query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Redirects as the request response. If the URL does not include a protocol, it will be converted into a complete URL. $request>redirect($url); [!!] No further processing can be done after this method is called! [update] $url = URL::site($url, TRUE, ! empty(Kohana::$index_file));
public function redirect($url = '', $code = 302) { $referrer = $this->uri(); if (strpos($referrer, '://') === FALSE) { $referrer = URL::site($referrer, TRUE, ! empty(Kohana::$index_file)); } if (strpos($url, '://') === FALSE) { // Make the URI into a URL $url = URL::site($url, TRUE, ! empty(Kohana::$index_file)); } if (($response = $this->response()) === NULL) { $response = $this->create_response(); } echo $response->status($code) ->headers('Location', $url) ->headers('Referer', $referrer) ->send_headers() ->body(); // Stop execution exit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function redirect() {\n\n\t\t// @todo. How to handle https?\n\t\t$domain = 'http://'.$_SERVER['HTTP_HOST'];\n\t\t$data = $this->EE->shortee->get_url($domain,$this->EE->input->get('url',true));\n\n\t\tif(!$data) {\n\t\t\t$loc = $this->EE->config->item('site_url');\n\t\t} else {\n\t\t\t$loc = $data['url'];\n\t\t\t$this->EE->shortee->log_view($data['id'],$_SERVER['REMOTE_ADDR']);\n\t\t}\n\n\t\theader(\"Location: \".$loc, true, 302);\n\t\texit;\n\t}", "public function sendRedirect() {}", "public function redirect();", "public function redirect();", "public function redirect();", "abstract protected function redirect();", "protected abstract function redirect(Response $response);", "public function redirect($redirectUrl);", "public function redirectToUrl(UrlRequest $urlRequest): void\n {\n if ($this -> getBrowserDetect()) {\n // render javascript page to get/fetch browser info that sends\n // client info to this api for this url and then redirects\n\n Core\\BrowserDetect::render($this -> getUrl(), $urlRequest -> getGuid());\n\n // do tracker magic\n Core\\UrlTracker::track($urlRequest);\n\n //\n } else {\n if (!headers_sent()) {\n\n // start the forced redirect\n header('Connection: close');\n ob_start();\n header('Content-Length: 0');\n header(\"Location: {$this -> getUrl()}\");\n ob_end_flush();\n flush();\n // end the forced redirect and continue with this script process\n\n ignore_user_abort(true);\n\n // do tracker magic\n Core\\UrlTracker::track($urlRequest);\n\n //\n } else {\n\n // fallback script\n echo '<script type=\"text/javascript\">';\n echo ' window.location.href=\"' . $this -> getUrl() . '\";';\n echo '</script>';\n echo '<noscript>';\n echo ' <meta http-equiv=\"refresh\" content=\"0;url=' . $this -> getUrl() . '\" />';\n echo '</noscript>';\n }\n }\n exit();\n }", "public function redirectAction()\n {\n $params = array('key' => $_GET['url']);\n $records = $this->getCollection(self::MONGO_COLLECTION)->find($params);\n\n if ($records->hasNext()) {\n $record = $records->getNext();\n $this->set('redirectTo', $record['target']);\n header('Location: ' . $record['target']);\n } else {\n $this->set('redirectTo', 'http://' . $_SERVER['SERVER_NAME']);\n header('Location: ' . 'http://' . $_SERVER['SERVER_NAME']);\n }\n }", "public static function go(): RedirectResponse\n {\n return \\redirect(\\route('home'), 307, [\n 'Cache-Control' => 'no-cache, must-revalidate',\n ]);\n }", "function redirect($url) {\n\tResponder::redirect($url);\n}", "public function redirect(string $url, $status_code = 302);", "public function doRedirect() {\n if(is_null($this->redirect)) {\n return;\n }\n\n if(is_string($this->redirect)) {\n $this->setHeader(\"Location: \" . $this->redirect);\n }\n\n if(is_array($this->redirect)) {\n $url = '/?' . http_build_query($this->redirect);\n $this->setHeader(\"Location: \" . $url);\n }\n return;\n }", "function redirect()\n {\n global $wgOut;\n $wgOut->redirect( $this->getRedirectLink(), 302);\n }", "private static function redirect()\n {\n $files = ['Redirector', 'Redirect'];\n $folder = static::$root.'Http/Redirect'.'/';\n\n self::call($files, $folder);\n }", "protected function followRedirect()\n\t\t{\n\t\t\tif (!$this->followRedirect)\n\t\t\t\treturn false; /* disabled */\n\t\t\tif (!isset($this->responseHeaders['Location']) || !is_string($this->responseHeaders['Location'])) {\n\t\t\t\tSERIA_Base::debug('HTTP protocol violation: No location header with response code: '.$this->responseCode);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$redirectPoint = $this->url;\n\t\t\t$location = $this->responseHeaders['Location'];\n\n\t\t\tif(strpos($location, '://')===false)\n\t\t\t{ // handling illegal redirects (Location: /path)\n\t\t\t\t$pi = parse_url($this->url);\n\t\t\t\t$location = $pi['scheme'].'://'.$pi['host'].$location;\n\t\t\t}\n\n\t\t\tif ($this->responseCode == 301 || $this->responseCode == 307) {\n\t\t\t\t/*\n\t\t\t\t * Check whether this is a post request:\n\t\t\t\t */\n\t\t\t\tif (isset($this->currentRequest['postFields']) && $this->currentRequest['postFields'])\n\t\t\t\t\t$post = $this->currentRequest['postFields'];\n\t\t\t\telse {\n\t\t\t\t\tif (isset($this->currentRequest['postFiles']) && $this->currentRequest['postFiles'])\n\t\t\t\t\t\t$post = true;\n\t\t\t\t\telse\n\t\t\t\t\t\t$post = false;\n\t\t\t\t}\n\t\t\t\tif (isset($this->currentRequest['postFiles']) && $this->currentRequest['postFiles'])\n\t\t\t\t\t$postFiles = $this->currentRequest['postFiles'];\n\t\t\t\telse\n\t\t\t\t\t$postFiles = array();\n\t\t\t} else {\n\t\t\t\t$post = false;\n\t\t\t\t$postFiles = array();\n\t\t\t}\n\t\t\t$connectToHost = false;\n\t\t\t$port = false;\n\t\t\t$from = parse_url($redirectPoint);\n\t\t\t$to = parse_url($location);\n\t\t\tif ($from['scheme'] == $to['scheme'] && $from['host'] == $to['host'] && $from['port'] == $to['port']) {\n\t\t\t\tif (isset($this->currentRequest['connectToHost']))\n\t\t\t\t\t$connectToHost = $this->currentRequest['connectToHost'];\n\t\t\t\t$port = $this->currentRequest['port'];\n\t\t\t}\n\t\t\t$this->navigateTo($location, $post, $connectToHost, $port);\n\t\t\tforeach ($postFiles as $name => $file)\n\t\t\t\t$this->postFile($name, $file);\n\t\t\tif ($this->responseCode == 301)\n\t\t\t\t$this->movedPermanently[$redirectPoint] = $location;\n\t\t\treturn true;\n\t\t}", "public function redirect($url){\r\n header(\"location:$url\");\r\n }", "public static function redirect($url)\n {\n return header('Location: '. App::$base_url .$url);\n }", "protected function _redirect($url)\n {\n if ($this->getUseAbsoluteUri() && !preg_match('#^(https?|ftp)://#', $url)) {\n $host = (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:'');\n $proto = (isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!==\"off\") ? 'https' : 'http';\n $port = (isset($_SERVER['SERVER_PORT'])?$_SERVER['SERVER_PORT']:80);\n $uri = $proto . '://' . $host;\n if ((('http' == $proto) && (80 != $port)) || (('https' == $proto) && (443 != $port))) {\n // do not append if HTTP_HOST already contains port\n if (strrchr($host, ':') === false) {\n $uri .= ':' . $port;\n }\n }\n $url = $uri . '/' . ltrim($url, '/');\n }\n $this->_redirectUrl = $url;\n $this->getResponse()->setRedirect($url, $this->getCode());\n }", "abstract protected function redirectTo();", "public static function redirect($url = 'index')\n {\n header(\"location: {$url}\");\n }", "public function redirect(){\r\n\t}", "public function redirect($url) {\n header('Location: ' . $url);\n }", "public function redirectToSelf() {\n\n\t\t$protocol = (! empty ( $_SERVER ['HTTPS'] ) && $_SERVER ['HTTPS'] !== 'off' || $_SERVER ['SERVER_PORT'] == 443) ? 'https://' : 'http://';\n\t\theader ( 'Location: ' . $protocol . $_SERVER [\"HTTP_HOST\"] . $_SERVER [\"REQUEST_URI\"] );\n\t\texit ( \"Redirection: This should never be displayed\" );\n\t\n\t}", "public function redirector()\n\t{\n\t\treturn \\Redirect::to(\\Input::get('url'));\n\t}", "public static function rendirect($url){\n\t \n\t\t header(\"Location: {$url}\");\n exit;\n\t}", "public function redirect($url){\n header(\"Location: $url\");\n }", "public function redirect(string $url)\n {\n return exit(header('Location:'. $url));\n }", "public function redirect($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function redirect($url){\n header(\"Location: /$url\");\n header(\"Connection: close\");\n exit;\n }", "public static function redirect ($url)\r\n {\r\n header(\"Location: $url\");\r\n exit;\r\n }", "public static function redirect($url){\n\t\theader($url);\n\t\tdie();\n\t}", "public function redirectTo();", "public function RedirectURL(){\n //echo Director::baseURL();exit(); \n return urlencode(Director::baseURL().$this->request->getURL(true));\n }", "public function __invoke(): RedirectResponse\n {\n return Socialite::driver('github')->redirect();\n }", "function _redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "public function redirect($url)\n {\n header(\"Location: $url\");\n }", "function _redirect($url) {\n\theader(\"HTTP/1.1 301 Moved Permanently\");\n\tdheader(\"location: \".str_replace('&amp;', '&', $url));\n\tdexit();\n}", "public function redirect($url) {\r\n ob_start();\r\n header('Location: '. $url);\r\n ob_end_flush();\r\n die();\r\n }", "static function redirect($url){\n header( 'Location: '.$url ) ;\n\n }", "public function redirect($url)\n {\n ob_get_clean();\n header('Location: '.$url);\n exit();\n }", "public function sslRedirect()\n {\n if (!$this->isSecure()) {\n $redirect = 'https://' . $this->server['HTTP_HOST'] . $this->server['REQUEST_URI'];\n\n header('HTTP/1.1 301 Moved Permanently');\n header('Location: ' . $redirect);\n exit();\n }\n }", "public function mustRedirect();", "public function redirect($url)\n {\n header(\"Location: $url\");\n exit;\n }", "public static function redirect($url)\n {\n header('Location: ' . Config::PROTOKOL . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "protected function processRedirect() {}", "public function redirect()\n {\n return Socialite::driver('twitter')->redirect();\n }", "public static function redirect($url) {\n\n header(\"Location: \" . $url);\n }", "static function redirect($url, $arguments = array())\n {\n if (substr($url, 0, 1) == '@')\n {\n global $router;\n $url = $router->generate(substr($url, 1), $arguments);\n }\n\n header(\"location: $url\");\n die();\n }", "public function redirect($url)\n {\n header('location: ' . $url);\n exit;\n }", "public static function redirectTo($url) {\n header(\"Location: $url\");\n exit;\n }", "public function redirect() : RedirectResponse\n {\n return new RedirectResponse($this->authUrl);\n }", "public static function redirect($url)\n {\n header('location: ' . $url);\n }", "public function redirect() {\n\t\tif ( is_404() ) {\n\t\t\t$redirects = $this->get_rewrite_rules();\n\t\t\t$matched_rule = false;\n\t\t\t$request = $this->get_request();\n\t\t\tforeach ( (array) $redirects as $match => $query ) {\n\t\t\t\tif ( preg_match(\"#^$match#\", $request, $matches) ||\n\t\t\t\t\tpreg_match(\"#^$match#\", urldecode($request), $matches) ) {\n\n\t\t\t\t\t// Got a match.\n\t\t\t\t\t$matched_rule = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( $matched_rule ) {\n\t\t\t\t$query = preg_replace(\"!^.+\\?!\", '', $query);\n\t\t\t\t$redirect = addslashes(WP_MatchesMapRegex::apply($query, $matches));\n\t\t\t\tif ( $redirect ) {\n\t\t\t\t\twp_redirect( $this->clean_url( home_url( \"?$redirect\" ) ), 301 );\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function redirect($url)\r\n {\r\n header(\"Location: /$url\"); \r\n header(\"Connection: close\");\r\n exit;\r\n }", "protected function redirect($url) {\n header('Location: ' . $url);\n }", "public function doRedirect()\n {\n $response = $this->response->asJson()->getResponse();\n $responseToArray = json_decode($response, true);\n\n if ($responseToArray['status']) {\n $url = $responseToArray['data']['authorization_url'];\n\n return redirect()->away($url);\n } else {\n Throw new \\Exception('An error occurred, could not get authorization url. ' . $response);\n }\n\n }", "static public function redirect(string $url)\n {\n header(\"location: $url\");\n exit;\n }", "function redirect() {\n //header('Location: ' . $this->url_origin($_SERVER, false)); \n exit(0);\n}", "public static function _redirect($url, $code = 303) {\n self::response(false)\n ->status($code)\n ->header('Location', $url)\n ->write($url)\n ->send();\n }", "protected function redirect($url) {\n header(\"Location: $url\");\n die();\n }", "public function testAssertRedirect(): void\n {\n $this->_response = new Response();\n $this->_response = $this->_response->withHeader('Location', 'http://localhost/get/tasks/index');\n\n $this->assertRedirect();\n $this->assertRedirect('/get/tasks/index');\n $this->assertRedirect(['controller' => 'Tasks', 'action' => 'index']);\n\n $this->assertResponseEmpty();\n }", "protected function redirect($url)\n\t{\n\t\t$this->_redirect = $url;\n\t\t$this->_flow = PAGE_FLOW_REDIRECT;\n\t}", "public static function redirect($url){\n\t\t\tif(headers_sent())\n\t\t\t\tdie('Cannot redirect to <a href=\"'.self::snohtml($url).'\">'.self::snohtml($url).'</a>; headers have already been sent.');\n\t\t\t$host=parse_url($url,PHP_URL_HOST);\n\t\t\t$goodhost=($_SERVER['SERVER_NAME']==$host)||($host=='');\n\t\t\tif(!$goodhost)\n\t\t\t\tdie('Cannot redirect to <a href=\"'.self::snohtml($url).'\">'.self::snohtml($url).'</a>; untrusted host.');\n\t\t\theader('Location: '.$url);\n\t\t\tdie;\n\t\t}", "public function redirect() {\n return Socialite::driver('google')->redirect();\n }", "public function redirect($url) {\r\n\t\theader('Location: ' . HTMLROOT . $url);\r\n\t\tdie();\r\n\t}", "public function redirect(string $url) {\r\n\t\t\theader(\"location: $url\");\r\n\t\t\tdie();\r\n\t\t}", "public static function redirect($url, $base = SELF_URL){\r\n header('Location: '.self::getAbsoluteURL($url, $base));\r\n\t\texit;\r\n\t}", "function redirect($url, $exit = true, $rfc2616 = false)\n {\n if (headers_sent()) {\n return false;\n }\n\n $url = HTTP::absoluteURI($url);\n header('Location: '. $url);\n\n if ($rfc2616 && isset($_SERVER['REQUEST_METHOD'])\n && $_SERVER['REQUEST_METHOD'] != 'HEAD') {\n echo '\n<p>Redirecting to: <a href=\"'.str_replace('\"', '%22', $url).'\">'\n .htmlspecialchars($url).'</a>.</p>\n<script type=\"text/javascript\">\n//<![CDATA[\nif (location.replace == null) {\n location.replace = location.assign;\n}\nlocation.replace(\"'.str_replace('\"', '\\\\\"', $url).'\");\n// ]]>\n</script>';\n }\n if ($exit) {\n exit;\n }\n return true;\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect($url)\n\t{\n\t\theader(\"Location: $url\");\n\t}", "public function redirect()\n {\n return Socialite::driver('google')->redirect();\n }", "function redirect($url)\n\t{\n\t\treturn header(\"Location:\". BASEURL . $url);\n\t}", "public function redirect($url = '', $code = 302)\n\t{\n\t\tif (strpos($url, '://') === FALSE)\n\t\t{\n\t\t\t// Make the URI into a URL\n\t\t\t$url = URL::site($url, TRUE);\n\t\t}\n\n\t\t// Set the response status\n\t\t$this->status = $code;\n\n\t\t// Set the location header\n\t\t$this->headers['Location'] = $url;\n\n\t\t// Send headers\n\t\t$this->send_headers();\n\n\t\t// Stop execution\n\t\texit;\n\t}", "function redirect($url, $statusCode = 303) {\n\tif (headers_sent()) {\n\t\tob_start();\n\t\tinclude(ABSPATH . 'templates/redirect.php');\n\t\techo ob_get_clean();\n\t} else {\n\t\theader('Location: ' . $url, true, $statusCode);\n\t}\n\tdie();\n}", "public function go($url)\r\n {\r\n header('Location: '.$url);\r\n }", "public function redirect()\n {\n return Socialite::driver('google')->redirect();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n return redirect('/callback');\n }", "public function redirect($url)\n {\n if (strpos($url, '://') === false) //relative URL\n {\n $url = BASE_URL.$url;\n }\n \n header('Location: '.$url); //redirect\n exit;\n }", "function caSetRedirect($ps_url) {\n\t\tglobal $g_response;\n\t\tif(!($g_response instanceof ResponseHTTP)) { return false; }\n\n\t\t$g_response->setRedirect($ps_url);\n\t\treturn true;\n\t}", "public static function redirect($url){\n header('Location: '.$url);\n die(\"Redirecting to page <a href='\".$url.\"'>\".$url.\"</a>\");\n }", "function redirect($location = ''){\n $this->_redirect = true;\n $this->_redirect_location = $location;\n $this->_HTML = false;\n $this->_JSON = false;\n }", "public function redirect($url)\n {\n header('Location: http://' . $_SERVER['HTTP_HOST'] . $url, true, 303);\n exit;\n }", "public function generateRedirectResponse();", "public function redirect($url) {\n\t\tif (headers_sent() OR $this->performed == TRUE) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Cannot modify header information - headers already sent.\");\n\t\t}\n\t\t$this->performed = TRUE;\n\t\theader(\"Location: \".$url);\n\t\texit();\n\t}", "public function gotoSource(){\n if(!empty($this->website)){\n header(\"Location: \". $this->website);\n }\n else{\n header(\"Location: \". $this->getUri());\n }\n die();\n }", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirect($url = null)\n {\n if ($url <> null) {\n header(\"Location: {$url}\");\n exit(0);\n }\n }", "function redirect($url) {\n ob_start();\n header('Location: '.$url);\n ob_end_flush();\n die();\n }", "protected function redirect($url) {\n if (headers_sent()) {\n // If contents already output, use javascript to redirect instead.\n echo '<script>window.location.href=\"' . $url . '\";</script>';\n }\n else {\n // Redirect using PHP.\n header('Location: ' . $url);\n }\n\n $this->exitAfterHook();\n }", "public function handle_redirection()\n {\n }", "public static function redirect($url)\n {\n $response = new self(null, 302);\n $response->headers->set('Location', $url);\n\n return $response;\n }", "function redirect() {\n\n\t\tif ($this->redirectUrl) {\n\t\t\tif ($this->message) {\n\t\t\t\tKenedoPlatform::p()->sendSystemMessage($this->message, $this->messageType);\n\t\t\t}\n\t\t\tKenedoPlatform::p()->redirect($this->redirectUrl);\n\t\t}\n\n\t}", "public function redirect(): void\n {\n $this->admin->redirect($this->redirect, $this->redirectCode);\n }", "public function setRedirectUrl($url);", "public static function redirect(string $url)\n {\n header(\"Location: $url\");\n exit();\n }" ]
[ "0.74402606", "0.7185414", "0.7152131", "0.7152131", "0.7152131", "0.7072317", "0.7044566", "0.6950612", "0.69283485", "0.6918125", "0.6911351", "0.67593473", "0.6732821", "0.66978455", "0.66676384", "0.6643857", "0.66306186", "0.6622568", "0.6597113", "0.6577779", "0.6572729", "0.6567625", "0.65500504", "0.6535498", "0.6533894", "0.65307873", "0.650861", "0.6507748", "0.6488877", "0.64865744", "0.6484199", "0.64470357", "0.6445944", "0.64300203", "0.6416225", "0.640718", "0.6406209", "0.6399484", "0.6399484", "0.6399484", "0.63968444", "0.6389916", "0.6371781", "0.6358993", "0.6354254", "0.63334256", "0.6330663", "0.632839", "0.6326365", "0.6319108", "0.6318052", "0.6312993", "0.631249", "0.63105774", "0.63075703", "0.6300591", "0.6300557", "0.6299484", "0.6290765", "0.6286537", "0.62857556", "0.628416", "0.62813354", "0.6274841", "0.62697506", "0.6268659", "0.62648064", "0.6260951", "0.6251378", "0.6250567", "0.62430036", "0.6242341", "0.6239978", "0.6239978", "0.62390184", "0.62341046", "0.6208604", "0.62014395", "0.6198386", "0.61951005", "0.6192393", "0.6189057", "0.61886066", "0.6186462", "0.6171745", "0.6170802", "0.61701775", "0.6165049", "0.61629874", "0.61614335", "0.6160743", "0.6157995", "0.61486655", "0.61425436", "0.61414313", "0.6139643", "0.6135149", "0.61101997", "0.61060417", "0.6100479" ]
0.68295795
11
presmerovani na pozadovanou stranku
public static function redirect_initial($url = '', $code = 302) { self::initial()->redirect($url, $code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AggiornaPrezzi(){\n\t}", "public function podrskaPotvrdjeno(){\n $this->prikaz('podrskaPotvrdjeno' , []);\n }", "public function valorpasaje();", "public function uputstvo()\n {\n $this->prikaz(\"uputstvo\", []);\n }", "function _JsemNaRade($posta_id, $prac = 0) {\r\n if (is_array($posta_id)) $posta_id = $posta_id[0];\r\n $pid = split(',',$posta_id);\r\n $posta_id = $pid[0];\r\n $sql = 'select * from posta_schvalovani where posta_id=' . $posta_id . ' and schvaleno=0 and stornovano is null order by id asc';\r\n $q = new DB_POSTA;\r\n $q->query($sql); \r\n $q->Next_Record();\r\n if ($q->Record['POSTUP'] == 2 || ($q->Record['POSTUP'] == 1 && $q->Record['SCHVALUJICI_ID'] == $prac)) return true;\r\n else return false; \r\n}", "abstract public function getPasiekimai();", "public function masodik()\n {\n }", "public function ispisiOsobu(){\n // echo \"$this->ime $this->prezime $this->godRdoj\";\n echo \"<br>Ime: \" . $this->getIme() . \"<br>Prezime: \" . $this->getPrezime() . \"<br>Godina rodjenja: \" . $this->getGodRodj() . \"<br>\";\n }", "public function isplata($iznos){\n\n $stanjesalimitom=$this->stanje+$this->limit;\n\n if($iznos<=$stanjesalimitom){\n // $novostanje=$stanjesalimitom-$iznos;\n //echo \"Vas iznos je isplacen<br>\";\n // echo \"Novo stanje na racunu je: \".$novostanje;\n if($iznos>$this->stanje){\n // ovde je kontrolno logika ako klijent ulazi u minus\n $zaduzenje=$iznos-$this->stanje;\n $this->limit-=$zaduzenje;\n $this->stanje=0;\n echo \"Vas iznos je isplacen<br>\";\n echo \"Usli ste u dozvoljeni minus, Vas limit iznosi jos: \".$this->limit;\n\n }else{\n // ako trazi manji iznos od stanja koje ima na racunu\n $this->stanje-=$iznos;\n echo \"Vas iznos je isplacen, novo stanje je: \".$this->stanje;\n }\n\n }else{\n echo \"Nemate dovoljno sredstava na racunu\";\n }\n\n\n\n}", "public function sortPredvidjanjePopularno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najpopularnija_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }", "public function sortPredvidjanjeNajteze() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najteza_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }", "private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }", "public function testKojiPreskacem()\n {\n $this->markTestSkipped(\"ovaj test je namjerno prekocen\");\n }", "public function pregledprofilapredvidjanja() {\n $data['user']=$this->session->get('korisnik');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_predvidjanja_po_korisnickom_imenu($data['user']->Username);\n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('profilkorisnikpredvidjanja', $data);\n }", "function SuoritaLisaysToimet(){\n /*Otetaan puuhaId piilotetustaKentasta*/\n $puuhaid = $_POST['puuha_id'];\n \n /* Hae puuhan tiedot */\n $puuha = Puuhat::EtsiPuuha($puuhaid);\n $suositus=luoSuositus($puuhaid,null);\n \n /*Tarkistetaan oliko suosituksessa virheita*/\n if(OlioOnVirheeton($suositus)){\n LisaaSuositus($suositus,$puuhaid);\n header('Location: puuhanTiedotK.php?puuhanid=' . $puuhaid . '.php');\n } else {\n $virheet = $suositus->getVirheet();\n naytaNakymaSuosituksenKirjoitusSivulle($puuha, $suositus, $virheet, \"Lisays\");\n }\n}", "public function pasaje_abonado();", "function ahoj($priezvisko)\n {\n echo \"Nazdar<br>\".$priezvisko;\n echo \"<br><br>\";\n }", "public function Zapis_vsechny_kolize_v_zaveru_formulare ($pole, $idcka_skolizi, $iducast, $formular){\r\n //zapise kolize formulare \r\n self::Zapis_kolize_formulare($pole,$idcka_skolizi, $iducast, $formular);\r\n //-----------------------------------------------------------------------------\r\n \r\n \r\n //a zjisti a zapise kolize ucastnika pro vsechny formulare \r\n $vsechny_kolize_ucastnika_pole = self::Najdi_kolize_vsechny($iducast);\r\n //echo \"<br>**Vsechny kolize_pole v Zapis_vsechny_kolize..... **\";\r\n //var_dump($vsechny_kolize_ucastnika_pole);\r\n \r\n //znevalidneni vsech kolizi pro ucastnika \r\n self::Znevalidni_kolize_ucastnika_vsechny($iducast);\r\n foreach($vsechny_kolize_ucastnika_pole as $jedna_kolize){\r\n if ($jedna_kolize->kolize_nastala) {\r\n $jedna_kolize->Zapis_jednu_kolizi();\r\n } \r\n }\r\n \r\n}", "public function hapus_toko(){\n\t}", "public function sortPredvidjanjeNovo() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_najnovija_predvidjanja(); \n $data['predvidjanja']=$predvidjanja;\n $this->prikaz('pregled_predvidjanja', $data); \n }", "public function boleta()\n\t{\n\t\t//\n\t}", "function sobre_planeacion($minimoMes,$maximoMes,$vigencia,$unidades,$tipo_usuario)\n\t\t{\n\t\t\t//$tipo_usuario ALMACENA EL TIPO DE USUARIO( I O E), EN UN ARRAY, ESTE SE CARGA EN LA PAGINA DE PLANEACION DE PROYECTOS (upHTplaneacionProy.PHP)\t\n//echo $unidades[0].\" - $minimoMes - $maximoMes - $vigencia ********************** <br><br>\";\n\t\t?>\n\n<?\t\t\n\t\t$ban_reg=0; //PERMITE IDENTIFICAR, SI SE ENCONTRO ALMENOS, UN USUARIO SOBRE PLANEADO, DE NO SER ASI, NO SE ENVIA EL CORREO\n\t\t$pTema ='<table width=\"100%\" border=\"0\">\n\t\t <tr class=\"Estilo2\" >\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td width=\"5%\" >Asunto:</td>\n\t\t\t<td >Sobre planeaci&oacute;n de participantes.</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t \n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\">Los siguientes participantes, tienen una dedicaci&oacute;n superior a 1 en los siguientes proyectos:</td>\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t\n\t\t </tr>\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td>&nbsp;</td>\n\t\t\t<td>&nbsp;</td>\n\t\t\n\t\t </tr>\n\t\t\n\t\t <tr class=\"Estilo2\">\n\t\t\t<td colspan=\"2\" >\n\t\t\t\t<table width=\"100%\" border=\"1\" >\n\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td colspan=\"5\"></td>\n\t\t\t\t\t<td colspan=\"'.(($maximoMes-$minimoMes)+1).'\" align=\"center\" >'.$vigencia.'</td>\n\t\t\t\t </tr>\t\t\t\t\n\t\t\t\t\n\t\t\t\t <tr class=\"Estilo2\">\n\t\t\t\t\t<td>Unidad</td>\n\t\t\t\t\t<td>Nombre</td>\n\t\t\t\t\t<td>Departamento</td>\n\t\t\t\t\t<td>Divisi&oacute;n</td>\n\t\t\t\t\t<td>Proyecto</td>';\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t$vMeses= array(\"\",\"Ene\",\"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"); \n\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t{\n\n\t\t\t\t\t $pTema = $pTema.'<td>'.$vMeses[$m].' </td>';\n\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t $pTema = $pTema.' </tr>';\n\t\t\t\t$cur_tipo_usu=0; //CURSOR DEL ARRAY, DEL TIPO DE USUARIO \n\t\t\t\tforeach($unidades as $unid)\n\t\t\t\t{\n//tipo_usuario\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"I\")\t\n\t\t\t\t\t{\n\t\t\t\t\t//CONSULTA SI EL USUARIO ESTA SOBREPLANEADO EN ALMENOS, UN MES DURANTE LA VIGENCIA\n\n\t\t\t\t\t//COSNULTA PARA LOS USUARIOS INTERNOS\n\t\t\t\t\t\t\t$sql_planea_usu=\"select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, Usuarios.nombre, \n\t\t\t\t\t\t\t\t\t\t\tUsuarios.apellidos ,Divisiones.nombre as div,Departamentos.nombre as dep\n\t\t\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t\t inner join Usuarios on PlaneacionProyectos.unidad=Usuarios.unidad \n\t\t\t\t\t\t\t\t\t\t\t inner join Departamentos on Departamentos.id_departamento=Usuarios.id_departamento \n\t\t\t\t\t\t\t\t\t\t\t inner join Divisiones on Divisiones.id_division=Departamentos.id_division \n\t\t\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \"; \n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\t\t//PlaneacionProyectos.id_proyecto,\t\t\t\t\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\t\t\tand esInterno='I'\n\t\t\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,Usuarios.nombre, Usuarios.apellidos,Divisiones.nombre ,Departamentos.nombre \n\t\t\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \";\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif($tipo_usuario[$cur_tipo_usu]==\"E\")\t\n\t\t\t\t\t{\n\t\t\t\t\t\t//COSNULTA PARA LOS USUARIOS EXTERNOS\n\t\t\t\t\t\t$sql_planea_usu=\" select top(1) SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.unidad ,mes \n\t\t\t\t\t\t\t\t\t--,PlaneacionProyectos.id_proyecto\n\t\t\t\t\t\t\t\t\t, PlaneacionProyectos.unidad, TrabajadoresExternos.nombre, \n\t\t\t\t\t\t\t\t\tTrabajadoresExternos.apellidos,'' div, ''dep\n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t inner join TrabajadoresExternos on PlaneacionProyectos.unidad=TrabajadoresExternos.consecutivo \n\t\t\t\t\t\t\t\t\t inner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\twhere vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\" \".$m.\",\";\n\n\t\t\t\t\t\t\t$sql_planea_usu=$sql_planea_usu.\"0) and PlaneacionProyectos.unidad=\".$unid.\" \n\t\t\t\t\t\t\t\t\tand esInterno='E'\n\t\t\t\t\t\t\t\t\tgroup by PlaneacionProyectos.unidad,mes,TrabajadoresExternos.nombre, TrabajadoresExternos.apellidos\n\t\t\t\t\t\t\t\t\tHAVING (SUM (hombresMes))>1 \t\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$cur_planea_usu=mssql_query($sql_planea_usu);\n//echo $sql_planea_usu.\" ---- <br>\".mssql_get_last_message().\" *** \".mssql_num_rows($cur_planea_usu).\"<br>\";\n\t\t\t\t\twhile($datos__planea_usu=mssql_fetch_array($cur_planea_usu))\n\t\t\t\t\t{\n\t\t\t\t\t\t$ban_reg=1; //SI ENCUENTRA ALMENOS UN USUARIO SOBREPLANEADO, ENVIA EL CORREO\n\t\t\t\t\n\t\t\t\t\t\t//CONSULTA LOS PROYECTOS, EN LOS CUALES EL PARTICIAPENTE HA SIDO PLANEADO, ESTO PARA PODER DOBUJAR LA TABLA DE FORMA CORRECTA\n\t\t\t\t\t\t$sql_uu=\" select distinct(id_proyecto),nombre,codigo,cargo_defecto from (select SUM (hombresMes) as total_hombre_mes ,unidad, mes,PlaneacionProyectos.id_proyecto ,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto \n\t\t\t\t\t\t\t\t\tfrom PlaneacionProyectos\n\t\t\t\t\t\t\t\t\t\tinner join Proyectos on PlaneacionProyectos.id_proyecto=Proyectos.id_proyecto \n\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and mes in( \";\n\t\t\t\t\n\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql_uu=$sql_uu.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]=0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql_uu=$sql_uu.\"0) and unidad in(\".$unid.\") and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by unidad, mes , PlaneacionProyectos.id_proyecto,Proyectos.nombre,Proyectos.codigo,Proyectos.cargo_defecto ) aa \";\n// HAVING (SUM (hombresMes)\t>1\t\n\t\t\t\t\t\t$cur_uu=mssql_query($sql_uu);\n\t\t\t\t\t\t$cant_proy=mssql_num_rows($cur_uu);\n//echo \"<br><BR>---//**************--------------\".$sql_uu.\" \".mssql_get_last_message().\"<br>\".$cant_proy.\"<br>\";\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t<?\n\t\t\t\t//echo $sql_proy_planea.\" ---- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\n\t\t\t\t\t\t$total_planeado= array();\n\t\t\t\t\t\t$cont=0;\n\t\t\t\t\t\twhile($datos_uu=mssql_fetch_array($cur_uu))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($cont==0)\n\t\t\t\t\t\t\t{\n\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\t\t\t\t\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \"> '.$datos__planea_usu[\"unidad\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'.$datos__planea_usu[\"apellidos\"].' '.$datos__planea_usu[\"nombre\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"dep\"].' </td>\n\t\t\t\t\t\t\t\t<td rowspan=\"'.$cant_proy.' \">'. $datos__planea_usu[\"div\"].' </td>';\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" >['.$datos_uu[\"codigo\"].'.'.$datos_uu[\"cargo_defecto\"].'] '. $datos_uu[\"nombre\"].' </td>';\n\n\t\t\t\t\t\t\t//CONSULTA LA INFORMACION DE LO PLANEADO EN CADA MES, DE ACUERDO AL PORYECTO CONSULTADO\n\t\t\t\t\t\t\t$sql_pro=\"select SUM (hombresMes) as total_hombre_mes ,PlaneacionProyectos.id_proyecto,PlaneacionProyectos.unidad,mes\n\t\t\t\t\t\t\t\t\t\t from PlaneacionProyectos \n\t\t\t\t\t\t\t\t\t\t where vigencia=\".$vigencia.\" and PlaneacionProyectos.unidad=\".$unid.\" and id_proyecto=\".$datos_uu[\"id_proyecto\"].\" and mes in(\";\n\t\t\t\t\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" \".$m.\",\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql_pro=$sql_pro.\" 0) and esInterno= '\".$tipo_usuario[$cur_tipo_usu].\"' group by PlaneacionProyectos.id_proyecto ,PlaneacionProyectos.unidad ,mes order by (mes) \";\n// HAVING (SUM (hombresMes))>1\n\t\t\t\t\t\t\t$cur_proy_planea=mssql_query($sql_pro);\n//\t\t\t\techo $sql_pro.\" --22222222222-- <br>\".mssql_get_last_message().\"<br><br>\";\n\t\t\t\t\t\t\t$m=$minimoMes;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\twhile($datos_proy_planea=mssql_fetch_array($cur_proy_planea))\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\tfor ($m;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif($datos_proy_planea[\"mes\"]==$m)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$total_planeado[$m]+=( (float) $datos_proy_planea[\"total_hombre_mes\"]);\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td class=\"Estilo2\" align=\"right\" >'.((float) $datos_proy_planea[\"total_hombre_mes\"] ).'</td>';\n\n\t\t\t\t\t\t\t\t\t\t$m=$datos_proy_planea[\"mes\"];\n\t\t\t\t\t\t\t\t\t\t$m++;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp; </td>';\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m--;\n\t\t\t\t\t\t\tfor ($m++;$m<=$maximoMes; $m++) \n\t\t\t\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\t\t\t\t $pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\t\t$cont++;\n\t\t\t\t\t\t\tunset($datos_proy_planea);\n\n\t\t\t\t\t\t\t $pTema = $pTema.' </tr>';\n\n\t\t\t\t//\t\t\techo $datos_proy_planea[\"total_hombre_mes\"].\"<br>\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t $pTema = $pTema.' <tr class=\"Estilo2\">\n\t\t\t\t\t\t<td colspan=\"4\" >&nbsp;</td>\n\n\t\t\t\t\t\t<td>Total planeaci&oacute;n</td>';\n\n\t\t\t\t\t\tfor ($m=$minimoMes; $m<=$maximoMes; $m++) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif($total_planeado[$m]==0)\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>&nbsp;</td>';\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$pTema = $pTema.'<td>'.$total_planeado[$m].'</td>';\n\t\t\t\t\t\t}\n \n\t\t\t\t\t $pTema = $pTema.' </tr>\n\t\t\t\t\t <tr >\n\t\t\t\t\t\t<td colspan=\"17\">&nbsp;</td>\n\t\t\t\t\t </tr>\t';\n\n\t\t\t\t\t}\n\t\t\t\t\t$cur_tipo_usu++;\n\t\t\t\t}\n\t\t\t\t$pTema = $pTema.'\n\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t </tr>\n\t\t<tr class=\"Estilo2\"><td colspan=\"2\" >Para consultar en detalle la planeaci&oacute;n de un participante, en un proyecto especifico, utilice el reporte Usuarios por proyecto, accediendo a el, atravez del boton Consolidados por divisi&oacute;n, ubicado en la parte superior de la pagina principal de la planeaci&oacute;n por proyectos. </td></tr>\n\t\t</table>';\n\n\t\t/*\n\t\t\t\t//consulta la unidad del director y el coordinador de proyecto\n\t\t\t\t$sql=\"SELECT id_director,id_coordinador FROM HojaDeTiempo.dbo.proyectos where id_proyecto = \" . $cualProyecto.\" \" ;\n\t\t\t\t$eCursorMsql=mssql_query($sql);\n\t\t\t\t$usu_correo= array(); //almacena la unidad de los usuarios a los que se le enviara el correo\n\t\t\t\t$i=1;\n\t\t\t\twhile($datos_dir_cor=mssql_fetch_array($eCursorMsql))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_coordinador\"];\n\t\t\t\t\t$i++;\n\t\t\t\t\t$usu_correo[$i]=$datos_dir_cor[\"id_director\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\n\t\t\t\t//consulta la unidad porgramadores y ordenadores de gasto\t\t\t\n\t\t//select unidad from HojaDeTiempo.dbo.Programadores where id_proyecto=\".$cualProyecto.\" union\n\t\t\t\t$sql_pro_orde=\" select unidadOrdenador from GestiondeInformacionDigital.dbo.OrdenadorGasto where id_proyecto=\".$cualProyecto;\n\t\t\t\t$cur_pro_orde=mssql_query($sql_pro_orde);\n\t\t\t\twhile($datos_pro_orde=mssql_fetch_array($cur_pro_orde))\n\t\t\t\t{\n\t\t\t\t\t$usu_correo[$i]=$datos_pro_orde[\"unidad\"];\n\t\t\t\t\t$i++;\n\t\t\t\t}\t\t\t\n\t\t\n\t\t\t\t$i=0;\n\t\t\t\t//consulta el correo de los usuarios(director,cordinador,ordenadroes de G, y programadores) asociados al proyecto\n\t\t\t\t$sql_usu=\" select email from HojaDeTiempo.dbo.Usuarios where unidad in(\";\n\t\t\t\tforeach($usu_correo as $unid)\n\t\t\t\t{\n\t\t\t\t\tif($i==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" \".$unid;\t\t\n\t\t\t\t\t\t$i=1;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$sql_usu=$sql_usu.\" ,\".$unid;\n\t\t\t\t}\n\t\t\t\t$sql_usu=$sql_usu.\") and retirado is null\";\n\t\t\t\t$cur_usu=mssql_query($sql_usu);\t\t\t\t\n\t\t\n\t\t\t\t//se envia el correo a el director, cordinador, orenadores de gasto, y programadores del proyecto\t\n\t\t\t\twhile($eRegMsql = mssql_fetch_array($cur_usu))\n\t\t\t\t{\t\t\n\t\t\t\t $miMailUsuarioEM = $eRegMsql[email] ;\n\t\t\t\n\t\t\t\t //***EnviarMailPEAR\t\n\t\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\n\t\t\t\n\t\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\n\t\t\t\n\t\t\t\t //***FIN EnviarMailPEAR\n\t\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t\n\t\t\t\t}\n\t\t*/\n\t\t\tif($ban_reg==1) //SEW ENVIA EL CORREO SI EXISTE ALMENOS UN USUARIO SOBREPLANEADO\n\t\t\t{\n\t\t///////////////////////////**********************************************************PARA QUITAR\n\t\t\t $miMailUsuarioEM = 'carlosmaguirre'; //$eRegMsql[email] ;\t\n\t\t\t\t$pAsunto='Sobre planeaci&oacute;n de proyectos';\n\t\t\t //***EnviarMailPEAR\t\n\t\t\t $pPara= trim($miMailUsuarioEM) . \"@ingetec.com.co\";\t\n\t\t\t enviarCorreo($pPara, $pAsunto, $pTema, $pFirma);\t\n\t\t\t //***FIN EnviarMailPEAR\n\t\t\t $miMailUsuarioEM = \"\";\n\t\t\t}\n\t\t\n\t\t?>\n\n<?\n}", "public function pregledtudjegpredv() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $trenprikaz='prikazprofpredv_admin'; \n $username=$this->request->uri->getSegment(3);\n $korisnikModel=new KorisnikModel();\n $data['user']=$korisnikModel->dohvati_korisnika($username);\n if(($data['user']->Username)==($this->session->get('korisnik')->Username)) {$data['user']=$this->session->get('korisnik'); $trenprikaz='profilkorisnikpredvidjanja'; }\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanja=$predvidjanjeModel->dohvati_predvidjanja_po_korisnickom_imenu($data['user']->Username);\n $data['predvidjanja']=$predvidjanja;\n $this->prikaz($trenprikaz, $data);\n }", "public static function posodobiKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n $kolicina = filter_input(INPUT_POST, \"num\", FILTER_SANITIZE_SPECIAL_CHARS);\n\n if ($kolicina < 1) {\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n } else {\n\n if (PodrobnostiNarocilaDB::edit($podrobnost_narocila[\"id_podrobnosti_narocila\"], $id_artikla, $kolicina, $narocilo[\"id\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }\n }", "private function Zapis_kolize_formulare($pole, $idcka_skolizi, $iducast, $formular) { \r\n//znevalidneni vsech kolizi pro ucastnika a tento formular\r\n self::Znevalidni_kolize_ucastnika_formulare($iducast, $formular); \r\n\r\n//zapis do uc_kolize_table pro kazdou nastalou s_kolizi\r\n foreach ($idcka_skolizi as $id_skolize) { //zapisovana policka jsou v $pole\r\n //echo \"policko: \" . $pole['uc_kolize_table§' . $id_skolize . '_revidovano'];\r\n $kolize = new Projektor2_Table_UcKolizeData ($iducast, (int)$id_skolize,\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano'],\r\n $pole['uc_kolize_table§' . $id_skolize . '_revidovano_pozn'],\r\n null, 1,\r\n null,null,null,null,null) ;\r\n // echo \"v Zapis_kolize_temp\" . var_dump ($kolize);\r\n $kolize->Zapis_jednu_kolizi(); //kdyz je v tabulce uc_kolize_table, tak prepsat, kdyz neni, tak insert\r\n }\r\n\r\n}", "public static function dodajArtikelVKosarico() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n // ce narocilo ze obstaja mu samo povecamo kolicino \n // drugace narocilo ustvarimo\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n\n if (!$narocilo) {\n\n $id_narocila = NarocilaDB::insert($id, $status);\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $id_narocila);\n\n } else {\n\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n if (!$podrobnost_narocila) {\n PodrobnostiNarocilaDB::insert($id_artikla, 1, $narocilo[\"id\"]);\n } else {\n PodrobnostiNarocilaDB::edit($id_artikla, $podrobnost_narocila[\"kolicina\"] + 1, $narocilo[\"id\"]); \n } \n }\n\n echo ViewHelper::redirect(BASE_URL);\n\n }", "public function valordelospasajesplus();", "public function pretragaIdeja(){\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $korisnik= $this->request->getVar(\"pretraga\");\n $ideje=$idejaModel->dohvati_ideje_po_korisnickom_imenu($korisnik);\n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data);\n }", "public function zahtev_za_prijavu()\n {\n if(!$this->validate(['uname'=>'required|min_length[5]|max_length[30]', 'pword'=>'required|min_length[8]|max_length[20]']))\n return $this->prijava($this->validator->getErrors());\n $pwordhash = hash(\"sha256\",$this->request->getVar('pword'));\n $km = new korisnikModel();\n $korisnici = $km->pretraga_kIme($this->request->getVar('uname'));\n if(count($korisnici)==1)\n {\n if($korisnici[0]->sifra==$pwordhash)\n {\n if($korisnici[0]->tipKorisnika<3)\n {\n $tipK = ['Administrator','Predstavnik','Kupac'];\n $sessiondata=['idK'=>$korisnici[0]->idKorisnik,\n 'tipK'=>$tipK[$korisnici[0]->tipKorisnika]];\n $this->session->set($sessiondata);\n }\n if($korisnici[0]->tipKorisnika==0) return redirect()->to(site_url('Administrator/index'));\n else if($korisnici[0]->tipKorisnika==1) return redirect()->to(site_url('Predstavnik/index'));\n else if($korisnici[0]->tipKorisnika==2) return redirect()->to(site_url('Kupac/index'));\n else return $this->prijava('Administrator jos uvek nije odobrio zahtev');\n }\n return $this->prijava('Sifra nije ispravna');\n }\n return $this->prijava('Korisnik sa tim imenom ne postoji');\n }", "public function nadar()\n {\n }", "public function jarjesta() {\n usort($this->ravinnon_saannit, \"self::vertaaPvm\");\n }", "function rp($nominal) {\n //mengupdate nominal menjadi string, takutnya yang dimasukkan bertipe data int (angka)\n //mengeset string kosong buat penampung nanti, dan counter $c = 0\n $nominal = strval($nominal); $r = ''; $c = 0;\n $nominal = explode('.', $nominal); //memisah jika terdapat titik, takutnya ada titik seperti 4000.00\n $nominal = $nominal[0]; //mengambil data index pertama sebelum titik, berarti mengambil 4000-nya\n $nominal = explode('-', $nominal); //jika ada tanda minus di depan, maka akan dipecah lagi berdasarkan tanda minus tsb\n if (sizeof($nominal)>1) { //jika ternyata array yang dihasilkan oleh pemecahan tanda minus berjumlah lebih dari 1, berarti angka tersebut memang minus\n $min = '-'; $nominal = $nominal[1]; //dilakukan pemisahan dengan index 0 nin dan nominalnya di array index 1\n } else {\n $min = ''; $nominal = $nominal[0]; //jika tidak, maka memang bukan angka minus dan $min diset string kosong agar tidak berpengaruh saat direturn\n }\n for ($x=strlen($nominal)-1; $x>=0; $x--) { //diulang sebanyak string tapi dari belakang\n $r = $nominal[$x].$r; $c++; //menambah string kosong $r dengan index nominal dari belakang sambil menambah counter ($c)\n //jika counter kelipatan 3, maka saatnya ditambahkan dengan titik\n //misalnya 10000000, maka tiap perulangan 3x dari belakang akan ditambah titik, sehingga menjadi 10.000.000\n if ($c%3==0 & $x>0) $r = \".\".$r;\n }\n //mereturn hasil tadi, dengan tanda minusnya, tetapi jika tidak minus makan tidak akan mengganggu, karena variabel $min diisi string kosong di atas\n //return ditambahkan dengan ,00 dibelakang dan tanda Rp di depan sehingga berformat Rp ##.###,00\n return 'Rp '.$min.$r.',00';\n}", "private function Zapis_jednu_kolizi() { \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n//echo \"<hr><br>* v Zapis_jednu_kolizi:\";\r\n\r\n //vyberu kolizi z uc_kolize_table pokud jiz existuje\r\n $query= \"SELECT * FROM uc_kolize_table WHERE id_ucastnik =\" . $this->id_ucastnik . \" and id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK ;\r\n //echo \"<br>*dotaz v Zapis_jednu_kolizi: \" . $query;\r\n $data = $dbh->prepare($query)->execute();\r\n //var_dump($data);\r\n \r\n if ($data) {\r\n $zaznam_kolize = $data->fetch() ; //vemu prvni (je predpoklad ze je jen jedna)\r\n if ($zaznam_kolize) {\r\n //echo \"<br>kolize je - budu prepisovat\"; //budu prepisovat\r\n $query1 = \"UPDATE uc_kolize_table set \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1 \" . \r\n \"WHERE id_uc_kolize_table =\" . $zaznam_kolize['id_uc_kolize_table'];\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute(); \r\n \r\n }\r\n else {\r\n //echo \"<br>kolize neni - budu vkladat\"; //budu vkladat\r\n $query1 = \"INSERT uc_kolize_table set \" . \r\n \"id_ucastnik= \" . $this->id_ucastnik . \", \" .\r\n \"id_s_typ_kolize_FK=\" . $this->id_s_typ_kolize_FK . \", \" .\r\n \"revidovano='\" . $this->revidovano . \"', \" .\r\n \"revidovano_pozn='\" . $this->revidovano_pozn . \"', \" .\r\n \"valid=1, date_vzniku=now() \" ;\r\n //echo \"<br>\" . $query1; \r\n $data1 = $dbh->prepare($query1)->execute();\r\n \r\n }\r\n } \r\n\r\n//echo \"<hr>\";\r\n}", "function lebih($slug) {\n\n\t\t/* ---- PREPARE VARIABLE ------*/\n\t\t$arr_slug\t\t= explode('_', $slug);\n\t\t$pegawai_result = $this->db->get_where('pegawai', array('id_pegawai' => $arr_slug[1]))->result();\n\t\t$pegawai \t\t= $pegawai_result['0']->nama_pegawai;\n\t\t$jabatan\t\t= $pegawai_result['0']->jabatan_pegawai;\n\t\t$nip \t\t= $pegawai_result['0']->nip_pegawai;\n\t\t$surat_result \t= $this->db->get_where('data_rinci', array('id_surat' => $arr_slug[0],\n\t\t\t'id_pegawai' => $arr_slug[1]))->result();\n\t\t$nomor \t\t\t= $surat_result['0']->nomor;\n\n\t\t//Get data rinci\n\t\t$data_rinci_all\t= $this->db->get_where('data_rinci',\n\t\t\tarray('id_surat' => $arr_slug[0], 'id_pegawai' => $arr_slug[1]))->result();\n\t\t$id_tiket = $data_rinci_all['0']->id_tiket;\n\t\t$id_transport2 = $data_rinci_all['0']->id_transport2;\n\t\t\t\n\t\t//get data uang tiket\n\t\tif ($id_tiket == 0) {\n\t\t\t$sbu_tiket = 0;\n\t\t\t$sbu_tiket_ena = $this->rupiah($sbu_tiket);\n\t\t\t$transport2 = $this->db->get_where('biaya_transport',array('id' => $id_transport2))->result();\n\t\t\t$rute = $transport2['0']->provinsi;\n\n\t\t} else {\n\t\t\t$tiket_result = $this->db->get_where('tiket_pesawat',array('id' => $id_tiket))->result();\n\t\t\t$sbu_tiket = $tiket_result['0']->biaya_tiket;\n\t\t\t$sbu_tiket_ena = $this->rupiah($sbu_tiket);\n\t\t\t$rute = $tiket_result['0']->rute;\n\t\t}\n\n\t\t//get real pengeluaran untuk tiket\n\t\t$r_tiket_result = $this->db->get_where('spd_rampung', array('id_surat' => $arr_slug[0], 'id_pegawai' => $arr_slug[1]))->result();\n\t\t$r_tiket = $r_tiket_result != NULL ? $r_tiket_result['0']->tiket : 0;\n\n\t\t$ppk \t\t\t= $this->db->get_where('pejabat_administratif',\n\t\t\tarray('jabatan' => 'Pejabat Pembuat Komitmen'))->result();\n\t\t$nama_ppk \t\t\t\t= $ppk['0']->nama;\n\t\t$nip_ppk \t\t\t\t= $ppk['0']->nip;\n\n\t\t$var_tgl_skrg = $this->tanggal_indo(date('Y').'-'.date('m').'-'.date('d'), '-');\n\t\t$var_tgl_surat \t= $this->tanggal_indo($surat_result['0']->tgl_surat,'/');\n\n\t\t/* -----------------------------*/\n\t\tif(empty($r_tiket_result)) {\n\t\t\techo \"<script> \t\n \talert('Anda belum mengisi SPD Rampung!');\n \twindow.location.href='\".base_url('C_PDF/print_biaya/').$arr_slug[0].\"';</script>\";\n\t\t}\n\n\t\tif($sbu_tiket<$r_tiket) {\n\t\t\t$pdf = new PDF_MC_Table('p','mm','A4');\n\t\t\t$pdf->AddPage();\n\t\t\t$pdf->SetFont('Arial','B',14);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->MultiCell(0,25,\"SURAT PERNYATAAN\",0,'C');\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(25,7,'',0,0);\n\t\t\t$pdf->MultiCell(0,6,\"Yang bertandatangan di bawah ini :\",0,'L');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'Nama',0,0);\n\t\t\t$pdf->Cell(10,7,':',0,0);\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(20,7,$pegawai,0,1);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(20,7,'NIP',0,0);\n\t\t\t$pdf->Cell(10,7,':',0,0);\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(20,7,$nip,0,1);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(20,7,'Jabatan',0,0);\n\t\t\t$pdf->Cell(10,7,':',0,0);\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(20,7,$jabatan,0,1);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(20,7,'Berdasarkan Surat Tugas Nomor:'.$nomor.' tanggal '.$var_tgl_surat.' dengan',0,1);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'sesungguhnya bahwa : input alasan lebih here',0,1);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'1. Tiket '.$rute.' (PP) dengan jumlah tiket pesawat di bawah ini melebihi dengan',0,1);\n\t\t\t$pdf->Cell(5,7,'',0,0);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'SBU tahun '.date('Y').', meliputi :',0,1);\n\t\t\t$pdf->Ln();\n\n\t\t\t//here is table\n\t\t\t$pdf->Cell(20,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(10,5,'No.',1,0,'C',0);\n\t\t\t$pdf->Cell(70,5,'Uraian',1,0,'C',0);\n\t\t\t$pdf->Cell(40,5,'Nilai SBU',1,0,'C',0);\n\t\t\t$pdf->Cell(40,5,'Pengeluaran Rill',1,0,'C',0);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(20,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','',12);\n\n\t\t\t$counterrr = 1;\n\t\t\t\t$pdf->SetWidths(array(10, 70, 40, 40));\n\t\t\t\tfor($i=0;$i<1;$i++) {\n\t\t\t\t\t$pdf->Row(array($counterrr,\"Tiket Pesawat \".$rute. \" (PP)\",\"Rp \".$sbu_tiket_ena, \"Rp \".number_format($r_tiket,2,',','.')));\n\t\t\t\t\t$counterrr++;\n\t\t\t\t}\n\t\t\t$pdf->Cell(20,7,'',0,0);\n\t\t\t$pdf->SetFont('Arial','B',12);\n\t\t\t$pdf->Cell(10,5,'','LB',0,'L',0);\n\t\t\t$pdf->Cell(70,5,'Jumlah','LRB',0,'C',0);\n\t\t\t$pdf->Cell(7,5,'Rp ','B',0,'L',0);\n\t\t\t$pdf->Cell(33,5,''.$sbu_tiket_ena,'RB',0,'L',0);\n\t\t\t$pdf->Cell(7,5,'Rp ','B',0,'L',0);\n\t\t\t$pdf->Cell(33,5,''.$sbu_tiket_ena,'RB',0,'L',0);\n\t\t\t$pdf->Ln();\n\t\t\t\n\t\t\t//end of table\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'2. Bahwa tiket '.$rute.' (PP) dengan jumlah uang tersebut pada angka (1)',0,1);\n\t\t\t$pdf->Cell(5,7,'',0,0);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'melebihi jumlah SBU dan benar - benar dikeluarkan dengan bukti rill kuitansi tiket',0,1);\n\t\t\t$pdf->Cell(5,7,'',0,0);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'Perjalanan Dinas dimaksud.',0,1);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(20,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'Demikian pernyataan ini kami buat dengan sebenarnya, untuk dipergunakan',0,1);\n\t\t\t$pdf->Cell(15,7,'',0,0);\n\t\t\t$pdf->Cell(20,7,'sebagaimana mestinya.',0,1);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t//Footer Surat\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(10,6,\"\",0,0,'L');\n\t\t\t$pdf->Cell(25,6,'',0,0,'L');\n\t\t\t$pdf->Cell(15,6,'',0,0,'L');\n\t\t\t$pdf->Cell(25,6,'',0,0,'R');\n\t\t\t$pdf->Cell(20,6,'',0,0,'C');\n\t\t\t$pdf->MultiCell(60,6,'Jakarta, '.$var_tgl_skrg,0,'R');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(18,6,'',0,0,'L');\n\t\t\t$pdf->MultiCell(55,6,'Mengetahui/Menyetujui',0,'R');\n\t\t\t$pdf->Cell(100,6,'Pejabat Pembuat Komitmen',0, 0,'C');\n\t\t\t$pdf->MultiCell(50,6,'Pelaksana SPD',0,'R');\n\t\t\t$pdf->Cell(100,6,' Pusat Data Informasi dan Humas',0, 0,'C');\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->SetFont('Arial','BU',12);\n\t\t\t$pdf->Ln();\n\t\t\t$pdf->Cell(100,6,$nama_ppk,0, 0,'C');\n\t\t\t$pdf->MultiCell(72.5,6,$pegawai,0,'C');\n\t\t\t$pdf->SetFont('Arial','',12);\n\t\t\t$pdf->Cell(100,6,\"NIP. \".$nip_ppk,0, 0,'C');\n\t\t\t$pdf->MultiCell(72.5,6,'NIP. '.$nip,0,'C');\n\n\t\t\t//Cetak gans\n\t\t\t$filename = \"Lebih - \".$arr_slug[0].\" - \".$pegawai.$this->extension;\n\t\t\t$pdf->setTitle($filename);\n\t\t\t$pdf->Output(\"I\", $filename);\n\t\t} else {\n\t\t\techo \"<script> \t\n \talert('Tidak bisa mencetak karena biaya tiket tidak lebih dari SBU!');\n \twindow.location.href='\".base_url('C_PDF/print_biaya/').$arr_slug[0].\"';</script>\";\n\t\t}\n\t}", "public function getMataPelajaran();", "function difundir() {\n\n // La funcion obtener_frase esta heredado del pariente Orador\n $frase = $this->obtener_frase();\n\n // Convirtir a mayusculos\n $frase_mayusculas = strtoupper($frase);\n\n echo $frase_mayusculas;\n\n }", "public function zpracuj($parametry)\n {\n $spravceHraci = new SpravceHraci();\n\n if (!empty($parametry)) {\n //ziskani clanku podle jeho url\n $clanek = $spravceHraci->vratClanekHrac($parametry[0]);\n\n //kdyz se clanek nenajde - presmerovani na chybovou stránku\n if (!$clanek) {\n $this->presmeruj('chyba');\n }\n\n $this->hlavicka = array(\n 'titulek' => $clanek['titulek'],\n 'popisek' => $clanek['popisek'],\n );\n\n $this->data['titulek'] = $clanek['titulek'];\n $this->data['obsah'] = $clanek['obsah'];\n //nastaveni sablony\n $this->pohled = 'clanek';\n } //když není zadána URl článku tak se vypíše seznam článků\n else {\n $clanky = $spravceHraci->vratClankyHrac();\n $this->data['clanky'] = $clanky;\n $this->pohled = 'proHrace';\n }\n }", "function hapusawalan1($kata){\n if(substr($kata,0,4)==\"meng\"){\n if(substr($kata,4,1)==\"e\"||substr($kata,4,1)==\"u\"){\n $kata = \"k\".substr($kata,4);\n }else{\n $kata = substr($kata,4);\n }\n }else if(substr($kata,0,4)==\"meny\"){\n $kata = \"ny\".substr($kata,4);\n }else if(substr($kata,0,3)==\"men\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,3)==\"mem\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"p\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,2)==\"me\"){\n $kata = substr($kata,2);\n }else if(substr($kata,0,4)==\"peng\"){\n if(substr($kata,4,1)==\"e\" || substr($kata,4,1)==\"a\"){\n $kata = \"k\".substr($kata,4);\n }else{\n $kata = substr($kata,4);\n }\n }else if(substr($kata,0,4)==\"peny\"){\n $kata = \"s\".substr($kata,4);\n }else if(substr($kata,0,3)==\"pen\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"t\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,3)==\"pem\"){\n if(substr($kata,3,1)==\"a\" || substr($kata,3,1)==\"i\" || substr($kata,3,1)==\"e\" || substr($kata,3,1)==\"u\" || substr($kata,3,1)==\"o\"){\n $kata = \"p\".substr($kata,3);\n }else{\n $kata = substr($kata,3);\n }\n }else if(substr($kata,0,2)==\"di\"){\n $kata = substr($kata,2);\n }else if(substr($kata,0,5)==\"keter\"){\n $kata = substr($kata,5);\n }else if(substr($kata,0,3)==\"ter\"){\n $kata = substr($kata,3);\n }else if(substr($kata,0,2)==\"ke\"){\n $kata = substr($kata,2);\n }\n return $kata;\n }", "function Uzasadnienie($dbh, $un, $ud, $up, $roszczenia, $no)\r\n\t\t\t{\r\n\t\t\t\t$uzasadnienie=\"Powodowie prowadzą działalność gospodarczą pod nazwą NETICO Spółka Cywilna M.Borodziuk, M.Pielorz, K.Rogacki. Powodowie dnia $ud zawarli z Pozwanym(ą) umowę abonencką nr $un o świadczenie usług telekomunikacyjnych.\\n Termin płatności został określony w Umowie do $up dnia danego miesiąca. \\n Za świadczone usługi w ramach prowadzonej przez siebie działalności gospodarczej Powodowie wystawili Pozwanemu(ej) następujące faktury VAT:\\n \";\r\n\t\t\t\t\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$suma=0;\r\n\t\t\t\tforeach ($roszczenia as $n => $v)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oznaczenie=$roszczenia[$n][\"oznaczenie\"];\r\n\t\t\t\t\t$kwota=$roszczenia[$n][\"wartosc\"];\r\n\t\t\t\t\t$pozostalo=$roszczenia[$n][\"pozostalo\"];\r\n\t\t\t\t\t$d=$n;\r\n\t\t\t\t $kwota=number_format(round($kwota,2), 2,',','');\r\n\t\t\t\t\tif ( $pozostalo>0)\r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t$suma+=$pozostalo;\r\n\t\t\t\t\t\t\t$pozostalo=number_format($pozostalo, 2,',','');\r\n\t\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł, pozostało do zapłaty $pozostalo zł. \\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/*\t\r\n\t\t\t\tif (!empty($no))\r\n\t\t\t\t{\r\n\t\t\t\t\t$uzasadnienie.=\"W zwiazku z nie regulowaniem przez Pozwanego(ą) płatności wynikających z warunków Umowy Powodowie rozwiązali Umowę i wystawili Pozwanemu(ej) następujące noty obciążaniowe: \";\r\n\t\t\t\t\t$n=1;\r\n\t\t\t\t\tforeach ($no as $n => $v)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oznaczenie=$no[$n][\"oznaczenie\"];\r\n\t\t\t\t\t\t$kwota=$no[$n][\"wartosc\"];\r\n\t\t\t\t\t\t$d=$n;\r\n\t\t\t\t\t\t$kwota=number_format($kwota,2), 2,',','');\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\t$suma=number_format(round($suma,2), 2,',','');\r\n\t\t\t\t$uzasadnienie.=\"Razem $suma zł.\\n\";\r\n\t\t\t\t$uzasadnienie.=\"Pomimo wezwań do zapłaty Pozwany(a) nie uregulował należności.\";\r\n\t\t\t\treturn($uzasadnienie);\r\n\t\t\t}", "function huruf($jenis, $papar)\n{\n \n switch ($jenis) \n {// mula - pilih $jenis\n case 'BESAR':\n $papar = strtoupper($papar);\n break;\n case 'kecil':\n $papar = strtolower($papar);\n break;\n case 'Depan':\n $papar = ucfrist($papar);\n break;\n case 'Besar_Depan':\n $papar = mb_convert_case($papar, MB_CASE_TITLE);\n break;\n }// tamat - pilih $jenis\n \n return $papar;\n}", "function prn_wejscie() {\n global $Cuzytkownik,$db, $_GLOBAL, $L;\n \n $DD[] = \"IT_AKTYWACJA\";\n \n $query = \"select * from \" . dn('kontrahent') . \" where ko_id=\" . $Cuzytkownik->get_id() . \";\";\n $res = $db->query($query);\n $dane= $db->fetch($res);\n $A['{PANELTITLE}'] = $dane['ko_nazwa'];\n \n // <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/uzytkownik/dlaciebie/\"><div>' . $L['{T_SPECJALNIE_DLA_CIEBIE}'] . '</div></a></div>\n $A['{PANELMENU}'] = '<div class=\"steps\">\n <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/uzytkownik/rabat/\"><div>' . $L['{T_TWOJ_RABAT}'] . '</div></a></div>\n <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/uzytkownik/obserwowane/\"><div>' . $L['{T_OBSERWOWANE}'] . '</div></a></div>\n <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/uzytkownik/dane/\"><div>' . $L['{T_MOJE_DANE}'] . '</div></a></div>\n <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/zamowienie/\"><div>' . $L['{T_HISTORIA_ZAMOWIEN}'] . '</div></a></div>\n <div class=\"panelmenu\"><a href=\"' . $_GLOBAL['page_url'] . $_GLOBAL['lang'] . '/koszyk/\"><div>' . $L['{T_PRZEJDZ_DO_KOSZYKA}'] . '</div></a></div>\n </div>';\n\n $query = \"select * from \" . dn('cms') . \" where st_id=72;\";\n $res = $db->query($query);\n $dane= $db->fetch($res);\n \n if ($_GLOBAL['langid'] == 2) {\n $A['{PANELCONTENTSTART}'] = str_replace('\\\"','\"',$dane['st_tresc_en']);\n } else {\n $A['{PANELCONTENTSTART}'] = str_replace('\\\"','\"',$dane['st_tresc']); \n }\n \n return get_template(\"user_enter\",$A,$DD);\n }", "public function getOdmitnuteClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'odmítnuto'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }", "function spd($slug) {\n\t\t$arr_slug\t\t= explode('_', $slug);\n\t\t$pegawai_result = $this->db->get_where('pegawai', array('id_pegawai' => $arr_slug[1]))->result();\n\t\t$pegawai \t\t= $pegawai_result['0']->nama_pegawai;\n\t\t$jabatan\t\t= $pegawai_result['0']->jabatan_pegawai;\n\t\t$golongan \t\t= $pegawai_result['0']->golongan_pegawai;\n\t\t$surat_result \t= $this->db->get_where('data_rinci', array('id_surat' => $arr_slug[0],\n\t\t\t'id_pegawai' => $arr_slug[1]))->result();\n\t\t$nomor \t\t\t= $surat_result['0']->nomor;\n\t\t$kegiatan \t\t= $surat_result['0']->kegiatan;\n\n\t\t//Get data rinci\n\t\t$data_rinci_all\t= $this->db->get_where('data_rinci',\n\t\t\tarray('id_surat' => $arr_slug[0], 'id_pegawai' => $arr_slug[1]))->result();\n\t\t$jenis = $data_rinci_all['0']->jenis;\n\t\t$id_harian = $data_rinci_all['0']->id_harian;\n\t\t$id_penginapan = $data_rinci_all['0']->id_penginapan;\n\t\t$id_transport = $data_rinci_all['0']->id_transport;\n\t\t$id_transport2 = $data_rinci_all['0']->id_transport2;\n\t\t$id_tiket = $data_rinci_all['0']->id_tiket;\n\n\t\t//get data uang harian\n\t\t$harian_result\t= $this->db->get_where('uang_harian',array('id' => $id_harian))->result();\n\t\t$harian = $harian_result['0']->luar_kota;\n\t\t//get data uang penginapan\n\t\t$penginapan_result\t= $this->db->get_where('biaya_penginapan',array('id' => $id_penginapan))->result();\n\t\t$sbu_penginapan = $penginapan_result['0']->eselon_4;\n\n\t\t//get data uang tiket\n\t\t//handler tiket\n\t\tif ($id_tiket == 0) {\n\t\t\t$sbu_tiket = 0;\n\t\t\t$transport1 = $this->db->get_where('biaya_transport',array('id' => $id_transport))->result();\n\t\t\t$berangkat = $transport1['0']->provinsi;\n\t\t\t$transport2 = $this->db->get_where('biaya_transport',array('id' => $id_transport2))->result();\n\t\t\t$tujuan = $transport2['0']->provinsi;\n\t\t\t$angkutan = 'Darat';\n\n\t\t} else {\n\t\t\t//get data tiket pesawat\n\t\t\t$tiket_result = $this->db->get_where('tiket_pesawat',array('id' => $id_tiket))->result();\n\t\t\t$tiket = $tiket_result['0']->biaya_tiket;\n\t\t\t$sbu_tiket = $tiket_result['0']->biaya_tiket;\n\t\t\t$rute = $tiket_result['0']->rute;\n\t\t\t$rute_arr = explode('-', $rute);\n\t\t\t$berangkat = $rute_arr[0];\n\t\t\t$tujuan = $rute_arr[1];\n\t\t\t$angkutan = 'Udara dan Darat';\n\t\t}\n\n\t\t//get data uang transport\n\t\t$transport_result\t= $this->db->get_where('biaya_transport',array('id' => $id_transport))->result();\n\t\t$transport = $transport_result['0']->besaran;\n\n\n\t\t$ppk \t\t\t= $this->db->get_where('pejabat_administratif',\n\t\t\tarray('jabatan' => 'Pejabat Pembuat Komitmen'))->result();\n\n\t\t$nama_ppk \t\t\t\t= $ppk['0']->nama;\n\t\t$nip_ppk \t\t\t\t= $ppk['0']->nip;\n\n\t\t$var_tgl_mulai \t= $this->tanggal_indo($surat_result['0']->tgl_mulai, '-');\n\t\t$var_tgl_akhir \t= $this->tanggal_indo($surat_result['0']->tgl_akhir, '-');\n\t\t$var_tgl_surat \t= $this->tanggal_indo($surat_result['0']->tgl_surat,'/');\n\t\t$jumlah_hari\t= $this->hitung_hari($surat_result['0']->tgl_mulai, $surat_result['0']->tgl_akhir)+1;\n\n\t\t$var_tgl_rampung = $this->db->get_where('spd_rampung',\n\t\t\tarray('id_surat' => $arr_slug[0], 'id_pegawai' => $arr_slug[1]))->result();\n\t\t$var_tgl_rampung = $var_tgl_rampung != NULL ? $this->tanggal_indo($var_tgl_rampung['0']->tgl,'/') : 0;\n\n\t\tif (empty($var_tgl_rampung)) {\n\t\t\techo \"<script> \t\n \talert('Anda harus mengisi SPD Rampung dulu!');\n \twindow.location.href='\".base_url('C_PDF/print_biaya/').$arr_slug[0].\"';</script>\";\n\t\t}\n\t\t$pdf = new FPDF('p','mm','A4');\n\t\t$pdf->AddPage();\n\t\t$pdf->SetFont('Arial','B',8);\n\t\t$pdf->Cell(150,3,'BADAN NASIONAL PENANGGULANGAN BENCANA',0,0,'L');\n\t\t$pdf->SetFont('Arial','',7);\n\t\t$pdf->Cell(25,3,'Lembar ke : ',0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(150,3,'Jl. Pramuka Kav. 38 - Jakarta Timur 13120',0,0,'L');\n\t\t$pdf->Cell(25,3,'Kode No. : '.$nomor,0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(150,3,'',0,0,'L');\n\t\t$pdf->Cell(25,3,'Nomor : ',0,0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->SetFont('Arial','BU',12);\n\t\t$pdf->Cell(0,10,'SURAT PERINTAH DINAS',0,1,'C');\n\t\t//this is the table\n\t\t$pdf->Cell(10,7,'',0,0);\n\t\t$pdf->SetFont('Arial','',8);\n\t\t$pdf->Cell(10,5,'1.','LT',0,'C',0);\n\t\t$pdf->Cell(70,5,'Pejabat Pembuat Komitmen','LTR',0,'L',0);\n\t\t$pdf->Cell(90,5,'Pusat Data Informasi dan Humas','TR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'2.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'Nama Pegawai yang','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,$pegawai,'R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'diperintahkan','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'3.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'a. Pangkat dan golongan','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'a. '.$golongan,'R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'b. Jabatan / Instansi','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'b. ','R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'c. Tingkat biaya perjalanan dinas','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'c. C','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'4','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'Maksud perjalanan Dinas','LR',0,'L',0);\n\t\t$pdf->MultiCell(90,5,'Melakukan kegiatan '.$kegiatan,'LR','L');\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'5','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'Alat angkutan yang dipergunakan','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5, $angkutan,'BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'6.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'a. Tempat berangkat','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'a. Jakarta' ,'R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'b. Tempat tujuan','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'b.'.$tujuan,'BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'7.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'a. Lamanya perjalanan Dinas','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'a. '. $jumlah_hari .' ('. $this->terbilang($jumlah_hari) .') Hari','R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'b. Tanggal berangkat','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'b. '.$var_tgl_mulai,'R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'c. Tanggal harus kembali /','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'c. '.$var_tgl_akhir,'R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,' Tiba di tempat baru','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'8.','L',0,'C',0);\n\t\t$pdf->Cell(25,5,'Pengikut :','L',0,'L',0);\n\t\t$pdf->Cell(45,5,'Nama','R',0,'L',0);\n\t\t$pdf->Cell(50,5,'Tanggal Lahir','R',0,'C',0);\n\t\t$pdf->Cell(40,5,'Keterangan','R',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(25,5,'1.','L',0,'C',0);\n\t\t$pdf->Cell(45,5,'','R',0,'L',0);\n\t\t$pdf->Cell(50,5,'','R',0,'C',0);\n\t\t$pdf->Cell(40,5,'','R',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(25,5,'2.','L',0,'C',0);\n\t\t$pdf->Cell(45,5,'','R',0,'L',0);\n\t\t$pdf->Cell(50,5,'','R',0,'C',0);\n\t\t$pdf->Cell(40,5,'','R',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(25,5,'3.','L',0,'C',0);\n\t\t$pdf->Cell(45,5,'','R',0,'L',0);\n\t\t$pdf->Cell(50,5,'','R',0,'C',0);\n\t\t$pdf->Cell(40,5,'','R',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(25,5,'4.','L',0,'C',0);\n\t\t$pdf->Cell(45,5,'','R',0,'L',0);\n\t\t$pdf->Cell(50,5,'','R',0,'C',0);\n\t\t$pdf->Cell(40,5,'','R',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(25,5,'5.','LB',0,'C',0);\n\t\t$pdf->Cell(45,5,'','RB',0,'L',0);\n\t\t$pdf->Cell(50,5,'','RB',0,'C',0);\n\t\t$pdf->Cell(40,5,'','RB',0,'C',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'9.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'Pembebanan anggaran :','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'a. Instansi','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'a. BADAN NASIONAL PENANGGULANGAN BENCANA','R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'b. Mata Anggaran','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'b. 524111','BR',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n $pdf->Cell(10,5,'10.','L',0,'C',0);\n\t\t$pdf->Cell(70,5,'Pejabat Pembuat Komitmen','LR',0,'L',0);\n\t\t$pdf->Cell(90,5,'Pusat Data Informasi dan Humas','R',0,'L',0);\n $pdf->Ln();\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(10,5,'','LB',0,'C',0);\n\t\t$pdf->Cell(70,5,'','LBR',0,'L',0);\n\t\t$pdf->Cell(90,5,'','BR',0,'L',0);\n $pdf->Ln();\n //end of table\n $pdf->Cell(10,7,'',0,0);\n\t\t$pdf->Cell(70,6,'Coret yang tidak perlu',0,0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(112,7,'',0,0);\n\t\t$pdf->Cell(30,5,'Dikeluarkan di :',0,0,'L');\n\t\t$pdf->Cell(20,5,'Jakarta',0,0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->SetFont('Arial','',8);\n\t\t$pdf->Cell(112,7,'',0,0);\n\t\t$pdf->Cell(30,5,'Pada tanggal :','B',0,'L');\n\t\t$pdf->Cell(20,5,$var_tgl_rampung,'B',0,'L');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(116.5,7,'',0,0);\n\t\t$pdf->Cell(40,4,'Pejabat Pembuat Komitmen',0,0,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Cell(116.5,7,'',0,0);\n\t\t$pdf->Cell(40,4,'Pusat Data Informasi dan Humas',0,0,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->Ln();\n\t\t$pdf->SetFont('Arial','U',8);\n\t\t$pdf->Cell(116.5,6,'',0,0);\n\t\t$pdf->Cell(40,4,$nama_ppk,0,0,'C');\n\t\t$pdf->Ln();\n\t\t$pdf->SetFont('Arial','',8);\n\t\t$pdf->Cell(116.5,6,'',0,0);\n\t\t$pdf->Cell(40,4,'NIP. '.$nip_ppk,0,0,'C');\n\n\t\t//Cetak gans\n\t\t$filename = \"Surat Perintah Dinas - \".$arr_slug[0].\" - \".$pegawai.$this->extension;\n\t\t$pdf->setTitle($filename);\n\t\t$pdf->Output(\"I\", $filename);\n\t}", "public static function Najdi_kolize_pro_formular_dosud_nezavolane ($iducast, $formular, $pole_id_volanych ) {\r\n $query= \"SELECT * FROM s_typ_kolize WHERE formular='\" . $formular . \"' and valid\" ;\r\n $kolize_pole = self::Najdi_kolize ($query,$iducast) ; //to jsou vsechny pro formular\r\n \r\n //ty, co uz volal, z pole vypustit\r\n $kolize_pole_redukovane = array();\r\n \r\n foreach ($kolize_pole as $kprvek) {\r\n if ( in_array( $kprvek->id_s_typ_kolize_FK, $pole_id_volanych) ) {\r\n }\r\n else {\r\n array_push ($kolize_pole_redukovane, $kprvek ); //$kprvek->id_s_typ_kolize_FK);\r\n } \r\n }\r\n \r\n return $kolize_pole_redukovane; \r\n}", "public function extra_voor_verp()\n\t{\n\t}", "function secenjeVrstaPolja($line)\n{ \n \n \n $tacka=strpos($line, ':');// trazi lokaciju tacke\n \n if($tacka>7){ // ako je tacka na 7 mestu primenjuje secenje do prve ;\n $s=substr($line, 0, strpos($line, ';'));\n }else{ \n $s= substr($line, 0, strpos($line, ':'));\n } \n return $s;\n}", "function cariPosisi($batas){\nif(empty($_GET['halpengumuman'])){\n\t$posisi=0;\n\t$_GET['halpengumuman']=1;\n}\nelse{\n\t$posisi = ($_GET['halpengumuman']-1) * $batas;\n}\nreturn $posisi;\n}", "public function sortIdejaPopularno() {\n $data['kor_ime']=$this->session->get('kor_tip');\n $idejaModel=new IdejaModel();\n $ideje=$idejaModel->dohvati_najpopularnije_ideje(); \n $data['ideje']=$ideje;\n $this->prikaz('pregled_ideja', $data);\n }", "function ler($nome) {\n $x = 1;\n\t while($x < $this->bd[0][0] && !$this->str_igual($nome, $this->bd[$x][2])) {$x++;}\n if($x >= $this->bd[0][0]) {return 0;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\nreturn 1;\n }", "function getAllFromProizvod(){\n\t\treturn $this->ime . \"&nbsp\" . $this->imeProizvođača . \"&nbsp\" \n\t\t. $this->prezimeProizvođača . \"&nbsp\" . $this->cijena;\n\t}", "public static function parler()\n {\n echo 'Je suis un personnage <br/>';\n }", "function stan_lacznika($stan,$nr_rups)\n{\t\n\tif($stan==1 && $nr_rups==1) // zamkniety dla rups1\n\t{\n\t\t$wspolrzedna=230;\t\n\t}\n\telseif($stan==0 && $nr_rups==1) // otwarty dla rups1\n\t{\n\t\t$wspolrzedna=220;\n\t}\t\n\telseif($stan==1 && $nr_rups==2) // zamkniety dla rups2\n\t{\n\t\t$wspolrzedna=460;\t\n\t}\n\telseif($stan==0 && $nr_rups==2) // otwarty dla rups2\n\t{\n\t\t$wspolrzedna=450;\n\t}\t\n\telseif($stan==1 && $nr_rups==3.1) // zamkniety dla rups3\n\t{\n\t\t$wspolrzedna=690;\t\n\t}\n\telseif($stan==0 && $nr_rups==3.1) // otwarty dla rups3\n\t{\n\t\t$wspolrzedna=680;\n\t}\n\telseif($stan==1 && $nr_rups==3.2) // zamkniety dla rups3\n\t{\n\t\t$wspolrzedna=710;\t\n\t}\n\telseif($stan==0 && $nr_rups==3.2) // otwarty dla rups3\n\t{\n\t\t$wspolrzedna=700;\n\t}\n\telseif($stan==1 && $nr_rups==4) // zamkniety dla rups4\n\t{\n\t\t$wspolrzedna=940;\t\n\t}\n\telseif($stan==0 && $nr_rups==4) // otwarty dla rups4\n\t{\n\t\t$wspolrzedna=930;\n\t}\n\telseif($stan==1 && $nr_rups==8) // zamkniety dla rups8\n\t{\n\t\t$wspolrzedna=1170;\t\n\t}\n\telseif($stan==0 && $nr_rups==8) // otwarty dla rups8\n\t{\n\t\t$wspolrzedna=1160;\n\t}\t\n\telseif($stan==1 && $nr_rups==9.1) // zamkniety dla rups9.1\n\t{\n\t\t$wspolrzedna=1415;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.1) // otwarty dla rups9.1\n\t{\n\t\t$wspolrzedna=1405;\n\t}\n\telseif($stan==1 && $nr_rups==9.2) // zamkniety dla rups9.2\n\t{\n\t\t$wspolrzedna=1435;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.2) // otwarty dla rups9.2\n\t{\n\t\t$wspolrzedna=1425;\n\t}\t\t\n\telseif($stan==1 && $nr_rups==9.3) // zamkniety dla rups9.3\n\t{\n\t\t$wspolrzedna=1455;\t\n\t}\n\telseif($stan==0 && $nr_rups==9.3) // otwarty dla rups9.3\n\t{\n\t\t$wspolrzedna=1445;\n\t}\t\n\t\n\treturn $wspolrzedna;\n}", "function dividirPalabraEnLetras($palabra){\n \n /*>>> Completar para generar la estructura de datos b) indicada en el enunciado. \n recuerde que los string pueden ser recorridos como los arreglos. <<<*/\n \n}", "public function obtenerViajesplusAbonados();", "public function getVRizeniClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'v recenzním řízení'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }", "public function obtenerViajesplus();", "function cariPosisi($batas){\nif(empty($_GET['halpengajar'])){\n\t$posisi=0;\n\t$_GET['halpengajar']=1;\n}\nelse{\n\t$posisi = ($_GET['halpengajar']-1) * $batas;\n}\nreturn $posisi;\n}", "function SprWymiar($macierz){\n\t\t\t$wymiar=1;\n\t\t\twhile(isset($macierz[$wymiar][1])){\n\t\t\t\t$wymiar++;\n\t\t\t}\n\t\t\treturn $wymiar-1; \n\t\t}", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "public static function Znevalidni_kolize_ucastnika_vsechny($iducast) {\r\n//echo \"<hr><br>*Znevalidnuji vsechny kolize ucastnika , formular=\" . $formular;\r\n \r\n $dbh = Projektor2_AppContext::getDB();\r\n\r\n //vyberu vsechny ulozene kolize z tabulky uc_kolize_table\r\n $query= \"SELECT * FROM uc_kolize_table \" .\r\n \"WHERE id_ucastnik=\" . $iducast . \" and uc_kolize_table.valid\" ;\r\n\r\n //echo \"<br>*dotaz na kolize v Znevalidni_kolize_ucastnika: \" . $query;\r\n \r\n $sth = $dbh->prepare($query);\r\n $succ = $sth->execute(); \r\n while($zaznam_kolize = $sth->fetch(PDO::FETCH_ASSOC)) {\r\n //echo \"<br>*Znevalidnuji kolizi: \" . $zaznam_kolize[id_uc_kolize_table];\r\n \r\n $query1 = \"UPDATE uc_kolize_table SET \" .\r\n \"valid=0 WHERE uc_kolize_table.id_uc_kolize_table=\" . $zaznam_kolize['id_uc_kolize_table'] ;\r\n $data1= $dbh->prepare($query1)->execute(); \r\n }\r\n \r\n//echo \"<hr>\";\r\n}", "function Hasil_pencarian($cek,$tempprodi) {\n\t\t\n\t\t//D_TIMAJAR2013 (KD_KELAS, KD_DOSEN)\n\t\t\n\t\t$hp = $this->db->query(\"SELECT DISTINCT B.KD_DOSEN, B.NM_DOSEN, B.NM_DOSEN_F FROM SIA.V_KELAS A, SIA.V_DOSEN B, SIA.D_TIMAJAR2013 C WHERE A.KD_KELAS = C.KD_KELAS AND C.KD_DOSEN = B.KD_DOSEN AND (UPPER(B.NM_DOSEN) LIKE (UPPER ('%\".$cek.\"%')) OR B.KD_DOSEN LIKE '%\".$cek.\"%') AND (A.KD_PRODI IN ('\".$tempprodi.\"'))\")->result_array();\n\t\t\n\t\t\n\t\t/* $out_kd_prodi = $this->db->query(\"SELECT DISTINCT D.KD_PRODI FROM SIA.V_KELAS D, SIA.D_TIMAJAR2013 E WHERE D.KD_KELAS = E.KD_KELAS(+) AND E.KD_DOSEN = '\".$cek.\"'\")->result_array();\n\t\tif(!empty($out_kd_prodi)){\n\t\t\tfor($i=0; $i<count($out_kd_prodi); $i++){\n\t\t\t\tif($i==0) $kd_prodi_b[0] = $out_kd_prodi[$i]['KD_PRODI'];\n\t\t\t\t$kd_prodi_b[0] .= \"','\".$out_kd_prodi[$i]['KD_PRODI'];\n\t\t\t}\n\t\t}else{\n\t\t\t$kd_prodi_b[0] = '';\n\t\t}\n\t\t$hp = $this->db->query(\"SELECT DISTINCT B.KD_DOSEN, B.KD_PRODI, B.NM_DOSEN\n\t\t\t\t\t\t\t\t\tFROM SIA.V_KELAS A, SIA.V_DOSEN B, SIA.D_TIMAJAR2013 C \n\t\t\t\t\t\t\t\t\tWHERE A.KD_KELAS = C.KD_KELAS AND C.KD_DOSEN = B.KD_DOSEN AND (UPPER(B.NM_DOSEN) LIKE (UPPER ('%$cek%')) OR B.KD_DOSEN = '\".$cek.\"') AND (A.KD_PRODI IN ('$tempprodi') OR A.KD_PRODI IN ('\".$kd_prodi_b[0].\"'))\")->result_array(); */\n\t\treturn $hp;\n }", "public function oceniPredvidjanje()\n {\n $korisnik= $this->session->get(\"korisnik\");\n $predvidjanjeId= $this->request->uri->getSegment(3);\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanje= $predvidjanjeModel->dohvati_predvidjanja_id($predvidjanjeId); \n $ocena=$_POST[$predvidjanjeId];//pretpostavljam da ce tako biti najlakse dohvatiti, slovbodno promeniti\n $oceniModel=new DajeOcenuModel();\n \n if ($oceniModel->vec_dao_ocenu($korisnik->IdK, $predvidjanje->IdP) || date(\"Y-m-d H:i:s\")>$predvidjanje->DatumEvaluacije)\n {\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }\n else\n {\n \n \n $predvidjanjeModel->daje_ocenu($predvidjanje->IdP, $ocena);\n $posl_id=$oceniModel->poslednji_vestackiId();\n $oceniModel->daje_ocenu($korisnik->IdK, $predvidjanje->IdP, $ocena, $posl_id+1);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }", "function rekamMedis($nomor_pasien)\n\t{\n\n\t}", "function perolehan_medali($arr){\n // Kode kamu di sini\n}", "public function v_pesbaru()\r\n\t\t{\r\n\t\t\t$sql = \"SELECT a.id_permintaan,a.nota_minta,a.tgl_minta,b.nm_bagian,a.ket_minta,a.selesai_minta FROM tbl_permintaan as a join tbl_bagian as b on a.id_bagian=b.id_bagian where a.selesai_minta != 'Y' order by a.tgl_minta asc\";\r\n\t\t\t$data = $this->db->query($sql);\r\n\t\t\treturn $data->result();\r\n\t\t}", "function uprav_pretek ($NAZOV, $DATUM, $DEADLINE,$POZNAMKA){\r\n if(!$this->ID){\r\n return false;\r\n }\r\n $NAZOV2 = htmlentities($NAZOV, ENT_QUOTES, 'UTF-8');\r\n $reg_exUrl = \"/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/\";\r\n $text = $POZNAMKA;\r\n\r\n if(preg_match($reg_exUrl, $text, $url) && !strpos($text, \"</a>\") && !strpos($text, \"</A>\") && !strpos($text, \"HREF\") && !strpos($text, \"href\")) {\r\n\r\n // make the urls hyper links\r\n $text = preg_replace($reg_exUrl, \"<a href=\".$url[0].\">{$url[0]}</a> \", $text);\r\n\r\n}\r\n\r\n $POZNAMKA2 = htmlentities($text, ENT_QUOTES, 'UTF-8');\r\n $db = napoj_db();\r\n $sql =<<<EOF\r\n UPDATE PRETEKY set NAZOV = \"$NAZOV2\" where ID=\"$this->ID\";\r\n UPDATE PRETEKY set DATUM = \"$DATUM\" where ID=\"$this->ID\";\r\n UPDATE PRETEKY set DEADLINE = \"$DEADLINE\" where ID=\"$this->ID\";\r\n UPDATE PRETEKY set POZNAMKA = \"$POZNAMKA2\" where ID=\"$this->ID\";\r\n DELETE FROM KATEGORIE_PRE_$this->ID;\r\nEOF;\r\n $ret = $db->exec($sql);\r\n if(!$ret){\r\n echo $db->lastErrorMsg();\r\n } else {\r\n \r\n }\r\n $db->close();\r\n }", "public function odgovoriNaPitanje($idPitanje = null) {\n $controller = session()->get('controller');\n\n if ($idPitanje == null) {\n return redirect()->to(site_url(\"$controller/\"));\n }\n\n // ako je nepostojeci id treba vratiti korisnika na pocetnu stranu\n $pitanjeModel = new PitanjeModel();\n $pitanje = $pitanjeModel->find($idPitanje);\n if ($pitanje == null) {\n return redirect()->to(site_url(\"$controller/\"));\n }\n\n // koje sve poruke mogu da se prikazu korisniku\n $porukaTekstOdgovora = null;\n $porukaNemaPravaDaOdgovori = null;\n\n // provera da li je unet tekst odgovora posto je obavezno polje\n if (!$this->validate(['TekstOdgovora' => 'required'])) {\n $porukaTekstOdgovora = \"Morate da unesete tekst odgovora - to je obavezno polje!\";\n }\n\n // provera da li korisnik ima pravo da odgovori na izabrano pitanje\n // ako korisnik nije psiholog a na pitanje smeju samo psiholozi da odgovore potrebno je ispisati poruku korisniku\n $pitanjeModel = new PitanjeModel();\n $pitanje = $pitanjeModel->find($idPitanje);\n $moguSviDaOdgovore = $pitanje->moguSviDaOdgovore;\n $korisnikModel = new KorisnikModel();\n $idKategorijaKorisnika = $korisnikModel->find(session()->get('userid'))->tipKorisnika_idTipKorisnika;\n // psiholozi su idKategorijaKorisnika=2 \n if ($moguSviDaOdgovore == 0 && $idKategorijaKorisnika != 2) {\n $porukaNemaPravaDaOdgovori = \"Na ovo pitanje imaju pravo samo registrovani psiholozi da odgovore!\";\n }\n\n // ako nije unet tekst odgovora ili korisnik nema prava da odgovori ispisati mu poruke, odbacuje se unos odgovora\n if ($porukaTekstOdgovora != null || $porukaNemaPravaDaOdgovori != null) {\n echo view(\"odgovori_na_pitanje\", ['pitanje' => $pitanje, 'porukaTekstOdgovora' => $porukaTekstOdgovora, 'porukaNemaPravaDaOdgovori' => $porukaNemaPravaDaOdgovori]);\n return;\n }\n\n $odgovorModel = new OdgovorModel();\n $anonimno = $this->request->getVar('anonimus');\n $odgovorModel->save([\n 'pitanje_idPitanje' => $idPitanje,\n 'korisnik_idKorisnik_odgovorio' => session()->get('userid'),\n 'tekstOdgovora' => $this->request->getVar('TekstOdgovora'),\n 'odgovorenoAnonimno' => $anonimno == \"1\" ? true : false\n ]);\n\n $controller = session()->get('controller');\n // kada se sacuva odgovor na pitanje, redirect korisnika na prikaz svih odgovora na to pitanje\n return redirect()->to(site_url(\"$controller/pregledOdgovora?pretraga=$idPitanje\"));\n }", "public static function odstraniArtikelIzKosarice() {\n $id = $_SESSION[\"uporabnik_id\"];\n $uporabnik = UporabnikiDB::get($id);\n\n $id_artikla = filter_input(INPUT_POST, \"id\", FILTER_SANITIZE_SPECIAL_CHARS);\n $status = \"kosarica\";\n\n $narocilo = NarocilaDB::getByUporabnikId($id, $status);\n $podrobnost_narocila = PodrobnostiNarocilaDB::getByNarociloAndArtikel($narocilo[\"id\"], $id_artikla);\n\n\n if (PodrobnostiNarocilaDB::delete($podrobnost_narocila[\"id_podrobnosti_narocila\"])) {\n echo ViewHelper::redirect(BASE_URL . \"kosarica\");\n } else {\n echo(\"Napaka\");\n }\n }", "public function nahrajObrazkyVyhledavac($textHledani){\t\t\t\n\t\t\t$dotaz = \"SELECT obrazekID,filepath,tabObrazky.uzivatelID,uzivatelJmeno FROM tabObrazky \n\t\t\t\t\tJOIN tabUzivatele ON tabUzivatele.uzivatelID = tabObrazky.uzivatelID WHERE filepath LIKE \".'\"%' . $textHledani.'%\"';\n\t\t\t\n\t\t\t\t//echo \"X \".$dotaz .\" X\";\n\t\t\t\n\t\t\t$vysledek = mysqli_query($this -> pripojeni,$dotaz);\n\t\t\t$vratit = array();\n\t\t\t\n\t\t\tif($vysledek == false){\n\t\t\t\techo(\"During data upload an error occured!\" . mysqli_error($this->pripojeni) );\n\t\t\t}\n\t\telse{\n\t\t\t//case result is mysqli_result\n\t\t\t$pole = $vysledek->fetch_all(MYSQLI_ASSOC);\n\t\t\tforeach($pole as $radek ){\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\tforeach($radek as $x => $x_value) {\n\t\t\t\t\techo \"Key=\" . $x . \", Value=\" . $x_value;\n\t\t\t\t\techo \"<br>\";\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t$obrazekID = $radek[\"obrazekID\"];\n\t\t\t\t$filePath = $radek[\"filepath\"];\n\t\t\t\t$uzivatelID = $radek[\"uzivatelID\"];\n\t\t\t\t$jmenoUzivateleCoNahral = $radek[\"uzivatelJmeno\"];\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\techo $obrazekID;\n\t\t\t\techo $filePath;\n\t\t\t\techo $uzivatelID;\n\t\t\t\t*/\n\t\t\t\t//echo '*'.$jmenoUzivateleCoNahral.'*';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$obrazek = new obrazekObjekt($obrazekID, $filePath,$uzivatelID,$jmenoUzivateleCoNahral);\n\t\t\t\t\n\t\t\t\t//echo $obrazek->filePath;\n\t\t\t\t//echo $obrazek->jmenoUzivateleCoNahral;\n\t\t\t\t\n\t\t\t\tarray_push($vratit,$obrazek); \n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\t\n\t\treturn\t$vratit;\t\t\n\t\t\n\t}", "function ToonFormulierAfspraak()\n{\n\n}", "public static function getJefePlaneacion()\n {\n $jefes = file_get_contents('http://sws.itvillahermosa.edu.mx/ws/jefes?nivel=3');\n $jefes = json_decode($jefes, true);\n\n foreach($jefes as $jefe)\n {\n if($jefe['descripcion'] == 'DEPARTAMENTO DE PLANEACION, PROGRAMACION Y PRESUPUESTACION')\n {\n $pla = array_values($jefe);\n \n #Se pasa a mayúscula\n $pla[0]= mb_strtoupper($pla[0]);\n $pla[1]= mb_strtoupper($pla[1]);\n $pla[2]= mb_strtoupper($pla[2]);\n $pla[]= SWS_API::buscarID($pla[1]);\n $pla[]= 'JEFE(A) DE DEPTO. DE PLANEACIÓN, PROGRAMACIÓN Y PRESUPUESTACIÓN';\n\n return $pla;\n }\n }\n }", "function darLetras($solucion){ \r\n $azar = rand(0,strlen($solucion)-1);\r\n $dLetra = $solucion[$azar];\r\n $posicionLetra = $azar.strtoupper($dLetra);\r\n return $posicionLetra;\r\n }", "public static function preslovi($text, $pismo)\n {\n $cirilica = array (\"панјелиниз\",\"конјуг\",\"конјук\",\"конјун\",\"анјуг\",\"поджил\",\"поджет\",\"поджањ\",\"поджњ\",\"преджет\",\"преджив\",\"подждр\",\"подржар\",\"поджуп\",\"оджал\",\"оджив\",\"оджвал\",\"оджељ\",\"оджел\",\"оджден\",\"наджир\",\"наджуп\",\"надрждрел\",\"наджањ\",\"наджњ\",\"наджет\",\"наджив\",\"наджн\",\"инјункт\",\"инјек\",\"Џ\",\"џ\",\"Љ\",\"љ\",\"Њ\",\"њ\",\"Ђ\",\"ђ\",\"а\",\"б\",\"в\",\"г\",\"д\",\"е\",\"ж\",\"з\",\"и\",\"ј\",\"к\",\"л\",\"љ\",\"м\",\"н\",\"о\",\"п\",\"р\",\"с\",\"т\",\"ћ\",\"у\",\"ф\",\"х\",\"ц\",\"ч\",\"ш\",\"ѕ\",\"А\",\"Б\",\"В\",\"Г\",\"Д\",\"Е\",\"Ж\",\"З\",\"И\",\"Ј\",\"К\",\"Л\",\"Љ\",\"М\",\"Н\",\"Њ\",\"О\",\"П\",\"Р\",\"С\",\"Т\",\"Ћ\",\"У\",\"Ф\",\"Х\",\"Ц\",\"Ч\",\"Џ\",\"Ш\",\"Ѕ\");\n\n $latinica = array (\"panjeliniz\",\"konjug\",\"konjuk\",\"konjun\",\"anjug\",\"podžil\",\"podžet\",\"podžanj\",\"podžnj\",\"predžet\",\"predživ\",\"podždr\",\"podžar\",\"podžup\",\"odžal\",\"odživ\",\"odžval\",\"odželj\",\"odžel\",\"odžden\",\"nadžir\",\"nadžup\",\"nadždrel\",\"nadžanj\",\"nadžnj\",\"nadžet\",\"nadživ\",\"nadžn\",\"injunkt\",\"injek\",\"Dž\",\"dž\",\"Lj\",\"lj\",\"Nj\",\"nj\",\"Đ\",\"đ\",\"a\",\"b\",\"v\",\"g\",\"d\",\"e\",\"ž\",\"z\",\"i\",\"j\",\"k\",\"l\",\"lj\",\"m\",\"n\",\"o\",\"p\",\"r\",\"s\",\"t\",\"ć\",\"u\",\"f\",\"h\",\"c\",\"č\",\"š\",\"dz\",\"A\",\"B\",\"V\",\"G\",\"D\",\"E\",\"Ž\",\"Z\",\"I\",\"J\",\"K\",\"L\",\"Lj\",\"M\",\"N\",\"Nj\",\"O\",\"P\",\"R\",\"S\",\"T\",\"Ć\",\"U\",\"F\",\"H\",\"C\",\"Č\",\"Dž\",\"Š\",\"Dz\");\n\n if($pismo === \"Cyrl\") {\n return str_replace($cirilica, $latinica, $text);\n }\n elseif($pismo === \"Latn\")\n {\n return str_replace($latinica, $cirilica, $text);\n }\n\n }", "function perpraktikum($mhsw, $khs, $bipot, $ada, $pmbmhswid=1) {\r\n // Jumlah Matakuliah praktikum/responsi yg diambil mhsw. \r\n $jml = GetaField('krstemp k left outer join jadwal j on k.JadwalID=j.JadwalID', \r\n \"k.TahunID='$khs[TahunID]' and k.MhswID='$mhsw[MhswID]' and j.JenisJadwalID\", \r\n 'R', \"count(*)\") *2;\r\n if (($jml == 0) and (empty($mhsw['MhswID']))) $jml = 2;\r\n $totharga = $bipot['Jumlah'];\r\n if (empty($ada) && ($totharga > 0)) {\r\n $s0 = \"insert into bipotmhsw(PMBID, MhswID, TahunID, BIPOT2ID, BIPOTNamaID,\r\n PMBMhswID, TrxID, Jumlah, Besar, Catatan,\r\n LoginBuat, TanggalBuat)\r\n values('$mhsw[PMBID]', '$mhsw[MhswID]', '$khs[TahunID]', '$bipot[BIPOT2ID]', '$bipot[BIPOTNamaID]',\r\n '$pmbmhswid', '$bipot[TrxID]', $jml, '$totharga', '$mk',\r\n '$_SESSION[_Login]', now())\";\r\n $r0 = _query($s0);\r\n }\r\n else {\r\n $s0 = \"update bipotmhsw set Jumlah=$jml, Besar='$totharga',\r\n PMBMhswID='$pmbmhswid',\r\n Catatan='Total SKS: $totsks',\r\n LoginEdit='$_SESSION[_Login]', TanggalEdit=now()\r\n where BIPOTMhswID='$ada[BIPOTMhswID]' \";\r\n $r0 = _query($s0);\r\n }\r\n}", "public function voliPredvidjanje()\n {\n $korisnik= $this->session->get(\"korisnik\");\n $predvidjanjeId= $this->request->uri->getSegment(3); //slobodno promeniti nacin dohvatanja, poenta je da mi treba predvidjanje koje je voljeno\n $voliModel=new VoliModel();\n if ($voliModel->vec_voli($korisnik->IdK, $predvidjanjeId))\n {\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }\n else\n {\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanjeModel->voli($predvidjanjeId, true);\n $posl_id=$voliModel->poslednji_vestackiId();\n $voliModel->voli($korisnik->IdK, $predvidjanjeId, $posl_id+1);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n }", "public function getSchvaleneClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'schváleno'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }", "function pobierz_urle_uzyt($nazwa_uz) {\r\n // pobranie z bazy danych wszystkich URL-i danego u�ytkownika\r\n $lacz = lacz_bd();\r\n $wynik = $lacz->query(\"select URL_zak\r\n from zakladka\r\n where nazwa_uz = '\".$nazwa_uz.\"'\");\r\n if (!$wynik) {\r\n return false;\r\n }\r\n\r\n // tworzenie tablicy URL-i\r\n $tablica_url = array();\r\n for ($licznik = 0; $rzad = $wynik->fetch_row(); ++$licznik) {\r\n $tablica_url[$licznik] = $rzad[0];\r\n }\r\n return $tablica_url;\r\n}", "function en_rojo($anio){\n $ar=array();\n $ar['anio']=$anio;\n $sql=\"select sigla,descripcion from unidad_acad \";\n $sql = toba::perfil_de_datos()->filtrar($sql);\n $resul=toba::db('designa')->consultar($sql);\n $ar['uni_acad']=$resul[0]['sigla'];\n $res=$this->get_totales($ar);//monto1+monto2=gastado\n $band=false;\n $i=0;\n $long=count($res);\n while(!$band && $i<$long){\n \n if(($res[$i]['credito']-($res[$i]['monto1']+$res[$i]['monto2']))<-50){//if($gaste>$resul[$i]['cred']){\n $band=true;\n }\n \n $i++;\n }\n return $band;\n \n }", "function cariPosisi($batas){\nif(empty($_GET['haldatasiswa'])){\n\t$posisi=0;\n\t$_GET['haldatasiswa']=1;\n}\nelse{\n\t$posisi = ($_GET['haldatasiswa']-1) * $batas;\n}\nreturn $posisi;\n}", "function selmundat($xent, &$area, &$habit, &$freg, &$dia_fer, &$des_fer ) {\n\t$sqls=\"select * from munp1.municip where cod = '$xent'\";\n\t$ress=mysql_db_query(\"munp1\",$sqls); //\n\t\tif ($ress) {\n\t\t\t\t$regs=mysql_fetch_array($ress);\n\t\t\t\tif ( $regs ) {\n\t\t\t\t\t\t\t\t$area = $regs[\"med_area\"];\n\t\t\t\t\t\t\t\t$habit = $regs[\"num_habit\"];\n\t\t\t\t\t\t\t\t$freg = $regs[\"num_freg\"];\n\t\t\t\t\t\t\t\t$dia_fer = $regs[\"dat_fermun\"];\n\t\t\t\t\t\t\t\t$des_fer = $regs[\"des_fermun\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tmysql_free_result($ress);\n\t\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t\t}\n \t\t\t\t\telse return 0;\n\t\t }\n// printf(\"vai sair 0\");\nreturn 0;\n}", "function aggiungiAllegato($pratica,$documento){\n \n}", "function cariPosisi($batas){\nif(empty($_GET['halhasilkelulusansiswa'])){\n\t$posisi=0;\n\t$_GET['halhasilkelulusansiswa']=1;\n}\nelse{\n\t$posisi = ($_GET['halhasilkelulusansiswa']-1) * $batas;\n}\nreturn $posisi;\n}", "function noidungtt($sotu,$noidung)\n{\n\n\t$n=explode(\" \",$noidung);\n\t$noidunginra=\" \";\n\tif($sotu<=count($n)){\n for($i=0;$i<$sotu;$i++)\n\t\t $noidunginra = $noidunginra.$n[$i].\" \";\n $noidunginra .=\"...\";\n }\n\telse\n\t\techo \"<h1>cảnh báo : số từ tóm lược nhiều hơn nội dung ban đầu</h1>\"; \n\treturn $noidunginra;\n}", "public function dajStatusSvomPredvidjanju()\n {\n $korisnik=$this->session->get(\"korisnik\");\n $idPred=$_COOKIE['idTek'];\n setcookie(\"idTek\", \"\", time() - 3600);\n $predvidjanjeModel=new PredvidjanjeModel();\n $predvidjanje=$predvidjanjeModel->dohvati_predvidjanja_id($idPred);\n $danas=date(\"Y-m-d H:i:s\");\n //moze da se podeli u tri ifa, radi lepseg ispisa, ali ovde mislim da su svi slucajevi\n if ($danas<$predvidjanje->DatumEvaluacije || $predvidjanje->Status!=\"CEKA\" || $korisnik->IdK!=$predvidjanje->IdK)//ne sme jos da mu daje status\n {\n echo \"GRESKA\";\n return;\n }\n $statusV=$this->request->getVar(\"dane\");\n if($statusV=='DA') $status=\"ISPUNJENO\";\n else $status=\"NEISPUNJENO\";\n $predvidjanjeModel->postavi_status($predvidjanje, $status);\n if ($status==\"ISPUNJENO\")\n {\n $korisnikModel=new KorisnikModel();\n $korisnikModel->uvecaj_skor($korisnik, $predvidjanje->Tezina);\n }\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n \n }", "private function CsomagHozzaadasa()\r\n {\r\n foreach (Lap::Nevkeszlet() as $nev)\r\n {\r\n foreach (Lap::Szinkeszlet() as $szin)\r\n {\r\n $this->lapok[]=new Lap($szin,$nev);\r\n }\r\n }\r\n }", "function cariPosisi($batas){\nif(empty($_GET['halaman'])){\n\t$posisi=0;\n\t$_GET['halaman']=1;\n}\nelse{\n\t$posisi = ($_GET['halaman']-1) * $batas;\n}\nreturn $posisi;\n}", "function cariPosisi($batas){\nif(empty($_GET['halberita'])){\n\t$posisi=0;\n\t$_GET['halberita']=1;\n}\nelse{\n\t$posisi = ($_GET['halberita']-1) * $batas;\n}\nreturn $posisi;\n}", "function cariPosisi($batas){\nif(empty($_GET['halberita'])){\n\t$posisi=0;\n\t$_GET['halberita']=1;\n}\nelse{\n\t$posisi = ($_GET['halberita']-1) * $batas;\n}\nreturn $posisi;\n}", "public function tampilDataGalang(){\n\t\t\n\t}", "public function zpracuj($parametry) {\r\n $akce = \"new\";\r\n\r\n // bude-li odeslano take z formulare ma _POST prednost pred URL\r\n if (isset($_POST['akce'])&& (!empty($_POST['akce']))) {\r\n $akce = $_POST['akce'];\r\n } else {\r\n if (isset($parametry[0]) and in_array($parametry[0], ObjektKontroler::$typakce))\r\n $akce = $parametry[0];\r\n };\r\n\r\n if ((!isset($_POST['list'])) and isset($parametry[1]))\r\n $_POST['list'] = $parametry[1];\r\n\r\n\t\t//Debug::p($akce);\r\n\r\n $this->pohled = 'nabidka'; // Nastavení implicitni šablony\r\n // Hlavička stránky\r\n $this->hlavicka['titulek'] = 'Editor nabidky';\r\n $nab = new NhlavickaClass();\r\n\t\t$nab->data[\"nazev\"]=\"Nabidka XY\";\r\n\t\t$nab->data[\"id\"] = $nab->insert($nab->data);\r\n\t\t$nab->data[\"nazev\"]=\"Nabidka \".$nab->data[\"id\"] ;\r\n // Byl odeslán formulář\r\n if ($akce == \"new\") {\r\n\t\t\tif ( empty($_POST['list'])){\r\n\r\n\t\t\t}else{\r\n\t\t\t\t//je to seznam objektu oddelenych carkou \"15,12,78\"\r\n\t\t\t\t$polozky = explode(\",\",$_POST['list']);\r\n\t\t\t\tforeach ($polozky as $polID){\r\n\t\t\t\t\t$obj = new ObjektClass();\r\n\t\t\t\t\t$obj->get($polID);\r\n\t\t\t\t\t$pol = new NpolozkaClass();\r\n\t\t\t\t\t$pol->setByObjekt($obj);\r\n\t\t\t\t\t$pol->insert();\r\n\t\t\t\t}\r\n\t\t\t}\r\n $this->data = $nab->data; // Proměnné pro šablonu\r\n $this->data['titulek'] = 'Nová nabídka';\r\n\t\t\t// po odeslani formulare uloz\r\n $this->data['akce'] = 'insert';\r\n\t\t\t// $akce = 'insert'; // po odeslani formulare uloz\r\n }\r\n\r\n if ($akce == \"view\") {\r\n $nab->get($parametry[1]);\r\n $nab->data = array_intersect_key(array_merge(array_flip(NhlavickaClass::$sloupce), $nab->data), $nab->data);\r\n $this->data = $nab->data;\r\n $this->data['akce'] = 'save';\r\n $this->data['titulek'] = 'Detail nabídky ' . $nab->data['nazev'];\r\n Zprava::zobraz('Objekt k detailu byl vybrán');\r\n $this->pohled = 'DetailObjekt';\r\n }\r\n if ($akce == \"ObnovSkryj\") {\r\n DB::proved(\"UPDATE objekt SET status = (- status) WHERE objekt_id = ? \", array($parametry[1]));\r\n Zprava::zobraz('Objekt byl zneplatněn');\r\n $this->presmeruj('/objekt/edit/' . $parametry[1]);\r\n }\r\n if ($akce == \"delete\") {\r\n DB::proved(\"DELETE FROM obr WHERE id_objekt= ? \", array($parametry[1]));\r\n\t\t\tDB::proved(\"DELETE FROM objekt WHERE objekt_id = ? \", array($parametry[1]));\r\n Zprava::zobraz('Objekt byl smazán');\r\n $this->presmeruj('/');\r\n }\r\n\r\n\r\n if ($akce == \"insert\") {\r\n\r\n $nab->data = array_intersect_key($_POST, array_flip(NhlavickaClass::$sloupce));\r\n $nab->data['status'] = 1;\r\n $this->data = $nab->data;\r\n // zaloz noveho\r\n $this->data['objekt_id'] = $nab->insert($nab->data);\r\n $this->data['titulek'] = 'Editace objektu';\r\n // budu ho pak editovat\r\n $this->data['akce'] = 'edit';\r\n Zprava::zobraz('Objekt byl založen');\r\n $this->presmeruj('/nabidka/edit/' . $this->data['id']);\r\n }\r\n\r\n if ($akce == \"edit\") {\r\n //najdu objekt podle objekt_id\r\n $obj->get($_POST['objekt_id']);\r\n $obj->data = array_intersect_key(array_merge(array_flip(NhlavickaClass::$sloupce), $obj->data), $obj->data);\r\n $this->data = $obj->data;\r\n $this->data['akce'] = 'save';\r\n $this->data['titulek'] = 'Editace objektu ' . $obj->data['nazev'];\r\n Zprava::zobraz('Objekt byl vybrán');\r\n }\r\n if ($akce == \"save\") {\r\n\t\t\t//najdu objekt podle objekt_id\r\n\t\t\t// $obj->get($_POST['objekt_id']);\r\n $obj->data = array_intersect_key($_POST, array_flip(NhlavickaClass::$sloupce));\r\n $this->data = $obj->data;\r\n $obj->data['status'] = 2;\r\n $obj->update($obj->data);\r\n $this->data['akce'] = 'edit';\r\n $this->data['titulek'] = 'Editace objektu ' . $obj->data['nazev'];\r\n Zprava::zobraz('Objekt byl upraven');\r\n\t\t\t// //pridam obrazky udelam to pres Ajax\r\n\t\t\t// $img = new ObrClass();\r\n\t\t\t// $img->data['id_objekt'] = $obj->data['objekt_id'];\r\n\t\t\t// $img->insertFILES();\r\n $this->presmeruj('/nabidka/edit/' . $this->data['objekt_id']);\r\n }\r\n\r\n if ($akce == \"seznam\") {\r\n //seznam vsech objektu\r\n $obj->select( ' status >= ? ', Array(0) );\r\n // Debug::p($obj);\r\n $this->data['seznam'] = $obj->data;\r\n $this->data['akce'] = 'seznam';\r\n $this->data['titulek'] = 'Seznam objektů';\r\n Zprava::zobraz('Vybráno ' . count($this->data['seznam']) . ' objektů');\r\n // $this->presmeruj('/objekt');\r\n $this->pohled = 'objekty';\r\n if (isset($parametry[1]) and $parametry[1] === 'T')\r\n $this->pohled = 'objektyTab';\r\n }\r\n }", "public function bernafas()\n \t{\n \t\techo 'Bernafas menggunakan hidung, '.PHP_EOL;\n \t}", "public function stampaDipendenti() {\n echo '<p> Nome: ' . $this->nome . '</p>';\n echo '<p> Cognome: ' . $this->cognome . '</p>';\n echo '<p> Software utilizzati: ' . $this->software . '</p>';\n }", "public function sankcionisi_korisnika()\n {\n\n $sankcionisaniIme= $this->request->getVar('korisnik');\n $kazna=$this->request->getVar('kazna');\n // echo $sankcionisaniIme;\n //echo $kazna;\n $admin= $this->session->get(\"korisnik\");\n $sankcionisaniIme= $this->request->getVar('korisnik');//ili na bilo koji drugi nacin dohvatanje\n $kazna=$this->request->getVar('kazna');//ili na bilo koji drugi nacin dohvatanje\n $korisnikModel=new KorisnikModel();\n $sankcionisani=$korisnikModel->dohvati_korisnika($sankcionisaniIme);\n $korisnikModel->sankcionisi($sankcionisani, $kazna);\n return redirect()->to( $_SERVER['HTTP_REFERER']);\n \n }", "function cariPosisi($batas){\nif(empty($_GET['halproduk'])){\n\t$posisi=0;\n\t$_GET['halproduk']=1;\n}\nelse{\n\t$posisi = ($_GET['halproduk']-1) * $batas;\n}\nreturn $posisi;\n}", "public static function prijavi($upime, $geslo)\n\t{\n\t\t$db = Db::getInstance();\n\t\t//začnemo sejo, dobimo podatke iz PB (recimo ka nemreta meti istoga imena, kak je že v večini primerov gnesden)\n\t\t//Db::sessionStart();\n\t\t$result = mysqli_query($db, \"SELECT ID, upime, geslo FROM oseba WHERE upime='$upime'\");\n\t\n\t\t$row = mysqli_fetch_array($result);\n\t\t//tu dobimo isti hash, s kerin smo koderali (ali kak se tumi pravi) geslo, zato ka ga te v if stavki ponucamo za primerjavo\n\t\t\n\t\t//primerjamo podatke keri so v bazi pa vpisani podatki, password_verify pa je kak san že prej napisao za primerjavo vpisanoga gesla pa hash_gesla iz baze\n\t\tif($row[1] == $upime && password_verify($geslo, $row[2]))\n\t\t{\n\t\t\t//če smo vpisali prave podatke, shranimo v sejo ID uporabnika (mogoče bi ime?)\n\t\t\t$_SESSION[\"id\"]=$row[0];\n\t\t\t//dobimo id, pa zovemo uspesnaPrijava.php v keroj izpišemo ka smo se prijavili, pa povezava do \"home\" je not\n\t\t\t//$oseba = Oseba::najdi($row[0]);\n\t\t\t$query = mysqli_query($db, \"INSERT INTO osebaAktivna (osebaID) VALUES ('$row[0]')\");\n\t\t\t\n\t\t\terror_reporting(E_ALL);\n\t\t require_once('views/osebe/uspesnaPrijava.php');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//če nejsmo vnesli pravih podatkov, zovemo stran napakaPrijava.php, v keroj je izpis o ton ka smo napačne podatki dali, pa link za nazaj (torej na stran prijavi.php)\n\t\t require_once('views/osebe/napakaPrijava.php');\n\t\t}\n\t}", "public function luu_tt_sanpham()\n\t\t{\n\t\t\t//lay du lieu tu view \n\t\t\tif (isset($_POST['tensanpham'])&& isset($_POST['tenloaisanpham'])&& isset($_POST['img'])&& isset($_POST['mota'])&& isset($_POST['baohanh'])&& isset($_POST['gia'])){\n\t\t\t\t//goi ham luu data cua model san pham\n\t\t\t\t$this->tensanpham = $_POST['tensanpham'];\n\t\t\t\t$this->id_loaisp = $_POST['tenloaisanpham'];\n\t\t\t\t$this->img = $_POST['img'];\n\t\t\t\t$this->mota = $_POST['mota'];\n\t\t\t\t$this->baohanh = $_POST['baohanh'];\n\t\t\t\t$this->gia = $_POST['gia'];\n\t\t\t\t//goi ham luu data cua model sanpham\n\t\t\t\t$kq = $this->sanpham_model->insert_sanpham($this->tensanpham,$this->id_loaisp,$this->img,$this->mota,$this->baohanh,$this->gia);\n\t\t\t\tif ($kq) {\n\t\t\t\t\techo 'luu du lieu thanh cong -- sanphamcontroller';\n\t\t\t\t} else {\n\t\t\t\t\techo'luu du lieu that bai -- sanphamcontroller';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo 'ban chua nhap du lieu -- sanphamcontroller';\n\t\t\t}\t\t\t\n\t\t}", "public function getBanyakSoal();", "public function keliling()\n {\n return 2*($this->panjang + $this->lebar);\n }", "function prelasesor(){\n include(\"../include/conectar.php\"); \n $query =\"UPDATE tblsemestrepro SET asesor = '$this->asesor' WHERE tblsemestrepro.id_semestrepro = $this->semestrepy;\";\n $sql = mysqli_query($conection, $query);\n mysqli_close($conection); \n if($sql){\n\t\t\t $p =\"relacion\";\n include('../plantillas/paso.php');\n } \n else\n throw new Exception (\"Error: No es posible registrar\");\n }", "public function get_proizvod_Test(){\r\n $this->unit->run($this->get_proizvod(0), TRUE, 'Testiranje ucitavanja jednog dela proizvoda');\r\n echo $this->unit->report();\r\n }", "function cariPosisi($batas){\nif(empty($_GET[halprofile])){\n\t$posisi=0;\n\t$_GET[halprofile]=1;\n}\nelse{\n\t$posisi = ($_GET[halprofile]-1) * $batas;\n}\nreturn $posisi;\n}" ]
[ "0.7067543", "0.63922167", "0.63855314", "0.63663954", "0.62606496", "0.62198734", "0.6179883", "0.6058799", "0.60428405", "0.6042743", "0.5998228", "0.59869146", "0.595545", "0.5951641", "0.59348875", "0.59333086", "0.5915387", "0.5893048", "0.5859638", "0.5855344", "0.5848371", "0.58373946", "0.58261615", "0.58176064", "0.5786726", "0.57726294", "0.57677805", "0.5761294", "0.57586783", "0.57570416", "0.5734262", "0.5725935", "0.5713807", "0.56971186", "0.5688866", "0.5685305", "0.5668503", "0.56676275", "0.56655663", "0.56626695", "0.56582016", "0.5646606", "0.5644649", "0.5641489", "0.5637291", "0.5624687", "0.56201327", "0.5615307", "0.5614209", "0.56131846", "0.56107974", "0.5608682", "0.5605102", "0.5603652", "0.5603317", "0.5583856", "0.5580327", "0.5578883", "0.5570007", "0.5562867", "0.55575985", "0.55529577", "0.5551814", "0.5549089", "0.5546212", "0.55419135", "0.55393803", "0.55300486", "0.5518893", "0.551437", "0.5511816", "0.5508538", "0.5506506", "0.5505327", "0.5504931", "0.5500085", "0.54938984", "0.54876447", "0.5480944", "0.54801905", "0.54787356", "0.5477777", "0.547499", "0.54738027", "0.5470981", "0.5466435", "0.54630667", "0.54630667", "0.54583764", "0.5449985", "0.54486984", "0.5448396", "0.5448314", "0.54443455", "0.5442828", "0.5442524", "0.54424286", "0.5442131", "0.54383343", "0.5437001", "0.5429227" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, User $user) { $user->first_name = request('first_name'); $user->last_name = request('last_name'); $user->job_title = request('job_title'); $user->auth_level = request('auth_level'); $user->last_user = request('user_email'); $user->address = request('address'); $user->city = request('city'); $user->state = request('state'); $user->zip = request('zip'); $user->save(); return redirect('home'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update($id, $input);", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424578", "0.7062392", "0.7056844", "0.6897447", "0.65815884", "0.6451359", "0.634689", "0.62107086", "0.6145251", "0.6121901", "0.6115076", "0.61009926", "0.60885817", "0.6053816", "0.6018965", "0.6007763", "0.5973282", "0.59455335", "0.593951", "0.59388787", "0.5892445", "0.58630455", "0.58540666", "0.58540666", "0.5851948", "0.5816257", "0.58070177", "0.5752376", "0.5752376", "0.57359827", "0.5723941", "0.57152426", "0.56958807", "0.5691061", "0.56881654", "0.5669518", "0.5655434", "0.5651897", "0.56480426", "0.5636727", "0.56354004", "0.5633156", "0.5632135", "0.5629063", "0.5621358", "0.56089175", "0.5602031", "0.55927175", "0.5582773", "0.558176", "0.5581365", "0.5575607", "0.5571989", "0.55672973", "0.5562929", "0.55623275", "0.55602384", "0.55602384", "0.55602384", "0.55602384", "0.55602384", "0.55598706", "0.55560726", "0.55558753", "0.5554241", "0.55534166", "0.5552986", "0.55440396", "0.55438566", "0.5540619", "0.55394524", "0.5536144", "0.5535339", "0.5534803", "0.5524157", "0.55188423", "0.55163455", "0.55135876", "0.5509835", "0.5507501", "0.55068344", "0.55034274", "0.5501476", "0.55010915", "0.5499286", "0.5497852", "0.54958415", "0.54958415", "0.5494513", "0.5494261", "0.54935366", "0.54931587", "0.54917634", "0.54836094", "0.5479455", "0.5478885", "0.5478268", "0.54654354", "0.54645413", "0.5461025", "0.54568535" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(User $user) { // $user->delete(); return redirect('/users'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
This is the action to handle external exceptions.
public function actionError() { if($error=Yii::app()->errorHandler->error) { if(Yii::app()->request->isAjaxRequest) echo $error['message']; else $this->render('error', $error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function executeActionWithErrorHandling() {\n \n }", "function exception_handler($ex) {\n // now let the plugin send the exception to client\n $this->send_error($ex);\n // not much else we can do now, add some logging later\n exit(1);\n }", "protected function errorAction() {}", "abstract protected function handleError(\\Exception $e);", "function act() {\n throw $this->exception;\n }", "function as_exception_handler($e){\n\t\t$msg = 'Error('.$e->getCode().') '. $e->getMessage().' in '. $e->getFile().':'. $e->getLine();\n\t\t$this->catch_error($msg, 'clickgs plugin crashed');\n\t}", "public function handle() {\n throw new Exception(\"This is a test exception.\");\n }", "protected function throwRedirectException() {}", "public function error()\n {\n throw new Exception('Something went wrong!');\n }", "public function actionError() {\n \n }", "public function testOnExecuteActionException()\n {\n // Start of user code RouterSpecialEventsControllerTest.testonExecuteActionException\n $controller = new RouterSpecialEventsController();\n $httpResponse = $controller->onExecuteActionException(\n AssociativeArray::createFromNativeArray(\n 'string',\n array(\n 'type' => 'SomeException',\n 'code' => 0,\n 'message' => 'Message of a simulated exception',\n 'file' => '/var/some-folder/some-file.som',\n 'controller' => 'SomeController',\n 'action' => 'someAction'\n )\n ));\n $this->assertEquals(500, $httpResponse->getStatusCode());\n $this->assertEquals(\n \"<html><h1>Error 500 : An exception has been thrown</h1><p>While executing SomeController::someAction</p><p>SomeException : Message of a simulated exception</p><p>TiBeN Framework</p></html>\", \n $httpResponse->getMessage()\n );\n // End of user code\n }", "public function getException();", "function api_error_setup() {\n\tset_exception_handler(function(Throwable $e) {\n\t\ttry {\n\t\t\techo APIException::make_json_string(APIException::map_to_code($e), $e);\n\t\t\tls_log($e->__toString(), LOGERR);\n\t\t} catch (Exception $e) {\n\t\t\t/*\n\t\t\t* Exceptions thrown in the exception handler\n\t\t\t* cause hard to debug fatal errors. Handle them.\n\t\t\t*/\n\t\t\techo '{\"error\":'.API_E_INTERNAL.', \"e_msg\":\"'.$e->getMessage().\n\t\t\t\t' (in exception handler, '.$e->getFile().' '.$e->getLine().')\"}';\n\t\t}\n\t\texit(1);\n\t});\n}", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "public function actionException()\n {\n $this->render('exception');\n }", "public function throwErrorAction() {\n $message = $this->getRequestParam(\"message\", null);\n if (($error_code = $this->getRequestParam(\"error_code\")) && !empty($error_code)) {\n if (!empty($message))\n $this->respondWithValidationError($error_code, $message);\n else\n $this->respondWithError($error_code);\n }\n\n return;\n }", "public function handle(\\Exception $error);", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "function handler($ex) {\n echo \"In exception handler\\n\";\n}", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "protected static function exception()\n {\n foreach (self::fetch('exceptions') as $file) {\n Bus::need($file);\n }\n }", "protected function initializeErrorHandling() {}", "abstract public function handleFatalError($e);", "public function handle_error() {\n $last_operation = $this->add_last_operation;\n $data = array(\n 'function_name' => is_array($last_operation[0]) ? $last_operation[0][1] : $last_operation[0],\n 'function_name_complete' => is_array($last_operation[0]) ? (is_string($last_operation[0][0]) ? $last_operation[0][0].':' : get_class($last_operation[0][0]).'->').$last_operation[0][1] : $last_operation[0],\n 'args' => $last_operation[1]\n );\n\n switch (strtolower($data['function_name'])) {\n case 'autoexecute':\n $data['table'] = $data['args'][0];\n $data['fields'] = $data['args'][1];\n $data['operation'] = $data['args'][2];\n break;\n }\n\n $data['debug'] = $last_operation;\n if (class_exists('e_database'))\n throw new e_database($this->adodb->ErrorMsg(),$data,$this->adodb->ErrorNo());\n else\n throw new Exception($this->adodb->ErrorMsg(),$this->adodb->ErrorNo());\n }", "public function apply(Exception $ex);", "function errorHandler($errno,$errstr){\n\t global $errors;\n\n\t raiseError(\"We are working to solve an internal issue in our service. Please, try later.\", Constants::HTTP_INTERNAL_SERVER_ERROR);\n\t}", "public function handleException($exception);", "function uncaught_exception($o){\n $o['message'] = Trace::exceptionToText($o['exception']);\n $o['trace'] = Trace::exFullTrace($o['exception']);\n unexpected_failure($o);\n }", "function handleException(Exception $ex)\n{\n\techo \"There was an error: {$ex}\";\n}", "public function onException(Exception $err): Effect|Response;", "public function errorAction()\n\t{\n\t}", "function raise(\\Exception $ex);", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "public static function reportOtherExceptionAndExit($e){\nself::encodeAndOutputMessage(self::translate('System error.'));\n$msg=date(\"Y-m-d H:i:s T\");\n$msg.=':'.(string)$e.\"\\n\"; //Let the exception describe itself\nforeach(self::$details as $k=>$v)$msg.=\"$k=$v\\n\";\nLogger::log(self::$systemErrorLog,$msg);\nexit;\n}", "public function errorOccured();", "public function actionError()\n {\n if (($exception = Yii::$app->getErrorHandler()->exception) === null) {\n // action has been invoked not from error handler, but by direct route, so we display '404 Not Found'\n $exception = new HttpException(404, Yii::t('yii', 'Page not found.'));\n }\n\n if ($exception instanceof HttpException) {\n $code = $exception->statusCode;\n } else {\n $code = $exception->getCode();\n }\n if ($exception instanceof Exception) {\n $name = $exception->getName();\n } else {\n $name = Yii::t('yii', 'Error');\n }\n if ($code) {\n $name .= \" (#$code)\";\n }\n\n if ($exception instanceof UserException) {\n $message = $exception->getMessage();\n } else {\n $message = Yii::t('yii', 'An internal server error occurred.');\n }\n $statusCode = $exception->statusCode ? $exception->statusCode : 500;\n if (Yii::$app->getRequest()->getIsAjax()) {\n return \"$name: $message\";\n } else {\n return $this->render('error', [\n 'code' => $statusCode,\n 'name' => $name,\n 'message' => $message\n ]);\n }\n }", "public function throwExceptions($state)\r\n {\r\n $this->_frontController->throwExceptions($state);\r\n }", "function default_exception_handler($ex) {\n $backtrace = $ex->getTrace();\n $place = array('file'=>$ex->getFile(), 'line'=>$ex->getLine(), 'exception'=>get_class($ex));\n array_unshift($backtrace, $place);\n\n if ($ex instanceof moodle_exception) {\n _print_normal_error($ex->errorcode, $ex->module, $ex->a, $ex->link, $backtrace, $ex->debuginfo);\n } else {\n _print_normal_error('generalexceptionmessage', 'error', $ex->getMessage(), '', $backtrace);\n }\n}", "function exception_error_handler( $errno, $errstr, $errfile, $errline ) {\n throw new ErrorException( $errstr, $errno, 0, $errfile, $errline );\n}", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "function globalExceptionHandler ($ex) {\n try {\n ob_end_clean();\n $msg = '<b>' . get_class($ex) . ' (' . $ex->getCode() . ')</b> thrown in <b>' . $ex->getFile() . '</b> on line <b>'\n . $ex->getLine() . '</b><br>' . $ex->getMessage()\n . str_replace('#', '<br>#', $ex->getTraceAsString()) . '<br>';\n\n //don't log errors caused by routing to a non-existant page (since bots do that constantly)\n if($ex->getCode() != 404 && $ex->getCode() != 403 && $ex->getMessage() != \"Call to a member function getRewriteRoute() on null\") {\n $ds = DataService::getInstance();\n $ds->logException($msg);\n }\n\n if (DEBUG) {\n echo $msg;\n } else {\n if(Session::getUser() != null)\n header(\"Location: /error\");\n else\n header(\"Location: /login/error\");\n }\n }\n catch (Exception $e) {\n if(Session::getUser() != null)\n header(\"Location: /error\");\n else\n header(\"Location: /login/error\");\n }\n}", "protected abstract function send_error($ex=null) ;", "public static function handleException($e)\n {\n self::setHeader($e);\n //TODO quitar el extract, que el view pida los que necesite\n extract(Router::get(), EXTR_OVERWRITE);\n // Registra la autocarga de helpers\n spl_autoload_register('kumbia_autoload_helper', true, true);\n\n $Controller = Util::camelcase($controller);\n ob_start();\n if (PRODUCTION) { //TODO: añadir error 500.phtml\n include APP_PATH . 'views/_shared/errors/404.phtml';\n return;\n }\n if ($e instanceof KumbiaException) {\n $view = $e->view;\n $tpl = $e->template;\n } else {\n $view = 'exception';\n $tpl = 'views/templates/exception.phtml';\n }\n //Fix problem with action name in REST\n $action = $e->getMessage() ? $e->getMessage() : $action;\n\n include CORE_PATH . \"views/errors/{$view}.phtml\";\n \n $content = ob_get_clean();\n\n // termina los buffers abiertos\n while (ob_get_level ()) {\n ob_end_clean();\n }\n include CORE_PATH . $tpl;\n }", "function exceptionHandler($e) {\n $msg = array(\"status\" => \"500\", \"message\" => $e->getMessage(), \"file\" => $e->getFile(), \"line\" => $e->getLine());\n $usr_msg = array(\"status\" => \"500\", \"message\" => \"Sorry! Internal server error!\");\n header(\"Access-Control-Allow-Origin: *\"); \n header(\"Content-Type: application/json; charset=UTF-8\"); \n header(\"Access-Control-Allow-Methods: GET, POST\");\n echo json_encode($usr_msg);\n logError($msg);\n\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "public function handleException(Exception $e)\n {\n watchdog('Award Force API', $e->getMessage(), array(), WATCHDOG_ERROR);\n\n exit(t('An error has occurred. Please try again, and if the problem persists, contact the system administrator.'));\n }", "function OnAfterError(){\n }", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "public function onKernelException()\n {\n echo '<br> something wrong happened ! exeption event listener successfuly fired :D ';\n }", "public function caught( $ex ) {\n//\t\tob_end_clean();\n\n\t\t$class = get_class($ex);\n\t\tswitch ( $class ) {\n\t\t\tcase 'row\\database\\ModelException':\n\t\t\tcase 'row\\database\\NotEnoughFoundException':\n\t\t\tcase 'row\\database\\TooManyFoundException':\n\t\t\t\texit('[Database Model error] '.$ex->getMessage().'');\n\t\t\tcase 'row\\http\\NotFoundException':\n\t\t\tcase 'row\\OutputException':\n\t\t\tcase 'row\\core\\VendorException':\n//\t\t\t\tob_end_clean();\n//\t\t\t\treturn $this->_internal('errors/notfound', array('exception' => $ex));\n\t\t\t\texit('[404] ['.$class.'] Not Found: '.$ex->getMessage());\n\t\t\tcase 'row\\core\\MethodException':\n\t\t\tcase 'ErrorException':\n\t\t\t\texit('Parse/runtime error: '.$ex->getMessage().'');\n\t\t\tcase 'row\\database\\DatabaseException':\n\t\t\t\texit('[Database/Query error] '.$ex->getMessage().'');\n\t\t}\n\n\t\texit('Unknown ['.get_class($ex).'] encountered: '.$ex->getMessage().'');\n\t}", "function __elgg_php_exception_handler($exception) {\n\terror_log(\"*** FATAL EXCEPTION *** : \" . $exception);\n\n\tob_end_clean(); // Wipe any existing output buffer\n\n\t// make sure the error isn't cached\n\theader(\"Cache-Control: no-cache, must-revalidate\", true);\n\theader('Expires: Fri, 05 Feb 1982 00:00:00 -0500', true);\n\t//header(\"Internal Server Error\", true, 500);\n\n\t$body = elgg_view(\"messages/exceptions/exception\",array('object' => $exception));\n\tpage_draw(ballom_echo('exception:title'), $body);\n}", "protected function exceptions($exception){\n\t\tthrow $exception;\n\t}", "public function errorAction()\r\n {\r\n $errors = $this->_getParam('error_handler');\r\n $messages = array();\r\n\r\n switch ((string)$errors->type) {\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\r\n // 404 error -- controller or action not found\r\n $this->getResponse()->setRawHeader('HTTP/1.1 404 Not Found');\r\n\r\n $messages[] = Zoo::_(\"The page you requested was not found.\");\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $messages[] = $errors->exception->getMessage();\r\n }\r\n break;\r\n\r\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:\r\n case 0:\r\n // application error\r\n //$messages[] = Zoo::_(\"An unexpected error occurred with your request. Please try again later.\");\r\n $messages[] = $errors->exception->getMessage();\r\n if (ZfApplication::getEnvironment() == \"development\" || ZfApplication::getEnvironment() == \"staging\") {\r\n $trace = $errors->exception->getTrace();\r\n foreach (array_keys($trace) as $i) {\r\n if ($trace[$i]['args']) {\r\n foreach ($trace[$i]['args'] as $index => $arg) {\r\n if (is_object($arg)) {\r\n $trace[$i]['args'][$index] = get_class($arg);\r\n }\r\n elseif (is_array($arg)) {\r\n $trace[$i]['args'][$index] = \"array\";\r\n }\r\n }\r\n }\r\n $trace[$i]['file_short'] = \"..\".substr($trace[$i]['file'], strrpos(str_replace(\"\\\\\", DIRECTORY_SEPARATOR, $trace[$i]['file']), DIRECTORY_SEPARATOR));\r\n }\r\n $this->view->assign('trace', $trace);\r\n }\r\n break;\r\n\r\n default:\r\n // application error\r\n $this->getResponse()->setRawHeader('HTTP/1.1 '.$errors->type);\r\n $messages[] = $errors->exception->getMessage();\r\n break;\r\n }\r\n\r\n // Clear previous content\r\n $this->getResponse()->clearBody();\r\n\r\n $this->view->assign('errormessages', $messages);\r\n }", "function error_handler($errno, $string, $file, $line, $context) {\n throw new Trails_Exception(500, $string);\n }", "public function UnhandeldException(){\n\t\t$this -> message = \"An unhandeld exception was thrown. Please infrom...\";\n\t}", "public function testTask1Exception(){\n\n }", "protected function errorAction()\n\t{\n\t\t$this->handleTargetNotFoundError();\n\n\t\treturn $this->getFlattenedValidationErrorMessage();\n\t}", "private function handleException($e)\n {\n // TODO: test coverage\n if ($e instanceof ClientException) {\n // will catch all 4xx errors\n if ($e->getResponse()->getStatusCode() == 403) {\n throw new AuthenticationException(\n $this->apiKey,\n $this->apiSecret,\n null,\n $e\n );\n } else {\n throw new DomainException(\n 'The OpenTok API request failed: ' . json_decode($e->getResponse()->getBody(true))->message,\n null,\n $e\n );\n }\n } else if ($e instanceof ServerException) {\n // will catch all 5xx errors\n throw new UnexpectedValueException(\n 'The OpenTok API server responded with an error: ' . json_decode($e->getResponse()->getBody(true))->message,\n null,\n $e\n );\n } else {\n // TODO: check if this works because Exception is an interface not a class\n throw new Exception('An unexpected error occurred');\n }\n }", "public function support(\\Exception $exception);", "public function handleErrorRelateArticle()\n { \n $this->getResponse()->setStatusCode(500);\n $this->forward('articles', 'articleRelations');\n }", "function as_error_handler($errno, $errstr, $errfile, $errline){\n\t\t$msg = 'Error('.$errno.') '.$errstr.' in '. $errfile.':'. $errline;\n\t\t$this->catch_error( $msg, 'clickgs plugin crashed');\n\t}", "function rescue($exception) {\n return $this->dispatcher->trails_error($exception);\n }", "public abstract function onFail();", "public function throwError();", "function internalError() {\n\t\t$this->status = $this->STATUS_INTERNAL_ERROR;\n\t\t$this->noCache();\n\t}", "public function actionError()\n {\n if($error=Yii::app()->errorHandler->error)\n {\n if($error['code'] != 404 || !isset($aErrorMsg[$error['errorCode']])){\n Yii::log(' error : ' . $error['file'] .\":\". $error['line'] .\":\". $error['message'], 'error', 'system');\n }\n $ret = new ReturnInfo(FAIL_RET, Yii::t('exceptions', $error['message']), intval($error['errorCode']));\n if(Yii::app()->request->getIsAjaxRequest()){\n echo json_encode($ret);\n \n }else{\n if( empty($error['errorCode']) ){\n if(isset($this->aErrorMsg[$error['code']])){\n if(empty($this->aErrorMsg[$error['code']]['message'])) {\n $this->aErrorMsg[$error['code']]['message'] = $error['message'];\n }\n $this->render('error', $this->aErrorMsg[$error['code']]);\n }else{\n $this->render('error', $this->aErrorMsg['1000']);\n }\n }else{\n $this->render('error', $this->aErrorMsg[ $error['errorCode'] ]);\n \n }\n }\n \n } \n }", "function handle_error($exception) {\n try {\n print $this->encode(array(\n 'error' => $exception->getMessage(),\n 'message' => $exception->getMessage(), // Should be a i18n end user message\n 'data' => @$exception->data,\n 'status' => @$exception->status\n ));\n } catch(Exception $e) {\n echo 'Error: '.$e->getmessage();\n }\n }", "public function getExceptions();", "public static function error()\n {\n if ($error = static::$errorHandler) {\n admin_exit($error());\n }\n\n if (Helper::isAjaxRequest()) {\n abort(403, trans('admin.deny'));\n }\n\n admin_exit(\n Content::make()->withError(trans('admin.deny'))\n );\n }", "protected function throwErrorWhileSavingResponseException()\n {\n throw new InvalidScreenForNewSessionException('An error occured while saving data.');\n }", "protected function error($msg) {\n \t parent::error($msg); //log in error msg\n throw new Exception ($msg); // <-- TESTS php4\n }", "public function errorAction()\n {\n $errors = $this->_getParam('error_handler');\n\n switch ($errors->type) {\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n $this->view->message = 'Page not found';\n break;\n default:\n // Generic application error\n $this->getResponse()->setHttpResponseCode(500);\n $this->view->message = 'Application error';\n break;\n }\n\n $this->view->exception = $errors->exception;\n $this->view->request = $errors->request;\n $this->_response->clearBody();\n }", "public function loginCheckAction()\n {\n\n\n throw new \\Exception('This should never be reached!');\n }", "public function handleException(\\Exception $exception): void;", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'error' => $this->payload->getOutput(),\n ]);\n }", "function error(){}", "function fatalErrorHandler() {\n global $cfg;\n $error = error_get_last();\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n header(\"HTTP/1.1 500 Server Error\");\n readfile($cfg['source_root'] . \"/500.html\");\n //error_log(print_r($error, true));\n //error_log(print_r(debug_backtrace(), true));\n exit();\n }\n/*\n if(($error['type'] === E_ERROR) || ($error['type'] === E_USER_ERROR)){\n $_SESSION['error'] = $error;\n header(\"Location:\".$cfg['root'].\"exception/\");\n exit;\n }\n*/\n}", "public static function handleException(Throwable $exc) {\n\n\t\t\t# Load template\n\n\t\t\t$file_name = (DIR_TEMPLATES . 'Exception.ctp');\n\n\t\t\tif (false === ($contents = @file_get_contents($file_name))) $output = nl2br($exc);\n\n\t\t\telse $output = self::parseContents($contents, $exc);\n\n\t\t\t# Set headers\n\n\t\t\theader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n\n\t\t\theader('Cache-Control: no-store, no-cache, must-revalidate');\n\n\t\t\theader('Cache-Control: post-check=0, pre-check=0', false);\n\n\t\t\theader('Pragma: no-cache');\n\n\t\t\theader($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500);\n\n\t\t\theader('Content-type: text/html; charset=UTF-8');\n\n\t\t\t# ------------------------\n\n\t\t\texit ($output);\n\t\t}", "abstract protected function echoExceptionWeb($exception);", "function error_handler($exception) {\n\tglobal $config;\n\theader('HTTP/1.0 404 Not Found');\n\textract(array('error'=>$exception->getMessage()));\n\trequire($config['VIEW_PATH'].'404.php');\n\tdie();\n}", "function handleException($e) {\r\n\ttry {\r\n\t\tif (!($e instanceof \\Exception)) throw $e;\r\n\t\t\r\n\t\tif ($e instanceof IPrintableException || $e instanceof \\wcf\\system\\exception\\IPrintableException) {\r\n\t\t\t$e->show();\r\n\t\t\texit;\r\n\t\t}\r\n\t\t\r\n\t\t// repacking\r\n\t\t(new SystemException($e->getMessage(), $e->getCode(), '', $e))->show();\r\n\t\texit;\r\n\t}\r\n\tcatch (\\Throwable $exception) {\r\n\t\tdie(\"<pre>WCF::handleException() Unhandled exception: \".$exception->getMessage().\"\\n\\n\".$exception->getTraceAsString());\r\n\t}\r\n\tcatch (\\Exception $exception) {\r\n\t\tdie(\"<pre>WCF::handleException() Unhandled exception: \".$exception->getMessage().\"\\n\\n\".$exception->getTraceAsString());\r\n\t}\r\n}", "public function fatal_handler()\n {\n $error = error_get_last();\n\n if ($error !== null && is_array($error) && $error['type'] == E_ERROR)\n {\n $settings = require CODE_ROOT . '/src/settings.php';\n $app = new \\Slim\\App($settings);\n\n require CODE_ROOT . '/src/dependencies.php';\n\n $view = $app->getContainer()->get('view');\n\n $logger = $app->getContainer()->get('logger');\n $logger->emergency('An unrecoverable error has ocurred!', $error);\n\n echo $view->fetch('error.twig');\n }\n\n exit;\n }", "function exception_error_handler() {\n header('HTTP/1.1 500 Internal Server Error');\n if(is_file(__DIR__.'/../html/500.html'))\n {\n require(__DIR__.'/../html/404.html');\n } else {\n ?>\n <h1>Something goofed really hard</h1>\n <p>We're working on it, sit tight</p>\n <?php\n }\n // I'll just leave this here for debug purposes.\n //throw new ErrorException($errstr, $errno, 0, $errfile, $errline);\n}", "public function handleException(Exception $ex) {\r\n $extra = array('message' => $ex->getMessage());\r\n if ($ex instanceof NotFoundException) {\r\n header('HTTP/1.0 404 Not Found');\r\n $this->runErrorPage('404', $extra);\r\n } else {\r\n header('HTTP/1.1 500 Internal Sever Error');\r\n $this->runErrorPage('404', $extra);\r\n }\r\n }", "public function indexAction() {\n\t\ttry{\n\t\t\t\n\t\t\t\n\t\t}catch (Exception $e){\n\t\t\tApplication_Model_Logging::lwrite($e->getMessage());\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\t}", "public function cannotPerformReferencingErrorAction()\n {\n $this->renderTwigView('/iris-referencing/cannot-perform-referencing-error.html.twig');\n }", "public function raise() {\n throw $this;\n }", "private function _error() {\n\t\trequire $this->_controllerPath . $this->_errorFile;\n\t\t$this->_controller = new Error();\n\t\t$this->_controller->index('Esta página no existe');\n\t\texit;\n\t}", "public function actionError()\n {\n if(Core::getLoggedDeliveryBoyID() > 0)\n {\n\t \t $exception = Yii::$app->errorHandler->exception;\n\t \t $error = array('statusCode' => $exception->statusCode, 'message' => $exception->getMessage(), 'name' => $exception->getName());\n \t\t return $this->render('/error', ['error' => $error]);\n }\n else\n {\n\t \t\treturn Yii::$app->getResponse()->redirect(Yii::$app->getHomeUrl().'delivery')->send();\n }\n }", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n // Don't catch suppressed errors with '@' sign\n // @link http://stackoverflow.com/questions/7380782/error-supression-operator-and-set-error-handler\n $error_reporting = ini_get('error_reporting');\n if (!($error_reporting & $errno)) {\n return;\n }\n throw new ErrorException($errstr, $errno, 0, $errfile, $errline);\n}", "private function handleDefaultException($e)\n\t{\n\t\tLog::out(get_class($e) . ', ' . $e->getMessage(), Log::LEVEL_CRIT);\n\t\t\n\t\tif(php_sapi_name() == 'cli') {\n\t\t\tprint \"\\n\" . get_class($e) . \" occured\\n\" .\n\t\t\t\t'Message: ' . $e->getMessage() . \"\\n\" .\n\t\t\t\t'Code: ' . $e->getCode() . \"\\n\" .\n\t\t\t\t$e->getTraceAsString() . \"\\n\";\n\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\tif($e instanceOf BakedCarrotNotFoundException) {\n\t\t\t\tif(!headers_sent()) {\n\t\t\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Request::isAjax() || Request::isFlash()) {\n\t\t\t\t\tprint $e->getMessage();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprint '<html><head></head><body style=\"font: 10pt arial; margin: 40px;\">' .\n\t\t\t\t\t\t'<h1 style=\"font-weight: normal; font-size: 30px;\">404 Page Not Found</h1>' . \n\t\t\t\t\t\t($e->getMessage() ? '<h3 style=\"margin: 0; font-weight: normal;\">Message: ' . $e->getMessage() . '</h3>' : '') .\n\t\t\t\t\t\t(self::isDevMode() ? '<p>' . nl2br($e->getTraceAsString()) . '</p>' : '') .\n\t\t\t\t\t\t'</body>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(!headers_sent()) {\n\t\t\t\t\theader('HTTP/1.1 500 Internal Server Error');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(Request::isAjax() || Request::isFlash()) {\n\t\t\t\t\tprint 'EXCEPTION (' . get_class($e) . '): ' . $e->getMessage() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\tif(self::isDevMode() && get_class($e) == 'PDOException') {\n\t\t\t\t\t\tprint 'SQL: ' . Db::lastSql();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tprint '<html><head></head><body style=\"font: 10pt arial; margin: 40px;\">' .\n\t\t\t\t\t\t'<h1 style=\"font-weight: normal; font-size: 30px;\">' . get_class($e) . ' occured</h1>' . \n\t\t\t\t\t\t'<h3 style=\"margin: 0; font-weight: normal;\">Message: ' . $e->getMessage() . '</h3>' .\n\t\t\t\t\t\t'<h3 style=\"margin: 0; font-weight: normal;\">Code: ' . $e->getCode() . '</h3>' .\n\t\t\t\t\t\t(self::isDevMode() && get_class($e) == 'PDOException' ? '<h3 style=\"margin: 0;\">SQL: ' . Db::lastSql() . '</h3>' : '') .\n\t\t\t\t\t\t(self::isDevMode() ? '<p>' . nl2br($e->getTraceAsString()) . '</p>' : '') .\n\t\t\t\t\t\t'<h4 style=\"font-weight: normal;\"><em>Baked Carrot ver ' . BAKEDCARROT_VERSION . '</em></h4>' .\n\t\t\t\t\t\t'</body>';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\texit(-1);\n\t}", "abstract function bootErrorAction(array $errors = null);", "public function errorAction()\n {\n $code = $this->_request->getParam('errorCode');\n $this->view->errorCode = $code;\n $this->getResponse()->setRawHeader('HTTP/1.1 500 Internal Server Error');\n }", "public function http(HttpResponseException $ex);", "public static function exception_handler($exception) { \n ResponseFactory::send($exception->getMessage()); //Send exception message as response.\n }", "abstract protected function logException(\\Exception $ex);", "function handleError()\n{\n\tglobal $g_error_msg, $g_debug_msg;\n\tinclude_once(atkconfig('atkroot'). 'atk/errors/class.atkerrorhandlerbase.inc');\n\t$errorHandlers = atkconfig('error_handlers', array('mail'=>array('mailto' => atkconfig('mailreport'))));\n\tforeach ($errorHandlers as $key => $value)\n\t{\n\t\tif (is_numeric($key))\n\t\t$key = $value;\n\t\t$errorHandlerObject = atkErrorHandlerBase::get($key, $value);\n\t\t$errorHandlerObject->handle($g_error_msg, $g_debug_msg);\n\t}\n}", "private function guardAgainstExternalErrors($response)\n {\n if ($response->getStatusCode() == 503) {\n throw new \\Exception('Could not connect to googleapis.com/maps/api. STATUSCODE = '.$response->getStatusCode());\n }\n }", "protected function throwInaccessibleException() {}", "function atkExceptionHandler(Exception $exception)\n{\n\tatkdebug($exception->getMessage(), DEBUG_ERROR);\n\tatkdebug(\"Trace:<br/>\".nl2br($exception->getTraceAsString()), DEBUG_ERROR);\n\tatkhalt(\"Uncaught exception: \" . $exception->getMessage(), 'critical');\n}" ]
[ "0.7287599", "0.6912219", "0.68299127", "0.6764336", "0.67318916", "0.65816224", "0.652491", "0.64027196", "0.63419074", "0.6254394", "0.6252444", "0.62215143", "0.6202076", "0.6200523", "0.61928016", "0.61920303", "0.6190992", "0.61815006", "0.61570185", "0.6144311", "0.612321", "0.61201763", "0.6107248", "0.61004853", "0.6097678", "0.608724", "0.6077253", "0.6071571", "0.6012394", "0.60068166", "0.60027444", "0.599248", "0.5982089", "0.5976866", "0.59707934", "0.5940339", "0.592896", "0.5912697", "0.58972526", "0.5894595", "0.5872288", "0.5871165", "0.58653665", "0.58587426", "0.5849281", "0.5831071", "0.58264756", "0.5811687", "0.5809379", "0.5808009", "0.5807814", "0.5791766", "0.57854706", "0.57811344", "0.57673085", "0.5763232", "0.574481", "0.5742202", "0.5739157", "0.57249564", "0.5719985", "0.5712929", "0.5711839", "0.571016", "0.57080704", "0.57073575", "0.5691569", "0.5690952", "0.5689513", "0.56874895", "0.56806767", "0.5674907", "0.56744456", "0.56732786", "0.5670893", "0.5666088", "0.56618816", "0.56618595", "0.5652861", "0.5645839", "0.5644675", "0.56438804", "0.5641156", "0.56399024", "0.56284046", "0.562525", "0.5622601", "0.56127936", "0.5605725", "0.56056494", "0.56053597", "0.55948526", "0.55892783", "0.5585555", "0.55760646", "0.55698377", "0.5569038", "0.556873", "0.5563482", "0.55627924", "0.55540586" ]
0.0
-1
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget.
public function search() { // @todo Please modify the following code to remove attributes that should not be searched. $criteria=new CDbCriteria; if(!empty($this->start_balance) || !empty($this->end_balance)){ $start_val=floatval($this->start_balance); $end_val = floatval($this->end_balance); $criteria->addBetweenCondition('ali_balance',$start_val,$end_val); }else { $criteria->compare('user_id',$this->user_id,true); $criteria->compare('user_name',$this->user_name,true); //$criteria->compare('user_passwd',$this->user_passwd,true); $criteria->compare('user_phone',$this->user_phone,true); $criteria->compare('ali_email',$this->ali_email,true); $criteria->compare('ali_type',$this->ali_type); $criteria->compare('ali_balance',$this->ali_balance,true); $criteria->compare('ali_freeze',$this->ali_freeze,true); $criteria->compare('user_sex',$this->user_sex); //$criteria->compare('user_ico',$this->user_ico,true); $criteria->compare('user_birth',$this->user_birth,true); $criteria->compare('user_country',$this->user_country,true); $criteria->compare('user_address',$this->user_address,true); //$criteria->compare('user_lastlogin',$this->user_lastlogin,true); //$criteria->compare('user_lastip',$this->user_lastip,true); $criteria->compare('user_addtime',$this->user_addtime,true); } return new CActiveDataProvider($this, array( 'criteria'=>$criteria, 'pagination'=>array( 'pageSize'=>7, ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object_type_id);\n\t\t$criteria->compare('data_type_id',$this->data_type_id);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('client_ip',$this->client_ip,true);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_origin',$this->url_origin,true);\n\t\t$criteria->compare('device',$this->device,true);\n\t\t$criteria->compare('country_name',$this->country_name,true);\n\t\t$criteria->compare('country_code',$this->country_code,true);\n\t\t$criteria->compare('regionName',$this->regionName,true);\n\t\t$criteria->compare('cityName',$this->cityName,true);\n\t\t$criteria->compare('browser',$this->browser,true);\n\t\t$criteria->compare('os',$this->os,true);\n\t\t\t// se agrego el filtro por el usuario actual\n\t\t$idUsuario=Yii::app()->user->getId();\n\t\t$model = Listings::model()->finbyAttributes(array('user_id'=>$idUsuario));\n\t\tif($model->id!=\"\"){\n\t\t\t$criteria->compare('object_id',$model->id);\t\n\t\t}else{\n\t\t\t$criteria->compare('object_id',\"Null\");\t\n\t\t}\n\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('model_id',$this->model_id,true);\n $criteria->compare('color',$this->color,true);\n $criteria->compare('is_in_pare',$this->is_in_pare);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('generator_id',$this->generator_id,true);\n\t\t$criteria->compare('serial_number',$this->serial_number,true);\n\t\t$criteria->compare('model_number',$this->model_number,true);\n\t\t$criteria->compare('manufacturer_name',$this->manufacturer_name,true);\n\t\t$criteria->compare('manufacture_date',$this->manufacture_date,true);\n\t\t$criteria->compare('supplier_name',$this->supplier_name,true);\n\t\t$criteria->compare('date_of_purchase',$this->date_of_purchase,true);\n\t\t$criteria->compare('date_of_first_use',$this->date_of_first_use,true);\n\t\t$criteria->compare('kva_capacity',$this->kva_capacity);\n\t\t$criteria->compare('current_run_hours',$this->current_run_hours);\n\t\t$criteria->compare('last_serviced_date',$this->last_serviced_date,true);\n\t\t$criteria->compare('engine_make',$this->engine_make,true);\n\t\t$criteria->compare('engine_model',$this->engine_model,true);\n\t\t$criteria->compare('fuel_tank_capacity',$this->fuel_tank_capacity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('idmodel',$this->idmodel);\n\t\t$criteria->compare('usuario_anterior',$this->usuario_anterior);\n\t\t$criteria->compare('usuario_nuevo',$this->usuario_nuevo);\n\t\t$criteria->compare('estado_anterior',$this->estado_anterior,true);\n\t\t$criteria->compare('estado_nuevo',$this->estado_nuevo,true);\n\t\t$criteria->compare('fecha',$this->fecha,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('brand',$this->brand,true);\n\t\t$criteria->compare('status',$this->status,true);\n\t\t$criteria->compare('width',$this->width);\n\t\t$criteria->compare('height',$this->height);\n\t\t$criteria->compare('goods_thumb',$this->goods_thumb,true);\n\t\t$criteria->compare('goods_img',$this->goods_img,true);\n\t\t$criteria->compare('model_search',$this->model_search,true);\n\t\t$criteria->compare('brand_search',$this->brand_search,true);\n\t\t$criteria->compare('brand2',$this->brand2,true);\n\t\t$criteria->compare('brand2_search',$this->brand2_search,true);\n\t\t$criteria->compare('brand3',$this->brand3,true);\n\t\t$criteria->compare('brand3_search',$this->brand3_search,true);\n\t\t$criteria->compare('brand4',$this->brand4,true);\n\t\t$criteria->compare('brand4_search',$this->brand4_search,true);\n\t\t$criteria->compare('model2',$this->model2,true);\n\t\t$criteria->compare('model2_search',$this->model2_search,true);\n\t\t$criteria->compare('model3',$this->model3,true);\n\t\t$criteria->compare('model3_search',$this->model3_search,true);\n\t\t$criteria->compare('model4',$this->model4,true);\n\t\t$criteria->compare('model4_search',$this->model4_search,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('car',$this->car,true);\n\t\t$criteria->compare('source_id',$this->source_id,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('client_type_id',$this->client_type_id,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('other',$this->other,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t// $criteria->compare('text',$this->text,true);\n\t\t// $criteria->compare('record',$this->record,true);\n\t\t$criteria->compare('user',$this->user,true);\n\t\t$criteria->compare('createdBy',$this->createdBy,true);\n\t\t$criteria->compare('viewed',$this->viewed);\n\t\t$criteria->compare('createDate',$this->createDate,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('comparison',$this->comparison,true);\n\t\t// $criteria->compare('value',$this->value,true);\n\t\t$criteria->compare('modelType',$this->modelType,true);\n\t\t$criteria->compare('modelId',$this->modelId,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('Currency_ID',$this->Currency_ID);\n\t\t$criteria->compare('CurrencyNo',$this->CurrencyNo,true);\n\t\t$criteria->compare('ExchangeVND',$this->ExchangeVND,true);\n\t\t$criteria->compare('AppliedDate',$this->AppliedDate,true);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('firm',$this->firm,true);\n\t\t$criteria->compare('change_date',$this->change_date,true);\n\t\t$criteria->compare('item_id',$this->item_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('availability',$this->availability,true);\n\t\t$criteria->compare('price',$this->price,true);\n\t\t$criteria->compare('bonus',$this->bonus,true);\n\t\t$criteria->compare('shipping_cost',$this->shipping_cost,true);\n\t\t$criteria->compare('product_page',$this->product_page,true);\n\t\t$criteria->compare('sourse_page',$this->sourse_page,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('column_id',$this->column_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('condition',$this->condition,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('industry',$this->industry,true);\n\t\t$criteria->compare('industry_sub',$this->industry_sub,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('province',$this->province,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('contact_name',$this->contact_name,true);\n\t\t$criteria->compare('contact_tel',$this->contact_tel,true);\n\t\t$criteria->compare('ip',$this->ip,true);\n\t\t$criteria->compare('source',$this->source,true);\n $criteria->compare('status',$this->status);\n\t\t$criteria->compare('update_time',$this->update_time);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('notes',$this->notes);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('university',$this->university,true);\n\t\t$criteria->compare('major',$this->major,true);\n\t\t$criteria->compare('gpa',$this->gpa,true);\n\t\t$criteria->compare('appl_term',$this->appl_term);\n\t\t$criteria->compare('toefl',$this->toefl);\n\t\t$criteria->compare('gre',$this->gre);\n\t\t$criteria->compare('appl_major',$this->appl_major,true);\n\t\t$criteria->compare('appl_degree',$this->appl_degree,true);\n\t\t$criteria->compare('appl_country',$this->appl_country,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('goods_code',$this->goods_code,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('brand_id',$this->brand_id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('size',$this->size,true);\n\t\t$criteria->compare('material',$this->material,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('purchase_price',$this->purchase_price,true);\n\t\t$criteria->compare('selling_price',$this->selling_price,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('meta_title',$this->meta_title,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ContractsDetailID',$this->ContractsDetailID,true);\n\t\t$criteria->compare('ContractID',$this->ContractID,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\t\t$criteria->compare('CustomerID',$this->CustomerID,true);\n\t\t$criteria->compare('Share',$this->Share);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\n\t\t$criteria->compare('type_key',$this->type_key,true);\n\n\t\t$criteria->compare('type_name',$this->type_name,true);\n\n\t\t$criteria->compare('model',$this->model,true);\n\n\t\t$criteria->compare('status',$this->status,true);\n\t\t\n\t\t$criteria->compare('seo_title',$this->seo_title,true);\n\t\t\n\t\t$criteria->compare('seo_keywords',$this->seo_keywords,true);\n\t\t\n\t\t$criteria->compare('seo_description',$this->seo_description,true);\n\n\t\treturn new CActiveDataProvider('ModelType', array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria = $this->criteriaSearch();\r\n\t\t$criteria->limit = 10;\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('organizationName',$this->organizationName,true);\n\t\t$criteria->compare('contactNo',$this->contactNo,true);\n\t\t$criteria->compare('partnerType',$this->partnerType);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('emailId',$this->emailId,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('firstName',$this->firstName,true);\n\t\t$criteria->compare('lastName',$this->lastName,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_ID,$this->{Globals::FLD_NAME_ACTIVITY_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_TASK_ID,$this->{Globals::FLD_NAME_TASK_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_BY_USER_ID,$this->{Globals::FLD_NAME_BY_USER_ID},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_TYPE,$this->{Globals::FLD_NAME_ACTIVITY_TYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_ACTIVITY_SUBTYPE,$this->{Globals::FLD_NAME_ACTIVITY_SUBTYPE},true);\n\t\t$criteria->compare(Globals::FLD_NAME_COMMENTS,$this->{Globals::FLD_NAME_COMMENTS},true);\n\t\t$criteria->compare(Globals::FLD_NAME_CREATED_AT,$this->{Globals::FLD_NAME_CREATED_AT},true);\n\t\t$criteria->compare(Globals::FLD_NAME_SOURCE_APP,$this->{Globals::FLD_NAME_SOURCE_APP},true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('manufacturers_image',$this->manufacturers_image,true);\n\t\t$criteria->compare('date_added',$this->date_added);\n\t\t$criteria->compare('last_modified',$this->last_modified);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('url_clicked',$this->url_clicked);\n\t\t$criteria->compare('date_last_click',$this->date_last_click);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('date',$this->date);\n\t\t$criteria->compare('del',$this->del);\n\t\t$criteria->compare('action_id',$this->action_id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('catalog',$this->catalog,true);\n\t\t$criteria->compare('is_new',$this->is_new);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('case',$this->case);\n\t\t$criteria->compare('basis_doc',$this->basis_doc);\n\t\t$criteria->compare('calc_group',$this->calc_group);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('value',$this->value,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('competition',$this->competition);\n\t\t$criteria->compare('partner',$this->partner);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('website',$this->website,true);\t\t\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('data_attributes_fields',$this->data_attributes_fields,true);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('created',$this->created,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('skill_id',$this->skill_id);\n\t\t$criteria->compare('model_id',$this->model_id);\n\t\t$criteria->compare('account_id',$this->account_id);\n\t\t$criteria->compare('field_name',$this->field_name);\n\t\t$criteria->compare('content',$this->content);\n\t\t$criteria->compare('old_data',$this->old_data,true);\n\t\t$criteria->compare('new_data',$this->new_data,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('type',$this->type);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_updated',$this->date_updated,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('company_id',$this->company_id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('validator',$this->validator,true);\n\t\t$criteria->compare('position',$this->position);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n $criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('display_name',$this->display_name,true);\n $criteria->compare('actionPrice',$this->actionPrice);\n\t\t$criteria->compare('translit',$this->translit,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('display_description',$this->display_description,true);\n\t\t$criteria->compare('meta_keywords',$this->meta_keywords,true);\n\t\t$criteria->compare('meta_description',$this->meta_description,true);\n\t\t$criteria->compare('editing',$this->editing);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array(\n 'pageSize' => 15,\n ),\n\t\t));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('BrandID', $this->BrandID);\n $criteria->compare('BrandName', $this->BrandName, true);\n $criteria->compare('Pinyin', $this->Pinyin, true);\n $criteria->compare('Remarks', $this->Remarks, true);\n $criteria->compare('OrganID', $this->OrganID);\n $criteria->compare('UserID', $this->UserID);\n $criteria->compare('CreateTime', $this->CreateTime);\n $criteria->compare('UpdateTime', $this->UpdateTime);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('real_name',$this->real_name,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('zip_code',$this->zip_code,true);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('district_id',$this->district_id);\n\t\t$criteria->compare('district_address',$this->district_address,true);\n\t\t$criteria->compare('street_address',$this->street_address,true);\n\t\t$criteria->compare('is_default',$this->is_default);\n\t\t$criteria->compare('create_time',$this->create_time);\n\t\t$criteria->compare('update_time',$this->update_time);\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('componente_id',$this->componente_id);\n\t\t$criteria->compare('tipo_dato',$this->tipo_dato,true);\n\t\t$criteria->compare('descripcion',$this->descripcion,true);\n\t\t$criteria->compare('cruce_automatico',$this->cruce_automatico,true);\n\t\t$criteria->compare('sw_obligatorio',$this->sw_obligatorio,true);\n\t\t$criteria->compare('orden',$this->orden);\n\t\t$criteria->compare('sw_puntaje',$this->sw_puntaje,true);\n\t\t$criteria->compare('sw_estado',$this->sw_estado,true);\n\t\t$criteria->compare('todos_obligatorios',$this->todos_obligatorios,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('customerName',$this->customerName,true);\n\t\t$criteria->compare('agencyHead',$this->agencyHead,true);\n\t\t$criteria->compare('region_id',$this->region_id);\n\t\t$criteria->compare('province_id',$this->province_id);\n\t\t$criteria->compare('municipalityCity_id',$this->municipalityCity_id);\n\t\t$criteria->compare('barangay_id',$this->barangay_id);\n\t\t$criteria->compare('houseNumber',$this->houseNumber,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('type_id',$this->type_id);\n\t\t$criteria->compare('nature_id',$this->nature_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('created_by',$this->created_by);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('update_time',$this->update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('EMCE_ID',$this->EMCE_ID);\n\t\t$criteria->compare('MOOR_ID',$this->MOOR_ID);\n\t\t$criteria->compare('EVCR_ID',$this->EVCR_ID);\n\t\t$criteria->compare('EVES_ID',$this->EVES_ID);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->name,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('state',$this->address,true);\n\t\t$criteria->compare('country',$this->address,true);\n\t\t$criteria->compare('contact_number',$this->contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('is_deleted',$this->is_deleted);\n\t\t$criteria->compare('deleted_by',$this->deleted_by,true);\n\t\t$criteria->compare('created_at',$this->created_at,true);\n\t\t$criteria->compare('updated_at',$this->updated_at,true);\n\t\tif(YII::app()->user->getState(\"role\") == \"admin\") {\n\t\t\t$criteria->condition = 'is_deleted = 0';\n\t\t}\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('industry_id',$this->industry_id);\n\t\t$criteria->compare('professional_status_id',$this->professional_status);\n\t\t$criteria->compare('birthday',$this->birthday);\n\t\t$criteria->compare('location',$this->location);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=$this->criteriaSearch();\n $criteria->limit=10;\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\r\n\t{\r\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\r\n\r\r\n\t\t$criteria=new CDbCriteria;\r\r\n\r\r\n\t\t$criteria->compare('id',$this->id);\r\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\r\n\t\t$criteria->compare('adds',$this->adds);\r\r\n\t\t$criteria->compare('edits',$this->edits);\r\r\n\t\t$criteria->compare('deletes',$this->deletes);\r\r\n\t\t$criteria->compare('view',$this->view);\r\r\n\t\t$criteria->compare('lists',$this->lists);\r\r\n\t\t$criteria->compare('searches',$this->searches);\r\r\n\t\t$criteria->compare('prints',$this->prints);\r\r\n\r\r\n\t\treturn new CActiveDataProvider($this, array(\r\r\n\t\t\t'criteria'=>$criteria,\r\r\n\t\t));\r\r\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('applyId',$this->applyId);\n\t\t$criteria->compare('stuId',$this->stuId);\n\t\t$criteria->compare('stuName',$this->stuName,true);\n\t\t$criteria->compare('specification',$this->specification,true);\n\t\t$criteria->compare('assetName',$this->assetName,true);\n\t\t$criteria->compare('applyTime',$this->applyTime,true);\n\t\t$criteria->compare('loanTime',$this->loanTime,true);\n\t\t$criteria->compare('returnTime',$this->returnTime,true);\n\t\t$criteria->compare('RFID',$this->RFID,true);\n\t\t$criteria->compare('stuTelNum',$this->stuTelNum,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('itemcode', $this->itemcode, true);\n $criteria->compare('product_id', $this->product_id, true);\n $criteria->compare('delete_flag', $this->delete_flag);\n $criteria->compare('status', $this->status);\n $criteria->compare('expire', $this->expire, true);\n $criteria->compare('date_input', $this->date_input, true);\n $criteria->compare('d_update', $this->d_update, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('verid',$this->verid);\n\t\t$criteria->compare('appversion',$this->appversion,true);\n\t\t$criteria->compare('appfeatures',$this->appfeatures,true);\n\t\t$criteria->compare('createtime',$this->createtime,true);\n\t\t$criteria->compare('baseNum',$this->baseNum);\n\t\t$criteria->compare('slave1Num',$this->slave1Num);\n\t\t$criteria->compare('packagename',$this->packagename,true);\n\t\t$criteria->compare('ostype',$this->ostype);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('client_id',$this->client_id,true);\n\t\t$criteria->compare('extension',$this->extension,true);\n\t\t$criteria->compare('rel_type',$this->rel_type,true);\n\t\t$criteria->compare('rel_id',$this->rel_id,true);\n\t\t$criteria->compare('meta_key',$this->meta_key,true);\n\t\t$criteria->compare('meta_value',$this->meta_value,true);\n\t\t$criteria->compare('date_entry',$this->date_entry,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('column_id',$this->column_id,true);\n\t\t$criteria->compare('research_title',$this->research_title,true);\n\t\t$criteria->compare('research_url',$this->research_url,true);\n\t\t$criteria->compare('column_type',$this->column_type);\n\t\t$criteria->compare('filiale_id',$this->filiale_id,true);\n\t\t$criteria->compare('area_name',$this->area_name,true);\n\t\t$criteria->compare('user_id',$this->user_id);\n\t\t$criteria->compare('trigger_config',$this->trigger_config);\n\t\t$criteria->compare('status',$this->status);\n $criteria->compare('terminal_type',$this->terminal_type);\n\t\t$criteria->compare('start_time',$this->start_time,true);\n\t\t$criteria->compare('end_time',$this->end_time,true);\n\t\t$criteria->compare('explain',$this->explain,true);\n\t\t$criteria->compare('_delete',$this->_delete);\n\t\t$criteria->compare('_create_time',$this->_create_time,true);\n\t\t$criteria->compare('_update_time',$this->_update_time,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('birthday',$this->birthday,true);\n\t\t$criteria->compare('sex',$this->sex);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('is_get_news',$this->is_get_news);\n\t\t$criteria->compare('user_id',$this->user_id);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('order_id',$this->order_id);\n\t\t$criteria->compare('device_id',$this->device_id,true);\n\t\t$criteria->compare('money',$this->money,true);\n\t\t$criteria->compare('status',$this->status);\n\t\t$criteria->compare('add_time',$this->add_time);\n\t\t$criteria->compare('recharge_type',$this->recharge_type);\n\t\t$criteria->compare('channel',$this->channel,true);\n\t\t$criteria->compare('version_name',$this->version_name,true);\n\t\t$criteria->compare('pay_channel',$this->pay_channel);\n\t\t$criteria->compare('chanel_bid',$this->chanel_bid);\n\t\t$criteria->compare('chanel_sid',$this->chanel_sid);\n\t\t$criteria->compare('versionid',$this->versionid);\n\t\t$criteria->compare('chanel_web',$this->chanel_web);\n\t\t$criteria->compare('dem_num',$this->dem_num);\n\t\t$criteria->compare('last_watching',$this->last_watching,true);\n\t\t$criteria->compare('pay_type',$this->pay_type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\r\n {\r\n // @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n $criteria = new CDbCriteria;\r\n\r\n $criteria->compare('id', $this->id);\r\n $criteria->compare('country_id', $this->country_id);\r\n $criteria->compare('user_id', $this->user_id);\r\n $criteria->compare('vat', $this->vat);\r\n $criteria->compare('manager_coef', $this->manager_coef);\r\n $criteria->compare('curator_coef', $this->curator_coef);\r\n $criteria->compare('admin_coef', $this->admin_coef);\r\n $criteria->compare('status', $this->status);\r\n\r\n return new CActiveDataProvider($this, array(\r\n 'criteria' => $criteria,\r\n ));\r\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('purchase_price',$this->purchase_price);\n\t\t$criteria->compare('sell_price',$this->sell_price);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('measurement',$this->measurement,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('date_update',$this->date_update,true);\n\t\t$criteria->compare('date_out',$this->date_out,true);\n\t\t$criteria->compare('date_in',$this->date_in,true);\n\t\t$criteria->compare('firma_id',$this->firma_id,true);\n\t\t$criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('instock',$this->instock);\n\t\t$criteria->compare('user_id',$this->user_id);\n $criteria->compare('warning_amount',$this->warning_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('fname',$this->fname,true);\n\t\t$criteria->compare('mname',$this->mname,true);\n\t\t$criteria->compare('lname',$this->lname,true);\n\t\t$criteria->compare('photo',$this->photo,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('date_of_birth',$this->date_of_birth,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('landline',$this->landline,true);\n\t\t$criteria->compare('em_contact_name',$this->em_contact_name,true);\n\t\t$criteria->compare('em_contact_relation',$this->em_contact_relation,true);\n\t\t$criteria->compare('em_contact_number',$this->em_contact_number,true);\n\t\t$criteria->compare('created_by',$this->created_by,true);\n\t\t$criteria->compare('created_date',$this->created_date,true);\n\n return new CActiveDataProvider( $this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => Yii::app()->user->getState( 'pageSize', Yii::app()->params[ 'defaultPageSize' ] ),\n ),\n ) );\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('COMPETITOR_ID',$this->COMPETITOR_ID);\n\t\t$criteria->compare('WSDC_NO',$this->WSDC_NO);\n\t\t$criteria->compare('FIRST_NAME',$this->FIRST_NAME,true);\n\t\t$criteria->compare('LAST_NAME',$this->LAST_NAME,true);\n\t\t$criteria->compare('COMPETITOR_LEVEL',$this->COMPETITOR_LEVEL);\n\t\t$criteria->compare('REMOVED',$this->REMOVED);\n\t\t$criteria->compare('ADDRESS',$this->ADDRESS,true);\n\t\t$criteria->compare('CITY',$this->CITY,true);\n\t\t$criteria->compare('STATE',$this->STATE,true);\n\t\t$criteria->compare('POSTCODE',$this->POSTCODE);\n\t\t$criteria->compare('COUNTRY',$this->COUNTRY,true);\n\t\t$criteria->compare('PHONE',$this->PHONE,true);\n\t\t$criteria->compare('MOBILE',$this->MOBILE,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('LEADER',$this->LEADER);\n\t\t$criteria->compare('REGISTERED',$this->REGISTERED);\n\t\t$criteria->compare('BIB_STATUS',$this->BIB_STATUS);\n\t\t$criteria->compare('BIB_NUMBER',$this->BIB_NUMBER);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('sys_name',$this->sys_name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('CustomerId',$this->CustomerId,true);\n\t\t$criteria->compare('AddressId',$this->AddressId,true);\n\t\t$criteria->compare('CustomerStatusId',$this->CustomerStatusId,true);\n\t\t$criteria->compare('DateMasterId',$this->DateMasterId,true);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('CustomerPhoto',$this->CustomerPhoto,true);\n\t\t$criteria->compare('CustomerCode',$this->CustomerCode);\n\t\t$criteria->compare('Telephone',$this->Telephone,true);\n\t\t$criteria->compare('Mobile',$this->Mobile,true);\n\t\t$criteria->compare('EmailId',$this->EmailId,true);\n\t\t$criteria->compare('Status',$this->Status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\r\n\t{\r\n\t\t// Warning: Please modify the following code to remove attributes that\r\n\t\t// should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n\r\n\t\t$criteria->compare('id',$this->id);\r\n\t\t$criteria->compare('user_id',$this->user_id);\r\n\t\t$criteria->compare('mem_type',$this->mem_type);\r\n\t\t$criteria->compare('business_type',$this->business_type);\r\n\t\t$criteria->compare('product_name',$this->product_name,true);\r\n\t\t$criteria->compare('panit',$this->panit,true);\r\n\t\t$criteria->compare('sex',$this->sex);\r\n\t\t$criteria->compare('tname',$this->tname);\r\n\t\t$criteria->compare('ftname',$this->ftname,true);\r\n\t\t$criteria->compare('ltname',$this->ltname,true);\r\n\t\t$criteria->compare('etname',$this->etname);\r\n\t\t$criteria->compare('fename',$this->fename,true);\r\n\t\t$criteria->compare('lename',$this->lename,true);\r\n\t\t$criteria->compare('birth',$this->birth,true);\r\n\t\t$criteria->compare('email',$this->email,true);\r\n\t\t$criteria->compare('facebook',$this->facebook,true);\r\n\t\t$criteria->compare('twitter',$this->twitter,true);\r\n\t\t$criteria->compare('address',$this->address,true);\r\n\t\t$criteria->compare('province',$this->province);\r\n\t\t$criteria->compare('prefecture',$this->prefecture);\r\n\t\t$criteria->compare('district',$this->district);\r\n\t\t$criteria->compare('postcode',$this->postcode,true);\r\n\t\t$criteria->compare('tel',$this->tel,true);\r\n\t\t$criteria->compare('mobile',$this->mobile,true);\r\n\t\t$criteria->compare('fax',$this->fax,true);\r\n\t\t$criteria->compare('high_education',$this->high_education);\r\n\t\t$criteria->compare('career',$this->career);\r\n\t\t$criteria->compare('skill_com',$this->skill_com);\r\n\t\t$criteria->compare('receive_news',$this->receive_news,true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n\t\t));\r\n\t}", "public function search() {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$parameters = array('limit'=>ceil(Profile::getResultsPerPage()));\n\t\t$criteria->scopes = array('findAll'=>array($parameters));\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('itemId',$this->itemId);\n\t\t$criteria->compare('changedBy',$this->changedBy,true);\n\t\t$criteria->compare('recordName',$this->recordName,true);\n\t\t$criteria->compare('fieldName',$this->fieldName,true);\n\t\t$criteria->compare('oldValue',$this->oldValue,true);\n\t\t$criteria->compare('newValue',$this->newValue,true);\n\t\t$criteria->compare('diff',$this->diff,true);\n\t\t$criteria->compare('timestamp',$this->timestamp);\n\n\t\treturn new SmartActiveDataProvider(get_class($this), array(\n\t\t\t'sort'=>array(\n\t\t\t\t'defaultOrder'=>'timestamp DESC',\n\t\t\t),\n\t\t\t'pagination'=>array(\n\t\t\t\t'pageSize'=>Profile::getResultsPerPage(),\n\t\t\t),\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('company_id', $this->company_id);\n\t\t$criteria->compare('productId', $this->productId);\n\t\t$criteria->compare('upTo', $this->upTo);\n\t\t$criteria->compare('fixPrice', $this->fixPrice);\n\t\t$criteria->compare('isActive', $this->isActive);\n\t\t$criteria->order = 'company_id';\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('city_id',$this->city_id);\n\t\t$criteria->compare('locality',$this->locality,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('item_id',$this->item_id);\n\t\t$criteria->compare('table_id',$this->table_id);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cou_id',$this->cou_id);\n\t\t$criteria->compare('thm_id',$this->thm_id);\n\t\t$criteria->compare('cou_nom',$this->cou_nom,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria=$this->getBaseCDbCriteria();\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('idempleo',$this->idempleo);\n\t\t$criteria->compare('administrativo',$this->administrativo,true);\n\t\t$criteria->compare('comercial',$this->comercial,true);\n\t\t$criteria->compare('artes',$this->artes,true);\n\t\t$criteria->compare('informatica',$this->informatica,true);\n\t\t$criteria->compare('salud',$this->salud,true);\n\t\t$criteria->compare('marketing',$this->marketing,true);\n\t\t$criteria->compare('servicio_domestico',$this->servicio_domestico,true);\n\t\t$criteria->compare('construccion',$this->construccion,true);\n\t\t$criteria->compare('agricultura',$this->agricultura,true);\n\t\t$criteria->compare('ganaderia',$this->ganaderia,true);\n\t\t$criteria->compare('telecomunicaciones',$this->telecomunicaciones,true);\n\t\t$criteria->compare('atencion_cliente',$this->atencion_cliente,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID_VALOR',$this->ID_VALOR);\n\t\t$criteria->compare('ID_UBICACION',$this->ID_UBICACION);\n\t\t$criteria->compare('ID_VISITA',$this->ID_VISITA);\n\t\t$criteria->compare('VALOR',$this->VALOR);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t\n\t\t$criteria->compare('id_aspecto',$this->id_aspecto,true);\n\t\t$criteria->compare('tbl_Programa_id_programa',$this->tbl_Programa_id_programa,true);\n\t\t$criteria->compare('tbl_Factor_id_factor',$this->tbl_Factor_id_factor);\n\t\t$criteria->compare('tbl_caracteristica_id_caracteristica',$this->tbl_caracteristica_id_caracteristica,true);\n\t\t$criteria->compare('num_aspecto',$this->num_aspecto,true);\n\t\t$criteria->compare('aspecto',$this->aspecto,true);\n\t\t$criteria->compare('instrumento',$this->instrumento,true);\n\t\t$criteria->compare('fuente',$this->fuente,true);\n\t\t$criteria->compare('documento',$this->documento,true);\n\t\t$criteria->compare('link',$this->link,true);\n\t\t$criteria->compare('Observaciones',$this->Observaciones,true);\n\t\t$criteria->compare('cumple',$this->cumple,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('website_url',$this->website_url,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('user_name',$this->user_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('created_datetime',$this->created_datetime,true);\n\t\t$criteria->compare('icon_src',$this->icon_src,true);\n\t\t$criteria->compare('show_r18',$this->show_r18);\n\t\t$criteria->compare('show_bl',$this->show_bl);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('creationDate',$this->creationDate,true);\n\t\t$criteria->compare('year',$this->year);\n\t\t$criteria->compare('term',$this->term,true);\n\t\t$criteria->compare('activated',$this->activated);\n\t\t$criteria->compare('startingDate',$this->startingDate,true);\n\t\t$criteria->compare('activation_userId',$this->activation_userId);\n\t\t$criteria->compare('parent_catalogId',$this->parent_catalogId);\n $criteria->compare('isProspective', $this->isProspective);\n $criteria->compare('creatorId', $this->creatorId);\n $criteria->compare('isProposed', $this->isProposed);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('FirstName',$this->FirstName,true);\n\t\t$criteria->compare('LastName',$this->LastName,true);\n\t\t$criteria->compare('location',$this->location);\n\t\t$criteria->compare('theripiest',$this->theripiest);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('gender',$this->gender,true);\n\t\t$criteria->compare('dob',$this->dob,true);\n\t\t$criteria->compare('inurancecompany',$this->inurancecompany,true);\n\t\t$criteria->compare('injurydate',$this->injurydate,true);\n\t\t$criteria->compare('therapy_start_date',$this->therapy_start_date,true);\n\t\t$criteria->compare('ASIA',$this->ASIA,true);\n\t\t$criteria->compare('injury',$this->injury,true);\n\t\t$criteria->compare('medication',$this->medication,true);\n\t\t$criteria->compare('notes',$this->notes,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('imputetype_id',$this->imputetype_id);\n\t\t$criteria->compare('project_id',$this->project_id);\n\n\t\treturn new ActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search () {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('formId', $this->formId, true);\n\t\t$criteria->compare('data', $this->data, true);\n\t\t$criteria->compare('ctime', $this->ctime);\n\t\t$criteria->compare('mtime', $this->mtime);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('category_id',$this->category_id);\n\t\t$criteria->compare('amount',$this->amount);\n\t\t$criteria->compare('price_z',$this->price_z);\n\t\t$criteria->compare('price_s',$this->price_s);\n\t\t$criteria->compare('price_m',$this->price_m);\n\t\t$criteria->compare('dependence',$this->dependence,true);\n\t\t$criteria->compare('barcode',$this->barcode,true);\n\t\t$criteria->compare('unit',$this->unit,true);\n\t\t$criteria->compare('minimal_amount',$this->minimal_amount);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 100),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('image',$this->image,true);\n\t\t$criteria->compare('manager',$this->manager);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('realname',$this->realname,true);\n\t\t$criteria->compare('identity',$this->identity,true);\n\t\t$criteria->compare('mobile',$this->mobile,true);\n\t\t$criteria->compare('bussiness_license',$this->bussiness_license,true);\n\t\t$criteria->compare('bankcode',$this->bankcode,true);\n\t\t$criteria->compare('banktype',$this->banktype,true);\n\t\t$criteria->compare('is_open',$this->is_open,true);\n\t\t$criteria->compare('introduction',$this->introduction,true);\n\t\t$criteria->compare('images_str',$this->images_str,true);\n\t\t$criteria->compare('gmt_created',$this->gmt_created,true);\n\t\t$criteria->compare('gmt_modified',$this->gmt_modified,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('url',$this->url,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email_admin',$this->email_admin,true);\n\t\t$criteria->compare('password_api',$this->password_api,true);\n\t\t$criteria->compare('url_result_api',$this->url_result_api,true);\n\t\t$criteria->compare('id_currency_2',$this->id_currency_2);\n\t\t$criteria->compare('id_currency_1',$this->id_currency_1,true);\n\t\t$criteria->compare('is_test_mode',$this->is_test_mode);\n\t\t$criteria->compare('is_commission_shop',$this->is_commission_shop);\n\t\t$criteria->compare('commission',$this->commission);\n\t\t$criteria->compare('is_enable',$this->is_enable);\n\t\t$criteria->compare('is_active',$this->is_active);\n\t\t$criteria->compare('create_date',$this->create_date,true);\n\t\t$criteria->compare('mod_date',$this->mod_date,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID,true);\n\t\t$criteria->compare('userID',$this->userID,true);\n\t\t$criteria->compare('mtID',$this->mtID,true);\n\t\t$criteria->compare('fxType',$this->fxType);\n\t\t$criteria->compare('leverage',$this->leverage);\n\t\t$criteria->compare('amount',$this->amount,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('surname',$this->surname,true);\n\t\t$criteria->compare('comany_name',$this->comany_name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('uuid',$this->uuid,true);\n\t\t$criteria->compare('is_admin',$this->is_admin);\n\t\t$criteria->compare('paid_period_start',$this->paid_period_start,true);\n\t\t$criteria->compare('ftp_pass',$this->ftp_pass,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('price',$this->price,true);\n\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('breed',$this->breed,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_birthday',$this->date_birthday,true);\n\t\t$criteria->compare('sex',$this->sex,true);\n\t\t$criteria->compare('color',$this->color,true);\n\t\t$criteria->compare('tattoo',$this->tattoo,true);\n\t\t$criteria->compare('sire',$this->sire,true);\n\t\t$criteria->compare('dame',$this->dame,true);\n\t\t$criteria->compare('owner_type',$this->owner_type,true);\n\t\t$criteria->compare('honors',$this->honors,true);\n\t\t$criteria->compare('photo_preview',$this->photo_preview,true);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('pet_status',$this->pet_status,true);\n\t\t$criteria->compare('about',$this->about,true);\n\t\t$criteria->compare('uid',$this->uid);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('veterinary',$this->veterinary,true);\n\t\t$criteria->compare('vaccinations',$this->vaccinations,true);\n\t\t$criteria->compare('show_class',$this->show_class,true);\n\t\t$criteria->compare('certificate',$this->certificate,true);\n $criteria->compare('neutered_spayed',$this->certificate,true);\n \n\n $criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('city',$this->city,true);\n\n \n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('HISTORY',$this->HISTORY,true);\n\t\t$criteria->compare('WELCOME_MESSAGE',$this->WELCOME_MESSAGE,true);\n\t\t$criteria->compare('LOCATION',$this->LOCATION,true);\n\t\t$criteria->compare('PHONES',$this->PHONES,true);\n\t\t$criteria->compare('FAX',$this->FAX,true);\n\t\t$criteria->compare('EMAIL',$this->EMAIL,true);\n\t\t$criteria->compare('MISSION',$this->MISSION,true);\n\t\t$criteria->compare('VISION',$this->VISION,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('orgName',$this->orgName,true);\n\t\t$criteria->compare('noEmp',$this->noEmp);\n\t\t$criteria->compare('phone',$this->phone);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('addr1',$this->addr1,true);\n\t\t$criteria->compare('addr2',$this->addr2,true);\n\t\t$criteria->compare('state',$this->state,true);\n\t\t$criteria->compare('country',$this->country,true);\n\t\t$criteria->compare('orgType',$this->orgType,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('fax',$this->fax);\n\t\t$criteria->compare('orgId',$this->orgId,true);\n\t\t$criteria->compare('validity',$this->validity);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n \n $criteria->with=array('c','b');\n\t\t$criteria->compare('pid',$this->pid,true);\n\t\t$criteria->compare('t.cid',$this->cid,true);\n\t\t$criteria->compare('t.bid',$this->bid,true);\n\n $criteria->compare('c.classify_name',$this->classify,true);\n\t\t$criteria->compare('b.brand_name',$this->brand,true);\n \n $criteria->addCondition('model LIKE :i and model REGEXP :j');\n $criteria->params[':i'] = \"%\".$this->index_search.\"%\";\n $criteria->params[':j'] = \"^\".$this->index_search;\n\n \n\t\t$criteria->compare('model',$this->model,true);\n\t\t$criteria->compare('package',$this->package,true);\n\t\t$criteria->compare('RoHS',$this->RoHS,true);\n\t\t$criteria->compare('datecode',$this->datecode,true);\n\t\t$criteria->compare('quantity',$this->quantity);\n\t\t$criteria->compare('direction',$this->direction,true);\n $criteria->compare('image_url',$this->image_url,true);\n\t\t$criteria->compare('create_time',$this->create_time,true);\n\t\t$criteria->compare('status',$this->status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('category',$this->category,true);\n\t\t$criteria->compare('sortorder',$this->sortorder,true);\n\t\t$criteria->compare('fullname',$this->fullname,true);\n\t\t$criteria->compare('shortname',$this->shortname,true);\n\t\t$criteria->compare('idnumber',$this->idnumber,true);\n\t\t$criteria->compare('summary',$this->summary,true);\n\t\t$criteria->compare('summaryformat',$this->summaryformat);\n\t\t$criteria->compare('format',$this->format,true);\n\t\t$criteria->compare('showgrades',$this->showgrades);\n\t\t$criteria->compare('sectioncache',$this->sectioncache,true);\n\t\t$criteria->compare('modinfo',$this->modinfo,true);\n\t\t$criteria->compare('newsitems',$this->newsitems);\n\t\t$criteria->compare('startdate',$this->startdate,true);\n\t\t$criteria->compare('marker',$this->marker,true);\n\t\t$criteria->compare('maxbytes',$this->maxbytes,true);\n\t\t$criteria->compare('legacyfiles',$this->legacyfiles);\n\t\t$criteria->compare('showreports',$this->showreports);\n\t\t$criteria->compare('visible',$this->visible);\n\t\t$criteria->compare('visibleold',$this->visibleold);\n\t\t$criteria->compare('groupmode',$this->groupmode);\n\t\t$criteria->compare('groupmodeforce',$this->groupmodeforce);\n\t\t$criteria->compare('defaultgroupingid',$this->defaultgroupingid,true);\n\t\t$criteria->compare('lang',$this->lang,true);\n\t\t$criteria->compare('theme',$this->theme,true);\n\t\t$criteria->compare('timecreated',$this->timecreated,true);\n\t\t$criteria->compare('timemodified',$this->timemodified,true);\n\t\t$criteria->compare('requested',$this->requested);\n\t\t$criteria->compare('enablecompletion',$this->enablecompletion);\n\t\t$criteria->compare('completionnotify',$this->completionnotify);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('email',$this->email,true);\n\t\t$criteria->compare('password',$this->password,true);\n\t\t$criteria->compare('address',$this->address,true);\n\t\t$criteria->compare('zipcode',$this->zipcode,true);\n\t\t$criteria->compare('city',$this->city,true);\n\t\t$criteria->compare('phone',$this->phone,true);\n\t\t$criteria->compare('role',$this->role,true);\n\t\t$criteria->compare('active',$this->active);\n\t\t$criteria->compare('camaras',$this->camaras);\n\t\t$criteria->compare('freidoras',$this->freidoras);\n\t\t$criteria->compare('cebos',$this->cebos);\n\t\t$criteria->compare('trampas',$this->trampas);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('cod_venda',$this->cod_venda,true);\n\t\t$criteria->compare('filial_cod_filial',$this->filial_cod_filial,true);\n\t\t$criteria->compare('funcionario_cod_funcionario',$this->funcionario_cod_funcionario,true);\n\t\t$criteria->compare('cliente_cod_cliente',$this->cliente_cod_cliente,true);\n\t\t$criteria->compare('data_2',$this->data_2,true);\n\t\t$criteria->compare('valor_total',$this->valor_total);\n\t\t$criteria->compare('forma_pagamento',$this->forma_pagamento,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('attribute',$this->attribute,true);\n\t\t$criteria->compare('displayName',$this->displayName,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('value_type',$this->value_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->buscar,'OR');\n\t\t$criteria->compare('fecha',$this->buscar,true,'OR');\n\t\t$criteria->compare('fechaUpdate',$this->buscar,true,'OR');\n\t\t$criteria->compare('idProfesional',$this->buscar,'OR');\n\t\t$criteria->compare('importe',$this->buscar,'OR');\n\t\t$criteria->compare('idObraSocial',$this->buscar,'OR');\n\t\t$criteria->compare('estado',$this->buscar,true,'OR');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('codop',$this->codop,true);\n\t\t$criteria->compare('codcatval',$this->codcatval,true);\n\t\t$criteria->compare('cuentadebe',$this->cuentadebe,true);\n\t\t$criteria->compare('cuentahaber',$this->cuentahaber,true);\n\t\t$criteria->compare('desop',$this->desop,true);\n\t\t$criteria->compare('descat',$this->descat,true);\n\t\t$criteria->compare('debe',$this->debe,true);\n\t\t$criteria->compare('haber',$this->haber,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pagesize'=>100),\n\t\t));\n\t}" ]
[ "0.72131824", "0.7136133", "0.7093762", "0.7092962", "0.69853705", "0.69606364", "0.69477797", "0.6942041", "0.69339", "0.6923732", "0.69106185", "0.69030225", "0.6898345", "0.689756", "0.6892536", "0.6882575", "0.6879712", "0.6873826", "0.6849293", "0.6848419", "0.68348354", "0.6826058", "0.6815265", "0.6807689", "0.680362", "0.6797507", "0.6796388", "0.6795649", "0.679537", "0.6794034", "0.67897785", "0.6785364", "0.6784801", "0.67841005", "0.6780918", "0.6780793", "0.6777831", "0.6777813", "0.6776535", "0.6776259", "0.6775416", "0.6775416", "0.6775416", "0.6775416", "0.6775416", "0.6775416", "0.6775416", "0.6775416", "0.6772487", "0.6768503", "0.67664665", "0.6766424", "0.67624265", "0.6762194", "0.6760994", "0.67608446", "0.67595494", "0.6758713", "0.67531717", "0.675311", "0.6751995", "0.6748015", "0.6747993", "0.6746068", "0.67451733", "0.67447823", "0.67443323", "0.6744258", "0.6744114", "0.674373", "0.6742337", "0.6740929", "0.6740617", "0.67390317", "0.6737021", "0.67363214", "0.67346835", "0.6731918", "0.67316866", "0.672513", "0.67226183", "0.67225236", "0.6721782", "0.6713013", "0.67127407", "0.6710453", "0.6708797", "0.6706334", "0.67059094", "0.6705451", "0.6703852", "0.6702373", "0.670077", "0.66989607", "0.66963327", "0.66951656", "0.6695039", "0.66933435", "0.6692909", "0.6692596", "0.6691121" ]
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className=__CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLASS__)\n {\n return CActiveRecord::model($className);\n }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($class = __CLASS__)\n\t{\n\t\treturn parent::model(get_called_class());\n\t}", "public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }" ]
[ "0.7572934", "0.75279754", "0.72702134", "0.72696835", "0.72606635", "0.72133243", "0.72126555", "0.71307015", "0.71276915", "0.71276915", "0.71013916", "0.71013916", "0.7101271", "0.707343", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163" ]
0.0
-1
Get the File's create date
public function getCreateDate() { return $this->createDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileCreationTime($filename) {\r\n if (function_exists(\"filemtime\")) {\r\n $FT = filemtime($filename);\r\n } else {\r\n $FT = false;\r\n }\r\n return $FT;\r\n }", "function getCreationTime() ;", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "public function getCreationDate();", "public function getCreationTime() {}", "public function getCreationTime() {}", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getCreatedDate()\r\n\t\t{\r\n\t\t\treturn date('m/d/Y', strtotime($this->_created_date));\r\n\t\t}", "public function getCreationDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->creationDate;\r\n\t}", "public function getCreatedAt()\n {\n return \\DateTime::createFromFormat(DATE_ISO8601, $this->file->get(self::SETTING_CREATED_AT));\n }", "public function getDateCreated();", "public function getDate_creation()\n {\n return $this->date_creation;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "public function getDateCreate()\n {\n return $this->date_create;\n }", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getCreationDate()\n {\n return $this->created;\n }", "public function getDateCreation()\n {\n return $this->date_creation;\n }", "public function getCreationTime(){\r\n\t\treturn $this->creationTime;\r\n\t}", "public function get_date_create()\n\t{\n\t\treturn $this->date_create;\n\t}", "public function getCreationTime(){\n\t\treturn $this->creationTime;\n\t}", "public function filetime() {\n return $this->info['filetime'];\n }", "public function getCreationDate() {\n\t\treturn $this->creationDate;\n\t}", "public function getCreationTime()\n {\n return $this->creation_time;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreateDate(): string\n {\n return $this->create_date;\n }", "public function getCreateDate()\n {\n return $this->create_date;\n }", "public function getCreationDate() {\n return $this->creationDate;\n }", "public function getCreateDate()\n\t{\n\t\treturn $this->CreateDate;\n\t}", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getDateCreation()\n {\n return $this->dateCreation;\n }", "public function getCreationDate() \r\n { \r\n return $this->_creationDate; \r\n }", "public function get_creation_date()\n {\n return $this->get_default_property(self::PROPERTY_CREATION_DATE);\n }", "public function getCreate_time()\r\n {\r\n return $this->create_time;\r\n }", "public function getCreatedDate();", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "public function get_date_created();", "public function getOriginalCreationDate() {\n return $this->originalCreationDate;\n }", "public function getFileTime() {\n /* filemtime — Gets file modification time */\n $xmlfile = FCPATH.\"sitemap.xml\";\n if (file_exists($xmlfile)) {\n return date(\"F d Y H:i:s.\", filemtime($xmlfile));\n }else{\n return FALSE;\n }\n }", "public function created() {\n\t\treturn gmdate( 'Y-m-d\\TH:i:s\\Z' );\n\t}", "public function getCreatetime()\n {\n return $this->createTime;\n }", "public function getDateCreated() {\r\n return $this->_date_created;\r\n }", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getCreatedTime();", "public function getDateCreated()\n {\n return $this->getDateModified();\n }", "function getCreatedDate() {\n\t\treturn $this->_CreatedDate;\n\t}", "public function getCreatedAt()\n {\n return $this->sys->getCreatedAt();\n }", "public function getCreatedDate()\n {\n return $this->created_date;\n }", "function get_media_creation_timestamp( $metadata ) {\n $creation_date = false;\n\n if ( empty( $metadata['fileformat'] ) ) {\n return $creation_date;\n }\n\n switch ( $metadata['fileformat'] ) {\n case 'asf':\n if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) {\n $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix'];\n }\n break;\n\n case 'matroska':\n case 'webm':\n if ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {\n $creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );\n } elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {\n $creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];\n }\n break;\n\n case 'quicktime':\n case 'mp4':\n if ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {\n $creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];\n }\n break;\n }\n\n return $creation_date;\n}", "public function getCreatedDate() {\n return $this->get('created_date', 'user');\n }", "public function getCreateddate()\n {\n return $this->createddate;\n }", "public function getCreatetime()\n {\n return $this->createtime;\n }", "public function getCreationTimestamp()\n {\n return isset($this->creation_timestamp) ? $this->creation_timestamp : '';\n }", "public function getDateCreated()\n {\n return $this->date_created;\n }", "public function getDateCreated()\n {\n return $this->date_created;\n }", "public function getDateCreated()\n {\n return $this->_DateCreated;\n }", "public function getCreate_date(){\n return $this->create_date;\n }", "public function getFormattedCreateDate();", "public function getCreated()\n {\n if (! isset($this->created)) {\n $this->created = new DateTime($this->getXPath($this->getDom())->query($this->getCreatedQuery())->item(0)->value);\n }\n return $this->created;\n }", "public function getCreated() {\n\n $createdDateTime = \\DateTime::createFromFormat('Y-m-d H:i:s', $this->created);\n return $createdDateTime;\n\n }", "public function getCreatedDate()\n {\n return isset($this->CreatedDate) ? $this->CreatedDate : null;\n }", "public function getCreationDate() {\n\n return $this->u_creationdate;\n\n }", "public function getCreatedTime()\n\t{\n\t\treturn $this->createdTime; \n\n\t}", "public function mtime();", "public function getDateCreated() {\n return($this->dateCreated);\n }", "function getFormattedCreatedDate()\r\n {\r\n return $this->created_at->format('d/m/y');\r\n }", "public function getCreated() : string\n {\n return $this->created;\n }", "private function GetCreated()\n\t\t{\n\t\t\treturn $this->created;\n\t\t}", "public function getDocumentUploadDate() {\n return $this->document['uploadDate'];\n }", "public function get_timestamp() {\n\n\t\tif ( file_exists( $this->get_path( 'file' ) ) ) {\n\t\t\treturn filemtime( $this->get_path( 'file' ) );\n\t\t}\n\t\treturn false;\n\t}", "public function getCreated()\n {\n if (is_string($this->created))\n $this->created = new UDate($this->created);\n return $this->created;\n }", "public function forcreated(){\n $created = $this->created_at;\n $newcreated = date('d-m-Y',strtotime(str_replace('/', '-', $created)));\n return $newcreated;\n }", "public function getDateCreated()\n {\n if (isset($this->data['CreatedDate'])) {\n return $this->data['CreatedDate'];\n } else {\n return false;\n }\n }" ]
[ "0.72932124", "0.72480094", "0.720321", "0.71408266", "0.7059552", "0.70586413", "0.70328885", "0.70069546", "0.6985486", "0.6976184", "0.69675", "0.6966067", "0.69477665", "0.69477665", "0.6936046", "0.69286114", "0.6927667", "0.68929595", "0.68872654", "0.68763566", "0.68516254", "0.68496", "0.6839967", "0.68342954", "0.68342954", "0.68342954", "0.68342954", "0.68342954", "0.683216", "0.683216", "0.6820722", "0.68149483", "0.68142974", "0.68133867", "0.6799092", "0.6799092", "0.6799092", "0.67916447", "0.67759097", "0.6772079", "0.6736996", "0.6725329", "0.6725329", "0.6715871", "0.67126346", "0.66889685", "0.66828775", "0.6651423", "0.6646101", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6621658", "0.6618356", "0.6604089", "0.66030633", "0.6598491", "0.6591936", "0.6591722", "0.65901476", "0.65849733", "0.65761834", "0.6560565", "0.6560565", "0.6559843", "0.6522368", "0.6520122", "0.6519721", "0.6506559", "0.6504655", "0.6499896", "0.6497602", "0.6476389", "0.6471939", "0.6471423", "0.64687276", "0.64632523", "0.6454621", "0.645085", "0.64322054", "0.64281934", "0.64215636" ]
0.6927195
17
Sets this File's create date
public function setCreateDate($createDate) { $this->createDate = $createDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}", "public function setCreationDate($date) {}", "public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }", "public function setCreated($date) \n\t{\n\t\t$this->created = $this->parseDate($date);\n\t}", "public function setCreated($date)\n {\n $this->created = $date;\n }", "public function setCreationDate($date = true) {}", "public function setCreatedDate($date)\r\n\t\t{\r\n\t\t\t$this->_created_date = $date;\r\n\t\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function set_creation_date($created)\n {\n $this->set_default_property(self::PROPERTY_CREATION_DATE, $created);\n }", "public function setCreateDate(string $create_date): void\n {\n $this->create_date = $create_date;\n }", "protected function _syncCreationDate() {}", "private function SetCreated(\\DateTime $value)\n\t\t{\n\t\t\t$this->created = $value;\n\t\t}", "public function getCreateDate()\n {\n $this->create_date = null;\n\n return;\n }", "public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }", "public function setCreationDate(\\DateTime $creationDate) {\n\t\t$this->creationDate = $creationDate;\n\t}", "public function setDateCreated($value)\n {\n $this->validateDate('DateCreated', $value);\n $this->validateNotNull('DateCreated', $value);\n\n if ($this->data['date_created'] === $value) {\n return;\n }\n\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }", "function setCreateDate($inCreateDate) {\n\t\tif ( $inCreateDate !== $this->_CreateDate ) {\n\t\t\tif ( !$inCreateDate instanceof DateTime ) {\n\t\t\t\t$inCreateDate = new systemDateTime($inCreateDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreateDate = $inCreateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setCreateDate(int $create_date);", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2021-06-07 11:49:57') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setCreatedDate(DateTime $createdDate);", "function setCreateDate($inCreateDate) {\n\t\tif ( $inCreateDate !== $this->_CreateDate ) {\n\t\t\t$this->_CreateDate = $inCreateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = BangunanPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setDateCreated($data)\n {\n $this->_DateCreated=$data;\n return $this;\n }", "private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2020-04-16 09:40:03') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SekolahPaudPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setDate($value) {\n\t\t$this->_date = $value;\n\t}", "public function getCreateDate()\n\t{\n\t\treturn $this->CreateDate;\n\t}", "public function setCreationTime()\n {\n $this->userDateCreation = new \\DateTime(\"now\");\n $this->userDateLastConnection = new \\DateTime(\"now\");\n $this->userActive = 'true';\n $this->userAdmin = $this->userAdmin == 'true' ? 'true' : 'false';\n }", "public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }", "public function setCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('creationDateTime', $value);\n }", "public function setCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('creationDateTime', $value);\n }", "public function setCreatedAtValue()\n {\n $this->createdAt = new \\DateTime();\n }", "public function getCreateDate()\n {\n return $this->create_date;\n }", "public function setDateTime($value)\n {\n $this->createdAt=$value;\n }", "public function setCreatedAt()\n {\n $this->createdAt = new \\DateTime();\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }", "public function getCreatedDate()\r\n\t\t{\r\n\t\t\treturn date('m/d/Y', strtotime($this->_created_date));\r\n\t\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "function getCreateDate() {\n\t\treturn $this->_CreateDate;\n\t}", "public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function getCreationDate() \r\n { \r\n return $this->_creationDate; \r\n }", "public function setCreated($created) {\n\t\t$this->created = (string) $created;\n\t}", "public function setcreateDatetime($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->createdatetime !== null || $dt !== null) {\n $currentDateAsString = ($this->createdatetime !== null && $tmpDt = new DateTime($this->createdatetime)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->createdatetime = $newDateAsString;\n $this->modifiedColumns[] = ActionTypePeer::CREATEDATETIME;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setProcessCreationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('processCreationDateTime', $value);\n }", "public function setCreationDate($var)\n {\n GPBUtil::checkInt64($var);\n $this->creationDate = $var;\n\n return $this;\n }", "public function getCreationDate()\n {\n return $this->created;\n }", "public function setCreated($created);", "public function setCreated($created);", "public function getCreate_date(){\n return $this->create_date;\n }", "public function setCreationDate($var)\n {\n GPBUtil::checkInt64($var);\n $this->creation_date = $var;\n\n return $this;\n }", "public function setCreationDate($var)\n {\n GPBUtil::checkInt64($var);\n $this->creation_date = $var;\n\n return $this;\n }", "public function setCreatedDate(NostoDate $date)\n {\n $this->createdDate = $date;\n }", "public function setDate($date);", "public function setCreated($created)\n {\n $this->created = $created;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function getCreationDate()\n {\n return $this->creationDate;\n }", "public function set_date_created( $date = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $date ) ) {\n\n\t\t\t$datetime_string = wcs_get_datetime_utc_string( wcs_get_datetime_from( $date ) );\n\n\t\t\t// Don't use wp_update_post() to avoid infinite loops here\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d\", get_date_from_gmt( $datetime_string ), $datetime_string, $this->get_id() ) );\n\n\t\t\t$this->post->post_date = get_date_from_gmt( $datetime_string );\n\t\t\t$this->post->post_date_gmt = $datetime_string;\n\t\t}\n\t}", "public function setCreatedAt(DateTime $date);", "function get_creation_date()\n\t{\n\t\treturn $this->creation_date;\n\t}", "public function getCreationDate() {\n return $this->creationDate;\n }", "public function set_date_create($date_create) \n\t{\n\t\t$this->date_create = $date_create;\n\t\treturn $this;\n\t}", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreationDate()\n {\n return $this->creation_date;\n }", "public function getCreationDate() {\n\t\treturn $this->creationDate;\n\t}", "public function setDateCreated($value) : Job\n {\n $this->validateDate('DateCreated', $value);\n\n if ($this->data['date_created'] !== $value) {\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }\n\n return $this;\n }", "protected function _setDateCreated(XMLWriter $xml)\n {\n if (!$this->entry->getDateCreated()) {\n return;\n }\n\n $xml->writeElement(\n 'published', \n $this->entry->getDateCreated()->format(DateTime::RFC3339)\n );\n }", "function setCreatedDate($inCreatedDate) {\n\t\tif ( $inCreatedDate !== $this->_CreatedDate ) {\n\t\t\tif ( !$inCreatedDate instanceof DateTime ) {\n\t\t\t\t$inCreatedDate = new systemDateTime($inCreatedDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreatedDate = $inCreatedDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}", "public function getCreationDate();", "protected function createFile() {}", "public function getCreationDate() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->creationDate;\r\n\t}", "public function setDate($date){\n\t\t$this->date = $date;\n\t}", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }", "public function setCreated(\\DateTime $created = null)\n {\n $this->created = $created;\n }", "public function setCreate_date($create_date){\n $this->create_date = $create_date;\n return $this;\n }", "public function beforeCreate()\n {\n $this->created_at = date('Y-m-d H:i:s');\n }", "public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = date('Y-m-d');\n }", "public function set_dates(){\n // if the id is not set, this means its anew item being created\n if(property_exists($this, 'created_on') && empty($this->id)){\n $this->created_on = date('Y-m-d H:i:s');\n }\n\n // if id is set, its an update\n if(property_exists($this, 'last_updated_on') && isset($this->id)){\n $this->last_updated_on = date('Y-m-d H:i:s');\n }\n }" ]
[ "0.7488274", "0.717621", "0.7100362", "0.7076811", "0.70765835", "0.70547324", "0.7024293", "0.69406366", "0.69406366", "0.6851883", "0.6695069", "0.64633423", "0.64532626", "0.6452525", "0.6436888", "0.6428422", "0.6418315", "0.63860583", "0.6351244", "0.63465595", "0.6333029", "0.632045", "0.62887764", "0.62576395", "0.6228069", "0.62087387", "0.6188303", "0.6188303", "0.616414", "0.61449814", "0.6132923", "0.6122805", "0.61175907", "0.60859096", "0.60859096", "0.60761654", "0.6059622", "0.6027157", "0.60265493", "0.6024425", "0.6024425", "0.6024425", "0.6024425", "0.6024425", "0.6024425", "0.6024425", "0.6024425", "0.6022231", "0.6015544", "0.6015544", "0.60115004", "0.6006621", "0.6000254", "0.59996694", "0.5987477", "0.5985181", "0.5974115", "0.59623957", "0.59623957", "0.5961208", "0.5958104", "0.5958104", "0.59578663", "0.5957167", "0.5952685", "0.5943043", "0.5943043", "0.5943043", "0.5943043", "0.5943043", "0.59381545", "0.5937966", "0.59140635", "0.5913507", "0.59098077", "0.59066266", "0.59066266", "0.58934796", "0.58897865", "0.5886598", "0.5881298", "0.5881027", "0.58786833", "0.5857019", "0.585459", "0.5853611", "0.5843237", "0.5843237", "0.5843237", "0.5843237", "0.5843237", "0.5843237", "0.5843237", "0.5843237", "0.58397037", "0.58281106", "0.5824403", "0.5823357", "0.58145815" ]
0.6532661
11
Get the File's updated date
public function getUpdatedDate() { return $this->updatedDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "public function getUpdatedDate()\n {\n return $this->updated;\n }", "public function getLastModified()\n {\n return filemtime($this->getFileName());\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getUpdatedDate()\n {\n return $this->updated_date;\n }", "public function getLastModified() {\n\t\treturn filemtime($this->filename);\n\t}", "public static function last_updated($file)\n\t{\n\t\treturn filemtime($file);\n\t}", "public function get_date_modified();", "public function getDateUpdated() {\n return $this->dateUpdated;\n }", "function getLastModified()\n {\n $this->loadStats();\n return $this->stat['mtime'];\n }", "public function mtime();", "public function updateLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_WRITE_MODE);\n\t\t\n\t\t// Last update dateTime\n\t\t$date = new \\Datetime();\n\t\n\t\t// write the last update datetime\n\t\t$lastUpdateDateTime = fputs($lastUpdateStorageFile, $date->format('Y-m-d H:i:s'));\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function getModificationTime()\n {\n return $this->fileStructure->mtime;\n }", "public function getModified($file);", "public function getDateUpdated()\n {\n $rtn = $this->data['date_updated'];\n\n if (!empty($rtn)) {\n $rtn = new \\DateTime($rtn);\n }\n\n return $rtn;\n }", "public function get_timestamp() {\n\n\t\tif ( file_exists( $this->get_path( 'file' ) ) ) {\n\t\t\treturn filemtime( $this->get_path( 'file' ) );\n\t\t}\n\t\treturn false;\n\t}", "public static function getLastModified() {}", "public function getLastModified()\n {\n return ($this->item['mtime'] ? $this->item['mtime'] : ($this->item['ctime'] ? $this->item['ctime'] : time()));\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "function update_recently_edited($file)\n {\n }", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function updated_at()\n\t{\n return $this->date($this->updated_at);\n\t}", "public function updated_at()\n {\n return ExpressiveDate::make($this->updated_at)->getRelativeDate();\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "function getLastModified() {\n\t\treturn $this->getData('lastModified');\n\t}", "public function getModifiedTime()\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn filemtime($this->_path);\n\t}", "public function getUpdatedTime() {\r\n return $this->updated_time;\r\n }", "public function getLastModified(){\n return $this->lastModified;\n }", "public function getLastUpdated();", "public function getDateUpdate()\n {\n return $this->dateUpdate;\n }", "public function filetime() {\n return $this->info['filetime'];\n }", "public function updated_at()\n {\n return $this->date($this->updated_at);\n }", "private function _lastChanged ($file)\n {\n return filectime($file);\n }", "public function getLastModifiedTime();", "public function updatedAt(){\n return $this->_formatDate($this->updated_at);\n }", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModifiedDate() {\n\t\treturn date(\"d/m/Y\", strtotime($this->lastModifiedDate));\n\t}", "public function get_file_version($file_name = null) {\n return $this->wp_fs()->mtime($file_name);\n }", "function getLastModifiedDate() {\n\t\treturn $this->data_array['last_modified_date'];\n\t}", "public function getUpdate_date(){\n return $this->update_date;\n }", "public function getLastModified()\n {\n return $this->lastModified;\n }", "public function getFileTime() {\n /* filemtime — Gets file modification time */\n $xmlfile = FCPATH.\"sitemap.xml\";\n if (file_exists($xmlfile)) {\n return date(\"F d Y H:i:s.\", filemtime($xmlfile));\n }else{\n return FALSE;\n }\n }", "public function fileTime() { return $this->_m_fileTime; }", "public function getLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_ONLY_MODE);\n\t\n\t\t// read the first and unique line\n\t\t$lastUpdateDateTime = fgets($lastUpdateStorageFile);\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function getLastModified()\n {\n return $this->_lastModified;\n }", "function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}", "public function getUpdated(): \\DateTime\n {\n return $this->updated;\n }", "public function getDateModified();", "public function last_modified() {\n\t\treturn $this->timestamp;\n\t}", "public function getDateModified()\n {\n return $this->_DateModified;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getLastModifiedAt()\n {\n return $this->lastModifiedAt;\n }", "public function getDateLastUpdated()\n {\n if (isset($this->data['LastUpdatedDate'])) {\n return $this->data['LastUpdatedDate'];\n } else {\n return false;\n }\n }", "public function getModifed(): DateTime\n {\n $DateTime = new DateTime();\n $DateTime->createFromFormat('U', filemtime($this->filePath));\n return $DateTime;\n }", "public function lastModified();", "public function lastModified();", "public function getUpdated()\n {\n if (is_string($this->updated))\n $this->updated = new UDate($this->updated);\n return $this->updated;\n }", "public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}", "public function fileModified($path)\n {\n try {\n return Carbon::createFromTimestamp($this->disk->lastModified($path));\n } catch (\\Exception $e) {\n return Carbon::now();\n }\n }", "public function getModificationTime()\n {\n return ( $this->mtime ? $this->mtime : self::dosFormatToTimestamp( array( $this->lastModFileTime, $this->lastModFileDate ) ) );\n }", "function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}", "public function lastModification( ) {\n\n\t\treturn file_exists( $this->_path )\n\t\t\t? filemtime( $this->_path )\n\t\t\t: 0;\n\t}", "public function getUpdatedTime()\n {\n return $this->getAttribute('updatedTime');\n }", "public function getAssetFileLastModified()\n {\n if ($this->isAssetFilePathUrl()) {\n if (\n //Retrieve headers\n ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))\n //Assert return is OK\n && strstr($aHeaders[0], '200') !== false\n //Retrieve last modified as DateTime\n && !empty($aHeaders['Last-Modified']) && $oLastModified = new \\DateTime($aHeaders['Last-Modified'])\n ) {\n return $oLastModified->getTimestamp();\n } else {\n $oCurlHandle = curl_init($sAssetFilePath);\n curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);\n curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($oCurlHandle, CURLOPT_FILETIME, true);\n if (curl_exec($oCurlHandle) === false) {\n return null;\n }\n return curl_getinfo($oCurlHandle, CURLINFO_FILETIME) ? : null;\n }\n } else {\n \\Zend\\Stdlib\\ErrorHandler::start();\n $iAssetFileFilemtime = filemtime($this->getAssetFilePath());\n \\Zend\\Stdlib\\ErrorHandler::stop(true);\n return $iAssetFileFilemtime ? : null;\n }\n }", "public function getDateModified()\n {\n return $this->dateModified;\n }", "function last_version($file_name) {\n echo $file_name .\"?v=\". filemtime($file_name);\n}", "private function _lastModified ($file)\n {\n return filemtime($file);\n }", "public function getModeratorUpdatedDate();", "public function getUpdatedAt()\n {\n return $this->sys->getUpdatedAt();\n }", "public function getTimestampUpdated()\n {\n return $this->_getData(self::TIMESTAMP_UPDATED);\n }", "public function getLatestUpdateDate()\n {\n return $this->channel->getLatestUpdateDate();\n }", "public function getDateUpdated() : DateTime\n {\n $rtn = $this->data['date_updated'];\n\n if (!empty($rtn)) {\n $rtn = new DateTime($rtn);\n }\n\n return $rtn;\n }", "public function LastUpdated()\n\t{\n\t\treturn $this->LastUpdated;\n\t}", "public function fileModified($path)\n {\n return Carbon::createFromTimestamp($this->disk->lastModified($path));\n }", "protected function getTimeStamp(){\n\t\t$result = $this->getFile()->getProperty('tstamp');\n\t\tif ($this->processedFile) {\n\t\t\t$result = $this->processedFile->getProperty('tstamp');\n\t\t}\n\t\treturn $result;\n\t}", "public function getUpdated_at()\n {\n return $this->updated_at;\n }", "public function getUpdated_at()\n {\n return $this->updated_at;\n }", "public function getUpdated_at()\n {\n return $this->updated_at;\n }", "public function getUpdated_at()\n {\n return $this->updated_at;\n }", "public function getLastUpdatedFile(): string\n {\n $path = $this->getJsonTypeFolder();\n $this->lastUpdatedFile = $path . DIRECTORY_SEPARATOR . 'last-updated.php';\n return $this->lastUpdatedFile;\n }", "public function getModifiedDate() : \\DateTime {\n return $this->modifiedDate;\n }", "public function mtime()\n {\n }", "public function getAuthorUpdatedDate();", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }", "public function mtime()\n {\n }" ]
[ "0.79737306", "0.7540886", "0.7470075", "0.7413219", "0.7413219", "0.74103886", "0.74055135", "0.737792", "0.7353785", "0.73500276", "0.7248622", "0.72121924", "0.71836025", "0.7162533", "0.71474606", "0.71230936", "0.7099108", "0.70861804", "0.7065775", "0.706119", "0.706119", "0.706119", "0.706119", "0.7060144", "0.7059429", "0.7059429", "0.7059429", "0.70561373", "0.70484966", "0.70484966", "0.7043836", "0.7038499", "0.7015265", "0.7010988", "0.7006952", "0.70031554", "0.6995278", "0.6992845", "0.69905686", "0.69890016", "0.69889003", "0.6980877", "0.6980877", "0.6980877", "0.6980877", "0.6979979", "0.6974927", "0.69711655", "0.69670165", "0.6966161", "0.69634503", "0.6959617", "0.69578767", "0.6952896", "0.69511133", "0.694777", "0.69320303", "0.6930901", "0.6888537", "0.6886739", "0.6886739", "0.6886739", "0.6886739", "0.6886739", "0.6863375", "0.68593985", "0.68569076", "0.68569076", "0.6856662", "0.6846911", "0.68436044", "0.6839467", "0.68364584", "0.68081695", "0.6801958", "0.6801684", "0.6789435", "0.67806894", "0.67684567", "0.6763842", "0.67632425", "0.6755575", "0.6746674", "0.67361605", "0.6711492", "0.67084956", "0.67070127", "0.6704297", "0.6704297", "0.6704297", "0.6704297", "0.67034096", "0.669652", "0.66944945", "0.6694372", "0.6694306", "0.6693704", "0.6693704", "0.6693704" ]
0.74424446
3
Sets this File's updated date
public function setUpdatedDate($updatedDate) { $this->updatedDate = $updatedDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUpdated($date)\n {\n $this->updated = $date;\n }", "public function setUpdated($date) \n\t{\n\t\t$this->updated = $this->parseDate($date);\n\t}", "public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }", "private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}", "public function addUpdated()\n {\n try {\n $date = new DateTime();\n $this->updated_at = $date->format('Y-m-d H:i:s');\n $this->updated_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }", "public function setDateUpdated($value)\n {\n $this->validateDate('DateUpdated', $value);\n $this->validateNotNull('DateUpdated', $value);\n\n if ($this->data['date_updated'] === $value) {\n return;\n }\n\n $this->data['date_updated'] = $value;\n $this->setModified('date_updated');\n }", "public function setUpdated(\\DateTime $updated = null)\n {\n $this->updated = $updated;\n }", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function getUpdatedDate() {\n\t\treturn $this->updatedDate;\n\t}", "public function _update()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function getUpdatedDate()\n {\n return $this->updated;\n }", "public function getUpdatedDate()\n {\n return $this->updated_date;\n }", "public function setModifiedAt()\n {\n $this->modifiedAt = new \\DateTime();\n }", "protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }", "public function refreshUpdated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function updateUpdatedAt()\n {\n $this->setUpdatedAt(new \\Datetime());\n }", "private function setLastUpdateDate( $date ) {\n Mage::getModel('core/config')->saveConfig('taxjar/config/last_update', $date);\n }", "public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }", "private function updateUpdatedAtField() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof UpdatedAtField) {\n $this->$field_name = time();\n }\n }\n }", "protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getUpdateDate()\n {\n return $this->updateDate;\n }", "public function getModifiedDate()\n {\n $this->modified_date = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $this->modified_date =\n $this->temp_files[$this->path]->year . '-' .\n $this->temp_files[$this->path]->month . '-' .\n $this->temp_files[$this->path]->day . ' ' .\n $this->temp_files[$this->path]->time;\n\n return;\n }", "private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}", "public function beforeUpdate()\n {\n $this->owner->{$this->updatedAtField} = date($this->format);\n }", "public function getUpdate_date(){\n return $this->update_date;\n }", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}", "protected function _update()\n {\r\n $this->date_updated = new Zend_Db_Expr(\"NOW()\");\n parent::_update();\n }", "public function markLastUpdate()\n {\n if (!$this->updatedAtOveridden) {\n $this->updatedAt = new \\DateTime();\n }\n }", "public function updateLastUpdateDateTime() {\n\t\t// open file\n\t\t$lastUpdateStorageFile = fopen($this::LAST_UPDATE_STORAGE_FILE, $this::FILE_READ_WRITE_MODE);\n\t\t\n\t\t// Last update dateTime\n\t\t$date = new \\Datetime();\n\t\n\t\t// write the last update datetime\n\t\t$lastUpdateDateTime = fputs($lastUpdateStorageFile, $date->format('Y-m-d H:i:s'));\n\t\n\t\t// Close the file\n\t\tfclose($lastUpdateStorageFile);\n\t\n\t\treturn $lastUpdateDateTime;\n\t}", "public function refreshUpdated(): void\n {\n $this->setUpdatedAt(new \\DateTime());\n }", "function updateLastModifiedDate() {\n\t\t$res = db_query_params ('UPDATE artifact SET last_modified_date=EXTRACT(EPOCH FROM now())::integer WHERE artifact_id=$1',\n\t\t\tarray ($this->getID()));\n\t\treturn (!$res);\n\t}", "public function setUpdatedAtValue()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function setUpdatedAtValue()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function setUpdatedAtValue()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function setUpdated($updated);", "public function updated(File $file)\n {\n $file->modified_by = Auth::user()->id;\n\n $file->save();\n }", "protected function _setDateModified(XMLWriter $xml)\n {\n if (!$this->entry->getDateModified()) {\n throw new InvalidArgumentException(\n 'Atom 1.0 entry elements MUST contain exactly one'\n . ' atom:updated element but a modification date has not been set'\n );\n }\n\n $xml->writeElement(\n 'updated', \n $this->entry->getDateModified()->format(DateTime::RFC3339)\n );\n }", "public function setModifiedAt(DateTime $date);", "public function setLastUpdateAttribute($date)\n {\n $myDate = Carbon::createFromFormat('Y-m-d', $date);\n if ($myDate > Carbon::now()) {\n $this->attributes['last_update'] = Carbon::parse($date);\n } else {\n $this->attributes['last_update'] = Carbon::createFromFormat('Y-m-d', $date);\n }\n }", "public function setLastUpdateAttribute($date)\n {\n $myDate = Carbon::createFromFormat('Y-m-d', $date);\n if ($myDate > Carbon::now()) {\n $this->attributes['last_update'] = Carbon::parse($date);\n } else {\n $this->attributes['last_update'] = Carbon::createFromFormat('Y-m-d', $date);\n }\n }", "public function updateDate( Inx_Api_Recipient_Attribute $attr, $sValue );", "function getUpdateDate() {\n\t\treturn $this->_UpdateDate;\n\t}", "function setLastModified($dateModified) {\n\t\t$this->setData('lastModified', $dateModified);\n\t}", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function getDateUpdated()\n {\n return $this->date_updated;\n }", "public function onPreUpdate()\n {\n $this->modified_at = new \\DateTime(\"now\");\n }", "public function setModifiedDate($value) {\n if (is_string($value)) {\n try {\n $this->modifiedDate = new \\DateTime($value);\n } catch (\\Exception $ex) {\n $this->modifiedDate = null;\n }\n } elseif (is_a($value, '\\\\DateTime')) {\n $this->modifiedDate = $value;\n } else {\n $this->modifiedDate = null;\n }\n }", "public function getDateUpdated() {\n return $this->dateUpdated;\n }", "public function setDateUpdated($value) : Job\n {\n $this->validateDate('DateUpdated', $value);\n\n if ($this->data['date_updated'] !== $value) {\n $this->data['date_updated'] = $value;\n $this->setModified('date_updated');\n }\n\n return $this;\n }", "public function set_dates(){\n // if the id is not set, this means its anew item being created\n if(property_exists($this, 'created_on') && empty($this->id)){\n $this->created_on = date('Y-m-d H:i:s');\n }\n\n // if id is set, its an update\n if(property_exists($this, 'last_updated_on') && isset($this->id)){\n $this->last_updated_on = date('Y-m-d H:i:s');\n }\n }", "public function setLastUpdatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastUpdatedDateTime', $value);\n }", "public function refreshUpDated()\n {\n $this->setUpdated(new \\DateTime());\n }", "public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}", "public function setDateUpdated(\\DateTime $dateUpdated): self\n {\n $this->options['dateUpdated'] = $dateUpdated;\n return $this;\n }", "public function setDateUpdated(\\DateTime $dateUpdated): self\n {\n $this->options['dateUpdated'] = $dateUpdated;\n return $this;\n }", "public function preUpdate()\n {\n $this->dateUpdated = new \\DateTime();\n }", "function update_recently_edited($file)\n {\n }", "protected function _update()\n {\n $this->oxnews__oxdate->setValue(oxRegistry::get(\"oxUtilsDate\")->formatDBDate($this->oxnews__oxdate->value, true));\n\n\n parent::_update();\n }", "public function setUpdateDate(\\DateTime $updateDate)\n {\n $this->updateDate = $updateDate;\n }", "public function updatedTimestamps() {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n\n if ($this->getCreated() == null) {\n $this->setCreated(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "protected function _setDateModified(XMLWriter $xml)\n {\n if (!$this->feed->getDateModified()) {\n return;\n }\n\n $xml->writeElement(\n 'pubDate', \n $this->feed->getDateModified()->format(DateTime::RSS)\n );\n }", "public function setLastUpdated($lastUpdated);", "public function setUpdateViewedDate($value)\n {\n return $this->set('UpdateViewedDate', $value);\n }", "public function preUpdate()\n {\n $this->updated = new \\DateTime();\n }", "public function updatedTimestamps()\n {\n $this->setModifiedAt(new \\DateTime(date('Y-m-d H:i:s')));\n\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function setLastModifiedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('lastModifiedDateTime', $value);\n }", "public function onPreUpdate()\r\n {\r\n $this->updated_at = new \\DateTime(\"now\");\r\n }", "public function updatedTimestamps()\n {\n $this->setUpdatedAt(new \\DateTime(date('d-m-Y H:i')));\n\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('d-m-Y H:i')));\n }\n }", "public function updateTimestamps() {\r\n $this->setModifiedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n\r\n if ($this->getCreatedAt() == null) {\r\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\r\n }\r\n }", "function setUpdateDate($inUpdateDate) {\n\t\tif ( $inUpdateDate !== $this->_UpdateDate ) {\n\t\t\t$this->_UpdateDate = $inUpdateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function setUpdated(\\DateTime $updated)\n {\n $this->updated = $updated;\n\n return $this;\n }", "public function updateDatetime( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function setSetModifiedDate($value)\n {\n return $this->set('SetModifiedDate', $value);\n }", "protected function _syncModDate() {}", "public function setUpdateDate($var)\n {\n GPBUtil::checkInt64($var);\n $this->updateDate = $var;\n\n return $this;\n }", "public function setModificationDate($date = true) {}", "public function set_modification_date($modified)\n {\n $this->set_default_property(self::PROPERTY_MODIFICATION_DATE, $modified);\n }", "public function getDateUpdate()\n {\n return $this->dateUpdate;\n }", "public function setDateUpdated($date_updated)\n {\n $this->date_updated = $date_updated;\n\n return $this;\n }", "public function setDateUpdated($date_updated)\n {\n $this->date_updated = $date_updated;\n\n return $this;\n }", "public function updatedAt(){\n return $this->_formatDate($this->updated_at);\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function getDateUpdate()\n {\n return $this->date_update;\n }", "public function updatedTimestamps()\n {\n if($this->getCreatedAt() == null)\n {\n $this->setCreatedAt(new \\DateTime(date('Y-m-d H:i:s')));\n }\n }", "protected function setUpdatedTime($updated_time) {\r\n $this->updated_time = strtotime($updated_time);\r\n }", "public function preUpdate()\n {\n $this->dateModification = new \\DateTime();\n }", "public function setModificationTime( $timestamp )\n {\n $this->mtime = $timestamp;\n list( $this->properties[\"lastModFileTime\"], $this->properties[\"lastModFileDate\"] ) = self::timestampToDosFormat( $timestamp );\n }", "public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }", "public function onPreUpdate()\n {\n $this->updatedAt = new \\DateTime();\n }" ]
[ "0.74046516", "0.72501945", "0.6960901", "0.6888795", "0.6730107", "0.6699216", "0.6681694", "0.6663711", "0.6663711", "0.6657403", "0.6646336", "0.66407657", "0.66312075", "0.65520436", "0.654402", "0.65135026", "0.6505039", "0.6450629", "0.6433379", "0.64283615", "0.642747", "0.642747", "0.642747", "0.642747", "0.6418346", "0.6416102", "0.63863045", "0.63807523", "0.63736755", "0.63736755", "0.63653576", "0.6364225", "0.636112", "0.6353748", "0.6329349", "0.6318849", "0.6318849", "0.6318849", "0.6309937", "0.63094556", "0.6277585", "0.62754816", "0.6265136", "0.6265136", "0.6240953", "0.624003", "0.6228031", "0.622298", "0.622298", "0.62167984", "0.620169", "0.61864614", "0.6180867", "0.6174159", "0.6168389", "0.6157519", "0.6156939", "0.613073", "0.613073", "0.6115575", "0.6106187", "0.60959435", "0.60926735", "0.60898113", "0.60809714", "0.6073052", "0.60669154", "0.60543716", "0.6034488", "0.6034279", "0.6034279", "0.6034279", "0.6034279", "0.6034279", "0.6034279", "0.6032363", "0.60297996", "0.6025049", "0.60234386", "0.6012814", "0.60040593", "0.6000986", "0.59952843", "0.59928864", "0.5990245", "0.59844023", "0.5980536", "0.5978823", "0.5978823", "0.5978498", "0.5959965", "0.5959965", "0.59595966", "0.5958173", "0.59469366", "0.59427345", "0.5940655", "0.59383225", "0.59383225" ]
0.68910587
3
Get the File's title
public function getTitle() { return $this->title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getTitle() {\n\t\t$result = $this->getFile()->getProperty('title');\n\t\tif (empty($result)) {\n\t\t\t$result = $this->getFile()->getName();\n\t\t}\n\t\treturn htmlspecialchars($result);\n\t}", "protected function getTitle() {\n\t\t$result = $this->overlayFile->getProperty('title');\n\t\tif (empty($result)) {\n\t\t\t$result = $this->overlayFile->getName();\n\t\t}\n\t\treturn htmlspecialchars($result);\n\t}", "public function titleFile($id, $file);", "public function title()\n {\n if ($this->title === null) {\n $this->title = $this->translator()->translation('filesystem.library.media');\n }\n\n return $this->title;\n }", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "public function getTitle()\n {\n return $this->originalAsset->getTitle();\n }", "public function getTitle() {\n\t\treturn (string) $this->photo->title;\n\t}", "public function getTitleFileVideo()\n\t {\n\t return $this->titleFileVideo;\n\t }", "public function getFilename() {\n return $this->getData('file');\n }", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "public function getName()\n {\n return $this->file['name'];\n }", "public function get_file_name() {\n\t\treturn $this->file;\n\t}", "function getName() {\n\t\treturn $this->data_array['filename'];\n\t}", "function GetFileName() {\n \treturn $this->FilePost[$this->ObjClientSide]['name'];\n }", "public function name() : string {\n return $this->file->name;\n }", "public function getDocumentTitle() {\n return $this->document['title'];\n }", "public function getFileName()\n {\n $value = $this->get(self::FILENAME);\n return $value === null ? (string)$value : $value;\n }", "public function getFileName() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"filename\", FALSE);\n\t}", "public function getName()\n {\n return $this->_path['filename'];\n }", "public function getName()\n {\n return $this->file->getName();\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "protected function ___filename() {\n\t\treturn $this->pagefiles->path . $this->basename;\n\t}", "public function getFilename() {}", "protected function _getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "protected function _getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getFilename();", "public function getFilename();", "public function getFileName() {\n return $this->name;\n }", "public function filename() : string {\n return $this->name;\n }", "public function getName(){\n if ($this->file)\n return $this->file->getName();\n }", "public function getTitle()\n {\n return $this->getField('Title');\n }", "function filename($title,$name){\n return $name;\n}", "public static function getTitle()\n {\n return self::$title;\n }", "public function getFileName()\n {\n return $this->filename;\n }", "public function getFileName()\n {\n return $this->filename;\n }", "public function getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "function getTitle() {\n return $this->document->getTitle();\n }", "public function getTitle()\n\t{\n\t\t$content = $this->getContent();\n\t\treturn $content->title;\n\t}", "protected function _getAssetTitle()\n {\n return $this->title;\n }", "protected function _getAssetTitle()\n {\n return $this->title;\n }", "public function getFileName()\n {\n return basename($this->file, '.' . $this->getExtension());\n }", "public function getTitle()\n {\n return $this->getData(self::TITLE);\n }", "function getFilename();", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->filename;\n }", "public function getFileName() {\n\t\treturn $this->filename;\n\t}", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "public function getFileName();", "public function getFileName();", "public function getFileName();", "public function title() {\r\n\t\treturn trim(strtok($this->_content, \"\\n\"));\r\n\t}", "public function getFileName()\n {\n return $this->language.'/'.strtolower($this->getName());\n }", "public function extractFileName(): string\n {\n $name = $this->extractMeta('name') ?: $this->extractMeta('filename');\n\n if ( ! $this->isValidFilename($name)) {\n return '';\n }\n\n return $name;\n }", "public function getFilename() : string\n {\n return $this->fileName;\n }", "public function getFilename() {\n return $this->filename;\n }", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function getFileName()\n\t{\n\t\treturn $this->fileName;\n\t}", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}", "public function title()\n\t{\n\t\treturn $this->lang->words['upload_emoticon'];\n\t}", "public function getTitle() {\n return wb_get_text($this->controlID);\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename(): string\n {\n return $this->filename;\n }", "public function getFilename()\n {\n return $this->_filename;\n }", "public function get_title()\n\t{\n\t\treturn $this->title;\n\t}", "static public function getTitle() {\n\t\treturn self::$page_title;\n\t}", "public function getFilename()\n\t\t{\n\t\t\treturn $this->filename;\n\t\t}", "public function getHeader()\n {\n return $this->getFilename();\n }", "public function title()\n {\n return $this->resource->getName();\n }", "public function getFileName()\n {\n return basename($this->path);\n }", "public function getFilename()\r\n {\r\n return pathinfo($this->filename, PATHINFO_BASENAME);\r\n }", "public function getTitle()\n {\n return $this->get(self::_TITLE);\n }", "public function getTitle()\n {\n return $this->get(self::_TITLE);\n }", "public function getFileName() {\n\t\treturn $this->_pidFile;\n\t}", "protected function getFileName() {\n // Full file path.\n $path = $this->urls[$this->activeUrl];\n\n // Explode with the '/' to get the last element.\n $files = explode('/', $path);\n\n // File name without extension.\n $file_name = explode('.', end($files))[0];\n return $file_name;\n }", "public function getDocTitle()\n {\n return $this->doc_title;\n }", "public function fileName()\n {\n return $this->getCleanString(self::$_file_name_clean);\n }", "public function getTitle()\n {\n return $this->formattedData['title'];\n }", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getFilename() {\n\t\treturn $this->filename;\n\t}", "public function getTitle()\n {\n return $this->getData('title');\n }", "public static function getName()\n\t{\n\t\treturn self::$filename;\n\t}", "public function getFilename()\n\t\t{\n\t\t\treturn $this->_fileName;\n\t\t}", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getFileName()\n {\n return $this->fileName;\n }", "public function getTitle(): string {\n\t\treturn $this->title;\n\t}", "public function title(): string {\n\t\treturn $this->m_title;\n\t}", "function getFilename()\n {\n return $this->filename;\n }", "public function getTitle()\n {\n return str_replace([' ', '?', '/', '\\\\', '&'], '_', $this->info['title']);\n }", "public function getTitle()\n {\n return $this->getValue('title');\n }", "public function getFileName()\n {\n $fileName = $this->getInfo('fileName');\n if (!$fileName) {\n $fileName = $this->getInfo('title');\n }\n if (!$fileName) {\n $fileName = Zend_Controller_Front::getInstance()->getRequest()->getParam('controller') . '-' . date(\"Ymd\");\n }\n return $fileName . '.csv';\n }", "public function getFileName() {\n\t \t return $this->fileName;\n\t }", "public function filename() {\n\t\treturn $this->wire('hooks')->isHooked('Pagefile::filename()') ? $this->__call('filename', array()) : $this->___filename();\n\t}", "public function getTitle(): string\n {\n return $this->_title;\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }" ]
[ "0.84242594", "0.7946734", "0.75137234", "0.74333835", "0.737744", "0.731556", "0.7256094", "0.7244767", "0.7210806", "0.7189557", "0.71842426", "0.71043015", "0.70991385", "0.70330787", "0.7028023", "0.7017188", "0.70151955", "0.70100355", "0.70055497", "0.69913846", "0.6960009", "0.69560885", "0.6955512", "0.69490695", "0.69490695", "0.6938256", "0.6938256", "0.69111973", "0.6906705", "0.69063795", "0.69046336", "0.688595", "0.688507", "0.68844867", "0.68844867", "0.6880238", "0.6875125", "0.6863346", "0.68582106", "0.68582106", "0.6850172", "0.68484", "0.6842182", "0.6839205", "0.6839205", "0.6839205", "0.6839205", "0.6839205", "0.6839205", "0.6838596", "0.68344617", "0.6830435", "0.6830435", "0.6830435", "0.6822203", "0.68155265", "0.68101865", "0.6809699", "0.6807425", "0.6805993", "0.6805993", "0.68056166", "0.67931634", "0.6791842", "0.6787593", "0.6787593", "0.6786171", "0.67847896", "0.67847097", "0.67835", "0.6780128", "0.6774287", "0.67701775", "0.6763838", "0.6763084", "0.6763084", "0.6759799", "0.6750536", "0.6746054", "0.6742021", "0.67416185", "0.6741461", "0.6741461", "0.6740438", "0.6733798", "0.67293024", "0.67268145", "0.67268145", "0.67268145", "0.67268145", "0.67268145", "0.6725587", "0.67155665", "0.67120206", "0.6710454", "0.6709972", "0.67093337", "0.6706145", "0.6703275", "0.67020965", "0.66997516" ]
0.0
-1
Sets this File's title
public function setTitle($title) { $this->title = $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\n\t\t$this->_title = $title;\n\t}", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "public function setTitle($title)\r\n\t\t{\r\n\t\t\t$this->_title = $title;\r\n\t\t}", "function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title) {\r\n $this->title = $title;\r\n }", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "public function setTitle($var)\n {\n $this->_title = $var;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title) {\n\t\t\n\t\t\t$this->_title = $title;\n\t\t\n\t\t}", "function setTitle($title)\r\n\t{\r\n\t\t$this->title = $title;\r\n\t}", "public function setTitle($title) {\n $this->title = $title ;\n }", "public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "public function setTitle($title){\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title){\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "function setTitle($title)\n {\n $this->m_title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "public function setTitle($title){\n \t$this->title = $title;\n }", "public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}", "public function setTitle($title = ''){\n $this->setVar('TITLE', $title);\n }", "public function set_title($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = (string) $title;\n }", "public function setTitle($title) {\n\t\t$title = str_replace(\"\\r\\n\", \"|\", $title);\n\t\t$title = str_replace(\" \", \"+\", $title);\n\t\t$this -> setProperty('chtt', $title);\n\t}", "public function setTitle(string $title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($value)\n {\n $this->_title = $value;\n }", "function setTitle($a_title)\n\t{\n\t\t$this->title = $a_title;\n\t}", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}", "function set_the_title($title) {\n\n md_set_the_title($title);\n \n }", "public static function setTitle(string $title) {}", "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "public function setTitle($t){\n\t\t$this->title = $t;\n\t}", "public function setTitle(string $title): void\n {\n $this->_title = $title;\n }", "public function set_pagetitle($title)\n {\n $this->pagetitle = $title;\n }", "public function setTitle($title){\n $this->p_title = $title;\n }", "public function setTitle(string $title): void {\n\t\t$this->m_title = $title;\n\t}", "public function setTitle(string $title);", "public function setTitle($title)\n\t{\n\t\tif (!empty($title)) {\n\t\t\t$this->title = $title;\n\t\t}\n\t}", "function SetTitle($title, $isUTF8 = false) {\n parent::SetTitle($title, $isUTF8);\n $this->title = ($isUTF8 ? utf8_encode($title) : $title);\n }", "public function setTitle($value)\n {\n $this->title = $value;\n }", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "public function setTitle(string $title)\n {\n if (strlen($title) > 3) {\n $this->title = $title;\n }\n }", "function setTitle(string $title): void\n {\n $this->data['head']['title'] = $title;\n }", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "public function set_title($text){\n $this->title=$text;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->setValue('title', $title);\n }", "public function set_title($title)\n {\n $this->set_default_property(self::PROPERTY_TITLE, $title);\n }", "public function set_name($title)\n {\n if (!empty($title)) {\n $this->title = Database::escape_string($title);\n }\n }", "private function setTitle(\\Scrivo\\Str $title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title){\n\t\t$this->mail_title = $title;\n\t}", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function setTitle($var)\n {\n GPBUtil::checkString($var, True);\n $this->title = $var;\n\n return $this;\n }", "public function titleFile($id, $file);", "public function setTitle($title)\n {\n if(strlen($title) <= 50 && strlen($title) > 0 && preg_match('#^[a-zA-Z0-9- ]*$#', $title)) {\n $this->title = $title;\n }\n }", "function setTitle($title)\n\t{\n\t\t$this->table->title = $title;\n\t\t$this->record->title = $title;\n\t}", "public function set_title($title){\n\t\t$this->set_channel_element('title', $title);\n\t}", "public function setTitle($title, $encoding = 'UTF-8') {}", "public function setTitle($title, $encoding = 'UTF-8') {}", "public function _syncTitle() {}", "public function setTitle($title) {\n\t\t// if passed in title is not between 1 and 255 characters\n\t\tif(strlen($title) < 1 || strlen($title) > 255) {\n\t\t\tthrow new TaskException(\"Task title error\");\n\t\t}\n\t\t$this->_title = $title;\n\t}", "public function setTtitle($title)\n {\n $this->title = $title;\n }" ]
[ "0.7674066", "0.7674066", "0.76688296", "0.7656986", "0.764267", "0.7617649", "0.7606191", "0.7595769", "0.7585626", "0.75767344", "0.7568053", "0.75666803", "0.75615", "0.75615", "0.75508237", "0.7541058", "0.7538982", "0.7538589", "0.75334555", "0.75137985", "0.7505814", "0.7505814", "0.7505814", "0.7504801", "0.7502081", "0.7502081", "0.7500074", "0.74974567", "0.7492126", "0.7480761", "0.7480761", "0.74741066", "0.7467707", "0.7467707", "0.7467707", "0.7467707", "0.7467707", "0.7467707", "0.74625695", "0.7436638", "0.73984367", "0.737006", "0.7367195", "0.7333535", "0.73178625", "0.73110956", "0.7307063", "0.72881806", "0.7281135", "0.7281135", "0.7281135", "0.7281135", "0.7281135", "0.7281135", "0.7281135", "0.72802126", "0.7274691", "0.7256724", "0.72541875", "0.7246392", "0.7240945", "0.72385025", "0.7211705", "0.7197531", "0.7176728", "0.7174682", "0.7172367", "0.7163759", "0.7155756", "0.7155756", "0.7153497", "0.71412677", "0.71320075", "0.7129699", "0.71245575", "0.71245575", "0.71245575", "0.71245575", "0.7120683", "0.71017325", "0.70912516", "0.7071169", "0.70037585", "0.6997294", "0.6997294", "0.6997294", "0.6997294", "0.6997294", "0.6997294", "0.699455", "0.6986908", "0.69671965", "0.6964583", "0.69638205", "0.69631684", "0.6954561", "0.69511753", "0.6948762" ]
0.7559063
16
Get the File's description
public function getDescription() { return $this->description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_file_description($file)\n {\n }", "public function get_description() {\n\t\t\t$path = $this->git_directory_path();\n\t\t\treturn file_get_contents($path.\"/description\");\n\t\t}", "public function getDescriptionAction()\n {\n $content = null;\n try {\n $content = $this->dms()->getService()->getInfo($this->params('file'), 'description');\n } catch (NoFileException $e) {\n $content = $e->getMessage();\n }\n\n return $this->getResponse()->setContent($content);\n }", "function get_desc_file_fields() {\n\treturn array (\n\t\t\t\"Taxonomic name (Name)\",\n\t\t\t\"Diagnostic Description\",\n\t\t\t\"Distribution\",\n\t\t\t\"Habitat\",\n\t\t\t\"Size\",\n\t\t\t\"Habitus image\",\n\t\t\t\"Morphological Description\",\n\t\t\t\"Habitat image\",\n\t\t\t\"Simlar Species (Name)\",\n\t\t\t\"Pronotum image\",\n\t\t\t\"Elytral microsculpture\",\n\t\t\t\"Genitalia left image\",\n\t\t\t\"General description\",\n\t\t\t\"Genetics\" \n\t);\n}", "public static function getDescription();", "public static function getDescription()\n {\n return self::$description;\n }", "public static function description () {\n\t\treturn Array(\n\t\t\t'maxSize'=>self::DE('integer', 'The max file size in bytes. 0 indicates there is no limit', '0'),\n\t\t\t'includeInEmail'=>self::DE('bool', 'Send this file to the email recipients as an attachment', 'true'),\n\t\t\t'uploadDir'=>self::DE('path', 'The path to upload the file(s) to', '\\'uploads/\\''),\n\t\t\t'allowMultiple'=>self::DE('bool', 'Allows this form item to upload multiple files.', 'false'),\n\t\t\t'maxFiles'=>self::DE('integer', 'If allowMultiple is allowed, the number of files to allow', '1'),\n\t\t\t'acceptableExtensions'=>self::DE('array', 'A list of acceptable extensions (case insensitive)', 'Array()'),\n\t\t);\n\t}", "function getDescription() {\n\t\tswitch ($this->type) {\n\t\t\tcase PAYMENT_TYPE_PURCHASE_FILE:\n\t\t\t\treturn __('payment.directSales.monograph.description');\n\t\t\tdefault:\n\t\t\t\t// Invalid payment ID\n\t\t\t\tassert(false);\n\t\t}\n\t}", "function getDescription() ;", "public function getDescription() {\n\t\treturn 'Copy a file from a local or remote place to a local folder';\n\t}", "public function get_description() {\r\n\t\treturn $this->get_name();\r\n\t}", "function getDescription()\n {\n $description = '\n\t\tThis is the template installation type. Change this text within the file for this installation type.';\n return $description;\n }", "public function getDescription() {\n\t\treturn self::$_description;\n\t}", "public function description()\n\t{\n\t\treturn $this->lang->words['upload_emoticon'];\n\t}", "function getDescription() {\n\t\tif( !($ret = $this->getField( 'summary' )) ) {\n\t\t\t$ret = $this->getField( 'data' );\n\t\t}\n\t\treturn $ret;\n\t}", "public static function getDescription(): string\n {\n return static::$description;\n }", "function getDescription();", "public static function description()\n {\n return static::$_description;\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription(): string\n\t{\n\t\treturn $this->description;\n\t}", "protected function getDescription() {\r\n\t\treturn $this->description;\r\n\t}", "public function getDescription(): string\r\n {\r\n return $this->description;\r\n }", "public function getDesciption();", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {\n return $this->_get( 'description' );\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription(): string\n {\n return $this->description;\n }", "public function getDescription() : string\n {\n return $this->_description;\n }", "public function getDescription()\n {\n $this->parseDocBlock();\n return $this->description;\n }", "public function getDescription()\n\t{\n\t\treturn $this->_description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "public function getDescription()\n\t{\n\t\treturn $this->description;\n\t}", "function getDescription() {\n\t\treturn $this->data_array['description'];\n\t}", "public function getDescription() {\n return $this->desc;\n }", "public abstract function getDescription();", "public function getDescription() {\n\t\treturn $this->_description;\n\t}", "public function getDescription()\n {\n return $this->getHeaderFieldModel('Content-Description');\n }", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription(): string;", "public function getDescription() : string\n {\n return $this->description;\n }", "public function getDescription() : string\n {\n return $this->description;\n }", "public function getDescription() : string\n {\n return $this->description;\n }", "public function getDescription()\r\n {\r\n return $this->_description;\r\n }", "public function getDescription()\r\n {\r\n return $this->_description;\r\n }", "public function getDescription()\n {\n $headers = $this->getDefaultHeaders();\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo,\n array(\n \"headers\" => $headers\n )\n );\n\n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body[\"description\"];\n }\n return '';\n }", "public function getDescription()\n {\n return $this->__get(self::FIELD_DESCRIPTION); \n }", "public function getDescription()\n {\n return isset($this->description) ? $this->description : '';\n }" ]
[ "0.8713992", "0.7651977", "0.75235856", "0.736979", "0.706772", "0.68714", "0.68405735", "0.6834574", "0.68128705", "0.6788961", "0.6770136", "0.675297", "0.6742858", "0.6736958", "0.673504", "0.6730535", "0.67258155", "0.6723226", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.671352", "0.6691643", "0.6689286", "0.6678171", "0.66746676", "0.66663426", "0.66663426", "0.66663426", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.6664649", "0.66641206", "0.6657502", "0.6657502", "0.6657502", "0.6657502", "0.6657502", "0.6657502", "0.6657502", "0.6657502", "0.6655682", "0.6639267", "0.6625308", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.66231245", "0.6617325", "0.661682", "0.660557", "0.6604867", "0.6604457", "0.66030264", "0.66030264", "0.66030264", "0.66030264", "0.66030264", "0.66030264", "0.6602751", "0.6602751", "0.6602751", "0.6602053", "0.6602053", "0.6599238", "0.65977895", "0.6596732" ]
0.65969515
98
Sets this File's description
public function setDescription($description) { $this->description = $description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_description($new) {\n\t\t\t$path = $this->git_directory_path();\n\t\t\tfile_put_contents($path.\"/description\", $new);\n\t\t}", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "function setDescription( $value )\r\n {\r\n $this->Description = $value;\r\n }", "public function setDescription($desc) {\n\t\t$this->description = $desc;\n\t}", "protected function setDescription($description) {\r\n $this->description = $description;\r\n }", "protected function assignDescription()\n {\n $this->description = 'This is a test for a Template Variable migration class';\n }", "function setDescription($description) {\n\t\t$this->description = $description;\n\t}", "public function setDescription($desc)\n {\n $this->description = $desc;\n }", "protected function assignDescription()\n {\n $this->description = '';\n }", "public function setDescription($description){\n\t\t$this->description = $description;\n\t}", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "public function setDescription($description) {\n $this->_description = $description;\n }", "protected function setDescription() {\r\n\t\t$descriptionCrop = intval($this->settings['news']['semantic']['general']['description']['crop']);\r\n\t\t$descriptionAction = $this->settings['news']['semantic']['general']['description']['action'];\r\n\t\t$descriptionText = $this->newsItem->getTeaser();\r\n\t\tif (empty($descriptionText)) {\r\n\t\t\t$descriptionText = $this->newsItem->getBodytext();\r\n\t\t}\r\n\t\tif (!empty($descriptionText) && !empty($descriptionAction)) {\r\n\t\t\tif (!empty($GLOBALS['TSFE']->page['description'])) {\r\n\t\t\t\tswitch ($descriptionAction) {\r\n\t\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t\t$descriptionText .= ': ' . $GLOBALS['TSFE']->page['description'];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 'append':\r\n\t\t\t\t\t\t$descriptionText = $GLOBALS['TSFE']->page['description'] . ': ' . $descriptionText;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$this->description = $this->contentObject->crop($descriptionText, $descriptionCrop . '|...|' . TRUE);\r\n\t\t}\r\n\t}", "public function setDescription( $description )\r\n\t{\r\n\t\t$this->description = $description;\r\n\t}", "public function setDescription($description)\r\n {\r\n $this->description = $description;\r\n }", "public function setDescription($description)\n\t{\n\t\t$this->_description = $description;\n\t}", "public function setDescription($description)\n {\n $this->_description = $description;\n }", "public function setDescription($description) {\n $this->description = $description;\n }", "public function setDescription(string $description)\n {\n $this->description = $description;\n }", "function setDescription( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Description = $value;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description)\n {\n $this->description = $description;\n }", "public function setDescription($description) \n\t{\n \n $this->description = empty($description) ? \"\" : $description;\t\n\t}", "public function setDescription($value) {\n\t\tif($value == \"\") { $value = \"None\"; }\n\t\tself::$_description = $value;\n\t}", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n }", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription($description);", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription(?string $value): void {\n $this->getBackingStore()->set('description', $value);\n }", "public function setDescription($desc, $encoding = 'UTF-8') {}", "public function setDescription(string $description)\n {\n $this->description = $description;\n }", "public function setDescription($value)\n {\n $this->setItemValue('description', (string)$value);\n }", "function set_description($description)\r\n {\r\n $this->set_default_property(self :: PROPERTY_DESCRIPTION, $description);\r\n }", "public function setDescription( string $desc=NULL ) : Asset\n {\n $this->getProperty()->description = $desc;\n return $this;\n }", "public function setDescription( string $desc=NULL ) : Asset\n {\n $this->getProperty()->description = $desc;\n return $this;\n }", "public function setDesciption($description);", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "public function setDescription($val)\n {\n $this->_propDict[\"description\"] = $val;\n return $this;\n }", "function setDescription($desc)\n {\n if (strlen($desc) > 1024) {\n throw new InvalidArgumentException('Input must be 1024 characters or less\n in length!');\n }\n $this->_description = $desc;\n }", "public function setDescription(DescriptionDescriptor $description): void;", "function set_description($description)\n {\n $this->set_default_property(self :: PROPERTY_DESCRIPTION, $description);\n }", "public function testAssignDescription()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "function setHeadDescription($var)\n\t{\n\t\t$this -> head_description = $var;\n\t}", "public function setDescription($sDesc)\n {\n $this->sTempalteDesc = $sDesc;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }", "public function setDescription($var)\n {\n GPBUtil::checkString($var, True);\n $this->description = $var;\n\n return $this;\n }" ]
[ "0.74998707", "0.7360755", "0.7360755", "0.7274152", "0.72487634", "0.71985716", "0.71978563", "0.7124631", "0.7115616", "0.71056825", "0.7102226", "0.7064539", "0.7059225", "0.70320034", "0.7001273", "0.6997573", "0.69902146", "0.6964792", "0.6956323", "0.6915812", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6895538", "0.6856864", "0.6846222", "0.6843055", "0.68165594", "0.68165594", "0.68165594", "0.68165594", "0.68165594", "0.68165594", "0.6757252", "0.6757252", "0.6757252", "0.6757252", "0.6757252", "0.6757252", "0.6757252", "0.6757252", "0.67405105", "0.6728365", "0.67230564", "0.67042774", "0.6697019", "0.6697019", "0.66935235", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6688012", "0.6676343", "0.6670224", "0.66593117", "0.66573155", "0.6653716", "0.66356236", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347", "0.66341347" ]
0.7022174
14
Get the File's original resource
public function getOriginalFileResource() { return $this->originalFileResource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOriginalResource()\n {\n return isset($this->original_resource) ? $this->original_resource : null;\n }", "public function getOriginalResource() {\n\t\treturn $this->originalResource;\n\t}", "public function getOriginalResource()\n {\n return $this->resource;\n }", "public function getOriginalFile() {}", "public function getOriginalFile() {}", "private function getOriginalImage()\n {\n return $this->getDisk()->get($this->path);\n }", "public function getOriginalAsset()\n {\n return $this->originalAsset;\n }", "public function getOriginalFile() {\n $file = $this->getPath() . DS . $this->getFile();\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n header(\"Content-Type: \". $mimetype);\n readfile($file);\n }", "protected function getResource()\n {\n if (is_resource($this->path)) {\n return $this->path;\n }\n\n if (!$this->isRemoteFile() && !is_readable($this->path)) {\n throw new TelegramSDKException('Failed to create InputFile entity. Unable to read resource: '.$this->path.'.');\n }\n\n return Psr7\\Utils::tryFopen($this->path, 'rb');\n }", "public function getOriginalFileContent()\n {\n return $this->originalFileContent;\n }", "public function getSource()\n {\n return Yii::$app->storage->fileAbsoluteHttpPath($this->filter_id . '_' . $this->file->name_new_compound);\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function get_file() {\n\t\treturn $this->file;\n\t}", "function get_file()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile() {\n return $this->getFiles()->getFirst();\n }", "public function getResource()\n {\n return $this->resource ?: parent::getResource();\n }", "public function getModifiedResource()\n {\n return isset($this->modified_resource) ? $this->modified_resource : null;\n }", "public function get_file()\n {\n return $this->file;\n }", "public function getFile(): string\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->getAbsolutePath($this->avatarName);\n }", "public function getResource() {}", "function getFile() {\n\t\treturn ArtifactStorage::instance()->get($this->getID());\n\t}", "public function getFile() {\n return $this->file;\n }", "public function getFile() {\n return $this->file;\n }", "public function getFile()\n {\n return $this->_File;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getFile()\n {\n return $this->file;\n }", "public function getResource(): string\n {\n return $this->resource;\n }", "public function getResource(): string\n {\n return $this->resource;\n }", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile() {\n\n return $this->file;\n }", "protected function get_file() {\r\n\t\t$file = '';\r\n\r\n\t\tif ( @file_exists( $this->file ) ) {\r\n\t\t\tif ( ! is_writeable( $this->file ) ) {\r\n\t\t\t\t$this->is_writable = false;\r\n\t\t\t}\r\n\r\n\t\t\t$file = @file_get_contents( $this->file );\r\n\t\t} else {\r\n\t\t\t@file_put_contents( $this->file, '' );\r\n\t\t\t@chmod( $this->file, 0664 );\r\n\t\t}\r\n\r\n\t\treturn $file;\r\n\t}", "public function getOriginal(Template $template)\n {\n return $this->getFilePath($template->getType(), $template->getName());\n }", "public\n function getOriginalPath()\n {\n return $this->originalsPath;\n }", "public function getFile():string {\n\t\t\treturn $this->file;\n\t\t}", "public function getOriginalFile(){\n if(isset($_FILES['Immagine']['name'])){\n return $_FILES['Immagine']['name'];\n }else{\n return false;\n }\n }", "public function getFile()\n\t{\n\t\treturn $this->file; \n\n\t}", "public function sourceFile() {\n return $this->loader\n ? $this->loader->getResourceAsStream(strtr($this->name, '.', '/').'/package-info.xp')\n : NULL\n ;\n }", "public function getFile(): string\n {\n return $this->filePath;\n }", "public function getOriginalFilename()\n\t{\n\t\treturn $this->googleDriveFile->getOriginalFilename();\n\t}", "public function file() {\n return $this->file;\n }", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "public function file()\n {\n return rtrim($this->destinationPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$this->fileName;\n }", "protected function get_file() {\n\n\t\t$file = '';\n\n\t\tif ( @file_exists( $this->file ) ) {\n\n\t\t\tif ( ! is_writeable( $this->file ) ) {\n\t\t\t\t$this->is_writable = false;\n\t\t\t}\n\n\t\t\t$file = @file_get_contents( $this->file );\n\n\t\t} else {\n\n\t\t\t@file_put_contents( $this->file, '' );\n\t\t\t@chmod( $this->file, 0664 );\n\n\t\t}\n\n\t\treturn $file;\n\t}", "protected function get_file() {\n\n\t\treturn __FILE__;\n\t}", "public function getResource()\n {\n return $this->_resource;\n }", "public function file()\n {\n return $this->file;\n }", "public function getCurrentFile()\n {\n return $this->currentFile;\n }", "public function getPath(): string {\n $meta_data = stream_get_meta_data($this->file);\n return $meta_data[\"uri\"];\n }", "protected static function _get_local_resource( $resource ) {\r\n return file_get_contents( \r\n $resource \r\n ); \r\n }", "public function GetSourceResource()\n {\n return $this->_sourceResource;\n }", "public function getMediaFileUnwrapped()\n {\n return $this->readWrapperValue(\"media_file\");\n }", "public function getRawValue ()\n {\n return $this->files->getFile( $this->getName() );\n }", "public function getFilename()\n {\n return $this->target->getUri();\n }", "public function getCurrentFile() {}", "public function getCleanFile()\n {\n return $this->_getCleanProperty('file');\n }", "public function get_file() {\n\t\treturn __FILE__;\n\t}", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getCaminhoReal()\n {\n return $this->arquivo->getRealPath();\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "public function getResource()\n {\n return $this->resource;\n }", "final function getFile();", "public static function getFile(){\n\t\t$file_name = base_path().\"/resources/views/DURC/durc_html.mustache\";\n\t\treturn($file_name);\n\t}", "public function baseFile()\n\t{\n\t\treturn $this->baseFile;\n\t}", "public function getFile(): string;", "public function getFile(): string;", "public function getFile(): string;", "protected function getUploadedResource()\n {\n if ($this->getMappingResultsForProperty()->hasErrors()) {\n return null;\n }\n if (is_callable([$this, 'getValueAttribute'])) {\n $resource = $this->getValueAttribute();\n } else {\n // @deprecated since 7.6 will be removed once 6.2 support is removed\n $resource = $this->getValue(false);\n }\n if ($resource instanceof FileReference) {\n return $resource;\n }\n return $this->propertyMapper->convert($resource, FileReference::class);\n }", "public function getOriginal() {\n return $this->original;\n }", "public function getOriginal()\n {\n return $this->original;\n }", "protected function getTargetFile(){\n return $this->target_file;\n }", "public function getOriginalUri(): string {\n\t\treturn $this->originalUri;\n\t}", "function getActualFile(){\n\t\treturn $this->xmldir;\n\t}", "public function getSource()\n\t{\n\t\treturn file_get_contents($this->file);\n\t}", "public function getFullFilePath()\n {\n return $this->basePath . $this->mediaFile->getFileName();\n }", "public function getAbsoluteSrc();", "public function getResource(){\n return $this->resource;\n }" ]
[ "0.7779481", "0.77074766", "0.7693794", "0.7437302", "0.7437302", "0.7009194", "0.69877654", "0.6978498", "0.6731973", "0.6676021", "0.6612523", "0.66032326", "0.66032326", "0.66032326", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.6600738", "0.65468335", "0.65094817", "0.64998645", "0.64993864", "0.6477711", "0.64616096", "0.64614785", "0.644982", "0.6444417", "0.64229923", "0.6386906", "0.6386906", "0.6381753", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63748866", "0.63717836", "0.63717836", "0.63515836", "0.63515836", "0.633687", "0.6320645", "0.63120323", "0.6303305", "0.62931675", "0.625859", "0.6258517", "0.6245416", "0.6242312", "0.6241857", "0.62363833", "0.6231128", "0.6229434", "0.62286925", "0.62156737", "0.6210683", "0.61984736", "0.6192446", "0.6184039", "0.6177981", "0.61763275", "0.6175334", "0.6169502", "0.6168078", "0.6158147", "0.6156374", "0.61474556", "0.61452067", "0.61452067", "0.61452067", "0.61452067", "0.6138436", "0.6123391", "0.6123391", "0.6123391", "0.6123391", "0.6120763", "0.6113728", "0.60895777", "0.6052012", "0.6052012", "0.6052012", "0.6038409", "0.60375667", "0.60366553", "0.6032905", "0.603218", "0.60228395", "0.60139364", "0.60115653", "0.6006315", "0.5994905" ]
0.8437936
0
Sets this File's original resource
public function setOriginalFileResource($originalFileResource) { $this->originalFileResource = $originalFileResource; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOriginalResource($originalResource) {\n\t\t$this->originalResource = $originalResource;\n\t}", "public function updateOriginal()\n {\n // @todo Bug#1101: shouldn't just serialise this object\n // because some things change for the original\n // loaded_width\n // loaded_height\n $this->write($this->getOriginalSourceFilename());\n }", "public function getOriginalFileResource() {\n\t\treturn $this->originalFileResource;\n\t}", "public function getOriginalResource() {\n\t\treturn $this->originalResource;\n\t}", "public function getOriginalResource()\n {\n return $this->resource;\n }", "abstract protected function setResource(): String;", "public function setOriginalResource($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Ads\\GoogleAds\\Util\\FieldMasks\\Proto\\Resource::class);\n $this->original_resource = $var;\n\n return $this;\n }", "public function getOriginalResource()\n {\n return isset($this->original_resource) ? $this->original_resource : null;\n }", "public function setOriginal($original) {\n $this->original = $original;\n }", "public function setFile($file)\n\t{\n\t\t$this->file = $file;\n\t\t// check if we have an old image path\n\t\tif (isset($this->image)) {\n\t\t\t// store the old name to delete after the update\n\t\t\t$this->temp = $this->image;\n\t\t\t$this->image = null;\n\t\t} else {\n\t\t\t$this->image = 'initial';\n\t\t}\n\t}", "protected function _setFile()\n\t{\n\t\t$this->_moveToImageDir();\n\n\t\tif (!$this->_validateMimeType()) {\n\t\t\tunlink($this->getFilePath()); // delete file\n\t\t\tthrow new Exception('Not Allowed MIME Type File ERROR!');\n\t\t}\n\n\t\t$this->_file = file_get_contents($this->getFilePath());\n\t}", "public function deleteOriginalFile()\n\t{\n\t\t$this->deleteFile = TRUE;\n\n\t\treturn $this;\n\t}", "protected function renderResource()\n {\n $processedImageInfo = $this->imageService->processImage($this->originalAsset->getResource(), $this->adjustments->toArray());\n $this->resource = $processedImageInfo['resource'];\n $this->width = $processedImageInfo['width'];\n $this->height = $processedImageInfo['height'];\n $this->persistenceManager->whiteListObject($this->resource);\n }", "public function getOriginalAsset()\n {\n return $this->originalAsset;\n }", "public function setFile($file)\n {\n $this->file = __DIR__ . '/../../../res/' . $file;\n\n if (!is_file($this->file)) {\n header(\"HTTP/1.0 404 Not Found\");\n exit;\n }\n\n return $this;\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "public function setResource(Resource $res)\n {\n $this->setResourceId($res->getResourceId());\n $this->setResourceClass($res->getResourceClass());\n }", "public function restore()\n\t{\n\t\t$this->files = array();\n\t}", "public static function setFile($file) {}", "public function setOriginal(string $original): self\n {\n if ($original !== $this->original) {\n $this->original = $original;\n $this->transliteration = null;\n }\n\n return $this;\n }", "public function setFile($file) {}", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "protected function _getResource()\n {\n return parent::_getResource();\n }", "public function getOriginalFile() {}", "public function getOriginalFile() {}", "public function setFile(File $file)\n\t{\n\t\t$this->file=$file; \n\t\t$this->keyModified['file'] = 1; \n\n\t}", "function SetOtherObjectClient($Resource) {\n\t\t\t$this->ObjClientSide = $Resource;\n\t\t\tif (is_uploaded_file($this->GetFileTempName())) {\n\t\t\t\t$this->SetReplaceMode(0);\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->RollbackUpload();\n\t\t\t\tdie('El cambio de recurso es erroneo: se ha procedido al rollback de todas las operaciones');\n\t\t\t}\n\t\t}", "function _wp_image_meta_replace_original($saved_data, $original_file, $image_meta, $attachment_id)\n {\n }", "function reset() {\n\t\t$this->_ID = 0;\n\t\t$this->_MovieID = 0;\n\t\t$this->_Type = 'File';\n\t\t$this->_Ext = '';\n\t\t$this->_ProfileID = 0;\n\t\t$this->_Description = '';\n\t\t$this->_Width = null;\n\t\t$this->_Height = null;\n\t\t$this->_Metadata = array();\n\t\t$this->_Filename = null;\n\t\t$this->_DateModified = date(system::getConfig()->getDatabaseDatetimeFormat()->getParamValue());\n\t\t$this->_CdnURL = null;\n\t\t$this->_Notes = null;\n\t\t$this->_MarkForDeletion = false;\n\t\t$this->setModified(false);\n\t\treturn $this;\n\t}", "public function setResource($resource)\n {\n if($this->getWorker($resource) === $this->getWorker($this->resource))\n {\n $this->resource = $resource;\n }\n\n $this->tmpImage[] = $tmpImage = tempnam(sys_get_temp_dir(), 'picture');\n\n if($this->getWorker($resource) === $this::WORKER_GD)\n {\n imagepng($resource, $tmpImage, 0);\n }\n else\n {\n $resource->writeImage($tmpImage);\n }\n\n if($this->isGd())\n {\n $this->resource = $this->getGdResource($tmpImage);\n }\n else\n {\n $this->resource = $this->createImagick($tmpImage);\n }\n }", "public function setResource($resource);", "function setFilename($inFilename) {\n\t\tif ( $inFilename !== $this->_Filename ) {\n\t\t\t$this->_Filename = $inFilename;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}", "public function getResource() {}", "function getOriginal()\n {\n }", "public function setToResource()\n {\n $this->type = \"resource\";\n }", "public function set_file($file) {\n $this->file = $file;\n return $this;\n }", "protected function setupFile($originalFile, $cacheFile)\n {\n if (count($this->filters) > 0) {\n $this->checkNumberOfAllowedFilters($cacheFile);\n if ($this->options['checkReferrer']) {\n $this->checkReferrer();\n }\n }\n\n if (! file_exists($originalFile)) {\n // If we are using a placeholder and that exists, use it!\n if ($this->placeholder && file_exists($this->placeholder)) {\n $originalFile = $this->placeholder;\n }\n }\n\n parent::setupFile($originalFile, $cacheFile);\n }", "private function readOriginal(): void\n {\n $this->translation = $this->translation->withOriginal($this->readIdentifier('msgid', true));\n }", "public function setFile($data)\n {\n $this->_File=$data;\n return $this;\n }", "private function setTempFile() {\n $this->filename = tempnam('/tmp/', 'siwiki_relplot_');\n $this->fileresource = fopen($this->filename, 'a+');\n }", "public function set_file( $file ) {\n\t\t$this->file = $file;\n\t\treturn $this;\n\t}", "public function setResourcePath($resourcePath);", "public function syncOriginal()\n {\n $this->original = $this->attributes;\n\n return $this;\n }", "public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }", "public function temp()\n\t\t{\n\t\t\tif ($this->is_cached()) {\n\t\t\t\tself::put($this->get_path_temp(), $this->get_content());\n\t\t\t} else {\n\t\t\t\tif ($this->exists()) {\n\t\t\t\t\t$this->copy($this->get_path_temp());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->update_attrs(array(\n\t\t\t\t\"name\" => basename($this->get_path_temp()),\n\t\t\t\t\"path\" => dirname($this->get_path_temp()),\n\t\t\t\t\"temp\" => true,\n\t\t\t));\n\n\t\t\treturn $this;\n\t\t}", "abstract public function setContentFromFile($file);", "public function setPath($file);", "public function rewind()\n {\n rewind($this->resource);\n }", "function alt_from_resource($source,$target,$name='',$delete=false){\n\t// alt is the source resource, $ref is the target resource that will get the new alternate\n\tglobal $view_title_field;\n\t$srcdata=get_resource_data($source);\n\t$srcext = $srcdata['file_extension'];\n\t$srcpath = get_resource_path($source,true,\"\",false,$srcext);\n\tif ($name == ''){\n\t\t$name = sql_value(\"select value from resource_data where resource_type_field = '$view_title_field' and resource = '$source'\",'Untitled');\n\t}\n\n\t$description = '';\n\tif (!file_exists($srcpath)){\n\t\techo \"ERROR: File not found.\";\n\t\treturn false;\n\t} else {\n\n\t\t$file_size = filesize_unlimited($srcpath);\n\t\t$altid = add_alternative_file($target,$name,$description=\"\",$file_name=\"\",$file_extension=\"\",$file_size,$alt_type='');\n\t\t$newpath = get_resource_path($target,true,\"\",true,$srcext,-1,1,false,'',$altid);\n\t\tcopy($srcpath,$newpath);\n\t\t# Preview creation for alternative files (enabled via config)\n global $alternative_file_previews;\n if ($alternative_file_previews){\n\t\t\tcreate_previews($target,false,$srcext,false,false,$altid);\n \t}\n\t\tif ($delete){\n\t\t\t// we are supposed to delete the original resource when we're done\n\t\t\t# Not allowed to edit this resource? They shouldn't have been able to get here.\n\t\t\tif ((!get_edit_access($source,$srcdata[\"archive\"],false,$srcdata))||checkperm('D')) {\n\t\t\t\texit (\"Permission denied.\");\n\t\t\t} else {\n\t\t\t\tdelete_resource($source);\n\t\t\t}\n\t\t}\n\t\treturn true;\n\n\t}\n}", "function setImage($rImage = false) {\n\n\t\tif (is_resource($this->rImage)) imageDestroy($this->rImage);\n\t\t$this->rImage = $rImage;\n\n\t}", "public function setOriginalUrl(string $originalUrl): void\n {\n $this->originalUrl = $originalUrl;\n }", "public function setResource($resource) {\n\n $this->resource = $resource;\n }", "protected static function restore() {}", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "public function getResource();", "function wp_swap_source($old_source_file) {\n\t\t\t\n\t\t$ext = pathinfo($old_source_file, PATHINFO_EXTENSION);\n\t\t\n\t\t$name = pathinfo($old_source_file, PATHINFO_FILENAME);\n\t\t$name = explode('-', $name);\n\t\t$temp = array_pop($name);\n\t\t$name = implode('-', $name);\n\t\t\n\t\t$path = dirname($old_source_file) . '/';\n\t\t\n\n\t\t$new_source_file = $path . $name . '.' . $ext;\n\t\t\n\t\t// In case there cannot be found an unresized original file in Wordpress’ media directory\n\t\t// Fallback to original file requested\n\t\t// This happens when cropping was done manuall in Wordpress, e.g. on a thumbnail\n\t\t// Why? The filename changes and no information about how and where cropping took place is stored \n\t\tif ( !file_exists($new_source_file) ) $new_source_file = $old_source_file;\n\n\t\treturn $new_source_file;\n\t}", "public function __wakeup()\n {\n if (isset($GLOBALS['TSFE'])) {\n $this->typoScriptFrontendController = $GLOBALS['TSFE'];\n }\n if ($this->currentFile !== null && is_string($this->currentFile)) {\n list($objectType, $identifier) = explode(':', $this->currentFile, 2);\n try {\n if ($objectType === 'File') {\n $this->currentFile = ResourceFactory::getInstance()->retrieveFileOrFolderObject($identifier);\n } elseif ($objectType === 'FileReference') {\n $this->currentFile = ResourceFactory::getInstance()->getFileReferenceObject($identifier);\n }\n } catch (ResourceDoesNotExistException $e) {\n $this->currentFile = null;\n }\n }\n }", "public function getOriginalFile() {\n $file = $this->getPath() . DS . $this->getFile();\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n header(\"Content-Type: \". $mimetype);\n readfile($file);\n }", "public function setFile($file){\n $this->file = $file;\n }", "function original_requested($wp_original = true) {\n\t\tglobal $source_file, $browser_cache, $wp;\n\t\t\n\t\t// In Wordpress detection mode, do REALLY serve the original file\n\t\t// Except when \"classic behavior\" is off, then serve the requested file\n\t\tif ($wp and $wp_original) $source_file = wp_swap_source($source_file);\n\t\t\n\t\t// Send the image\n\t\tsendImage($source_file, $browser_cache);\n die();\n\t\t}", "public function restore()\n {\n }", "function update_file() {\r\n\t\tset_transient( 'av5_css_file', true );\r\n\t}", "public function setFile($v)\r\n\t{\r\n\t\t$this->_file = $v;\r\n\t}", "public function setFile($file)\n {\n $this->file = $file;\n $this->load();\n }", "private function setResource()\n {\n $path = $_SERVER['PATH_INFO'];\n $params = explode('/', $path);\n $this->_requestResource = $params[2];\n if (!in_array($this->_requestResource, $this->_allowResource)) {\n throw new Exception(\"Request resource not allowed!\", 405);\n }\n\n $this->_version = $params[1];\n\n if (!$this->notValid($params[3])) {\n $this->_requestUri = $params[3];\n }\n }", "private function resetfile_pointer()\n {\n $this->file_pointer = 0;\n }", "public function setAvatarFile(UploadedFile $file = null)\n {\n $this->avatar_file = $file;\n // check if we have an old image path\n if (is_file($this->getAbsolutePath())) {\n // store the old name to delete after the update\n $this->temp = $this->getAbsolutePath();\n } else {\n $this->avatar_path = 'initial';\n }\n }", "public function setFile($file) {\t\t\n\t\t// set file\n\t\t$this->file = $file;\n\t\t\n\t\t// set extension\n\t\t$file_parts = explode('.', $this->file['name']);\n\t\t$this->extension = strtolower(end($file_parts));\n\n\t}", "public function restore() {}", "function _saveOriginal(&$model, $name) {\n $setting = $this->settings[$model->name][$name];\n \n # create original data to save into the database\n $original = array(\n 'foreign_key' => $model->id,\n 'model' => $model->name,\n 'field' => $name,\n 'version' => 'original',\n 'filename' => null,\n 'mime' => assetMimeType($model->data[$name]['tmp_name']),\n 'size' => $model->data[$name]['size']\n );\n \n # include dimensions if a valid file-type (image, swf, etc)\n list($original['width'], $original['height']) = getimagesize($model->data[$name]['tmp_name']);\n \n # if this is not an update and files are set to overwrite\n if (!isset($setting['overwrite']) || $setting['overwrite'] == true) {\n \n # count the existing rows for renaming the file\n $existing = $model->{$name}->find('all', array(\n 'fields' => array('id', 'filename'),\n 'conditions' => array('model' => $model->name, 'foreign_key' => $model->id, 'field' => $name)\n ));\n \n # loop through the existing files and remove each entry\n foreach (!empty($existing) && is_array($existing) ? $existing : array() as $remove) {\n assetDelete($model, array($remove[$name]['filename']));\n }\n \n # delete all existing records for this field\n $model->{$name}->deleteAll(array('model' => $model->name, 'foreign_key' => $model->id, 'field' => $name));\n }\n \n # set the filename field value\n $original['filename'] = assetFileName($model->data[$name]['name'], 'original', $name);\n \n # create new entry\n $model->{$name}->create();\n \n # save the original file data\n if (!$model->{$name}->create() || !$model->{$name}->save($original, false)) {\n $model->{$name}->delete($original['parent_id']);\n $this->_setError($model, 'Critical Error found while saving record in afterSave: '. $name, 'error');\n return false;\n }\n \n # update the parent_id\n $model->{$name}->saveField('parent_id', $model->{$name}->id);\n \n # create the directory path for this asset\n if (!assetDirectoryCreate($model)) {\n $this->_setError($model, 'Storage directory was not created, file not properly uploaded. Please try again and/or contact an Administrator.');\n return false;\n }\n \n $this->directory = assetDirectoryPath($model);\n \n # move the original file\n if (!assetSaveFile($model, $model->data[$name]['tmp_name'], $original['filename'])) {\n $this->_setError($model, 'Critical Error found while saving file in afterSave: '. $name, 'error');\n return false;\n }\n \n # save the original filename\n unset($model->data[$name]);\n $model->data[$name]['filename'] = $original['filename'];\n $model->data[$name]['type'] = $original['mime'];\n \n return true;\n }", "public function getResource()\n {\n return $this->resource ?: parent::getResource();\n }", "public function reload() {\r\n if ($this->pathname) {\r\n $this->contents = file_get_contents($this->pathname);\r\n }\r\n }", "public function setResource(PersistentResource $resource)\n {\n throw new \\RuntimeException('Setting the resource on an ImageVariant is not supported.', 1366627480);\n }", "public function setFile($file)\n {\n $this->file = $file;\n }", "public function restore()\n {\n //\n }", "public function getOriginal() {\n return $this->original;\n }", "function setFilename($filename);", "public function setFile($file)\r\n {\r\n $this->file = $file;\r\n }", "public function setDataFileFromContentRaw($contentRaw)\n {\n $this->dataFile = FileReference::fromContentRaw($contentRaw);\n }", "public function setResource(string $resource): self\n {\n $this->resource = $resource;\n\n return $this;\n }", "public function undoRestore ()\n {\n if (file_exists ( $this->_previewFilename ))\n {\n unlink($this->_previewFilename);\n }\n }", "public function set_file($path='',$filename='') {\n\t\t$this->_init($path,$filename);\n\t}", "public function __clone()\n {\n $this->init(clone $this->original, $this->encoding);\n }", "public function getOriginal()\n {\n return $this->original;\n }", "public function getOriginalFileContent()\n {\n return $this->originalFileContent;\n }", "public function setFilename($filename);", "public function setFile(HttpFile $file)\r\n {\r\n $this->file = $file;\r\n $this->mime = $file->getMimeType();\r\n $this->date = new \\DateTime('NOW');\r\n }", "public function restored(File $file)\n {\n //\n }", "public function setFile(File $file)\n {\n $this->file = $file;\n }", "public function getOriginalInstance()\n {\n return $this->imageObj;\n }", "public function __construct()\r\r\n\t{\r\r\n\t\tparent::__construct();\r\r\n\t\t$this->strFile = preg_replace('@^/+@', '', str_replace('%20', ' ' , $this->Input->get('src')));\r\r\n\t}", "public function withResource($resource) {\n $this->resource = $resource;\n \n if (is_a($this->resource, 'Illuminate\\Http\\UploadedFile')) {\n $this->resource_type = 'uploaded';\n }\n \n if (filter_var($this->resource, FILTER_VALIDATE_URL)) {\n $this->resource_type = 'url';\n }\n \n if (is_string($this->resource) && file_exists($this->resource)) {\n $this->resource_type = 'path';\n }\n \n if (empty($this->resource_type)) {\n throw new \\Exception('Resource type unsupported.');\n }\n \n return $this;\n }", "public function rewind()\n {\n $this->fileObject->rewind();\n }", "public function setOriginalId($id);", "protected function setInitialRelativePath() {}" ]
[ "0.71453226", "0.6865306", "0.66661096", "0.6439208", "0.6436352", "0.641165", "0.62328446", "0.62123764", "0.61517024", "0.60588366", "0.5894209", "0.5777561", "0.57602704", "0.57152414", "0.5713898", "0.5616245", "0.5580611", "0.5564613", "0.55543405", "0.5535997", "0.5516889", "0.5500962", "0.5500962", "0.5500962", "0.54589534", "0.54589534", "0.54020566", "0.53996694", "0.5352594", "0.5345049", "0.5338665", "0.53355795", "0.53342116", "0.53327066", "0.5332664", "0.5331218", "0.53038466", "0.52917695", "0.52797836", "0.5258946", "0.5246603", "0.5233982", "0.52296746", "0.52252513", "0.52218187", "0.5196723", "0.5196217", "0.518295", "0.51769817", "0.51756155", "0.5174718", "0.517186", "0.5164114", "0.5156722", "0.5152802", "0.5152802", "0.5152802", "0.5152802", "0.5152802", "0.5152802", "0.51450163", "0.5123185", "0.5120742", "0.5112816", "0.51092553", "0.5108933", "0.5103519", "0.5091021", "0.50847375", "0.50769854", "0.5071463", "0.5058226", "0.50502884", "0.5048493", "0.5044872", "0.5032854", "0.5028987", "0.5027076", "0.502011", "0.501786", "0.5016317", "0.5013484", "0.5007497", "0.5006857", "0.5005873", "0.5002107", "0.49987736", "0.49970174", "0.49873525", "0.49859655", "0.49795368", "0.4979419", "0.4971159", "0.49694344", "0.49657762", "0.49581897", "0.49543968", "0.49539912", "0.4945127", "0.49437422" ]
0.71582353
0
Get the File's hidden
public function getHidden() { return $this->hidden; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getShowHiddenFilesAndFolders() {}", "public static function hidden($path)\n {\n // Pass to self::contents();\n return array_values(self::contents($path, 'only'));\n }", "public function getHiddenFlag() {}", "protected function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return isset($this->hidden) ? $this->hidden : false;\n }", "public function getHidden()\n\t{\n\t\treturn $this->hidden;\n\t}", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHiddenAttributes()\n {\n return $this->{self::ENTRY_HIDDENATTRIBUTES};\n }", "public function getHidden(){\n return $this->_hidden;\n }", "public function getHidden(): bool;", "public function getHidden()\n {\n $this->parseDocBlock();\n return $this->hasAnnotation('hidden');\n }", "protected function getDeletableFileInfo()\n {\n $file = tempnam('.', '');\n $spl = new \\SplFileInfo($file);\n return $spl;\n }", "public static function getKeepFile() {}", "public function getDeletedFilesStorage() {\n return @$this->attributes['deleted_files_storage'];\n }", "public function getMediaFileUnwrapped()\n {\n return $this->readWrapperValue(\"media_file\");\n }", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function getCleanFile()\n {\n return $this->_getCleanProperty('file');\n }", "public function retrieveFile()\n\t{\n\t\t// We're gonna hide it.\n\t\t$no_check_files = array('async-upload.php');\n\t\t$no_check_files = apply_filters('no_check_files', $no_check_files);\n\t\t\n\t\t$script_filename = empty($_SERVER['SCRIPT_FILENAME'])\n\t\t\t? $_SERVER['PATH_TRANSLATED']\n\t\t\t: $_SERVER['SCRIPT_FILENAME'];\n\t\t$explode = explode('/', $script_filename );\n\t\treturn end( $explode );\n\t}", "public static function hidden()\n {\n return [];\n }", "public function files()\n {\n return $this->_array[\"files\"];\n }", "private function _file()\n {\n return Html::getAttributeValue($this->model, $this->attribute);\n }", "public function getf() {\n return $this->file;\n }", "function isHidden();", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "public function getFileInfo()\n {\n return $this->_info;\n }", "public function isHidden() {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function showHiddenFiles($show = true)\n {\n $this->showHiddenFiles = $show;\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function getInvisible()\n\t{\n\t\treturn $this->invisible;\n\t}", "public function isHidden()\n {\n return $this->is_hidden;\n }", "public function getFileInfo()\n\t{\n\t\treturn $this->data;\n\t}", "function isHidden()\n {\n return $this->_hidden;\n }", "public function isVisibleOnFrontEnd()\n\t{\n\t\treturn ivFilepath::matchSuffix($this->name, ivPool::get('conf')->get('/config/imagevue/settings/includefilesext'));\n\t}", "public function getFileReflection()\n\t{\n\t\treturn $this->getBroker()->getFile($this->fileName);\n\t}", "public function getOpac_hide()\n {\n return $this->opac_hide;\n }", "public function getFile() {\n\t\treturn $this->data['file'];\n\t}", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "final public static function hidden()\n {\n return (new static)->hidden;\n }", "public function isHidden()\n\t{\n\t\treturn (bool)$this->_hidden;\n\t}", "function getHtmlFileInfo(){\n\t\n\t\treturn $this->html_info;\n\t}", "public function getInvisibleFlag() {}", "public function files()\r\n {\r\n return $this->files;\r\n }", "public function getFile()\n {\n return $this->_File;\n }", "public function fileInfo()\n {\n return R::findAll('uploaddetail');\n }", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function getImageFile()\n {\n return isset($this->filetask) ? $this->filetask : null;\n }", "public function isHidden(): bool\n {\n return false;\n }", "public function ShowFiles() {\n $i = 0;\n if ($handle = opendir($this->filePath)) {\n while (false !== ($file = readdir($handle))) {\n if (($file != '..') && ($file != '.') && ($file != 'Thumbs.db')) {\n $files[$i] = $file;\n $i++;\n }\n }\n closedir($handle);\n }\n return($files);\n }", "public function file() {\n return $this->file;\n }", "public function getAllowedFiles(){\n return self::$allowed_files;\n }", "public function getNonCompliantFiles()\n {\n return $this->non_compliant_files;\n }", "public function getFiles($showHidden = false)\n {\n $it = $this->getContents();\n\n return array_filter($it, function (HandlerInterface $handler) use ($showHidden) {\n return $handler->isFile() && ($showHidden ?: strpos($handler->getFilename(), '.') !== 0);\n });\n }", "public function file(): string\n {\n return $this->column->isFile();\n }", "public function file()\n {\n return $this->file;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getImageFile()\n {\n return $this->imageFile;\n }", "public function getFile()\n\t{\n\t\treturn $this->file; \n\n\t}", "public function getFileInfo();", "public function getFile():string {\n\t\t\treturn $this->file;\n\t\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "public function getFile()\n\t{\n\t\treturn $this->file;\n\t}", "function getVisible() { return $this->readVisible(); }", "public static function isHidden(): bool\n {\n return !empty(static::HIDDEN);\n }", "function getVisible() { return $this->readVisible(); }", "public function get_file()\n {\n return $this->file;\n }", "public function getVisibility($path)\n\t{\n\t\treturn $this->getMetadata($path);\n\t}", "public function getFile()\n {\n return $this->file;\n }" ]
[ "0.7618114", "0.67773896", "0.67528665", "0.65093064", "0.64604264", "0.64481837", "0.6350912", "0.6350912", "0.6350912", "0.6350912", "0.63223475", "0.62975055", "0.6045381", "0.59984857", "0.5972593", "0.5957512", "0.5938506", "0.58700824", "0.58669376", "0.58669376", "0.58669376", "0.58669376", "0.5836621", "0.58138347", "0.58120775", "0.58056647", "0.5801858", "0.5791779", "0.57693154", "0.5749028", "0.5749028", "0.5749028", "0.5731512", "0.5730585", "0.5730467", "0.57244647", "0.5717287", "0.5717287", "0.57016796", "0.57016796", "0.57016796", "0.5689024", "0.567866", "0.5675342", "0.56751776", "0.5664784", "0.5657127", "0.56521386", "0.5651023", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56270874", "0.56218493", "0.56155515", "0.5615259", "0.56000966", "0.5599213", "0.55985934", "0.55985343", "0.55772406", "0.5572616", "0.55578583", "0.55563205", "0.5551389", "0.5550397", "0.5544909", "0.55427957", "0.5540556", "0.55385137", "0.5514626", "0.5514626", "0.5514626", "0.5514626", "0.5510048", "0.5502776", "0.5486924", "0.5485066", "0.5485066", "0.548278", "0.5478686", "0.5474355", "0.54620034", "0.54562527", "0.5450321" ]
0.64198226
6
Sets this File's hidden
public function setHidden($hidden) { $this->hidden = $hidden; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setHidden(){\n $this->_hidden = true;\n }", "public function setHiddenFlag($hidden = true) {}", "public function setHidden($value = TRUE);", "function setTypeAsHidden() {\n\t\t$this->type = \"hidden\";\n\t}", "function hide()\n {\n $this->_hidden = true;\n }", "public function setHidden($value)\n {\n return $this->set('Hidden', $value);\n }", "public function setInvisibleFlag($invisible = true) {}", "public function showHiddenFiles($show = true)\n {\n $this->showHiddenFiles = $show;\n }", "public function setVisibility() {}", "public function getHiddenFlag() {}", "public function setIsHidden($flag)\n {\n $this->_isHidden = (bool) $flag;\n }", "public function isHidden() {\n return false;\n }", "public function getHidden(){\n return $this->_hidden;\n }", "public function withHidden($hidden=true);", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden() {\r\n return false;\r\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function isHidden()\r\n {\r\n return false;\r\n }", "public function setHidden($hidden)\n {\n $this->AddAnnotation('hidden', $hidden);\n return $this;\n }", "public function setHidden($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->hidden !== $v || $v === 0) {\n\t\t\t$this->hidden = $v;\n\t\t\t$this->modifiedColumns[] = UserPeer::HIDDEN;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function isHidden()\n {\n return false;\n }", "public function setHidden(array $hidden)\n {\n $this->hidden = $hidden;\n\n return $this;\n }", "public function setHidden(array $hidden)\n {\n $this->hidden = $hidden;\n\n return $this;\n }", "public function isHidden(): bool\n {\n return false;\n }", "public function setHidden($var)\n {\n GPBUtil::checkBool($var);\n $this->hidden = $var;\n\n return $this;\n }", "public function hidden(bool $hidden = true)\n {\n $this->hidden = $hidden;\n\n return $this;\n }", "public static function setNoHideSecrets (){\n self::$hideSecrets = null;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function is_hidden() {\n return $this->hidden;\n }", "function hideExhibit(){\n\t\t$this->setVisible('0');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function setHidden($hidden=true)\n\t{\n\t\tif (is_bool($hidden)) {\n\t\t\t$this->_hidden = $hidden;\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function getHidden(): bool;", "public function isHidden()\r\n\t{\r\n\t\treturn false;\r\n\t}", "public function isHidden();", "public function isHidden();", "public function isHidden();", "public function isHidden();", "protected function setHideAmount()\n {\n \tif (isset($_POST['hide_amount']) && !empty($_POST['hide_amount'])) {\n \t\t$this->data['hide_amount'] = 1;\n \t} else {\n \t\t$this->data['hide_amount'] = 0;\n \t}\n }", "public function setConditionallyHidden($flag)\n {\n $this->_isConditionallyHidden = $flag;\n }", "public function setVisibility($path, $visibility)\n {\n }", "public function setVisibility($path, $visibility)\n {\n }", "public function setHiddenAttributes(array $attributes)\n {\n $this->{self::ENTRY_HIDDENATTRIBUTES} = $attributes;\n }", "public static function convert_hidden_field() {\n\n\t\t// Create a new Hidden field.\n\t\tself::$field = new GF_Field_Hidden();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public function isHidden()\n {\n return $this->is_hidden;\n }", "public function makeFileInvisible($id){\n\t\t$failas = File::find($id);\n\t\t$failas->visibility = 0;\n\t\t$failas->save();\n\t\treturn redirect()->back();\n\t}", "public function setPrivate()\n {\n $this->private = true;\n }", "public function hide();", "function isHidden()\n {\n return $this->_hidden;\n }", "static public function asHidden( $aName, $aValue )\n\t{\n\t\treturn self::withNameAndType( $aName, self::INPUT_TYPE_HIDDEN )\n\t\t\t\t->setValue($aValue);\n\t}", "function hideField($fieldName){\n\n\t\t$this->hidden[$fieldName] = \"hide\";\n\n\t}", "function isHidden();", "public function setPublic()\n {\n $this->private = false;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "public function getHidden()\n {\n return $this->hidden;\n }", "protected function getHidden()\n {\n return $this->hidden;\n }", "public function setVisible($value) {\r\n $this->bVisible = $this->setBooleanProperty($this->bVisible, $value);\r\n }", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function getHidden() {\n\t\treturn $this->hidden;\n\t}", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function isHidden(): bool\n {\n return $this->hidden;\n }", "public function setHide($val = 'null')\n {\n $this->addParams('hide', $val);\n\n return $this;\n }", "public function hide() {\n\t\treturn true;\n\t}", "public function hide() {\n\t\treturn true;\n\t}", "public function getHidden()\n\t{\n\t\treturn $this->hidden;\n\t}", "public function hidden ( \\r8\\Form\\Hidden $field )\n {\n $this->addField( \"hidden\", $field );\n }", "public function isHidden()\n\t{\n\t\treturn (bool)$this->_hidden;\n\t}", "public function initialize() {\n\t\t\tparent::initialize();\n\n\t\t\t// vars\n\t\t\t$this->name = 'hidden';\n\t\t\t$this->label = __( 'Hidden', 'acf' );\n\t\t}", "public function setPrivate()\r\n {\r\n $this->data['security'] = 'private';\r\n }", "public static function getShowHiddenFilesAndFolders() {}", "function is_hidden() {\n trigger_error('Admin class does not implement method <strong>is_hidden()</strong>', E_USER_WARNING);\n return;\n }", "public function getHidden()\n {\n return isset($this->hidden) ? $this->hidden : false;\n }", "public function hideExtraField()\n {\n $this->houses=false;\n $this->jobs_training=false;\n $this->motorcycles =false;\n $this->cars = false;\n $this->offices=false;\n $this->lands_plots=false;\n return;\n }", "public static function NewHidden($name) {\n $cmp = new ExjUIHidden();\n return $cmp->setName($name);\n }", "public function setVisible(bool $visible)\n {\n $this->visible = $visible;\n }", "public function hide() {\n\n if($this->isInvisible()) return true;\n\n $root = dirname($this->root()) . DS . $this->uid();\n\n if(!dir::move($this->root(), $root)) {\n throw new Exception('The directory could not be moved');\n }\n\n $this->dirname = $this->uid();\n $this->num = null;\n $this->root = $root;\n $this->kirby->cache()->flush();\n $this->reset();\n return true;\n\n }", "public function hide($id)\n\t{\n\t\t$photo = Photo::find($id);\n\t\t$photo->hide_photo = $photo->hide_photo == 0 ? 1 : 0;\n\t\tif ($photo->save()) {\n\t\t\treturn Redirect::route('admin.photo.index')->with('success', 'Photo Updated.');\n\t\t}\n\t}", "public function resetHidden($value = '')\n {\n $this->ansi(28);\n $this->raw($value);\n\n return $this;\n }" ]
[ "0.7812048", "0.7225677", "0.720871", "0.71842355", "0.6717956", "0.64650303", "0.63854593", "0.6354249", "0.6135822", "0.61213386", "0.608953", "0.60510415", "0.60421336", "0.60405254", "0.601817", "0.601817", "0.59904134", "0.5989666", "0.5989666", "0.5989666", "0.5987318", "0.59241045", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5917381", "0.5903291", "0.5903291", "0.5901502", "0.58715224", "0.5863658", "0.58417565", "0.58342993", "0.58342993", "0.58342993", "0.5834005", "0.5828348", "0.5823717", "0.5819595", "0.580199", "0.580199", "0.580199", "0.580199", "0.5781936", "0.57739115", "0.56699944", "0.56699944", "0.56659317", "0.5665397", "0.5640477", "0.5638958", "0.5621264", "0.5604656", "0.5599625", "0.5591617", "0.55912435", "0.5573097", "0.5558032", "0.5554987", "0.5554987", "0.5554987", "0.5554987", "0.55373085", "0.55360806", "0.5533949", "0.5533949", "0.55283946", "0.55283946", "0.55245006", "0.54893696", "0.54893696", "0.5467105", "0.53994536", "0.53944355", "0.53681076", "0.5357794", "0.53410196", "0.5335513", "0.53258806", "0.5307953", "0.52905816", "0.52905315", "0.528817", "0.528122", "0.5266546" ]
0.71712315
4
Returns uuid of this object
public function getUuid() { return $this->Persistence_Object_Identifier; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUuid()\n {\n return $this->uuid;\n }", "public function getUuid()\n {\n return $this->uuid;\n }", "public function getUuid()\n {\n return $this->uuid;\n }", "public function getUuid() {\n return $this->uuid;\n }", "public function get_uuid() \n {\n return $this->uuid;\n }", "public function getUuid(): string\n {\n return $this->uuid;\n }", "public function getUuid()\n {\n return !empty($this->uuid) ? $this->uuid : '';\n }", "public function getUuid();", "public function getUUID()\n {\n return $this->uUID;\n }", "public function getUUID()\n {\n return $this->uUID;\n }", "public function getUUID()\n {\n return $this->uUID;\n }", "public function getUUID()\n {\n return $this->getPointer();\n }", "public function getUuid(): string;", "public function getUuid()\n {\n return isset($this->source['uuid']) ? $this->source['uuid'] : null;\n }", "public function uuid();", "public function uuid();", "public function uuid(){ }", "public static function uuid() {}", "public function uuid() : Uuid;", "public function canonical(): string\n {\n return $this->_uuid;\n }", "public function getUuidPropertyName() {}", "function uuid(): string\n {\n return \\Midnite81\\Core\\Functions\\uuid();\n }", "public function getResourceUuid()\n {\n return $this->resource_uuid;\n }", "public static function uuid()\n {\n return Uuid::uuid5(Uuid::NAMESPACE_DNS, self::uniqueKey());\n }", "public function getEntityUuid()\n\t{\n\t\treturn $this->entity_uuid;\n\t}", "public function getReferenceUuid()\n\t{\n\t\treturn $this->reference_uuid;\n\t}", "public function getUuid()\n {\n if ($this->_uuid !== null) {\n return $this->_uuid;\n }\n\n if ($uuid = Yii::$app->request->cookies->getValue($this->cookieName)) {\n $this->_uuid = (string) $uuid;\n return $this->_uuid;\n }\n\n $uuid = NumberHelper::getGuid();\n $this->setUuid($uuid);\n return $this->_uuid;\n }", "public static function getUuid() {\n return sprintf(\n \"%04x%04x-%04x-%04x-%04x-%04x%04x%04x\",\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0x0fff) | 0x4000,\n mt_rand(0, 0x3fff) | 0x8000,\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "public static function getUuid(): string\n {\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex(random_bytes(16)), 4));\n }", "public function getKeyName()\n {\n return 'uuid';\n }", "protected function getUid() {\n\t\treturn UUIDUtil::getUUID();\n\t}", "function getProductuuid()\n {\n return $this->product_uuid;\n }", "public function getProductuuid(){\n return $this->productuuid;\n }", "public function get() {\n if (function_exists('com_create_guid')){\n return com_create_guid();\n }else{\n mt_srand((double)microtime()*10000);//optional for php 4.2.0 and up.\n $charid = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);// \"-\"\n $uuid = //chr(123)// \"{\"\n substr($charid, 0, 8).$hyphen\n .substr($charid, 8, 4).$hyphen\n .substr($charid,12, 4).$hyphen\n .substr($charid,16, 4).$hyphen\n .substr($charid,20,12);\n //.chr(125);// \"}\"\n return $uuid;\n } \n }", "function getUUID()\n {\n $sql = \"select gen_random_uuid() as uuid\";\n $data = $this->lireParam($sql);\n return $data[\"uuid\"];\n }", "public function uniqueId()\n {\n return $this->transaction->id;\n }", "public function uniqueId(): string\n {\n return $this->person->id;\n }", "public static function uuid() {\n if (!function_exists('uuid_create'))\n return false;\n\n uuid_create(&$context);\n\n uuid_make($context, UUID_MAKE_V4);\n uuid_export($context, UUID_FMT_STR, &$uuid);\n return trim($uuid);\n }", "private function uuid(){\n return uniqid('');\n }", "public function getUniqueId()\n {\n return $this->unique_id;\n }", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "function getpurchaseuuid()\n {\n return $this->purchase_uuid;\n }", "public function generateUuid()\n {\n return (new Generator())->uuid();\n }", "public function getUniqueId() {\n return $this->id;\n }", "public function getUniqueID()\n {\n return $this->uniqueID;\n }", "public function getUniqueID()\n {\n return $this->uniqueID;\n }", "private function uuid() {\n\t\treturn sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n\t\t);\n\t}", "public function getIdentifier()\n {\n return $this->uid;\n }", "public function getUniqueId()\n {\n return $this->uniqueId;\n }", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public function getModelInstanceID() : string\n {\n return \\md5(\\implode('-', $this->getModelInstanceElements()));\n }", "public function getUniqueId()\n {\n return $this->_uniqueId;\n }", "public static function getUuid(): string {\n mt_srand((double)microtime() * 10000);\n $charid = strtolower(md5(uniqid(rand(), TRUE)));\n $hyphen = chr(45);\n $uuid = substr($charid, 0, 8) . $hyphen\n . substr($charid, 8, 4) . $hyphen\n . substr($charid, 12, 4) . $hyphen\n . substr($charid, 16, 4) . $hyphen\n . substr($charid, 20, 12);\n return $uuid;\n }", "public static function timeuuid() {}", "public function getUniqueObjectIdentifier();", "protected function generateUUID(): string {\n return Str::uuid();\n }", "private function uuid()\n {\n $data = random_bytes(16);\n $data[6] = chr(ord($data[6]) & 0x0f | 0x40);\n $data[8] = chr(ord($data[8]) & 0x3f | 0x80);\n return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4));\n }", "public function getNotificationUUID(): string\n {\n return $this->rawData['notificationUUID'];\n }", "public static function getGUIDProperty()\n {\n return 'SuperFundID';\n }", "function getUniqueID() {\r\n\t\treturn $this->uniqueID;\r\n\t}", "public function id(): string\n {\n if ($this->id) {\n return $this->id;\n }\n\n if ($this->name) {\n return $this->id = $this->generateIdByName();\n }\n\n return $this->id = Str::random(4);\n }", "public function __toString() {\n return (string)$this->id();\n }", "public function getUID()\n {\n return $this->uid;\n }", "protected function get_issue_uuid() {\n global $CFG;\n require_once($CFG->libdir . '/horde/framework/Horde/Support/Uuid.php');\n return (string)new Horde_Support_Uuid();\n }", "public function getId()\n {\n if (!$this->id) {\n $this->id = md5(uniqid(rand(), true));\n }\n return $this->id;\n }", "public function id() {\n\t\tif ( null === $this->_id ) {\n\t\t\t$this->_id = sha1( mt_rand() . microtime( true ) . mt_rand() );\n\t\t}\n\n\t\treturn $this->_id;\n\t}", "public static function uuid()\n {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff), // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000, // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000, // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));\n }", "public function getIdentifier() {\n\n\t\t// String Prefix muss vorhanden sein -> reiner Zahlenwert wirft Exception nach dem Absenden\n\t\t// @see: https://wiki.typo3.org/Exception/CMS/1210858767\n\t\treturn md5($this->contentObject->data['uid']);\n\t}", "public static function getGuid()\n {\n return self::$guid;\n }", "public function getGUID()\n\t{\n\t\treturn $this->m_oUser->GUID;\n\t}", "public function getSerialId()\n {\n return $this->get(self::_SERIAL_ID);\n }", "public static final function generateInstanceUuid() {\n return Config::generateUuid('instance');\n }", "public function getUID() {\r\n return $this->uid;\r\n }", "public function serializedId() {\n return (is_null($this->id)?null:$this->id);\n }", "private function getUserUuid()\r\n {\r\n\r\n if ($this->uuid === null) {\r\n $requestURI = $this->requestURI();\r\n $queryStringPos = strpos($requestURI,\"?\");\r\n if($queryStringPos)\r\n {\r\n $uuid = substr($requestURI, 0, $queryStringPos);\r\n }\r\n else\r\n {\r\n $uuid = substr($requestURI, 0);\r\n }\r\n\r\n if (strpos($uuid, $this->path) !== 0) {\r\n throw new \\InvalidArgumentException('The uuid and the path doesn\\'t match : '.$uuid.' - '.$this->path);\r\n }\r\n\r\n $this->uuid = $uuid;\r\n }\r\n\r\n return $this->uuid;\r\n }", "function Uuid()\n {\n $unid = uniqid() . str_replace('-', '', Guid());\n $uuid = substr($unid, 0, 8) . '-' . substr($unid, 8, 4) . '-' . substr($unid, 12, 4) . '-' . substr($unid, 16, 4) . '-' . substr($unid, 20, 12);\n return $uuid;\n }", "public static function getGUIDProperty()\n {\n return '';\n }", "public static function getGUIDProperty()\n {\n return '';\n }", "public function generateUuid()\n {\n return Uuid::uuid5(Uuid::NAMESPACE_DNS, md5(uniqid(date('d-m-Y H:i:s'), true)))->toString();\n }", "public function __toString()\n {\n return $this->identifier;\n }", "public function getUniqueId()\n {\n return '';\n }", "public function uuid($uuid = null);", "private function uuid(): string\n {\n return implode('-', [\n bin2hex(random_bytes(4)),\n bin2hex(random_bytes(2)),\n bin2hex(chr((ord(random_bytes(1)) & 0x0F) | 0x40)) . bin2hex(random_bytes(1)),\n bin2hex(chr((ord(random_bytes(1)) & 0x3F) | 0x80)) . bin2hex(random_bytes(1)),\n bin2hex(random_bytes(6)),\n ]);\n }", "public static function getUUID()\n {\n return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n // 32 bits for \"time_low\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff),\n\n // 16 bits for \"time_mid\"\n mt_rand(0, 0xffff),\n\n // 16 bits for \"time_hi_and_version\",\n // four most significant bits holds version number 4\n mt_rand(0, 0x0fff) | 0x4000,\n\n // 16 bits, 8 bits for \"clk_seq_hi_res\",\n // 8 bits for \"clk_seq_low\",\n // two most significant bits holds zero and one for variant DCE1.1\n mt_rand(0, 0x3fff) | 0x8000,\n\n // 48 bits for \"node\"\n mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)\n );\n }", "public function getJWTIdentifier()\n {\n return $this->getUuidKey();\n }", "public function getUid() {\n return $this->get(self::UID);\n }", "public function __toString()\n {\n if ($this->id === null) {\n return '';\n }\n\n return $this->id;\n }", "public function getUuidFieldName() {\n \n return $this->getUuidColumnName();\n }", "public function __toString()\n {\n return $this->getIdentifier();\n }", "public function getUniqueId();", "public function getUniqueId();", "public function getUniqueId();", "public function __toString()\n\t{\n\t\treturn (string) $this->id();\n\t}", "public function getUID() {\r\n\t\treturn $this->_uId;\r\n\t}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}" ]
[ "0.86325145", "0.86325145", "0.86325145", "0.8588566", "0.84742033", "0.8454373", "0.8387439", "0.8266323", "0.8207266", "0.8207266", "0.8207266", "0.81043184", "0.8017663", "0.7782897", "0.7677365", "0.7677365", "0.7628186", "0.75425655", "0.75283384", "0.7516442", "0.7502797", "0.7403413", "0.73461896", "0.7190502", "0.71573347", "0.71148074", "0.7113716", "0.71074605", "0.70951176", "0.70805705", "0.7075945", "0.7047013", "0.7041884", "0.69927204", "0.6946555", "0.6936146", "0.69226557", "0.6920951", "0.6919607", "0.6878103", "0.6870488", "0.68345904", "0.6825568", "0.6823547", "0.68078434", "0.68078434", "0.67998236", "0.677719", "0.67758614", "0.6745909", "0.6732464", "0.67309386", "0.6730117", "0.67106843", "0.6701407", "0.6699495", "0.6699022", "0.66978514", "0.6692091", "0.66862184", "0.66858965", "0.66817003", "0.6679811", "0.66746914", "0.6650672", "0.66499776", "0.663587", "0.66332567", "0.6609117", "0.6602247", "0.65990186", "0.6597862", "0.6593414", "0.6589579", "0.65887547", "0.6583787", "0.65835124", "0.65835124", "0.65814364", "0.65810937", "0.6580311", "0.6579451", "0.6576303", "0.65713096", "0.65638727", "0.6561765", "0.6559452", "0.655583", "0.65538013", "0.65517896", "0.65517896", "0.65517896", "0.65436524", "0.6540782", "0.6534426", "0.65337473", "0.653305", "0.653305", "0.653305" ]
0.8347621
7
Prepare what is necessary to use in these tests. setUp() is run automatically by the testing framework before each test method.
protected function setUp(): void { global $txt; require_once(SUBSDIR . '/Emailpost.subs.php'); $lang = new Loader('english', $txt, database()); $lang->load('Maillist'); User::$info = new UserInfo(['name' => 'name']); $this->_email = 'Return-Path: <[email protected]> Delivered-To: <[email protected]> Received: from galileo.tardis.com by galileo.tardis.com (Dovecot) with LMTP id znQ3AvalOVi/SgAAhPm7pg for <[email protected]>; Sat, 26 Nov 2016 09:10:46 -0600 Received: by galileo.tardis.com (Postfix, from userid 1005) id 0671C1C8; Sat, 26 Nov 2016 09:10:46 -0600 (CST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on galileo.tardis.com X-Spam-Flag: YES X-Spam-Level: ****** X-Spam-Status: Yes, score=5.0 required=5.0 tests=HTML_IMAGE_ONLY_16, HTML_MESSAGE,HTML_SHORT_LINK_IMG_2,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI, MPART_ALT_DIFF,RCVD_IN_BRBL_LASTEXT,T_DKIM_INVALID,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.0 Received: from mail.elkarte.net (s2.eurich.de [85.214.104.5]) by galileo.tardis.com (Postfix) with ESMTP id 1872579 for <[email protected]>; Sat, 26 Nov 2016 09:10:40 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by mail.elkarte.net (Postfix) with ESMTP id 9DE3C4CE1535 for <[email protected]>; Sat, 26 Nov 2016 16:10:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at s2.eurich.de Received: from mail.elkarte.net ([127.0.0.1]) by localhost (h2294877.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zQep5x32jrqA for <[email protected]>; Sat, 26 Nov 2016 16:10:03 +0100 (CET) Received: from mail.elkarte.net (h2294877.stratoserver.net [85.214.104.5]) by mail.elkarte.net (Postfix) with ESMTPA id 990694CE0CFA for <[email protected]>; Sat, 26 Nov 2016 16:10:03 +0100 (CET) Subject: [ElkArte Community] Test Message To: <[email protected]> From: "Administrator via ElkArte Community" <[email protected]> Reply-To: "ElkArte Community" <[email protected]> References: <[email protected]> Date: Sat, 26 Nov 2016 15:09:15 -0000 X-Mailer: ELK X-Auto-Response-Suppress: All Auto-Submitted: auto-generated List-Id: <[email protected]> List-Unsubscribe: <http://www.elkarte.net/community/index.php?action=profile;area=notification> List-Owner: <mailto:[email protected]> (ElkArte Community) Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="ELK-66593aefa4beed000470cbd4cc3238d9" Content-Transfer-Encoding: 7bit Message-ID: <[email protected]> Testing Regards, The ElkArte Community [cd8c399768891330804a1d2fc613ccf3-t4124] --ELK-66593aefa4beed000470cbd4cc3238d9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Testing Regards, The ElkArte Community [cd8c399768891330804a1d2fc613ccf3-t4124] --ELK-66593aefa4beed000470cbd4cc3238d9-- --ELK-66593aefa4beed000470cbd4cc3238d9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit <strong>Testing</strong> Regards, The ElkArte Community [cd8c399768891330804a1d2fc613ccf3-t4124] --ELK-66593aefa4beed000470cbd4cc3238d9--'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }", "protected function setUp(): void\n {\n $this->dbSetUp();\n $this->prepareObjects();\n $this->createDummyData();\n }", "public function setUp()\n {\n // 'This test has not been implemented yet.'\n return;\n\n $this->setupDomains();\n $this->setupCountries();\n $this->setupLanguages();\n $this->setupCategories();\n }", "protected function setUp()\n {\n $this->preSetup();\n parent::setUp();\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp(): void {\n\t\trequire_once( dirname( __FILE__ ) . '/../vendor/aliasapi/frame/client/create_client.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestHelpers.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestParameters.php' );\n\n\t\tTestHelpers::prepareDatabaseConfigs();\n\t\tClient\\create_client( 'money' );\n\n\t\t$this->http_client = new GuzzleHttp\\Client( [ 'base_uri' => 'http://money/' ] );\n\t\t$this->process_tag = 'refund_purchase_from';\n\t\t$this->tag = 'refund_purchase_to';\n\t}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp()\n\t{\n\t}", "protected function setUp() { }" ]
[ "0.82054555", "0.8016314", "0.7844287", "0.7839633", "0.78211635", "0.78211635", "0.78211635", "0.78211635", "0.78211635", "0.7784194", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.77815634", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.7781151", "0.77810436", "0.77810436", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.77806306", "0.7759246", "0.7756637" ]
0.0
-1
Cleanup data we no longer need at the end of the tests in this class. tearDown() is run automatically by the testing framework after each test method.
protected function tearDown(): void { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "public function tearDown()\n {\n parent::tearDown();\n\n unset($this->stringHelper);\n unset($this->dateTransformer);\n }", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown() {}", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "protected function tearDown() {\n\t\t\n\t}", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "protected function tearDown() { }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->deleteCities();\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown()\n {\n $this->cache->clear();\n }", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "public function tearDown() {\n\t\tunset($this->ItemsTable);\n\t\tunset($this->PDO);\n\t}", "protected function tearDown(): void\n {\n parent::tearDown();\n\n $this->dropTables();\n\n unset($this->repository);\n\n $this->clearDataDir();\n }", "public function tearDown()\n {\n parent::tearDown();\n\n $this->serviceManager = null;\n $this->rpc = null;\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n // unset instance\n $this->akismet =null;\n\n // call parent\n parent::tearDown();\n }", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "protected function tearDown()\n {\n unset($this->output);\n }", "protected function tearDown() {\r\n\t\t$this->testObject = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown() {\r\n\t\t$this->testObject = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown()\n {\n // cleaning up\n $sQ = 'delete from oxuser where oxusername like \"test%\" ';\n oxDb::getDb()->execute($sQ);\n $sQ = 'delete from oxaddress where oxid like \"test%\" ';\n oxDb::getDb()->execute($sQ);\n\n $this->cleanUpTable('oxuser');\n $this->cleanUpTable('oxnewssubscribed');\n\n parent::tearDown();\n }", "protected function tearDown() {\n\n\t}", "protected function tearDown() {\n\n\t}", "protected function tearDown() {\r\n\t\t\r\n\t}", "protected function tearDown()\n {\n $this->decorator = null;\n $this->innerFormatter = null;\n parent::tearDown();\n }", "protected function tearDown()\n\t{\n\t\tunset($this->object);\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n }", "protected function tearDown()\n {\n }", "protected function tearDown()\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($this->object);\n\n\t\tparent::tearDown();\n\t}", "protected function tearDown() {\r\n\t\tparent::tearDown();\r\n\t\tunset ( $this->mockedCacheCleanerBuilder );\r\n\t\tunset ( $this->mockedEventDispatcher );\r\n\t\tunset ( $this->mockedEventQueue );\r\n\t\tunset ( $this->mockedEventRepository );\r\n\t\tunset ( $this->mockedTypo3DbBackend );\r\n\t\tunset ( $this->cacheEventHandler );\r\n\t}", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "protected function tearDown() {\r\n }", "protected function tearDown() {\r\n }", "protected function tearDown() {\r\n }", "protected function tearDown() {\r\n }", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function teardown()\n {\n //\n }", "protected function tearDown() {\n\t\t$this->Application = null;\n\t\tparent::tearDown ();\n\t}", "protected function tearDown() {\r\n }", "protected function tearDown()\n {\n $this->tgLog = null;\n }", "protected function tearDown() {\n\t\tController::clearDirectories();\n\t}", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function tearDown()\n {\n unset(\n $this->webhook_processor,\n $this->webhook,\n $this->domain,\n $this->subscriber,\n $this->data\n );\n }", "protected function tearDown() {\r\n\t\tgc_collect_cycles();\r\n\t\tparent::tearDown();\r\n\t}", "protected function tearDown() {\n Monkey\\tearDown();\n parent::tearDown();\n }", "protected function tearDown()\n\t{\n\t}", "protected function tearDown()\n\t{\n\t}", "protected function tearDown()\n\t{\n\t}", "protected function tearDown()\n\t{\n\t}", "protected function tearDown()\n\t{\n\t}", "protected function tearDown()\n\t{\n\t}" ]
[ "0.8423133", "0.8394887", "0.8384393", "0.8304614", "0.8276454", "0.82593775", "0.8247462", "0.81923795", "0.8150083", "0.8149888", "0.81334037", "0.8112908", "0.809768", "0.8075358", "0.80512834", "0.80462366", "0.80462366", "0.80462366", "0.80461323", "0.80461323", "0.80461323", "0.80461323", "0.80459565", "0.80459565", "0.80459565", "0.80459565", "0.80459565", "0.80459565", "0.80459565", "0.80258477", "0.8024969", "0.8022252", "0.8020996", "0.8017523", "0.7999054", "0.7998942", "0.7997313", "0.7997313", "0.7997313", "0.7997313", "0.7997313", "0.7997313", "0.7997313", "0.7997313", "0.79962504", "0.7990845", "0.79859173", "0.79770195", "0.7973098", "0.796977", "0.7964413", "0.7964413", "0.7964413", "0.7964413", "0.7964413", "0.7964413", "0.7960803", "0.795951", "0.7955377", "0.79442257", "0.7942828", "0.79308486", "0.7930101", "0.7918624", "0.7917319", "0.79156524", "0.7913576", "0.7913576", "0.7910841", "0.7909586", "0.7909586", "0.78978235", "0.7892721", "0.7879315", "0.7879156", "0.7879156", "0.7879156", "0.78788793", "0.7877333", "0.786688", "0.7862003", "0.7862003", "0.7862003", "0.7862003", "0.7858032", "0.7854879", "0.7853295", "0.7852285", "0.78494525", "0.7845094", "0.7836943", "0.7835074", "0.78347427", "0.78312165", "0.78308046", "0.78308046", "0.78308046", "0.78308046", "0.78308046", "0.78308046" ]
0.7874346
79
Test that we can read and parse the email
public function testMailParse() { // Parse a simple email $email_message = new EmailParse(); $email_message->read_email(true, $this->_email); // Basics $this->assertEquals('"ElkArte Community" <[email protected]>', $email_message->headers['reply-to']); $this->assertEquals('[ElkArte Community] Test Message', $email_message->subject); // Its marked as spam $email_message->load_spam(); $this->assertTrue($email_message->spam_found); // A few more details $email_message->load_address(); $this->assertEquals('[email protected]', $email_message->email['from']); $this->assertEquals('[email protected]', $email_message->email['to'][0]); // The key $email_message->load_key(); $this->assertEquals('cd8c399768891330804a1d2fc613ccf3-t4124', $email_message->message_key_id); $this->assertEquals('cd8c399768891330804a1d2fc613ccf3', $email_message->message_key); // The plain and HTML messages $this->assertStringContainsString('<strong>Testing</strong>', $email_message->body); $this->assertRegExp('/Testing\n/', $email_message->plain_body); // The IP $this->assertEquals('85.214.104.5', $email_message->load_ip()); // And some MD as well $markdown = pbe_load_text($email_message->html_found, $email_message, array()); $this->assertStringContainsString('[b]Testing[/b]', $markdown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testMailParse()\n {\n $raw = \"UmV0dXJuLVBhdGg6IDxzdXBwb3J0QGNvbW9kby5jb20+ClgtT3JpZ2luYWwtVG86IHNzbEB0ZXN0LmRlCkRlbGl2ZXJlZC1UbzogY2Rzc2xAaG9zdDJjMS50ZXN0LmRlClJlY2VpdmVkOiBmcm9tIG14cDAubmljZ2F0ZS5jb20gKG14cDAubmljZ2F0ZS5jb20gWzE4OC40MC42OS43Nl0pCiAgICBieSBob3MudGVzdC5kZSAoUG9zdGZpeCkgd2l0aCBFU01UUFMgaWQgMDAxNjU3RDMKICAgIGZvciA8c3NsQHRlc3QuZGU+OyBXZWQsICA5IEp1bCAyMDE0IDE2OjAwOjM0ICswMjAwIChDRVNUKQpSZWNlaXZlZDogZnJvbSBtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgKG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldCBbSVB2NjoyYTAyOjE3ODg6NDAyOjFjODg6OmMwYTg6ODhjY10pCiAgICBieSBteHAwLm5pY2dhdGUuY29tIChQb3N0Zml4KSB3aXRoIEVTTVRQUyBpZCAxMDUxOUUyODAwQgogICAgZm9yIDxzc2xAdGVzdC5kZT47IFdlZCwgIDkgSnVsIDIwMTQgMTY6MDA6MzIgKzAyMDAgKENFU1QpClJlY2VpdmVkOiAocW1haWwgMTk3MjkgaW52b2tlZCBieSB1aWQgMTAwOCk7IDkgSnVsIDIwMTQgMTQ6MDA6MjkgLTAwMDAKUmVjZWl2ZWQ6IGZyb20gb3JhY2xlb25lX21jci5tY3IuY29sby5jb21vZG8ubmV0IChIRUxPIG1haWwuY29sby5jb21vZG8ubmV0KSAoMTkyLjE2OC4xMjguMjEpCiAgICBieSBtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgKHFwc210cGQvMC44NCkgd2l0aCBTTVRQOyBXZWQsIDA5IEp1bCAyMDE0IDE1OjAwOjI5ICswMTAwClN1YmplY3Q6IE9SREVSICMxMjM0NTY3OCAtIENPTkZJUk1BVElPTgpGcm9tOiAiQ29tb2RvIFNlY3VyaXR5IFNlcnZpY2VzIiA8bm9yZXBseV9zdXBwb3J0QGNvbW9kby5jb20+Ck1JTUUtVmVyc2lvbjogMS4wCkNvbnRlbnQtVHlwZTogbXVsdGlwYXJ0L2FsdGVybmF0aXZlOyBib3VuZGFyeT0iKEFsdGVybmF0aXZlQm91bmRhcnkpIgpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0ClRvOiAiVGVzdG1hc3RlciIgPHNzbEB0ZXN0LmRlPgpEYXRlOiBXZWQsIDA5IEp1bCAyMDE0IDEzOjU5OjUxICswMDAwCk1lc3NhZ2UtSUQ6IDw0TklyTVNzZmIyR0NQZll5VUk1bGFBQG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldD4KWC1Qcm94eS1NYWlsU2Nhbm5lci1JbmZvcm1hdGlvbjogUGxlYXNlIGNvbnRhY3QgdGhlIElTUCBmb3IgbW9yZSBpbmZvcm1hdGlvbgpYLVByb3h5LU1haWxTY2FubmVyLUlEOiAxMDUxOUUyODAwQi5BQzg1RApYLVByb3h5LU1haWxTY2FubmVyOiBGb3VuZCB0byBiZSBjbGVhbgpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1DaGVjazogbm90IHNwYW0sIFNwYW1Bc3Nhc3NpbiAobm90IGNhY2hlZCwKICAgIHNjb3JlPTEuNjI1LCByZXF1aXJlZCA1Ljc1LCBhdXRvbGVhcm49ZGlzYWJsZWQsIEhUTUxfTUVTU0FHRSAwLjAwLAogICAgU1BGX0hFTE9fUEFTUyAtMC4wMCwgU1VCSl9BTExfQ0FQUyAxLjYyKQpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1TY29yZTogMQpYLVByb3h5LU1haWxTY2FubmVyLUZyb206IHN1cHBvcnRAY29tb2RvLmNvbQpYLVByb3h5LU1haWxTY2FubmVyLVRvOiBzc2xAdGVzdC5kZQpYLVNwYW0tU3RhdHVzOiBObwoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSkKQ29udGVudC1UeXBlOiB0ZXh0L3BsYWluOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDhiaXQKCnRlc3QKCi0tKEFsdGVybmF0aXZlQm91bmRhcnkpCkNvbnRlbnQtVHlwZTogdGV4dC9odG1sOyBjaGFyc2V0PVVURi04CkNvbnRlbnQtVHJhbnNmZXItRW5jb2Rpbmc6IDhiaXQKCjxodG1sPgo8aGVhZD4KPC9oZWFkPgo8Ym9keT4KdGVzdAo8L2JvZHk+CjwvaHRtbD4KCi0tKEFsdGVybmF0aXZlQm91bmRhcnkpLS0KCg==\";\n\n $imapAdapter = $this->createImapAdpater();\n\n /** @var \\PHPUnit_Framework_MockObject_MockObject $imapExtension */\n $imapExtension = $imapAdapter->getInstance();\n\n $imapExtension\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array(0)));\n\n $imapExtension\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnValue($this->createImapRawMessage(base64_decode($raw))));\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $message = $messages[0];\n\n $this->assertEquals('ORDER #12345678 - CONFIRMATION', $message['subject']);\n $this->assertEquals(1404914391, $message['received']);\n $this->assertEquals(\"test\\n\\n\", $message['plainText']);\n }", "public function testMailAttachmentParse()\n {\n $raw = \"UmV0dXJuLVBhdGg6IDxzdXBwb3J0QGNvbW9kby5jb20+ClgtT3JpZ2luYWwtVG86IHNzbEB0ZXN0LmRlCkRlbGl2ZXJlZC1UbzogY2Rzc2xAaG9zdDJjMS50ZXN0LmRlClJlY2VpdmVkOiBmcm9tIG14cDAubmljZ2F0ZS5jb20gKG14cDAubmljZ2F0ZS5jb20gWzE4OC40MC42OS43Nl0pCiAgICBieSBob3N0MmMxLnRlc3QuZGUgKFBvc3RmaXgpIHdpdGggRVNNVFBTIGlkIEREMjA5MkIzCiAgICBmb3IgPHNzbEB0ZXN0LmRlPjsgTW9uLCAgNyBKdWwgMjAxNCAxMjozMjozOSArMDIwMCAoQ0VTVCkKUmVjZWl2ZWQ6IGZyb20gbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChtY21haWwyLm1jci5jb2xvLmNvbW9kby5uZXQgW0lQdjY6MmEwMjoxNzg4OjQwMjoxYzg4OjpjMGE4Ojg4Y2NdKQogICAgYnkgbXhwMC5uaWNnYXRlLmNvbSAoUG9zdGZpeCkgd2l0aCBFU01UUFMgaWQgNEY5QjNFMjgwMEQKICAgIGZvciA8c3NsQHRlc3QuZGU+OyBNb24sICA3IEp1bCAyMDE0IDEyOjMyOjMwICswMjAwIChDRVNUKQpSZWNlaXZlZDogKHFtYWlsIDExMTYyIGludm9rZWQgYnkgdWlkIDEwMDgpOyA3IEp1bCAyMDE0IDEwOjMyOjMwIC0wMDAwClJlY2VpdmVkOiBmcm9tIG9yYWNsZW9uZV9tY3IubWNyLmNvbG8uY29tb2RvLm5ldCAoSEVMTyBtYWlsLmNvbG8uY29tb2RvLm5ldCkgKDE5Mi4xNjguMTI4LjIxKQogICAgYnkgbWNtYWlsMi5tY3IuY29sby5jb21vZG8ubmV0IChxcHNtdHBkLzAuODQpIHdpdGggU01UUDsgTW9uLCAwNyBKdWwgMjAxNCAxMTozMjozMCArMDEwMApTdWJqZWN0OiBPUkRFUiAjMTQ3NjU2MDIgLSBZb3VyIFBvc2l0aXZlU1NMIENlcnRpZmljYXRlIGZvciBmaW5hbHRlc3QudG9iaWFzLW5pdHNjaGUuZGUKRnJvbTogIkNvbW9kbyBTZWN1cml0eSBTZXJ2aWNlcyIgPG5vcmVwbHlfc3VwcG9ydEBjb21vZG8uY29tPgpUbzogInNzbEB0ZXN0LmRlIiA8c3NsQHRlc3QuZGU+CkRhdGU6IE1vbiwgMDcgSnVsIDIwMTQgMTA6MzI6MjAgKzAwMDAKTUlNRS1WZXJzaW9uOiAxLjAKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdApDb250ZW50LVR5cGU6IG11bHRpcGFydC9taXhlZDsgYm91bmRhcnk9IihBbHRlcm5hdGl2ZUJvdW5kYXJ5MikiCk1lc3NhZ2UtSUQ6IDxJbkdKYlNKK0h2QUFpTUhjN1MxVTJRQG1jbWFpbDIubWNyLmNvbG8uY29tb2RvLm5ldD4KWC1Qcm94eS1NYWlsU2Nhbm5lci1JbmZvcm1hdGlvbjogUGxlYXNlIGNvbnRhY3QgdGhlIElTUCBmb3IgbW9yZSBpbmZvcm1hdGlvbgpYLVByb3h5LU1haWxTY2FubmVyLUlEOiA0RjlCM0UyODAwRC5BMDM1MgpYLVByb3h5LU1haWxTY2FubmVyOiBGb3VuZCB0byBiZSBjbGVhbgpYLVByb3h5LU1haWxTY2FubmVyLVNwYW1DaGVjazogbm90IHNwYW0sIFNwYW1Bc3Nhc3NpbiAobm90IGNhY2hlZCwgc2NvcmU9MSwKICAgIHJlcXVpcmVkIDUuNzUsIGF1dG9sZWFybj1kaXNhYmxlZCwgREVBUl9FTUFJTCAxLjAwLAogICAgSFRNTF9NRVNTQUdFIDAuMDAsIFNQRl9IRUxPX1BBU1MgLTAuMDApClgtUHJveHktTWFpbFNjYW5uZXItU3BhbVNjb3JlOiAxClgtUHJveHktTWFpbFNjYW5uZXItRnJvbTogc3VwcG9ydEBjb21vZG8uY29tClgtUHJveHktTWFpbFNjYW5uZXItVG86IHNzbEB0ZXN0LmRlClgtU3BhbS1TdGF0dXM6IE5vCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5MikKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7IGJvdW5kYXJ5PSIoQWx0ZXJuYXRpdmVCb3VuZGFyeSkiCgotLShBbHRlcm5hdGl2ZUJvdW5kYXJ5KQpDb250ZW50LVR5cGU6IHRleHQvcGxhaW47IGNoYXJzZXQ9VVRGLTgKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogOGJpdAoKdGVzdAoKLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZTekNDQkRPZ0F3SUJBZ0lRS0lXTnpIYTFVNUFDUkJIY0dBNGdLVEFOQmdrcWhraUc5dzBCQVFVRkFEQnoKTVFzd0NRWURWUVFHRXdKSFFqRWJNQmtHQTFVRUNCTVNSM0psWVhSbGNpQk5ZVzVqYUdWemRHVnlNUkF3RGdZRApWUVFIRXdkVFlXeG1iM0prTVJvd0dBWURWUVFLRXhGRFQwMVBSRThnUTBFZ1RHbHRhWFJsWkRFWk1CY0dBMVVFCkF4TVFVRzl6YVhScGRtVlRVMHdnUTBFZ01qQWVGdzB4TkRBM01EY3dNREF3TURCYUZ3MHhOVEEzTURjeU16VTUKTlRsYU1JR0VNU0V3SHdZRFZRUUxFeGhFYjIxaGFXNGdRMjl1ZEhKdmJDQldZV3hwWkdGMFpXUXhJekFoQmdOVgpCQXNUR2todmMzUmxaQ0JpZVNCRGFHVmphMlJ2YldGcGJpQkhiV0pJTVJRd0VnWURWUVFMRXd0UWIzTnBkR2wyClpWTlRUREVrTUNJR0ExVUVBeE1iWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUlJQklqQU4KQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBMzNWTVpnd2ZOc0hoOHZlZTBkdWNoVUhsQ3drWApTcGd0VW9iVFFCZ2dEbk1HNlVUbEltcEFVVWNORzlYbWZHVlVFdE15UXd4bCthc0VkaFpoYnF1VVdqcmdNV2FlCitWZlFtN3kwQlVNNWxFRlpOdTVkWjVJblRVa2hQOHZDQnJGUVVoSGQwU1FuNjdTUWFscVJVZFNOVjBCRDBjWUYKbTJHZmtyUlZyWWNjai9JOFIxOVV6eDlNNXZwNGY4Tmw0YytuVTJzVTVLSkFZQ2JJdFBDY0lDVENaQzdQNmJ6TwprenArb1ZpbmVmeVVZcGRXMFVhd21vWmVsV2R4cllNaUZjYW5oZTZFQnI0WUg4Ny9CWWVReUcxZHJhMkhiMFdTCmpoNGxOMUFpZXRwK0E2S0I1ZHJPM1JQaGRDcHhFd2N6TGMyczFVZTl4dmdNdnd6NzM3OHpYSWNxbHdJREFRQUIKbzRJQnh6Q0NBY013SHdZRFZSMGpCQmd3Rm9BVW1lUkFYMnNVWGo0RjJkM1RZMVQ4WXJqM0FLd3dIUVlEVlIwTwpCQllFRkd1SzQ3blFNTFdNdmFOVDlvRjNzeFJObCtzck1BNEdBMVVkRHdFQi93UUVBd0lGb0RBTUJnTlZIUk1CCkFmOEVBakFBTUIwR0ExVWRKUVFXTUJRR0NDc0dBUVVGQndNQkJnZ3JCZ0VGQlFjREFqQlFCZ05WSFNBRVNUQkgKTURzR0N5c0dBUVFCc2pFQkFnSUhNQ3d3S2dZSUt3WUJCUVVIQWdFV0htaDBkSEE2THk5M2QzY3VjRzl6YVhScApkbVZ6YzJ3dVkyOXRMME5RVXpBSUJnWm5nUXdCQWdFd093WURWUjBmQkRRd01qQXdvQzZnTElZcWFIUjBjRG92CkwyTnliQzVqYjIxdlpHOWpZUzVqYjIwdlVHOXphWFJwZG1WVFUweERRVEl1WTNKc01Hd0dDQ3NHQVFVRkJ3RUIKQkdBd1hqQTJCZ2dyQmdFRkJRY3dBb1lxYUhSMGNEb3ZMMk55ZEM1amIyMXZaRzlqWVM1amIyMHZVRzl6YVhScApkbVZUVTB4RFFUSXVZM0owTUNRR0NDc0dBUVVGQnpBQmhoaG9kSFJ3T2k4dmIyTnpjQzVqYjIxdlpHOWpZUzVqCmIyMHdSd1lEVlIwUkJFQXdQb0liWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsZ2g5M2QzY3UKWm1sdVlXeDBaWE4wTG5SdlltbGhjeTF1YVhSelkyaGxMbVJsTUEwR0NTcUdTSWIzRFFFQkJRVUFBNElCQVFDbwpPL1B5cDJHTHdmWDBlbmxnVnJyVVZUYmh2NVBQV1pBajQ2Z3pidVhVYUY5a2hMNy9DQ1VJZEc3ekdvdGlDWlVZCklDOUJrYkc2S0MrWEpWdGgzam50a2JNN0ZaQzFCUHk5Q3VtSmNpWlVHdUJzem12c1k4N1VVL2FVZ0t2SlpOaVoKZGwxMW92dnBUQTJEdW5ISmtyOXF0eStFQkMyTHY4aFNwTHZlMS9KVFlwYXBqZTRSeXlrcjFYY0phaGRnOEtjOQpXN1U0SmY0aWNoV2lQTWFoSnBnZ0NrVGE0eGYybnFXdTMvVG1jeThFbjNnVWZZNEZzRTg5eWJmVDZzT0J0SVdUCnNma3BpUm5vL1FWUTBQZW4yTCtzVGFCZVZ5YmswN0IrRGdMRWxGUmxuS2NDWFBzUU9vVVdlcHJ3VkNVa1E2VE4KNFNscmRxOHY5T2lkUzg2Z01CRU4KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSkKQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9SVNPLTg4NTktMQpDb250ZW50LVRyYW5zZmVyLUVuY29kaW5nOiA3Yml0Cgo8aHRtbD4KPGhlYWQ+Cgo8L2hlYWQ+Cjxib2R5Pgp0ZXN0CjwvYm9keT4KPC9odG1sPgoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeSktLQoKLS0oQWx0ZXJuYXRpdmVCb3VuZGFyeTIpCkNvbnRlbnQtVHlwZTogYXBwbGljYXRpb24veC16aXAtY29tcHJlc3NlZDsgbmFtZT0iZmluYWx0ZXN0X3RvYmlhcy1uaXRzY2hlX2RlLnppcCIKQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogYmFzZTY0CkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7IGZpbGVuYW1lPSJmaW5hbHRlc3RfdG9iaWFzLW5pdHNjaGVfZGUuemlwIgoKVUVzREJBb0FBQUFBQUFBQVVFQ1JJcVYrM1FZQUFOMEdBQUFsQUFBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdQphWFJ6WTJobFgyUmxMbU5oTFdKMWJtUnNaUzB0TFMwdFFrVkhTVTRnUTBWU1ZFbEdTVU5CVkVVdExTMHRMUXBOClNVbEZOVlJEUTBFNE1tZEJkMGxDUVdkSlVVSXlPRk5TYjBaR2JrTnFWbE5PWVZoNFFUUkJSM3BCVGtKbmEzRm8KYTJsSE9YY3dRa0ZSVlVaQlJFSjJDazFSYzNkRFVWbEVWbEZSUjBWM1NsUlNWRVZWVFVKSlIwRXhWVVZEYUUxTQpVVmRTYTFaSVNqRmpNMUZuVVZWSmVFcHFRV3RDWjA1V1FrRnpWRWhWUm1zS1drWlNlV1JZVGpCSlJWWTBaRWRXCmVXSnRSbk5KUmxKVlZVTkNUMXBZVWpOaU0wcHlUVk5KZDBsQldVUldVVkZFUlhoc1FscEhVbFZqYmxaNlpFTkMKUmdwbFNGSnNZMjAxYUdKRFFrUlJVMEpUWWpJNU1FMUNORmhFVkVWNVRVUkplRTVxUVhkTlJFRjNUVVp2V0VSVQpTWGROUkZWNlRVUkZkMDVFWjNwUFJtOTNDbU42UlV4TlFXdEhRVEZWUlVKb1RVTlNNRWw0UjNwQldrSm5UbFpDClFXZFVSV3RrZVZwWFJqQmFXRWxuVkZkR2RWa3lhR3hqTTFKc1kycEZVVTFCTkVjS1FURlZSVUo0VFVoVk1rWnoKV20wNWVWcEVSV0ZOUW1kSFFURlZSVU5vVFZKUk1EbE9WREJTVUVsRlRrSkpSWGh3WWxkc01GcFhVWGhIVkVGWQpRbWRPVmdwQ1FVMVVSVVpDZG1NeWJEQmhXRnBzVlRGT1RVbEZUa0pKUkVsM1oyZEZhVTFCTUVkRFUzRkhVMGxpCk0wUlJSVUpCVVZWQlFUUkpRa1IzUVhkblowVkxDa0Z2U1VKQlVVUnZObXB1YWtseFlYRjFZMUZCTUU5bGNWcDYKZEVSQ056RlFhM1YxT0hablIycFJTek5uTnpCUmIzUmtRVFoyYjBKVlJqUldObUUwVW5NS1RtcGliRzk1VkdrdgphV2RDYTB4NldETlJLelZMTURWSlpIZFdjSEk1TlZoTlRFaHZLM2h2UkRscWVHSlZlRFpvUVZWc2IyTnVVRmROCmVYUkVjVlJqZVFwVlp5dDFTakZaZUUxSFEzUjVZakY2VEVSdWRXdE9hREZ6UTFWb1dVaHpjV1ozVERsbmIxVm0KWkVVclUwNUlUbU5JVVVObmMwMUVjVzFQU3l0QlVsSlpDa1o1WjJscGJtUmtWVU5ZVG0xdGVXMDFVWHBzY1hscQpSSE5wUTBvNFFXTnJTSEJZUTB4elJHdzJaWG95VUZKSlNGTkVNMU4zZVU1WFVXVjZWRE42Vmt3S2VVOW1NbWhuClZsTkZSVTloYWtKa09HazJjVGhsVDBSM1VsUjFjMmRHV0N0TFNsQm9RMmhHYnpsR1NsaGlMelZKUXpGMFpFZHQKY0c1ak5XMURkRW8xUkFwWlJEZElWM2x2VTJKb2NuVjVlbTExZDNwWFpIRk1lR1J6UXk5RVFXZE5Ra0ZCUjJwbgpaMFl6VFVsSlFtTjZRV1pDWjA1V1NGTk5SVWRFUVZkblFsTjBDblphYURaT1RGRnRPUzl5UlVwc1ZIWkJOek5uClNrMTBWVWRxUVdSQ1owNVdTRkUwUlVablVWVnRaVkpCV0RKelZWaHFORVl5WkROVVdURlVPRmx5YWpNS1FVdDMKZDBSbldVUldVakJRUVZGSUwwSkJVVVJCWjBWSFRVSkpSMEV4VldSRmQwVkNMM2RSU1UxQldVSkJaamhEUVZGQgpkMFZSV1VSV1VqQm5Ra0Z2ZHdwRFJFRkhRbWRTVmtoVFFVRk5SVkZIUVRGVlpFaDNVVGxOUkhOM1QyRkJNMjlFClYwZE5NbWd3WkVoQk5reDVPV3BqYlhkMVpGaE9iR051VW5sa1dFNHdDa3h0VG5aaVV6bENXa2RTVldOdVZucGsKUlZZMFpFZFdlV0p0Um5OUk1FWlRZakk1TUV4dFRubGlSRU5DYzNkWlNVdDNXVUpDVVZWSVFWRkZSV2RoV1hjSwpaMkZOZDFCM1dVbExkMWxDUWxGVlNFMUJTMGROTW1nd1pFaEJOa3g1T1dwamJsRjFaRmhPYkdOdVVubGtXRTR3ClRHMU9kbUpUT1VKYVIxSlZZMjVXZWdwa1JWWTBaRWRXZVdKdFJuTlJNRVpUWWpJNU1FeHVRVE5aZWtFMVFtZG4KY2tKblJVWkNVV04zUVc5WmRHRklVakJqUkc5MlRESk9lV1JETlRGak1sWjVDbVJJU2pGak0xRjFXVEk1ZEV3dwpSbXRhUmxKNVpGaE9NRlpXVWs5Vk1HUkVVVEJGZFZrelNqQk5RMVZIUTBOelIwRlJWVVpDZWtGQ2FHaHNiMlJJClVuY0tUMms0ZG1JeVRucGpRelV4WXpKV2VXUklTakZqTTFGMVdUSTVkRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkMKVVZWQlFUUkpRa0ZSUTJOT2RVNVBjblpIU3dwMU1ubFlha2s1VEZvNVEyWXlTVk54Ym5sR1prNWhSbUo0UTNScQpSR1ZwT0dReE1tNTRSR1k1VTNreVpUWkNNWEJ2WTBORmVrNUdkR2t2VDBKNU5UbE1DbVJNUWtwTGFraHZUakJFCmNrZzViVmh2ZUc5U01WTmhibUpuS3pZeFlqUnpMMkpUVWxwT2VTdFBlR3hSUkZoeFZqaDNVVlJ4WW5SSVJEUjAKWXpCaGVrTUtaVE5qYUZWT01XSnhLemN3Y0hScVZWTnNUbkpVWVRJMGVVOW1iVlZzYUU1Uk1IcERiMmxPVUVSegpRV2RQWVM5bVZEQktZa2gwVFVvNVFtZEtWMU55V2dvMlJXOVpkbnBNTnl0cE1XdHBOR1pMVjNsMmIzVkJkQ3QyCmFHTlRlSGRQUTB0aE9WbHlORmRGV0ZRd1N6TjVUbEozT0RKMlJVd3JRV0ZZWlZKRGF5OXNDblYxUjNSdE9EZG0KVFRBMGQwOHJiVkJhYml0REsyMTJOakkyVUVGamQwUnFNV2hMZGxSbVNWQlhhRkpTU0RJeU5HaHZSbWxDT0RWagpZM05LVURneFkzRUtZMlJ1Vld3MFdHMUhSazh6Q2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLClVFc0RCQW9BQUFBQUFBQUE1MFRDdzhFOVp3Y0FBR2NIQUFBZkFBQUFabWx1WVd4MFpYTjBYM1J2WW1saGN5MXUKYVhSelkyaGxYMlJsTG1OeWRDMHRMUzB0UWtWSFNVNGdRMFZTVkVsR1NVTkJWRVV0TFMwdExRcE5TVWxHVTNwRApRMEpFVDJkQmQwbENRV2RKVVV0SlYwNTZTR0V4VlRWQlExSkNTR05IUVRSblMxUkJUa0puYTNGb2EybEhPWGN3ClFrRlJWVVpCUkVKNkNrMVJjM2REVVZsRVZsRlJSMFYzU2toUmFrVmlUVUpyUjBFeFZVVkRRazFUVWpOS2JGbFkKVW14amFVSk9XVmMxYW1GSFZucGtSMVo1VFZKQmQwUm5XVVFLVmxGUlNFVjNaRlJaVjNodFlqTkthMDFTYjNkSApRVmxFVmxGUlMwVjRSa1JVTURGUVVrVTRaMUV3UldkVVIyeDBZVmhTYkZwRVJWcE5RbU5IUVRGVlJRcEJlRTFSClZVYzVlbUZZVW5Ca2JWWlVWVEIzWjFFd1JXZE5ha0ZsUm5jd2VFNUVRVE5OUkdOM1RVUkJkMDFFUW1GR2R6QjQKVGxSQk0wMUVZM2xOZWxVMUNrNVViR0ZOU1VkRlRWTkZkMGgzV1VSV1VWRk1SWGhvUldJeU1XaGhWelJuVVRJNQpkV1JJU25aaVEwSlhXVmQ0Y0ZwSFJqQmFWMUY0U1hwQmFFSm5UbFlLUWtGelZFZHJhSFpqTTFKc1drTkNhV1ZUClFrUmhSMVpxWVRKU2RtSlhSbkJpYVVKSVlsZEtTVTFTVVhkRloxbEVWbEZSVEVWM2RGRmlNMDV3WkVkc01ncGEKVms1VVZFUkZhMDFEU1VkQk1WVkZRWGhOWWxwdGJIVlpWM2d3V2xoT01FeHVVblpaYld4b1kza3hkV0ZZVW5wWgpNbWhzVEcxU2JFMUpTVUpKYWtGT0NrSm5hM0ZvYTJsSE9YY3dRa0ZSUlVaQlFVOURRVkU0UVUxSlNVSkRaMHREClFWRkZRVE16VmsxYVozZG1Ubk5JYURoMlpXVXdaSFZqYUZWSWJFTjNhMWdLVTNCbmRGVnZZbFJSUW1kblJHNU4KUnpaVlZHeEpiWEJCVlZWalRrYzVXRzFtUjFaVlJYUk5lVkYzZUd3cllYTkZaR2hhYUdKeGRWVlhhbkpuVFZkaApaUW9yVm1aUmJUZDVNRUpWVFRWc1JVWmFUblUxWkZvMVNXNVVWV3RvVURoMlEwSnlSbEZWYUVoa01GTlJialkzClUxRmhiSEZTVldSVFRsWXdRa1F3WTFsR0NtMHlSMlpyY2xKV2NsbGpZMm92U1RoU01UbFZlbmc1VFRWMmNEUm0KT0U1c05HTXJibFV5YzFVMVMwcEJXVU5pU1hSUVEyTkpRMVJEV2tNM1VEWmllazhLYTNwd0syOVdhVzVsWm5sVgpXWEJrVnpCVllYZHRiMXBsYkZka2VISlpUV2xHWTJGdWFHVTJSVUp5TkZsSU9EY3ZRbGxsVVhsSE1XUnlZVEpJCllqQlhVd3BxYURSc1RqRkJhV1YwY0N0Qk5rdENOV1J5VHpOU1VHaGtRM0I0UlhkamVreGpNbk14VldVNWVIWm4KVFhaM2VqY3pOemg2V0VsamNXeDNTVVJCVVVGQ0NtODBTVUo0ZWtORFFXTk5kMGgzV1VSV1VqQnFRa0puZDBadgpRVlZ0WlZKQldESnpWVmhxTkVZeVpETlVXVEZVT0ZseWFqTkJTM2QzU0ZGWlJGWlNNRThLUWtKWlJVWkhkVXMwCk4yNVJUVXhYVFhaaFRsUTViMFl6YzNoU1Rtd3JjM0pOUVRSSFFURlZaRVIzUlVJdmQxRkZRWGRKUm05RVFVMUMKWjA1V1NGSk5RZ3BCWmpoRlFXcEJRVTFDTUVkQk1WVmtTbEZSVjAxQ1VVZERRM05IUVZGVlJrSjNUVUpDWjJkeQpRbWRGUmtKUlkwUkJha0pSUW1kT1ZraFRRVVZUVkVKSUNrMUVjMGREZVhOSFFWRlJRbk5xUlVKQlowbElUVU4zCmQwdG5XVWxMZDFsQ1FsRlZTRUZuUlZkSWJXZ3daRWhCTmt4NU9UTmtNMk4xWTBjNWVtRllVbkFLWkcxV2VtTXkKZDNWWk1qbDBUREJPVVZWNlFVbENaMXB1WjFGM1FrRm5SWGRQZDFsRVZsSXdaa0pFVVhkTmFrRjNiME0yWjB4SgpXWEZoU0ZJd1kwUnZkZ3BNTWs1NVlrTTFhbUl5TVhaYVJ6bHFXVk0xYW1JeU1IWlZSemw2WVZoU2NHUnRWbFJWCk1IaEVVVlJKZFZrelNuTk5SM2RIUTBOelIwRlJWVVpDZDBWQ0NrSkhRWGRZYWtFeVFtZG5ja0puUlVaQ1VXTjMKUVc5WmNXRklVakJqUkc5MlRESk9lV1JETldwaU1qRjJXa2M1YWxsVE5XcGlNakIyVlVjNWVtRllVbkFLWkcxVwpWRlV3ZUVSUlZFbDFXVE5LTUUxRFVVZERRM05IUVZGVlJrSjZRVUpvYUdodlpFaFNkMDlwT0haaU1rNTZZME0xCmFtSXlNWFphUnpscVdWTTFhZ3BpTWpCM1VuZFpSRlpTTUZKQ1JVRjNVRzlKWWxwdGJIVlpWM2d3V2xoT01FeHUKVW5aWmJXeG9ZM2t4ZFdGWVVucFpNbWhzVEcxU2JHZG9PVE5rTTJOMUNscHRiSFZaVjNnd1dsaE9NRXh1VW5aWgpiV3hvWTNreGRXRllVbnBaTW1oc1RHMVNiRTFCTUVkRFUzRkhVMGxpTTBSUlJVSkNVVlZCUVRSSlFrRlJRMjhLClR5OVFlWEF5UjB4M1psZ3daVzVzWjFaeWNsVldWR0pvZGpWUVVGZGFRV28wTm1kNlluVllWV0ZHT1d0b1REY3YKUTBOVlNXUkhOM3BIYjNScFExcFZXUXBKUXpsQ2EySkhOa3RESzFoS1ZuUm9NMnB1ZEd0aVRUZEdXa014UWxCNQpPVU4xYlVwamFWcFZSM1ZDYzNwdGRuTlpPRGRWVlM5aFZXZExka3BhVG1sYUNtUnNNVEZ2ZG5ad1ZFRXlSSFZ1ClNFcHJjamx4ZEhrclJVSkRNa3gyT0doVGNFeDJaVEV2U2xSWmNHRndhbVUwVW5sNWEzSXhXR05LWVdoa1p6aEwKWXprS1Z6ZFZORXBtTkdsamFGZHBVRTFoYUVwd1oyZERhMVJoTkhobU1tNXhWM1V6TDFSdFkzazRSVzR6WjFWbQpXVFJHYzBVNE9YbGlabFEyYzA5Q2RFbFhWQXB6Wm10d2FWSnVieTlSVmxFd1VHVnVNa3dyYzFSaFFtVldlV0pyCk1EZENLMFJuVEVWc1JsSnNia3RqUTFoUWMxRlBiMVZYWlhCeWQxWkRWV3RSTmxST0NqUlRiSEprY1RoMk9VOXAKWkZNNE5tZE5Ra1ZPQ2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLVUVzQkFoUUFDZ0FBQUFBQQpBQUJRUUpFaXBYN2RCZ0FBM1FZQUFDVUFBQUFBQUFBQUFRQWdBTGFCQUFBQUFHWnBibUZzZEdWemRGOTBiMkpwCllYTXRibWwwYzJOb1pWOWtaUzVqWVMxaWRXNWtiR1ZRU3dFQ0ZBQUtBQUFBQUFBQUFPZEV3c1BCUFdjSEFBQm4KQndBQUh3QUFBQUFBQUFBQkFDQUF0b0VnQndBQVptbHVZV3gwWlhOMFgzUnZZbWxoY3kxdWFYUnpZMmhsWDJSbApMbU55ZEZCTEJRWUFBQUFBQWdBQ0FLQUFBQURFRGdBQUFBQT0KCi0tKEFsdGVybmF0aXZlQm91bmRhcnkyKS0t\";\n\n $imapAdapter = $this->createImapAdpater();\n\n /** @var \\PHPUnit_Framework_MockObject_MockObject $imapExtension */\n $imapExtension = $imapAdapter->getInstance();\n\n $imapExtension\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array(0)));\n\n $imapExtension\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnValue($this->createImapRawMessage(base64_decode($raw))));\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $attachment = $messages[0]['attachments'][0];\n\n $this->assertEquals('application/x-zip-compressed', $attachment['mime']);\n $this->assertEquals('finaltest_tobias-nitsche_de.zip', $attachment['filename']);\n $this->assertEquals(3962, strlen($attachment['content']));\n }", "public function testEmailHeaderParsing()\n {\n $default = $this->getDefaultRequest();\n\n $toAddress = array(\n 'a simple to header should return the correct address' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple to header should return the correct address, trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex to header should return the correct address, with no <>' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'a complex email address in the to header should return the correct address' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'an incorrect email address in the to header should not be recognized' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a name resembling an email address in the to header should not be used instead of the actual address' => array(\n 'string' => '[email protected] <[email protected]>',\n 'expected' => '[email protected]',\n ),\n );\n\n foreach ($toAddress as $label => $data) {\n $default['headers']['To'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getTo(), \"Parsing $label.\");\n }\n\n $rawFrom = array(\n 'a simple raw header should return as is' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple raw header should return as is, but trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex raw header should return as is' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '\"John Doe, The second\" <[email protected]>',\n ),\n );\n\n foreach ($rawFrom as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFrom(), \"Parsing $label.\");\n }\n\n $fromAddress = array(\n 'a simple from header should return the correct address' => array(\n 'string' => '[email protected]',\n 'expected' => '[email protected]',\n ),\n 'a simple from header should return the correct address, trimmed' => array(\n 'string' => ' [email protected] ',\n 'expected' => '[email protected]',\n ),\n 'a complex from header should return the correct address, with no <>' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'a complex email address in the from header should return the correct address' => array(\n 'string' => ' \"John Doe, The second\" <[email protected]> ',\n 'expected' => '[email protected]',\n ),\n 'an incorrect email address in the from header should not be recognized' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a name resembling an email address in the from header should not be used instead of the actual address' => array(\n 'string' => '[email protected] <[email protected]>',\n 'expected' => '[email protected]',\n ),\n );\n\n foreach ($fromAddress as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFromAddress(), \"Parsing $label.\");\n }\n\n $fromName = array(\n 'a simple from header with no name should return an empty string' => array(\n 'string' => '[email protected]',\n 'expected' => '',\n ),\n 'a complex from header with no name should return an empty string' => array(\n 'string' => ' <[email protected]>',\n 'expected' => '',\n ),\n 'a header with a simple name should just return the name' => array(\n 'string' => 'John Doe <[email protected]>',\n 'expected' => 'John Doe',\n ),\n 'a header with a simple name should just return the name, no double quotes' => array(\n 'string' => '\"John Doe\" <[email protected]>',\n 'expected' => 'John Doe',\n ),\n 'a header with a simple name should just return the name, no single quotes' => array(\n 'string' => \"'John Doe' <[email protected]>\",\n 'expected' => 'John Doe',\n ),\n 'a header can that contains a name with special characters should work' => array(\n 'string' => '\"John Doe, l\\'asplééààéàéèt % ?/)(_--\" <[email protected]>',\n 'expected' => 'John Doe, l\\'asplééààéàéèt % ?/)(_--',\n ),\n );\n\n foreach ($fromName as $label => $data) {\n $default['headers']['From'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getFromName(), \"Parsing $label.\");\n }\n\n $subject = array(\n 'a simple subject should return it verbatim' => array(\n 'string' => 'Subject',\n 'expected' => 'Subject',\n ),\n 'a simple subject should return it trimmed' => array(\n 'string' => ' Subject ',\n 'expected' => 'Subject',\n ),\n 'a header with no subject should just return an empty string' => array(\n 'string' => null,\n 'expected' => '',\n ),\n );\n\n foreach ($subject as $label => $data) {\n $default['headers']['Subject'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getSubject(), \"Parsing $label.\");\n }\n\n $messageID = array(\n 'a simple message ID should return it verbatim' => array(\n 'string' => '890asdjhgkasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n 'expected' => '890asdjhgkasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n ),\n 'a simple message ID should return it trimmed' => array(\n 'string' => ' 890asdjhgksdasdsaddasf90-sdfsdffsdf--sdf8s@df089sdfsdf ',\n 'expected' => '890asdjhgksdasdsaddasf90-sdfsdffsdf--sdf8s@df089sdfsdf',\n ),\n 'a header with no message ID should just return an empty string' => array(\n 'string' => null,\n 'expected' => '',\n ),\n );\n\n foreach ($messageID as $label => $data) {\n $default['headers']['Message-ID'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getMessageID(), \"Parsing $label.\");\n }\n\n $recipients = array(\n 'a simple, empty CC header' => array(\n 'string' => '',\n 'expected' => null,\n ),\n 'a simple CC header, with only one recipient (no name)' => array(\n 'string' => '[email protected]',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n )),\n ),\n 'a simple CC header, with only one recipient (with name)' => array(\n 'string' => 'John Doe <[email protected]>',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n )),\n ),\n 'a complex CC header, with only one recipient (with name)' => array(\n 'string' => ' üéà-èàèéasd@asdjk <[email protected]> ',\n 'expected' => array(array(\n 'address' => '[email protected]',\n 'name' => 'üéà-èàèéasd@asdjk',\n 'raw' => 'üéà-èàèéasd@asdjk <[email protected]>',\n )),\n ),\n 'a simple CC header, with multiple recipients (no name)' => array(\n 'string' => '[email protected], [email protected]',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => '',\n 'raw' => '[email protected]',\n ),\n ),\n ),\n 'a simple CC header, with multiple recipients (with name)' => array(\n 'string' => 'John Doe <[email protected]>, Jane Doe <[email protected]>',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => 'Jane Doe',\n 'raw' => 'Jane Doe <[email protected]>',\n ),\n ),\n ),\n 'a complex CC header, with multiple invalid recipients' => array(\n 'string' => 'John Doe <[email protected]>,, jimmy carter, jim@jane, Jane Doe <[email protected]>',\n 'expected' => array(\n array(\n 'address' => '[email protected]',\n 'name' => 'John Doe',\n 'raw' => 'John Doe <[email protected]>',\n ),\n array(\n 'address' => '[email protected]',\n 'name' => 'Jane Doe',\n 'raw' => 'Jane Doe <[email protected]>',\n ),\n ),\n ),\n );\n\n foreach ($recipients as $label => $data) {\n $default['headers']['Cc'] = $data['string'];\n $request = new Request(array(), $default);\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getRecipients(), \"Parsing $label.\");\n }\n }", "public function testParseEmailm1010() : void\n {\n $handle = \\fopen($this->messageDir . '/m1010.txt', 'r');\n $message = $this->parser->parse($handle, true);\n\n $failMessage = 'Failed while parsing m1010';\n $message->setCharsetOverride('iso-8859-1');\n $f = $message->getTextStream(0);\n $this->assertNotNull($f, $failMessage);\n $this->assertTextContentTypeEquals('HasenundFrosche.txt', $f, $failMessage);\n\n $message = null;\n // still open\n \\fseek($handle, 0);\n \\fread($handle, 1);\n \\fclose($handle);\n }", "public function testRegistrationEmailWrongFormat(): void { }", "public function testGetUserEmail()\n {\n $mail = $this->la->getMail('poa32kc');\n $this->assertEquals('[email protected]', $mail);\n }", "public function testEmailBodyParsing()\n {\n $default = $this->getDefaultRequest(array('plain', 'html'));\n\n $request = new Request(array(), $default + array(\n 'html' => 'html',\n 'plain' => 'plain',\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals('plain', $email->getBody(), \"Plain text emails always take precedence.\");\n\n $plainText = array(\n 'a simple, straight-forward email body' => array(\n 'string' => \"Line 1\\nLine2\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'a simple, straight-forward email body with different newlines' => array(\n 'string' => \"Line 1\\rLine2\\r\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with trailing white-space' => array(\n 'string' => \"Line 1\\rLine2\\r\\n\\nLine3 \",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with leading white-space' => array(\n 'string' => \" Line 1\\rLine2\\r\\n\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n 'an email body with leading and trailing white-space' => array(\n 'string' => \" \\n\\r Line 1\\rLine2\\r\\n\\nLine3 \\r \",\n 'expected' => \"Line 1\\nLine2\\n\\nLine3\",\n ),\n );\n\n foreach ($plainText as $label => $data) {\n $request = new Request(array(), $default + array(\n 'plain' => $data['string'],\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getBody(), \"Parsing $label.\");\n }\n\n $htmlText = array(\n 'a simple, straight-forward email body, with only divs' => array(\n 'string' => \"<div>Line 1</div><div>Line2</div><div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only divs and containing newlines as well' => array(\n 'string' => \"<div>Line 1</div>\\n<div>Line2</div>\\n<div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only divs and containing different newlines' => array(\n 'string' => \"<div>Line 1</div>\\r\\n<div>Line2</div>\\r<div>Line3</div>\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, with only ps and containing different newlines' => array(\n 'string' => \"<p>Line 1</p>\\r\\n<p>Line2</p>\\r<p>Line3</p>\",\n 'expected' => \"Line 1\\n\\nLine2\\n\\nLine3\",\n ),\n 'an email body containing brs' => array(\n 'string' => \"Line 1<br>Line2<br />Line3\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body containing brs and newlines' => array(\n 'string' => \"Line 1<br>\\n\\n\\nLine2<br />\\nLine3\",\n 'expected' => \"Line 1\\nLine2\\nLine3\",\n ),\n 'an email body, containing nested divs and ps' => array(\n 'string' => \"<div><p>Line 1</p><div><div></div><p>Line2</p></div></div><div><div><p>Line3</p></div></div>\",\n 'expected' => \"Line 1\\n\\nLine2\\n\\nLine3\",\n ),\n );\n\n foreach ($htmlText as $label => $data) {\n $request = new Request(array(), $default + array(\n 'html' => $data['string'],\n ));\n\n $email = new CloudMailinEmail($request);\n\n $this->assertEquals($data['expected'], $email->getBody(), \"Parsing $label.\");\n }\n }", "public function testEmail() {\n $this->assertEquals('[email protected]', Sanitize::email('em<a>[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('email+t(a)[email protected]'));\n $this->assertEquals('[email protected]', Sanitize::email('em\"ail+t(a)[email protected]'));\n }", "public function parseMailFile($raw){\n\t\t\tif($raw === false) return false;\n\t\t\t$s = array(\t\".\", \t\"+\"\t\t);\n\t\t\t$r = array(\t\"\\.\", \t\"\\+\"\t);\n\t\t\t$m = preg_match(\"/^(From \".preg_quote($this->responseEmail()).\".+)(^From )?/ms\", $raw, $matches);\n\t\t\tif($m)\treturn trim($matches[1]);\n\t\t\telse return false;\n\t\t}", "protected function setUp(): void\n\t{\n\t\tglobal $txt;\n\t\trequire_once(SUBSDIR . '/Emailpost.subs.php');\n\n\t\t$lang = new Loader('english', $txt, database());\n\t\t$lang->load('Maillist');\n\t\tUser::$info = new UserInfo(['name' => 'name']);\n\n\t\t$this->_email = 'Return-Path: <[email protected]>\nDelivered-To: <[email protected]>\nReceived: from galileo.tardis.com\n\tby galileo.tardis.com (Dovecot) with LMTP id znQ3AvalOVi/SgAAhPm7pg\n\tfor <[email protected]>; Sat, 26 Nov 2016 09:10:46 -0600\nReceived: by galileo.tardis.com (Postfix, from userid 1005)\n\tid 0671C1C8; Sat, 26 Nov 2016 09:10:46 -0600 (CST)\nX-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on\n\tgalileo.tardis.com\nX-Spam-Flag: YES\nX-Spam-Level: ******\nX-Spam-Status: Yes, score=5.0 required=5.0 tests=HTML_IMAGE_ONLY_16,\n\tHTML_MESSAGE,HTML_SHORT_LINK_IMG_2,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI,\n\tMPART_ALT_DIFF,RCVD_IN_BRBL_LASTEXT,T_DKIM_INVALID,URIBL_BLACK autolearn=no\n\tautolearn_force=no version=3.4.0\nReceived: from mail.elkarte.net (s2.eurich.de [85.214.104.5])\n\tby galileo.tardis.com (Postfix) with ESMTP id 1872579\n\tfor <[email protected]>; Sat, 26 Nov 2016 09:10:40 -0600 (CST)\nReceived: from localhost (localhost [127.0.0.1])\n\tby mail.elkarte.net (Postfix) with ESMTP id 9DE3C4CE1535\n\tfor <[email protected]>; Sat, 26 Nov 2016 16:10:39 +0100 (CET)\nX-Virus-Scanned: Debian amavisd-new at s2.eurich.de\nReceived: from mail.elkarte.net ([127.0.0.1])\n\tby localhost (h2294877.stratoserver.net [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id zQep5x32jrqA for <[email protected]>;\n\tSat, 26 Nov 2016 16:10:03 +0100 (CET)\nReceived: from mail.elkarte.net (h2294877.stratoserver.net [85.214.104.5])\n\tby mail.elkarte.net (Postfix) with ESMTPA id 990694CE0CFA\n\tfor <[email protected]>; Sat, 26 Nov 2016 16:10:03 +0100 (CET)\nSubject: [ElkArte Community] Test Message\nTo: <[email protected]>\nFrom: \"Administrator via ElkArte Community\" <[email protected]>\nReply-To: \"ElkArte Community\" <[email protected]>\nReferences: <[email protected]>\nDate: Sat, 26 Nov 2016 15:09:15 -0000\nX-Mailer: ELK\nX-Auto-Response-Suppress: All\nAuto-Submitted: auto-generated\nList-Id: <[email protected]>\nList-Unsubscribe: <http://www.elkarte.net/community/index.php?action=profile;area=notification>\nList-Owner: <mailto:[email protected]> (ElkArte Community)\nMime-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"ELK-66593aefa4beed000470cbd4cc3238d9\"\nContent-Transfer-Encoding: 7bit\nMessage-ID: <[email protected]>\n\n\nTesting\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\nTesting\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9--\n\n--ELK-66593aefa4beed000470cbd4cc3238d9\nContent-Type: text/html; charset=UTF-8\nContent-Transfer-Encoding: 7bit\n\n\n<strong>Testing</strong>\n\n\nRegards, The ElkArte Community\n\n[cd8c399768891330804a1d2fc613ccf3-t4124]\n\n--ELK-66593aefa4beed000470cbd4cc3238d9--';\n\t}", "private function testEmail(){\n $this->user_panel->checkSecurity();\n $this->mail_handler->testEmailFunction();\n }", "public function parseEmail($raw){\n\t\t\t$rawMessage = explode(\"\\n\\n\", $raw, 2);\n\t\t\t$header = trim($rawMessage[0]);\n\t\t\t$body = trim($rawMessage[1]);\n\n\t\t\tpreg_match(\"%Date: (.+?)\\n%\", $header, $date);\t\t\t\t\t\t//Parse date\n\t\t\t$receiveDate = strtotime($date[1]);\n\n\t\t\t//On Jan 24, 2011, at 8:00 PM, OhJournal wrote:\n\t\t\tpreg_match(\"%^([\\s\\S]+?)On (.+?), at (.+?), OhJournal%\", $body, $parts);\t//Parse send date & time from reply line\n\t\t\t$sendDate = strtotime($parts[2].\" \".$parts[3]);\n\t\t\t\n\t\t\t//should implement this as a config variable - this removes hard wrapping, but also removes a lot of newlines\n\t\t\t//$body = preg_replace('%(\\S)\\n(\\S)%', '\\1 \\2', trim(quoted_printable_decode(preg_replace(\"/=[\\n\\r]+/\", \"\", trim($parts[1])))));\n\t\t\t$body = trim(quoted_printable_decode(preg_replace(\"/=[\\n\\r]+/\", \"\", trim($parts[1]))));\n\n\t\t\treturn array($sendDate, $receiveDate, $header, $body);\n\t\t}", "public function testAntBackendGetMessage()\r\n\t{\r\n\t\t// Create new mail object and save it to ANT\r\n\t\t$obj = CAntObject::factory($this->dbh, \"email_message\", null, $this->user);\r\n\t\t$obj->setGroup(\"Inbox\");\r\n\t\t$obj->setValue(\"flag_seen\", 'f');\r\n\t\t$obj->setHeader(\"Subject\", \"UnitTest EmailSubject\");\r\n\t\t$obj->setHeader(\"From\", \"[email protected]\");\r\n\t\t$obj->setHeader(\"To\", \"[email protected]\");\r\n\t\t$obj->setBody(\"UnitTest EmailBody\", \"plain\");\r\n\t\t$eid = $obj->save();\r\n\r\n\t\t$contentParams = new ContentParameters();\r\n $email = $this->backend->getEmail($eid, $contentParams);\r\n $this->assertEquals($obj->getValue(\"subject\"), $email->subject);\r\n $this->assertEquals($obj->getValue(\"sent_from\"), $email->from); \r\n \r\n // Cleanup\r\n $obj->removeHard();\r\n\t}", "public function test_sanitized_email() {\n\t\t$actual = wp_create_user_request( 'some(email<withinvalid\\[email protected]', 'export_personal_data' );\n\n\t\t$this->assertNotWPError( $actual );\n\n\t\t$post = get_post( $actual );\n\n\t\t$this->assertSame( 'export_personal_data', $post->post_name );\n\t\t$this->assertSame( '[email protected]', $post->post_title );\n\t}", "public function testRequireEmail()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }", "public function testEmailSend() {\n\n }", "public function testMailAssume()\n {\n $asserts = array();\n\n foreach ($this->messages as $id => $message) {\n $asserts[$id] = array();\n\n $asserts[$id]['id'] = $id;\n\n $asserts[$id]['folder'] = $this->createZendImapStorageFolder();\n $asserts[$id]['subject'] = $message['subject'];\n $asserts[$id]['received'] = strtotime($message['date']);\n $asserts[$id]['plainText'] = $message['plainText'];\n $asserts[$id]['attachments'] = null;\n $asserts[$id]['type'] = $message['type'];\n $asserts[$id]['domainName'] = $message['domainName'];\n $asserts[$id]['orderNumber'] = $message['orderNumber'];\n }\n\n $imapAdapter = $this->createImapAdpater();\n\n $imapAdapter\n ->expects($this->any())\n ->method('search')\n ->will($this->returnValue(array_keys($this->messages)));\n\n $testClass = $this;\n\n $imapAdapter\n ->expects($this->any())\n ->method('getMessage')\n ->will($this->returnCallback(function ($id) use ($testClass) {\n return $testClass->createImapStorageMessage($id);\n }));\n\n\n $messages = $this->imapHelper->fetchMails($imapAdapter, array(), null, null, true, true);\n\n $this->assertEquals($asserts, $messages);\n }", "function parse_email($input) {\n\n // TODO TEST\n\n $input = trim($input);\n if (!$input) return false;\n\n if (preg_match('/^\\s*(([A-Z0-9._%+-]+)@([A-Z0-9.-]+\\.[A-Z]{2,4}))\\s*$/i', $input, $m)) {\n return array(\n 'email' => $m[1],\n 'user' => $m[2],\n 'domain' => $m[3]\n );\n } else {\n return false;\n }\n\n }", "public function getMail(){\n\t\t\t$data = file_get_contents($this->config->mailFile);\n\t\t\tif($data == NULL || trim($data) == \"\") return false;\n\t\t\treturn $data;\n\t\t}", "public function testParseHtmlEntities()\n {\n $file = __DIR__ . '/data/encoding.txt';\n $full_message = file_get_contents($file);\n $this->assertNotEmpty($full_message);\n\n $structure = Mime_Helper::decode($full_message, true, true);\n $this->assertEquals(\n \"\\npöördumise töötaja.\\n<b>Võtame</b> töösse võimalusel.\\npöördumisele süsteemis\\n\\n\", $structure->body\n );\n }", "public function TestEmail($data) {\r\n $data = trim($data);\r\n $data = filter_var($data, FILTER_SANITIZE_EMAIL);\r\n $data = filter_var($data,FILTER_VALIDATE_EMAIL);\r\n return $data;\r\n }", "public function testSpecificAllowedEmailAddressGet()\n {\n }", "private static function checkValidEMail(string $email): void {\n\t\ttry {\n\t\t\t// Check E-Mail pattern\n\t\t\t$atPos = mb_strpos($email, '@');\n\t\t\t$lastPointPos = mb_strrpos($email, '.');\n\n\t\t\tif(! $atPos || ! $lastPointPos) {\n\t\t\t\tthrow new Exception('E-Mail-Address \"' . htmlspecialchars($email) . '\" is invalid!');\n\t\t\t}\n\n\t\t\tif(! ($atPos > 0 && $lastPointPos > ($atPos + 1) && mb_strlen($email) > ($lastPointPos + 1))) {\n\t\t\t\tthrow new Exception('E-Mail-Address \"' . htmlspecialchars($email) . '\" is invalid!');\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t}\n\t}", "public function testRead()\n\t{\n\t\t$user = User::find(1);\n\n\t\t$this->assertNotNull($user);\n\t\t$this->assertEquals(1, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\n\t\t//Reading by email\n\t\t$user = User::where('email', '=', '[email protected]')->get()->first();\n\n\t\t$this->assertNotNull($user);\n\t\t$this->assertEquals(1, $user->id);\n\t\t$this->assertEquals('[email protected]', $user->email);\n\t}", "public function testAllowedEmailAddressGet()\n {\n }", "public function testEmailValidation() {\n $this->visit('http://londonce.lan/login')\n ->submitForm('Login', ['log' => 'dfdfdfd', 'password' => '11'])\n ->see('Your Username or Password has not been recognised. Please try again.');\n }", "private function handleFrom ()\n {\n $eregA = \"/^'.*@.*$/\";\n\n if ( strpos ($this->fileData['from'], '<') !== false )\n {\n //to validate complex email address i.e. Erik A. O <[email protected]>\n $ereg = (preg_match ($eregA, $this->fileData[\"from\"])) ? $this->longMailEreg : \"/^(.*)(<(.*)>)$/\";\n preg_match ($ereg, $this->fileData[\"from\"], $matches);\n\n if ( isset ($matches[1]) && $matches[1] != '' )\n {\n //drop the \" characters if they exist\n $this->fileData['from_name'] = trim (str_replace ('\"', '', $matches[1]));\n }\n else\n {\n //if the from name was not set\n $this->fileData['from_name'] = '';\n }\n\n if ( !isset ($matches[3]) )\n {\n throw new Exception ('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);\n }\n\n $this->fileData['from_email'] = trim ($matches[3]);\n }\n else\n {\n //to validate simple email address i.e. [email protected]\n $ereg = (preg_match ($eregA, $this->fileData[\"from\"])) ? $this->mailEreg : \"/^(.*)$/\";\n preg_match ($ereg, $this->fileData[\"from\"], $matches);\n\n if ( !isset ($matches[0]) )\n {\n throw new Exception ('Invalid email address in FROM parameter (' . $this->fileData['from'] . ')', $this->ExceptionCode['WARNING']);\n }\n\n $this->fileData['from_name'] = '';\n $this->fileData['from_email'] = $matches[0];\n }\n\n // Set reply to\n preg_match ($this->longMailEreg, $this->fileData['from_name'], $matches);\n if ( isset ($matches[3]) )\n {\n $this->fileData['reply_to'] = $matches[3];\n $this->fileData['reply_to_name'] = isset ($matches[1]) ? $matches[1] : $this->fileData['from_name'];\n }\n else\n {\n preg_match ($this->mailEreg, $this->fileData['from_name'], $matches);\n if ( isset ($matches[1]) )\n {\n $this->fileData['reply_to'] = $matches[1];\n $this->fileData['reply_to_name'] = '';\n }\n else\n {\n $this->fileData['reply_to'] = '';\n $this->fileData['reply_to_name'] = '';\n }\n }\n }", "public function testAuthenticateEmailUser ()\n {\n $result = $this->storage->authenticateUser($this->email1, $this->signature1, $this->stringToSign1);\n $this->assertEquals($this->email1, $result['email_address']);\n }", "public function getMail();", "public function testVerifyAllowedEmailAddressGet()\n {\n }", "public function testMyGmailAddressIsEvaluatedAsTrue()\n {\n $this->assertTrue(EmailValidator::validate(\"[email protected]\"));\n }", "public function testFixture() : void {\n $message = $this->getFixture(\"mixed_filename.eml\");\n\n self::assertEquals(\"Свежий прайс-лист\", $message->subject);\n self::assertFalse($message->hasTextBody());\n self::assertFalse($message->hasHTMLBody());\n\n self::assertEquals(\"2018-02-02 19:23:06\", $message->date->first()->setTimezone('UTC')->format(\"Y-m-d H:i:s\"));\n\n $from = $message->from->first();\n self::assertEquals(\"Прайсы || ПартКом\", $from->personal);\n self::assertEquals(\"support\", $from->mailbox);\n self::assertEquals(\"part-kom.ru\", $from->host);\n self::assertEquals(\"[email protected]\", $from->mail);\n self::assertEquals(\"Прайсы || ПартКом <[email protected]>\", $from->full);\n\n self::assertEquals(\"[email protected]\", $message->to->first());\n\n self::assertCount(1, $message->attachments());\n\n $attachment = $message->attachments()->first();\n self::assertInstanceOf(Attachment::class, $attachment);\n self::assertEquals(\"Price4VladDaKar.xlsx\", $attachment->name);\n self::assertEquals('xlsx', $attachment->getExtension());\n self::assertEquals('text', $attachment->type);\n self::assertEquals(\"application/octet-stream\", $attachment->content_type);\n self::assertEquals(\"b832983842b0ad65db69e4c7096444c540a2393e2d43f70c2c9b8b9fceeedbb1\", hash('sha256', $attachment->content));\n self::assertEquals(94, $attachment->size);\n self::assertEquals(2, $attachment->part_number);\n self::assertEquals(\"attachment\", $attachment->disposition);\n self::assertNotEmpty($attachment->id);\n }", "public function testMailingList() {\n\t}", "public function testEmailIsValid($data)\n {\n $pattern='/^[A-Za-z0-9_\\-]+(\\.[A-Za-z0-9_\\-]+)*\\@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*(\\.[A-Za-z]{2,16})$/';\n $this->assertMatchesRegularExpression($pattern,$data);\n\n }", "public function testAuthenticationsEmailIdGet()\n {\n }", "function isEmail($email) {\nreturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$email));\n}", "function EMAIL_test($e_to,$e_to_name,$e_subject,$e_in_subject,$e_body){\n\t\t\t// Create the mail transport configuration\n\t\t\t$transport = Swift_MailTransport::newInstance();\n\t\t\t\n\t\t\t// Create the message\n\t\t\t$message = Swift_Message::newInstance();\n\t\t\t$message->setTo(array(\n\t\t\t $e_to => $e_to_name\n\t\t\t));\n\t\t\t$message->setSubject($e_subject . \" - UnitedGaming\");\n\t\t\t$message->setBody(\n\t\t\t'<html>\n\t\t\t<link href=\"http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700\" rel=\"stylesheet\" type=\"text/css\"/>\n\t\t\t<table border=\"0\" align=\"center\">\n\t\t\t<tr>\n\t\t\t<td><a href=\"http://unitedgaming.org\" target=\"_blank\" title=\"UnitedGaming\" alt=\"UnitedGaming\"><img src=\"http://unitedgaming.org/mainlogo.png\" alt=\"UnitedGaming\" border=\"0\"/></td>\n\t\t\t<td><font face=\"Source Sans Pro\" size=\"6px\" color=\"#BD3538\">'.$e_in_subject.'</font></td>\n\t\t\t</tr>' \n\t\t\t.\n\t\t\t'<br/><br /><br/><tr>\n\t\t\t<td colspan=\"2\"><font face=\"Arial\" size=\"3px\" color=\"#303030\">'.$e_body.'\n\t\t\t </td></tr><tr><td><br/><font face=\"Source Sans Pro\" size=\"2px\">Kind Regards,<br/>Chuevo</font></td><td></td></tr></table></html>\n\t\t\t ');\n\t\t\t$message->setFrom(\"[email protected]\", \"UnitedGaming\");\n\t\t\t$type = $message->getHeaders()->get('Content-Type');\n\n\t\t\t$type->setValue('text/html');\n\t\t\t$type->setParameter('charset', 'utf-8');\n\t\t\t\n\t\t\t//echo $type->toString();\n\t\t\t\n\t\t\t/*\n\t\t\t\n\t\t\tContent-Type: text/html; charset=utf-8\n\t\t\t\n\t\t\t*/\n\t\t\t// Send the email\n\t\t\t$mailer = Swift_Mailer::newInstance($transport);\n\t\t\t$mailer->send($message);\n}", "public function testCanBeCreatedFromValidEmailAddress()\n {\n\n }", "function isemail($email) {\r\n return preg_match('|^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]{2,})+$|i', $email);\r\n\r\n // /* Define the test for a valid email address */ \r\n // $email_test = \"/ \r\n // ^([a-zA-Z0-9_\\.\\-\\+]) \r\n // + \r\n // \\@ \r\n // (([a-zA-Z0-9\\-])+\\.) \r\n // + \r\n // ([a-zA-Z0-9]{2,4})+$ \r\n // /x\"; \r\n}", "public function testAllowedEmailAddressPost()\n {\n }", "public function testRfcEmailValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"email\", function (Field $field): void {\n $field->email(\"rfc\");\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"email:rfc\"], $rules[\"email\"]);\n }", "function emailOk ($email) {\r\n return filter_var($email, FILTER_VALIDATE_EMAIL);\r\n }", "public function testGetInvalidUserByEmail() {\n\t\t// grab an email that does not exist\n\t\t$user = User::getUserByEmail($this->getPDO(), \"<sript><Scrpt\");\n\t\t$this->assertNull($user);\n\t}", "function is_valid_email($mail) {\r\t// simple: \t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.[a-z]{2,6}$/i\"\r\t$r = 0;\r\tif($mail) {\r\t\t$p =\t\"/^[-_a-z0-9]+(\\.[-_a-z0-9]+)*@[-a-z0-9]+(\\.[-a-z0-9]+)*\\.(\";\r\t\t// TLD (01-30-2004)\r\t\t$p .=\t\"com|edu|gov|int|mil|net|org|aero|biz|coop|info|museum|name|pro|arpa\";\r\t\t// ccTLD (01-30-2004)\r\t\t$p .=\t\"ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|az|ba|bb|bd|\";\r\t\t$p .=\t\"be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|\";\r\t\t$p .=\t\"cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|\";\r\t\t$p .=\t\"ec|ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|\";\r\t\t$p .=\t\"gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|\";\r\t\t$p .=\t\"im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|\";\r\t\t$p .=\t\"ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|\";\r\t\t$p .=\t\"mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|\";\r\t\t$p .=\t\"nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|\";\r\t\t$p .=\t\"py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|\";\r\t\t$p .=\t\"sr|st|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|\";\r\t\t$p .=\t\"tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|\";\r\t\t$p .=\t\"za|zm|zw\";\r\t\t$p .=\t\")$/i\";\r\r\t\t$r = preg_match($p, $mail) ? 1 : 0;\r\t}\r\treturn $r;\r}", "public function eml2records($fh){\n $data = is_resource($fh) ? stream_get_contents($fh) : $fh;\n // Initialize the parser\n $this->parser = new EmlParse($data);\n $this->checkForCaseAttachment();\n $this->parser->zapLineBreaks = $this->settings->zapLineBreaks;\n $addressees = $this->parser->getTo();\n $sender = $this->parser->getFrom();\n $subject = $this->parser->getSubject();\n $senderSubject = array('{sender}' => $sender->address, '{subject}' => $subject);\n $this->log(Yii::t('app','Loaded contents of email from {sender}, subject \"{subject}\".', $senderSubject));\n\n // Test that the sender is a valid user:\n $user = Profile::model()->findByAttributes(array('emailAddress' => $sender->address));\n if(!(bool) $user){// User doesn't exist in database; no matching address.\n // Silently log the event and exit, but don't notify the sender.\n $this->log(Yii::t('app','Rejecting email with subject \"{subject}\" from {sender}; it is from an email address that does not match any user profile and may possibly be spam.', $senderSubject));\n return;\n }\n // Set user for model creation\n $this->user = User::model()->findByAttributes(array('username' => $user->username));\n Yii::app()->setSuModel($this->user);\n\n\n if(count($addressees)){ // Typically should never be equivalent to false, unless the parser fails.\n $dropboxFwd = false;\n foreach($addressees as $dest){\n // Check to see if the email is addressed directly to the alias.\n // If not, use case 2 will be the case.\n $dropboxFwd = $dropboxFwd || strpos($dest->address, $this->alias) !== false;\n if($dropboxFwd){\n break;\n }\n }\n if($dropboxFwd){\n // Use case 1: user is forwarding directly to the dropbox capture, so\n // the contact details will need to be parsed from the email body\n // Only operate if the user with that email address exists\n // in the database (to distinguish from spam). Examine the\n // forwarded message.\n $this->log(Yii::t('app','Interpreting email as a forwarded message from a contact or social feed post; email has been sent directly to the alias.'));\n try{\n $from = $this->parser->getForwardedFrom($this->settings->ignoreEmptyName);\n }catch(Exception $e){\n if(!preg_match('/^fwd:/i', $this->parser->getSubject())){\n // Use case 3: Assume the user is *sending* and not\n // forwarding an email, to put it in as a social post\n // rather than importing a user's email.\n $this->log(Yii::t('app','Interpreting email as a social post; it contained no recognized forwarded message patterns and its subject does not indicate that it is a forwarded message.'));\n return $this->createSocialPost($this->parser->bodyCleanup());\n }else{\n $this->log(Yii::t('app','Tried to extract contact info from the attached forwarded message, but no matching patterns are available for extracting it.'));\n $this->sendErrorEmail('', 'forward');\n return;\n }\n }\n\n $this->log(Yii::t('app','Successfully parsed contact details from the forwarded message.'));\n $contact = $this->resolveContact($from);\n\n\n if((bool) $contact){\n if(!$this->isCase){\n // Make a new action tied to the contact record\n $body = Yii::t('app', \"Email sent from {contact}:\", array(\n '{contact}' => strtolower(Modules::displayName(false, 'Contacts')),\n )).\"\\n\\n\".$this->parser->bodyCleanup();\n $action = $this->createAction($contact, 'emailFrom');\n }else{\n // Making a service case\n $this->createCase($contact,'emailFrom');\n }\n }\n }else{\n // Use case 2: user is CC-ing to the dropbox capture. Get the contact\n // details from the header fields. Much simpler case.\n // Obtain all destinations:\n $this->log(Yii::t('app','Obtaining contact details from the \"To:\" field; email has been CC-ed to the alias.'));\n $addressees = $this->parser->getTo();\n foreach($addressees as $recipient){\n $contact = $this->resolveContact($recipient);\n if((bool) $contact){\n $body = $this->parser->bodyCleanup();\n if(!$this->isCase){\n $action = $this->createAction($contact, 'email');\n } else {\n $this->createCase($contact,'email');\n }\n }\n }\n }\n }\n }", "public function testSimpleEmailValidation(): void\n {\n $builder = new ValidationBuilder();\n $builder->validate(\"email\", function (Field $field): void {\n $field->email();\n });\n\n $rules = $builder->getRules();\n\n $this->assertCount(1, $rules);\n $this->assertEquals([\"email\"], $rules[\"email\"]);\n }", "abstract public function get_first_line_support_email();", "public function validEmailValidDataProvider() {}", "public function testEmailVerification(): void {\n\t\t$user = $this->createUser();\n\t\t$newEmail = '[email protected]';\n\t\t$token = $this->createToken($user->id, $newEmail);\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->getJson($this->route.'/email/verify/'.$token->token);\n\t\t$response->assertStatus(HttpStatus::STATUS_OK);\n\t\t$response->assertJson([\n\t\t\t'message' => 'Your e-mail has been verified. Proceed to login.'\n\t\t]);\n\t\t$this->assertDatabaseHas('users',[\n\t\t\t'id' => $user->id,\n\t\t\t'email' => $newEmail\n\t\t]);\n\t}", "public function testMagicCall()\n {\n $client = new Client($this->options);\n $emails = $client->emails();\n\n $this->assertTrue(is_array($emails));\n }", "public function parse($emails, $multiple = true, $encoding = 'UTF-8')\n {\n $emailAddresses = [];\n\n // Variables to be used during email address collection\n $emailAddress = $this->buildEmailAddressArray();\n\n $success = true;\n $reason = null;\n\n // Current state of the parser\n $state = self::STATE_TRIM;\n\n // Current sub state (this is for when we get to the [email protected] email address itself)\n $subState = self::STATE_START;\n $commentNestLevel = 0;\n\n $len = mb_strlen($emails, $encoding);\n if (0 == $len) {\n $success = false;\n $reason = 'No emails passed in';\n }\n $curChar = null;\n for ($i = 0; $i < $len; ++$i) {\n $prevChar = $curChar; // Previous Charater\n $curChar = mb_substr($emails, $i, 1, $encoding); // Current Character\n switch ($state) {\n case self::STATE_SKIP_AHEAD:\n // Skip ahead is set when a bad email address is encountered\n // It's supposed to skip to the next delimiter and continue parsing from there\n if ($multiple &&\n (' ' == $curChar ||\n \"\\r\" == $curChar ||\n \"\\n\" == $curChar ||\n \"\\t\" == $curChar ||\n ',' == $curChar)) {\n $state = self::STATE_END_ADDRESS;\n } else {\n $emailAddress['original_address'] .= $curChar;\n }\n\n break;\n /* @noinspection PhpMissingBreakStatementInspection */\n case self::STATE_TRIM:\n if (' ' == $curChar ||\n \"\\r\" == $curChar ||\n \"\\n\" == $curChar ||\n \"\\t\" == $curChar) {\n break;\n } else {\n $state = self::STATE_ADDRESS;\n if ('\"' == $curChar) {\n $emailAddress['original_address'] .= $curChar;\n $state = self::STATE_QUOTE;\n break;\n } elseif ('(' == $curChar) {\n $emailAddress['original_address'] .= $curChar;\n $state = self::STATE_COMMENT;\n break;\n }\n // Fall through to next case self::STATE_ADDRESS on purpose here\n }\n // Fall through\n // no break\n case self::STATE_ADDRESS:\n if (',' != $curChar || !$multiple) {\n $emailAddress['original_address'] .= $curChar;\n }\n\n if ('(' == $curChar) {\n // Handle comment\n $state = self::STATE_COMMENT;\n $commentNestLevel = 1;\n break;\n } elseif (',' == $curChar) {\n // Handle Comma\n if ($multiple && (self::STATE_DOMAIN == $subState || self::STATE_AFTER_DOMAIN == $subState)) {\n // If we're already in the domain part, this should be the end of the address\n $state = self::STATE_END_ADDRESS;\n break;\n } else {\n $emailAddress['invalid'] = true;\n if ($multiple || ($i + 5) >= $len) {\n $emailAddress['invalid_reason'] = 'Misplaced Comma or missing \"@\" symbol';\n } else {\n $emailAddress['invalid_reason'] = 'Comma not permitted - only one email address allowed';\n }\n }\n } elseif (' ' == $curChar ||\n \"\\t\" == $curChar || \"\\r\" == $curChar ||\n \"\\n\" == $curChar) {\n // Handle Whitespace\n\n // Look ahead for comments after the address\n $foundComment = false;\n for ($j = ($i + 1); $j < $len; ++$j) {\n $lookAheadChar = mb_substr($emails, $j, 1, $encoding);\n if ('(' == $lookAheadChar) {\n $foundComment = true;\n break;\n } elseif (' ' != $lookAheadChar &&\n \"\\t\" != $lookAheadChar &&\n \"\\r\" != $lookAheadChar &&\n \"\\n\" != $lookAheadChar) {\n break;\n }\n }\n // Check if there's a comment found ahead\n if ($foundComment) {\n if (self::STATE_DOMAIN == $subState) {\n $subState = self::STATE_AFTER_DOMAIN;\n } elseif (self::STATE_LOCAL_PART == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email Address contains whitespace';\n }\n } elseif (self::STATE_DOMAIN == $subState || self::STATE_AFTER_DOMAIN == $subState) {\n // If we're already in the domain part, this should be the end of the whole address\n $state = self::STATE_END_ADDRESS;\n break;\n } else {\n if (self::STATE_LOCAL_PART == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email address contains whitespace';\n } else {\n // If the previous section was a quoted string, then use that for the name\n $this->handleQuote($emailAddress);\n $emailAddress['name_parsed'] .= $curChar;\n }\n }\n } elseif ('<' == $curChar) {\n // Start of the local part\n if (self::STATE_LOCAL_PART == $subState || self::STATE_DOMAIN == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Email address contains multiple opening \"<\" (either a typo or multiple emails that need to be separated by a comma or space)';\n } else {\n // Here should be the start of the local part for sure everything else then is part of the name\n $subState = self::STATE_LOCAL_PART;\n $emailAddress['special_char_in_substate'] = null;\n $this->handleQuote($emailAddress);\n }\n } elseif ('>' == $curChar) {\n // should be end of domain part\n if (self::STATE_DOMAIN != $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Did not find domain name before a closing '>'\";\n } else {\n $subState = self::STATE_AFTER_DOMAIN;\n }\n } elseif ('\"' == $curChar) {\n // If we hit a quote - change to the quote state, unless it's in the domain, in which case it's error\n if (self::STATE_DOMAIN == $subState || self::STATE_AFTER_DOMAIN == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Quote \\'\"\\' found where it shouldn\\'t be';\n } else {\n $state = self::STATE_QUOTE;\n }\n } elseif ('@' == $curChar) {\n // Handle '@' sign\n if (self::STATE_DOMAIN == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Multiple at '@' symbols in email address\";\n } elseif (self::STATE_AFTER_DOMAIN == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Stray at '@' symbol found after domain name\";\n } elseif (null !== $emailAddress['special_char_in_substate']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Invalid character found in email address local part: '{$emailAddress['special_char_in_substate']}'\";\n } else {\n $subState = self::STATE_DOMAIN;\n if ($emailAddress['address_temp'] && $emailAddress['quote_temp']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Something went wrong during parsing.';\n $this->log('error', \"Email\\\\Parse->parse - Something went wrong during parsing:\\n\\$i: {$i}\\n\\$emailAddress['address_temp']: {$emailAddress['address_temp']}\\n\\$emailAddress['quote_temp']: {$emailAddress['quote_temp']}\\nEmails: {$emails}\\n\\$curChar: {$curChar}\");\n } elseif ($emailAddress['quote_temp']) {\n $emailAddress['local_part_parsed'] = $emailAddress['quote_temp'];\n $emailAddress['quote_temp'] = '';\n $emailAddress['local_part_quoted'] = true;\n } elseif ($emailAddress['address_temp']) {\n $emailAddress['local_part_parsed'] = $emailAddress['address_temp'];\n $emailAddress['address_temp'] = '';\n $emailAddress['local_part_quoted'] = $emailAddress['address_temp_quoted'];\n $emailAddress['address_temp_quoted'] = false;\n $emailAddress['address_temp_period'] = 0;\n }\n }\n } elseif ('[' == $curChar) {\n // Setup square bracket special handling if appropriate\n if (self::STATE_DOMAIN != $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Invalid character '[' in email address\";\n }\n $state = self::STATE_SQUARE_BRACKET;\n } elseif ('.' == $curChar) {\n // Handle periods specially\n if ('.' == $prevChar) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Email address should not contain two dots '.' in a row\";\n } elseif (self::STATE_LOCAL_PART == $subState) {\n if (!$emailAddress['local_part_parsed']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Email address can not start with '.'\";\n } else {\n $emailAddress['local_part_parsed'] .= $curChar;\n }\n } elseif (self::STATE_DOMAIN == $subState) {\n $emailAddress['domain'] .= $curChar;\n } elseif (self::STATE_AFTER_DOMAIN == $subState) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Stray period '.' found after domain of email address\";\n } elseif (self::STATE_START == $subState) {\n if ($emailAddress['quote_temp']) {\n $emailAddress['address_temp'] .= $emailAddress['quote_temp'];\n $emailAddress['address_temp_quoted'] = true;\n $emailAddress['quote_temp'] = '';\n }\n $emailAddress['address_temp'] .= $curChar;\n ++$emailAddress['address_temp_period'];\n } else {\n // Strict RFC 2822 - require all periods to be quoted in other parts of the string\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Stray period found in email address. If the period is part of a person\\'s name, it must appear in double quotes - e.g. \"John Q. Public\". Otherwise, an email address shouldn\\'t begin with a period.';\n }\n } elseif (preg_match('/[A-Za-z0-9_\\-!#$%&\\'*+\\/=?^`{|}~]/', $curChar)) {\n // see RFC 2822\n\n if (isset($this->options->getBannedChars()[$curChar])) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"This character is not allowed in email addresses submitted (please put in quotes if needed): '{$curChar}'\";\n } elseif (('/' == $curChar || '|' == $curChar) &&\n !$emailAddress['local_part_parsed'] && !$emailAddress['address_temp'] && !$emailAddress['quote_temp']) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"This character is not allowed in the beginning of an email addresses (please put in quotes if needed): '{$curChar}'\";\n } elseif (self::STATE_LOCAL_PART == $subState) {\n // Legitimate character - Determine where to append based on the current 'substate'\n\n if ($emailAddress['quote_temp']) {\n $emailAddress['local_part_parsed'] .= $emailAddress['quote_temp'];\n $emailAddress['quote_temp'] = '';\n $emailAddress['local_part_quoted'] = true;\n }\n $emailAddress['local_part_parsed'] .= $curChar;\n } elseif (self::STATE_NAME == $subState) {\n if ($emailAddress['quote_temp']) {\n $emailAddress['name_parsed'] .= $emailAddress['quote_temp'];\n $emailAddress['quote_temp'] = '';\n $emailAddress['name_quoted'] = true;\n }\n $emailAddress['name_parsed'] .= $curChar;\n } elseif (self::STATE_DOMAIN == $subState) {\n $emailAddress['domain'] .= $curChar;\n } else {\n if ($emailAddress['quote_temp']) {\n $emailAddress['address_temp'] .= $emailAddress['quote_temp'];\n $emailAddress['address_temp_quoted'] = true;\n $emailAddress['quote_temp'] = '';\n }\n $emailAddress['address_temp'] .= $curChar;\n }\n } else {\n if (self::STATE_DOMAIN == $subState) {\n try {\n // Test by trying to encode the current character into Punycode\n // Punycode should match the traditional domain name subset of characters\n if (preg_match('/[a-z0-9\\-]/', idn_to_ascii($curChar))) {\n $emailAddress['domain'] .= $curChar;\n } else {\n $emailAddress['invalid'] = true;\n }\n } catch (\\Exception $e) {\n $this->log('warning', \"Email\\\\Parse->parse - exception trying to convert character '{$curChar}' to punycode\\n\\$emailAddress['original_address']: {$emailAddress['original_address']}\\n\\$emails: {$emails}\");\n $emailAddress['invalid'] = true;\n }\n if ($emailAddress['invalid']) {\n $emailAddress['invalid_reason'] = \"Invalid character found in domain of email address (please put in quotes if needed): '{$curChar}'\";\n }\n } elseif (self::STATE_START === $subState) {\n if ($emailAddress['quote_temp']) {\n $emailAddress['address_temp'] .= $emailAddress['quote_temp'];\n $emailAddress['address_temp_quoted'] = true;\n $emailAddress['quote_temp'] = '';\n }\n $emailAddress['special_char_in_substate'] = $curChar;\n $emailAddress['address_temp'] .= $curChar;\n } elseif (self::STATE_NAME === $subState) {\n if ($emailAddress['quote_temp']) {\n $emailAddress['name_parsed'] .= $emailAddress['quote_temp'];\n $emailAddress['quote_temp'] = '';\n $emailAddress['name_quoted'] = true;\n }\n $emailAddress['special_char_in_substate'] = $curChar;\n $emailAddress['name_parsed'] .= $curChar;\n } else {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Invalid character found in email address (please put in quotes if needed): '{$curChar}'\";\n }\n }\n break;\n case self::STATE_SQUARE_BRACKET:\n // Handle square bracketed IP addresses such as [10.0.10.2]\n $emailAddress['original_address'] .= $curChar;\n if (']' == $curChar) {\n $subState = self::STATE_AFTER_DOMAIN;\n $state = self::STATE_ADDRESS;\n } elseif (preg_match('/[0-9\\.]/', $curChar)) {\n $emailAddress['ip'] .= $curChar;\n } else {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = \"Invalid Character '{$curChar}' in what seemed to be an IP Address\";\n }\n break;\n case self::STATE_QUOTE:\n // Handle quoted strings\n $emailAddress['original_address'] .= $curChar;\n if ('\"' == $curChar) {\n $backslashCount = 0;\n for ($j = $i; $j >= 0; --$j) {\n if ('\\\\' == mb_substr($emails, $j, 1, $encoding)) {\n ++$backslashCount;\n } else {\n break;\n }\n }\n if ($backslashCount && 1 == $backslashCount % 2) {\n // This is a quoted quote\n $emailAddress['quote_temp'] .= $curChar;\n } else {\n $state = self::STATE_ADDRESS;\n }\n } else {\n $emailAddress['quote_temp'] .= $curChar;\n }\n break;\n case self::STATE_COMMENT:\n // Handle comments and nesting thereof\n $emailAddress['original_address'] .= $curChar;\n if (')' == $curChar) {\n --$commentNestLevel;\n if ($commentNestLevel <= 0) {\n $state = self::STATE_ADDRESS;\n }\n } elseif ('(' == $curChar) {\n ++$commentNestLevel;\n }\n break;\n default:\n // Shouldn't ever get here - what is $state?\n $emailAddress['original_address'] .= $curChar;\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Error during parsing';\n $this->log('error', \"Email\\\\Parse->parse - error during parsing - \\$state: {$state}\\n\\$subState: {$subState}\\$i: {$i}\\n\\$curChar: {$curChar}\");\n break;\n }\n\n // if there's a $emailAddress['original_address'] and the state is set to STATE_END_ADDRESS\n if (self::STATE_END_ADDRESS == $state && strlen($emailAddress['original_address']) > 0) {\n $invalid = $this->addAddress(\n $emailAddresses,\n $emailAddress,\n $encoding,\n $i\n );\n\n if ($invalid) {\n if (!$success) {\n $reason = 'Invalid email addresses';\n } else {\n $reason = 'Invalid email address';\n $success = false;\n }\n }\n\n // Reset all local variables used during parsing\n $emailAddress = $this->buildEmailAddressArray();\n $subState = self::STATE_START;\n $state = self::STATE_TRIM;\n }\n\n if ($emailAddress['invalid']) {\n $this->log('debug', \"Email\\\\Parse->parse - invalid - {$emailAddress['invalid_reason']}\\n\\$emailAddress['original_address'] {$emailAddress['original_address']}\\n\\$emails: {$emails}\");\n $state = self::STATE_SKIP_AHEAD;\n }\n }\n\n // Catch all the various fall-though places\n if (!$emailAddress['invalid'] && $emailAddress['quote_temp'] && self::STATE_QUOTE == $state) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'No ending quote: \\'\"\\'';\n }\n if (!$emailAddress['invalid'] && $emailAddress['quote_temp'] && self::STATE_COMMENT == $state) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'No closing parenthesis: \\')\\'';\n }\n if (!$emailAddress['invalid'] && $emailAddress['quote_temp'] && self::STATE_SQUARE_BRACKET == $state) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'No closing square bracket: \\']\\'';\n }\n if (!$emailAddress['invalid'] && $emailAddress['address_temp'] || $emailAddress['quote_temp']) {\n $this->log('error', \"Email\\\\Parse->parse - corruption during parsing - leftovers:\\n\\$i: {$i}\\n\\$emailAddress['address_temp']: {$emailAddress['address_temp']}\\n\\$emailAddress['quote_temp']: {$emailAddress['quote_temp']}\\nEmails: {$emails}\");\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'Incomplete address';\n if (!$success) {\n $reason = 'Invalid email addresses';\n } else {\n $reason = 'Invalid email address';\n $success = false;\n }\n }\n\n // Did we find no email addresses at all?\n if (!$emailAddress['invalid'] && !count($emailAddresses) && (!$emailAddress['original_address'] || !$emailAddress['local_part_parsed'])) {\n $success = false;\n $reason = 'No email addresses found';\n if (!$multiple) {\n $emailAddress['invalid'] = true;\n $emailAddress['invalid_reason'] = 'No email address found';\n $this->addAddress(\n $emailAddresses,\n $emailAddress,\n $encoding,\n $i\n );\n }\n } elseif ($emailAddress['original_address']) {\n $invalid = $this->addAddress(\n $emailAddresses,\n $emailAddress,\n $encoding,\n $i\n );\n if ($invalid) {\n if (!$success) {\n $reason = 'Invalid email addresses';\n } else {\n $reason = 'Invalid email address';\n $success = false;\n }\n }\n }\n if ($multiple) {\n return ['success' => $success, 'reason' => $reason, 'email_addresses' => $emailAddresses];\n } else {\n return $emailAddresses[0];\n }\n }", "private function parseEmail($email)\n {\n $addressList = imap_rfc822_parse_adrlist($email, '');\n\n if ($addressList) {\n $address = $addressList[0];\n $name = isset($address->personal) ? $address->personal : '';\n $email = $address->mailbox . '@' . $address->host;\n\n return array(\n 'name' => $name,\n 'email' => $email\n );\n } else {\n return false;\n }\n }", "public function testGetEmail()\n {\n $user = new User(\"[email protected]\");\n $this->assertEquals(\"[email protected]\", $user->getEmail());\n }", "function isEmail($verify_email) {\n\t\n\t\treturn(preg_match(\"/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i\",$verify_email));\n\t\n\t}", "function check_email_address($email) {\n # Check @ symbol and lengths\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n return false;\n }\n\n # Split Email Address into Sections\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n\n # Validate Local Section of the Email Address\n for ($i = 0; $i < sizeof($local_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) {\n return false;\n }\n }\n\n # Validate Domain Section of the Email Address\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n $domain_array = explode(\".\", $email_array[1]);\n\n # Check the number of domain elements\n if (sizeof($domain_array) < 2) {\n return false;\n }\n\n # Sanity Check All Email Components\n for ($i = 0; $i < sizeof($domain_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) {\n return false;\n }\n }\n }\n\n # If All Validation Checks have Passed then Return True\n return true;\n }", "public function testComposeEmailAddresses()\n {\n $addresses = array( new ezcMailAddress( '[email protected]', 'John Doe' ),\n new ezcMailAddress( '[email protected]' ) );\n\n $this->assertEquals( 'John Doe <[email protected]>, [email protected]',\n ezcMailTools::composeEmailAddresses( $addresses ) );\n }", "function testEmailExpectsSanitizeMethodCalled() {\n\t\t// arrange\n\t\tglobal $post;\n\t\t\\WP_Mock::wpPassthruFunction('sanitize_email', array('times' => 1));\n\t\t$TestValidEmailField = new TestValidEmailField();\n\t\t$_POST = array(\n\t\t\t'field' => '[email protected]',\n\t\t);\n\t\t$actual = array();\n\t\t// act\n\t\t$TestValidEmailField->validate($post->ID, $TestValidEmailField->fields['field'], $actual);\n\t}", "public function isEmail();", "function validateEmail($TO,$SUBJECT,$BODY,$headers){\r\n\r\n if(!$this->getAccessLevel() > 0) {echo 'false'; return false;}\r\n\r\n //$server = \"http://localhost/dev/pansophy\"; // dev server\r\n $server = \"http://pansophy.wooster.edu\";\r\n $referer = $_SERVER['HTTP_REFERER'];\r\n\t\t\r\n // check if server string is a substring of the referer string\r\n $pos = strpos($referer,$server);\r\n\r\n if($pos === false)\r\n return false;\r\n else if($pos == 0)\r\n return true;\r\n else \r\n return false;\r\n\t}", "function mme_checkemail( $email ) {\n\t$match = preg_match( '/^[A-z0-9_\\-.]+[@][A-z0-9_\\-]+([.][A-z0-9_\\-]+)+[A-z.]{2,4}$/', $email );\n\tif(!$match){\n\t\t$error_msg = 'Invalid E-mail address';\n\t\tmme_error_notice( $error_msg );\n\t\treturn false;\n\t\t}\n\treturn true;\n}", "public function testComposeEmailAddress()\n {\n $address = new ezcMailAddress( '[email protected]', 'John Doe' );\n $this->assertEquals( 'John Doe <[email protected]>', ezcMailTools::composeEmailAddress( $address ) );\n\n $address = new ezcMailAddress( '[email protected]' );\n $this->assertEquals( '[email protected]', ezcMailTools::composeEmailAddress( $address ) );\n }", "public function testEmailAvailable()\n {\n $user = factory(User::class)->make();\n $this->assertTrue(User::isEmailAvailable($user->email));\n }", "function verifyEmail ($testString)\n\t{\n return (preg_match(\"/^([[:alnum:]]|_|\\.|-)+@([[:alnum:]]|\\.|-)+(\\.)([a-z]{2,4})$/\", $testString));\n }", "function isEmail($email) {\r\n\r\n\treturn preg_match(\"/^(((([^]<>()[\\.,;:@\\\" ]|(\\\\\\[\\\\x00-\\\\x7F]))\\\\.?)+)|(\\\"((\\\\\\[\\\\x00-\\\\x7F])|[^\\\\x0D\\\\x0A\\\"\\\\\\])+\\\"))@((([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))(\\\\.([[:alnum:]]([[:alnum:]]|-)*[[:alnum:]]))*|(#[[:digit:]]+)|(\\\\[([[:digit:]]{1,3}(\\\\.[[:digit:]]{1,3}){3})]))$/\", $email);\r\n\r\n}", "private function parse()\r\n\t{\r\n\t\t// Suppress annoying notices/warnings\r\n\t\tset_error_handler(function() { /* Nothing */ }, E_NOTICE|E_WARNING);\r\n\r\n\t\t$structure = mailparse_msg_get_structure($this->resource);\r\n\t\t$this->parts = array();\r\n\t\tforeach ($structure as $part_id) {\r\n\t\t\t$part = mailparse_msg_get_part($this->resource, $part_id);\r\n\t\t\t$this->parts[$part_id] = mailparse_msg_get_part_data($part);\r\n\t\t}\r\n\r\n\t\trestore_error_handler();\r\n\t}", "public function testPostUpdate()\n {\n $this->getEmailWithLocal('uk');\n /** check email with ticket pdf file */\n $this->findEmailWithText('ticket-php-day-2017.pdf');\n /** check email with string */\n $this->findEmailWithText('Шановний учасник, в вкладенні Ваш вхідний квиток. Покажіть його з екрану телефону або роздрукуйте на папері.');\n }", "function isEmail($field_data) \n{ \n\t$fields_ok=preg_match(\"/^([a-zA-Z0-9])+([a-zA-Z0-9\\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\\._-]+)+$/\" , $field_data); \n\treturn $fields_ok; \n}", "public function testInboundDocumentAttachmentContent()\n {\n }", "function is_email($addr)\n{\n $addr = strtolower(trim($addr));\n $addr = str_replace(\"&#064;\",\"@\",$addr);\n if ( (strstr($addr, \"..\")) || (strstr($addr, \".@\")) || (strstr($addr, \"@.\")) || (!preg_match(\"/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9][a-z0-9.-]{0,61}[a-z0-9]\\.[a-z]{2,6}\\$/\", stripslashes(trim($addr)))) ) {\n $emailvalidity = 0;\n } else {\n $emailvalidity = 1;\n }\n return $emailvalidity;\n}", "function checkEmail($data) {\n $data = trim($data);\n $data = stripslashes($data);\n $data = htmlspecialchars($data);\n return $data;\n}", "function s2_is_valid_email($email)\n{\n $return = ($hook = s2_hook('fn_is_valid_email_start')) ? eval($hook) : null;\n if ($return != null)\n return $return;\n\n if (strlen($email) > 80)\n return false;\n\n return preg_match('/^(([^<>()[\\]\\\\.,;:\\s@\"\\']+(\\.[^<>()[\\]\\\\.,;:\\s@\"\\']+)*)|(\"[^\"\\']+\"))@((\\[\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\])|(([a-zA-Z\\d\\-]+\\.)+[a-zA-Z]{2,}))$/', $email);\n}", "function parseEmailAction() {\n $request = $this->getRequest()->request;\n $respondToFeedbackService = $this->get('e2w_respond_to_feedback_service');\n $to = $request->get('to') . '';\n $respondToFeedbackService->createFeedbackResponseFromEmail($to, $request->get('html'), $request->get('text'));\n return new Response();\n }", "public function detect_emails()\r\n\t{\r\n\t\t$this->loop_text_nodes(function($child) {\r\n\t\t\tpreg_match_all(\"/(?:[a-zA-Z0-9\\-\\._]){1,}@(?:[a-zA-Z0-9\\-\\.]{1,255}\\.[a-zA-Z]{1,20})/\",\r\n\t\t\t\t$child->get_text(),\r\n\t\t\t\t$matches,\r\n\t\t\t\tPREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);\r\n\r\n\t\t\tif(count($matches[0]) == 0)\r\n\t\t\t\treturn;\r\n\r\n\t\t\t$replacment = array();\r\n\t\t\t$last_pos = 0;\r\n\r\n\t\t\tforeach($matches[0] as $match)\r\n\t\t\t{\r\n\t\t\t\t$url = new SBBCodeParser_TagNode('email', array());\r\n\t\t\t\t$url_text = new SBBCodeParser_TextNode($match[0]);\r\n\t\t\t\t$url->add_child($url_text);\r\n\r\n\t\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos, $match[1] - $last_pos));\r\n\t\t\t\t$replacment[] = $url;\r\n\t\t\t\t$last_pos = $match[1] + strlen($match[0]);\r\n\t\t\t}\r\n\r\n\t\t\t$replacment[] = new SBBCodeParser_TextNode(substr($child->get_text(), $last_pos));\r\n\t\t\t$child->parent()->replace_child($child, $replacment);\r\n\t\t}, $this->get_excluded_tags(SBBCodeParser_BBCode::AUTO_DETECT_EXCLUDE_EMAIL));\r\n\t\t\r\n\t\treturn $this;\r\n\t}", "function getEmailsFromUrl($url) \n{\n $text = file_get_contents($url);\n \n $hash = md5($text);\n \n echo \"<tr><td>Source URL</td><td>\".$url.\"</td></tr>\";\n echo \"<tr><td>MD5</td><td>\".$hash.\"</td></tr>\";\n\n // parse emails\n if (!empty($text)) {\n $res = preg_match_all(\"/[a-z0-9]+([_\\\\.-][a-z0-9]+)*@([a-z0-9]+([\\.-][a-z0-9]+)*)+\\\\.[a-z]{2,}/i\",$text,$matches);\n if ($res) {\n foreach(array_unique($matches[0]) as $email) {\n echo \"<tr><td>\".$email.\"</td>\";\n \n $email_arr[] = $email;\n \n // take a given email address and split it into the username and domain.\n //Will move to separate process... eventually\n list($userName, $mailDomain) = split(\"@\", $email);\n if (checkdnsrr($mailDomain, \"MX\")) {\n\t echo \"<td>Valid</td>\";\n } else {\n \t echo \"<td>Invalid</td>\";\n\t\t\t\t}\n }\n } else {\n\t\t echo \"<tr><td colspan=2>No emails found.</td></tr>\";\n }\n }\n else\n {\n\t echo \"<tr><td colspan=2>No text?</td></tr>\";\n }\n echo \"<tr><td colspan=2><hr></td></tr>\";\n\treturn ($email_arr);\n}", "public function testRead()\n {\n }", "public function testEmailItem() {\n // Verify entity creation.\n $entity = EntityTest::create();\n $value = '[email protected]';\n $entity->field_email = $value;\n $entity->name->value = $this->randomMachineName();\n $entity->save();\n\n // Verify entity has been created properly.\n $id = $entity->id();\n $entity = EntityTest::load($id);\n $this->assertInstanceOf(FieldItemListInterface::class, $entity->field_email);\n $this->assertInstanceOf(FieldItemInterface::class, $entity->field_email[0]);\n $this->assertEquals($value, $entity->field_email->value);\n $this->assertEquals($value, $entity->field_email[0]->value);\n\n // Verify changing the email value.\n $new_value = $this->randomMachineName();\n $entity->field_email->value = $new_value;\n $this->assertEquals($new_value, $entity->field_email->value);\n\n // Read changed entity and assert changed values.\n $entity->save();\n $entity = EntityTest::load($id);\n $this->assertEquals($new_value, $entity->field_email->value);\n\n // Test sample item generation.\n $entity = EntityTest::create();\n $entity->field_email->generateSampleItems();\n $this->entityValidateAndSave($entity);\n }", "public function getEmail_always_returnCorrectly()\n {\n $this->assertEquals($this->user['email'], $this->entity->getEmail());\n }", "abstract public function get_mailto();", "private function validateEmail($addr) {\n // Set result to false (guilty until proven innocent)\n $this->log->write('[Form] Email - validation begun');\n $result = FALSE;\n\n $boolDebug = FALSE;\n\n // Part 1: Consult isemail.info via curl\n // 0 = invalid format\n // 1 = valid format\n\n /*\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://isemail.info/valid/\".$addr);\n // curl_setopt($ch, CURLOPT_URL, \"http://www.asdasdljaskdhf.org/\".$addr);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $out = curl_exec($ch);\n $log->write(\"FORM: Email - check result: \".$out);\n curl_close($ch);\n */\n\n // This uses a local copy of is_email() to verify emails, rather than the remote service\n $out = is_email($addr);\n\n // Part 2: DNS lookup (provided first part passed)\n if($out==1) {\n $this->log->write('[Form] Email validation 1 of 2');\n // isolate the domain (\"remote part\")\n // adapted from http://www.linuxjournal.com/article/9585?page=0,3\n $domain = substr($addr,strrpos($addr, \"@\")+1);\n\n // If domain checks out, set result to true\n if (checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\")) {\n\n $this->log->write('[Form] Email validation 2 of 2');\n\n $result = TRUE;\n\n // A planned third component is to contact the MX server in the email address and \n // confirm that the address is valid. Not all servers will respond, but some will\n\n } else {\n\n $this->log->write('[FORM] Email validation failed step 2');\n\n }\n\n } else {\n $this->log->write('[FORM] Email validation failed step 1');\n }\n\n // Part 3: coming (either here or inside previous block)\n\n return $result;\n}", "public function testUsersEmailAuth()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function clean_poea_email($email) {\n\n \t$emails = array();\n\n \t$email = str_replace('@y.c', \"@yahoo.com\", $email);\n\n\t\t$slash_email = explode(\"/\", $email);\n\t\t$or_email = explode(\" or \", $email);\n\t\t$and_email = explode(\"&\", $email);\n\n\t\tif(count($slash_email) > 1) {\n\t\t\t\n\t\t\tforeach ($slash_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($and_email) > 1) {\n\n\t\t\tforeach ($and_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t\t\t$emails[] = $v;\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(count($or_email) > 1) {\n\n\t\t\tforeach ($or_email as $v) {\n\n\t\t\t\t$v = trim($v);\n\n\t\t\t\tif(filter_var($v, FILTER_VALIDATE_EMAIL)) {\n\t\n\t\t\t\t\t$emails[] = $v;\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t} elseif(filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\n\t\t\t$emails[] = $email;\t\n\n\t\t}\n\n\t\tif(empty($emails)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn json_encode($emails);\n }", "public function testZendEmailValidator()\n{\n $validator = new Zend_Validate_EmailAddress();\n \n\n \n // test some possible addresses\n $this->assertEquals(true,$validator->isValid(\"[email protected]\"));\n $this->assertEquals(true,$validator->isValid(\"[email protected]\"));\n $this->assertEquals(true,$validator->isValid(\"[email protected]\"));\n $this->assertEquals(true,$validator->isValid(\"[email protected]\"));\n \n // test some incorrect addresses\n $this->assertEquals(false,$validator->isValid(\"testgmx.de\"));\n $this->assertEquals(false,$validator->isValid(\"[email protected]\"));\n $this->assertEquals(false,$validator->isValid(\"[email protected]\"));\n $this->assertEquals(false,$validator->isValid(\"te [email protected]\"));\n \n \n \n \n \n}", "public function testEmail($key)\n {\n if (!$this->keyExists($key)) {\n return false;\n }\n return eregi(\"^[a-z0-9\\._-]+@+[a-z0-9\\._-]+\\.+[a-z]{2,4}$\", $this->_source[$key]);\n }", "function verifica_email ($email)\r\n{\r\n\t$retorno = true;\r\n\r\n\t/* Aqui estaria el codigo para verificar \r\n\tla direccion de correo */\r\n\r\n\treturn $retorno;\r\n}", "protected function validateEmail($args) {\n\n if ($args['ent_email'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $vmail = new verifyEmail();\n\n if ($vmail->check($args['ent_email'])) {\n return $this->_getStatusMessage(34, $args['ent_email']);\n } else if ($vmail->isValid($args['ent_email'])) {\n return $this->_getStatusMessage(24, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email valid, but not exist!';\n } else {\n return $this->_getStatusMessage(25, $args['ent_email']); //_getStatusMessage($errNo, $test_num);\n//echo 'email not valid and not exist!';\n }\n }", "public function testAuthenticateUserEmailFalse ()\n {\n try {\n $this->storage->authenticateUser('milan@magudia', $this->signature1, $this->stringToSign1);\n } catch (InvalidArgumentException $e) {\n $this->assertEquals('$email address is not valid', $e->getMessage());\n return;\n }\n $this->fail('An expected exception has not been raised.');\n }", "public function test_search_emails_endpoint()\n {\n $response = $this->json('GET',\n route('emails.search', '[email protected]')\n );\n $response->assertStatus(200);\n }", "public function testEmailSharedLink()\n {\n }", "function check_email_address($email) \n{\n // First, we check that there's one @ symbol, and that the lengths are right\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) \n {\n // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n return false;\n }\n // Split it into sections to make life easier\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n for ($i = 0; $i < sizeof($local_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) \n {\n return false;\n }\n }\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) \n { // Check if domain is IP. If not, it should be valid domain name\n $domain_array = explode(\".\", $email_array[1]);\n if (sizeof($domain_array) < 2) \n {\n return false; // Not enough parts to domain\n }\n for ($i = 0; $i < sizeof($domain_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) \n {\n return false;\n }\n }\n }\n return true;\n}", "public function testReturnsTrueWhenEmailIsValid()\n {\n $validator = new ContactValidator();\n $this->assertTrue($validator->validateEmail('[email protected]'));\n }", "function is_email($emailadres)\r\n{\r\n // Eerst een snelle controle uitvoeren: \r\n // een e-mailadres moet uit minimaal 7 tekens bestaan:\r\n if (strlen($emailadres) < 7) \r\n {\r\n return false;\r\n }\r\n // Daarna een controle met een reguliere expressie uitvoeren:\r\n if( ! ereg(\"^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\\.)+([a-zA-Z]{2,4})$\", $emailadres) ) \r\n {\r\n return false;\r\n } \r\n\r\n return true; \r\n}", "public function testFixture(): void {\n $message = $this->getFixture(\"example_bounce.eml\");\n\n self::assertEquals(\"<>\", $message->return_path);\n self::assertEquals([\n 0 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>); Thu, 02 Mar 2023 05:27:29 +0100',\n 1 => 'from somewhere06.your-server.de ([1b21:2f8:e0a:50e4::2]) by somewhere.your-server.de with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) id 1pXaXR-0006xQ-BN for [email protected]; Thu, 02 Mar 2023 05:27:29 +0100',\n 2 => 'from [192.168.0.10] (helo=sslproxy01.your-server.de) by somewhere06.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-000LYP-9R for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 3 => 'from localhost ([127.0.0.1] helo=sslproxy01.your-server.de) by sslproxy01.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-0008gy-7x for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 4 => 'from Debian-exim by sslproxy01.your-server.de with local (Exim 4.92) id 1pXaXO-0008gb-6g for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 5 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>)',\n ], $message->received->all());\n self::assertEquals(\"[email protected]\", $message->envelope_to);\n self::assertEquals(\"Thu, 02 Mar 2023 05:27:29 +0100\", $message->delivery_date);\n self::assertEquals([\n 0 => 'somewhere.your-server.de; iprev=pass (somewhere06.your-server.de) smtp.remote-ip=1b21:2f8:e0a:50e4::2; spf=none smtp.mailfrom=<>; dmarc=skipped',\n 1 => 'somewhere.your-server.de'\n ], $message->authentication_results->all());\n self::assertEquals([\n 0 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>); Thu, 02 Mar 2023 05:27:29 +0100',\n 1 => 'from somewhere06.your-server.de ([1b21:2f8:e0a:50e4::2]) by somewhere.your-server.de with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) id 1pXaXR-0006xQ-BN for [email protected]; Thu, 02 Mar 2023 05:27:29 +0100',\n 2 => 'from [192.168.0.10] (helo=sslproxy01.your-server.de) by somewhere06.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-000LYP-9R for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 3 => 'from localhost ([127.0.0.1] helo=sslproxy01.your-server.de) by sslproxy01.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-0008gy-7x for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 4 => 'from Debian-exim by sslproxy01.your-server.de with local (Exim 4.92) id 1pXaXO-0008gb-6g for [email protected]; Thu, 02 Mar 2023 05:27:26 +0100',\n 5 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>)',\n ], $message->received->all());\n self::assertEquals(\"[email protected]\", $message->x_failed_recipients);\n self::assertEquals(\"auto-replied\", $message->auto_submitted);\n self::assertEquals(\"Mail Delivery System <[email protected]>\", $message->from);\n self::assertEquals(\"[email protected]\", $message->to);\n self::assertEquals(\"1.0\", $message->mime_version);\n self::assertEquals(\"Mail delivery failed\", $message->subject);\n self::assertEquals(\"[email protected]\", $message->message_id);\n self::assertEquals(\"2023-03-02 04:27:26\", $message->date->first()->setTimezone('UTC')->format(\"Y-m-d H:i:s\"));\n self::assertEquals(\"Clear (ClamAV 0.103.8/26827/Wed Mar 1 09:28:49 2023)\", $message->x_virus_scanned);\n self::assertEquals(\"0.0 (/)\", $message->x_spam_score);\n self::assertEquals(\"[email protected]\", $message->delivered_to);\n self::assertEquals(\"multipart/report\", $message->content_type->last());\n self::assertEquals(\"5d4847c21c8891e73d62c8246f260a46496958041a499f33ecd47444fdaa591b\", hash(\"sha256\", $message->getTextBody()));\n self::assertFalse($message->hasHTMLBody());\n\n $attachments = $message->attachments();\n self::assertCount(2, $attachments);\n\n $attachment = $attachments[0];\n self::assertInstanceOf(Attachment::class, $attachment);\n self::assertEquals('c541a506', $attachment->filename);\n self::assertEquals(\"c541a506\", $attachment->name);\n self::assertEquals('', $attachment->getExtension());\n self::assertEquals('text', $attachment->type);\n self::assertEquals(\"message/delivery-status\", $attachment->content_type);\n self::assertEquals(\"85ac09d1d74b2d85853084dc22abcad205a6bfde62d6056e3a933ffe7e82e45c\", hash(\"sha256\", $attachment->content));\n self::assertEquals(267, $attachment->size);\n self::assertEquals(1, $attachment->part_number);\n self::assertNull($attachment->disposition);\n self::assertNotEmpty($attachment->id);\n\n $attachment = $attachments[1];\n self::assertInstanceOf(Attachment::class, $attachment);\n self::assertEquals('da786518', $attachment->filename);\n self::assertEquals(\"da786518\", $attachment->name);\n self::assertEquals('', $attachment->getExtension());\n self::assertEquals('text', $attachment->type);\n self::assertEquals(\"message/rfc822\", $attachment->content_type);\n self::assertEquals(\"7525331f5fab23ea77f595b995336aca7b8dad12db00ada14abebe7fe5b96e10\", hash(\"sha256\", $attachment->content));\n self::assertEquals(776, $attachment->size);\n self::assertEquals(2, $attachment->part_number);\n self::assertNull($attachment->disposition);\n self::assertNotEmpty($attachment->id);\n }", "public function testValidateEmail()\n\t{\n\t\t$return = $this->auth->register('[email protected]', $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.email_short', [$this->auth->config->verifyEmailMinLength]));\n\n\t\t// maximal email length is 50\n\t\t$return = $this->auth->register('[email protected]', $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.email_long', [$this->auth->config->verifyEmailMaxLength]));\n\n\t\t// register with invalid email\n\t\t$return = $this->auth->register($this->invalidEmail, $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.email_invalid'));\n\t}", "public function getEmail() {}", "public function getEmail() {}", "public function getEmail() {}", "public function testEncryptEmailA() {\n // Encrypted email\n $encrypted_email = security::encrypt_email( '[email protected]', '', false );\n\n // Proper email =\n // Make sure it's 15 characters\n $this->assertEquals( 'john&#64;doe&#46;&#99;&#111;&#109;', $encrypted_email );\n }", "public function getEmail() {}", "public function getEmail() {}", "function isValidEMail ($string)\n{\n return (preg_match ('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', $string) ? 1 : 0);\n}" ]
[ "0.73370063", "0.67949635", "0.66037804", "0.64252317", "0.6395159", "0.6377212", "0.62867296", "0.6222555", "0.6187763", "0.6138994", "0.607519", "0.604774", "0.6037602", "0.6035867", "0.5942482", "0.5934118", "0.59335464", "0.59266746", "0.58585733", "0.58531094", "0.5845122", "0.5793451", "0.5762495", "0.57497466", "0.57299143", "0.5723904", "0.5718279", "0.5714917", "0.5697465", "0.56891507", "0.5687674", "0.5672355", "0.56691724", "0.5668023", "0.56524146", "0.5648812", "0.56201845", "0.5617423", "0.5613067", "0.56123775", "0.5603952", "0.55951136", "0.5581204", "0.55752283", "0.5573027", "0.5568027", "0.55552006", "0.5553942", "0.5539746", "0.5530013", "0.55204993", "0.55117977", "0.55097455", "0.5503113", "0.5502805", "0.5483652", "0.5480783", "0.5479221", "0.54650295", "0.5457725", "0.54493254", "0.5441557", "0.54404455", "0.5434112", "0.54283965", "0.54238343", "0.5418857", "0.54185355", "0.54149604", "0.5408535", "0.5399494", "0.5398131", "0.5395837", "0.53902775", "0.5390015", "0.53874356", "0.5380501", "0.5373417", "0.5372834", "0.5371946", "0.5371917", "0.5358603", "0.5357498", "0.5354531", "0.53540814", "0.5348509", "0.53481406", "0.53437173", "0.53348035", "0.5325993", "0.53225774", "0.5318705", "0.5311144", "0.5297832", "0.5297832", "0.5297832", "0.52975726", "0.52975214", "0.52975214", "0.5297481" ]
0.78743756
0
This is a helpping method to call CURL PUT request with the username and key
private function curl_put($url, $data) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($ch, CURLOPT_POSTFIELDS,$data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put($url, $fields, $headers)\n{\n $ch = curl_init($url); //initialize and set url\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\"); //set as put request\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); //set fields, ensure they are properly encoded\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // set headers pass encoding here and tokens.\n $response = curl_exec($ch); // save the response\n curl_close ($ch);\n return $response;\n}", "public static function urlPUT($url, $data, $headers=null) {\n\n $isJsonForm = false;\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n $arrKeys = array_keys($data);\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n \n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n curl_close($ch);\n\n return utf8_encode($contents);\n }", "function make_put_call($mid_url, $put_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($put_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "public function curlPutCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }", "function rest_put_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "public function _PUT($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'PUT', $params, $username, $password, $contentType);\n\n return $this->parseResponse($this->convertEncoding($response, 'utf-8', $this->_encode));\n }", "public function put($url, $body = array(), $query = array(), $headers = array());", "function put($url, $data = \"\", $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"PUT\";\n $http_options[CURLOPT_POSTFIELDS] = $data;\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "function CallAPI($method, $url, $data = false){\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_PUT, 1);\t\t\n\t\t$update_json = json_encode($data);\t\n\t\tcurl_setopt($curl, CURLOPT_URL, $url . \"?\" . http_build_query($data));\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($curl, CURLOPT_SSLVERSION, 4);\n\t\t$result = curl_exec($curl); \n\t\t$api_response_info = curl_getinfo($curl);\n\t\tcurl_close($curl);\n\t\treturn $result;\n}", "public function put()\n {\n #HTTP method in uppercase (ie: GET, POST, PUT, DELETE)\n $sMethod = 'PUT';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_POSTFIELDS, $this->getData());\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"accept-language: \" . $this->getAcceptLanguage(),\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'PUT::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'PUT::DATA', $this->getData());\n Log::write('WebRequest', 'PUT::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'PUT::RESPONSE', $sOutput);\n\n $this->setData('');\n\n if ($iHTTPCode !== 204) {\n print_r($sOutput);\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }", "public function sendPutRequestToUrl(\n\t\tstring $fullUrl,\n\t\tstring $user,\n\t\tstring $password,\n\t\tstring $xRequestId = '',\n\t\tarray $headers = [],\n\t\tstring $content = \"\"\n\t): ResponseInterface {\n\t\treturn HttpRequestHelper::sendRequest($fullUrl, $xRequestId, 'PUT', $user, $password, $headers, $content);\n\t}", "public function Put( $sUrl, $vRequestBody, $bJsonEncode = false );", "public function _put($url = null, array $parameters = []);", "function restPut($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t//Need to set the request to be a PATCH\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}", "function put($url, $data = null, $options = array()) {\n\t\treturn $this->request($url, array_merge(array('method' => 'PUT', 'body' => $data), $options));\n\t}", "public function testUpdateMetadata1UsingPUT()\n {\n }", "function sendPutCmd($resource, $data) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($request, CURLOPT_FAILONERROR, true);\n curl_setopt($request, CURLOPT_POSTFIELDS, $data);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($request, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data))\n );\n\n $result = curl_exec($request);\n return json_decode($result, true);\n }", "public static function put($url, array $options = []) {\n $ch = curl_init();\n static::parse_query_params($url, $options);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n static::set_body($ch, $options);\n static::parse_options($ch, $options);\n return static::parse_response(curl_exec($ch), $options);\n }", "public function put(...$args)\n {\n return $this->curl('put', ...$args);\n }", "private function executePut(Visio\\Http\\CurlRequest $curl) {\n if (!is_string($this->requestBody)) {\n $this->buildPostBody();\n }\n\n $this->requestLength = strlen($this->requestBody);\n\n $phpMemory = fopen('php://memory', 'rw');\n fwrite($phpMemory, $this->requestBody);\n rewind($phpMemory);\n\n $curl->setOption(CURLOPT_INFILE, $phpMemory);\n $curl->setOption(CURLOPT_INFILESIZE, $this->requestLength);\n $curl->setOption(CURLOPT_PUT, true);\n\n $this->doExecute($curl);\n\n fclose($phpMemory);\n }", "public function put(string $url, array $input = [], $headers = null);", "public function testMakePutRequest()\n {\n $body = ['teacher' => 'Charles Xavier', 'job' => 'Professor'];\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse($body),\n ]);\n\n $this->assertEquals($client->put('teachers/1', ['job' => 'Professor']), $body);\n }", "public function testUpdateMetadata2UsingPUT()\n {\n }", "public function testUpdateMetadata3UsingPUT()\n {\n }", "public function put($url, $endpoint = \"\", $header = array(), $query = array(), $sendJSON = false)\n {\n if ($sendJSON == true) {\n $payload = json_encode($query);\n } else {\n $payload = $query;\n }\n\n // Prepare new cURL resource\n $ch = curl_init($url . $endpoint);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n //curl_setopt($ch, CURLOPT_PUT, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n // Submit the POST request\n $result = curl_exec($ch);\n\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n\n // Close cURL session handle\n curl_close($ch);\n }", "public function put($key=null,$value=null){\n return $this->methodsData(\"put\",$key,$value);\n }", "public function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public static function put($url, $data, $httpHeaders = array())\n {\n $ch = self::init($url, $httpHeaders);\n //set the request type\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n return self::processRequest($ch);\n }", "public static function put($url, $headers = [], $data = [], $options = [])\n {\n }", "public function put( $url, array $headers=array(), $data=null ) {\n return $this->httpRequest( $url, 'PUT', $headers, $data );\n }", "public function api_put($path, $data = array()) {\n\n $path = GoCardless_Client::$api_path . $path;\n\n return $this->request('put', $path, $data);\n\n }", "function put(Request &$request, Response &$response);", "function callAPI($method, $url, $data){\n $curl = curl_init();\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\t\t\t \t\t\t\t\t\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n // EXECUTE:\n $result = curl_exec($curl);\n curl_close($curl);\n return $result;\n}", "protected function makePutRequest($uri, $params) {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL,$this->server_url . $uri);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS,\n http_build_query($params));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $output = curl_exec($curl);\n $this->response = $output;\n $this->response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n curl_close ($curl);\n }", "function handlePut($isValid, $update)\n{\n $isSuccess = false;\n\n try {\n # extract the id portion of the URL\n $id = substr($_SERVER['PATH_INFO'], 1);\n # get the JSON format body and decode it\n $put = trim(file_get_contents(\"php://input\"));\n $data = json_decode($put, true);\n // var_dump($data);\n $isSuccess = $update($data, $id);\n } catch (Exception $e) {\n}\n\n $resp = new stdClass();\n $resp->success = $isSuccess;\n\n echo json_encode($resp);\n}", "public function testUpdateCategoryUsingPUT()\n {\n }", "public function put($path, $json_filter) {\r\n $handle = $this->create_curl_handle($path, array());\r\n // Build up the headers we'll need to pass\r\n $headers = array(\r\n 'Accept: application/json',\r\n 'Content-type: application/json',\r\n \"X-App-Token: \" . $this->app_token\r\n );\r\n // Time for some cURL magic...\r\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($handle, CURLOPT_POSTFIELDS, $json_filter);\r\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\r\n // Set up request, and auth, if configured\r\n if($this->user_name != \"\" && $this->password != \"\") {\r\n curl_setopt($handle, CURLOPT_USERPWD, $this->user_name . \":\" . $this->password);\r\n }\r\n $response = curl_exec($handle);\r\n $code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\r\n if($code != \"200\") {\r\n throw new Exception(\"Error \\\"$code\\\" from server: $response\");\r\n }\r\n return json_decode($response, true);\r\n }", "public function testPutWithExistingKey(): void\n {\n $this->client->jsonRequest(\n 'PUT',\n '/api/roles/' . $this->role2->getId(),\n [\n 'name' => 'Sulu Administrator 2',\n 'key' => 'sulu_administrator',\n 'system' => 'Sulu',\n ]\n );\n\n $response = \\json_decode($this->client->getResponse()->getContent());\n\n $this->assertHttpStatusCode(409, $this->client->getResponse());\n $this->assertEquals(1101, $response->code);\n\n // setting key to 'null' should work although there is another role with the key 'null'\n $this->client->jsonRequest(\n 'PUT',\n '/api/roles/' . $this->role1->getId(),\n [\n 'name' => 'Sulu Editor 2',\n 'key' => null,\n 'system' => 'Sulu',\n ]\n );\n\n $response = \\json_decode($this->client->getResponse()->getContent());\n\n $this->assertHttpStatusCode(200, $this->client->getResponse());\n $this->assertEquals(null, $response->key);\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "abstract public function put($data);", "static function put($url, $body = null, $headers = array()) {\n $request = new NiceHTTP\\PutRequest($url, $body, $headers);\n return $request->send();\n }", "public function request($path, $method = \"GET\", $vars = array(), $headers = array( 'Accept' => 'application/json', 'Content-Type' => 'application/json' ) ) {\n\n $encoded = \"\";\n /*foreach($vars AS $key=>$value)\n $encoded .= \"$key=\".urlencode($value).\"&\";*/\n //$encoded = substr($encoded, 0, -1);\n $encoded = json_encode($vars);\n $tmpfile = \"\";\n $fp = null;\n \n // construct full url\n $url = \"{$this->Endpoint}/$path\";\n \n // if GET and vars, append them\n if($method == \"GET\") \n $url .= (FALSE === strpos($path, '?')?\"?\":\"&\").$encoded;\n\n // initialize a new curl object \n $curl = curl_init($url);\n \n $opts = array();\n foreach ($headers as $k => $v) $opts[CURLOPT_HTTPHEADER][] = \"$k: $v\";\n curl_setopt_array($curl, $opts);\n \n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n \n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n switch(strtoupper($method)) {\n case \"GET\":\n curl_setopt($curl, CURLOPT_HTTPGET, TRUE);\n break;\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n break;\n case \"PUT\":\n // curl_setopt($curl, CURLOPT_PUT, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $encoded);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n file_put_contents($tmpfile = tempnam(\"/tmp\", \"put_\"),\n $encoded);\n curl_setopt($curl, CURLOPT_INFILE, $fp = fopen($tmpfile,\n 'r'));\n curl_setopt($curl, CURLOPT_INFILESIZE, \n filesize($tmpfile));\n break;\n case \"DELETE\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n break;\n default:\n throw(new PocketstopException(\"Unknown method $method\"));\n break;\n }\n \n // send credentials\n curl_setopt($curl, CURLOPT_USERPWD,\n $pwd = \"{$this->AccountId}:{$this->ApiKey}\");\n \n // do the request. If FALSE, then an exception occurred \n if(FALSE === ($result = curl_exec($curl)))\n throw(new PocketstopException(\n \"Curl failed with error \" . curl_error($curl)));\n \n // get result code\n $responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n \n // unlink tmpfiles\n if($fp)\n fclose($fp);\n if(strlen($tmpfile))\n unlink($tmpfile);\n \n return new PocketstopRestResponse($url, $result, $responseCode);\n }", "function http_put_data($url, $data = null, ?array $options = null, ?array &$info = null) {}", "function callAPI($method, $url, $data){\n $curl = curl_init();\n\n switch ($method){\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // OPTIONS:\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n ));\n\n // EXECUTE:\n $result = curl_exec($curl);\n if(!$result){die(\"Connection Failure\");}\n curl_close($curl);\n return $result;\n}", "private function put($url, $content = '', $type = 'application/xml', $header = '') {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Set headers.\n\t\t$headers = array();\n\t\tif (!empty($type)) {\n\t\t\t$headers[] = 'Content-Type: ' . $type . '; charset=UTF-8';\n\t\t}\n\t\t$headers[] = 'Content-Length: ' . strlen($content);\n\t\tif (!empty($header)) {\n\t\t\t$headers[] = $header;\n\t\t}\n\n\t\t// PUT in PHP requires content to be in a file. Store in temp.\n\t\t$fp = fopen(\"php://temp\", \"r+\");\n\t\tfputs($fp, $content);\n\t\trewind($fp);\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tif (count($headers) > 0) {\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t\t}\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\tfclose($fp);\n\t\treturn $output;\n\t}", "public function DataPut_put($id)\n {\n $value = $this->input->get('value'); \n if(empty($value) || empty($id))\n\t\t{\t\t\t\n\t\t\t$this->response( [\n 'status' => RestController::HTTP_NOT_FOUND,\n 'message' => 'Please Enter All Fields.'\n ], RestController::HTTP_NOT_FOUND );\n }\n else\n {\n $username = $this->input->get('value');\n //$id\n //call Model Function .... \n $this->response( [\n 'status' => RestController::HTTP_OK,\n 'message' => 'Data Put Successfully.'\n ], RestController::HTTP_OK ); \n }\n }", "public function PUT()\n {\n $obj = $this->puttedObject();\n if( ! isset($obj->email))\n {\n throw new BadRequest();\n }\n if( ! isset($obj->name))\n {\n throw new BadRequest();\n }\n \n $u = new User(); \n $u->setEmail($obj->email);\n $u->setName($obj->name);\n $password = $this->pseudoRandomPassword();\n $u->setPassword($password);\n if( ! $u->save() )\n {\n throw new Conflict;\n }\n $this->setReturnVariable(\"data\", array(\"password\" => $password));\n\n \n }", "protected function put(): self\n {\n $this->setOpt(CURLOPT_URL, $this->url->appendQuery($this->fields));\n $this->setOpt(CURLOPT_CUSTOMREQUEST, self::METHOD_PUT);\n \n return $this;\n }", "private function put_request( $endpoint = '/', $args = [], $request_args = [] ) {\n return $this->request( 'PUT', $endpoint, $args, $request_args );\n }", "public function updateKey($keyId, $request)\n {\n return $this->start()->uri(\"/api/key\")\n ->urlSegment($keyId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public function updateAPIKey($apiKeyId, $request)\n {\n return $this->start()->uri(\"/api/api-key\")\n ->urlSegment($apiKeyId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "static function tx($url, $data, $headers, $function = '', $package = 'json') {\r\n\t\tif (!empty($function)&&!empty($package)) {\r\n\t\t\t$parts = parse_url($url);\r\n\t\t\t$url = $parts['scheme'].'://'.(!empty($parts['user'])&&!empty($parts['pass'])?$parts['user'].':'.$parts['pass'].'@':'').$parts['host'].(!empty($parts['port'])?\":\".$parts['port']:\"\").$parts['path'].'/'.$function.'/'.$package.'/?'.$parts['query'].(!empty($parts['fragment'])?'#'.$parts['fragment']:'');\r\n\t\t}\r\n\r\n\t\t$headers = $this->getProtocolAuthorisationHeaders($headers, $url);\r\n\t\t$headers = $this->getProtocolDiscoveryHeaders($headers, $url);\r\n\t\t$headers = $this->getSystemHeaders($headers);\r\n\t\t\r\n\t\t$parts \t\t= parse_url($url);\r\n\t\t$url \t\t= $parts['scheme'].'://'.(!empty($parts['user'])&&!empty($parts['pass'])?$parts['user'].':'.$parts['pass'].'@':'').$parts['host'].(!empty($parts['port'])?\":\".$parts['port']:\"\").$parts['path'];\r\n\t\t$method\t\t= (is_array($data)?'POST':(is_string($data)?'PUT':'GET'));\r\n\t\t$query\t\t= $parts['query'];\r\n\t\t\r\n\t\t$ch \t\t= curl_init();\r\n\t\t\r\n\t\t$has_content_type = false;\r\n\t\tforeach ($headers as $id => $h)\r\n\t\t{\r\n\t\t\tif (is_array($h)) {\r\n\t\t\t\t$headers[$id] = $h[0].': '.$h[1];\r\n\t\t\t}\r\n\t\t\tif (strncasecmp($h, 'Content-Type:', 13) == 0)\r\n\t\t\t{\r\n\t\t\t\t$has_content_type = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (is_string($data))\r\n\t\t{\t\r\n\t\t\t// PUT and POST allow a request body\r\n\t\t\tif (!empty($query))\r\n\t\t\t{\r\n\t\t\t\t$url .= '?'.$query;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t// Make sure that the content type of the request is ok\r\n\t\t\tif (!$has_content_type)\r\n\t\t\t{\r\n\t\t\t\t$header[] = 'Content-Type: application/octet-stream';\r\n\t\t\t\t$has_content_type = true;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// When PUTting, we need to use an intermediate file (because of the curl implementation)\r\n\t\t\tif ($method == 'PUT')\r\n\t\t\t{\r\n\t\t\t\t/*\r\n\t\t\t\t if (version_compare(phpversion(), '5.2.0') >= 0)\r\n\t\t\t\t {\r\n\t\t\t\t// Use the data wrapper to create the file expected by the put method\r\n\t\t\t\t$put_file = fopen('data://application/octet-stream;base64,'.base64_encode($body));\r\n\t\t\t\t}\r\n\t\t\t\t*/\r\n\t\t\r\n\t\t\t\t$put_file = @tmpfile();\r\n\t\t\t\tif (!$put_file)\r\n\t\t\t\t{\r\n\t\t\t\t\ttrigger_error('Could not create tmpfile for PUT operation', E_WARNING);\r\n\t\t\t\t}\r\n\t\t\t\tfwrite($put_file, $data);\r\n\t\t\t\tfseek($put_file, 0);\r\n\t\t\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_PUT, \t\t true);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_INFILE, \t $put_file);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_INFILESIZE, strlen($body));\r\n\t\t\t}\r\n\t\t} elseif (is_array($data)) {\r\n\t\t\tif (!$has_content_type)\r\n\t\t\t{\r\n\t\t\t\t$header[] = 'Content-Type: application/x-www-form-urlencoded';\r\n\t\t\t\t$has_content_type = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$method == 'POST';\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST,\t\t true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// a 'normal' request, no body to be send\r\n\t\t\tif ($method == 'POST')\r\n\t\t\t{\r\n\t\t\t\tif (!$has_content_type)\r\n\t\t\t\t{\r\n\t\t\t\t\t$header[] = 'Content-Type: application/x-www-form-urlencoded';\r\n\t\t\t\t\t$has_content_type = true;\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POST, \t\t true);\r\n\t\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $query.'&'.http_build_query($data));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (!empty($query))\r\n\t\t\t\t{\r\n\t\t\t\t\t$url .= '?'.$query.'&'.http_build_query($data);\r\n\t\t\t\t}\r\n\t\t\t\tif ($method != 'GET')\r\n\t\t\t\t{\r\n\t\t\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, \t\t \ttrue);\r\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER,\t \t$headers);\r\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,\ttrue);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, \ttrue);\r\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT,\t\t \t$GLOBALS['xFreindicaModuleConfig']['user_agent']);\r\n\t\tcurl_setopt($ch, CURLOPT_URL, \t\t\t \t$url);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, \t$GLOBALS['xFreindicaModuleConfig']['curl_ssl_verify']);\r\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, \t\t\t$GLOBALS['xFreindicaModuleConfig']['curl_verbose']);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, \t\t \t$GLOBALS['xFreindicaModuleConfig']['curl_timeout']);\r\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, \t$GLOBALS['xFreindicaModuleConfig']['curl_connection_timeout']);\r\n\t\t$txt = curl_exec($ch);\r\n\t\tif ($txt === false) {\r\n\t\t\t$error = curl_error($ch);\r\n\t\t\tcurl_close($ch);\r\n\t\t\ttrigger_error('CURL error: ' . $error);\r\n\t\t}\r\n\t\tcurl_close($ch);\r\n\t\treturn self::curl_parse($txt);\r\n\t\t\r\n\t}", "function send_put()\n { \n $send = new send($this->put('id'));\n\n $send->date_modified = date('Y-m-d H:i:s');\n $send->modifiedbypk = $this->get_user()->user_id;\n\n $this->response($this->_update_save($send, 'put'));\n }", "protected function setPutData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function httpPut()\n {\n return $this->method(\"PUT\");\n }", "public function put($url)\n {\n $this->requestType = Client::REQUEST_PUT;\n $this->url = $url;\n return $this;\n }", "public function setOpt($key, $value)\n {\n curl_setopt($this->curl, $key, $value);\n }", "public function doPut($path, array $parsed_body);", "function getSignedUrlForPuttingObject($ossClient, $bucket)\n{\n $object = \"test/test-signature-test-upload-and-download.txt\";\n $timeout = 3600;\n $options = NULL;\n try {\n $signedUrl = $ossClient->signUrl($bucket, $object, $timeout, \"PUT\");\n } catch (OssException $e) {\n printf(__FUNCTION__ . \": FAILED\\n\");\n printf($e->getMessage() . \"\\n\");\n return;\n }\n print(__FUNCTION__ . \": signedUrl: \" . $signedUrl . \"\\n\");\n $content = file_get_contents(__FILE__);\n\n $request = new RequestCore($signedUrl);\n $request->set_method('PUT');\n $request->add_header('Content-Type', '');\n $request->add_header('Content-Length', strlen($content));\n $request->set_body($content);\n $request->send_request();\n $res = new ResponseCore($request->get_response_header(),\n $request->get_response_body(), $request->get_response_code());\n if ($res->isOK()) {\n print(__FUNCTION__ . \": OK\" . \"\\n\");\n } else {\n print(__FUNCTION__ . \": FAILED\" . \"\\n\");\n };\n}", "public function setopt($key, $value)\n {\n curl_setopt($this->curl, $key, $value);\n }", "public function setopt($key, $value){\n curl_setopt($this->ch, $key, $value);\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function put($configKey, $key, $data);", "public static function put($url, $data)\n {\n $putData = tmpfile();\n\n fwrite($putData, $data);\n fseek($putData, 0);\n\n $result = self::fetch($url, array(\n CURLOPT_PUT => true,\n CURLOPT_INFILE => $putData,\n CURLOPT_INFILESIZE => strlen($putData)\n ));\n\n fclose($putData);\n\n return $result;\n }", "function doPUT (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"PUT method not supported\");\n }", "public function putAction($apiVersion, $type, $name, $key='')\n {\n $parameters = $this->getRequest()->request->all();\n\n $response = array(\n 'method' => 'PUT',\n 'version' => $apiVersion,\n 'type' => $type,\n 'name' => $name,\n 'key' => $key,\n 'parameters'=> $parameters\n );\n\n return new Response(json_encode($response));\n }", "function CallAPI($method, $url, $data = false)\r\n{\r\n $curl = curl_init();\r\n\r\n switch ($method)\r\n {\r\n case \"POST\":\r\n curl_setopt($curl, CURLOPT_POST, 1);\r\n\r\n if ($data)\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n break;\r\n case \"PUT\":\r\n curl_setopt($curl, CURLOPT_PUT, 1);\r\n break;\r\n default:\r\n if ($data)\r\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n }\r\n\r\n // Optional Authentication:\r\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\r\n\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n $result = curl_exec($curl);\r\n\r\n curl_close($curl);\r\n\r\n return $result;\r\n}", "public function put(string $key, $value): void;", "protected function _doPut($in_url, $in_content, $in_content_type, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'PUT', $in_content, $in_content_type, $in_additional_curl_options);\r\n }", "public function put($key, $value);", "public function put($key, $value);", "public function controllerPUT($url) {\r\n\treturn $this->controller($url);\r\n }", "public function testPutValue() : void {\n\t\t$this->assertEquals('PUT', HttpMethod::Put->value);\n\t}", "public function testUpdateSubject()\n {\n echo \"\\nTesting subject update...\";\n $id = \"0\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('subject_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "function CallAPI($method, $url, $data = false)\n{\n $curl = curl_init();\n\n switch ($method)\n {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // Optional Authentication:\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n\n// echo \"<pre>\",print_r($result);\n return $result;\n}", "function put() \n {\n \n }", "public function update_put(){\n $response = $this->PersonM->update_person(\n $this->put('id'),\n $this->put('name'),\n $this->put('hp'),\n $this->put('email'),\n $this->put('message')\n );\n $this->response($response);\n }", "public function put ( $path, $body = null, $params ) {\n \n \t$body = json_encode ( $body );\n \n $opts = array (\n\t\t\t CURLOPT_HTTPHEADER \t\t=> array ( 'Content-Type: application/json' ),\n\t\t\t CURLOPT_CUSTOMREQUEST \t=> \"PUT\",\n\t\t\t CURLOPT_POSTFIELDS \t\t=> $body\n );\n \n $exec = $this->execute ( $path, $opts, $params );\n\n return $exec;\n }", "public function put($arguments = []) {\n try {\n //Attempt to update the row.\n $this->dbh->query($this->query_array['put'], $arguments);\n $this->result_array['new_username'] = $arguments['new_username'];\n } catch (PDOException $e) {\n $this->result_array['ok'] = false;\n if ($e->errorInfo[1] == 19) {\n //We've got a duplicate entry for the username.\n $this->result_array['error'] = 'Username already exists!';\n } else {\n //Other error.\n $this->result_array['error'] = $e->getMessage();\n }\n }\n }", "public function put($content = NULL) {\n\t\tif (is_array ( $content )) {\n\t\t\t$content = http_build_query ( $content );\n\t\t\t$this->setHeader ( 'Content-Type', 'application/x-www-form-urlencoded' );\n\t\t}\n\t\t$this->request_body = $content . self::CRLF . self::CRLF;\n\t\t$this->method = \"PUT\";\n\t\t$this->send ();\n\t\treturn $this->status_code;\n\t}", "private function _setUserKey (string $username, string $key, $value)\n\t{\n\t\t$realKey = $username . '_' . $key;\n\t\t$this->cache->put($realKey, (string) $value, self::CACHE_TIME);\n\t}", "public function handlePut($user, $_PUT) {\n\t\t// User must be verified to perform modifications\n\t\tif (!$this->verifyUser($user)) {\n\t\t\techo json_encode($this->throwUnauthorized());\n\t\t\treturn;\n\t\t}\n\t\tif ($_GET['entryid'] == \"\") { // URL rewrite parameter\n\t\t\t// Batch transaction\n\t\t\tif (isset($_PUT['time']) && isset($_PUT['entries'])) {\n\t\t\t\t$result = $this->putEntries($user, $_PUT['entries']);\n\t\t\t\t$result['time'] = $_PUT['time'];\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t} else {\n\t\t\t// Single entry\n\t\t\tif (isset($_PUT['time']) && isset($_PUT['entry'])) {\n\t\t\t\t$result = $this->putEntry($user, $_PUT['entry']);\n\t\t\t\t$result['time'] = $_PUT['time'];\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t}\n\t}", "function setUpSpotifyCurl($clientId, $data){\n\t// Set the URI during init\n\t$ch = curl_init(SPOTIFY_TOKEN_URI);\n\t\n\t// Set auth\n\t// https://developer.spotify.com/web-api/authorization-guide/\n\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\tcurl_setopt($ch, CURLOPT_USERPWD, $clientId.':'.SPOTIFY_CLIENT_SECRET);\n\t// Set Content-Type\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);\n\t// Capture the json data\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t// Allow the header to be dumped\n\tcurl_setopt($ch, CURLINFO_HEADER_OUT, true);\n\t\n\t// Set POST Data\n\tcurl_setopt($ch, CURLOPT_POST, true);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));\n\t\n\treturn $ch;\n}", "public function testUpdateKey()\n {\n }", "abstract public function put(Request $request);", "public function put($path, $data = null);", "function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}", "function http_put_stream($url, $stream = null, ?array $options = null, ?array &$info = null) {}", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"[email protected]\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "public function put();", "public function put();", "public function update(Request $request, $key);", "public function addPutData($put_data) {}", "function send_request($http_method, $url, $auth_header=null, $postData=null) {\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_FAILONERROR, false);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n switch($http_method) {\n case 'GET':\n if ($auth_header) {\n curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header)); \n }\n break;\n case 'POST':\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml', \n $auth_header)); \n curl_setopt($curl, CURLOPT_POST, 1); \n curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);\n break;\n case 'PUT':\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/atom+xml', \n $auth_header)); \n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $http_method);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);\n break;\n case 'DELETE':\n curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header)); \n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $http_method); \n break;\n }\n $response = curl_exec($curl);\n if (!$response) {\n $response = curl_error($curl);\n }\n curl_close($curl);\n return $response;\n}", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function testPutDataFormUrlEncoded(): void\n {\n $this->configRequest([\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ],\n ]);\n $this->put('/request_action/post_pass', ['title' => 'value']);\n $this->assertResponseOk();\n $data = json_decode('' . $this->_response->getBody());\n $this->assertSame('value', $data->title);\n }", "public function testuserUpdate200()\n {\n $response = $this->runApp('PUT', '//user/{id}',[$user => '',]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertContains('Success', (string)$response->getBody());\n }", "function putcURLtoFireBase($item,$objname) {\n //if [status] is not true, launch processes\n if ($item['status'] != 1) {\n print_r($objname);\n \n print \"<br />\";\n \n $purl = 'https://amber-inferno-7558.firebaseio.com/' . $objname . '.json';\n //Automated Process Called here\n print \"updating db json obj\".PHP_EOL;\n $data = $item;\n $data['status'] = true;\n $data_json = json_encode($data);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $purl);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($data_json)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n \n $response = curl_exec($ch);\n if(!$response) {\n print 'FAIL '.curl_errno($ch) . '-' . curl_error($ch);\n } else {\n print PHP_EOL.'PASS: '.curl_errno($ch) . '-' . curl_error($ch);\n } \n }\n }", "function update()\n {\n $fkey = $this->input->post('fkey', TRUE);\n $fpass = $this->input->post('fpass', TRUE);\n $fname = $this->input->post('fname', TRUE);\n $femail = $this->input->post('femail', TRUE);\n\n $dataInfo = array('fkey'=>$fkey, 'fpass'=>$fpass, 'fname'=>$fname, 'femail'=>$femail);\n \n $rs_data = send_curl($this->security->xss_clean($dataInfo), $this->config->item('api_edit_account'), 'POST', FALSE);\n\n if($rs_data->status)\n {\n $this->session->set_userdata('vendorName', $fname);\n $this->session->set_flashdata('success', $rs_data->message);\n redirect('my-account');\n }\n else\n {\n $this->session->set_flashdata('error', $rs_data->message);\n redirect('my-account');\n }\n }", "public function put()\n\t{\n\t\t$this->post();\n\n\t\t$response = $this->plugin->get( 'response' );\n\t\tif ( isset( $response->success ) && $response->success ) {\n\t\t\tJResponse::setHeader( 'status', 200, true );\n\t\t\t$response->code = 200;\n\t\t\t$this->plugin->setResponse( $response );\n\t\t}\n\t}" ]
[ "0.72033864", "0.65037984", "0.6477619", "0.6439031", "0.6424803", "0.64064497", "0.6395999", "0.6388594", "0.6384424", "0.6311735", "0.61685264", "0.61212295", "0.6117455", "0.609955", "0.60273874", "0.5992573", "0.5985227", "0.5980311", "0.5975014", "0.5953659", "0.5922608", "0.59095407", "0.58783746", "0.5872109", "0.5856211", "0.5848717", "0.58436257", "0.5821671", "0.5820248", "0.580001", "0.5788245", "0.57715464", "0.57642746", "0.57603985", "0.5752713", "0.5717423", "0.56875193", "0.5672863", "0.5627778", "0.56027144", "0.55955017", "0.55884737", "0.55761015", "0.55398345", "0.55292076", "0.552735", "0.55104524", "0.54750013", "0.54701734", "0.5455343", "0.5452972", "0.54494756", "0.542302", "0.54124665", "0.5387688", "0.53866875", "0.53606224", "0.53566843", "0.5340845", "0.5331292", "0.532523", "0.5324821", "0.5322344", "0.5318922", "0.5317519", "0.53130174", "0.5305883", "0.53057665", "0.53023183", "0.5291217", "0.5291217", "0.5282267", "0.5264332", "0.52633315", "0.52560747", "0.5252702", "0.5240439", "0.5231804", "0.5221279", "0.52168703", "0.5214815", "0.52144605", "0.5211552", "0.5191999", "0.5188399", "0.5181114", "0.5179776", "0.51761204", "0.5172947", "0.51714", "0.51714", "0.5164948", "0.5160157", "0.5159106", "0.5146813", "0.51439905", "0.514167", "0.5139877", "0.5137443", "0.5136392" ]
0.69541943
1
This is a helpping method to calll CURL Delete request with username and password
private function curl_delete($url) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function call_api_delete(){\n$ch = curl_init('http://localhost:8001/api/users/....');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLINFO_HEADER_OUT, true);\ncurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n// Submit the DELETE request\n$result = curl_exec($ch);\n\n//Close cURL session handle\ncurl_close($ch);\necho \"Deleted\"; \n }", "public function _DELETE($url, $params = null, $username = null, $password = null)\n {\n //Modified by Edison tsai on 09:50 2010/11/26 for missing part\n $response = $this->call($url, 'DELETE', $params, $username, $password);\n\n return $this->parseResponse($response);\n }", "function finishAndDisconnect($resultAPI, $res){\n echo json_encode($res);\n if(isset($_GET['username']) && isset($_GET['password']) ){\n $curl = curl_init();\n $params = \"id=\".$resultAPI['id'].\"&sessionkey=\".$resultAPI['sessionKey']; \n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n // curl_setopt($curl, CURLOPT_POSTFIELDS, array( ));\n curl_setopt($curl, CURLOPT_URL, \"http://localhost/SiteD/BDD/API/connexion.php?$params\"); // a modifier plus tard\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n $result = curl_exec($curl);\n curl_close($curl);\n }\n\n\n die();\n}", "private function delete($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "public function delete()\n {\n #HTTP method in uppercase (ie: GET, POST, PATCH, DELETE)\n $sMethod = 'DELETE';\n $sTimeStamp = gmdate('c');\n\n #Creating the hash\n\t\t$oHash = new Hash($this->getSecretKey());\n\t\t$oHash->addData($this->getPublicKey());\n\t\t$oHash->addData($sMethod);\n\t\t$oHash->addData($this->getApiResource());\n\t\t$oHash->addData($this->getData());\n\t\t$oHash->addData($sTimeStamp);\n\n\t\t$sHash = $oHash->hash();\n\n $rCurlHandler = curl_init();\n curl_setopt($rCurlHandler, CURLOPT_URL, $this->getApiRoot() . $this->getApiResource());\n curl_setopt($rCurlHandler, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($rCurlHandler, CURLOPT_CUSTOMREQUEST, $sMethod);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($rCurlHandler, CURLOPT_SSL_VERIFYHOST, 0);\n\n curl_setopt($rCurlHandler, CURLOPT_HTTPHEADER, [\n \"x-date: \" . $sTimeStamp,\n \"x-hash: \" . $sHash,\n \"x-public: \" . $this->getPublicKey(),\n \"Content-Type: text/json\",\n ]);\n $sOutput = curl_exec($rCurlHandler);\n $iHTTPCode = curl_getinfo($rCurlHandler, CURLINFO_HTTP_CODE);\n curl_close($rCurlHandler);\n\n Log::write('WebRequest', 'DELETE::REQUEST', $this->getApiRoot() . $this->getApiResource());\n Log::write('WebRequest', 'DELETE::HTTPCODE', $iHTTPCode);\n Log::write('WebRequest', 'DELETE::RESPONSE', $sOutput);\n\n if ($iHTTPCode !== 204) {\n throw new InvalidApiResponse('HttpCode was ' . $iHTTPCode . '. Expected 204');\n }\n return $sOutput;\n }", "function rest_delete_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "function delete()\n {\n $this->_api->doRequest(\"DELETE\", \"{$this->getBaseApiPath()}\");\n }", "public function sendDelete ()\n {\n curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n return $this->handleQuery();\n }", "function delete($url, $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_CUSTOMREQUEST] = \"DELETE\";\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "public function delete($url, $query = array(), $headers = array());", "public function procesa($action)\n {\n $id = $this->numero; \n $cmd='curl -v -H \"Accept: application/json\" -H \"Content-type: application/json\" -X DELETE https://app.alegra.com/api/v1/contacts/' . $id . ' -u \"xxxxx:xxxxx\"'; \n exec($cmd,$result);\n\n }", "public function deauthenticate() {\n\t\t$response = $this->requester->request('DELETE', $this->url);\n\t\t$this->requester->token = null;\n\t\treturn $response;\n\t}", "public static function urlDelete($url,$data,$headers=null) {\n\n $isJsonForm = false;\n\n if ($headers == null){\n $headers = array(\"Content-type: application/json\");\n $isJsonForm = true;\n }\n else {\n $stringFromHeaders = implode(\" \",$headers);\n if (preg_match(\"/Content\\-type:/i\",$stringFromHeaders)){\n \n if (preg_match(\"/Content\\-type:\\ {0,4}application\\/json/i\",$stringFromHeaders)){\n $isJsonForm = true; \n //array_push($headers,\"Content-type: application/json\");\n }\n\n }\n else{\n $isJsonForm = true; \n array_push($headers,\"Content-type: application/json\");\n }\n }\n\n if ($isJsonForm){\n $data = json_encode($data);\n $dataString = $data;\n }\n else{\n\n $dataString = '';\n foreach ($data as $key => $value){\n if (preg_match(\"/[a-zA-Z_]{2,100}/\",$key))\n $dataString .= $key . \"=\" . $value .\"&\";\n }\n $dataString .= \"\\n\";\n }\n\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n array_push($headers,'Content-Length: ' . strlen($dataString));\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n if($headers != null && in_array('Custom-SSL-Verification:false',$headers)){\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n }\n\n $contents = curl_exec($ch);\n\n\n if($errno = curl_errno($ch)) {\n $error_message = curl_strerror($errno);\n //echo \"cURL error ({$errno}):\\n {$error_message}\";\n $contents = \"cURL error ({$errno}):\\n {$error_message}\";\n }\n\n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n return utf8_encode($contents);\n }", "public function delete() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function delete(...$args)\n {\n return $this->curl('delete', ...$args);\n }", "public function testDeleteSuccessful() {\n\t\t$response = $this->call('DELETE','v1/users/'.$this->username);\n\t\t$this->assertResponseOk();\n\t}", "function delete(Request &$request, Response &$response);", "public function _delete($url = null, array $parameters = []);", "private function delete_request( $endpoint = '/', $args = [], $request_args = [] ) {\n return $this->request( 'DELETE', $endpoint, $args, $request_args );\n }", "function delTemp($userid){\n\t$cSession = curl_init();\n\t// Step 2\n\tcurl_setopt($cSession,CURLOPT_URL,\"http://1.179.187.126/linegps/deltemp.php?userid=$userid\");\n\tcurl_setopt($cSession,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($cSession,CURLOPT_HEADER, false);\n\t// Step 3\n\t$result=curl_exec($cSession);\n\t// Step 4\n\tcurl_close($cSession);\n\t// ====\n\treturn $result;\n\n}", "function delete($url, $parameters = array()) {\n $response = $this->oAuthRequest($url, 'DELETE', $parameters);\n if ($this->format === 'json' && $this->decode_json) {\n return json_decode($response, true);\n }\n return $response;\n }", "public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "public function delete()\n\t{\n\t\t$data = json_decode(file_get_contents(\"php://input\")); \t \n\t\techo $this->home->delete($data);\n\t\t\n\t}", "public function delete() {\n\n try {\n /**\n * Set up request method\n */\n $this->method = 'POST';\n\n\n /**\n * Process request and call for response\n */\n return $this->requestProcessor();\n\n } catch (\\Throwable $t){\n new ErrorTracer($t);\n }\n }", "public function delete($url, $endpoint = \"\", $header = array(), $query = array())\n {\n $url .= $endpoint;\n if (count($query) > 0) {\n $query = http_build_query($query);\n $url .= \"?\" . $query;\n }\n\n // $log = \"New DELETE Request.\\n\";\n // $log .= \"URL: $url\\n\";\n\n $ch = curl_init();\n\n //Set the URL that you want to GET by using the CURLOPT_URL option.\n curl_setopt($ch, CURLOPT_URL, $url);\n\n\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n //Set CURLOPT_RETURNTRANSFER so that the content is returned as a variable.\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n //Set CURLOPT_FOLLOWLOCATION to true to follow redirects.\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\n if (array_key_exists('headers', $header)) {\n // Set HTTP Header for POST request \n //$log .= \"Header sent: \" . json_encode($header['headers']) . \"\\n\";\n curl_setopt($ch, CURLOPT_HTTPHEADER, $header['headers']);\n }\n\n //Execute the request.\n $result = curl_exec($ch);\n\n\n //Handle curl errors\n if (curl_error($ch)) {\n $error_msg = curl_error($ch);\n //$log .= \"Error: $error_msg\\n\";\n throw new \\Exception(curl_error($ch));\n }\n\n //$log .= \"\\n------------------------END-------------------------\\n\\n\";\n //file_put_contents('log.txt', $log, FILE_APPEND);\n\n //Close the cURL handle.\n curl_close($ch);\n\n //Print the data out onto the page.\n //header('Content-Type: application/json');\n return json_encode(json_decode($result));\n }", "public function delete($requestUrl, $requestBody, array $requestHeaders = []);", "public function delete($username)\n {\n }", "public function deleteWebhook(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function delete()\n\t{\n\t\t// Pass on the request to the driver\n\t\treturn $this->backend->delete('', array());\n\t}", "public function delete()\n {\n return $this->apiCall('delete', '');\n }", "public function delete()\n {\n return $this->apiCall('delete', '');\n }", "protected function curl_delete($uri) {\n\n\t $output = \"\";\n\n\t try {\n\n\t\t$ch = curl_init($uri);\n\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); \n\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 4);\n\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\n\t\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n\n\t\t$output = curl_exec($ch);\n\n\t\t$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n\t } catch (Exception $e) {\n\n\t }\n\n\t \tif ($httpcode == \"200\") {\n\n\t \t\treturn json_decode($output, true);\n\n\t \t} else {\n\n\t \t\treturn array('error' => 'HTTP status code not expected - got ', 'description' => $httpcode);\n\n\t \t}\n\n\t}", "public function sendDelete($id)\n {\n $ch = curl_init(\"http://localhost/rest/index.php/book/$id\");\n //a true, obtendremos una respuesta de la url, en otro caso, \n //true si es correcto, false si no lo es\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //establecemos el verbo http que queremos utilizar para la petición\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n //enviamos el array data\n $response = curl_exec($ch);\n // Se cierra el recurso CURL y se liberan los recursos del sistema\n curl_close($ch);\n if(!$response) {\n return false;\n }else{\n var_dump($response);\n }\n }", "function sendDeleteCmd($resource) {\n $url = $this->baseURL . $resource;\n\n $request = curl_init($url);\n curl_setopt($request, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($request, CURLOPT_FAILONERROR, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n\n $result = curl_exec($request);\n return json_decode($result, true);\n }", "public function delete()\n {\n return $this->setMethod(__FUNCTION__)\n ->makeRequest();\n }", "public function testThatDeleteUserRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->delete( '__test_user_id__' );\n\n $this->assertEquals( 'DELETE', $api->getHistoryMethod() );\n $this->assertEquals( 'https://api.test.local/api/v2/users/__test_user_id__', $api->getHistoryUrl() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "function delete($conn)\n{\n $response[\"loggedIn\"] = getSessionValue(\"user\", \"\") != \"\";\n if (!$response[\"loggedIn\"])\n {\n $response[\"error\"] = \"You must login to delete your user account.\";\n return $response;\n } \n \n // make sure the user exists...\n $userID = getSessionValue(\"user\", \"\")[\"userID\"];\n $stmt = $conn->prepare(\"SELECT USER_ID FROM USER WHERE USER_ID = ?\");\n $stmt->bind_param(\"i\", $userID);\n $stmt->execute();\n if (!$stmt->fetch()) \n {\n $response[\"error\"] = sprintf(\"User %d does not exist.\", $userID);\n return $response;\n }\n $stmt->close();\n \n // delete the user...\n $stmt = $conn->prepare(\"DELETE FROM USER WHERE USER_ID = ?\");\n $stmt->bind_param(\"i\", $userID);\n $stmt->execute();\n \n // log the user out...\n setSessionValue(\"user\", \"\");\n $response[\"loggedIn\"] = false;\n return $response;\n}", "static public function delete(){\n\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/DeleteRequest.php');\n\n\t\t$requests = new DeleteRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\tif(count($errors) > 0){\n\n\t\t\t//Verifica se id não existe no banco ou deixar enviar, força o redirecionamento para pagina /users\n\t\t\tif( isset($errors['id']) ){\n\n\t\t\t\t$back = '/users?errors=' . json_encode(['id' => $errors['id']]);\n\n\t\t\t}else{\n\n\t\t\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users';\n\t\t\t\t$back .= '?id='.$_POST['id'].'&errors=' . json_encode($errors);\n\n\t\t\t}\n\n\t\t\theader('Location: ' . $back);\n\n\t\t}else{\n\n\t\t\t//Caso não houver nenhum impedimento, faz o delete do usuario\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\t$crud->delete($_POST['id']);\n\n\t\t\t//Redireciona para pagina de /users\n\t\t\theader('Location: /users?success=Usuário deletado com sucesso');\n\t\t\t\n\t\t}\n\n\t}", "public function DELETE() {\n #\n }", "static public function del($method, $params)\n {\n $client = new Client;\n $signedParams = ['form_params' => [\n 'id' => 1,\n 'user_id' => getenv('AMTEL_USER_ID'),\n 'request' => self::getRequestString($params)\n ]];\n Log::info('DELETE: ' . self::URI . $method . ', params=' . json_encode($params));\n $res = $client->delete(self::URI . $method, $signedParams);\n\n if ($res->getStatusCode() == 200) {\n Log::info('result 200');\n $content = $res->getBody()->getContents();\n\n return $content;\n } else {\n Log::error('GET: ' . self::URI . $method . ', params=' . json_encode($params) . '. result: ' . $res->getStatusCode());\n //Log::error(new \\Exception('amtel GET ' . self::URI . $method . ', params=' . json_encode($params) . '. result ' . $res->getStatusCode()));\n throw new HttpException('bad request ' . $res->getStatusCode());\n }\n }", "public function testDeleteUrlUsingDELETE()\n {\n }", "public function deleteAllSelected(){\n $data =$data = $this->input->post();\n $url = 'http://localhost/data-api/v1/api/deleteAllSelected';\n $method = $_SERVER['REQUEST_METHOD'];\n $response = callAPI($method,$url ,http_build_query($data));\n echo $response;\n }", "public function deleteUser() {\n extract($_GET);\n $path = base_url();\n $url = $path . 'api/admin/Employee_api/deleteUser?user_id=' . $user_id;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n // authenticate API\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);\n curl_setopt($ch, CURLOPT_USERPWD, API_USER . \":\" . API_PASSWD);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPGET, 1);\n $output = curl_exec($ch);\n //close cURL resource\n curl_close($ch);\n $response = json_decode($output, true);\n ///print_r($output);die();\n if ($response['status'] == 200) {\n $response = array(\n 'status' => 200,\n 'message' => '<div class=\"alert alert-success alert-dismissible fade in alert-fixed w3-round\">\n\t\t\t<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>\n\t\t\t<strong>Success!</strong> Employee Removed successfully.\n\t\t\t</div>\n\t\t\t<script>\n\t\t\twindow.setTimeout(function() {\n\t\t\t$(\".alert\").fadeTo(500, 0).slideUp(500, function(){\n\t\t\t$(this).remove(); \n\t\t\t});\n\t\t\tlocation.reload();\n\t\t\t}, 1000);\n\t\t\t</script>'\n );\n } else {\n $response = array(\n 'status' => 500,\n 'message' => '<div class=\"alert alert-danger alert-dismissible fade in alert-fixed w3-round\">\n\t\t\t<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">&times;</a>\n\t\t\t<strong>Failure!</strong> Employee Not Removed Successfully.\n\t\t\t</div>\n\t\t\t<script>\n\t\t\twindow.setTimeout(function() {\n\t\t\t$(\".alert\").fadeTo(500, 0).slideUp(500, function(){\n\t\t\t$(this).remove(); \n\t\t\t});\n\t\t\t}, 5000);\n\t\t\t</script>'\n );\n }\n echo json_encode($response);\n }", "function doDELETE (HttpRequest $request, HttpResponse $response) {\n throw new Exception(\"DELETE method not supported\");\n }", "public function delete(string $url, array $input = [], $headers = null);", "public function deletePost($id){\n $ourResponse=Http::delete('https://reqres.in/api/users/'.$id);\n // DD the response to check it is done or not\n dd($ourResponse);\n }", "public function Delete( $sUrl, array $aFields = array() );", "public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }", "public function delete() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['delete']) && !empty($_POST['delete'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->delete(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n } else {\n echo \"good\";\n }\n }\n }\n }", "public function delete( $id ){\n \t\t$response = $this->curl->delete( $this->api_url . '/' . $id, [ \n\t\t\t'access_token' \t=> $this->token\n\t\t]);\n\t\t\n\t\treturn $response;\n \t}", "public function delete($json){\n $_respuestas = new respuestas;\n $datos = json_decode($json,true);\n\n if(!isset($datos['token'])){\n return $_respuestas->error_401();\n }else{\n $this->token = $datos['token'];\n $arrayToken = $this->buscarToken();\n if($arrayToken){\n\n if(!isset($datos['idcita'])){\n return $_respuestas->error_400();\n }else{\n $this->idcita = $datos['idcita'];\n $resp = $this->eliminarCita();\n if($resp){\n $respuesta = $_respuestas->response;\n $respuesta[\"result\"] = array(\n \"idcita\" => $this->idcita\n );\n return $respuesta;\n }else{\n return $_respuestas->error_500();\n }\n }\n\n }else{\n return $_respuestas->error_401(\"El Token que envio es invalido o ha caducado\");\n }\n }\n\n\n\n \n }", "public function delete($uri, array $data = [], array $headers = []): TestResponse\n {\n return $this->call('DELETE', $uri, $data, $this->defaultCookies, [], $headers);\n }", "public static function delete($url)\n {\n return self::fetch($url, array (\n CURLOPT_CUSTOMREQUEST => 'DELETE'\n ));\n }", "public function delete()\n {\n try {\n global $connection;\n //generate sql\n $sql = \"CALL customers_delete(:username)\";\n // adding the current values from fields to local variables..\n $username = $this->getUsername();\n //preparing the statement using prepare function\n $stmt = $connection->prepare($sql);\n //binding the parameters into sql using local appropriate fields\n $stmt->bindParam(':username', $username);\n //if execution is successful it will return true else false.. because execte function will return bool\n return $stmt->execute();\n } catch (Exception $e) {\n echo 'Exception occurred: ' . $e->getMessage();\n }\n }", "public function delete ( $path, $params ) {\n \n \t$opts = array ( \n \t\t\tCURLOPT_CUSTOMREQUEST => \"DELETE\"\n );\n \n $exec = $this->execute ( $path, $opts, $params );\n \n return $exec;\n }", "private function setCustomRequestDelete()\n {\n curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n $this->setPostFields();\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "protected function _doDelete($in_url, $in_additional_curl_options=array()) {\r\n return $this->__doRequest($in_url, 'DELETE', null, null, $in_additional_curl_options);\r\n }", "public function delete() {}", "public function testDeleteHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\r\n\t\t//Test HTTP status ok for id=1\r\n\t\t$response= $this->http->request('DELETE','api/v1/hospital/2');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t}", "public function testDeleteUser()\n {\n $id = 6;\n $this->json('DELETE', \"api/user/delete/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\"\n ]);\n }", "public function testDelete_Error()\r\n\t{\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\t\r\n\t\t$response = $this->http->delete('/api/v1/hospital/5', [ //Change ID here to a Hospital that isn't in the datastore'\r\n\t\t\t'http_errors' => false\r\n\t\t]);\r\n\t\r\n\t\t//Test invalid requests\r\n\t\t$this->assertEquals(405, $response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "function Delete( $uri )\r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Delete( $uri )\\n\";\r\n\t\tif( $this->sendCommand( \"DELETE $uri HTTP/$this->protocolVersion\" ) )\r\n\t\t\t$this->processReply();\r\n\t\treturn $this->reply;\r\n\t}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "private function executeDelete(Visio\\Http\\CurlRequest $curl) {\n $curl->setOption(CURLOPT_CUSTOMREQUEST, 'DELETE');\n\n $this->doExecute($curl);\n }", "function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}", "public function testMakeDeleteRequest()\n {\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse([\n 'success' => [\n 'code' => 200,\n 'message' => 'Deleted.',\n ],\n ], 200),\n ]);\n\n $this->assertEquals($client->delete('teachers/1'), true);\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "public function deleteAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function testDelete()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t// On clique sur le lien entreprise de test\n\t\t$crawler = $client->request('GET', '/clients');\n\t\t$link = $crawler->filter('.bloc__title a:contains(\"Entreprise de test\")')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Entreprise de test\")')->count());\n\n\t\t// On clique sur le bouton modifier\n\t\t$link = $crawler->filter('.btn--delete')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('.breadcrumb:contains(\"Supprimer\")')->count()); \n\n\t\t// On modifie le métier\n\t\t$form = $crawler->selectButton('Supprimer')->form();\n\t\t$crawler = $client->submit($form);\t\n\n\t\t//On vérifie que ça a marché\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Le client a bien été supprimé.\")')->count());\n\n\t}", "public function delete(string $uri, array $params = [], array $headers = []): ResponseInterface;", "public function delete() {\n\n try{\n\n $this->checkOptionsAndEnableCors();\n\n $id = $this->input->get('id');\n if(isset($id)){\n $this->repository->delete((int) $id);\n echo json_encode([ \"data\" => 'User id '.$id. ' deleted' ]);\n } else {\n $this->handleError('Missing id parameter');\n }\n } catch (ORMException $e) {\n $this->handleError($e->getMessage());\n } catch (Exception $e) {\n log_message('error', $e->getMessage());\n $this->handleError($e->getMessage());\n }\n }", "public function delete()\n {\n $user = new Task();\n $attributes = $this->request->body();\n\n if( $user->setAttributes($attributes)->delete() ) {\n // return ['status' => 'success']; // for ajax\n header(\"Location: /task/index\");\n exit;\n }\n\n return ['status' => 'cannot delete'];\n }", "abstract public function removeAuthToken();", "function delete_cart()\n {\n $fid = $this->input->post('fid');\n\n $success_response = array(\n 'status' => 1,\n 'message'=> 'Successfully delete data'\n );\n $error_response = array(\n 'status' => 0,\n 'message'=> 'Failed delete data'\n );\n\n $arrWhere = array('fid'=>$fid);\n $rs_data = send_curl($arrWhere, $this->config->item('api_delete_cart'), 'POST', FALSE);\n $result = $rs_data->status ? TRUE : FALSE;\n\n if($result)\n {\n $response = $success_response;\n }\n else\n {\n $this->session->set_flashdata('error', 'Something wrong when deleting data');\n $response = $error_response;\n }\n return $this->output\n ->set_content_type('application/json')\n ->set_output(\n json_encode($response)\n );\n }", "public function delete()\r\n\t\t{\r\n\t\t\t//Validate request method\r\n\t\t\tif($this->getRequestMethod() != \"DELETE\"){\r\n\t\t\t\t$this->methodNotAllowed();\r\n\t\t\t}\r\n\r\n\t\t\t// Input validations\r\n\t\t\t$this->validation(array('iCartId'));\r\n\r\n\t\t\t$iCartId = (int)$this->_arrRequest['iCartId'];\r\n\r\n\t\t\tif($iCartId > 0){\r\n\t\t\t\t$sWhere \t\t= \"iCartId = '\".$iCartId.\"'\";\r\n\t\t\t\t$iDeleteStatus \t= $this->deleteRecord($this->_sCartTable,$sWhere);\r\n\t\t\t\t$iStatus \t\t= ($iDeleteStatus>0) ? \"Success\" : \"False\";\r\n\t\t\t\t$sMessage\t\t= ($iDeleteStatus>0) ? \"Deleted successfully.\" : \"Fail to delete.\";\r\n\t\t\t}else{\r\n\t\t\t\t$iStatus = \"False\";\r\n\t\t\t\t$sMessage = \"Invalid input.\";\r\n\t\t\t}\r\n\t\t\t$arrResponse['status']\t= $iStatus;\r\n\t\t\t$arrResponse['message']\t= $sMessage;\r\n\t\t\t$this->response($this->json($arrResponse), 200);\r\n\t\t}", "public function user_delete($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_delete', $data);\n\t}", "public function delete($id){\n\t\t$url = WEBSERVICE. \"status_robot/deleteById/\" . $id;\n\t\t$this->HTTPRequest->setUrl($url);\n\t\t$this->HTTPRequest->setMethod(\"DELETE\");\n\t\t$response = $this->HTTPRequest->sendHTTPRequest();\n\t\treturn $response;\n\t}", "function deleteUser($userName) {\n\n Util::throwExceptionIfNullOrBlank($userName, \"User Name\");\n $encodedUserName = Util::encodeParams($userName);\n $responseObj = new App42Response();\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['userName'] = $userName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/\" . $encodedUserName;\n $response = RestClient::delete($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $responseObj->setStrResponse($response->getResponse());\n $responseObj->setResponseSuccess(true);\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $responseObj;\n }", "public function delete() {\r\n\t\t$sql = \"DELETE FROM\twcf\".WCF_N.\"_user_failed_login\r\n\t\t\tWHERE\t\tfailedLoginID = \".$this->failedLoginID;\r\n\t\tWCF::getDB()->sendQuery($sql);\r\n\t}", "public function deleteAction(){\n $id = $this->params('id');\n $client = new Client();\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest/'.$id);\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setMethod( Request::METHOD_DELETE );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }", "function deleteSnap($snap_id){\n $ch = curl_init('https://api.digitalocean.com/v2/snapshots/'.$snap_id);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, [\n 'Authorization: Bearer '.token(),\n 'Content-Type: application/json',\n ]);\n $results = json_decode(curl_exec($ch));\n return $results;\n}", "function delete($username, $permission){\n \tif($permission != ADMIN)\n \t\treturn NOT_ALLOW;\n \t$con = new mysqli('localhost','heng','@powell135','200ok');\n \tif ($con -> connect_errno){\n \t\treturn CONNECTION_FAIL;\n \t}\n \t\n \t$query = \"delete from jnjn_user where username='$username'\";\n \tif($con -> query($query)){\n \t\t$query = \"delete from jnjn_user_group where username = '$username'\";\n\t\tif($con -> query($query)){\n\t\t\t$query = \"delete from jnjn_comment where username = '$username'\";\n\t\t\tif($con -> query($query)){\n\t\t\t\treturn SUCCESS;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn FAIL;\n\t\t}\n\t\telse\n\t\t\treturn FAIL;\n\t}\n\telse\n \t\treturn FAIL;\n }" ]
[ "0.76457405", "0.7013172", "0.6974841", "0.6775493", "0.67704713", "0.67443913", "0.65435946", "0.65435946", "0.64849", "0.64789796", "0.64669096", "0.64368284", "0.6370967", "0.6355791", "0.63540024", "0.63539404", "0.62862056", "0.6246455", "0.6229506", "0.62198025", "0.6217717", "0.62150216", "0.62123054", "0.62111527", "0.6192371", "0.61866605", "0.6185661", "0.61627525", "0.60756487", "0.607386", "0.60376513", "0.60376513", "0.6031529", "0.603023", "0.59991455", "0.59964615", "0.598565", "0.5981251", "0.5962921", "0.5960939", "0.5957756", "0.59524345", "0.5942856", "0.5916775", "0.5914245", "0.5914204", "0.59130764", "0.590578", "0.5901943", "0.5898866", "0.58882457", "0.58837277", "0.5864044", "0.58582133", "0.5847558", "0.58472973", "0.5841263", "0.5810015", "0.5810015", "0.5809486", "0.58089983", "0.5808581", "0.5803839", "0.57862186", "0.57836014", "0.57644635", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57609713", "0.57607466", "0.57416594", "0.5720243", "0.57187563", "0.5713299", "0.57067657", "0.5706551", "0.56961817", "0.5693591", "0.5691981", "0.56897134", "0.56873107", "0.568352", "0.5668423", "0.56604195", "0.5659769", "0.56592256", "0.5656421", "0.5654527" ]
0.7174635
1
This is a helpping method to call CURL POST request with the user name and password.
private function curl_post($url, $data) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_POSTFIELDS,$data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function curl_post($url, $postfields=array(), $headers=array(), $auth=array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n if(!empty($auth['username']) && !empty($auth['password'])) {\n curl_setopt($ch, CURLOPT_USERPWD, $auth['username'].\":\".$auth[\"password\"]);\n }\n return curl_exec($ch);\n}", "function Curl_Post_Login($url, $params = array()) {\n $data_string = json_encode($params);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n\n $result = curl_exec($ch);\n return $result;\n }", "function api_post($url, array $post_contents, $username = null, $password = null)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_contents));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n if ($username != NULL) {\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, \"{$username}:{$password}\");\n }\n return $this->gather_response($ch);\n }", "function authenticate_user_post ($data) {\n \n $url = 'https://test-superdogy92.c9.io/php/validateuser.php';\n $options = array(\n 'http' => array(\n 'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",\n 'method' => 'POST',\n 'content' => http_build_query($data),\n ),\n );\n \n $context = stream_context_create($options);\t#reading from options\n $result = file_get_contents($url, false, $context);\t#same as doing a post in the browser\n return $result;\n }", "function call($postfields) {\r\n\t\t$postfields[\"username\"] = $this->api_user;\r\n\t\t$postfields[\"password\"] = md5($this->api_pass);\r\n\r\n\t\t// Make curl request\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_url);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 100);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t// Format response\r\n\t\t$data = explode(\";\",$data);\r\n\t\tforeach ($data AS $temp) {\r\n\t\t $temp = explode(\"=\",$temp);\r\n\t\t $key = trim($temp[0]);\r\n\t\t $value = trim($temp[1]);\r\n\t\t $results[$key] = $value;\r\n\t\t}\r\n\t\t\r\n\t\t// Returns array with response\r\n\t\treturn $results;\r\n\t}", "public function loginRequest()\n {\n $response = $this->client->request('POST', $this->url, [\n 'json' => $this->body,\n 'headers' => $this->headers\n ]);\n return $response;\n\n }", "function loginRequest( $logintoken ) {\n global $cookies;\n global $endPoint;\n global $user;\n global $password;\n\n $params2 = [\n \"action\" => \"login\",\n \"lgname\" => $user,\n \"lgpassword\" => $password,\n \"lgtoken\" => $logintoken,\n \"format\" => \"json\"\n ];\n\n $ch = curl_init();\n\n curl_setopt( $ch, CURLOPT_URL, $endPoint );\n curl_setopt( $ch, CURLOPT_POST, true );\n curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $params2 ) );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookies );\n curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookies );\n\n $output = curl_exec( $ch );\n curl_close( $ch );\n}", "public function login_post(){\n\t\t$data=($_POST);\n\n\t\t$result = $this->login_model->login($data);\n\t\treturn $this->response($result);\t\t\t\n\t}", "function postRequest( $url, $fields, $optional_headers = null ) {\n\t\t// http_build_query is preferred but doesn't seem to work!\n\t\t// $fields_string = http_build_query($fields, '', '&', PHP_QUERY_RFC3986);\n\t\t\n\t\t// Create URL parameter string\n\t\tforeach( $fields as $key => $value )\n\t\t\t$fields_string .= $key.'='.$value.'&';\n\t\t\t\n\t\t$fields_string = rtrim( $fields_string, '&' );\n\n//\t\techo \"controlKey.php : postRequest() : URL = $url\";\n//\t\techo \"controlKey.php : postRequest() : Fields_string = $fields_string\";\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, TRUE);\n\t\tcurl_setopt( $ch, CURLOPT_POST, count( $fields ) );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $fields_string );\n\t\t\n\t\t$result = curl_exec( $ch );\n\t\t\n\t\tcurl_close( $ch );\n\t}", "public function login()\n {\n $loginPostArray = $this->_getLoginPostArray();\n \n // Reset the client\n //$this->_client->resetParameters();\n \n // To turn cookie stickiness on, set a Cookie Jar\n $this->_client->setCookieJar();\n \n // Set the location for the login request\n $this->_client->setUri($this->_login_endPoint);\n \n // Set the post variables\n foreach ($loginPostArray as $loginPostKey=>$loginPostValue) {\n $this->_client->setParameterPost($loginPostKey, $loginPostValue);\n }\n \n // Submit the reqeust\n $response = $this->_client->request(Zend_Http_Client::POST);\n }", "private function loginToWigle() {\n\t\t$this->sendCurlRequest(self::WIGLE_LOGIN_URL,array(\"credential_0\"=>$this->user,\"credential_1\"=>$this->password));\n }", "public function _POST($url, $params = null, $username = null, $password = null, $contentType = null)\n {\n $response = $this->call($url, 'POST', $params, $username, $password, $contentType);\n //$this->convertEncoding($response,'utf-8',$this->_encode)\n return $this->json_foreach($this->parseResponse($response));\n }", "public function DataPost_post()\n {\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n \n if(empty($username) || empty($password))\n\t\t{\t\t\t\n\t\t\t$this->response( [\n 'status' => RestController::HTTP_NOT_FOUND,\n 'message' => 'Please Enter All Fields.'\n ], RestController::HTTP_NOT_FOUND );\n }\n else\n {\n $username = $this->input->post('username');\n $password = $this->input->post('password');\n //call Model Function .... \n $this->response( [\n 'status' => RestController::HTTP_OK,\n 'message' => 'Data Post Successfully.'\n ], RestController::HTTP_OK ); \n }\n }", "function httpPOST($url, $data)\n{\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n return $response;\n}", "public function curlPostCall( $url, $postData ) \n {\n // prx($postData);\n $fields = array();\n foreach ($postData as $postKey => $postVal){\n $fields[$postKey] = urlencode($postVal);\n }\n //url-ify the data for the POST\n foreach($fields as $key=>$value) { \n $fields_string .= $key.'='.$value.'&';\n }\n \n rtrim($fields_string, '&');\n\n try\n {\n // $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n //curl_setopt($ch,CURLOPT_POST, count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //execute post\n $result = curl_exec($ch);\n \n //close connection\n curl_close($ch);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n \n $responseArr = json_decode($result, true);\n return $responseArr;\n }", "public function curlpost($url, $data)\n {\n\n $host = $url;\n // echo $host;exit;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $host);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n //curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n //var_dump(curl_error($ch));\n $res = curl_exec($ch);\n curl_close($ch);\n return $res;\n }", "private function doLoginWithPostData() {\r\n\t\tif ($this->checkLoginFormDataNotEmpty()) {\r\n\t\t\r\n\t\t\t/**\r\n\t\t\t * Generate access token using Agave API\r\n\t\t\t */\r\n\t\t\t \r\n\t\t\t$ch = curl_init();\r\n\r\n\t\t\t$pf = \"grant_type=password&username=\".$_POST['user_name'].\"&password=\".$_POST['user_password'].\"&scope=PRODUCTION\";\r\n\t\t\t$key_and_secret = $this->key.\":\".$this->secret;\r\n\t\t\t$encoding = \"Content-Type: application/x-www-form-urlencoded\";\r\n\t\t\t\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://agave.iplantc.org/token\");\r\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $pf);\r\n\t\t\tcurl_setopt($ch, CURLOPT_USERPWD, $key_and_secret);\r\n\t\t\tcurl_setopt($ch, CURLOPT_ENCODING, $encoding);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t\t\r\n\t\t\t$response = curl_exec($ch);\r\n\t\t\t$response_arr = json_decode($response, true);\r\n\t\t\t$_SESSION['access_token'] = $response_arr['access_token'];\r\n\t\t\t\r\n\t\t\tcurl_close ($ch);\r\n\t\t\t/**\r\n\t\t\t * Get Login info using access token\r\n\t\t\t */\r\n\t\t\t \r\n\t\t\t$ch = curl_init();\r\n\t\t\t$data = array(\"Authorization: Bearer \".$_SESSION['access_token']);\r\n\t\t\t$url = \"https://agave.iplantc.org:443/profiles/v2/\".$_POST['user_name'];\r\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $data);\r\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\r\n\t\t\t\t\t\t\r\n\t\t\t$response = curl_exec($ch);\r\n\t\t\tcurl_close ($ch);\r\n\t\t\t$response_arr = json_decode($response, true);\r\n\t\t\t\r\n\t\t\tif($response_arr['status'] == \"success\"){\r\n\t\t\t\t$user_info = $response_arr['result'];\r\n\t\t\t\t$_SESSION['user_name'] = $user_info['username'];\r\n\t\t\t\t$_SESSION['user_email'] = $user_info['email'];\r\n\t\t\t\t$this->user_is_logged_in = true;\r\n\t\t\t\t$_SESSION['user_is_logged_in'] = true;\r\n\t\t\t} else {\r\n\t\t\t\t$this->feedback = \"Invalid Username or Password \";//.$_SESSION['access_token'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n }", "public function login_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\t\t$array['password'] = hash('sha512', $this->post('password'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else if (empty($array['password'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Password is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$data = $this->api_model->login($array);\n\t\t\t\t$auth_code = $this->createAuthorizationCode($data->id);\n\t \t$is_auth_code_valid = (new Authorization_codes_model)->isValid($auth_code->code);\n\t\t if (!$is_auth_code_valid) {\n\t\t $this->response(['status' => FALSE, 'error' => ['Invalid Authorization Code.']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t }\n\n\t \t$accesstoken = $this->createAccesstoken($auth_code->code);\n\n\t\t\t\tif (empty($data)) {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or password is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t} else {\n\t\t\t\t\t$result = array(\n\t\t\t\t\t\t'user_id' => (int) $data->id,\n\t\t\t\t\t\t'username' => $data->username,\n\t\t\t\t\t\t'email' => $data->email,\n\t\t\t\t\t\t'access_token' => $accesstoken->token,\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'Login successful.', 'user_details' => $result], REST_Controller::HTTP_OK);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "function doPost($url, $post = array() , $format = 'plain')\n{\n return curlExecute($url, 'post', $post, $format);\n}", "public function postCurlCall($url, $post_params){\n return $this->utilities->curlPost($url, $post_params);\n }", "function login($url,$data){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($ch, CURLOPT_CAINFO, getcwd().'/cacert.pem');\n curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . \"/cookies.txt\");\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n ob_start(); // prevent any output\n return curl_exec ($ch); // execute the curl command\n ob_end_clean(); // stop preventing output\n curl_close ($ch);\n //unset($ch);\n}", "function sendPost($api, $key, $user, $name, $description) {\r\n $data = http_build_query(array('key'=>$key,\r\n 'user'=>$user,\r\n 'name'=>$name,\r\n 'desc'=>$description,\r\n 'src'=>'sdk-php-1.0')); // management internal parameter\r\n $context = stream_context_create(array('http'=>array(\r\n 'method'=>'POST',\r\n 'header'=>\r\n 'Content-type: application/x-www-form-urlencoded'.\"\\r\\n\".\r\n 'Content-Length: '.strlen($data).\"\\r\\n\",\r\n 'content'=>$data)));\r\n \r\n $fd = fopen($api, 'r', false, $context);\r\n $response = stream_get_contents($fd);\r\n fclose($fd);\r\n return $response;\r\n}", "function send_request($postdata = \"\") {\n\t\tif(!is_array($postdata) ) $postdata = array();\n\t\t\n\t\t$url = $this->_build_url();\n\t\t\n\t\tif(!isset($postdata['ip_address'])) $postdata['ip_address'] = $this->_get_client_ip();\n\t\tif(!isset($postdata['user_agent'])) $postdata['user_agent'] = $this->_get_client_user_agent();\n\t\t$postdata['api_key'] = $this->api_key;\n\n\t\t$ch = curl_init($url);\n\n\t\tcurl_setopt($ch, CURLOPT_POST ,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, 'json='.$this->_json_encode($postdata));\n\t\tcurl_setopt($ch, CURLOPT_HEADER ,0); \n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER ,1);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT ,10);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\t\t\n\n\t\t$return_data = curl_exec($ch);\n\n\t\treturn $return_data;\n\t}", "function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}", "function request(string $url, string $fields = '', int $isPost = 0)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, $isPost);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n if ($isPost) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n }\n $requestHeaders = array(\n 'Content-type: application/x-www-form-urlencoded',\n 'Content-Length: ' . strlen($fields),\n );\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n return curl_exec($ch);\n}", "function curl_post($url, array $post = NULL, array $options = array())\n{\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch))\n {\n echo \"curl_exec failed \" . $url;\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "private function login(): void\n {\n try {\n $promise = $this->client->requestAsync('POST', 'https://api.jamef.com.br/login',\n ['json' => ['username' => $this->username, 'password' => $this->password]]\n )->then(function ($response) {\n $json = json_decode($response->getBody());\n $this->token = $json->access_token;\n });\n $promise->wait();\n } catch (RequestException $e) {\n $this->result->status = 'ERROR';\n $this->result->errors[] = 'Curl Error: ' . $e->getMessage();\n }\n }", "function web_hook_post($url, $fields) {\n // url-ify the data for the POST\n foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n rtrim($fields_string,'&');\n\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return ($result);\n}", "function h_POST(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n $payload = json_encode($data);\n\n // Prepare new cURL resource\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLINFO_HEADER_OUT, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);\n \n // Set HTTP Header for POST request \n curl_setopt(\n $ch,\n CURLOPT_HTTPHEADER,\n [\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($payload)\n ]\n );\n \n // Submit the POST request\n $response = curl_exec($ch);\n curl_close($ch);\n\n return $response;\n}", "public function create_user_key() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "private function initPostRequest()\n {\n $this\n ->addCurlOption(CURLOPT_URL, $this->getUrl())\n ->addCurlOption(CURLOPT_CUSTOMREQUEST, HttpMethodResolver::HTTP_POST)\n ->addCurlOption(CURLOPT_POSTFIELDS, $this->getQuery())\n ;\n }", "function curl_post($url, array $post = NULL, array $options = array()) {\n\t\t$this->curlError = 0;\n\t $defaults = array(\n\t CURLOPT_POST => 1,\n\t CURLOPT_HEADER => 0,\n\t CURLOPT_URL => $url,\n\t CURLOPT_FRESH_CONNECT => 1,\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_FORBID_REUSE => 1,\n\t CURLOPT_TIMEOUT => 4,\n\t CURLOPT_POSTFIELDS => $this->decodeParamsIntoGetString($post),\n\t\t\tCURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT']\n\t );\n\t \n\t $this->logMessage(\"Posting to: \".$this->decodeParamsIntoGetString($post));\n\t\t\n\t $ch = curl_init();\n\t curl_setopt_array($ch, ($options + $defaults));\n\t if( !$result = curl_exec($ch))\n\t { \n\t // trigger_error(curl_error($ch));\n\t \t$this->curlError = curl_error($ch);\n\t \treturn false;\n\t }\n\t else {\n\t \treturn $result;\n\t \n\t \t} \t\n\t}", "public function post($url, $body = array(), $query = array(), $headers = array());", "protected function _sendRemoteRequest($url, $username, $email)\n\t{\n\t\t$url .= Core::getLang()->getOpt(\"langcode\").\"/password/request\";\n\t\t$request = new Recipe_HTTP_Request($url, \"Curl\");\n\t\t$request->getSession()\n\t\t\t->setRequestType(\"POST\")\n\t\t\t->setPostArgs(array(\"username\" => $username, \"email\" => $email));\n\t\tterminate($request->getResponse());\n\t\treturn $this;\n\t}", "protected function execCurl() \n\t{\t\t\t\n\t\tif ( $this->sandbox == true )\n\t\t{\n\t\t\t$server = $this->_server['sandbox'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$server = $this->_server['live'];\n\t\t}\n\n\t\t$url = $server . $this->adhocPostUrl;\n\t\t\n\t\t$headers = array(\n\t\t\t'Content-type: application/x-www-form-urlencoded',\n\t\t\t'Authorization: GoogleLogin auth=' . $this->getAuthToken(),\n\t\t\t'developerToken: ' . $this->developerToken,\n\t\t\t'clientCustomerId: ' . $this->clientCustomerId,\n\t\t\t'returnMoneyInMicros: true',\n\t\t\t\t\t\t\n\t\t);\n\n\t\t$data = '__rdxml=' . urlencode( $this->__rdxml );\n\t\t\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $data );\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HEADER, FALSE );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, TRUE );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );\n\t\t\n\t\t$response = curl_exec( $ch );\n\t\t$httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\t$error = curl_error( $ch );\n\t\tcurl_close( $ch );\n\t\t\n\t\tif( $httpCode == 200 || $httpCode == 403 )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( !empty( $error ) )\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - ' . $error );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new exception( $httpCode . ' - Unknow error occurred while post operation.' ); \n\t\t\t}\n\t\t}\n\t}", "public function usePost()\n {\n $this->setOption(CURLOPT_POST, true);\n }", "function curl_post($url, array $post = NULL, array $headers = NULL, array $options = array()) {\n $defaults = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($post)\n );\n\n $_defaults = defaults;\n \n $ch = curl_init();\n curl_setopt_array($ch, ($options + $defaults));\n if( ! $result = curl_exec($ch)) {\n trigger_error(curl_error($ch));\n }\n curl_close($ch);\n return $result;\n}", "function post_to_ilevel($url, $user, $password, $body) {\n\n\t// Set the arguments for the query\n\t$args = array(\n\t\t'method' => 'POST',\n\t\t'headers' => array(\n\t\t\t'Authorization' => 'Basic ' . base64_encode( $user . ':' . $password )\n\t\t\t),\n\t\t'httpversion' => '1.0',\n 'sslverify' => true,\n 'body' => $body\n\t\t);\n\n\t// Make the query, using the URL and arguments\n\t$response = wp_remote_get( $url, $args );\n\n\t// If the query returns an error, exit early\n\tif( is_wp_error( $response ) ) {\n\t\treturn false;\n\t}\n\n\t// Retrieve the body from the returned data\n\t$response_body = wp_remote_retrieve_body( $response );\n\n\t// Decode the response_body so we can access its values\n\t// $json = json_decode($response_body, true);\n\n\t// Log the body in the error log\n\t// error_log('response_status: '.$json['response_status']);\n\t// error_log('type: '.gettype($response_body));\n\n\twp_mail('[email protected]', 'i.LEVEL RetailOrder Response', $response_body);\n\n\t// Return the response body\n\treturn $body;\n\n}", "public function postData(){\n\t\t$url = $this->host . \"/rest/v1/leads.json?access_token=\" . $this->getToken();\n\t\t$ch = curl_init($url);\n\t\t$requestBody = $this->bodyBuilder();\n\t\t//debug\n\t\t//print_r($requestBody);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);\n\t\tcurl_getinfo($ch);\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "public function testPostUserCreateNewUserWithEmailUsernamePassword()\n {\n $userPayload = [\n 'email' => '[email protected]',\n 'username' => 'new_user',\n 'plain_password' => 'new_password',\n ];\n $this->performPostUser($userPayload);\n $this->assertAcceptedSuccess();\n $this->assertUserCreated('new_user');\n }", "protected function login() {\n\t\t\t\n\t\t\t// Generate the login string\n\t\t\t$loginString = str_replace( array('{USER}', '{PASS}'), array( $this->user, $this->pass), $this->loginString );\n\t\t\t\n\t\t\t// Send the login data with curl\n\t\t\t$this->c->{$this->loginMethod}($this->loginUrl, $loginString);\n\t\t\t\n\t\t\t// Check if the login worked\n\t\t\tif($this->is_logged_in()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdie('Login failed');\n\t\t\t}\n\t\t\t\n\t\t}", "function make_post_call($mid_url, $post_values) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($post_values));\n \n $output = curl_exec($curl);\n curl_close($curl);\n \n return $output;\n }", "function post($request, $key=VANCO_KEY, $session = FALSE, $user_id = VANCO_USER_ID, $password = VANCO_PASSWORD) {\n ##Data Post\n $request_id = generateRequestID();\n $postfields = array('nvpvar' => \"$request&requestid=$request_id\");\n #echo $postfields['nvpvar'].\"<br>\";\n if($session) { #Only used if the post needs a sessionid as specified by VANCO's API\n $postfields['sessionid'] = open_session($user_id, $password, $key);\n }\n $result = new_post($postfields, VANCO_WSNVP);\n $result = str_replace('nvpvar=', '', $result);\n try {\n $result = my_unpack($result, $key);\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"<BR>\\n\";\n }\n parse_str($result, $value);\n if($request_id != $value['requestid']) {\n throw new Exception(\"Invalid requestid returned by server. Original id: '$request_id', response: '$result'\");\n }\n return $value;\n}", "function login_post()\n {\n if(!$this->post('user') || !$this->post('pass')){\n $this->response(NULL, 400);\n }\n\n $this->load->library('authentication');\n $array = array(\n 'user' => $this->post('user'),\n 'pass' => $this->post('pass')\n );\n $auth_result = $this->authentication->authenticate($array);\n \n if($auth_result['success'] == 1){\n $this->response(array('status' => 'success'));\n }else{\n $this->response(array('status' => 'failed'));\n }\n }", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}", "protected function sendCURL($trans){\n\t\n\t\tConfigure::load('payscape');\n\t\t$trans['username'] = Configure::read('Payscape.userid');\n\t\t$trans['password'] = Configure::read('Payscape.userpass');\n\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, self::url);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $trans);\n\t\tcurl_setopt($ch, CURLOPT_REFERER, \"\");\n\t\n\t\t/* gateway SSL certificate options for Apache on Windows */\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\t\n\t\tcurl_setopt($ch, CURLOPT_CAINFO, getcwd() . \"/crt/cacert.pem\");\n\t\n\t\t$outcome = curl_exec($ch);\n\t\n\t\t/* display cURL errors */\n\t\tif(curl_errno($ch)){\n\t\t\tdie('Could not send request: ' .curl_error($ch));\n\t\t\texit();\n\t\t}\n\t\n\t\tcurl_close($ch);\n\t\tunset($ch);\n\t\t\t\n\t\treturn $outcome;\n\t\n\t}", "private function perform_request($fields){\r\n curl_setopt($this->ch,CURLOPT_POST,count($fields));\r\n curl_setopt($this->ch,CURLOPT_POSTFIELDS,$fields);\r\n\r\n //execute post\r\n $result = curl_exec($this->ch);\r\n if($result === false){\r\n throw new ApiCurlException(curl_error($this->ch));\r\n }\r\n return $result;\r\n }", "public function https_post($url, $data = [] , $is_raw = false){\n// $this->response = $curl->post($url , $data , $is_raw)\n// ->setHeader('X-Requested-With', 'XMLHttpRequest')\n// ->setHeader(\"Accept\" , 'application/json')\n// ->setHeader('Content-Type' , 'application/json')\n// //->setOpt(CURLOPT_PROXY , '127.0.0.1:8888')\n// ->response;\n\n $header = [\n 'Accept:application/json' , 'Content-Type:application/json'\n ];\n $this->response = $this->https_request($url , json_encode($data ) , $header);\n\n return $this;\n }", "function loginRequest( $logintoken ) {\n\tglobal $endPoint;\n\n\t$params2 = [\n\t\t\"action\" => \"clientlogin\",\n\t\t\"username\" => \"username\",\n\t\t\"password\" => \"password\",\n\t\t'loginreturnurl' => 'http://127.0.0.1:5000/',\n\t\t\"logintoken\" => $logintoken,\n\t\t\"format\" => \"json\"\n\t];\n\n\t$ch = curl_init();\n\n\tcurl_setopt( $ch, CURLOPT_URL, $endPoint );\n\tcurl_setopt( $ch, CURLOPT_POST, true );\n\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $params2 ) );\n\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $ch, CURLOPT_COOKIEJAR, \"cookie.txt\" );\n\tcurl_setopt( $ch, CURLOPT_COOKIEFILE, \"cookie.txt\" );\n\n\t$output = curl_exec( $ch );\n\tcurl_close( $ch );\n\n}", "private function _httpPost($fields)\n {\n $fields_string = http_build_query($fields);\n //open connection\n $ch = curl_init();\n\n //set the url, number of POST vars, POST data\n curl_setopt($ch,CURLOPT_URL,$this->_getFullUrl());\n curl_setopt($ch,CURLOPT_POST,count($fields));\n curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n //execute post\n $result = curl_exec($ch);\n\n //close connection\n curl_close($ch);\n\n return $result;\n }", "function qt_post($protocol,$host,$uri,$auth,$parms,$encoding)\n{\n $url = \"$protocol://$host\";\n if (strlen($uri))\n $url .= $uri;\n\n $post = '';\n if ( strtoupper($encoding) == 'URL' )\n {\n foreach($parms as $k => $v)\n $post .= $k . '=' . $v . '&';\n $post = rtrim($post,'&');\n }\n if ( strtoupper($encoding) == 'JSON' )\n {\n $post = json_encode($parms);\n }\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n curl_setopt($ch, CURLOPT_USERAGENT, 'phpAPI');\n\n qt_curl_header('','',1);\n qt_curl_code('',1);\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, \"qt_curl_header\");\n if ( strlen($auth) )\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER,array(\"Authorization: $auth\"));\n echo \"auth: $auth<br>\\n\";\n }\n\n $out = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n qt_curl_code($httpCode);\n curl_close($ch);\n \n return $out;\n}", "public function testPostUserAction201()\n {\n $rand_num = mt_rand(0, 1000000);\n $nombre = 'Nuevo UsEr POST * ' . $rand_num;\n $p_data = [\n 'username' => $nombre,\n 'email' => 'email' . $rand_num . '@example.com',\n 'password' => 'P4ssW0r4 Us3r P0ST * ñ?¿ áËì·' . $rand_num,\n 'enabled' => mt_rand(0, 2),\n 'isAdmin' => mt_rand(0, 2)\n ];\n\n // 201\n self::$_client->request(\n Request::METHOD_POST, self::RUTA_API,\n [], [], [], json_encode($p_data)\n );\n $response = self::$_client->getResponse();\n self::assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n self::assertTrue($response->isSuccessful());\n self::assertJson($response->getContent());\n $user = json_decode($response->getContent(), true);\n\n return $user['user'];\n }", "function testSimplePost() {\n \n $curlAdapter = new CurlAdapter();\n \n $post = array (\n 'SECURITY.SENDER' => '31HA07BC8142C5A171745D00AD63D182',\n 'USER.LOGIN' => '31ha07bc8142c5a171744e5aef11ffd3',\n 'USER.PWD' => '93167DE7',\n 'TRANSACTION.MODE' => 'CONNECTOR_TEST',\n 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865',\n 'PAYMENT.CODE' => 'CC.RG',\n 'FRONTEND.MODE' => 'WHITELABEL',\n 'FRONTEND.ENABLED' => 'TRUE',\n 'FRONTEND.LANGUAGE' => 'EN',\n 'FRONTEND.RESPONSE_URL' => 'http://dev.heidelpay.de',\n 'CONTACT.IP' => '127.0.0.1',\n 'REQUEST.VERSION' => '1.0'\n \n );\n \n $result = $curlAdapter->sendPost('https://test-heidelpay.hpcgw.net/ngw/post', $post);\n \n \n $this->assertTrue(is_array($result[0]), 'First result key should be an array.');\n $this->assertTrue(is_object($result[1]), 'Secound result key should be an object.');\n \n \n $this->assertFalse($result[1]->isError(), 'isError should return true');\n $this->assertTrue($result[1]->isSuccess(), 'isSuccess should return false');\n \n }", "function httpPOST($url, array $data, $headers = '') {\n $this->ensureOpened(__FUNCTION__);\n $query = http_build_query($data, '', '&');\n ($headers = trim($headers) === '') or $headers .= \"\\r\\n\";\n\n $headers = \"POST $url HTTP/1.0\\r\\n\".\n $headers.\n \"Content-Type: application/x-www-form-urlencoded\\r\\n\".\n \"Content-Length: \".strlen($query).\"\\r\\n\".\n \"$query\\r\\n\";\n\n $this->write($headers);\n return $this->readAllAndClose();\n }", "public function createUser($request) {\n $response = $this->client->request('POST', 'user', [\n 'body' => $request,\n 'form_params' => [\n 'name' => $request->input('name'),\n 'email' => $request->input('email'),\n 'password'=> md5($request->input('password'))\n ]\n ]);\n \n return $response;\n }", "static function login($url, $user, $pass) {\n $response = Gallery3_Helper::request(\n \"post\", $url, null, array(\"user\" => $user, \"password\" => $pass));\n return $response;\n }", "function wechat_php_curl_https_post($url, $postfields, $ct = '')\n{\n //$postfields = array('field1'=>'value1', 'field2'=>'value2');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n // Edit: prior variable $postFields should be $postfields;\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n if($ct == 'json'){\n curl_setopt($ch, CURLOPT_HTTPHEADER,\n array('Content-Type: application/json',\n 'Content-Length: ' . strlen($postfields),\n )); \n }\n\n //Keep this code to remind me use it for some chinese character just in case\n if($ct == 'utf-8'){\n curl_setopt($ch, CURLOPT_HTTPHEADER,\n array('Content-Type: text/xml; charset=utf-8', \n 'Content-Length: ' . strlen($postfields),\n )); \n }\n\n $result = curl_exec($ch);\n\n if(curl_errno($ch))\n {\n curl_close($ch);\n return NULL;\n }\n\n curl_close($ch);\n return $result;\n}", "private function submitRequest($url, $data) { \n\t\t$accessToken = $this->getAccessToken();\n\t\tif($accessToken == '' || $accessToken == FALSE) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Authorization: Bearer '.$accessToken));\n\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\n\t\treturn $response;\n\t}", "function login() {\n $token = $this->getchallenge();\n $curl = curl_init();\n// $accesskey = '55kt1mJbtDFpsw1t';\n// $accessKey = md5($token + $accesskey);\n// echo $token;\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://develop.datacrm.la/datacrm/pruebatecnica/webservice.php\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => \"operation=login&username=prueba&accessKey=\" . $token,\n CURLOPT_HTTPHEADER => array(\n \"Accept: */*\",\n \"Accept-Encoding: gzip, deflate\",\n \"Cache-Control: no-cache\",\n \"Connection: keep-alive\",\n \"Content-Length: 74\",\n \"Content-Type: application/x-www-form-urlencoded\",\n \"Host: develop.datacrm.la\",\n \"Postman-Token: 3b714da7-abbd-4fd6-8e8b-0afa4d40bde2,5bd84e36-16d2-4609-b2af-58b243590dd6\",\n \"User-Agent: PostmanRuntime/7.19.0\",\n \"cache-control: no-cache\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $arrayJson = json_decode($response);\n// $sessionName = $arrayJson->result->sessionName;\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo $response; \n }\n }", "private function executePost(Visio\\Http\\CurlRequest $curl) {\n if (!is_string($this->requestBody)) {\n $this->buildPostBody();\n }\n\n $curl->setOption(CURLOPT_POSTFIELDS, $this->requestBody);\n $curl->setOption(CURLOPT_POST, 1);\n\n $this->doExecute($curl);\n }", "public function login_post()\n\t{\n\t\t$name = $this->post('username',true);\n $pass = $this->post('password',true);\n\n $user = $this->db->get_where('user',['username' =>$name])->row_array();\n\n if ($user) \n {\n if (password_verify($pass,$user['password'])) \n {\n $this->response([\n 'error' => false,\n 'message' => 'Login successfull',\n 'user' => $user\n ],200);\n }\n else\n {\n $this->response([\n 'error' => true,\n 'message' => 'Password salah'\n ],200);\n }\n }\n else\n {\n $this->response([\n\n 'error'=>true,\n 'message'=>\"Username dan Password salah\"\n ],200);\n }\n\t}", "function Send($url, $POST){ //работа с CURL'ом\n\t$ch = curl_init();// Устанавливаем соединение\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $POST);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\n\t$result = curl_exec($ch);\n\n\tif($result === false) print $err = curl_error($ch);\n\n\treturn $result;\n}", "public function request() {\r\n\t\t$this->verbose('protocol', $this->protocol);\r\n\t\t$this->verbose('method', $this->method);\r\n\t\t$this->verbose('host', $this->host);\r\n\t\t$this->verbose('path', $this->path);\r\n\t\t$this->verbose('query', $this->query);\r\n\t\t$this->verbose('headers', $this->headers);\r\n\t\t$this->verbose('body', $this->body);\r\n\t\t$this->verbose('timeout', $this->timeout);\r\n\r\n\t\t$this->addQueryToPath();\r\n\t\t$this->verbose('path + query', $this->path);\r\n\t\t$this->cleanHost();\r\n\t\t$this->verbose('cleanHost', $this->host);\r\n\r\n\t\t$url = $this->protocol . '://' . $this->host . $this->path;\r\n\t\t$this->verbose('url', $url);\r\n\r\n\t\t$this->headers['Authorization'] = $this->makeAuthHeader();\r\n\r\n\r\n\t\tforeach ($this->headers as $header_key => $header_value) {\r\n\t\t\t$header_array[] = $header_key . \":\" . $header_value;\r\n\t\t}\r\n\r\n\t\t$ch = curl_init();\r\n\t\t$options = array(\r\n\t\t\tCURLOPT_URL => $url,\r\n\t\t\tCURLOPT_RETURNTRANSFER => 1,\r\n\t\t\tCURLOPT_CUSTOMREQUEST => $this->method,\r\n\t\t\tCURLOPT_POSTFIELDS => $this->body,\r\n\t\t\tCURLOPT_HEADER => false,\r\n\t\t\tCURLINFO_HEADER_OUT => true,\r\n\t\t\tCURLOPT_HTTPHEADER => $header_array,\r\n\t\t\tCURLOPT_TIMEOUT => $this->timeout\r\n\t\t);\r\n\t\tcurl_setopt_array($ch, $options);\r\n\r\n\t\t$this->verbose('body at exec', $this->body);\r\n\t\t$response_body = curl_exec($ch);\r\n\t\t$response_error = curl_error($ch);\r\n\t\t$response_headers = curl_getinfo($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$response['error'] = $response_error;\r\n\t\t$response['body'] = $response_body;\r\n\t\t$response['header'] = $response_headers;\r\n\t\treturn $response;\r\n\t}", "function postDataToUrl($url, $data) {\r\n $curl = curl_init();\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 1);\r\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8'));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($curl, CURLOPT_VERBOSE, 0);\r\n curl_setopt($curl, CURLOPT_HEADER, 1);\r\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\r\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n $response = curl_exec ($curl);\r\n curl_close ($curl);\r\n\treturn $response;\r\n}", "private function create_curl($s_url, $post_params = array() )\n\t{\n\n\t\t$full_url = $this->settings['server'];\n if ($this->settings['port'] != '80') $full_url .= ':' . $this->settings['port'];\n $full_url .= $s_url ;\n\n\t\t$this->log( 'curl_init( ' . $full_url . ' )' );\n\t\t\n $post_value = Centrifuge::array_implode( '=', '&', $post_params );\n \n\t\t# Set cURL opts and execute request\n\t\t$ch = curl_init();\n\t\tif ( $ch === false )\n\t\t{\n\t\t\tthrow new CentrifugeException('Could not initialize cURL!');\n\t\t}\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $full_url );\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array ( \"Content-type: application/x-www-form-urlencoded\" ) );\t\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $this->settings['timeout'] );\n\t\t\n $this->log( 'trigger POST: ' . $post_value );\n\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $post_value );\n \n\t\treturn $ch;\n\t}", "function post($url,$fields){\n curl_setopt($this-> ch,CURLOPT_POST,1);\n curl_setopt($this-> ch,CURLOPT_POSTFIELDS,$fields);\n curl_setopt($this-> ch,CURLOPT_URL,$url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, COOKIE_FILE); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION,true);\n // 返回跳转后的页面 如果只提交表单,则返回1表示成功\n return $this-> html = curl_exec($this-> ch);\n }", "public function testLoginPost()\n\t{\n\t\t$request = $this->getMockedRequest();\n\t\t$request->server->set('REQUEST_METHOD', 'POST');\n\t\t$userbaseController = new UserbaseController($request);\n\t\t$result = $userbaseController->loginAction();\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(401, $result['returnCode']);\n\t}", "public function loginprofesor_post() //INICIAR SESION = http://localhost/foxweb/Api/login\n {\n $matricula = $this->post('matricula');\n $password = $this->post('password');\n $type = $this->post('type');\n\n $datauser = $this->ApiModel->flogin($matricula, $password, $type);\n\n if ($datauser != false) {\n foreach ($datauser as $data) {\n $matricula = $data['matricula'];\n $nombre = $data['nombre'];\n $apellidos = $data['apellidos'];\n }\n\n $response = ['error' => false, 'status' => parent::HTTP_OK, \"matricula\" => $matricula, \"nombre\" => $nombre, \"apellidos\" => $apellidos];\n\n $this->response($response, parent::HTTP_OK);\n\n } else {\n\n $response = ['error' => true,'status' => parent::HTTP_NOT_FOUND, 'msg' => 'Usuario o Contraseña Invalidos!'];\n\n $this->response($response, parent::HTTP_NOT_FOUND);\n\n }\n }", "public function loginPostAction() {\r\n\t\t$email = $this->getRequest()->getPost('email', false);\r\n\t\t$password = $this->getRequest()->getPost('password', false);\r\n\t\t\r\n\t\t$error = '';\r\n\t\tif ($email && $password) {\r\n\t\t\ttry {\r\n\t\t\t\t$this->_getCustomerSession()->login($email, $password);\r\n\t\t\t}\r\n\t\t\tcatch(Exception $ex) {\r\n\t\t\t\t$error = $ex->getMessage();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$result = array();\r\n\t\t$result['error'] = $error;\r\n\t\tif ($error == '') $result['success'] = true;\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}", "public function postAuth(Request $request) {\n\t\tif (!$request->isJson())\n\t\t\treturn;\n\n\t\t$req = $request->json()->all();\n\t\tif (!isset($req['mac'], $req['usermac'], $req['redir'], $req['gatewayip'], $req['access_token'])) {\n\t\t\treturn;\n\t\t}\n\t\t$cfg = self::getDevConfig($req['mac']);\n\t\tif (!$cfg || $cfg['access_token'] != $req['access_token']) {\n\t\t\treturn response()->json(['success'=>false]);\n\t\t}\n\t\t$token = self::auth($req['mac'], $req['usermac'], null, $req['redir']);\n\t\treturn response()->json(['success'=>true, 'token'=>$token]);\n\t}", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }", "public function pcr_auth($user, $username='', $password='') {\r\n $env = (getenv('APPLICATION_ENV') == 'dev') ? 'https://dev.domain.com/api/' : 'https://domain.com/api/';\r\n\r\n // # Define application API key\r\n $apikey = (!empty(getenv('API_KEY')) ? getenv('API_KEY') : '');\r\n\r\n $token = (isset($_GET['token']) ? filter_var($_GET['token'], FILTER_SANITIZE_STRING) : false);\r\n\r\n // # retrieve the current sessions id\r\n $sess_id = session_id();\r\n\r\n // # detect mobile client and if token exists\r\n if($token && wp_is_mobile()) {\r\n\r\n $request_array = array('apiProgram' => 'CGDRUA', \r\n 'token' => $token, \r\n 'apikey' => $apikey\r\n );\r\n } else { // not mobile\r\n\r\n // # check if username and password are present\r\n if(empty($username) || empty($password)) return;\r\n\r\n $request_array = array('apiProgram' => 'CGDRUA', \r\n 'access' => $username, \r\n 'password' => md5(strtolower($password)), \r\n 'sess_id' => $sess_id, \r\n 'apikey' => $apikey\r\n );\r\n }\r\n\r\n $response = wp_remote_post($env, array(\r\n 'method' => 'POST',\r\n 'timeout' => 45,\r\n 'redirection' => 5,\r\n 'httpversion' => '1.0',\r\n 'blocking' => true,\r\n 'headers' => array(),\r\n 'body' => $request_array,\r\n 'cookies' => array()\r\n )\r\n );\r\n\r\n if(is_wp_error($response)) {\r\n error_log(print_r($response->get_error_message(), 1));\r\n }\r\n\r\n $ext_auth = json_decode($response['body'], true);\r\n\r\n if($ext_auth['status'] == 403) {\r\n return;\r\n }\r\n\r\n $department = (!empty($ext_auth['department']) ? $ext_auth['department'] : 'Unassigned');\r\n $dept_code = (!empty($ext_auth['department_code']) ? strtolower($ext_auth['department_code']) : 'subscriber');\r\n\r\n if(empty($ext_auth['salesman_number'])) {\r\n // # User does not exist, send back an error message\r\n $user = new WP_Error( 'denied', __(\"ERROR: Access Number or Password incorrect\") );\r\n\r\n } else {\r\n\r\n // # External user exists, try to load the user info from the WordPress user table\r\n $userobj = new WP_User();\r\n $user = $userobj->get_data_by('login', $ext_auth['salesman_number']); // Does not return a WP_User object 🙁\r\n\r\n $user = new WP_User($user); // Attempt to load up the user with that ID\r\n\r\n if( $user->ID == 0 ) {\r\n // # The user does not currently exist in the WordPress user table.\r\n // # You have arrived at a fork in the road, choose your destiny wisely\r\n\r\n // # If you do not want to add new users to WordPress if they do not\r\n // # already exist uncomment the following line and remove the user creation code\r\n //$user = new WP_Error( 'denied', __(\"ERROR: Not a valid user for this system\") );\r\n\r\n // # Setup the minimum required user information for this example\r\n $userdata = array('user_login' => $ext_auth['salesman_number'],\r\n 'user_email' => strtolower($ext_auth['email']),\r\n 'first_name' => $ext_auth['first_name'],\r\n 'last_name' => $ext_auth['last_name']\r\n );\r\n\r\n $new_user_id = wp_insert_user($userdata); // A new user has been created\r\n \r\n // # Load the new user info\r\n $user = new WP_User($new_user_id);\r\n\r\n // # if department (role) doesnt not exist, create it\r\n if(empty(get_role($dept_code))) {\r\n add_role($dept_code, $department, array('read' => true,));\r\n }\r\n \r\n // # set_role() will overwrite ALL existing assigned roles (including administrator)\r\n $user->set_role($dept_code);\r\n\r\n } else { \r\n\r\n // ######################\r\n // # update existing user\r\n // ######################\r\n\r\n // # update the minimum required user information\r\n $userdata = array('ID' => $user->ID,\r\n 'user_email' => strtolower($ext_auth['email']),\r\n 'first_name' => $ext_auth['first_name'],\r\n 'last_name' => $ext_auth['last_name']\r\n );\r\n\r\n // # force user info update\r\n wp_update_user($userdata);\r\n\r\n // # if department (role) doesnt not exist, create it!\r\n if(empty(get_role($dept_code))) { \r\n add_role($dept_code, $department, array('read' => true,));\r\n }\r\n\r\n // # loop through all user assigned roles\r\n foreach ($user->roles as $role) {\r\n\r\n // # SKIP default wordpress roles\r\n if ($role != 'administrator' && \r\n $role != 'editor' && \r\n $role != 'author' && \r\n $role != 'contributor' && \r\n $role != 'app_subscriber') {\r\n \r\n // # remove all non-WP department (role) capabilities for clean role assignment.\r\n $user->remove_role($role);\r\n }\r\n }\r\n\r\n // # add the response [department] (role) to current user\r\n // # we broke free of the loop so we can iterate through it again\r\n $user->add_role($dept_code);\r\n\r\n // # find default WP roles assigned to user\r\n foreach ($user->roles as $role) {\r\n\r\n // # match on default wordpress roles\r\n if ($role == 'administrator' || \r\n $role == 'editor' || \r\n $role == 'author' || \r\n $role == 'contributor' || \r\n $role == 'app_subscriber') {\r\n \r\n // # remove any default WP roles found in primary position and re-add as secondary role\r\n $user->remove_cap($role);\r\n $user->add_cap($role);\r\n }\r\n }\r\n\r\n }\r\n\r\n if(!empty($ext_auth['internalIPs'])) {\r\n\r\n $allowedIPs = $ext_auth['internalIPs'];\r\n\r\n if (get_option('allowedIPs') !== false ) {\r\n // # The wp-option already exists, so we just update it.\r\n update_option( 'allowedIPs', $allowedIPs, 1);\r\n\r\n } else {\r\n // # The wp-option hasn't been added yet. We'll add it with $autoload set to 'no'.\r\n add_option('allowedIPs', $allowedIPs, null, 0);\r\n }\r\n }\r\n\r\n if($token && wp_is_mobile()) {\r\n // # set the wordpress auth cookie and redirect to dashboard\r\n wp_set_auth_cookie($user->ID);\r\n wp_redirect(home_url());\r\n exit;\r\n }\r\n }\r\n\r\n // # Comment out this line if you wish to fall back on WordPress authentication\r\n // # Useful for times when the external service is offline\r\n remove_action('authenticate', 'wp_authenticate_username_password', 20);\r\n\r\n return $user;\r\n }", "public function testLogAuthActionUsingPOST()\n {\n\n }", "function post($url, $headers, $params)\n{\n $data = json_encode($params);\n\n $curl = curl_init();\n\n array_push($headers, \"Content-Type: application/json\");\n array_push($headers, \"Content-Length: \" . strlen($data));\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n // print_r(\"=========请求信息 start =========\\n\");\n // print_r($url . \"\\n\");\n // print_r(json_encode($headers) . \"\\n\");\n // print_r($data . \"\\n\");\n $response = curl_exec($curl);\n curl_close($curl);\n // print_r(\"==============================\\n\");\n // print_r($response);\n // print_r(\"\\n=========请求信息 end =========\\n\");\n return $response;\n}", "public function login($userName, $password);", "function post($url, $fields = array(), $http_options = array()) {\n $http_options = $http_options + $this->http_options;\n $http_options[CURLOPT_POST] = true;\n $http_options[CURLOPT_POSTFIELDS] = $fields;\n if (is_array($fields)) {\n $http_options[CURLOPT_HTTPHEADER] = array(\"Content-Type: multipart/form-data\");\n }\n $this->handle = curl_init($url);\n\n if (!curl_setopt_array($this->handle, $http_options)) {\n throw new RestClientException(\"Error setting cURL request options.\");\n }\n\n $this->response_object = curl_exec($this->handle);\n $this->http_parse_message($this->response_object);\n\n curl_close($this->handle);\n return $this->response_object;\n }", "public static function curlPOST($url,$dato){\n\n $ch = curl_init($url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_CAINFO, getcwd() . \"/certificado/privatekey.pem\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $dato);\n\tcurl_setopt($ch, CURLOPT_CERTINFO, 1);\n\t$response = curl_exec($ch);\n\t$info = curl_getinfo($ch);\n //var_dump($info);\n\t$certInfo = curl_getinfo($ch, CURLINFO_CERTINFO);\n\t//var_dump($response);\n\t//exit;\n curl_close($ch);\n\n\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "function http_post($url, $params = array()) {\n $postData = '';\n //create name value pairs seperated by &\n foreach ($params as $k => $v) {\n $postData .= $k . '=' . $v . '&';\n }\n $postData = rtrim($postData, '&');\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_POST, count($postData));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);\n $output = curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "public function post($url, $payload = array(), $do_not_exit = true)\n {\n if($do_not_exit)\n {\n $this->do_not_exit = true;\n }\n\n $this->url = $url;\n $this->curl_handle = curl_init();\n $payload = http_build_query($payload);\n curl_setopt($this->curl_handle, CURLOPT_URL, $this->url);\n curl_setopt($this->curl_handle, CURLOPT_POST, true);\n curl_setopt($this->curl_handle, CURLOPT_HTTPHEADER, $this->header);\n curl_setopt($this->curl_handle, CURLOPT_POSTFIELDS, $payload);\n curl_setopt($this->curl_handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($this->curl_handle, CURLOPT_HEADER, true);\n $this->curl_response = curl_exec($this->curl_handle);\n\n $this->parse_curl_response();\n return $this->http_body;\n }", "function WithPost()\n {\n $this->mUsername = $_POST['username'];\n $this->mPassword = $_POST['password'];\n $this->mPasswordConfirm = $_POST['passwordConfirm'];\n }", "public function sendRequest($postData)\n {\n\n $url = 'https://rpcapi.checkout.fi/reseller/createMerchant';\n $basicAuth = base64_encode($this->username.':'.$this->password);\n\n if(ini_get('allow_url_fopen'))\n {\n $context = stream_context_create(array(\n 'http' => array(\n 'method' => 'POST',\n 'header' => array(\n 'Authorization: Basic '. $basicAuth,\n 'Content-Type: application/x-www-form-urlencoded',\n 'User-Agent: checkout-finland-api-client'\n ),\n 'content' => http_build_query($postData)\n )\n ));\n\n $response = file_get_contents($url, false, $context);\n if ($response) {\n $merchant = new SimpleXMLElement($response);\n return $merchant;\n } else {\n throw new \\Exception(\"No response from Checkout.fi RPC API.\");\n }\n\n }\n elseif(in_array('curl', get_loaded_extensions()) )\n {\n $options = array(\n CURLOPT_POST => 1,\n CURLOPT_HEADER => 0,\n CURLOPT_URL => $url,\n CURLOPT_FRESH_CONNECT => 1,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_FORBID_REUSE => 1,\n CURLOPT_TIMEOUT => 4,\n CURLOPT_POSTFIELDS => http_build_query($postData)\n );\n\n $ch = curl_init();\n curl_setopt_array($ch, $options);\n $result = curl_exec($ch);\n curl_close($ch);\n\n return $result;\n }\n else\n {\n throw new \\Exception(\"No valid method to post data. Set allow_url_fopen setting to On in php.ini file or install curl extension.\");\n }\n }", "public static function sendPostRequest(String $resource, array $data)\n {\n static::init();\n $curl = new UKMCURL();\n $curl->json($data);\n $curl->requestType(\"POST\");\n $curl->user('userpwd:' . static::$api_key);\n\n return new Result($curl->request(static::_getUrl($resource)));\n }", "function post_to_url($url, $data) {\r\n\t\t$fields = '';\r\n\t\tforeach($data as $key => $value) {\r\n\t\t\t$fields .= $key . '=' . $value . '&';\r\n\t\t}\r\n \r\n\t\trtrim($fields, '&');\r\n\t\t$post = curl_init();\r\n \r\n\t\t curl_setopt($post, CURLOPT_URL, $url);\r\n\t\t curl_setopt($post, CURLOPT_POST, count($data));\r\n\t\t curl_setopt($post, CURLOPT_POSTFIELDS, $fields);\r\n\t\t curl_setopt($post, CURLOPT_RETURNTRANSFER, 1);\r\n\t\t $result = curl_exec($post);\r\n\t\t curl_close($post);\r\n\t}", "function _curlRequest( $url, $method, $data = null, $sendAsJSON = true, $auth = true ) {\n\t$curl = curl_init();\n\tif ( $method == 'GET' && $data !== null ) {\n\t\t$url .= '?' . http_build_query( $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\tif ( $auth ) {\n\t\tcurl_setopt( $curl, CURLOPT_USERPWD, P_SECRET );\n\t}\n\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $method );\n\tif ( $method == 'POST' && $data !== null ) {\n\t\tif ( $sendAsJSON ) {\n\t\t\t$data = json_encode( $data );\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen( $data ) ) );\n\t\t}\n\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );\n\t$response = curl_exec( $curl );\n\tif ( $response === false ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\t$httpCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n\tif ( $httpCode >= 400 ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\tcurl_close( $curl );\n\n\treturn json_decode( $response, true );\n}", "function restPost($url, $content) {\n\t$ch = curl_init();\n\t// Uses the URL passed in that is specific to the API used\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t// When posting to a Fuel API, content-type has to be explicitly set to application/json\n\t$headers = [\"Content-Type: application/json\", \"User-Agent: \" . getSDKVersion()];\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\t// The content is the JSON payload that defines the request\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $content);\n\t//Need to set ReturnTransfer to True in order to store the result in a variable\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t// Disable VerifyPeer for SSL\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$outputJSON = curl_exec($ch);\n\t$responseObject = new \\stdClass();\n\t$responseObject->body = $outputJSON;\n\t$responseObject->httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\treturn $responseObject;\n}", "protected function _execute(){\n\t\t\t$this->_getUrl();\n\n\t\t\t$c = curl_init($this->_url);\n\t\t\tob_start();\n\t\t\tif(!empty($this->_postFields)) {\n\t\t\t\tcurl_setopt($c, CURLOPT_POST, 1);\n\t\t\t\tcurl_setopt($c, CURLOPT_POSTFIELDS, json_encode($this->_postFields));\n\t\t\t}\n\n\t\t\tcurl_exec($c);\n\t\t\tcurl_close($c);\n\t\t\t$this->_result = trim(ob_get_contents());\n\t\t\tob_end_clean();\n\t\t}", "public function post($requestUrl, $requestBody, array $requestHeaders = []);", "function auth($username, $password) {\n\n // curl function to backend\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://afsaccess2.njit.edu/~es66/login.php\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&password='.$password);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n $decoded_json = json_decode($output);\n if ($decoded_json->{\"login\"} == \"success\") {\n $json[\"login\"] = \"ok\";\n if ($decoded_json->{\"Type\"} == \"1\") {\n $json[\"type\"] = \"instructor\";\n } else {\n $json[\"type\"] = \"student\";\n }\n //$json[\"type\"]=$decoded_json->{\"type\"};\n $json[\"username\"] = $decoded_json->{\"username\"};\n $json[\"firstname\"] = $decoded_json->{\"firstname\"};\n $json[\"lastname\"] = $decoded_json->{\"lastname\"};\n } else {\n $json[\"login\"] = \"bad\";\n }\n curl_close($ch);\n echo json_encode($json);\n}", "public function AdminLogin(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $username = $_POST['email'];\n $password = $_POST['password'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($username) && !empty($password)){\n $res->admin_login($username, $password, $conn);\n $this->dbClose();\n }\n else{\t\n $this->dbClose();\n $error = array('status' => \"0\", \"msg\" => \"Fill Both Fields !!\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function http($url, $method='POST', $postfields = null, $headers = array())\r\n {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ci, CURLOPT_COOKIESESSION, true);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, false);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, true);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if (isset($this->accessToken) && $this->accessToken) {\r\n $headers[] = \"Authorization: OAuth2 \" . $this->accessToken;\r\n }\r\n\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n curl_setopt($ci, CURLOPT_URL, $url);\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, true);\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo '=====info=====' . \"\\r\\n\";\r\n print_r(curl_getinfo($ci));\r\n\r\n echo '=====$response=====' . \"\\r\\n\";\r\n print_r($response);\r\n }\r\n\r\n curl_close($ci);\r\n return $response;\r\n }", "function post(Request &$request, Response &$response);", "static public function createPost(){\n\t\tinclude ($GLOBALS['PATH'] . '/classes/requests/users/CreateRequest.php');\n\n\t\t$requests = new CreateRequest;\n\t\t$errors = $requests->validate();\n\t\t\n\t\t//Criar url de redirecionar\n\t\t$back = explode('?', $_SERVER['HTTP_REFERER'])[0] ?? '/users/create';\n\n\t\tif(count($errors) > 0){\n\t\t\t//seta os params de retorno\n\t\t\t$back .= '?errors=' . json_encode($errors) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\n\t\t}else{\n\n\t\t\t$conn = Container::getDB();\n\t\t\t$user = new User;\n\t\t\t\n\t\t\t//Cria criptografia de senha\n\t\t\t$password = crypt($_POST['password'], SALT);\n\n\t\t\t//seta os dados do usuario na instância da class User\n\t\t\t$user->setName($_POST['name'])\n\t\t\t\t->setEmail($_POST['email'])\n\t\t\t\t->setPassword($password);\n\t\t\n\t\t\t$crud = new CrudUser($conn, $user);\n\n\t\t\ttry {\n\t\t\t\t//metodo save(), salva os dados do usuario no banco de dados\n\t\t\t\t$save = $crud->save();\n\n\t\t\t\t//Verificação se o cadastro foi com successo\n\t\t\t\tif($save){\n\t\t\t\t\t$back .= '?success=Usuário cadastrado com sucesso!';\n\t\t\t\t}else{\n\n\t\t\t\t\t//cria message de retorno com erro\n\t\t\t\t\t$messageError = ['Error' => 'Erro ao salvar usuario'];\n\t\t\t\t\t$back .= '?errors=' . json_encode($messageError) . '&name='. $_POST['name'] . '&email='. $_POST['email'];\n\t\t\t\t\n\t\t\t\t}\n\t\t\t} catch (\\Throwable $th) {\n\t\t\t\techo '<pre>';\n\t\t\t\t\tprint_r($th);\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t//Redireciona para $back\n\t\theader('Location: ' . $back);\n\t}", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "function Curl($url = false , array $data = array()){\n\n\t\tif($url !== false){\n\n\t\t\t$build[CURLOPT_POST] = 1;\n\t\t\t$build[CURLOPT_POSTFIELDS] = http_build_query($data, '', '&');\n\n\t\t\treturn new curlseton($url,$build);\n\t\t\t\n\t\t}\n\t}", "private function curlPost($host, $params = array())\n {\n $handle = curl_init($host);\n curl_setopt($handle, CURLOPT_POST, true);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n // NOTE: On Windows systems, the line below may cause problems even when\n // cURL is configured with a CA file.\n\n $is_windows = strtoupper(substr(PHP_OS, 0, 3)) == 'WIN';\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, !$is_windows);\n\n curl_setopt($handle, CURLOPT_POSTFIELDS, $params);\n $result = curl_exec($handle);\n if ($result === false) {\n throw new BillComException('Curl error: ' . curl_error($handle));\n }\n return $result;\n }", "public static function send($url, $headers = [], $body = null, $username = null, $password = null)\n {\n self::$handle = curl_init();\n\n curl_setopt_array(self::$handle, [\n CURLOPT_URL => self::encodeUrl($url),\n CURLOPT_POSTFIELDS => $body,\n CURLOPT_HTTPHEADER => self::getFormattedHeaders($headers),\n CURLOPT_CONNECTTIMEOUT => 10,\n CURLOPT_TIMEOUT => 10,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_SSL_VERIFYPEER => false,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_POST => true,\n CURLOPT_VERBOSE => true,\n CURLOPT_HEADER => true,\n ]);\n if (self::$socketTimeout !== null) {\n curl_setopt(self::$handle, CURLOPT_TIMEOUT, self::$socketTimeout);\n }\n // supporting deprecated http auth method\n if (!empty($username)) {\n curl_setopt_array(self::$handle, [\n CURLOPT_HTTPAUTH => CURLAUTH_BASIC,\n CURLOPT_USERPWD => $username.':'.$password,\n ]);\n }\n if (!empty(self::$auth['user'])) {\n curl_setopt_array(self::$handle, [\n CURLOPT_HTTPAUTH => self::$auth['method'],\n CURLOPT_USERPWD => self::$auth['user'].':'.self::$auth['pass'],\n ]);\n }\n if (self::$proxy['address'] !== false) {\n curl_setopt_array(self::$handle, [\n CURLOPT_PROXYTYPE => self::$proxy['type'],\n CURLOPT_PROXY => self::$proxy['address'],\n CURLOPT_PROXYPORT => self::$proxy['port'],\n CURLOPT_HTTPPROXYTUNNEL => self::$proxy['tunnel'],\n CURLOPT_PROXYAUTH => self::$proxy['auth']['method'],\n CURLOPT_PROXYUSERPWD => self::$proxy['auth']['user'].':'.self::$proxy['auth']['pass'],\n ]);\n }\n $response = curl_exec(self::$handle);\n $error = curl_error(self::$handle);\n $info = self::getInfo();\n if ($error) {\n throw new \\Exception($error);\n }\n // Split the full response in its headers and body\n $header_size = $info['header_size'];\n $header = substr($response, 0, $header_size);\n $body = substr($response, $header_size);\n\n return new SoapClientResponse($info, $header, $body);\n }", "private function _post_data($url, $data)\n\t{\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); \n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\t\t$ret = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $ret;\n\t}", "function zbase_remote_post_json($url, $data, $options = [])\n{\n\t$dataString = '';\n\tforeach ($data as $key => $value)\n\t{\n\t\t$dataString .= $key . '=' . $value . '&';\n\t}\n\trtrim($dataString, '&');\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($ch, CURLOPT_POST, count($data));\n\tcurl_setopt($ch, CURLOPT_COOKIEJAR, zbase_storage_path() . 'cookie.txt');\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $dataString);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . strlen($dataString))\n\t);\n\t$result = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $result;\n}" ]
[ "0.6935809", "0.65286905", "0.6373342", "0.6103658", "0.59414285", "0.587953", "0.5792687", "0.57070893", "0.569892", "0.5682557", "0.5681375", "0.5637551", "0.56273496", "0.5627273", "0.56193733", "0.56129336", "0.56035554", "0.55753124", "0.5574021", "0.5571241", "0.556158", "0.5552862", "0.554127", "0.55133736", "0.549546", "0.5486702", "0.54810137", "0.5476311", "0.5474127", "0.5462996", "0.54598844", "0.54575264", "0.54443246", "0.5436453", "0.54316545", "0.541992", "0.54000694", "0.53995633", "0.5373016", "0.53699535", "0.53631467", "0.5360799", "0.5359742", "0.53538054", "0.5351166", "0.5349201", "0.53464913", "0.5345223", "0.5344604", "0.5337575", "0.5330841", "0.53302497", "0.5328631", "0.5311498", "0.5308613", "0.5307841", "0.5293414", "0.5280858", "0.52766067", "0.5262439", "0.52623594", "0.5250989", "0.52462274", "0.52354693", "0.5228883", "0.5221795", "0.5221128", "0.5215493", "0.5209884", "0.52069956", "0.52061003", "0.5202187", "0.51976675", "0.5191105", "0.5190251", "0.51867634", "0.5179891", "0.51786333", "0.51783967", "0.5174755", "0.5173329", "0.5167064", "0.5164973", "0.51630354", "0.51624066", "0.5162209", "0.51580185", "0.5157384", "0.5152728", "0.5149749", "0.51465714", "0.51464516", "0.514531", "0.5143793", "0.5141015", "0.514095", "0.5133764", "0.5133456", "0.513188", "0.51311255" ]
0.60856056
4
This is a helpping method to call CURL GET request with the user name and key
private function curl_get($url) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get($url, $headers=array(), $userPW=0, $params=array())\n{\n $paramLength = count($params);\n // only set params if there are some else url is fine\n if ($paramLength > 0)\n {\n $url = $url.'?'.http_build_query($params,'','&');\n }\n echo $url . \"<br/>\";\n $ch = curl_init();\n // set the url\n curl_setopt($ch, CURLOPT_URL, $url);\n // set http method\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n if ($userPW <> 0)\n {\n curl_setopt($ch, CURLOPT_USERPWD, User_Creds::PingUser . \":\" . User_Creds::PingPass);\n }\n $headerLength = count($headers);\n if ($headerLength > 0)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n //get response\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "function get_data($url) {\n $usrpwd = 'Contact CATA for access credentials';\n $ch = curl_init();\n $timeout = 15;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERPWD,$usrpwd);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "public static function getUserAPI();", "public function getUser(){\r\n $urlUser = \"{$this->apiHost}/api/v1/me\";\r\n // return $urlUser;\r\n return self::runCurl($urlUser);\r\n }", "function authGet() { }", "public function test_lsvt_api_can_get_user_by_username()\n {\n $email = '[email protected]';\n\n $this->httpMock->append(new Response(200, ['Content-Type' => 'application/json'], json_encode($this->getUserEmailResponse($email))));\n\n $test = $this->apiClient->getUserByUsername($email);\n\n $this->assertCount(1, $this->curlHistory);\n $this->assertEquals('https://webservices.lightspeedvt.net/REST/v1//[email protected]', (string)$this->curlHistory[0]['request']->getUri());\n\n $this->assertIsArray($test);\n $this->assertEquals($email, $test['email']);\n }", "function auth_apikey($key){\n\t\n}", "function requestProfile() {\n $username = $_GET['username'];\n\n $response = retrieveProfile($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "function call($postfields) {\r\n\t\t$postfields[\"username\"] = $this->api_user;\r\n\t\t$postfields[\"password\"] = md5($this->api_pass);\r\n\r\n\t\t// Make curl request\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->api_url);\r\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 100);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t// Format response\r\n\t\t$data = explode(\";\",$data);\r\n\t\tforeach ($data AS $temp) {\r\n\t\t $temp = explode(\"=\",$temp);\r\n\t\t $key = trim($temp[0]);\r\n\t\t $value = trim($temp[1]);\r\n\t\t $results[$key] = $value;\r\n\t\t}\r\n\t\t\r\n\t\t// Returns array with response\r\n\t\treturn $results;\r\n\t}", "function api_get($url, $identifier = null, $shared_secret = null)\n {\n $curl_auth = $identifier . \":\" . $shared_secret;\n $ch = curl_init($url);\n\n curl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_USERPWD, $curl_auth);\n\n return $this->gather_response($ch);\n }", "private function get($url) {\n\t\t$url = $this->api_url . $url;\n\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "private function request($query)\n\t{\n\t\t$url = \"{$this->__url}/yourls-api.php\";\n\n\t\tif (!empty($this->__signature)) {\n\t\t\t$query = array_merge($query, array('signature' => $this->__signature));\n\t\t} elseif (!empty($this->__username) && !empty($this->__password)) {\n\t\t\t$query = array_merge($query, array('username' => $this->__username, 'password' => $this->__password));\n\t\t}\n\t\treturn $this->__httpSocket->{$this->requestMethod}($url, $query);\n\t}", "private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }", "function retrieveAddressForToken()\n{\n $usertoken = $_SESSION['usertoken'];\n\n $payload = array(\n 'identifier' => $usertoken, //required\n );\n\n //this will return a jsonencoded array with a payment information about the user if found\n $endpoint = 'https://api.coinbee.io/retrieve/address/identifier';\n\n return doCurl($endpoint, $payload);\n}", "function query($param) {\n $curl = curl_init();\n $userName = $param;\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://develop.datacrm.la/datacrm/pruebatecnica/webservice.php?operation=query&sessionName=\" . $userName . \"&query=select%20%2A%20from%20Contacts;\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Accept: */*\",\n \"Accept-Encoding: gzip, deflate\",\n \"Cache-Control: no-cache\",\n \"Connection: keep-alive\",\n \"Host: develop.datacrm.la\",\n \"Postman-Token: 438973a9-ec4c-4c01-bc55-71ad624b746d,206316aa-adaa-4963-b5c6-bdacd9e13eb0\",\n \"User-Agent: PostmanRuntime/7.19.0\",\n \"cache-control: no-cache\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n if ($err) {\n echo \"cURL Error #:\" . $err;\n } else {\n echo $response;\n }\n }", "function getURL($url, $companyFileUsername = '[email protected]', $companyFilePassword = 'lm2225ehO&pM*Q4y0tT5G') {\n\n\t// if we have a username we need to base64_encode it - so lets check if it's set\n\tif( isset( $companyFileUsername ) ) {\n\t\t$companyFileToken = base64_encode( $companyFileUsername.':'.$companyFilePassword );\n\t} else {\n\t\t$companyFileToken = '';\n\t}\n\n\t// we setup some headers to tell the API some information like the company file token and api version\n\t$headers = array(\n\t\t'x-myobapi-cftoken: '.$companyFileToken,\n\t\t'x-myobapi-version: v2',\n\t);\n\n\t// setup the CURL session & pass it the URL we will call\n\t$session = curl_init( $url );\n\t// curl options\n\tcurl_setopt( $session, CURLOPT_HTTPHEADER, $headers ); // set the headers\n\tcurl_setopt( $session, CURLOPT_HEADER, false ); // tell curl NOT to return the headers (set to true to debug)\n\tcurl_setopt( $session, CURLOPT_RETURNTRANSFER, true );\n\n\t// lets fire this off & get the response\n\t$response = curl_exec( $session );\n print '<pre>debug: '.$response.'</pre>';\n\tcurl_close( $session ); // close the curl session to free up memory\n\n\t// okay, lets pass the response back\n\treturn( $response );\n}", "function CallAPI($method, $url, $data = false)\n{\n $curl = curl_init();\n\n switch ($method)\n {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // Optional Authentication:\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n\n// echo \"<pre>\",print_r($result);\n return $result;\n}", "function apikeys($username, $password, $expired=false) {\n $params = array();\n $params[\"username\"] = $username;\n $params[\"password\"] = $password;\n $params[\"expired\"] = $expired;\n return $this->callServer(\"apikeys\", $params);\n }", "public function getUserByToken(ApiTester $I, $url, $token, $key)\n {\n $I->clearHeaders();\n $I->setHeaders();\n if (!($key == \"NoHeader\" or $key == \"NoBearer\")) {\n $I->amBearerAuthenticated($token);\n }\n\n if ($key == \"NoBearer\") {\n $I->clearHeaders();\n $I->setHeaders();\n $I->haveHttpHeader('Authorization', 'Basic');\n }\n $I->sendGET($url);\n return $I->grabResponse();\n }", "function request($host_url, $id, $entity, $auth)\n {\n $url = \"$host_url/v1/checkouts/$id/payment?entityId=$entity\";\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Authorization:Bearer $auth\"));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // this should be set to true in production\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $responseData = curl_exec($ch);\n if (curl_errno($ch)) {\n return curl_error($ch);\n }\n curl_close($ch);\n return $responseData;\n }", "public function GetUserById($userid)\n {\n $url = \"https://reqres.in/api/users/\".$userid;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,$url);\n $result=curl_exec($ch);\n curl_close($ch);\n return $result;\n }", "private function do_get_request($ch,$url,$params=array()){ \n if(is_array($params) && count($params)>0){\n $url.='?';\n foreach($params as $key=>$val){\n $url.='&'.$key.'='.urlencode($val);\n }\n }\n $ch=curl_init();\n $timeout=5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n $result=curl_exec($ch);\n return $result;\n }", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "public static function GETAUTH($url, $key, $auth = 'DEFAULT')\n {\n $curl = curl_init();\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n\n switch ($auth) {\n case 'CUSTOM':\n $headers[] = \"Authentication: \" . $key;\n break;\n case 'DEFAULT':\n $headers[] = \"Authorization: \" . $key;\n break;\n default:\n $headers[] = \"Authorization: \" . $key;\n break;\n }\n\n $headers[] = \"Content-Type:application/json\";\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n $Response = curl_exec($curl);\n $Result = json_decode($Response, true);\n\n curl_close($curl);\n\n return $Result;\n }", "public function auth_request()\n {\n // request the user information\n $url = $this->tmhOAuth->url('1.1/account/verify_credentials');\n $file = $this->sanitize($url);\n\n if ($cached_file = $this->get_cached_file($file)) {\n return json_decode($cached_file, true);\n } else {\n $code = $this->tmhOAuth->user_request([\n 'url' => $url\n ]);\n\n // If the request fails, check to see if there's an older cached file we can use\n if ($code <> 200) {\n if ($cached_file = $this->get_cached_file($file, true)) {\n return json_decode($cached_file, true);\n } else {\n if ($code == 429) {\n die(\"Exceeded Twitter API rate limit\");\n }\n\n die(\"verify_credentials connection failure\");\n }\n }\n\n // Decode JSON\n $json = $this->tmhOAuth->response['response'];\n\n $this->set_cached_file($file, $json);\n\n return json_decode($json, true);\n }\n }", "function getdata( $url, $authinfo, $javascript_loop = 0, $timeout = 0, $postdata = \"\" ) {\n\n\t\t$url = str_replace( \"&amp;\", \"&\", urldecode(trim($url)) );\n\n\t\t$ch = curl_init();\n\n\n\n\t\t$fields = '';\n\n\t\tif (!empty($postdata)) {\n\n\t\t\tforeach($postdata as $key => $value) { \n\n\t\t\t\t$fields .= ($fields==''?'?':'&').$key . '=' . $value; \n\n\t\t\t}\n\n\n\n\t\t\tcurl_setopt($ch,CURLOPT_POST, count($postdata));\n\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, urlencode($fields));\n\n\t\t}\n\n\n\n\t\tcurl_setopt( $ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\" );\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url);\n\n\t\t\t\n\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_ENCODING, \"\");\n\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls\n\n\t\tcurl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );\n\n\t\n\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, TRUE);\n\n\t\t\n\n\t\t$headers = array(\n\n\t\t \"Expect:\",\n\n\t\t \"X-ApiKey: 95074c8fb639b45aa0acc4c23bc7c4d2\",\n\n\t\t \"Authorization: Basic \".$authinfo\n\n\t\t);\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers); \n\n\t\t\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = curl_getinfo( $ch );\n\n\t\tcurl_close ( $ch );\n\n\t\n\n\t\tif ($response['http_code'] == 301 || $response['http_code'] == 302)\t\t{\n\n\t\t\tini_set(\"user_agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\");\n\n\t\n\n\t\t\tif ( $headers = get_headers($response['url']) ) {\n\n\t\t\t\tforeach( $headers as $value ) {\n\n\t\t\t\t\tif ( substr( strtolower($value), 0, 9 ) == \"location:\" )\n\n\t\t\t\t\t\treturn get_url( trim( substr( $value, 9, strlen($value) ) ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\n\n\t\tif ( ( preg_match(\"/>[[:space:]]+window\\.location\\.replace\\('(.*)'\\)/i\", $content, $value) || preg_match(\"/>[[:space:]]+window\\.location\\=\\\"(.*)\\\"/i\", $content, $value) ) &&\n\n\t\t\t\t$javascript_loop < 5 ) {\n\n\t\t\treturn getdata( $value[1], $authinfo, $javascript_loop+1 );\n\n\t\t} else {\n\n\t\t\treturn array( $content, $response );\n\n\t\t}\n\n\t}", "function wechat_php_curl_https_get($url, $h = false) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n // Edit: prior variable $postFields should be $postfields;\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n if($h){\n //include header information\n curl_setopt($ch, CURLOPT_HEADER, true); \n }\n\n $result = curl_exec($ch);\n if(curl_errno($ch))\n {\n curl_close($ch);\n return NULL;\n }\n\n if($h){\n if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == '200') {\n return $result;\n }else{\n return NULL;\n }\n }\n\n curl_close($ch);\n return $result;\n}", "function loginRequest( $logintoken ) {\n global $cookies;\n global $endPoint;\n global $user;\n global $password;\n\n $params2 = [\n \"action\" => \"login\",\n \"lgname\" => $user,\n \"lgpassword\" => $password,\n \"lgtoken\" => $logintoken,\n \"format\" => \"json\"\n ];\n\n $ch = curl_init();\n\n curl_setopt( $ch, CURLOPT_URL, $endPoint );\n curl_setopt( $ch, CURLOPT_POST, true );\n curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $params2 ) );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookies );\n curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookies );\n\n $output = curl_exec( $ch );\n curl_close( $ch );\n}", "public function callApi()\n {\n // Call URL\n $fetchUsers = $this->requestUsingCurl($this->url);\n \n if (!$fetchUsers) {\n return false;\n }\n // Get Data in array format\n $this->users = json_decode($fetchUsers, true);\n }", "public function getme(){\n return $this->make_http_request(__FUNCTION__);\n }", "public function get_user()\n {\n $token = $this->CI->input->get_request_header('Authorization', TRUE);\n $token_json = base64_decode($token);\n $token = json_decode($token_json);\n $userid = $token->userId;\n $username = $token->userName;\n return ['id'=>$userid,'name'=>$username];\n }", "function requestToken() {\n\t\t$conn = new Connection('DB-Name');\n\n\t\t//instantiate login information, api_key, username, and password\n\t\t$api = $conn->tokenGrab(x);\n\t\t$user = $conn->tokenGrab(x);\n\t\t$pass = $conn->tokenGrab(x);\n\n\t\t//build fields to send to the token giver\n\t\t$fields = array(\n\t\t\t'grant_type' \t=> urlencode('password')\n\t\t\t, 'client_id' \t=> urlencode($api)\n\t\t\t, 'username' \t=> urlencode($user)\n\t\t\t, 'password'\t=> urlencode($pass));\n\n\t\t$fields_string = '';\n\t\tforeach ($fields as $key=>$value) { $fields_string .= $key . '=' . $value . '&'; }\n\t\trtrim($fields_string, '&');\n\n\t\t//send the request to token giver via cURL\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $conn->tokenGrab(x));\n\t\tcurl_setopt($ch, CURLOPT_POST, count($fields));\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t\t\t 'Content-Type' => urlencode('application/x-www-form-urlencoded')\n\t\t\t, 'Content-Length' => urlencode(strlen($fields_string))\n\t\t));\n\n\t\t$cherwellApiResponse = json_decode(curl_exec($ch), TRUE);\n\t\treturn $cherwellApiResponse['access_token'];\n\t}", "public function apiCall($url) {\n\t\t// Open curl.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_USERPWD, $this->api_username . \":\" . $this->api_password);\n\t\tcurl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t$output = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $output;\n\t}", "public function processGetRequest(){\n\t\t$query = $this->request->getQueryString();\n\t\t$params = $this->request->getPathParameters();\n\t\tif (!empty($params)){\n\t\t\t\n\t\t\t$uid \t= $this->extractUserId();\n\t\t\t$controller = new ExampleController();\n\t\t\t$result = $controller->getUserById($uid);\n\t\t\tif ($result){\t\n\t\t\t\tnew Response('200', $result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew Response('404');\n\t\t\t} \n\t\t}\n\t\telse{\n\t\t\t// get all\n\t\t\t$controller = new ExampleController();\n\t\t\t$results = $controller->getAllUsers($query);\n\t\t\tnew Response('200', $results);\n\t\t}\n\t}", "function getCredentials($url)\n{\n $ch = curl_init($url);\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n return json_decode($result);\n}", "function find_user ( $ID ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t$url=$canvas_base_url.\"/api/v1/accounts/1/users.json?access_token=\".$access_token;\n\t\n\t$data=array('search_term'=>$ID);\n\t\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t CURLOPT_URL => $url,\n\t CURLOPT_POSTFIELDS => $data,\n\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = json_decode(curl_exec($curl));\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\t\n\t$canvasID=$resp[0]->id;\n\t\n\treturn $canvasID;\n}", "function _curlRequest( $url, $method, $data = null, $sendAsJSON = true, $auth = true ) {\n\t$curl = curl_init();\n\tif ( $method == 'GET' && $data !== null ) {\n\t\t$url .= '?' . http_build_query( $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\tif ( $auth ) {\n\t\tcurl_setopt( $curl, CURLOPT_USERPWD, P_SECRET );\n\t}\n\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $method );\n\tif ( $method == 'POST' && $data !== null ) {\n\t\tif ( $sendAsJSON ) {\n\t\t\t$data = json_encode( $data );\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen( $data ) ) );\n\t\t}\n\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );\n\t$response = curl_exec( $curl );\n\tif ( $response === false ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\t$httpCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n\tif ( $httpCode >= 400 ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\tcurl_close( $curl );\n\n\treturn json_decode( $response, true );\n}", "public function create_user_key() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function GetUserInfo() {\r\n $ch = curl_init();\r\n\r\n $CURLParameters = http_build_query(array(\r\n \"key\" => $this->key,\r\n \"steamid\" => $this->steamid,\r\n ));\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://partner.steam-api.com/\" . $this->interface . \"/GetUserInfo/v2/?\" . $CURLParameters);\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n //curl_setopt($ch, CURLOPT_POST, 1);\r\n //curl_setopt($ch, CURLOPT_POSTFIELDS, $CURLParameters);\r\n $CURLResponse = json_decode(curl_exec($ch));\r\n $CURLResponseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n // Error handling improved!\r\n\r\n if ($CURLResponseCode != 200) {\r\n if ($CURLResponseCode == 400) {\r\n throw new exceptions\\SteamRequestParameterException(\"The Steam ID or another parameter is invalid!\");\r\n }\r\n if ($CURLResponseCode == 401) {\r\n throw new exceptions\\SteamException(\"App ID or API Key is invalid.\");\r\n }\r\n throw new exceptions\\SteamRequestException(\"$CURLResponseCode Request Error.\");\r\n }\r\n\r\n return $CURLResponse->response->params;\r\n }", "public function DataGet_get()\n {\n $username = $this->get('username');\n $password = $this->get('password');\n \n\t\tif(empty($username) || empty($password))\n\t\t{\t\t\t\n\t\t\t$this->response( [\n 'status' => RestController::HTTP_NOT_FOUND,\n 'message' => 'Please Enter All Fields.'\n ], RestController::HTTP_NOT_FOUND );\n }\n else\n {\n $username = $this->input->get('username');\n $password = $this->input->get('password');\n //call Model Function .... \n $this->response( [\n 'status' => RestController::HTTP_OK,\n 'message' => 'Data Get Successfully.'\n ], RestController::HTTP_OK ); \n }\n }", "function _sso_request($cmd, $vars = null)\n {\n # if vars is a string, then vars will be sent as get data\n # if vars is an array, then vars will be sent as post data\n\n $url = \"http://$this->sso_server/auth/$cmd\";\n\n #var_dump($vars, $cmd, $url, $_COOKIE);die;\n\n if (!empty($vars) && is_string($vars)) $url .= $vars;\n\n $curl = curl_init($url);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_COOKIE, \"session_token=\" . $this->get_token());\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-CLIENT: SSO_Client'));\n\n if (!empty($vars) && is_array($vars)) {\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $vars);\n }\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);\n\n $body = curl_exec($curl);\n $ret = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if($this->sso_debug_mode){\n\t\t\t\t//error_log(date('Y-m-d H:i:s').\"\\tURL: $url\\tTOKEN: \".$this->get_token().\"\\tPOST: \".http_build_query($vars).\"\\tRESPONSE: $body\\tRESNO: $ret\\n\",3,'/tmp/sso_client.log');\n\t\t\t}\n #var_dump($body);exit;\n if (curl_errno($curl) != 0) throw new Exception(\"SSO failure: HTTP request to server failed. <br />URL: $url<br />\" . curl_error($curl));\n\n return array($ret, $body);\n }", "public function certificate_addon_get() {\n $response = array();\n if (isset($_GET['auth_token']) && !empty($_GET['auth_token'])) {\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n $user_id = $logged_in_user_details['user_id'];\n $course_id = $_GET['course_id'];\n\n $response = $this->api_model->certificate_addon_get($user_id, $course_id);\n }else{\n $response['status'] = 'failed';\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }", "function crowd_rest_request($url, $content_type, $method, $method_field = \"\"){\n $curl = curl_init();\n\n // Set common parameters.\n curl_setopt($curl, CURLOPT_URL,\n \"http://localhost:8095/crowd/rest/usermanagement/latest/\" . $url);\n curl_setopt($curl, CURLOPT_USERPWD, \"appname:apppassword\");\n curl_setopt($curl, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n\n // Set content type.\n if (strtolower($content_type) === 'json'){\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-type: application/json\",\n \"Accept: application/json\"));\n }\n else if (strtolower($content_type) === 'xml'){\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-type: application/xml\",\n \"Accept: application/xml\"));\n }\n else throw new Exception(\"Bad request -- invalid content type: \" . $content_type);\n\n // Set method.\n if (strtolower($method) === 'get'){}\n else if (strtolower($method) === 'post'){\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $method_field);\n }\n else if (strtolower($method) === 'put'){\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($curl, CURLOPT_POSTFIELDS, $method_field);\n }\n else if (strtolower($method) === 'delete'){\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n }\n else throw new Exception(\"Bad request -- invalid method: \" . $method);\n\n // Perform request.\n $return = curl_exec($curl);\n\n // If status code is not between 200 and 206, throw an exception.\n $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n if ($http_status < 200 || $http_status > 206){\n throw new Exception(\"Bad request -- HTTP status code: \" . $http_status);\n }\n\n curl_close($curl);\n return $return;\n}", "private static function requestWithCurl($completeurl, $user, $password) {\n $session = curl_init($completeurl);\n $httpHeader[] = 'Expect:';\n if (!empty($user) && !empty($password)) {\n $httpHeader[] = 'Authorization: Basic ' . base64_encode($user . ':' . $password);\n }\n curl_setopt($session, CURLOPT_HTTPHEADER, $httpHeader);\n curl_setopt($session, CURLOPT_HEADER, false);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);\n $response = curl_exec($session);\n curl_close($session);\n return $response;\n }", "private function getUser($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/users/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "function get_cities()\n{\n $url = set_url('cities');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "public function getAuthenticated($user) { \r\n return $this->makeRequest('get', \"/user\");\r\n }", "public function getUser() {\n\t\t$urlUser = \"{$this->apiHost}/me.json\";\n\t\treturn $this->runCurl ( $urlUser );\n\t}", "public static function _call_get($url){\n $curl = curl_init();\n // Set curl opt as array\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n // No more than 30 sec on a website\n CURLOPT_TIMEOUT=>10,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_RETURNTRANSFER => true,\n ));\n // Run curl\n $response = curl_exec($curl);\n //Check for errors \n if(curl_errno($curl)){\n $errorMessage = curl_error($curl);\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log error message .\n $return = array('success'=>FALSE,'error'=>$errorMessage,'status'=>$statusCode);\n } else {\n $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n // Log success\n $return = array('success'=>TRUE,'response'=>$response,'status'=>$statusCode);\n }\n //close request\n curl_close($curl);\n //Return\n return $return;\n }", "function check_user( string $username, string $password ) {\n\tglobal $database;\n // Read from the api/v1/me endpoint which returns details about the logged in user.\n // This user will be whatever you specify in the Basic Auth, or the endpoint will\n // return an error if it fails.\n $curl = curl_init( \"https://$database[kayako]/api/v1/me?include=*\" );\n\tcurl_setopt( $curl, CURLOPT_USERPWD, \"$username:$password\");\n curl_setopt( $curl, CURLOPT_RETURNTRANSFER, 1 );\n \n $result = curl_exec($curl);\n\t\n if( !$result ) {\n // Couldn't connect to server.\n return FALSE;\n }\n \n $code = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n if( $code >= 500 && $code < 600) {\n // Internal server error.\n return FALSE;\n }\n\t\n $json = json_decode( $result, true );\n \n // Note that there can still be an error, but it should be a well defined error with\n // a response from the Kayako server. For example, if the login is incorrect:\n /*\n {\n \"status\": 401,\n \"errors\": [\n {\n \"code\": \"AUTHENTICATION_FAILED\",\n \"message\": \"Used authentication credentials are invalid or signature verification failed\",\n \"more_info\": \"https://developer.kayako.com/api/v1/reference/errors/AUTHENTICATION_FAILED\"\n }\n ],\n \"notifications\": [\n {\n \"type\": \"ERROR\",\n \"message\": \"Invalid Email or Password\",\n \"sticky\": false\n }\n ]\n }\n */\n\n return $json;\n}", "public function private_user_data($user_name, $set, $purchase_code = null)\n {\n if ( ! isset($this->api_key) ) return 'You have not set an api key yet.';\n if (! isset($set) ) return 'Missing parameters';\n\n $url = \"http://marketplace.envato.com/api/edge/$user_name/$this->api_key/$set\";\n if ( !is_null($purchase_code) ) $url .= \":$purchase_code\";\n $url .= '.json';\n\n $result = $this->curl($url);\n\n if ( isset($result->error) ) return 'Username, API Key, or purchase code is invalid.';\n return $result->$set;\n }", "public function curlUsers() {\n // $fixieUrl = \"http://fixie:[email protected]:80\";\n // $parsedFixieUrl = parse_url($fixieUrl);\n\n // $proxy = $parsedFixieUrl['host'].\":\".$parsedFixieUrl['port'];\n // $proxyAuth = $parsedFixieUrl['user'].\":\".$parsedFixieUrl['pass'];\n\n // $ch = curl_init();\n // curl_setopt($ch, CURLOPT_URL, \"https://mindcrunch.com/all_users.php\");\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // curl_setopt($ch, CURLOPT_PROXY, $proxy);\n // curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);\n // curl_setopt($ch, CURLOPT_HTTPHEADER, array( \n // 'Accept: application/json', \n // )\n // );\n // $contents = curl_exec($ch);\n // curl_close($ch);\n\n // return json_decode($contents);\n\n // // LOCAL\n // $ch = curl_init();\n // curl_setopt($ch, CURLOPT_URL, \"https://mindcrunch.com/all_users.php\");\n // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // curl_setopt($ch, CURLOPT_HTTPHEADER, array( \n // 'Accept: application/json', \n // )\n // );\n\n // $contents = curl_exec ($ch);\n // curl_close ($ch);\n\n // return json_decode($contents);\n\n $contents = shell_exec(\"curl -H \\\"Accept: application/json\\\" https://mindcrunch.com/all_users.php\");\n return json_decode($contents);\n }", "function make_get_call($mid_url) {\n global $base_url, $end_url;\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $base_url . $mid_url . $end_url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);\n curl_setopt($curl, CURLOPT_HEADER, false);\n \n $output = json_decode(curl_exec($curl));\n curl_close($curl);\n \n return $output;\n }", "public function get_userInfo_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userInfo($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "function CallAPI($method, $url, $data = false)\r\n{\r\n $curl = curl_init();\r\n\r\n switch ($method)\r\n {\r\n case \"POST\":\r\n curl_setopt($curl, CURLOPT_POST, 1);\r\n\r\n if ($data)\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\r\n break;\r\n case \"PUT\":\r\n curl_setopt($curl, CURLOPT_PUT, 1);\r\n break;\r\n default:\r\n if ($data)\r\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n }\r\n\r\n // Optional Authentication:\r\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\r\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\r\n\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n $result = curl_exec($curl);\r\n\r\n curl_close($curl);\r\n\r\n return $result;\r\n}", "public function auth_user() {\n\t\t$key = $this->getParams('key');\n\t\t\n\t\t$this->UserAuth = ClassRegistry::init('UserAuth');\n\t\t$options = array('conditions' => array('UserAuth.key' => $key), 'order' => array('id' => 'DESC'));\n\t\t$data = $this->UserAuth->find('first', $options);\n\t\t$data = isset($data['UserAuth']['params']) ? unserialize($data['UserAuth']['params']) : array();\n\t\t\t\n\t\t$response = array(\n\t\t\t\t'status' => 'success',\n\t\t\t\t'operation' => 'auth_user',\n\t\t\t\t'data' => $data,\n\t\t\t\t);\n\t\t$this->set(array(\n 'response' => parseParams($response),\n '_serialize' => array('response'),\n ));\n\t}", "function curlGet($url, $headers=null) {\r\n //write_log(\"Function fired\");\r\n $mc = JMathai\\PhpMultiCurl\\MultiCurl::getInstance();\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\r\n\t\tcurl_setopt ($ch, CURLOPT_CAINFO, rtrim(dirname(__FILE__), '/') . \"/cert/cacert.pem\");\r\n\t\tif ($headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t//$result = curl_exec($ch);\r\n\t\t//curl_close ($ch);\r\n $call = $mc->addCurl($ch);\r\n // Access response(s) from your cURL calls.\r\n $result = $call->response;\r\n\t\t//write_log(\"URL is \".$url.\". Result is \".$result);\r\n\t\treturn $result;\r\n\t}", "function get_user_info( $user, $key )\n {\n //Unimplemented\n }", "function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}", "public function get($user) { \r\n return $this->makeRequest('get', \"/users/{$user}\");\r\n }", "public function getrequest()\n {\n $request = User::getrequest();\n return result::repsonse(true,$request);\n }", "public function testThatGetUserRequestIsFormattedProperly()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->get( '__test_user_id__' );\n\n $this->assertEquals( 'GET', $api->getHistoryMethod() );\n $this->assertEquals( 'https://api.test.local/api/v2/users/__test_user_id__', $api->getHistoryUrl() );\n\n $headers = $api->getHistoryHeaders();\n $this->assertEquals( 'Bearer __api_token__', $headers['Authorization'][0] );\n $this->assertEquals( self::$expectedTelemetry, $headers['Auth0-Client'][0] );\n }", "function btce_generic_read($key, $secret, $command) {\n $_mt = explode(' ', microtime());\n $_post = array(\n \"method\" => $command,\n \"nonce\" => $_mt[1],\n );\n\n $sign = hash_hmac('sha512', http_build_query($_post, '', '&'), $secret);\n $_headers = array (\n 'Sign: ' . $sign,\n 'Key: ' . $key,\n );\n\n $_o_url = new URLScrape(\"https://btc-e.com/tapi/\", $_post, $_headers);\n return json_decode($_o_url->response);\n}", "function h_GET(string $url, $data = []) {\n // if URL doesn't start with \"http\", prepend API_URL\n if (!preg_match('/^http/', $url, $matches)) {\n $url = API_URL . $url;\n }\n\n if ($data) {\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n \n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n curl_close($curl);\n\n return json_decode($result, true);\n}", "public function qelasyLoginAction(){\n \n \n /*$url = \"http://silk-outsourcing.com/qelasysecurity/web/index.php/api/default/appStoreAuthentication\";\n $client = new Zend_Http_Client($url);\n $client->setHeaders(array(\n 'X-USERNAME:non-qelasy-stg',\n 'X-PASSWORD:non-qelasy-stg',\n 'Content-Type:application/x-www-form-urlencoded'\n ));\n\n $client->setParameterGet(array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => 1\n ));\n \n $response = $client->request(Zend_Http_Client::POST); \n echo htmlspecialchars($client->getLastRequest(), ENT_QUOTES).'<br><br>';\n echo '--------------------------------------------------------<br><br>';\n echo htmlspecialchars($client->getLastResponse(), ENT_QUOTES).'<br><br>';\n echo '---------------------------------------------------------<br><br>';\n \n echo $response->getRawBody();\n //$results = json_decode($response->getRawBody(), true);\n //print_r($results);\n die();*/\n\n \n $uri = 'http://silk-outsourcing.com/qelasysecurity/web/index.php/api/default/appStoreAuthentication';\n\n $config = array(\n 'adapter' => 'Zend_Http_Client_Adapter_Curl',\n 'curloptions' => array(CURLOPT_FOLLOWLOCATION => true),\n );\n $client = new Zend_Http_Client($uri, $config);\n\n $client->setHeaders(array(\n 'X-USERNAME:non-qelasy-stg',\n 'X-PASSWORD:non-qelasy-stg',\n 'Content-Type:application/x-www-form-urlencoded'\n ));\n \n /*$data = array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => '1'\n );*/\n\n /*$client->setParameterGet(array(\n 'email' => '[email protected]',\n 'pin' => 'dumindu',\n 'type' => 1\n ));*/\n \n $data = '[email protected]&pin=dumindu&type=1';\n //$data = 'studentId=113&pin=dumindu&type=0';\n //$json = json_encode($data);\n\n $resp = $client->setRawData($data, 'application/x-www-form-urlencoded')->request('POST');\n\n echo htmlspecialchars($client->getLastRequest(), ENT_QUOTES).'<br><br>';\n echo '--------------------------------------------------------<br><br>';\n echo htmlspecialchars($client->getLastResponse(), ENT_QUOTES).'<br><br>';\n echo '---------------------------------------------------------<br><br>';\n \n echo $results = $resp->getBody();\n\n echo '---------------------------------------------------------<br><br>';\n \n $phpNative = Zend_Json::decode($results);\n print_r($phpNative);\n \n echo '---------------------------------------------------------<br><br>';\n \n try {\n $json = Zend_Json::decode($results);\n\n print_r($json);\n } catch (Exception $ex) {\n echo \"failed to decode json\";\n }\n \n exit();\n \n }", "function acapi_get_creds() {\n $user = acapi_get_option('email');\n $pass = acapi_get_option('key');\n if (empty($user) || empty($pass)) {\n return drush_set_error('ACAPI_CREDS_MISSING', dt('Email and api key required; specify --email/--key or run drush ac-api-login'));\n }\n return \"$user:$pass\";\n}", "function curl_get($url, array $get = NULL, array $headers = NULL, array $options = array()) { \n $defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_HTTPHEADER => $headers,\n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 4,\n $headers\n ); \n \n $ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults));\n \n if ( ! $result = curl_exec($ch)) { \n trigger_error(curl_error($ch)); \n } \n curl_close($ch); \n return $result; \n}", "function pete_curl_get($url, $params){\n\t$post_params = array();\n\tforeach ($params as $key => &$val) {\n\t\tif (is_array($val)) $val = implode(',', $val);\n\t\t$post_params[] = $key.'='.urlencode($val);\n\t}\n\t$post_string = implode('&', $post_params);\n\t$fullurl = $url.\"?\".$post_string;\n\t$ch = curl_init();curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);curl_setopt($ch, CURLOPT_URL, $fullurl);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040608');\n\t$result = curl_exec($ch);curl_close($ch);\n\treturn $result;\n}", "protected function _actionGet(KCommandContext $context)\n {\n if ( $context->request->getFormat() == 'html' ) {\n $context->response->setRedirect(JRoute::_('format=json&option=com_connect&view='.$this->view));\n return; \n }\n \n if ( $this->get ) \n { \n $url = ltrim($this->get, '/');\n $data = KConfig::unbox($this->api->get($url));\n $data = json_encode($data); \n } \n else \n {\n $data = (array) $this->api->getUser();\n }\n \n $this->getView()->data($data);\n \n return parent::_actionGet($context); \n }", "function fsf_cms_getUserInfo($fsfcms_user_id)\n {\n global $fsfcms_api_url;\n $fsf_api_file = \"fsf.cms.getUserInfo.php\";\n if(ctype_digit($fsfcms_user_id))\n {\n $fsf_api_options = \"?userId=\" . $fsfcms_user_id;\n } else {\n $fsf_api_options = \"?userSlug=\" . $fsfcms_user_id;\n }\n $fsfcms_cms_get_user_info_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options); \n return $fsfcms_cms_get_user_info_json; \n }", "public function get($url, $fields=\"\") {\n\n $this->_error = NULL;\n $this->_rc = NULL;\n\n curl_setopt($this->_cm, CURLOPT_USERPWD, $this->_username.\":\".$this->_password);\n curl_setopt($this->_cm, CURLOPT_POSTFIELDS, $fields);\n curl_setopt($this->_cm, CURLOPT_URL, $url);\n\n $res = curl_exec($this->_cm);\n if ($res == FALSE) {\n $this->_error = curl_error($this->_cm);\n $this->_rc = curl_errno($this->_cm);\n } else {\n $this->_rc = curl_getinfo($this->_cm, CURLINFO_HTTP_CODE);\n }\n curl_close($this->_cm);\n return $res;\n }", "function get_account_id($account_name){\n $arResult = sendCurl('get_account_id', [$account_name]);\n return $arResult;\n}", "function get_twitter_friends(&$username,&$password){\n $url = 'http://twitter.com/statuses/friends.json'; //works only for authenticated user\n $curl_handle = curl_init();\n curl_setopt($curl_handle, CURLOPT_URL, \"$url\");\n curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl_handle, CURLOPT_USERPWD, \"$username:$password\");\n\n $buffer = curl_exec($curl_handle);\n curl_close($curl_handle);\n // check for success or failure\n if (!empty($buffer)) {\n return $buffer;\n } else {\n print \"cant get twitter friends\\n\";\n\t return -1;\n }\n\n}", "public static function getUser();", "protected function api_request($query) {\n if (empty($this->server_path)) {\n return;\n }\n \n try {\n if (!($this->request instanceof HTTP_Request2)) {\n \n /**\n * Parse server_path to extract an optional username and\n * password for basic auth.\n */\n $_url = new Net_Url2($this->server_path);\n \n $basic_auth_user = $_url->getUser();\n $basic_auth_pass = $_url->getPassword();\n \n $request = new HTTP_Request2($this->server_path . $query);\n if ($basic_auth_user !== false) {\n if ($basic_auth_pass !== false) {\n $request->setAuth($basic_auth_user, $basic_auth_pass);\n } else {\n $request->setAuth($basic_auth_user);\n }\n }\n \n } else {\n $request = $this->request;\n }\n $response = $request->send(); \n $body = json_decode($response->getBody());\n\n return $body;\n\n } catch (HTTP_Request2_Exception $e) {\n trigger_error($e->getMessage(), E_USER_WARNING);\n }\n }", "function get_user()\n{\n$response = $GLOBALS['http']->request('GET', '/api/users/@me', [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $_SESSION['auth_token']\n ]\n]);\n\n$responseBody = $response->getBody(true); \n$response = json_decode($responseBody, true);\n$_SESSION['username'] = $response['username'];\n$_SESSION['discrim'] = $response['discriminator'];\n$_SESSION['user_id'] = $response['id'];\n$_SESSION['user_avatar'] = $response['avatar'];\n}", "protected function getPrivateKeysRequest()\n {\n\n $resourcePath = '/v1/account/privkey';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function get_user()\n\t{\n\t\t$username = 'root';\n\t\t$password = md5('123');\n\n\t\t//将数据存储到数据中\n\t\t$arr = array(\n\t\t\t'username'\t=>\t$username,\n\t\t\t'psd' \t\t=>\t$password\n\t\t);\n\n\t\t$this->load->model('user_model','user');\n\t\t$data = $this->user->get_user($arr);\n\t\techo $this->_gen_userinfo_json($data);\n\t}", "public function findUsername($request)\n {\n return self::tikApi([\n 'request_type' => 'GET',\n 'endpoint_url' => 'https://api.tikapi.io/public/check?username='.$request\n ]);\n }", "public function get_userDetails($user_id){\n\t\t\t//$user_id=$this->session->userdata('user_id');\n\n //Connection establishment, processing of data and response from REST API\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/Project_posting_api/get_userDetails?user_id='.$user_id; \n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t\treturn $response; \n\t\t}", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "function file_get_contents_curl($mURL, $mACCESS) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $mURL);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$mACCESS\");\n curl_setopt($ch, CURLOPT_PORT, 80);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function auth($username, $password) {\n\n // curl function to backend\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"http://afsaccess2.njit.edu/~es66/login.php\");\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&password='.$password);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n $decoded_json = json_decode($output);\n if ($decoded_json->{\"login\"} == \"success\") {\n $json[\"login\"] = \"ok\";\n if ($decoded_json->{\"Type\"} == \"1\") {\n $json[\"type\"] = \"instructor\";\n } else {\n $json[\"type\"] = \"student\";\n }\n //$json[\"type\"]=$decoded_json->{\"type\"};\n $json[\"username\"] = $decoded_json->{\"username\"};\n $json[\"firstname\"] = $decoded_json->{\"firstname\"};\n $json[\"lastname\"] = $decoded_json->{\"lastname\"};\n } else {\n $json[\"login\"] = \"bad\";\n }\n curl_close($ch);\n echo json_encode($json);\n}", "function getClientURL($id, $username, $businessSector, $name, $phone, $email, $fax, $search)\n{\n $url = getAPIBaseDomain().'/api/Client/'.$id.'?username='.$username.'&businessSector='.$businessSector.'&name='.$name.'&phone='.$phone.'&email='.$email.'&fax='.$fax.'&search='.$search;\n return $url;\n}", "public function show($key)\n {\n //\n $user = User::where('user_key' ,'!=' , $key)->get(['avatar','lastname','name','user_key']);\n\n return Response()->json([\n 'users' => $user,\n ],200);\n }", "function github_request($url)\r\n{\r\n $ch = curl_init();\r\n\r\n $access = 'username:db1ff77b2eb06b3aa967e28f1943193ac831f064';\r\n\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/xml'));\r\n curl_setopt($ch, CURLOPT_USERAGENT, 'Agent smith');\r\n curl_setopt($ch, CURLOPT_HEADER, 0);\r\n curl_setopt($ch, CURLOPT_USERPWD, $access);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n $output = curl_exec($ch);\r\n curl_close($ch);\r\n $result = json_decode(trim($output), true);\r\n return $result;\r\n}", "public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}", "function qt_get($protocol,$host,$uri,$auth,$parms = array())\n{\n $url = \"$protocol://$host\";\n if ( strlen($uri) )\n $url .= $uri;\n\n if ( !empty($parms) )\n {\n $url .= '?';\n\n foreach($parms as $k => $v)\n $url .= $k . '=' . $v . '&';\n $url = rtrim($url,'&');\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERAGENT, 'phpAPI');\n\n qt_curl_header('','',1);\n qt_curl_code('',1);\n curl_setopt($ch, CURLOPT_HEADERFUNCTION, \"qt_curl_header\");\n if ( strlen($auth) )\n curl_setopt($ch, CURLOPT_HTTPHEADER,array(\"Authorization: $auth\"));\n\n $out = curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n qt_curl_code($httpCode);\n curl_close($ch);\n\n return $out;\n}", "function curlRequest($url, $authHeader){\n //Initialize the Curl Session.\n $ch = curl_init();\n //Set the Curl url.\n curl_setopt ($ch, CURLOPT_URL, $url);\n //Set the HTTP HEADER Fields.\n curl_setopt ($ch, CURLOPT_HTTPHEADER, array($authHeader));\n //CURLOPT_RETURNTRANSFER- TRUE to return the transfer as a string of the return value of curl_exec().\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n //CURLOPT_SSL_VERIFYPEER- Set FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, False);\n //Execute the cURL session.\n $curlResponse = curl_exec($ch);\n //Get the Error Code returned by Curl.\n $curlErrno = curl_errno($ch);\n if ($curlErrno) {\n $curlError = curl_error($ch);\n throw new Exception($curlError);\n }\n //Close a cURL session.\n curl_close($ch);\n return $curlResponse;\n }", "public function curlGetCall( $url ) \n {\n \n try\n {\n $requestTime = date('r');\n #CURL REQUEST PROCESS-START#\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($curl);\n }\n catch( Exception $e)\n {\n $strResponse = \"\";\n $strErrorCode = $e->getCode();\n $strErrorMessage = $e->getMessage();\n die('Connection Failure with API');\n }\n $responseArr = json_decode($result,true);\n return $responseArr;\n }", "public function ExecRequest($url, $access_token, $get_params) {\r\n // Create request string.\r\n // $full_url = http_build_query($url, $get_params);\r\n\t//print $url . $get_params; die;\r\n $r = $this->InitCurl($url);\r\n \r\n curl_setopt($r, CURLOPT_HTTPHEADER, array (\r\n \"Authorization: Basic \" . base64_encode($access_token)\r\n ));\r\n\t\t\r\n\t\tcurl_setopt($r, CURLOPT_POST, true);\r\n curl_setopt($r, CURLOPT_POSTFIELDS, $get_params);\r\n \r\n $response = curl_exec($r);\r\n if ($response == false) {\r\n die(\"curl_exec() failed. Error: \" . curl_error($r));\r\n }\r\n \r\n //Parse JSON return object.\r\n return json_decode($response); \r\n }", "public function get_userInfo($user_id){\n\n\t\t\t//$user_id=$this->session->userdata('user_id');\n\t\t\t//$profile_type=$this->session->userdata('profile_type');\n\n\n//\t\t\tif(($this->session->userdata('selected_profile_type'))!=''){\n//\t\t\t\t$profile_type=$this->session->userdata('selected_profile_type');\n//\t\t\t}\n\t\t//Connection establishment, processing of data and response from REST API\n\t\t\t$path=base_url();\n\t\t\t$url = $path.'api/ViewProfile_api/get_userInfo?user_id='.$user_id;\t\n\t\t\t$ch = curl_init($url);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$response_json = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t\t$response=json_decode($response_json, true);\n\t\t\treturn $response;\t\n\t\t}", "function curlGet($url) {\n\t\t$ch = curl_init();\t// Initialising cURL session\n\t\t// Setting cURL options\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t$results = curl_exec($ch);\t// Executing cURL session\n\t\tcurl_close($ch);\t// Closing cURL session\n\t\treturn $results;\t// Return the results\n\t}", "function user_data($key){\n global $mysqli;\n @$token = addslashes($_SESSION['user']['token']);\n @$username = addslashes($_SESSION['user']['name']);\n\n if(!isset($token) && !isset($username)){\n return false;\n } else {\n\n $sql = \"SELECT * FROM user WHERE username = '\" . $username . \"' AND token = '\" . $token . \"'\";\n $result = $mysqli->query($sql);\n\n $result = $result->fetch_object();\n return @$result->$key;\n }\n }", "public function loginUserWebAuthnGetAction(Request $request)\n {\n // Make sure that the client is providing something that we can consume\n $consumes = ['application/json'];\n if (!static::isContentTypeAllowed($request, $consumes)) {\n // We can't consume the content that the client is sending us\n return new Response('', 415);\n }\n\n // Figure out what data format to return to the client\n $produces = ['application/json'];\n // Figure out what the client accepts\n $clientAccepts = $request->headers->has('Accept')?$request->headers->get('Accept'):'*/*';\n $responseFormat = $this->getOutputFormat($clientAccepts, $produces);\n if ($responseFormat === null) {\n return new Response('', 406);\n }\n\n // Handle authentication\n // Authentication 'csrf' required\n // Set key with prefix in header\n $securitycsrf = $request->headers->get('X-CSRF-TOKEN');\n\n // Read out all input parameter values into variables\n $userWebAuthnGet = $request->getContent();\n\n // Use the default value if no value was provided\n\n // Deserialize the input values that needs it\n try {\n $inputFormat = $request->getMimeType($request->getContentType());\n $userWebAuthnGet = $this->deserialize($userWebAuthnGet, 'OpenAPI\\Server\\Model\\UserWebAuthnGet', $inputFormat);\n } catch (SerializerRuntimeException $exception) {\n return $this->createBadRequestResponse($exception->getMessage());\n }\n\n // Validate the input values\n $asserts = [];\n $asserts[] = new Assert\\NotNull();\n $asserts[] = new Assert\\Type(\"OpenAPI\\Server\\Model\\UserWebAuthnGet\");\n $asserts[] = new Assert\\Valid();\n $response = $this->validate($userWebAuthnGet, $asserts);\n if ($response instanceof Response) {\n return $response;\n }\n\n\n try {\n $handler = $this->getApiHandler();\n\n // Set authentication method 'csrf'\n $handler->setcsrf($securitycsrf);\n \n // Make the call to the business logic\n $responseCode = 200;\n $responseHeaders = [];\n $result = $handler->loginUserWebAuthnGet($userWebAuthnGet, $responseCode, $responseHeaders);\n\n // Find default response message\n $message = '';\n\n // Find a more specific message, if available\n switch ($responseCode) {\n case 200:\n $message = 'OK';\n break;\n case 405:\n $message = 'Invalid input';\n break;\n }\n\n return new Response(\n $result !== null ?$this->serialize($result, $responseFormat):'',\n $responseCode,\n array_merge(\n $responseHeaders,\n [\n 'Content-Type' => $responseFormat,\n 'X-OpenAPI-Message' => $message\n ]\n )\n );\n } catch (Exception $fallthrough) {\n return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough));\n }\n }", "public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }", "function vimeo_call($user_id,$request) {\n\t$curl = curl_init( $_GLOBALS['vimeo_base_url'] . $user_id . '/' . $request . '.php');\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_TIMEOUT, 30);\n\tcurl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);\n\t$return = curl_exec($curl);\n\tcurl_close($curl);\n\treturn unserialize($return);\n}", "public function helloworld_get() {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => '[email protected]'],\n ['id' => 1, 'name' => 'Jim', 'email' => '[email protected]'],\n ];\n\n\t\t// Set the response and exit\n\t\t$this->response( $users, 200 );\n\t}", "public function get_user_info() : bool {\n\t\t$req = self::init_req( ( (object) self::$URLS )->post );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tself::$httpResponseText = curl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}" ]
[ "0.6602886", "0.6015179", "0.59789693", "0.58957547", "0.5778181", "0.5730556", "0.5724307", "0.57089615", "0.57039416", "0.57019913", "0.5691763", "0.56494004", "0.5615287", "0.55970925", "0.5588781", "0.5579901", "0.5578215", "0.5551597", "0.55246246", "0.5513604", "0.5505416", "0.5483161", "0.5477736", "0.5468225", "0.546577", "0.54605526", "0.54492784", "0.5416757", "0.5408276", "0.54026544", "0.5396437", "0.5395417", "0.5392001", "0.53823656", "0.5376008", "0.53754467", "0.5375039", "0.5368959", "0.5360957", "0.53575474", "0.5353533", "0.53487515", "0.5341132", "0.53395575", "0.53311116", "0.53299564", "0.53238046", "0.5317605", "0.5312624", "0.5311722", "0.5309173", "0.5305757", "0.5295664", "0.5294047", "0.5287344", "0.52657163", "0.5265299", "0.5260114", "0.525809", "0.52508205", "0.5241573", "0.5237248", "0.52291715", "0.52271056", "0.52240646", "0.5214295", "0.52141976", "0.52138317", "0.521203", "0.52104366", "0.5209537", "0.5207326", "0.5206277", "0.5202419", "0.5201121", "0.52004623", "0.5198549", "0.51898116", "0.5184151", "0.5182736", "0.5177963", "0.5172826", "0.5169829", "0.5162547", "0.5157525", "0.51533544", "0.5137758", "0.5134097", "0.5129445", "0.5123949", "0.5122233", "0.5118428", "0.511242", "0.5109173", "0.5100896", "0.5098663", "0.50971055", "0.5091788", "0.50915945", "0.50824183" ]
0.593411
3
This is the helping function
private function just_curl_get_data($url,$data) { $json_str = file_get_contents($this->cil_config_file); $json = json_decode($json_str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc))); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($ch, CURLOPT_POSTFIELDS,$data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function help();", "public function printHelp();", "abstract public function displayHelp();", "protected function isHelp() {}", "protected function renderHelp() {}", "public function helpAction() {}", "public function get_help()\n\t{\n\t\treturn '';\n\t}", "public function cli_help() {}", "public function setup_help_tab()\n {\n }", "public function help() {\n $this->say(\"Please let me help!\");\n\n $this->say(\"I'm Martha and I can help you answer questions and find things online. Try asking:\");\n\n $suggestions = $this->suggest(3);\n\n if($this->_context != 'web') {\n foreach($suggestions as $suggestion) {\n $this->say($suggestion);\n }\n $this->say(\"I can talk to all of these APIs thanks to Temboo! https://temboo.com\");\n $this->say(\"You can read my source at https://github.com/temboo/martha\");\n } else {\n foreach($suggestions as $suggestion) {\n $this->say('<p><a href=\"?query=' . htmlentities($suggestion, ENT_COMPAT, 'UTF-8') . '\" class=\"suggestion\">\"' . htmlentities($suggestion, ENT_NOQUOTES, 'UTF-8') . '\"</a></p>', true);\n }\n $this->say('<p>I can talk to all of these APIs thanks to <a href=\"https://temboo.com/\" target=\"_blank\">Temboo</a>!</p>', true);\n $this->say('<p>You can read my source at <a href=\"https://github.com/temboo/martha\" target=\"_blank\">Github</a>.</p>', true);\n }\n }", "function help($id) {\n echo helpHtml($id);\n}", "public function makeHelpButton() {}", "function help ( $help='help text', $caption='') {\n\n\t\t$compath = JURI::root() . 'administrator/components/'.JEV_COM_COMPONENT;\n\t\t$imgpath = $compath . '/assets/images';\n\n\t\tif (empty($caption)) $caption = '&nbsp;';\n\n\t\tif (substr($help, 0, 7) == 'http://' || substr($help, 0, 8) == 'https://') {\n\t\t\t//help text is url, open new window\n\t\t\t$onclick_cmd = \"window.open(\\\"$help\\\", \\\"help\\\", \\\"height=700,width=800,resizable=yes,scrollbars\\\");return false\";\n\t\t} else {\n\t\t\t// help text is plain text with html tags\n\t\t\t// prepare text as overlib parameter\n\t\t\t// escape \", replace new line by space\n\t\t\t$help = htmlspecialchars($help, ENT_QUOTES);\n\t\t\t$help = str_replace('&quot;', '\\&quot;', $help);\n\t\t\t$help = str_replace(\"\\n\", \" \", $help);\n\n\t\t\t$ol_cmds = 'RIGHT, ABOVE, VAUTO, WRAP, STICKY, CLOSECLICK, CLOSECOLOR, \"white\"';\n\t\t\t$ol_cmds .= ', CLOSETEXT, \"<span style=\\\"border:solid white 1px;padding:0px;margin:1px;\\\"><b>X</b></span>\"';\n\t\t\t$onclick_cmd = 'return overlib(\"'.$help.'\", ' . $ol_cmds . ', CAPTION, \"'.$caption.'\")';\n\t\t}\n\n\t\t// RSH 10/11/10 - Added float:none for 1.6 compatiblity - The default template was floating images to the left\n\t\t$str = '<img border=\"0\" style=\"float: none; vertical-align:bottom; cursor:help;\" alt=\"'. JText::_('JEV_HELP') . '\"'\n\t\t. ' title=\"' . JText::_('JEV_HELP') .'\"'\n\t\t. ' src=\"' . $imgpath . '/help_ques_inact.gif\"'\n\t\t. ' onmouseover=\\'this.src=\"' . $imgpath . '/help_ques.gif\"\\''\n\t\t. ' onmouseout=\\'this.src=\"' . $imgpath . '/help_ques_inact.gif\"\\''\n\t\t. ' onclick=\\'' . $onclick_cmd . '\\' />';\n\n\t\treturn $str;\n\t}", "function print_help(){\necho \"Napoveda pre skript na analyzu funkcii v hlavickovych suboroch jazyka C. \\n\";\necho \"Skript je mozne spustit s nasledovnymi parametrami: \\n\";\necho \"--help: zobrazi napovedu \\n\";\necho \"--input=NIECO: kde nieco reprezentuje subor alebo adresar\\n\";\necho \"--output=subor: kde subor je vystupny subor pre zapis. Implicitne stdout\\n\";\necho \"--pretty-xml=k: odsadi vystup o k medzier, implicitne o 4\\n\";\necho \"--no-inline: preskakuje funkcie so specifikatorom inline\\n\";\necho \"--max-par=n: nevypise funkcie s n a viac parametrami\\n\";\necho \"--no-duplicates: v pripade definicie aj deklaracie funkcie vypise funkciu len jedenkrat\\n\";\necho \"--no-whitespaces: odstrani prebytocne biele znaky vo funkciach\"; \nexit (0); \n}", "public static function render_help() {\n\n // Grab the current screen\n $screen = get_current_screen();\n\n }", "function exampleHelpFunction()\n {\n //用法 >> exampleHelpFunction() \n return '這樣就能使用全域function了!';\n }", "function help()\n\t{\n\t\t$help['b'] = array();\n\t\t$help['i'] = array();\n\t\t\n\t\t$help['b'][] = 'Laisser une ligne vide entre chaque bloc <em>de même nature</em>.';\n\t\t$help['b'][] = '<strong>Paragraphe</strong> : du texte et une ligne vide';\n\t\t\n\t\tif ($this->getOpt('active_title')) {\n\t\t\t$help['b'][] = '<strong>Titre</strong> : <code>!!!</code>, <code>!!</code>, '.\n\t\t\t'<code>!</code> pour des titres plus ou moins importants';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_hr')) {\n\t\t\t$help['b'][] = '<strong>Trait horizontal</strong> : <code>----</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_lists')) {\n\t\t\t$help['b'][] = '<strong>Liste</strong> : ligne débutant par <code>*</code> ou '.\n\t\t\t'<code>#</code>. Il est possible de mélanger les listes '.\n\t\t\t'(<code>*#*</code>) pour faire des listes de plusieurs niveaux. '.\n\t\t\t'Respecter le style de chaque niveau';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_pre')) {\n\t\t\t$help['b'][] = '<strong>Texte préformaté</strong> : espace devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_quote')) {\n\t\t\t$help['b'][] = '<strong>Bloc de citation</strong> : <code>&gt;</code> ou '.\n\t\t\t'<code>;:</code> devant chaque ligne de texte';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_fr_syntax')) {\n\t\t\t$help['i'][] = 'La correction de ponctuation est active. Un espace '.\n\t\t\t\t\t\t'insécable remplacera automatiquement tout espace '.\n\t\t\t\t\t\t'précédant les marques \";\",\"?\",\":\" et \"!\".';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_em')) {\n\t\t\t$help['i'][] = '<strong>Emphase</strong> : deux apostrophes <code>\\'\\'texte\\'\\'</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_strong')) {\n\t\t\t$help['i'][] = '<strong>Forte emphase</strong> : deux soulignés <code>__texte__</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_br')) {\n\t\t\t$help['i'][] = '<strong>Retour forcé à la ligne</strong> : <code>%%%</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_ins')) {\n\t\t\t$help['i'][] = '<strong>Insertion</strong> : deux plus <code>++texte++</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_del')) {\n\t\t\t$help['i'][] = '<strong>Suppression</strong> : deux moins <code>--texte--</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_urls')) {\n\t\t\t$help['i'][] = '<strong>Lien</strong> : <code>[url]</code>, <code>[nom|url]</code>, '.\n\t\t\t'<code>[nom|url|langue]</code> ou <code>[nom|url|langue|titre]</code>.';\n\t\t\t\n\t\t\t$help['i'][] = '<strong>Image</strong> : comme un lien mais avec une extension d\\'image.'.\n\t\t\t'<br />Pour désactiver la reconnaissance d\\'image mettez 0 dans un dernier '.\n\t\t\t'argument. Par exemple <code>[image|image.gif||0]</code> fera un lien vers l\\'image au '.\n\t\t\t'lieu de l\\'afficher.'.\n\t\t\t'<br />Il est conseillé d\\'utiliser la nouvelle syntaxe.';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_img')) {\n\t\t\t$help['i'][] = '<strong>Image</strong> (nouvelle syntaxe) : '.\n\t\t\t'<code>((url|texte alternatif))</code>, '.\n\t\t\t'<code>((url|texte alternatif|position))</code> ou '.\n\t\t\t'<code>((url|texte alternatif|position|description longue))</code>. '.\n\t\t\t'<br />La position peut prendre les valeur L ou G (gauche), R ou D (droite) ou C (centré).';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_anchor')) {\n\t\t\t$help['i'][] = '<strong>Ancre</strong> : <code>~ancre~</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_acronym')) {\n\t\t\t$help['i'][] = '<strong>Acronyme</strong> : <code>??acronyme??</code> ou '.\n\t\t\t'<code>??acronyme|titre??</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_q')) {\n\t\t\t$help['i'][] = '<strong>Citation</strong> : <code>{{citation}}</code>, '.\n\t\t\t'<code>{{citation|langue}}</code> ou <code>{{citation|langue|url}}</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_code')) {\n\t\t\t$help['i'][] = '<strong>Code</strong> : <code>@@code ici@@</code>';\n\t\t}\n\t\t\n\t\tif ($this->getOpt('active_footnotes')) {\n\t\t\t$help['i'][] = '<strong>Note de bas de page</strong> : <code>$$Corps de la note$$</code>';\n\t\t}\n\t\t\n\t\t$res = '<dl class=\"wikiHelp\">';\n\t\t\n\t\t$res .= '<dt>Blocs</dt><dd>';\n\t\tif (count($help['b']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode('&nbsp;;</li><li>', $help['b']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '<dt>Éléments en ligne</dt><dd>';\n\t\tif (count($help['i']) > 0)\n\t\t{\n\t\t\t$res .= '<ul><li>';\n\t\t\t$res .= implode('&nbsp;;</li><li>', $help['i']);\n\t\t\t$res .= '.</li></ul>';\n\t\t}\n\t\t$res .= '</dd>';\n\t\t\n\t\t$res .= '</dl>';\n\t\t\n\t\treturn $res;\t\n\t}", "public function getHelp()\n\t{\n\t\treturn $this->run(array('help'));\n\t}", "public function get_help(){\n $tmp=self::_pipeExec('\"'.$this->cmd.'\" --extended-help');\n return $tmp['stdout'];\n }", "public static function add_help_text()\n {\n }", "function validate_help(){ \n\t\tif($this->help){\n\t\t\tif(isset($this->input)|| isset($this->output) || isset($this->param_root) || isset($this->query) || isset($this->qf) || $this->n){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->help();\n\t\t\t}\n\t\t}\n\t\treturn true; \n }", "public function help()\n {\n $help = file_get_contents(BUILTIN_SHELL_HELP . 'list.txt');\n $this->put($help);\n }", "function ShowAdminHelp()\r\n{\r\n\tglobal $txt, $helptxt, $context, $scripturl;\r\n\r\n\tif (!isset($_GET['help']) || !is_string($_GET['help']))\r\n\t\tfatal_lang_error('no_access', false);\r\n\r\n\tif (!isset($helptxt))\r\n\t\t$helptxt = array();\r\n\r\n\t// Load the admin help language file and template.\r\n\tloadLanguage('Help');\r\n\r\n\t// Permission specific help?\r\n\tif (isset($_GET['help']) && substr($_GET['help'], 0, 14) == 'permissionhelp')\r\n\t\tloadLanguage('ManagePermissions');\r\n\r\n\tloadTemplate('Help');\r\n\r\n\t// Set the page title to something relevant.\r\n\t$context['page_title'] = $context['forum_name'] . ' - ' . $txt['help'];\r\n\r\n\t// Don't show any template layers, just the popup sub template.\r\n\t$context['template_layers'] = array();\r\n\t$context['sub_template'] = 'popup';\r\n\r\n\t// What help string should be used?\r\n\tif (isset($helptxt[$_GET['help']]))\r\n\t\t$context['help_text'] = $helptxt[$_GET['help']];\r\n\telseif (isset($txt[$_GET['help']]))\r\n\t\t$context['help_text'] = $txt[$_GET['help']];\r\n\telse\r\n\t\t$context['help_text'] = $_GET['help'];\r\n\r\n\t// Does this text contain a link that we should fill in?\r\n\tif (preg_match('~%([0-9]+\\$)?s\\?~', $context['help_text'], $match))\r\n\t\t$context['help_text'] = sprintf($context['help_text'], $scripturl, $context['session_id'], $context['session_var']);\r\n}", "function clshowhelp() {\n\tglobal $CLHELP;\n\tforeach ( $CLHELP as $msg) {\n\t\tif ( substr( $msg, strlen( $msg) - 1, 1) != \"\\n\") $msg .= \"\\n\"; \t// no end line in this msg, add one\n\t\techo $msg;\n\t}\n\t\n}", "function print_help()\r\n{\r\n echo <<<HELP\r\ncryptor -e <input-file> [ -o <output-file> ]\r\ncryptor -d <input-file> [ -o <output-file> ]\r\n\r\nHELP;\r\n return 1;\r\n}", "function helps()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['helps'] == 1 ) ? 'Help File' : 'Help Files';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t$helpkeys = array();\n\t\t\n\t\tforeach ( $this->xml_array['helps_group']['help'] as $k => $v )\n\t\t{\n\t\t\t$helpkeys[] = \"'{$v['title']['VALUE']}'\";\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_delete( 'faq', \"title IN (\".implode( \",\", $helpkeys ).\")\" );\n\t\t\n\t\tif ( !$this->ipsclass->input['un'] )\n\t\t{\n\t\t\tforeach ( $this->xml_array['helps_group']['help'] as $k => $v )\n\t\t\t{\n\t\t\t\t$this->_add_help( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}{$group}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['helps']} {$object} {$operation}....\" );\n\t}", "protected function checkForHelp() {\n\t\tif ($this->commandLineOptions->hasOption(tx_mnogosearch_clioptions::HELP)) {\n\t\t\t$this->showUsageAndExit();\n\t\t}\n\t}", "function help()\n {\n return\n \"\\n -------------------------------------------------------------------------\\n\".\n \" ---- ~ BidVest Data : Assessment Commands ~ -------\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" All comamnds begin with '\\e[1m\\033[92mphp run.php\\033[0m'\\e[0m\\n\".\n \" Then append of the folling options: \\n\".\n \" -------------------------------------------------------------------------\\n\".\n \"\\n\\n\".\n \" 1. \\e[1m --action=\\033[34madd \\033[0m \\e[0m : \\e[3mThis allows you to add a record.\\e[0m \\n\\n\".\n \" 2. \\e[1m --action=\\033[33medit \\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mEdit a student record.\\e[0m \\n\\n\".\n \" (leave filed blank to keep previous value)\\n\\n\".\n \" 3. \\e[1m --action=\\033[91mdelete\\033[0m \\e[1m--id=<vaild_id>\\e[0m \\e[0m : \\e[3mDelete a student record (remove file only).\\e[0m \\n\\n\".\n \" 4. \\e[1m --action=\\033[36msearch \\033[0m \\e[0m : \\e[3mSearch for a student record. \\e[0m \\n\\n\".\n \" -------------------------------------------------------------------------\\n\\n\".\n \" Where \\e[1m<valid_id>\\e[0m must be an 8-digit number.\\n\\n\".\n \" -------------------------------------------------------------------------\\n\";\n }", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t\n\t\treturn $help;\n\t}", "function display_help () {\nprint \"Cacti ICMP Pinger v1.0, Copyright 2008 - The Cacti Group\\n\";\n\tprint \"usage: host_icmp_ping.php [--host-id=[n] | --hostname='ip'] [--timeout=[n]] [--retries=[n]] [-d] [-h] [--help] [-v] [--version]\\n\\n\";\n\tprint \"Required:\\n\";\n\tprint \"--host-id=n - The host_id to have templates reapplied 'all' to do all hosts\\n\";\n\tprint \"--hostname='ip' - The hostname to be pinged\\n\\n\";\n\tprint \"Optional:\\n\";\n\tprint \"--timeout=n - The timeout in milliseconds\\n\";\n\tprint \"--retries=n - The number of times to retry the ping\\n\";\n\tprint \"-d - Display verbose output during execution\\n\";\n\tprint \"-v --version - Display this help message\\n\";\n\tprint \"-h --help - Display this help message\\n\\n\";\n}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t$help [__CLASS__] [\"text\"] [] .= \"Zabbix Interface :\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_interface_ip 10.10.10.10 IP du CI\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_interface_fqdn ci.client.fr.ghc.local FQDN du CI\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_interface_resolv_fqdn IP|FQDN Si l'IP et le FQDN son fourni, permet de connaitre la methode a utiliser pour contacter le CI\";\n\t\t\n\t\treturn $help;\n\t}", "public function displayHelp()\n {\n $sHelp = \"\nUsage:\n$this->sViewName [options]\n\n$this->sTempalteDesc\n\nOptions:\\n\";\n\n $iMaxLength = 2;\n\n foreach ($this->hOptionList as $hOption)\n {\n if (isset($hOption['long']))\n {\n $iTemp = strlen($hOption['long']);\n\n if ($iTemp > $iMaxLength)\n {\n $iMaxLength = $iTemp;\n }\n }\n }\n\n foreach ($this->hOptionList as $hOption)\n {\n $bShort = isset($hOption['short']);\n $bLong = isset($hOption['long']);\n\n if (!$bShort && !$bLong)\n {\n continue;\n }\n\n if ($bShort && $bLong)\n {\n $sOpt = '-' . $hOption['short'] . ', --' . $hOption['long'];\n }\n elseif ($bShort && !$bLong)\n {\n $sOpt = '-' . $hOption['short'] . \"\\t\";\n }\n elseif (!$bShort && $bLong)\n {\n $sOpt = ' --' . $hOption['long'];\n }\n\n $sOpt = str_pad($sOpt, $iMaxLength + 7);\n $sHelp .= \"\\t$sOpt\\t\\t{$hOption['desc']}\\n\\n\";\n }\n\n die($sHelp . \"\\n\");\n }", "function showHelp()\n{\n $help = <<<EOD\n\nbulk_convert - Command-line tool to convert fonts data for the tc-lib-pdf-font library.\n\nUsage:\n bulk_convert.php [ options ]\n\nOptions:\n\n -o, --outpath\n Output path for generated font files (must be writeable by the\n web server). Leave empty for default font folder.\n\n -h, --help\n Display this help and exit.\n\nEOD;\n fwrite(STDOUT, $help);\n exit(0);\n}", "public function help() {\r\n return array(\"Success\" => \"Hello World\");\r\n }", "public function getHelp()\n {\n return $this->run(array(\n 'help'\n ));\n }", "function ren_help($mode = 1, $addtextfunc = \"addtext\", $helpfunc = \"help\")\n{\n return display_help(\"helpb\", $mode, $addtextfunc, $helpfunc = \"help\");\n}", "function writeHelp() {\n\t\t$pt1 = array(\t'title' => 'Valid commands',\n\t\t\t\t\t\t'text' => \"Please enter a request in the following format:\\n/cherwell I ##### for an incident\\n/cherwell T ##### for a task\\n/cherwell C ##### for a change request\",\n\t\t\t\t\t\t'color' => \"#b3003b\");\n\t\t$pt2 = array(\t'fallback'=>\"Help\", 'attachments' => array($pt1));\n\t\treturn json_encode($pt2);\n\t}", "function Help() {\r\n\t\t\r\n\t\tglobal $path, $backgroundColor, $IP, $language;\r\n\t\tif( file_exists( \"$path.help.$language.ihtml\" ) ) include_once( \"$path.help.$language.ihtml\" );\r\n\t\telse include_once( \"$path.help.fr.ihtml\" );\r\n\t}", "function acp_helps()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['acp_helps'] == 1 ) ? 'ACP Help Entry' : 'ACP Help Entries';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t$helpkeys = array();\n\t\t\n\t\tforeach ( $this->xml_array['acp_helps_group']['acp_help'] as $k => $v )\n\t\t{\n\t\t\t$helpkeys[] = \"'{$v['page_key']['VALUE']}'\";\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_delete( 'acp_help', \"page_key IN (\".implode( \",\", $helpkeys ).\")\" );\n\t\t\n\t\tif ( !$this->ipsclass->input['un'] )\n\t\t{\n\t\t\tforeach ( $this->xml_array['acp_helps_group']['acp_help'] as $k => $v )\n\t\t\t{\n\t\t\t\t$this->_add_acp_help( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}{$group}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['acp_helps']} {$object} {$operation}....\" );\n\t}", "public function visitHelpPage()\n {\n $this->data .= \"\n /* --- visitHelpPage --- */\n _ra.visitHelpPage = {'visit': true};\n \n if (_ra.ready !== undefined) {\n _ra.visitHelpPage();\n }\n \";\n\n return $this->data;\n }", "function getHelp()\n {\n return $this->help;\n }", "public function help()\r\n\t{\r\n\t\t// You could include a file and return it here.\r\n\t\treturn \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n\t}", "public function getHelp()\n\t{\n\t return '<info>Console Tool</info>';\n\t}", "function showHelp()\n{\n global $cli;\n\n $cli->writeln(sprintf(_(\"Usage: %s [OPTIONS]...\"), basename(__FILE__)));\n $cli->writeln();\n $cli->writeln(_(\"Mandatory arguments to long options are mandatory for short options too.\"));\n $cli->writeln();\n $cli->writeln(_(\"-h, --help Show this help\"));\n $cli->writeln(_(\"-u, --username[=username] Horde login username\"));\n $cli->writeln(_(\"-p, --password[=password] Horde login password\"));\n $cli->writeln(_(\"-t, --type[=type] Export format\"));\n $cli->writeln(_(\"-r, --rpc[=http://example.com/horde/rpc.php] Remote url\"));\n $cli->writeln();\n}", "protected function help()\n\t{\n\t\t$this->out('Getsocialdata ' . self::VERSION);\n\t\t$this->out();\n\t\t$this->out('Usage: php -f bin/getdata.php -- [switches]');\n\t\t$this->out();\n\t\t$this->out('Switches: -h | --help Prints this usage information.');\n\t\t$this->out();\n\t\t$this->out();\n\t}", "public function help()\n\t{\n\t\t// You could include a file and return it here.\n\t\treturn \"<h4>Overview</h4>\n\t\t<p>The Inventory module will work like magic. The End!</p>\";\n\t}", "function print_help($err_code = 0)\n{\n\tprintf(\"\n\tHelp:\\n\n\t--help - this help will be printed\n\t--input=FILE_NAME - input xml file (if not provided stdin is used)\n\t--output=FILE_NAME - output file\n\t--header='HEADER' - this header will be written to the beginning of the output file\n\t--etc=N - max number of columns generated from same named sub elements\n\t-a - columns from attributes in imputed xml will not be generated\n\t-b - if element will have more sub elements of same name, only one will be generated\n\t - cannot be combined with --etc option\\n\\n\");\n\texit($err_code);\n}", "public function help()\n {\n // You could include a file and return it here.\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\n }", "public function helpStubCommand() {}", "public static function run()\n\t{\n\t\tstatic::help();\n\t}", "function print_help()\n{\n\techo \"skript lze spustit s nasledujicimi parametry:\n\\\t--format=filename \\tparametr urcujici formatovaci soubor, volitelny\n\\\t--input=filename \\tparametr urcujici vstupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vstup ocekavan na stdin\n\\\t--output=filename \\tparametr urcujici vystupni soubor, volitelny\n\\\t\\t\\t\\tpokud neni zadan vystup na stdout\n\\\t--br \\t\\t\\tpridani <br /> na konec kazdeho radku, volitelny\\n\";\n\texit (0);\n}", "function Help()\n{\n echo (\n \"------------------------------------------------------------------------------\\n\".\n \" --help - Show help\\n\".\n \" --input=filename.ext - Input file with xml\\n\".\n \" --output=filename.ext - Output file with xml\\n\".\n \" --query='query' - Query under xml - can not be used with -qf attribute\\n\".\n \" --qf=filename.ext - Filename with query under xml\\n\".\n \" -n - Xml will be generated without XML header\\n\".\n \" -root=element - Name of root element\\n\".\n \"------------------------------------------------------------------------------\\n\"\n );\n exit(code_error::OK);\n}", "public function getHelp(): string\n {\n return $this->help;\n }", "public function getHelp()\n {\n new Help('form');\n }", "public function help() {\n $screen = get_current_screen();\n SwpmFbUtils::help($screen);\n }", "function printHelp(){\n\techo PHP_EOL;\n\techo \"Usage: \".PHP_EOL;\n\techo \"php hashCLI.php hash [password]: To hash the password. \".PHP_EOL;\n\techo \"php hashCLI.php check [password] [hash]: To check if the hash corresponds to the password. \".PHP_EOL;\n\techo \"php hashCLI.php help: For help. \".PHP_EOL;\n}", "function printHelp(){\n\techo PHP_EOL;\n\techo \"Usage: \".PHP_EOL;\n\techo \"php hashCLI.php hash [password]: To hash the password. \".PHP_EOL;\n\techo \"php hashCLI.php check [password] [hash]: To check if the hash corresponds to the password. \".PHP_EOL;\n\techo \"php hashCLI.php help: For help. \".PHP_EOL;\n}", "public function help_callback(){\r\n if($this->help_static_file()) {\r\n echo self::read_help_file($this->help_static_file());\r\n }\r\n }", "public function help() \n {\n if (!isset($_SESSION)) { \n session_start(); \n }\n $title = 'Aide';\n $customStyle = $this->setCustomStyle('help');\n require('../src/View/HelpView.php');\n }", "static function help($description, $cmdline, array $parameters) \n {\n\n }", "public function help()\r\n{\r\n // You could include a file and return it here.\r\n return \"No documentation has been added for this module.<br />Contact the module developer for assistance.\";\r\n}", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t$help [__CLASS__] [\"text\"] [] .= \"Zabbix Host Interface :\";\n\t\t$help = array_merge ( $help, zabbix_common_interface::help () );\n\t\t\n\t\treturn $help;\n\t}", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "public function getHelp() {\n\t\treturn $this->help;\n\t}", "function help()\n\t{\n\t\t/* check if all required plugins are installed */\n\t\t\n\t\t$text = \"<div class='center buttons-bar'><form method='post' action='\".e_SELF.\"?\".e_QUERY.\"' id='core-db-import-form'>\";\n\t\t$text .= e107::getForm()->admin_button('importThemeDemo', 'Install Demo', 'other');\n\t\t$text .= '</form></div>';\n \n\t \treturn $text;\n\t}", "function ShowHelp()\r\n{\r\n\tglobal $settings, $user_info, $language, $context, $txt, $sourcedir, $options, $scripturl;\r\n\r\n\tloadTemplate('Help');\r\n\tloadLanguage('Manual');\r\n\r\n\t$manual_areas = array(\r\n\t\t'getting_started' => array(\r\n\t\t\t'title' => $txt['manual_category_getting_started'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t'introduction' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_intro'],\r\n\t\t\t\t\t'template' => 'manual_intro',\r\n\t\t\t\t),\r\n\t\t\t\t'main_menu' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_main_menu'],\r\n\t\t\t\t\t'template' => 'manual_main_menu',\r\n\t\t\t\t),\r\n\t\t\t\t'board_index' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_board_index'],\r\n\t\t\t\t\t'template' => 'manual_board_index',\r\n\t\t\t\t),\r\n\t\t\t\t'message_view' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_message_view'],\r\n\t\t\t\t\t'template' => 'manual_message_view',\r\n\t\t\t\t),\r\n\t\t\t\t'topic_view' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_topic_view'],\r\n\t\t\t\t\t'template' => 'manual_topic_view',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t\t'registering' => array(\r\n\t\t\t'title' => $txt['manual_category_registering'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t'when_how' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_when_how_register'],\r\n\t\t\t\t\t'template' => 'manual_when_how_register',\r\n\t\t\t\t),\r\n\t\t\t\t'registration_screen' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_registration_screen'],\r\n\t\t\t\t\t'template' => 'manual_registration_screen',\r\n\t\t\t\t),\r\n\t\t\t\t'activating_account' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_activating_account'],\r\n\t\t\t\t\t'template' => 'manual_activating_account',\r\n\t\t\t\t),\r\n\t\t\t\t'logging_in' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_logging_in_out'],\r\n\t\t\t\t\t'template' => 'manual_logging_in_out',\r\n\t\t\t\t),\r\n\t\t\t\t'password_reminders' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_password_reminders'],\r\n\t\t\t\t\t'template' => 'manual_password_reminders',\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t\t'profile_features' => array(\r\n\t\t\t'title' => $txt['manual_category_profile_features'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t'profile_info' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_profile_info'],\r\n\t\t\t\t\t'template' => 'manual_profile_info_summary',\r\n\t\t\t\t\t'description' => $txt['manual_entry_profile_info_desc'],\r\n\t\t\t\t\t'subsections' => array(\r\n\t\t\t\t\t\t'summary' => array($txt['manual_entry_profile_info_summary'], 'template' => 'manual_profile_info_summary'),\r\n\t\t\t\t\t\t'posts' => array($txt['manual_entry_profile_info_posts'], 'template' => 'manual_profile_info_posts'),\r\n\t\t\t\t\t\t'stats' => array($txt['manual_entry_profile_info_stats'], 'template' => 'manual_profile_info_stats'),\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t\t'modify_profile' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_modify_profile'],\r\n\t\t\t\t\t'template' => 'manual_modify_profile_settings',\r\n\t\t\t\t\t'description' => $txt['manual_entry_modify_profile_desc'],\r\n\t\t\t\t\t'subsections' => array(\r\n\t\t\t\t\t\t'settings' => array($txt['manual_entry_modify_profile_settings'], 'template' => 'manual_modify_profile_settings'),\r\n\t\t\t\t\t\t'forum' => array($txt['manual_entry_modify_profile_forum'], 'template' => 'manual_modify_profile_forum'),\r\n\t\t\t\t\t\t'look' => array($txt['manual_entry_modify_profile_look'], 'template' => 'manual_modify_profile_look'),\r\n\t\t\t\t\t\t'auth' => array($txt['manual_entry_modify_profile_auth'], 'template' => 'manual_modify_profile_auth'),\r\n\t\t\t\t\t\t'notify' => array($txt['manual_entry_modify_profile_notify'], 'template' => 'manual_modify_profile_notify'),\r\n\t\t\t\t\t\t'pm' => array($txt['manual_entry_modify_profile_pm'], 'template' => 'manual_modify_profile_pm'),\r\n\t\t\t\t\t\t'buddies' => array($txt['manual_entry_modify_profile_buddies'], 'template' => 'manual_modify_profile_buddies'),\r\n\t\t\t\t\t\t'groups' => array($txt['manual_entry_modify_profile_groups'], 'template' => 'manual_modify_profile_groups'),\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t\t'actions' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_profile_actions'],\r\n\t\t\t\t\t'template' => 'manual_profile_actions_subscriptions',\r\n\t\t\t\t\t'description' => $txt['manual_entry_modify_profile_desc'],\r\n\t\t\t\t\t'subsections' => array(\r\n\t\t\t\t\t\t'subscriptions' => array($txt['manual_entry_profile_actions_subscriptions'], 'template' => 'manual_profile_actions_subscriptions'),\r\n\t\t\t\t\t\t'delete' => array($txt['manual_entry_profile_actions_delete'], 'template' => 'manual_profile_actions_delete'),\r\n\t\t\t\t\t),\r\n\t\t\t\t),\r\n\t\t\t),\r\n\t\t),\r\n\t\t'posting_basics' => array(\r\n\t\t\t'title' => $txt['manual_category_posting_basics'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t/*'posting_screen' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_posting_screen'],\r\n\t\t\t\t\t'template' => 'manual_posting_screen',\r\n\t\t\t\t),*/\r\n\t\t\t\t'posting_topics' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_posting_topics'],\r\n\t\t\t\t\t'template' => 'manual_posting_topics',\r\n\t\t\t\t),\r\n\t\t\t\t/*'quoting_posts' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_quoting_posts'],\r\n\t\t\t\t\t'template' => 'manual_quoting_posts',\r\n\t\t\t\t),\r\n\t\t\t\t'modifying_posts' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_modifying_posts'],\r\n\t\t\t\t\t'template' => 'manual_modifying_posts',\r\n\t\t\t\t),*/\r\n\t\t\t\t'smileys' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_smileys'],\r\n\t\t\t\t\t'template' => 'manual_smileys',\r\n\t\t\t\t),\r\n\t\t\t\t'bbcode' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_bbcode'],\r\n\t\t\t\t\t'template' => 'manual_bbcode',\r\n\t\t\t\t),\r\n\t\t\t\t/*'wysiwyg' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_wysiwyg'],\r\n\t\t\t\t\t'template' => 'manual_wysiwyg',\r\n\t\t\t\t),*/\r\n\t\t\t),\r\n\t\t),\r\n\t\t'personal_messages' => array(\r\n\t\t\t'title' => $txt['manual_category_personal_messages'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t'messages' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_pm_messages'],\r\n\t\t\t\t\t'template' => 'manual_pm_messages',\r\n\t\t\t\t),\r\n\t\t\t\t/*'actions' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_pm_actions'],\r\n\t\t\t\t\t'template' => 'manual_pm_actions',\r\n\t\t\t\t),\r\n\t\t\t\t'preferences' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_pm_preferences'],\r\n\t\t\t\t\t'template' => 'manual_pm_preferences',\r\n\t\t\t\t),*/\r\n\t\t\t),\r\n\t\t),\r\n\t\t'forum_tools' => array(\r\n\t\t\t'title' => $txt['manual_category_forum_tools'],\r\n\t\t\t'description' => '',\r\n\t\t\t'areas' => array(\r\n\t\t\t\t'searching' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_searching'],\r\n\t\t\t\t\t'template' => 'manual_searching',\r\n\t\t\t\t),\r\n\t\t\t\t/*'memberlist' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_memberlist'],\r\n\t\t\t\t\t'template' => 'manual_memberlist',\r\n\t\t\t\t),\r\n\t\t\t\t'calendar' => array(\r\n\t\t\t\t\t'label' => $txt['manual_section_calendar'],\r\n\t\t\t\t\t'template' => 'manual_calendar',\r\n\t\t\t\t),*/\r\n\t\t\t),\r\n\t\t),\r\n\t);\r\n\r\n\t// Set a few options for the menu.\r\n\t$menu_options = array(\r\n\t\t'disable_url_session_check' => true,\r\n\t);\r\n\r\n\trequire_once($sourcedir . '/Subs-Menu.php');\r\n\t$manual_area_data = createMenu($manual_areas, $menu_options);\r\n\tunset($manual_areas);\r\n\r\n\t// Make a note of the Unique ID for this menu.\r\n\t$context['manual_menu_id'] = $context['max_menu_id'];\r\n\t$context['manual_menu_name'] = 'menu_data_' . $context['manual_menu_id'];\r\n\r\n\t// Get the selected item.\r\n\t$context['manual_area_data'] = $manual_area_data;\r\n\t$context['menu_item_selected'] = $manual_area_data['current_area'];\r\n\r\n\t// Set a title and description for the tab strip if subsections are present.\r\n\tif (isset($context['manual_area_data']['subsections']))\r\n\t\t$context[$context['manual_menu_name']]['tab_data'] = array(\r\n\t\t\t'title' => $manual_area_data['label'],\r\n\t\t\t'description' => isset($manual_area_data['description']) ? $manual_area_data['description'] : '',\r\n\t\t);\r\n\r\n\t// Bring it on!\r\n\t$context['sub_template'] = isset($manual_area_data['current_subsection'], $manual_area_data['subsections'][$manual_area_data['current_subsection']]['template']) ? $manual_area_data['subsections'][$manual_area_data['current_subsection']]['template'] : $manual_area_data['template'];\r\n\t$context['page_title'] = $manual_area_data['label'] . ' - ' . $txt['manual_smf_user_help'];\r\n\r\n\t// Build the link tree.\r\n\t$context['linktree'][] = array(\r\n\t\t'url' => $scripturl . '?action=help',\r\n\t\t'name' => $txt['help'],\r\n\t);\r\n\tif (isset($manual_area_data['current_area']) && $manual_area_data['current_area'] != 'index')\r\n\t\t$context['linktree'][] = array(\r\n\t\t\t'url' => $scripturl . '?action=admin;area=' . $manual_area_data['current_area'],\r\n\t\t\t'name' => $manual_area_data['label'],\r\n\t\t);\r\n\tif (!empty($manual_area_data['current_subsection']) && $manual_area_data['subsections'][$manual_area_data['current_subsection']][0] != $manual_area_data['label'])\r\n\t\t$context['linktree'][] = array(\r\n\t\t\t'url' => $scripturl . '?action=admin;area=' . $manual_area_data['current_area'] . ';sa=' . $manual_area_data['current_subsection'],\r\n\t\t\t'name' => $manual_area_data['subsections'][$manual_area_data['current_subsection']][0],\r\n\t\t);\r\n\r\n\t// We actually need a special style sheet for help ;)\r\n\t$context['template_layers'][] = 'manual';\r\n\r\n\t// The smiley info page needs some cheesy information.\r\n\tif ($manual_area_data['current_area'] == 'smileys')\r\n\t\tShowSmileyHelp();\r\n}", "public function index()\n {\n $this->help();\n }", "public function get_help_tabs()\n {\n }", "function help_page() {\n\t\techo \"<div class=\\\"wrap\\\">\";\n\t\techo \"<h2>Help</h2>\";\n\t\techo \"<p>1. Upload your assets, to upload your assets go to the Piecemaker>Assets and click the <em>Upload New Asset</em> button.\n\t\t\\n</br>2. Once your assets are uploaded it is time to create your first Piecemaker go to Piecemaker>Piecemakers and click the <em>Add New Piecemaker</em>, fill all the option and click <em>Add Piecemaker</em> button.\n\t\t\\n </br>3. After creating new piecemaker you have to add Slides and Transitions. Go to Piecemaker>Piecemakers and click the icons next to your slider.\n\t\t\\n </br>4. To add your piecemaker into the post or page just simple type [piecemaker id='your_id'/] your_id = id of the piecemaker (it is displayed in the Piecemakers section).\"; \n\t\techo \"</div>\";\n\t}", "function HelpAndDie()\n\t{\n\t\tglobal $argv;\n\t\tdie(\"Usage: $argv[0] <start/stop/restart/status/autostart/create>\\n\n start: Starts the Bittorrent tracker and initial client\n stop: Stops the Bittorrent tracker and initial client\n restart: Restarts the Bittorrent tracker and initial client\n status: Gives status information.\n autostart: Starts the Bittorrent tracker and initial client, if there are\n .torrent files in \\\"\".BT_DIR.\"\\\"\n create <Filename>: Creates a torrent file for an existing file under\n /m23/data+scripts/extraDebs/.\\n\\n\");\n\t}", "public function getHelpLines()\n {\n return array(\n 'Usage: php [function] [full]',\n '[function] - the PHP function you want to search for',\n //'[full] (optional) - add \"full\" after the function name to include the description',\n 'Returns information about the specified PHP function'\n );\n }", "function help($message = null) {\n if (!is_null($message))\n echo($message.NL.NL);\n\n $self = baseName($_SERVER['PHP_SELF']);\n\necho <<<HELP\n\n Syntax: $self [symbol ...]\n\n\nHELP;\n}", "public function help(){\n\t\t$screen = get_current_screen();\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/installing\" target=\"_blank\">' . __( 'Installing the Plugin', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/staying-updated\" target=\"_blank\">' . __( 'Staying Updated', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/glossary\" target=\"_blank\">' . __( 'Glossary', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-general-info',\n\t\t\t'title' => __( 'General Info', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/forms-interface\" target=\"_blank\">' . __( 'Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/forms-creating\" target=\"_blank\">' . __( 'Creating a New Form', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/forms-sorting\" target=\"_blank\">' . __( 'Sorting Your Forms', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/forms-building\" target=\"_blank\">' . __( 'Building Your Forms', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-forms',\n\t\t\t'title' => __( 'Forms', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/entries-interface\" target=\"_blank\">' . __( 'Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/entries-managing\" target=\"_blank\">' . __( 'Managing Your Entries', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/entries-searching-filtering\" target=\"_blank\">' . __( 'Searching and Filtering Your Entries', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-entries',\n\t\t\t'title' => __( 'Entries', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/email-design\" target=\"_blank\">' . __( 'Email Design Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/analytics\" target=\"_blank\">' . __( 'Analytics Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-email-analytics',\n\t\t\t'title' => __( 'Email Design &amp; Analytics', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/import\" target=\"_blank\">' . __( 'Import Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/export\" target=\"_blank\">' . __( 'Export Interface Overview', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-import-export',\n\t\t\t'title' => __( 'Import &amp; Export', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<ul>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/conditional-logic\" target=\"_blank\">' . __( 'Conditional Logic', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/templating\" target=\"_blank\">' . __( 'Templating', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/documentation/custom-capabilities\" target=\"_blank\">' . __( 'Custom Capabilities', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '<li><a href=\"http://vfbpro.com/hooks\" target=\"_blank\">' . __( 'Filters and Actions', 'visual-form-builder-pro' ) . '</a></li>';\n\t\t$help .= '</ul>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-advanced',\n\t\t\t'title' => __( 'Advanced Topics', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t\t$help = '<p>' . __( '<strong>Always load CSS</strong> - Force Visual Form Builder Pro CSS to load on every page. Will override \"Disable CSS\" option, if selected.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable CSS</strong> - Disable CSS output for all forms.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable Email</strong> - Disable emails from sending for all forms.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable Notifications Email</strong> - Disable notification emails from sending for all forms.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Skip Empty Fields in Email</strong> - Fields that have no data will not be displayed in the email.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable saving new entry</strong> - Disable new entries from being saved.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable saving entry IP address</strong> - An entry will be saved, but the IP address will be removed.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Place Address labels above fields</strong> - The Address field labels will be placed above the inputs instead of below.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Remove default SPAM Verification</strong> - The default SPAM Verification question will be removed and only a submit button will be visible.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Disable meta tag version</strong> - Prevent the hidden Visual Form Builder Pro version number from printing in the source code.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Skip PayPal redirect if total is zero</strong> - If PayPal is configured, do not redirect if the total is zero.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Prepend Confirmation</strong> - Always display the form beneath the text confirmation after the form has been submitted.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Max Upload Size</strong> - Restrict the file upload size for all forms.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>Sender Mail Header</strong> - Control the Sender attribute in the mail header. This is useful for certain server configurations that require an existing email on the domain to be used.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>reCAPTCHA Public Key</strong> - Required if \"Use reCAPTCHA\" option is selected in the Secret field.', 'visual-form-builder-pro' ) . '</p>';\n\t\t$help .= '<p>' . __( '<strong>reCAPTCHA Private Key</strong> - Required if \"Use reCAPTCHA\" option is selected in the Secret field.', 'visual-form-builder-pro' ) . '</p>';\n\n\t\t$screen->add_help_tab( array(\n\t\t\t'id' => 'vfb-help-tab-settings',\n\t\t\t'title' => __( 'Settings', 'visual-form-builder-pro' ),\n\t\t\t'content' => $help,\n\t\t) );\n\n\t}", "public function usage() {}", "public function help()\n\t{\n\t\t$this\n\t\t\t->output\n\t\t\t->addOverview(\n\t\t\t\t'Store shared configuration variables used by the command line tool.\n\t\t\t\tThese will, for example, be used to fill in docblock stubs when\n\t\t\t\tusing the scaffolding command.'\n\t\t\t)\n\t\t\t->addTasks($this)\n\t\t\t->addArgument(\n\t\t\t\t'--{keyName}',\n\t\t\t\t'Sets the variable keyName to the given value.',\n\t\t\t\t'Example: --name=\"John Doe\"'\n\t\t\t);\n\t}", "public static function help_inner () \n { \n $html = null;\n\n $top = __( 'Instruction Manual', 'label' );\n $inner = self::help_center();\n $bottom = self::page_foot();\n\n $html .= self::page_body( 'help', $top, $inner, $bottom );\n\n return $html;\n }", "function dfcg_plugin_help() {\n\t\n\tglobal $current_screen;\n\t\n\t$sidebar = dfcg_help_sidebar();\n\t\n\t$current_screen->set_help_sidebar( $sidebar );\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-general',\n\t\t'title' => __( 'General info', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_general'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-theme',\n\t\t'title' => __( 'Theme integration', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_theme'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-quick',\n\t\t'title' => __( 'Quick Start', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_quick'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-gallery',\n\t\t'title' => __( 'Gallery Method', DFCG_DOMAIN ),\n\t\t'callback' => \"dfcg_help_gallery\"\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-images',\n\t\t'title' => __( 'Image Management', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_images'\n\t));\n\t\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-desc',\n\t\t'title' => __( 'Descriptions', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_desc'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-css',\n\t\t'title' => __( 'Gallery CSS', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_css'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-scripts',\n\t\t'title' => __( 'Load Scripts', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_scripts'\n\t));\n\n\t$current_screen->add_help_tab( array(\n\t\t'id' => 'dfcg-help-troubleshooting',\n\t\t'title' => __( 'Troubleshooting', DFCG_DOMAIN ),\n\t\t'callback' => 'dfcg_help_trouble'\n\t));\n}", "function GetHelp()\n {\n return $this->Lang('help');\n }", "public function getArgument()\n {\n return 'help';\n }", "private function displayHelpMessage() {\n $message = \"ClassDumper help:\\n\n -h : displays this help message\\n\n -f (directory 1 directory 2 ... directory n) : \n parses those directories\\n\n -t (xml / yaml) : selects type of serialization\\n\n (no args) : parses working directory in YAML format\\n\";\n\n echo $message;\n die('ShrubRoots ClassDumper v0.991');\n }", "function my_contextual_help($contexual_help, $screen_id, $screen) {\n\tif('listing' == $screen->id) {\n\t\t$contextual_help = '<h2>Listings</h2>\n\t\t<p>Listings show the details of the items that we sell on the website. You can see a list of them on this page in reverse chronological order - the latest one we added is first.</p>\n\t\t<p>You can view/edit the details of each product by clicking on its name, or you can perform bulk actions using the dropdown menu and selecting multiple items.</p>';\n\t}elseif('edit-listing' == $screen->id) {\n\t\t$contextual_help = '<h2>Editing listings</h2>\n\t\t<p>This page allows you to view/modify listing details. Please make sure to fill out the available boxes with the appropriate details (listing image, price, brand) and <strong>not</strong> add these details to the listing description.</p>';\n\t}\n\treturn $contextual_help;\n}", "public function help()\n {\n echo Config::main('help_text');\n if(empty($this->commands))\n render(\"[red] - NONE - [reset]\\r\\n\");\n else\n {\n foreach($this->commands as $key => $ignored)\n render(\"[blue] - {$key}[reset]\\r\\n\");\n }\n echo PHP_EOL;\n\n return 0;\n }", "function add_contextual_help($screen, $help)\n {\n }", "public static function getHelpIndex() {\n return self::$_help_index;\n }", "protected function displayHelp()\n {\n return $this->context->smarty->fetch($this->module->getLocalPath().'views/templates/admin/rewards_info.tpl');\n }", "private function PrintHelp(){\n\t\t\techo \"Script parser.php\\n\";\n echo \"Launch: php7.4 parse.php <file.src >out.xml\\n\";\n\t\t\techo \"Only supported argument is --help\\n\";\n exit;\n\t\t}", "function showHelp()\n{\n $myName = basename(__FILE__);\n echo \"Usage:\\n\";\n echo sprintf(\" %s \\033[32m{tool name}\\033[0m\\n\", $myName);\n echo PHP_EOL;\n echo \" Tool names:\\n\";\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Convert SASS/SCSS to CSS:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss2css');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sasstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scsstocss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'sass');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'scss');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'css');\n echo PHP_EOL;\n echo sprintf(\" * %s\\n\", 'Dump autoload classes map:');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dumpautoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'dump');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoload');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'classmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadmap');\n echo sprintf(\" \\033[33m%s\\033[0m\\n\", 'autoloadclassmap');\n exit(0);\n}", "function printHelp(){\n\t\techo \"Executes SQL-like SELECT query on XML file.\\n\";\n\t\techo \"Arguments:\\n\";\n\t\techo \" --help - prints this message\\n\";\n\t\techo \" --input=<file> - specifies input XML file\\n\";\n\t\techo \" --output=<file> - specifies output file\\n\";\n\t\techo \" --query='query' - query to be perfomed, cannot be used with --qf\\n\";\n\t\techo \" --qf=<file> - specifies file containing query, cannot be used with --query\\n\";\n\t\techo \" -n - XML header is not generated in the output\\n\";\n\t\techo ' --root=\"string\" - specifies name of the root element in the output'.\"\\n\";\n\t}", "public static function getAllHelp()\n {\n return $this->_help;\n }", "function fgallery_plugin_help($contextual_help, $screen_id, $screen) {\n if ($screen_id == 'toplevel_page_fgallery' || $screen_id == '1-flash-gallery_page_fgallery_add'\n || $screen_id == '1-flash-gallery_page_fgallery_add' || $screen_id == '1-flash-gallery_page_fgallery_images'\n || $screen_id == '1-flash-gallery_page_fgallery_upload') {\n $contextual_help = '<p><a href=\"http://1plugin.com/faq\" target=\"_blank\">'.__('FAQ').'</a></p>';\n }\n return $contextual_help;\n}", "public function help()\n {\n echo PHP_EOL;\n $output = new Output;\n $output->write('Available Commands', [\n 'color' => 'red',\n 'bold' => true,\n 'underline' => true,\n ]);\n echo PHP_EOL;\n\n $maxlen = 0;\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n if ($len > $maxlen) {\n $maxlen = $len;\n }\n\n }\n\n foreach ($this->supportedArgs as $key => $description) {\n $len = strlen($key);\n $output->write(' ')\n ->write($key, ['color' => 'yellow'])\n ->write(str_repeat(' ', $maxlen - $len))\n ->write(' - ')\n ->write($description);\n\n echo PHP_EOL;\n }\n\n echo PHP_EOL;\n\n }", "public function getPageHelp()\n {\n switch ($this->_page)\n {\n case 'indexindex':\n return $this->_help['Login']['help'];\n\n case 'queueindex':\n return $this->_help['Rig Selection']['help'];\n\n case 'queuequeuing':\n return $this->_help['Queue']['help'];\n\n case 'bookingsindex':\n return $this->_help['Reservation']['help'];\n\n case 'bookingswaiting':\n return $this->_help['Reservation Waiting']['help'];\n\n case 'bookingsexisting':\n return $this->_help['Existing Reservations']['help'];\n\n case 'sessionindex':\n return $this->_help['Session']['help'];\n\n default:\n return 'This page has no help.';\n }\n }", "public function help_tab(){\r\n $screen = get_current_screen();\r\n\r\n foreach($this->what_helps as $help_id => $tab) {\r\n $callback_name = $this->generate_callback_name($help_id);\r\n if(method_exists($this, 'help_'.$callback_name.'_callback')) {\r\n $callback = array($this, 'help_'.$callback_name.'_callback');\r\n }\r\n else {\r\n $callback = array($this, 'help_callback');\r\n }\r\n // documentation tab\r\n $screen->add_help_tab( array(\r\n 'id' => 'hw-help-'.$help_id,\r\n 'title' => __( $tab['title'] ),\r\n //'content' => \"<p>sdfsgdgdfghfhfgh</p>\",\r\n 'callback' => $callback\r\n )\r\n );\r\n }\r\n }", "function help(){\n\techo \"Usage : \\t(use --verbose for more infos)\\n\";\n\techo \"--build............................: Configure apache\\n\";\n\techo \"--apache-user --verbose............: Set Apache account in memory\\n\";\n\techo \"--sitename 'webservername'.........: Build vhost for webservername\\n\";\n\techo \"--remove-host 'webservername'......: Remove vhost for webservername\\n\";\n\techo \"--install-groupware 'webservername': Install the predefined groupware\\n\";\n\techo \"--httpd............................: Rebuild main configuration and modules\\n\";\n\techo \"--perms............................: Check files and folders permissions\\n\";\n\techo \"--failed-start.....................: Verify why Apache daemon did not want to run\\n\";\n\techo \"--resolv...........................: Verify if hostnames are in DNS\\n\";\n\techo \"--drupal...........................: Install drupal site for [servername]\\n\";\n\techo \"--drupal-infos.....................: Populate drupal informations in Artica database for [servername]\\n\";\n\techo \"--drupal-uadd......................: Create new drupal [user] for [servername]\\n\";\n\techo \"--drupal-udel......................: Delete [user] for [servername]\\n\";\n\techo \"--drupal-uact......................: Activate [user] 1/0 for [servername]\\n\";\n\techo \"--drupal-upriv.....................: set privileges [user] administrator|user|anonym for [servername]\\n\";\n\techo \"--drupal-cron......................: execute necessary cron for all drupal websites\\n\";\n\techo \"--drupal-modules...................: dump drupal modules for [servername]\\n\";\n\techo \"--drupal-modules-install...........: install pre-defined modules [servername]\\n\";\n\techo \"--drupal-schedules.................: Run artica orders on the servers\\n\";\n\techo \"--listwebs.........................: List websites currently sets\\n\";\n}", "function sendHelp($command){\n\t$use = getCorrectUse($command);\n\t_log($use);\n\t_log(\"Arguments are: \");\n\t_log(\"-c Prints currently used JS cipher function\");\n\t_log(\"-t title Provides a custom filename. The video ID and the extension will still be appended to this argument\");\n\t_log(\"-f format Provides a specific format to download. You can list available format IDs using the -l option\");\n\t_log(\"-l Lists the available formats for the provided video\");\n\t_log(\"-h Prints the help\");\n}", "public function help()\n\t\t{\n\t\t\t//On défini les commandes dispo\n\t\t\t$commands = array(\n\t\t\t\t'generateObjectFromTable' => array(\n\t\t\t\t\t'description' => 'Cette commande permet de générer un objet correspondant à la table fournie en argument.',\n\t\t\t\t\t'requireds' => array(\n\t\t\t\t\t\t'-t' => 'Nom de la table pour laquelle on veux générer un objet',\n\t\t\t\t\t),\n\t\t\t\t\t'optionals' => array(),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\t$message = \"Vous êtes ici dans l'aide de la console.\\n\";\n\t\t\t$message .= \"Voici la liste des commandes disponibles : \\n\";\n\n\t\t\t//On écrit les texte pour la liste des commandes dispos\n\t\t\tforeach ($commands as $name => $value)\n\t\t\t{\n\t\t\t\t$requireds = isset($value['requireds']) ? $value['requireds'] : array();\n\t\t\t\t$optionals = isset($value['optionals']) ? $value['optionals'] : array();\n\n\t\t\t\t$message .= '\t' . $name . ' : ' . $value['description'] . \"\\n\";\n\t\t\t\t$message .= \"\t\tArguments obligatoires : \\n\";\n\t\t\t\tif (!count($requireds))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($requireds as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$message .= \"\t\tArguments optionels : \\n\";\n\t\t\t\t\n\t\t\t\tif (!count($optionals))\n\t\t\t\t{\n\t\t\t\t\t$message .= \"\t\t\tPas d'arguments\\n\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tforeach ($optionals as $argument => $desc)\n\t\t\t\t\t{\n\t\t\t\t\t\t$message .= '\t\t\t\t- ' . $argument . ' : ' . $desc . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\techo $message;\n\t\t}", "public function usageHelp()\n {\n return <<<USAGE\n\nWARNING: Use at your own risk. Create a database backup first.\nThis script will remove entries from the catalog_url index containing which\ncontain -[number] and point to a URL which is the same except for the number.\n\nUsage: php -f jv_rewrite_cleanup.php -- [options]\n php -f jv_rewrite_cleanup.php -- cleanup\n\n cleanup Cleanup Catalog URL index\n help This help\n\nUSAGE;\n }", "static public function help() {\n\t\t$help = parent::help ();\n\t\t\n\t\t$help [__CLASS__] [\"text\"] = array ();\n\t\t$help [__CLASS__] [\"text\"] [] .= \"Zabbix User :\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_nom Nom du user\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_username Alias du user\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_autologin enabled/disabled\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_autologout 900 temps max avant logout\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_lang en_GB Langue au format systeme\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_refresh 30 temps max avant refresh\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_rows_per_page 50 ligne par page\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_surname '' Nom a l'affichage de l'utilisateur\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_theme default Theme de l'interface\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_type 'zabbix user' Type d'utilisateur zabbix user/zabbix admin/zabbix super admin\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_url '' Url de l'utilisateur pour redirection apres connexion\";\n\t\t$help [__CLASS__] [\"text\"] [] .= \"\\t--zabbix_user_password 'xxx' Password de l'utilisateur en cas de creation\";\n\t\t$help = array_merge ( $help, zabbix_usermedia::help () );\n\t\t$help = array_merge ( $help, zabbix_usergroups::help () );\n\t\t\n\t\treturn $help;\n\t}", "function get_site_screen_help_tab_args()\n {\n }" ]
[ "0.8167466", "0.7971505", "0.78824115", "0.7727608", "0.75076115", "0.7451693", "0.73065853", "0.7279187", "0.7261713", "0.71022564", "0.70810723", "0.69941163", "0.69587433", "0.6956322", "0.6940296", "0.6880349", "0.6876221", "0.6858191", "0.68483716", "0.683708", "0.6830749", "0.68214333", "0.6813821", "0.68021977", "0.67945856", "0.6790759", "0.67699987", "0.67585117", "0.6746606", "0.6746606", "0.6746606", "0.6736115", "0.6711819", "0.670815", "0.6705821", "0.66986185", "0.66943145", "0.6690002", "0.66831535", "0.6683025", "0.6680547", "0.6676964", "0.66691995", "0.6667973", "0.66528195", "0.6648953", "0.6644882", "0.6633783", "0.6619043", "0.6615599", "0.6608734", "0.6607398", "0.6599263", "0.6598895", "0.6593728", "0.6590263", "0.65859735", "0.65772927", "0.65772927", "0.655638", "0.65504813", "0.6549749", "0.6549607", "0.6544832", "0.6540226", "0.6540226", "0.65390956", "0.6534781", "0.65288764", "0.6520713", "0.6518776", "0.65175444", "0.650263", "0.6458731", "0.64567083", "0.6452981", "0.64528793", "0.6444195", "0.64371914", "0.6431321", "0.64305365", "0.64265436", "0.6424466", "0.64221656", "0.64220923", "0.64085865", "0.6401186", "0.6396219", "0.63899034", "0.63851", "0.6381693", "0.6370396", "0.6343717", "0.6338181", "0.63316715", "0.6312104", "0.6310845", "0.63022834", "0.630043", "0.62983197", "0.62860173" ]
0.0
-1
/ This is a helpping method to get a Project in String type.
private function getProject($id) { ///$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. "/projects/".$id; echo "\ngetProject URL:".$url; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function GetProject($value)\n\t{\n\t\tif ($value instanceof GitPHP_Project) {\n\t\t\treturn $value->GetProject();\n\t\t} else if (is_string($value)) {\n\t\t\treturn $value;\n\t\t}\n\t}", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "public abstract function getProjectName();", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "public function fetchProjectID(): string;", "public function getNameProjectType()\n {\n return $this->name_project_type;\n }", "public function getProject();", "function project_by_index($index) {\n $project = $this->parsed_items[$this->projects[$index]];\n return $project;\n }", "function get_project_type( $user, $project )\n {\n //Unimplemented\n }", "function project_by_key($key) {\n $project = $this->parsed_items[$key];\n return $project;\n }", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "public abstract function getProjectFieldName();", "function getProjectName($con, $inpProj)\n\t{\n\t\t$sql_projName = $con->prepare(\"SELECT projectName FROM projects WHERE projectID = ?\");\n\t\t$sql_projName->bind_param(\"i\", $inpProj);\n\t\t$sql_projName->execute();\n\n\t\t$result_projName = $sql_projName->get_result();\n\n\t\twhile($row = mysqli_fetch_array($result_projName))\n\t\t{\n\t\t\t$projName = $row['projectName'];\n\t\t}\n\n\t\treturn $projName;\n\t}", "public function getProject()\r\n {\r\n return $this->_params['project'];\r\n }", "public function getProject($id){\n\n\t\t$this->db->select('*');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('project');\n\t\t$row = $query->row();\n\n\t\t$project = array(\n\t\t\t'id' => $row->id,\n\t\t\t'name' => $row->name,\n\t\t\t'aggregate_url' => $row->aggregate_url,\n\t\t\t'description' => $row->description,\n\t\t\t'sample_target' => $row->sample_target,\n\t\t\t'sample_target_bs' => $row->sampel_target_bs,\n\t\t\t'sampling_table' => $row->sampling_frame_table,\n\t\t\t'loc_columns' => $row->alloc_unit_columns,\n\t\t\t'start_date' => $row->start_date,\n\t\t\t'end_date' => $row->finish_date,\n\t\t\t'delete_status' => $row->delete_status,\n\t\t\t'date_created' => $row->date_created\n\t\t );\n\t\t return $project;\t\t\t\t\t\t\n\t}", "public function getProject()\n\t{\n\t\tif (!$this->projectId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\t\t$query->select('id, name, alias, description, url, logo, logo_alt, issue_template')\n\t\t\t->from('#__monitor_projects')\n\t\t->where(\"id = \" . $query->q($this->projectId));\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObject();\n\t}", "public function getProjects();", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function getProjectInfo(): ProjectInfoInterface;", "public function getProjectName() : string\n {\n return $this->projectName;\n }", "public static function retrieveProjectInfo($projectID) {\n return R::load('project', $projectID);\n }", "public function getGathercontentProject();", "public function getProjectName($project)\n {\n return self::get(\"SELECT * FROM $this->table WHERE project_name = '$project'\");\n }", "public function projects_get($id = \"0\",$type=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n \n $search = $this->input->get('search',TRUE);\n \n \n \n if(strcmp($type, \"0\")==0 && is_null($search))\n $result = $sutil->getProject($id,$from,$size);\n else if(strcmp($type, \"Documents\")==0)\n {\n $result = $sutil->getDocumentByProjectID($id,$from,$size);\n }\n else if(!is_null($search))\n {\n $result = $sutil->searchProject($search,$from,$size);\n }\n else\n {\n $result = array();\n $result['Error'] = \"Invalid input:\".$type;\n \n }\n \n $this->response($result);\n \n }", "public function getProjectTItle() {\n $project = \"Yii2\";\n return $project;\n }", "function get_project_name_by_id($id)\n{\n $CI =& get_instance();\n $CI->db->select('name');\n $CI->db->where('id', $id);\n $project = $CI->db->get('tblprojects')->row();\n if ($project) {\n return $project->name;\n }\n\n return '';\n}", "public static function getAssignedProject()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $current_team_id = \"\";\n $result_project = \"\";\n\n if ($res_des == 'Developer' || $res_des == 'Project Manager') {\n\t\t\t// Get Team that current user has been assigned to\n $result_teams = DB::table('dev_team')->where('user_id', '=', $res_id)->get();\n\n foreach ($result_teams as $result_team) {\n $current_team_id = $result_team->team_id;\n }\n\n\t\t\t// Get Project that the Team has been assigned to\n $result_project_ids = DB::table('assign_teams')->where('team_id', '=', $current_team_id)->get();\n\n foreach ($result_project_ids as $result_project_id) {\n $result_projectID = $result_project_id->ProjectID;\n }\n\n }\n\n return $result_projectID;\n }", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "function GetProjectInfoBasedOnId($projId)\n {\n $ret = '';\n \n $sql = 'SELECT * ' .\n ' FROM PROJECTS ' .\n ' WHERE PROJECT_ID = ' . $projId;\n \n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $info = array();\n $info['name'] = $row['PROJECT_NAME'];\n $info['desc'] = $row['PROJECT_DESC'];\n $info['id'] = $row['PROJECT_ID'];\n $info['timestamp'] = $row['PROJECT_TIMESTAMP'];\n $ret = $info;\n }\n \n return $ret;\n }", "function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "public function getDescProjectType()\n {\n return $this->desc_project_type;\n }", "public function getProject($projectId)\n {\n return GPLProject::model()->findByPk($projectId);\n }", "function project_by_task($key) {\n $project_key = $this->projects[$this->task_project[$key]];\n $project = $this->parsed_items[$project_key];\n return $project;\n }", "static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}", "public function getProjectId(): string\n {\n return $this->_projectId;\n }", "public function getProjectTitle();", "public function project_info (Project $project)\n {\n return $project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function get_project_by_id ($project_id)\n {\n $this->where('project_id', $project_id);\n $project = $this->get('projects');\n //returns an array\n return $project;\n }", "public function getProjects()\n {\n }", "function GetProjectType($projectTypeId)\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectType\", array(\"ProjectTypeId\"=>$projectTypeId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function get_default_project_type() {\n $str = CriticalI_Property::get('project.default_type', 'inside-public');\n \n if (strtolower(trim($str)) == 'outside-public')\n return CriticalI_Project::OUTSIDE_PUBLIC;\n else\n return CriticalI_Project::INSIDE_PUBLIC;\n }", "public function projectTitle($id_project) {\n\t\t$this->db->select(\"project_title\");\n\t\t$this->db->from(\"project\");\n\t\t$this->db->where(\"id_project\",$id_project);\n\t\treturn $this->db->get();\n\t}", "private function getProjectNameAndProjectID(){\r\n $this->jsonOutput[\"projectID\"] = utils\\Encryption::encode($this->settingVars->projectID);\r\n $this->jsonOutput[\"projectName\"] = $this->settingVars->pageArray[\"PROJECT_NAME\"];\r\n }", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "public function getProject() {\n\t\treturn $this->project;\n\t}", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function get($project);", "public function get_project_all(){\n }", "public function get_project( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function project($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId);\n }", "public function data_project()\n {\n return new Data\\Project(array(\n 'name' => $this->get_data('name'),\n 'summary' => $this->get_data('summary')\n ));\n }", "function get_project()\n {\n return $this->find('all');\n }", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}", "function get_forge_project_name()\n\t{\n\t\treturn '';\n\t}", "function get_project($projectId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getProject($projectId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');\n }\n\n}", "public function model()\n {\n return Project::class;\n }", "public function get_projects()\n\t{\n\t\t$query = $this->db->get('projects');\n\t\treturn $query->result();\n\t}", "public function getProject($id)\n {\n }", "public function getProject($projectId) {\n\t\t$db = $this->connection();\n\t\t$sql = 'SELECT * FROM projects WHERE projectId = :projectId';\n\t\t$params = array(':projectId' => $projectId);\n\t\t$query = $db->prepare($sql);\n\t\t$status = $query->execute($params);\n\n\t\tif (!$status) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$project = $query->fetchObject();\n\n\t\tif ($project === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$returnProject = new Project($project);\n\n\t\treturn $returnProject;\n\t}", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "public function getProject() {\n\t\tif ($this->_project === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_project;\n\t}", "function projectname($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select property_name from manage_property where pid='$id'\"));\n\treturn $name['property_name'];\n\t}", "public function getProjectInformation() {\n $query = \"select * from projects\";\n $result = mysql_query($query);\n return $result;\n }", "public function getProjectById(int $projectId) : ProjectInterface;", "function getProjectName($lm_id){\n if (empty($lm_id)){\n $reply = array(0,'?');\n }else{\n $m = $this->getMember($lm_id);\n $reply = array($m['lm_value'],$m['lm_key']);\n }\n //b_debug::print_r($reply);\n return $reply;\n }", "public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }", "function get_cur_project() {\n\t\tif (!isset($_SESSION['dfl_project'])) {\n\t\t\tlgi_mysql_fetch_session(\"SELECT `dfl_project` AS `dfl_project` FROM %t(users) WHERE `name`='%%'\", $this->userid);\n\t\t\t// if not set, return first project found\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tlgi_mysql_fetch_session(\"SELECT `name` AS `dfl_project` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' LIMIT 1\", $this->userid);\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tthrow new LGIPortalException(\"No LGI projects for user: check certificate.\");\n\t\t}\n\t\treturn $_SESSION['dfl_project'];\n\t}", "public function getProjects()\n {\n $urlParts = array(\n 'format' => 'JSON',\n 'description' => '',\n 'type' => 'all',\n 'all' => '',\n 'tree' => '',\n );\n\n $url = $this->getBaseUrl() . 'projects/?' . http_build_query($urlParts);\n\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content;\n }", "function getProject($id = null)\n {\n $where = '';\n if($id) $where = \" AND idproject = '{$id}'\";\n $query = $this->db->query(\"SELECT idproject, title, DATE_FORMAT(startdate,'%m/%d/%Y') as startdate,\n\t\t DATE_FORMAT(enddate,'%m/%d/%Y') as enddate, companyname, companyurl, companycontactperson, companycontactpersonemail,\n\t\t note, active\n FROM project\n WHERE active = 1 {$where}\n ORDER BY idproject DESC\");\n\t\treturn $query; \n /*if($query->num_rows() > 1){\n return $query->result_array();\n }else{\n return $query->row_array();\n }*/\t\n }", "static function get_projet($idProjet=NULL, $titreProjet=NULL, $type=NULL)\n\t{\n\t\t// Si on a un ID\n\t\tif(!empty($idProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet, $titreProjet=NULL, $type=NULL);\n\t\t}\n\t\telse if(!empty($titreProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet, $type=NULL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!empty($type))\n\t\t\t{\n\n\t\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet=NULL, $type);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$get_projet = M_Projet::read_projet();\n\t\t\t}\n\t\t}\n\t\treturn($get_projet);\n\t}", "public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function projectName() : string\n {\n return (string) $this->getOrError('name');\n }", "public static function getById(Project $project)\n {\n \treturn VicinityMapProject::whereProjectId($project->id)->first();\n }", "public static function project()\n {\n return self::context()->project();\n }", "public function getProject(): ProjectContract\n {\n return $this->project;\n }", "public static function getProjectById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM project WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Project($results[0]);\n } else {\n return null;\n }\n }", "public function getTskProject()\n {\n return $this->tsk_project;\n }", "public function getByID($projectID)\n {\n $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();\n $members = $this->getMembers($projectID); \n\n if(isset($members['manager'])) $project->PM = $members['manager'][0]->account;\n $project->members = array($project->PM);\n if(isset($members['member']))\n {\n foreach($members['member'] as $member)\n {\n $project->members[] = $member->account; \n }\n }\n\n return $project;\n }", "public function getProjectDetails($projectId)\n {\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n $sql = \"SELECT prj.project_id,project_name,config.config_id FROM `tbl_projects` as prj \n\t\tleft join tbl_config as config on config.project_id = prj.project_id WHERE prj.`deleted` = 0 AND prj.project_id = $projectId \";\n \t\t$result = $DB->fetchAssoc($sql);\n\t\treturn $result;\n }", "function get_project_name($project_id, &$link){\n \t$resp = 'Unknown';\n \t$query = \"select name from healingcrystals_projects where id='\" . $project_id . \"'\";\n \t$result = mysql_query($query, $link);\n \tif (mysql_num_rows($result)){\n \t\t$info = mysql_fetch_assoc($result);\n \t\t$resp = $info['name'];\n \t}\n \treturn $resp;\n }", "public function singleProject($project_id, $db)\r\n {\r\n $sql = \"SELECT * FROM projects\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst-> execute();\r\n $p = $pst->fetch(PDO::FETCH_OBJ);\r\n return $p;\r\n }", "public function get($project)\n {\n $resource = $this->connection->get(\"/projects/{$project}\");\n return $this->load(['project' => $resource], 'Project', 'project');\n }", "public static function label()\n {\n return 'Projects';\n }", "public function projects()\n {\n $query = 'project';\n return json_decode($this->client->request('GET', $query, $this->options)->getBody(), true);\n }", "function get_projects( $user )\n {\n //Unimplemented\n }", "public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function getProject()\n { \n return $this->hasOne('App\\Project', 'id', 'resourse');\n }", "private function getProjectTitle($user_id, $level_id)\n\t{\n\t\t// Check if reference to this project is stored\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('pf_projects_id'))\n\t\t\t->from($db->qn('#__akeebasubs_pf4_projects'))\n\t\t\t->where($db->qn('users_id') . ' = ' . $db->q($user_id))\n\t\t\t->where($db->qn('akeebasubs_level_id') . ' = ' . $db->q($level_id));\n\t\t$db->setQuery($query);\n\t\t$proj_id = $db->loadResult();\n\t\tif($proj_id == null) return \"\";\n\t\t\n\t\t// Get the title\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('title'))\n\t\t\t->from($db->qn('#__pf_projects'))\n\t\t\t->where($db->qn('id') . ' = ' . $db->q($proj_id));\n\t\t$db->setQuery($query);\n\t\t$proj_title = $db->loadResult();\n\t\tif($proj_title == null) return \"\";\n\t\t\n\t\treturn $proj_title;\n\t}", "function get_project($pid){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"root\";\n $dbname = \"Projects\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql = \"SELECT head, summary, title, emails\n FROM Project\n WHERE pid = $pid\";\n $result = $conn->query($sql);\n $row = $result->fetch_assoc();\n return $row;\n }", "public function project($id)\n {\n $project = Project::find($id);\n $category = $project->category;\n return $project;\n }", "public function getProjectById($projectId) {\n\t\treturn $this->projectDao->getProjectById($projectId);\n\t}", "public function project($id)\n {\n $result = $this->get(\"projects/{$id}\");\n\n Validator::isArray($result);\n\n return $this->fromMantisProject($result['projects'][0]);\n }" ]
[ "0.7010423", "0.6870846", "0.6860733", "0.6857506", "0.673397", "0.6570787", "0.6566922", "0.65294653", "0.6517313", "0.64668554", "0.64501697", "0.64351815", "0.6419528", "0.63669646", "0.6351298", "0.63411367", "0.6317779", "0.6264729", "0.6253921", "0.6231453", "0.621582", "0.62116206", "0.6210987", "0.6197835", "0.61817867", "0.6181413", "0.61745304", "0.6145726", "0.61443466", "0.6142805", "0.614245", "0.6134295", "0.61250675", "0.61141527", "0.6110635", "0.6109784", "0.60889256", "0.60678977", "0.6021973", "0.6020314", "0.6020314", "0.6020314", "0.59909916", "0.59871966", "0.59494615", "0.5947778", "0.5942889", "0.59283274", "0.5926916", "0.5916622", "0.59101295", "0.58954406", "0.5893046", "0.5888542", "0.5887212", "0.586384", "0.58605766", "0.5846559", "0.58440393", "0.58422905", "0.5839909", "0.5828493", "0.5818438", "0.58159775", "0.5812828", "0.58084416", "0.58084416", "0.58013266", "0.57981306", "0.5797518", "0.5792603", "0.5780876", "0.5773786", "0.5766863", "0.5762947", "0.5761123", "0.5758183", "0.57514745", "0.5744299", "0.57315236", "0.5722021", "0.57205254", "0.57123286", "0.57008827", "0.56994563", "0.569042", "0.5690197", "0.5689883", "0.56860447", "0.56848747", "0.56775135", "0.5670869", "0.5667793", "0.5662788", "0.5650638", "0.5649591", "0.5647786", "0.5644616", "0.5641233", "0.5620011" ]
0.56867343
88
/ This is a helpping method to get a Project in String type.
private function getExperiment($id) { //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. "/experiments/".$id; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function GetProject($value)\n\t{\n\t\tif ($value instanceof GitPHP_Project) {\n\t\t\treturn $value->GetProject();\n\t\t} else if (is_string($value)) {\n\t\t\treturn $value;\n\t\t}\n\t}", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "public abstract function getProjectName();", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "public function fetchProjectID(): string;", "public function getNameProjectType()\n {\n return $this->name_project_type;\n }", "public function getProject();", "function project_by_index($index) {\n $project = $this->parsed_items[$this->projects[$index]];\n return $project;\n }", "function get_project_type( $user, $project )\n {\n //Unimplemented\n }", "function project_by_key($key) {\n $project = $this->parsed_items[$key];\n return $project;\n }", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "public abstract function getProjectFieldName();", "function getProjectName($con, $inpProj)\n\t{\n\t\t$sql_projName = $con->prepare(\"SELECT projectName FROM projects WHERE projectID = ?\");\n\t\t$sql_projName->bind_param(\"i\", $inpProj);\n\t\t$sql_projName->execute();\n\n\t\t$result_projName = $sql_projName->get_result();\n\n\t\twhile($row = mysqli_fetch_array($result_projName))\n\t\t{\n\t\t\t$projName = $row['projectName'];\n\t\t}\n\n\t\treturn $projName;\n\t}", "public function getProject()\r\n {\r\n return $this->_params['project'];\r\n }", "public function getProject($id){\n\n\t\t$this->db->select('*');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('project');\n\t\t$row = $query->row();\n\n\t\t$project = array(\n\t\t\t'id' => $row->id,\n\t\t\t'name' => $row->name,\n\t\t\t'aggregate_url' => $row->aggregate_url,\n\t\t\t'description' => $row->description,\n\t\t\t'sample_target' => $row->sample_target,\n\t\t\t'sample_target_bs' => $row->sampel_target_bs,\n\t\t\t'sampling_table' => $row->sampling_frame_table,\n\t\t\t'loc_columns' => $row->alloc_unit_columns,\n\t\t\t'start_date' => $row->start_date,\n\t\t\t'end_date' => $row->finish_date,\n\t\t\t'delete_status' => $row->delete_status,\n\t\t\t'date_created' => $row->date_created\n\t\t );\n\t\t return $project;\t\t\t\t\t\t\n\t}", "public function getProject()\n\t{\n\t\tif (!$this->projectId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\t\t$query->select('id, name, alias, description, url, logo, logo_alt, issue_template')\n\t\t\t->from('#__monitor_projects')\n\t\t->where(\"id = \" . $query->q($this->projectId));\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObject();\n\t}", "public function getProjects();", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function getProjectInfo(): ProjectInfoInterface;", "public function getProjectName() : string\n {\n return $this->projectName;\n }", "public static function retrieveProjectInfo($projectID) {\n return R::load('project', $projectID);\n }", "public function getGathercontentProject();", "public function getProjectName($project)\n {\n return self::get(\"SELECT * FROM $this->table WHERE project_name = '$project'\");\n }", "public function projects_get($id = \"0\",$type=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n \n $search = $this->input->get('search',TRUE);\n \n \n \n if(strcmp($type, \"0\")==0 && is_null($search))\n $result = $sutil->getProject($id,$from,$size);\n else if(strcmp($type, \"Documents\")==0)\n {\n $result = $sutil->getDocumentByProjectID($id,$from,$size);\n }\n else if(!is_null($search))\n {\n $result = $sutil->searchProject($search,$from,$size);\n }\n else\n {\n $result = array();\n $result['Error'] = \"Invalid input:\".$type;\n \n }\n \n $this->response($result);\n \n }", "public function getProjectTItle() {\n $project = \"Yii2\";\n return $project;\n }", "function get_project_name_by_id($id)\n{\n $CI =& get_instance();\n $CI->db->select('name');\n $CI->db->where('id', $id);\n $project = $CI->db->get('tblprojects')->row();\n if ($project) {\n return $project->name;\n }\n\n return '';\n}", "public static function getAssignedProject()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $current_team_id = \"\";\n $result_project = \"\";\n\n if ($res_des == 'Developer' || $res_des == 'Project Manager') {\n\t\t\t// Get Team that current user has been assigned to\n $result_teams = DB::table('dev_team')->where('user_id', '=', $res_id)->get();\n\n foreach ($result_teams as $result_team) {\n $current_team_id = $result_team->team_id;\n }\n\n\t\t\t// Get Project that the Team has been assigned to\n $result_project_ids = DB::table('assign_teams')->where('team_id', '=', $current_team_id)->get();\n\n foreach ($result_project_ids as $result_project_id) {\n $result_projectID = $result_project_id->ProjectID;\n }\n\n }\n\n return $result_projectID;\n }", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "function GetProjectInfoBasedOnId($projId)\n {\n $ret = '';\n \n $sql = 'SELECT * ' .\n ' FROM PROJECTS ' .\n ' WHERE PROJECT_ID = ' . $projId;\n \n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $info = array();\n $info['name'] = $row['PROJECT_NAME'];\n $info['desc'] = $row['PROJECT_DESC'];\n $info['id'] = $row['PROJECT_ID'];\n $info['timestamp'] = $row['PROJECT_TIMESTAMP'];\n $ret = $info;\n }\n \n return $ret;\n }", "function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "public function getDescProjectType()\n {\n return $this->desc_project_type;\n }", "public function getProject($projectId)\n {\n return GPLProject::model()->findByPk($projectId);\n }", "function project_by_task($key) {\n $project_key = $this->projects[$this->task_project[$key]];\n $project = $this->parsed_items[$project_key];\n return $project;\n }", "static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}", "public function getProjectId(): string\n {\n return $this->_projectId;\n }", "public function getProjectTitle();", "public function project_info (Project $project)\n {\n return $project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function get_project_by_id ($project_id)\n {\n $this->where('project_id', $project_id);\n $project = $this->get('projects');\n //returns an array\n return $project;\n }", "public function getProjects()\n {\n }", "function GetProjectType($projectTypeId)\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectType\", array(\"ProjectTypeId\"=>$projectTypeId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function get_default_project_type() {\n $str = CriticalI_Property::get('project.default_type', 'inside-public');\n \n if (strtolower(trim($str)) == 'outside-public')\n return CriticalI_Project::OUTSIDE_PUBLIC;\n else\n return CriticalI_Project::INSIDE_PUBLIC;\n }", "public function projectTitle($id_project) {\n\t\t$this->db->select(\"project_title\");\n\t\t$this->db->from(\"project\");\n\t\t$this->db->where(\"id_project\",$id_project);\n\t\treturn $this->db->get();\n\t}", "private function getProjectNameAndProjectID(){\r\n $this->jsonOutput[\"projectID\"] = utils\\Encryption::encode($this->settingVars->projectID);\r\n $this->jsonOutput[\"projectName\"] = $this->settingVars->pageArray[\"PROJECT_NAME\"];\r\n }", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "public function getProject() {\n\t\treturn $this->project;\n\t}", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function get($project);", "public function get_project_all(){\n }", "public function get_project( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function project($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId);\n }", "public function data_project()\n {\n return new Data\\Project(array(\n 'name' => $this->get_data('name'),\n 'summary' => $this->get_data('summary')\n ));\n }", "function get_project()\n {\n return $this->find('all');\n }", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}", "function get_forge_project_name()\n\t{\n\t\treturn '';\n\t}", "function get_project($projectId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getProject($projectId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');\n }\n\n}", "public function model()\n {\n return Project::class;\n }", "public function get_projects()\n\t{\n\t\t$query = $this->db->get('projects');\n\t\treturn $query->result();\n\t}", "public function getProject($id)\n {\n }", "public function getProject($projectId) {\n\t\t$db = $this->connection();\n\t\t$sql = 'SELECT * FROM projects WHERE projectId = :projectId';\n\t\t$params = array(':projectId' => $projectId);\n\t\t$query = $db->prepare($sql);\n\t\t$status = $query->execute($params);\n\n\t\tif (!$status) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$project = $query->fetchObject();\n\n\t\tif ($project === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$returnProject = new Project($project);\n\n\t\treturn $returnProject;\n\t}", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "public function getProject() {\n\t\tif ($this->_project === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_project;\n\t}", "function projectname($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select property_name from manage_property where pid='$id'\"));\n\treturn $name['property_name'];\n\t}", "public function getProjectInformation() {\n $query = \"select * from projects\";\n $result = mysql_query($query);\n return $result;\n }", "public function getProjectById(int $projectId) : ProjectInterface;", "function getProjectName($lm_id){\n if (empty($lm_id)){\n $reply = array(0,'?');\n }else{\n $m = $this->getMember($lm_id);\n $reply = array($m['lm_value'],$m['lm_key']);\n }\n //b_debug::print_r($reply);\n return $reply;\n }", "public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }", "function get_cur_project() {\n\t\tif (!isset($_SESSION['dfl_project'])) {\n\t\t\tlgi_mysql_fetch_session(\"SELECT `dfl_project` AS `dfl_project` FROM %t(users) WHERE `name`='%%'\", $this->userid);\n\t\t\t// if not set, return first project found\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tlgi_mysql_fetch_session(\"SELECT `name` AS `dfl_project` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' LIMIT 1\", $this->userid);\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tthrow new LGIPortalException(\"No LGI projects for user: check certificate.\");\n\t\t}\n\t\treturn $_SESSION['dfl_project'];\n\t}", "public function getProjects()\n {\n $urlParts = array(\n 'format' => 'JSON',\n 'description' => '',\n 'type' => 'all',\n 'all' => '',\n 'tree' => '',\n );\n\n $url = $this->getBaseUrl() . 'projects/?' . http_build_query($urlParts);\n\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content;\n }", "function getProject($id = null)\n {\n $where = '';\n if($id) $where = \" AND idproject = '{$id}'\";\n $query = $this->db->query(\"SELECT idproject, title, DATE_FORMAT(startdate,'%m/%d/%Y') as startdate,\n\t\t DATE_FORMAT(enddate,'%m/%d/%Y') as enddate, companyname, companyurl, companycontactperson, companycontactpersonemail,\n\t\t note, active\n FROM project\n WHERE active = 1 {$where}\n ORDER BY idproject DESC\");\n\t\treturn $query; \n /*if($query->num_rows() > 1){\n return $query->result_array();\n }else{\n return $query->row_array();\n }*/\t\n }", "static function get_projet($idProjet=NULL, $titreProjet=NULL, $type=NULL)\n\t{\n\t\t// Si on a un ID\n\t\tif(!empty($idProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet, $titreProjet=NULL, $type=NULL);\n\t\t}\n\t\telse if(!empty($titreProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet, $type=NULL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!empty($type))\n\t\t\t{\n\n\t\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet=NULL, $type);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$get_projet = M_Projet::read_projet();\n\t\t\t}\n\t\t}\n\t\treturn($get_projet);\n\t}", "public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function projectName() : string\n {\n return (string) $this->getOrError('name');\n }", "public static function getById(Project $project)\n {\n \treturn VicinityMapProject::whereProjectId($project->id)->first();\n }", "public static function project()\n {\n return self::context()->project();\n }", "public function getProject(): ProjectContract\n {\n return $this->project;\n }", "public static function getProjectById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM project WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Project($results[0]);\n } else {\n return null;\n }\n }", "public function getTskProject()\n {\n return $this->tsk_project;\n }", "public function getByID($projectID)\n {\n $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();\n $members = $this->getMembers($projectID); \n\n if(isset($members['manager'])) $project->PM = $members['manager'][0]->account;\n $project->members = array($project->PM);\n if(isset($members['member']))\n {\n foreach($members['member'] as $member)\n {\n $project->members[] = $member->account; \n }\n }\n\n return $project;\n }", "public function getProjectDetails($projectId)\n {\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n $sql = \"SELECT prj.project_id,project_name,config.config_id FROM `tbl_projects` as prj \n\t\tleft join tbl_config as config on config.project_id = prj.project_id WHERE prj.`deleted` = 0 AND prj.project_id = $projectId \";\n \t\t$result = $DB->fetchAssoc($sql);\n\t\treturn $result;\n }", "function get_project_name($project_id, &$link){\n \t$resp = 'Unknown';\n \t$query = \"select name from healingcrystals_projects where id='\" . $project_id . \"'\";\n \t$result = mysql_query($query, $link);\n \tif (mysql_num_rows($result)){\n \t\t$info = mysql_fetch_assoc($result);\n \t\t$resp = $info['name'];\n \t}\n \treturn $resp;\n }", "public function singleProject($project_id, $db)\r\n {\r\n $sql = \"SELECT * FROM projects\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst-> execute();\r\n $p = $pst->fetch(PDO::FETCH_OBJ);\r\n return $p;\r\n }", "private function getProject($id)\n {\n ///$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/projects/\".$id;\n \n echo \"\\ngetProject URL:\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function get($project)\n {\n $resource = $this->connection->get(\"/projects/{$project}\");\n return $this->load(['project' => $resource], 'Project', 'project');\n }", "public static function label()\n {\n return 'Projects';\n }", "public function projects()\n {\n $query = 'project';\n return json_decode($this->client->request('GET', $query, $this->options)->getBody(), true);\n }", "function get_projects( $user )\n {\n //Unimplemented\n }", "public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function getProject()\n { \n return $this->hasOne('App\\Project', 'id', 'resourse');\n }", "private function getProjectTitle($user_id, $level_id)\n\t{\n\t\t// Check if reference to this project is stored\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('pf_projects_id'))\n\t\t\t->from($db->qn('#__akeebasubs_pf4_projects'))\n\t\t\t->where($db->qn('users_id') . ' = ' . $db->q($user_id))\n\t\t\t->where($db->qn('akeebasubs_level_id') . ' = ' . $db->q($level_id));\n\t\t$db->setQuery($query);\n\t\t$proj_id = $db->loadResult();\n\t\tif($proj_id == null) return \"\";\n\t\t\n\t\t// Get the title\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('title'))\n\t\t\t->from($db->qn('#__pf_projects'))\n\t\t\t->where($db->qn('id') . ' = ' . $db->q($proj_id));\n\t\t$db->setQuery($query);\n\t\t$proj_title = $db->loadResult();\n\t\tif($proj_title == null) return \"\";\n\t\t\n\t\treturn $proj_title;\n\t}", "function get_project($pid){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"root\";\n $dbname = \"Projects\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql = \"SELECT head, summary, title, emails\n FROM Project\n WHERE pid = $pid\";\n $result = $conn->query($sql);\n $row = $result->fetch_assoc();\n return $row;\n }", "public function project($id)\n {\n $project = Project::find($id);\n $category = $project->category;\n return $project;\n }", "public function getProjectById($projectId) {\n\t\treturn $this->projectDao->getProjectById($projectId);\n\t}", "public function project($id)\n {\n $result = $this->get(\"projects/{$id}\");\n\n Validator::isArray($result);\n\n return $this->fromMantisProject($result['projects'][0]);\n }" ]
[ "0.7010423", "0.6870846", "0.6860733", "0.6857506", "0.673397", "0.6570787", "0.6566922", "0.65294653", "0.6517313", "0.64668554", "0.64501697", "0.64351815", "0.6419528", "0.63669646", "0.6351298", "0.63411367", "0.6317779", "0.6264729", "0.6253921", "0.6231453", "0.621582", "0.62116206", "0.6210987", "0.6197835", "0.61817867", "0.6181413", "0.61745304", "0.6145726", "0.61443466", "0.6142805", "0.614245", "0.6134295", "0.61250675", "0.61141527", "0.6110635", "0.6109784", "0.60889256", "0.60678977", "0.6021973", "0.6020314", "0.6020314", "0.6020314", "0.59909916", "0.59871966", "0.59494615", "0.5947778", "0.5942889", "0.59283274", "0.5926916", "0.5916622", "0.59101295", "0.58954406", "0.5893046", "0.5888542", "0.5887212", "0.586384", "0.58605766", "0.5846559", "0.58440393", "0.58422905", "0.5839909", "0.5828493", "0.5818438", "0.58159775", "0.5812828", "0.58084416", "0.58084416", "0.58013266", "0.57981306", "0.5797518", "0.5792603", "0.5780876", "0.5773786", "0.5766863", "0.5762947", "0.5761123", "0.5758183", "0.57514745", "0.5744299", "0.57315236", "0.5722021", "0.57205254", "0.57123286", "0.57008827", "0.56994563", "0.569042", "0.5690197", "0.5689883", "0.56867343", "0.56860447", "0.56848747", "0.56775135", "0.5670869", "0.5667793", "0.5662788", "0.5650638", "0.5649591", "0.5647786", "0.5644616", "0.5641233", "0.5620011" ]
0.0
-1
/ This is a helpping method to get a Project in String type.
private function getUser($id) { //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/users/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/users/".$id; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function GetProject($value)\n\t{\n\t\tif ($value instanceof GitPHP_Project) {\n\t\t\treturn $value->GetProject();\n\t\t} else if (is_string($value)) {\n\t\t\treturn $value;\n\t\t}\n\t}", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "public abstract function getProjectName();", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "public function fetchProjectID(): string;", "public function getNameProjectType()\n {\n return $this->name_project_type;\n }", "public function getProject();", "function project_by_index($index) {\n $project = $this->parsed_items[$this->projects[$index]];\n return $project;\n }", "function get_project_type( $user, $project )\n {\n //Unimplemented\n }", "function project_by_key($key) {\n $project = $this->parsed_items[$key];\n return $project;\n }", "private function term_project() {\n $matched = false;\n $project = array();\n\n $line = $this->_lines->cur();\n\n // special default project zero, for orphaned tasks and the like\n if ($this->_index == 0) {\n $text = \\tpp\\lang('orphaned');\n $note = $this->empty_note();\n $matched = true;\n $line = '';\n\n } elseif (preg_match($this->term['project'], $line , $match) > 0) {\n $this->_lines->move();\n\n $text = $match[1];\n $note = $this->term_note();\n $matched = true;\n }\n\n if ($matched) {\n $project = (object) array('type' => 'project', 'text' => $text, 'index' => $this->_index, 'note' => $note, 'raw' => $line);\n $this->_index++;\n\n $project->children = $this->match_any(array('term_task', 'term_info', 'term_empty'), array());\n return $project;\n } else {\n return false;\n }\n }", "public abstract function getProjectFieldName();", "function getProjectName($con, $inpProj)\n\t{\n\t\t$sql_projName = $con->prepare(\"SELECT projectName FROM projects WHERE projectID = ?\");\n\t\t$sql_projName->bind_param(\"i\", $inpProj);\n\t\t$sql_projName->execute();\n\n\t\t$result_projName = $sql_projName->get_result();\n\n\t\twhile($row = mysqli_fetch_array($result_projName))\n\t\t{\n\t\t\t$projName = $row['projectName'];\n\t\t}\n\n\t\treturn $projName;\n\t}", "public function getProject()\r\n {\r\n return $this->_params['project'];\r\n }", "public function getProject($id){\n\n\t\t$this->db->select('*');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('project');\n\t\t$row = $query->row();\n\n\t\t$project = array(\n\t\t\t'id' => $row->id,\n\t\t\t'name' => $row->name,\n\t\t\t'aggregate_url' => $row->aggregate_url,\n\t\t\t'description' => $row->description,\n\t\t\t'sample_target' => $row->sample_target,\n\t\t\t'sample_target_bs' => $row->sampel_target_bs,\n\t\t\t'sampling_table' => $row->sampling_frame_table,\n\t\t\t'loc_columns' => $row->alloc_unit_columns,\n\t\t\t'start_date' => $row->start_date,\n\t\t\t'end_date' => $row->finish_date,\n\t\t\t'delete_status' => $row->delete_status,\n\t\t\t'date_created' => $row->date_created\n\t\t );\n\t\t return $project;\t\t\t\t\t\t\n\t}", "public function getProject()\n\t{\n\t\tif (!$this->projectId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\t\t$query->select('id, name, alias, description, url, logo, logo_alt, issue_template')\n\t\t\t->from('#__monitor_projects')\n\t\t->where(\"id = \" . $query->q($this->projectId));\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObject();\n\t}", "public function getProjects();", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "public function getProjectInfo(): ProjectInfoInterface;", "public function getProjectName() : string\n {\n return $this->projectName;\n }", "public static function retrieveProjectInfo($projectID) {\n return R::load('project', $projectID);\n }", "public function getGathercontentProject();", "public function getProjectName($project)\n {\n return self::get(\"SELECT * FROM $this->table WHERE project_name = '$project'\");\n }", "public function projects_get($id = \"0\",$type=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n \n $search = $this->input->get('search',TRUE);\n \n \n \n if(strcmp($type, \"0\")==0 && is_null($search))\n $result = $sutil->getProject($id,$from,$size);\n else if(strcmp($type, \"Documents\")==0)\n {\n $result = $sutil->getDocumentByProjectID($id,$from,$size);\n }\n else if(!is_null($search))\n {\n $result = $sutil->searchProject($search,$from,$size);\n }\n else\n {\n $result = array();\n $result['Error'] = \"Invalid input:\".$type;\n \n }\n \n $this->response($result);\n \n }", "public function getProjectTItle() {\n $project = \"Yii2\";\n return $project;\n }", "function get_project_name_by_id($id)\n{\n $CI =& get_instance();\n $CI->db->select('name');\n $CI->db->where('id', $id);\n $project = $CI->db->get('tblprojects')->row();\n if ($project) {\n return $project->name;\n }\n\n return '';\n}", "public static function getAssignedProject()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $current_team_id = \"\";\n $result_project = \"\";\n\n if ($res_des == 'Developer' || $res_des == 'Project Manager') {\n\t\t\t// Get Team that current user has been assigned to\n $result_teams = DB::table('dev_team')->where('user_id', '=', $res_id)->get();\n\n foreach ($result_teams as $result_team) {\n $current_team_id = $result_team->team_id;\n }\n\n\t\t\t// Get Project that the Team has been assigned to\n $result_project_ids = DB::table('assign_teams')->where('team_id', '=', $current_team_id)->get();\n\n foreach ($result_project_ids as $result_project_id) {\n $result_projectID = $result_project_id->ProjectID;\n }\n\n }\n\n return $result_projectID;\n }", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "function GetProjectInfoBasedOnId($projId)\n {\n $ret = '';\n \n $sql = 'SELECT * ' .\n ' FROM PROJECTS ' .\n ' WHERE PROJECT_ID = ' . $projId;\n \n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $info = array();\n $info['name'] = $row['PROJECT_NAME'];\n $info['desc'] = $row['PROJECT_DESC'];\n $info['id'] = $row['PROJECT_ID'];\n $info['timestamp'] = $row['PROJECT_TIMESTAMP'];\n $ret = $info;\n }\n \n return $ret;\n }", "function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "public function getDescProjectType()\n {\n return $this->desc_project_type;\n }", "public function getProject($projectId)\n {\n return GPLProject::model()->findByPk($projectId);\n }", "function project_by_task($key) {\n $project_key = $this->projects[$this->task_project[$key]];\n $project = $this->parsed_items[$project_key];\n return $project;\n }", "static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}", "public function getProjectId(): string\n {\n return $this->_projectId;\n }", "public function getProjectTitle();", "public function project_info (Project $project)\n {\n return $project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function get_project_by_id ($project_id)\n {\n $this->where('project_id', $project_id);\n $project = $this->get('projects');\n //returns an array\n return $project;\n }", "public function getProjects()\n {\n }", "function GetProjectType($projectTypeId)\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectType\", array(\"ProjectTypeId\"=>$projectTypeId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "protected function get_default_project_type() {\n $str = CriticalI_Property::get('project.default_type', 'inside-public');\n \n if (strtolower(trim($str)) == 'outside-public')\n return CriticalI_Project::OUTSIDE_PUBLIC;\n else\n return CriticalI_Project::INSIDE_PUBLIC;\n }", "public function projectTitle($id_project) {\n\t\t$this->db->select(\"project_title\");\n\t\t$this->db->from(\"project\");\n\t\t$this->db->where(\"id_project\",$id_project);\n\t\treturn $this->db->get();\n\t}", "private function getProjectNameAndProjectID(){\r\n $this->jsonOutput[\"projectID\"] = utils\\Encryption::encode($this->settingVars->projectID);\r\n $this->jsonOutput[\"projectName\"] = $this->settingVars->pageArray[\"PROJECT_NAME\"];\r\n }", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "public function getProject() {\n\t\treturn $this->project;\n\t}", "function getProjects() {\n\n\tglobal $db;\n\treturn $db->getProjectsByGroup ( $GLOBALS [\"targetId\"] );\n\n}", "public function get($project);", "public function get_project_all(){\n }", "public function get_project( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function project($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId);\n }", "public function data_project()\n {\n return new Data\\Project(array(\n 'name' => $this->get_data('name'),\n 'summary' => $this->get_data('summary')\n ));\n }", "function get_project()\n {\n return $this->find('all');\n }", "function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "function get_forge_project_name()\n\t{\n\t\treturn '';\n\t}", "function get_project($projectId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getProject($projectId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');\n }\n\n}", "public function model()\n {\n return Project::class;\n }", "public function get_projects()\n\t{\n\t\t$query = $this->db->get('projects');\n\t\treturn $query->result();\n\t}", "public function getProject($id)\n {\n }", "public function getProject($projectId) {\n\t\t$db = $this->connection();\n\t\t$sql = 'SELECT * FROM projects WHERE projectId = :projectId';\n\t\t$params = array(':projectId' => $projectId);\n\t\t$query = $db->prepare($sql);\n\t\t$status = $query->execute($params);\n\n\t\tif (!$status) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$project = $query->fetchObject();\n\n\t\tif ($project === null) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$returnProject = new Project($project);\n\n\t\treturn $returnProject;\n\t}", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "public function getProject() {\n\t\tif ($this->_project === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_project;\n\t}", "function projectname($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select property_name from manage_property where pid='$id'\"));\n\treturn $name['property_name'];\n\t}", "public function getProjectInformation() {\n $query = \"select * from projects\";\n $result = mysql_query($query);\n return $result;\n }", "public function getProjectById(int $projectId) : ProjectInterface;", "function getProjectName($lm_id){\n if (empty($lm_id)){\n $reply = array(0,'?');\n }else{\n $m = $this->getMember($lm_id);\n $reply = array($m['lm_value'],$m['lm_key']);\n }\n //b_debug::print_r($reply);\n return $reply;\n }", "public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }", "function get_cur_project() {\n\t\tif (!isset($_SESSION['dfl_project'])) {\n\t\t\tlgi_mysql_fetch_session(\"SELECT `dfl_project` AS `dfl_project` FROM %t(users) WHERE `name`='%%'\", $this->userid);\n\t\t\t// if not set, return first project found\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tlgi_mysql_fetch_session(\"SELECT `name` AS `dfl_project` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' LIMIT 1\", $this->userid);\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tthrow new LGIPortalException(\"No LGI projects for user: check certificate.\");\n\t\t}\n\t\treturn $_SESSION['dfl_project'];\n\t}", "public function getProjects()\n {\n $urlParts = array(\n 'format' => 'JSON',\n 'description' => '',\n 'type' => 'all',\n 'all' => '',\n 'tree' => '',\n );\n\n $url = $this->getBaseUrl() . 'projects/?' . http_build_query($urlParts);\n\n $response = $this->getConnector()->get($url);\n $response = $this->verifyResult($response, $url);\n\n $content = $this->transformJsonResponse($response->getContent());\n\n return $content;\n }", "static function get_projet($idProjet=NULL, $titreProjet=NULL, $type=NULL)\n\t{\n\t\t// Si on a un ID\n\t\tif(!empty($idProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet, $titreProjet=NULL, $type=NULL);\n\t\t}\n\t\telse if(!empty($titreProjet))\n\t\t{\n\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet, $type=NULL);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(!empty($type))\n\t\t\t{\n\n\t\t\t\t$get_projet = M_Projet::read_projet($idProjet=NULL, $titreProjet=NULL, $type);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$get_projet = M_Projet::read_projet();\n\t\t\t}\n\t\t}\n\t\treturn($get_projet);\n\t}", "function getProject($id = null)\n {\n $where = '';\n if($id) $where = \" AND idproject = '{$id}'\";\n $query = $this->db->query(\"SELECT idproject, title, DATE_FORMAT(startdate,'%m/%d/%Y') as startdate,\n\t\t DATE_FORMAT(enddate,'%m/%d/%Y') as enddate, companyname, companyurl, companycontactperson, companycontactpersonemail,\n\t\t note, active\n FROM project\n WHERE active = 1 {$where}\n ORDER BY idproject DESC\");\n\t\treturn $query; \n /*if($query->num_rows() > 1){\n return $query->result_array();\n }else{\n return $query->row_array();\n }*/\t\n }", "public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function projectName() : string\n {\n return (string) $this->getOrError('name');\n }", "public static function getById(Project $project)\n {\n \treturn VicinityMapProject::whereProjectId($project->id)->first();\n }", "public static function project()\n {\n return self::context()->project();\n }", "public function getProject(): ProjectContract\n {\n return $this->project;\n }", "public static function getProjectById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM project WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Project($results[0]);\n } else {\n return null;\n }\n }", "public function getTskProject()\n {\n return $this->tsk_project;\n }", "public function getByID($projectID)\n {\n $project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();\n $members = $this->getMembers($projectID); \n\n if(isset($members['manager'])) $project->PM = $members['manager'][0]->account;\n $project->members = array($project->PM);\n if(isset($members['member']))\n {\n foreach($members['member'] as $member)\n {\n $project->members[] = $member->account; \n }\n }\n\n return $project;\n }", "function get_project_name($project_id, &$link){\n \t$resp = 'Unknown';\n \t$query = \"select name from healingcrystals_projects where id='\" . $project_id . \"'\";\n \t$result = mysql_query($query, $link);\n \tif (mysql_num_rows($result)){\n \t\t$info = mysql_fetch_assoc($result);\n \t\t$resp = $info['name'];\n \t}\n \treturn $resp;\n }", "public function getProjectDetails($projectId)\n {\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n $sql = \"SELECT prj.project_id,project_name,config.config_id FROM `tbl_projects` as prj \n\t\tleft join tbl_config as config on config.project_id = prj.project_id WHERE prj.`deleted` = 0 AND prj.project_id = $projectId \";\n \t\t$result = $DB->fetchAssoc($sql);\n\t\treturn $result;\n }", "public function singleProject($project_id, $db)\r\n {\r\n $sql = \"SELECT * FROM projects\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst-> execute();\r\n $p = $pst->fetch(PDO::FETCH_OBJ);\r\n return $p;\r\n }", "private function getProject($id)\n {\n ///$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/projects/\".$id;\n \n echo \"\\ngetProject URL:\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function get($project)\n {\n $resource = $this->connection->get(\"/projects/{$project}\");\n return $this->load(['project' => $resource], 'Project', 'project');\n }", "public static function label()\n {\n return 'Projects';\n }", "public function projects()\n {\n $query = 'project';\n return json_decode($this->client->request('GET', $query, $this->options)->getBody(), true);\n }", "function get_projects( $user )\n {\n //Unimplemented\n }", "public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function getProject()\n { \n return $this->hasOne('App\\Project', 'id', 'resourse');\n }", "private function getProjectTitle($user_id, $level_id)\n\t{\n\t\t// Check if reference to this project is stored\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('pf_projects_id'))\n\t\t\t->from($db->qn('#__akeebasubs_pf4_projects'))\n\t\t\t->where($db->qn('users_id') . ' = ' . $db->q($user_id))\n\t\t\t->where($db->qn('akeebasubs_level_id') . ' = ' . $db->q($level_id));\n\t\t$db->setQuery($query);\n\t\t$proj_id = $db->loadResult();\n\t\tif($proj_id == null) return \"\";\n\t\t\n\t\t// Get the title\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('title'))\n\t\t\t->from($db->qn('#__pf_projects'))\n\t\t\t->where($db->qn('id') . ' = ' . $db->q($proj_id));\n\t\t$db->setQuery($query);\n\t\t$proj_title = $db->loadResult();\n\t\tif($proj_title == null) return \"\";\n\t\t\n\t\treturn $proj_title;\n\t}", "function get_project($pid){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"root\";\n $dbname = \"Projects\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql = \"SELECT head, summary, title, emails\n FROM Project\n WHERE pid = $pid\";\n $result = $conn->query($sql);\n $row = $result->fetch_assoc();\n return $row;\n }", "public function project($id)\n {\n $project = Project::find($id);\n $category = $project->category;\n return $project;\n }", "public function getProjectById($projectId) {\n\t\treturn $this->projectDao->getProjectById($projectId);\n\t}", "public function project($id)\n {\n $result = $this->get(\"projects/{$id}\");\n\n Validator::isArray($result);\n\n return $this->fromMantisProject($result['projects'][0]);\n }" ]
[ "0.70093536", "0.68687844", "0.6858338", "0.68562514", "0.67321527", "0.65691257", "0.65685254", "0.65274704", "0.65155596", "0.6470176", "0.6449057", "0.64338446", "0.64196324", "0.6364692", "0.6349267", "0.63388395", "0.63150513", "0.62619674", "0.6251214", "0.6231605", "0.6212782", "0.62104845", "0.62099975", "0.619549", "0.61814576", "0.6180469", "0.61722046", "0.6143323", "0.61424816", "0.61412776", "0.6140356", "0.6132999", "0.61263925", "0.6112092", "0.61097986", "0.61083204", "0.6086363", "0.6065461", "0.6021265", "0.6017978", "0.6017978", "0.6017978", "0.5988976", "0.59848726", "0.595027", "0.59492147", "0.5939668", "0.59265417", "0.59245116", "0.59143287", "0.59069943", "0.58939826", "0.5890785", "0.5886735", "0.5885346", "0.5863185", "0.5858713", "0.5846477", "0.58435833", "0.5839842", "0.5838198", "0.58290327", "0.5815146", "0.581448", "0.58117527", "0.58071214", "0.58071214", "0.57991225", "0.57957", "0.5794239", "0.579182", "0.57788527", "0.577181", "0.5764568", "0.5760489", "0.57581043", "0.57579064", "0.5748636", "0.574111", "0.57303804", "0.5720021", "0.5719256", "0.5710587", "0.5699261", "0.5697681", "0.56880146", "0.5687986", "0.5687949", "0.568426", "0.56837314", "0.5683381", "0.56744975", "0.56694204", "0.5664939", "0.5661723", "0.5649013", "0.56472284", "0.56451905", "0.56429285", "0.5639436", "0.5618159" ]
0.0
-1
/ This is a helpping method to get a subject in String type.
private function getSubject($id) { //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/subjects/".$id; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSubject(): string;", "public function getSubject(): string\n {\n return $this->subject;\n }", "abstract public function get_subject();", "abstract function getSubject() : string;", "public function getSubject() : string {\n return $this->_subject;\n }", "public function getSubject()\n {\n }", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "function getSubject() {\n\t\treturn $this->getData('subject');\n\t}", "function getSubject() {\n\t\treturn $this->getData('subject');\n\t}", "private function retrieveSubject() : string {\n\n // Get header of current email\n $header = $this->getHeader();\n\n // Return the subject in \"ASCII\" format\n return $this->decodeMimeHeaderExtension($header->subject, false);\n }", "public function getSubject(): string\n {\n return $this->getPayloadClaim('sub');\n }", "protected function getSubject(): string\n {\n if ($this->subject) {\n $this->subject = mb_encode_mimeheader($this->subject, $this->charset, 'B');\n }\n\n return $this->subject;\n }", "function getSubject(){\n\t\t\treturn $this->subject;\n\t\t}", "public function getSubject()\n {\n if (array_key_exists(\"subject\", $this->_propDict)) {\n return $this->_propDict[\"subject\"];\n } else {\n return null;\n }\n }", "public function getSubject(): mixed\n {\n return $this->subject;\n }", "abstract protected function getSubject();", "public function getSubject() \n\t{\n\t\treturn $this->subject;\n\t}", "public function getSubject($encoding = 'UTF-8') {}", "public function getSubject(): string\n {\n return 'mailingSubject';\n }", "public function getSubject($encoding = 'UTF-8') {}", "protected function getSubject()\n {\n // NOTE: Subject header is always present,\n // so it's safe to call this without checking for header presence\n return $this->getHeader('Subject');\n }", "public function getSubject()\n\t{\n\t\treturn $this->subject;\n\t}", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject()\n {\n return $this->subject;\n }", "public function getSubject() {\n\t\treturn $this->subject;\n\t}", "public function getSubject() \r\n { \r\n return $this->_subject; \r\n }", "protected function getEmailSubject() {}", "function getSubject()\n {\n return $this->_subject;\n }", "public function getSubject(): ?string\n {\n return $this->getClaimSafe(SharedClaimsInterface::CLAIM_SUBJECT);\n }", "function Subject( $subject )\r\n\t\t{\r\n//echo \"$subject\";\r\n\t\t$this->msubject = \"=?utf-8?B?\"\r\n\t\t\t. base64_encode( strtr( $subject, \"\\r\\n\" , \" \" ) )\r\n\t\t\t. \"?=\";\r\n\t\t}", "public function getSubjectName()\n {\n if (array_key_exists(\"subjectName\", $this->_propDict)) {\n return $this->_propDict[\"subjectName\"];\n } else {\n return null;\n }\n }", "public function getSubject($type = null)\n {\n if( null === $this->_subject ) {\n throw new Khcn_Model_Exception(\"getSubject was called without first setting a subject. Use hasSubject to check\");\n } else if( is_string($type) && $type !== $this->_subject->getType() ) {\n throw new Khcn_Model_Exception(\"getSubject was given a type other than the set subject\");\n } else if( is_array($type) && !in_array($this->_subject->getType(), $type) ) {\n throw new Khcn_Model_Exception(\"getSubject was given a type other than the set subject\");\n }\n \n return $this->_subject;\n }", "public function getOriginalSubject(): string\n {\n return $this->decodeForHeader($this->subject);\n }", "public function getSubject()\n {\n return $this->getValue('nb_icontact_prospect_subject');\n }", "public function getSubject()\n {\n\n // Subject Already Set\n if (!empty($this->subject)) {\n return $this->subject;\n }\n\n // Default Subject\n return 'Customize your search alerts - Never miss a hot deal';\n }", "protected function _subject($additional = array()) {\n\t\treturn $this->_crud()->getSubject($additional);\n\t}", "function subject_obtain($report_subject)\n\t{\n\t\t$sql = 'SELECT t.topic_title, t.topic_first_post_id\n\t\t\tFROM ' . BB_POSTS . ' p\n\t\t\tINNER JOIN ' . BB_POSTS_TEXT . ' pt\n\t\t\t\tON pt.post_id = p.post_id\n\t\t\tINNER JOIN ' . BB_TOPICS . ' t\n\t\t\t\tON t.topic_id = p.topic_id\n\t\t\tWHERE p.post_id = ' . (int)$report_subject;\n\t\tif (!$result = DB()->sql_query($sql)) {\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not obtain report subject', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\t$row = DB()->sql_fetchrow($result);\n\t\tDB()->sql_freeresult($result);\n\n\t\tif (!$row) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ($row['topic_title'] != '') {\n\t\t\treturn $row['topic_title'];\n\t\t} else {\n\t\t\t$subject = ($row['topic_first_post_id'] == $report_subject) ? '' : 'Re: ';\n\t\t\t$subject .= $row['topic_title'];\n\n\t\t\treturn $subject;\n\t\t}\n\t}", "public function get_subject() {\n\t\tif ( $this->object['voucher_count'] == 1 ) {\n\t\t\treturn apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->subject ), $this->object );\n\t\t} else {\n\t\t\treturn apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->subject_multiple ), $this->object );\n\t\t}\n\t}", "public function generate( string $subject ) : string\n {\n return $subject;\n }", "function sc_mailbox_message_subject($parm = '')\n {\n // if(e107::getParser()->filter($_GET['id']))\n // {\n // return $this->var['message_subject'];\n // }\n\n \n $urlparms = array(\n 'id' => $this->var['message_id'],\n );\n\n // Check if draft, because then it requires a link to continue writing the message (compose)\n if(e107::getParser()->filter($_GET['page']) == 'draftbox')\n {\n $url = e107::url('mailbox', 'composeid', $urlparms);\n }\n else\n {\n $url = e107::url('mailbox', 'read', $urlparms);\n }\n\n if($parm['type'] == 'url')\n {\n return $url; \n }\n\n return $this->var['message_subject']; \n \n }", "function getSubject($locale) {\n\t\treturn isset($this->localeData[$locale]['subject']) ? $this->localeData[$locale]['subject'] : '';\n\t}", "function getEmailSubject($emailId) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT subject FROM scuola.email_store WHERE id_email = %s\", $emailId);\n\n // Perform Query\n $result = mysql_query($query);\n if (!$result) {\n setcookie('message', mysql_error());\n }\n $row = mysql_fetch_assoc($result);\n $subject = $row['subject'];\n }\n $this->closeConnection();\n return ($subject == null || strlen($subject) == 0) ? '<NO SUBJECT>' : test_input($subject);\n }", "public function getSubjectID()\n {\n return $this->subject->getID();\n }", "protected function _getMailSubject()\n {\n $subject = $this->config->get('subject');\n $subject = $this->_macros->renderText($subject, $this->getOrder());\n $subject = JString::trim($subject);\n\n if (empty($subject)) {\n $subject = $this->getName();\n }\n\n return $subject;\n }", "public function getSubjectName()\n {\n $subjectName = $this->getCourse()->getName();\n if ($this->getSubject()) {\n $subjectName = $this->getSubject()->getName();\n }\n return $subjectName;\n }", "public function getSubject()\n {\n\n // Subject Already Set\n if (!empty($this->subject)) {\n return $this->subject;\n }\n\n // Previous Saved Search\n $updated = $this->data['updated'];\n\n // Default Subject\n return 'Saved Search Notification' . (!empty($updated) ? ' (Updated)' : '');\n }", "public function getUserSubject()\n {\n return $this->usersubject;\n }", "function encodeSubject($text)\n {\n return $text;\n }", "public function get_subject_name($subjectid){\r\n\t\t$user = get_user($subjectid);\r\n\t\treturn $user->name;\r\n\t}", "public function getSubject()\n {\n return $this->config['Message']['Subject']['Data'];\n }", "public function getSubjectAttribute()\n {\n if (isset($this->_subject)) {\n return $this->_subject;\n }\n\n return null;\n }", "public function encodeSubject($subject, $charSet='ISO-8859-1', $type='quoted') {\n\n\t\t// TODO: Das hier müsste eigentlich rein, wenn aber das template auch nur ein MB-Zeichen enthält\n\t\t// aber ISO codiert ist, dann erscheinen statt Sonderzeichen nur \"?\"\n//\t\t if (mb_detect_encoding($subject, 'UTF-8')){\n//\t\t\t $subject = utf8_decode($subject);\n//\t\t }\n\t\t \n\t\t if (!$charSet) {\n\t\t \t$charSet = 'ISO-8859-1';\n\t\t }\n\t\t \n\t\t// Secure Subject Text\n\t\t$subject = trim(str_replace(array(\"\\r\", \"\\n\"), '', $subject));\n\t\t\n\t\tswitch($type) {\n\t\t\t\n\t\t\tcase 'binary':\n\n\t\t\t\t$encodedSubject = base64_encode($subject);\n\t\t\t\t$encodedSubject = trim('=?' . $charSet .'?B?' . $encodedSubject . '?=');\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'quoted':\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t$subject = str_replace(' ', '_', $subject);\n\t\t\n\t\t\t\t//encode Subject \n\t\t\t\t$encodedSubject = $this->quotedPrintableEncode($subject);\n\t\t\t\t$encodedSubject = trim('=?' . $charSet .'?Q?' . $encodedSubject . '?=');\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $encodedSubject; \n\t}", "protected function getKeyword(): string\n {\n return 'SUBJECT';\n }", "public function getSubjectRaw( $params ) {\n\t\treturn empty( $params['subject_escaped'] ) ? @$params['subject'] : $this->unhtmlspecialchars( @$params['subject'] );\n\t}", "protected function makeSubjectHeaderString() {\n\t\tif(($this->_mailProtocol != 'mail') AND (!empty($this->_mailSubject))) { \n\t\t\treturn 'Subject: ' . $this->_mailSubject . $this->_endString;\n\t\t}\n\t\treturn '';\n\t}", "function selectParticularSubject($subject) {\n if ($subject === 'none') {\n print 'Nenurodyta';\n }\n if ($subject === 'complains') {\n print 'Skundai';\n }\n if ($subject === 'questions') {\n print 'Klausimai';\n }\n}", "public function subject($subject);", "function subject($subject = '')\n\t{\n\t\tif (!$subject)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t$this->subject = $subject;\n\t}", "function the_ticket_subject() {\n\n // Get ticket\n $ticket = md_the_component_variable('support_single_ticket');\n\n // Verify if ticket exists\n if ( $ticket ) {\n return $ticket[0]['subject'];\n } else {\n return false;\n }\n \n }", "public function subject()\n {\n return $this->belongsTo(\n __NAMESPACE__ . '\\Subject', 'email_subject_id', 'id'\n );\n }", "public function getEmailSubject() { return $this->_emailSubject; }", "private static function get_email_subject($user_data)\n {\n }", "public function getSubject($subjectId) {\n $subject = null;\n $sql = 'SELECT title FROM `hotornot-dev`.tblChallengeSubjects WHERE id = ?';\n $params = array( $subjectId );\n $stmt = $this->prepareAndExecute($sql, $params);\n $data = $stmt->fetchAll( PDO::FETCH_CLASS, 'stdClass' );\n if( $data ){\n $subject = $data[0]->title;\n }\n return $subject;\n }", "function getSubject() {\n $sql = 'select *from ebh_users limit 10';\n $row = $this->db->query($sql)->list_array();\n return $row;\n }", "public function getSubjectData()\n {\n return PerchUtil::json_safe_encode($this->subject->toArray());\n }", "public function getdistringsubject()\n\t{\n\t\t$this->db->distinct();\n\t\t$this->db->select('gen_type');\n\t\t$this->db->order_by('gen_type', 'asc');\n\t\t$query=$this->db->get('admission_erp');\n\t\treturn $query->result();\n\t}", "protected function getEmailSubject($email)\n {\n return $email->getSubject();\n }", "function getSubject($code) {\n $con = getConnection();\n $sql = \"SELECT email_subject FROM email_text_tab WHERE email_code = ?;\";\n $subject = \"\";\n if ($stmt = mysqli_prepare($con, $sql)) {\n mysqli_stmt_bind_param($stmt, \"s\", $code);\n mysqli_stmt_execute($stmt); \n mysqli_stmt_bind_result($stmt, $result);\n while(mysqli_stmt_fetch($stmt)) {\n $subject = $result;\n }\n mysqli_stmt_close($stmt);\n }\n closeConnection($con);\n return $subject;\n }", "function setSubject($subject_toset,$default=\"No Subject\"){\n\t\t\tif(strlen($subject_toset)>0)\n\t\t\t{\n\t\t\t\t$this->subject=$subject_toset;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->subject=$default;\t\n\t\t\t}\n\t\t}", "public function getSubject()\n {\n return $this->hasOne(Subject::className(), ['subject_id' => 'subject_id']);\n }", "function setSubject( $str ){\n $this->Subject = SITE_NAME.\": \".$str;\n }", "public function getSubject()\n {\n return $this->EmailSubject ? $this->EmailSubject : $this->getCurrentPageTitle();\n }", "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "public function setSubject($var)\n {\n GPBUtil::checkString($var, True);\n $this->subject = $var;\n\n return $this;\n }", "function getContactUsSubjects() {\n return array(\n '0' => 'I would like to know the advertising prices',\n '1' => 'I would like to know how to create my profile',\n '2' => 'I would like to make a booking with an escort',\n '3' => 'Problems logging in',\n '4' => \"I didn't recieve my activation email\",\n '5' => 'Technical Support',\n '6' => 'Other'\n );\n}", "public function get_subject_identity( $id_token_claim ) {\n\t\treturn $id_token_claim['sub'];\n\t}", "abstract public function subject($subject);", "public static function getSubjectList()\n {\n return self::pluck('name', 'id');\n }", "public function getSubjectTitle(): ?string {\n $val = $this->getBackingStore()->get('subjectTitle');\n if (is_null($val) || is_string($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'subjectTitle'\");\n }", "function get_subject_info($subject_id){\n $query = $this->db->get_where('subject', array('subject_id'=> $subject_id));\n return $query->result_array();\n }" ]
[ "0.80003315", "0.77959657", "0.7767337", "0.7751092", "0.76167196", "0.7550399", "0.75480884", "0.75480884", "0.75480884", "0.75480884", "0.75480884", "0.75480884", "0.75480884", "0.7522569", "0.7522569", "0.7417192", "0.7344277", "0.7275357", "0.7273615", "0.72641826", "0.7250468", "0.7227381", "0.72022784", "0.7174182", "0.71719223", "0.71693015", "0.71662116", "0.715335", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7151396", "0.7134337", "0.710638", "0.70496196", "0.6972033", "0.6959051", "0.6946121", "0.6937781", "0.6925904", "0.6913674", "0.6855231", "0.6800661", "0.6753658", "0.6658092", "0.6656138", "0.66309506", "0.66189826", "0.6616291", "0.66132104", "0.6562396", "0.65613896", "0.6523983", "0.6512783", "0.65089804", "0.6496982", "0.6496546", "0.6492791", "0.6492161", "0.64723307", "0.64577883", "0.645683", "0.6446079", "0.6432927", "0.63947934", "0.63903314", "0.63898027", "0.63869625", "0.63651717", "0.63268864", "0.63059944", "0.62994057", "0.62816966", "0.62718356", "0.6259569", "0.62518156", "0.62092274", "0.61870825", "0.61654687", "0.61603755", "0.6151207", "0.6151207", "0.6145596", "0.6129108", "0.61121684", "0.61094564", "0.60821366", "0.607689" ]
0.63175166
82
/ This is a helpping method to get a document in String type.
private function getDocument($id) { //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/documents/".$id; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDocument();", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "abstract public static function getDoc();", "public function getDocType();", "abstract public function getDocument($id);", "static public function Get_Document_List() \n\t{\n\t\t$args = func_get_args();\n\t\t$obj = self::staticCall(\"Get_Document_List\",$args);\n//var_dump($obj);\n\t\treturn (string) $obj->__toString();\n\t}", "public function getDocument($id);", "public function get_document()\n {\n return $this->document;\n }", "public function document()\n\t{\n\t\treturn $this->Obj_Doc;\n\t}", "public function getDocumentByID($id)\n\t{\t\n\t\n\t\t$Document = new Document();\n\t\t$Utility = new Utility();\n\t\t// $document_id = $request->input('type');\n\t\t$document_id = $id;\n\n\t\t// return $document_id;\n\n\t\tif(isset($document_id) && $document_id!=NULL)\n\t\t{\n\t\t\tif(!empty($document_id) && is_numeric($document_id))\n\t\t\t{\n\t\t\t\t$document_id=$Utility->Clean_Data($document_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new customValidationException(\"A valid numeric document ID is required\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new customValidationException(\"document ID required\");\n\t\t}\n\n\t\t$documents = $Document->Document_by_Types($document_id);\n\n\t\treturn response()->json($documents);\n\t}", "public function getDocuments();", "private static final function getDocumentType () {\r\n // Do return ...\r\n return self::$objDocumentType;\r\n }", "function read_document($filename){\n\t\t$file_extension = substr($filename, strlen($filename)-4, 4);\n\t\tif($file_extension == 'docx'){\n\t\t\t$doc = $this->read_file_docx($filename);\n\t\t}else{\n\t\t\t$doc = $this->read_file_doc($filename);\n\t\t}\n\t\t$match = array(\"'\",'\"',\"’\",\"‘\",'“','”','–','–','-');\n\t\t$replace = array(\"'\",'\"',\"'\",\"'\",'\"','\"','-','-','');\n\t\t$doc = str_replace($match, $replace , $doc);\n\t\t$doc = htmlentities($doc);\n\t\treturn $doc;\n\t}", "abstract public function getDocuments();", "public function get_document(){retrun($id_local_document); }", "public function get_document() {\n\t\treturn $this->doc;\n\t}", "public function getString() {}", "public function getStringRepresentation(): string;", "public function getDocument() {\n\t\treturn phpQuery::getDocument($this->getDocumentID());\n\t}", "public function getDocument() {\n\t\treturn phpQuery::getDocument($this->getDocumentID());\n\t}", "function readDocumentType($id){\n $obj = new DocumentType($id);\n if($obj->isNew()) return false; else return $obj;\n }", "public function __toString() {\n\t\treturn json_encode($this->document);\n\t}", "public function get_document(){\n\t\t\t$query = $this->db->get_where(\"tipodocum\");\n\t\t\treturn $query->result();\n\t\t}", "public static function getDocument()\n {\n return self::$_document;\n }", "public function getLienDocument(): ?string {\n return $this->lienDocument;\n }", "public function getDocumentType()\n {\n return $this->document_type;\n }", "function get_string() {\n\t\t$str = $this->_parse();\n return $str;\n }", "public function getDocid(): string\n {\n return $this->docid;\n }", "function getDocument($id) { /* {{{ */\n\t\t$hits = $this->index->find('D'.$id);\n\t\treturn $hits['hits'] ? $hits['hits'][0] : false;\n\t}", "public function getDocsByName($name){\r\n return ClientSDocs::where('projectclientservices_id',$this->id)->where('document',$name)->first();\r\n }", "public function getDocumentType() {\n return $this->document['type'];\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument(): Document\n {\n return $this->document;\n }", "public function data(): DocumentData;", "public function get_documents() \n {\n $endpoint_name = \"/documents/\";\n $request_arguments = [];\n $documents = $this->request(\"GET\", $endpoint_name, $request_arguments);\n if (array_key_exists(\"documents\", $documents)) {\n return $documents[\"documents\"];\n }\n return $documents;\n }", "public static function doc() { return \"\\n\" . file_get_contents(__CLASS__ . '.doc.txt'); }", "public function getDocument($document_code, array $security_params=array()): string\n {\n return $this->request('documents/'.$document_code, 'GET', array(\n 'headers' => [\n 'X-SECURITY-CODE-1' => $security_params['security-code-1'] ?? '',\n 'X-SECURITY-CODE-2' => $security_params['security-code-2'] ?? '',\n 'X-ACTIVITY' => $security_params['activity'] ?? '',\n 'X-SOURCE' => $security_params['source'] ?? '',\n 'X-CLIENT-IP' => $security_params['client-ip'] ?? '',\n 'X-USER-AGENT' => $security_params['user-agent'] ?? ''\n ]\n ));\n }", "public function getDocument()\n\t{\n\t\treturn $this->document;\n\t}", "public function getDocumentType()\n {\n return $this->_documentType;\n }", "public function get_document($document_id)\n\t{\n\t\t$this->db->select('documents.document_id, documents.document_name, documents.document_text, collections.collection_name');\n\t\t$this->db->from('documents');\n\t\t$this->db->join('collections', 'documents.collection_id = collections.collection_id');\n\t\t$this->db->where(array('documents.document_id' => $document_id));\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query->row_array();\n\t}", "public function getDocument()\n\t{\n\t\treturn $this->_doc;\n\t}", "public function getDocument() {\n return $this->document;\n }", "public static function getById($id) {\n\n $id = intval($id);\n\n if ($id < 1) {\n return null;\n }\n\n $cacheKey = \"document_\" . $id;\n\n try {\n $document = \\Zend_Registry::get($cacheKey);\n if(!$document){\n throw new \\Exception(\"Document in registry is null\");\n }\n }\n catch (\\Exception $e) {\n try {\n if (!$document = Cache::load($cacheKey)) {\n $document = new Document();\n $document->getResource()->getById($id);\n\n $mappingClass = \"\\\\Pimcore\\\\Model\\\\Document\\\\\" . ucfirst($document->getType());\n\n // this is the fallback for custom document types using prefixes\n // so we need to check if the class exists first\n if(!\\Pimcore\\Tool::classExists($mappingClass)) {\n $oldStyleClass = \"Document_\" . ucfirst($document->getType());\n if(\\Pimcore\\Tool::classExists($oldStyleClass)) {\n $mappingClass = $oldStyleClass;\n }\n }\n $typeClass = Tool::getModelClassMapping($mappingClass);\n\n if (Tool::classExists($typeClass)) {\n $document = new $typeClass();\n \\Zend_Registry::set($cacheKey, $document);\n $document->getResource()->getById($id);\n\n Cache::save($document, $cacheKey);\n }\n }\n else {\n \\Zend_Registry::set($cacheKey, $document);\n }\n }\n catch (\\Exception $e) {\n \\Logger::warning($e->getMessage());\n return null;\n }\n }\n\n if(!$document) {\n return null;\n }\n\n return $document;\n }", "public function document_type() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn (isset($class::_object()->document_type)) ? $class::_object()->document_type:null;\r\n }", "public function getDoc()\n {\n return $this->doc;\n }", "public function get_one_document($id_document){\n try{\n return DB::table('study_document')\n ->where('study_document.id', $id_document)\n ->join('user', 'study_document.id_lecturer', 'user.id')\n ->select('study_document.*', 'user.full_name as author')\n ->first();\n }catch (\\Exception $ex){\n return $ex;\n }\n }", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "public function getDocumentType() {\n\t\tif($this->document_type == 'DOCUMENT' && $this->document_id)\n\t\t\treturn Yii::t('store', $this->document->document_type);\n\t\telse\n\t\t\treturn Yii::t('store', $this->document_type);\n\t}", "function getDocumentContent($id) {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT document_name, document_type, document_size, document_content FROM Documents WHERE document_id='\".mysqli_real_escape_string($conn,$id). \"'\";\n\n\t// $result\n\t$result = $conn->query($dbQuery);\n\n\t// checking for errors\n\tif(!$result) {\n\t\techo \"Error: \" . $dbQuery . \"<br>\" . $conn->error;\n\t\tdie();\n\t}\n\n\t//if $result is successful\n\t$row = $result->fetch_array(); //by now they should have the same email address\n\n\tif(!$row) {\n\t\tdie('FATAL: document was not found');\n\t}\n\n\t// free the results array\n\t$result->close();\n\t$conn->close();\n\n\treturn $row;\n}", "public function __toString()\n {\n $str = \"Document : <br>\";\n $str .= \"numEnregistrement: $this->numEnregistrement<br>\";\n $str .= \"Title: $this->title<br>\";\n return $str;\n }", "public function getSacadoDocumento();", "function getDocument($authentication, $modulepart, $file, $refname = '')\n{\n\tglobal $db,$conf,$langs,$mysoc;\n\n\tdol_syslog(\"Function: getDocument login=\".$authentication['login'].' - modulepart='.$modulepart.' - file='.$file);\n\n\tif ($authentication['entity']) $conf->entity=$authentication['entity'];\n\n\t$objectresp=array();\n\t$errorcode='';$errorlabel='';\n\t$error=0;\n\n\t// Properties of doc\n\t$original_file = $file;\n\t$type=dol_mimetype($original_file);\n\t//$relativefilepath = $ref . \"/\";\n\t//$relativepath = $relativefilepath . $ref.'.pdf';\n\n\t$accessallowed=0;\n\n\t$fuser=check_authentication($authentication, $error, $errorcode, $errorlabel);\n\n\tif ($fuser->societe_id) $socid=$fuser->societe_id;\n\n\t// Check parameters\n\tif (! $error && ( ! $file || ! $modulepart ) )\n\t{\n\t\t$error++;\n\t\t$errorcode='BAD_PARAMETERS'; $errorlabel=\"Parameter file and modulepart must be both provided.\";\n\t}\n\n\tif (! $error)\n\t{\n\t\t$fuser->getrights();\n\n\t\t// Suppression de la chaine de caractere ../ dans $original_file\n\t\t$original_file = str_replace(\"../\", \"/\", $original_file);\n\n\t\t// find the subdirectory name as the reference\n\t\tif (empty($refname)) $refname=basename(dirname($original_file).\"/\");\n\n\t\t// Security check\n\t\t$check_access = dol_check_secure_access_document($modulepart, $original_file, $conf->entity, $fuser, $refname);\n\t\t$accessallowed = $check_access['accessallowed'];\n\t\t$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];\n\t\t$original_file = $check_access['original_file'];\n\n\t\t// Basic protection (against external users only)\n\t\tif ($fuser->societe_id > 0)\n\t\t{\n\t\t\tif ($sqlprotectagainstexternals)\n\t\t\t{\n\t\t\t\t$resql = $db->query($sqlprotectagainstexternals);\n\t\t\t\tif ($resql)\n\t\t\t\t{\n\t\t\t\t\t$num=$db->num_rows($resql);\n\t\t\t\t\t$i=0;\n\t\t\t\t\twhile ($i < $num)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = $db->fetch_object($resql);\n\t\t\t\t\t\tif ($fuser->societe_id != $obj->fk_soc)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessallowed=0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Security:\n\t\t// Limite acces si droits non corrects\n\t\tif (! $accessallowed)\n\t\t{\n\t\t\t$errorcode='NOT_PERMITTED';\n\t\t\t$errorlabel='Access not allowed';\n\t\t\t$error++;\n\t\t}\n\n\t\t// Security:\n\t\t// On interdit les remontees de repertoire ainsi que les pipe dans\n\t\t// les noms de fichiers.\n\t\tif (preg_match('/\\.\\./', $original_file) || preg_match('/[<>|]/', $original_file))\n\t\t{\n\t\t\tdol_syslog(\"Refused to deliver file \".$original_file);\n\t\t\t$errorcode='REFUSED';\n\t\t\t$errorlabel='';\n\t\t\t$error++;\n\t\t}\n\n\t\tclearstatcache();\n\n\t\tif(!$error)\n\t\t{\n\t\t\tif(file_exists($original_file))\n\t\t\t{\n\t\t\t\tdol_syslog(\"Function: getDocument $original_file $filename content-type=$type\");\n\n\t\t\t\t$file=$fileparams['fullname'];\n\t\t\t\t$filename = basename($file);\n\n\t\t\t\t$f = fopen($original_file, 'r');\n\t\t\t\t$content_file = fread($f, filesize($original_file));\n\n\t\t\t\t$objectret = array(\n\t\t\t\t\t'filename' => basename($original_file),\n\t\t\t\t\t'mimetype' => dol_mimetype($original_file),\n\t\t\t\t\t'content' => base64_encode($content_file),\n\t\t\t\t\t'length' => filesize($original_file)\n\t\t\t\t);\n\n\t\t\t\t// Create return object\n\t\t\t\t$objectresp = array(\n\t\t\t\t\t'result'=>array('result_code'=>'OK', 'result_label'=>''),\n\t\t\t\t\t'document'=>$objectret\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdol_syslog(\"File doesn't exist \".$original_file);\n\t\t\t\t$errorcode='NOT_FOUND';\n\t\t\t\t$errorlabel='';\n\t\t\t\t$error++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($error)\n\t{\n\t\t$objectresp = array(\n\t\t'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)\n\t\t);\n\t}\n\n\treturn $objectresp;\n}", "public function getDocumentName()\n {\n $value = $this->get(self::DOCUMENTNAME);\n return $value === null ? (string)$value : $value;\n }", "public function document($path = '')\n {\n return $this->resolvePath($this->documentRoot, $path);\n }", "public function string();", "public function getDocumentation(): string;", "function _apachesolr_index_process_entity_get_document($entity, $entity_type) {\n list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n\n $document = new ApacheSolrDocument();\n\n // Define our url options in advance. This differs depending on the\n // language\n $languages = language_list();\n $url_options = array('absolute' => TRUE);\n if (isset($entity->language) && isset($languages[$entity->language])) {\n $url_options['language'] = $languages[$entity->language];\n }\n\n $document->id = apachesolr_document_id($entity_id, $entity_type);\n $document->site = url(NULL, $url_options);\n $document->hash = apachesolr_site_hash();\n\n $document->entity_id = $entity_id;\n $document->entity_type = $entity_type;\n $document->bundle = $bundle;\n $document->bundle_name = entity_bundle_label($entity_type, $bundle);\n\n if (empty($entity->language)) {\n // 'und' is the language-neutral code in Drupal 7.\n $document->ss_language = LANGUAGE_NONE;\n }\n else {\n $document->ss_language = $entity->language;\n }\n\n $path = entity_uri($entity_type, $entity);\n // A path is not a requirement of an entity\n if (!empty($path)) {\n $document->path = $path['path'];\n $document->url = url($path['path'], $path['options'] + $url_options);\n // Path aliases can have important information about the content.\n // Add them to the index as well.\n if (function_exists('drupal_get_path_alias')) {\n // Add any path alias to the index, looking first for language specific\n // aliases but using language neutral aliases otherwise.\n $output = drupal_get_path_alias($document->path, $document->ss_language);\n if ($output && $output != $document->path) {\n $document->path_alias = $output;\n }\n }\n }\n return $document;\n}", "public function documents_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n $operator=\"OR\";\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n \n $temp = $this->input->get('default_operator', TRUE);\n if(!is_null($temp))\n {\n $operator = $temp;\n }\n \n \n $result = null;\n if(is_null($search))\n $result = $sutil->getDocument($id,$from,$size);\n else \n {\n $result = $sutil->searchDocuments($search,$from,$size,$operator);\n }\n $this->response($result);\n }", "private function readDocument($filename,$originalClientName) {\n $content = '';\n \n $fileType = strrchr($filename,'.'); //TODO: retrieve filetype\n \n switch($fileType) {\n case '.xls':\n case '.xlsx':\n $inputFileType = IOFactory::identify($filename);\n $reader = IOFactory::createReader($inputFileType);\n $reader->setReadDataOnly(true);\n try {\n $content = $reader->load($filename);\n } catch (Exception $e) {\n dd(\"erreur\". $e);\n }\n\n $content = $content->getActiveSheet()->toArray(null, true, true, true);\n\n array_walk($content, function(&$row) {\n $ligne = '';\n foreach($row as $cell) {\n if($cell) {\n $ligne .= $cell.\"\\t\";\n }\n }\n $row = $ligne.PHP_EOL;\n });\n\n $content = array_filter($content, function($row) { return $row!=PHP_EOL; });\n $content = implode('',$content);\n break;\n case '.pdf':\n // Parse pdf file and build necessary objects.\n $parser = new Parser();\n $pdf = $parser->parseFile($filename);\n\n $content = $pdf->getText();\n break;\n case '.doc':\n case '.docx':\n case '.odt':\n case '.rtf':\n if($fileType=='.doc') { //Format Word97\n $phpWord = WordIOFactory::load($filename, 'MsDoc');\n } elseif($fileType=='.docx') { //Format Word2007\n $phpWord = WordIOFactory::load($filename);\n } elseif($fileType=='.odt') { //Format ODT\n $phpWord = WordIOFactory::load($filename, 'ODText');\n } elseif($fileType=='.rtf') { //Format RTF\n $phpWord = WordIOFactory::load($filename, 'RTF');//\n }\n $content = '';\n foreach ($phpWord->getSections()[0]->getElements() as $element) { \n switch(get_class($element)) {\n case 'PhpOffice\\PhpWord\\Element\\PageBreak':\n break;\n case 'PhpOffice\\PhpWord\\Element\\Text':\n $content .= $element->getText().\"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Link':\n $content .= $element->getText();\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextRun':\n $cpt = 0;\n foreach ($element->getElements() as $runElement) {\n if($runElement->getText()==null) { $cpt++; }\n if($cpt==2) {\n $content .= $runElement->getText().\"\\t\";\n $cpt = 0;\n } else {\n $content .= $runElement->getText().\"\";\n }\n }\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextBreak':\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\ListItem':\n $content .= \"- \".$element->getTextObject()->getText().\"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Table':\n foreach ($element->getRows() as $row) {\n foreach ($row->getCells() as $cell) {\n foreach ($cell->getElements() as $element) {\n switch(get_class($element)) {\n case 'PhpOffice\\PhpWord\\Element\\Text':\n $content .= $element->getText().\"\\t\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Link':\n $content .= $element->getText().\"\\t\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextRun':\n $cpt = 0;\n foreach ($element->getElements() as $runElement) {\n if($runElement->getText()==null) { $cpt++; }\n if($cpt==2) {\n $content .= $runElement->getText().\"\\t\";\n $cpt = 0;\n } else {\n $content .= $runElement->getText().\"\";\n }\n }\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextBreak':\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\ListItem':\n $content .= \"- \".$element->getTextObject()->getText().\"\\r\\n\";\n break;\n default :\n dd($element);\n }\n }\n \n }\n $content .= \"\\r\\n\";\n }\n break;\n default:\n $class = get_class($element);\n }\n }\n break;dd($content);\n case '.html':\n case '.htm':\n case '.xml':\n $content = strip_tags(file_get_contents($filename));\n\n $encodingList = ['UTF-8', 'UTF-7', 'ASCII', 'EUC-JP','SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP', 'ISO-8859-1'];\n $encoding = mb_detect_encoding($content,$encodingList);\n if($encoding!='UTF-8'){\n $content = mb_convert_encoding($content,'UTF-8',$encodingList);\n $encoding = 'UTF-8';\n }\n $content = html_entity_decode($content,ENT_COMPAT | ENT_HTML5, $encoding);\n //Suppresion des espaces et retour superflus\n $content = preg_replace('/ {2,}/',\" \",$content);\n $content = preg_replace('/( )*(\\r( )*){2,}/',\"\\r\",$content);\n $content = preg_replace('/( )*(\\n( )*){2,}/',\"\\n\",$content);\n $content = preg_replace('/( )*((\\r\\n)( )*){2,}/',\"\\r\\n\",$content);\n $content = preg_replace('/( )*(\\t( )*){2,}/',\"\\t\",$content);\n break;\n case '.txt':\n case '.csv':\n $content = file_get_contents($filename);\n \n $encodingList = ['UTF-8', 'UTF-7', 'ASCII', 'EUC-JP','SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP', 'ISO-8859-1'];\n $encoding = mb_detect_encoding($content,$encodingList);\n if($encoding!='UTF-8'){\n $content = mb_convert_encoding($content,'UTF-8',$encodingList);\n }\n break;\n case '.png':\n case '.jpeg':\n case '.jpg':\n case '.bmp':\n case '.gif':\n default: \n $content .= substr($originalClientName,0,strrpos($originalClientName,\".\")); \n }\n \n return $content;\n }", "public function isExpectingDocument();", "public function getDocument($document, $id, $type)\n {\n if (!in_array($type, ['info', 'xml', 'pdf'])) {\n return $this->response(404);\n }\n\n $doc = $this->documentRepository->get($id);\n if ($doc === null) {\n return $this->response(404);\n }\n if ($doc['cliente_doc'] !== $document) {\n return $this->response(401);\n }\n if ($type == 'info') {\n return $this->ok($doc);\n }\n\n $filter = $this->documentConverter->convertToDoc($doc);\n $storageId = $this->documentRepository->getStorageId($filter);\n\n $result = [\n 'file' => $this->fileRepository->read($storageId, $type),\n 'type' => $type === 'xml' ? 'text/xml' : 'application/pdf',\n ];\n\n $headers = [\n 'Content-Type' => $result['type'],\n 'Content-Disposition' => 'attachment',\n 'Content-Length' => strlen($result['file']),\n ];\n\n return $this->response(200, $result, $headers);\n }", "public function get_document($document_id) \n {\n $endpoint_name = \"/documents/{$document_id}/\";\n $request_arguments = [ \"id\" => $document_id ];\n $document = $this->request(\"GET\", $endpoint_name, $request_arguments);\n return $document;\n }", "public function get_document($record, $options = array()) {\n\n $context = \\context_system::instance();\n\n // Prepare associative array with data from DB.\n $doc = \\core_search\\document_factory::instance($record->id, $this->componentname, $this->areaname);\n // Include all alternate names in title.\n $array = [];\n foreach (get_all_user_name_fields(false, null, null, null, true) as $field) {\n $array[$field] = $record->$field;\n }\n $fullusername = join(' ', $array);\n // Assigning properties to our document.\n $doc->set('title', content_to_text($fullusername, false));\n $doc->set('contextid', $context->id);\n $doc->set('courseid', SITEID);\n $doc->set('itemid', $record->id);\n $doc->set('modified', $record->timemodified);\n $doc->set('owneruserid', \\core_search\\manager::NO_OWNER_ID);\n $doc->set('content', content_to_text($record->description, $record->descriptionformat));\n\n // Check if this document should be considered new.\n if (isset($options['lastindexedtime']) && $options['lastindexedtime'] < $record->timecreated) {\n // If the document was created after the last index time, it must be new.\n $doc->set_is_new(true);\n }\n\n return $doc;\n }", "public function testReadDocument()\n {\n }", "abstract public function data(): JsonApiParser\\Collections\\Document;", "public function document($filename = null) {\n if(is_null($filename)) return $this->documents()->first();\n return $this->documents()->find($filename);\n }", "public function getContentText(): ?string;", "public function getDocContent()\n {\n return $this->doc_content;\n }", "public function read_doc()\n {\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n $fileHandle = fopen($f, \"r\");\n $line = @fread($fileHandle, filesize($this->file));\n $lines = explode(chr(0x0D), $line);\n $outtext = \"\";\n foreach ($lines as $thisline) {\n $pos = strpos($thisline, chr(0x00));\n if (($pos !== false) || (strlen($thisline) == 0)) {\n } else {\n $outtext .= $thisline . \" \";\n }\n }\n $outtext = preg_replace(\"/[^a-zA-Z0-9\\s\\,\\.\\-\\n\\r\\t@\\/\\_\\(\\)]/\", \"\", $outtext);\n\n return $outtext;\n }", "public function getOfficialDocuments() {}", "public function getString()\n\t{\n\t\treturn $this->_string ;\n\t}", "private function createDocument()\n {\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function read_doc_file()\n {\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n if (file_exists($f)) {\n if (($fh = fopen($f, 'r')) !== false) {\n $headers = fread($fh, 0xA00);\n\n // 1 = (ord(n)*1) ; Document has from 0 to 255 characters\n $n1 = (ord($headers[0x21C]) - 1);\n\n // 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters\n $n2 = ((ord($headers[0x21D]) - 8) * 256);\n\n // 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters\n $n3 = ((ord($headers[0x21E]) * 256) * 256);\n\n // 1 = (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters\n $n4 = (((ord($headers[0x21F]) * 256) * 256) * 256);\n\n // Total length of text in the document\n $textLength = ($n1 + $n2 + $n3 + $n4);\n\n $extracted_plaintext = fread($fh, $textLength);\n $extracted_plaintext = mb_convert_encoding($extracted_plaintext, 'UTF-8');\n // simple print character stream without new lines\n //echo $extracted_plaintext;\n\n // if you want to see your paragraphs in a new line, do this\n return nl2br($extracted_plaintext);\n // need more spacing after each paragraph use another nl2br\n }\n }\n }", "function getDocument($id = 0, $fields = '*') {\r\n if ($id == 0) {\r\n return false;\r\n } else {\r\n $ids = array($id);\r\n $docs = $this->getDocuments($ids, '', '', $fields);\r\n\r\n return ($docs != false) ? $docs[0] : false;\r\n }\r\n }", "function getDoc(){\n\t\t$sql = \"SELECT tl.TenTL, tl.TenKhongDauTL, gd.TenGD, gd.TomtatGD FROM theloai tl INNER JOIN giaidoan gd ON tl.MaTL = gd.MaTL\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows(); \n\t}", "public function getDocumentType()\n {\n $value = $this->get(self::DOCUMENTTYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function getDocument() {\n return (new \\Treto\\PortalBundle\\Model\\DocumentSerializer($this,[]))->toArray();\n }", "public function getCedenteDocumento();" ]
[ "0.7038305", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6896831", "0.6896831", "0.6896831", "0.6896831", "0.6603759", "0.63798285", "0.6251721", "0.6240621", "0.6206133", "0.60387385", "0.6033544", "0.60162055", "0.5989132", "0.5968777", "0.5940862", "0.59355557", "0.59208333", "0.5894824", "0.5882709", "0.58723885", "0.58701587", "0.58701587", "0.58213425", "0.5772135", "0.5770724", "0.57692534", "0.574971", "0.5746518", "0.57158875", "0.5677102", "0.5674857", "0.5656573", "0.5648227", "0.5641337", "0.5641337", "0.5635104", "0.56313443", "0.5629204", "0.562153", "0.5593788", "0.5590025", "0.5570839", "0.55536634", "0.5532119", "0.55230427", "0.5522661", "0.55157286", "0.5513863", "0.55135053", "0.5509766", "0.5509766", "0.5508495", "0.5508312", "0.5508312", "0.5506355", "0.5506355", "0.5506355", "0.5506355", "0.54903173", "0.54774743", "0.54691", "0.5466434", "0.54609656", "0.54461354", "0.5443857", "0.5430186", "0.54192764", "0.54120284", "0.5407496", "0.54020774", "0.5399244", "0.53869265", "0.5379732", "0.5378218", "0.536775", "0.5357185", "0.53560233", "0.53522134", "0.5346824", "0.53425753", "0.53294253", "0.5326248", "0.53216875", "0.53181195", "0.53149384", "0.53123635", "0.53022724", "0.52972573", "0.5294271" ]
0.57232404
39
/ This is a helpping method to get a document in String type.
private function listDocumentsFromTo($from,$size) { //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. "/documents"; $url = $url."?from=".$from."&size=".$size; echo "\n".$url; $response = $this->curl_get($url); //echo "\n-------getProject Response:".$response; //$result = json_decode($response); return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDocument();", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "public function getDocument() {}", "abstract public static function getDoc();", "public function getDocType();", "abstract public function getDocument($id);", "static public function Get_Document_List() \n\t{\n\t\t$args = func_get_args();\n\t\t$obj = self::staticCall(\"Get_Document_List\",$args);\n//var_dump($obj);\n\t\treturn (string) $obj->__toString();\n\t}", "public function getDocument($id);", "public function get_document()\n {\n return $this->document;\n }", "public function document()\n\t{\n\t\treturn $this->Obj_Doc;\n\t}", "public function getDocumentByID($id)\n\t{\t\n\t\n\t\t$Document = new Document();\n\t\t$Utility = new Utility();\n\t\t// $document_id = $request->input('type');\n\t\t$document_id = $id;\n\n\t\t// return $document_id;\n\n\t\tif(isset($document_id) && $document_id!=NULL)\n\t\t{\n\t\t\tif(!empty($document_id) && is_numeric($document_id))\n\t\t\t{\n\t\t\t\t$document_id=$Utility->Clean_Data($document_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new customValidationException(\"A valid numeric document ID is required\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new customValidationException(\"document ID required\");\n\t\t}\n\n\t\t$documents = $Document->Document_by_Types($document_id);\n\n\t\treturn response()->json($documents);\n\t}", "public function getDocuments();", "private static final function getDocumentType () {\r\n // Do return ...\r\n return self::$objDocumentType;\r\n }", "function read_document($filename){\n\t\t$file_extension = substr($filename, strlen($filename)-4, 4);\n\t\tif($file_extension == 'docx'){\n\t\t\t$doc = $this->read_file_docx($filename);\n\t\t}else{\n\t\t\t$doc = $this->read_file_doc($filename);\n\t\t}\n\t\t$match = array(\"'\",'\"',\"’\",\"‘\",'“','”','–','–','-');\n\t\t$replace = array(\"'\",'\"',\"'\",\"'\",'\"','\"','-','-','');\n\t\t$doc = str_replace($match, $replace , $doc);\n\t\t$doc = htmlentities($doc);\n\t\treturn $doc;\n\t}", "abstract public function getDocuments();", "public function get_document(){retrun($id_local_document); }", "public function get_document() {\n\t\treturn $this->doc;\n\t}", "public function getString() {}", "public function getStringRepresentation(): string;", "public function getDocument() {\n\t\treturn phpQuery::getDocument($this->getDocumentID());\n\t}", "public function getDocument() {\n\t\treturn phpQuery::getDocument($this->getDocumentID());\n\t}", "function readDocumentType($id){\n $obj = new DocumentType($id);\n if($obj->isNew()) return false; else return $obj;\n }", "public function __toString() {\n\t\treturn json_encode($this->document);\n\t}", "public function get_document(){\n\t\t\t$query = $this->db->get_where(\"tipodocum\");\n\t\t\treturn $query->result();\n\t\t}", "public static function getDocument()\n {\n return self::$_document;\n }", "public function getLienDocument(): ?string {\n return $this->lienDocument;\n }", "public function getDocumentType()\n {\n return $this->document_type;\n }", "private function getDocument($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "function get_string() {\n\t\t$str = $this->_parse();\n return $str;\n }", "public function getDocid(): string\n {\n return $this->docid;\n }", "function getDocument($id) { /* {{{ */\n\t\t$hits = $this->index->find('D'.$id);\n\t\treturn $hits['hits'] ? $hits['hits'][0] : false;\n\t}", "public function getDocsByName($name){\r\n return ClientSDocs::where('projectclientservices_id',$this->id)->where('document',$name)->first();\r\n }", "public function getDocumentType() {\n return $this->document['type'];\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument()\n {\n return $this->document;\n }", "public function getDocument(): Document\n {\n return $this->document;\n }", "public function data(): DocumentData;", "public function get_documents() \n {\n $endpoint_name = \"/documents/\";\n $request_arguments = [];\n $documents = $this->request(\"GET\", $endpoint_name, $request_arguments);\n if (array_key_exists(\"documents\", $documents)) {\n return $documents[\"documents\"];\n }\n return $documents;\n }", "public static function doc() { return \"\\n\" . file_get_contents(__CLASS__ . '.doc.txt'); }", "public function getDocument($document_code, array $security_params=array()): string\n {\n return $this->request('documents/'.$document_code, 'GET', array(\n 'headers' => [\n 'X-SECURITY-CODE-1' => $security_params['security-code-1'] ?? '',\n 'X-SECURITY-CODE-2' => $security_params['security-code-2'] ?? '',\n 'X-ACTIVITY' => $security_params['activity'] ?? '',\n 'X-SOURCE' => $security_params['source'] ?? '',\n 'X-CLIENT-IP' => $security_params['client-ip'] ?? '',\n 'X-USER-AGENT' => $security_params['user-agent'] ?? ''\n ]\n ));\n }", "public function getDocument()\n\t{\n\t\treturn $this->document;\n\t}", "public function getDocumentType()\n {\n return $this->_documentType;\n }", "public function get_document($document_id)\n\t{\n\t\t$this->db->select('documents.document_id, documents.document_name, documents.document_text, collections.collection_name');\n\t\t$this->db->from('documents');\n\t\t$this->db->join('collections', 'documents.collection_id = collections.collection_id');\n\t\t$this->db->where(array('documents.document_id' => $document_id));\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query->row_array();\n\t}", "public function getDocument()\n\t{\n\t\treturn $this->_doc;\n\t}", "public function getDocument() {\n return $this->document;\n }", "public static function getById($id) {\n\n $id = intval($id);\n\n if ($id < 1) {\n return null;\n }\n\n $cacheKey = \"document_\" . $id;\n\n try {\n $document = \\Zend_Registry::get($cacheKey);\n if(!$document){\n throw new \\Exception(\"Document in registry is null\");\n }\n }\n catch (\\Exception $e) {\n try {\n if (!$document = Cache::load($cacheKey)) {\n $document = new Document();\n $document->getResource()->getById($id);\n\n $mappingClass = \"\\\\Pimcore\\\\Model\\\\Document\\\\\" . ucfirst($document->getType());\n\n // this is the fallback for custom document types using prefixes\n // so we need to check if the class exists first\n if(!\\Pimcore\\Tool::classExists($mappingClass)) {\n $oldStyleClass = \"Document_\" . ucfirst($document->getType());\n if(\\Pimcore\\Tool::classExists($oldStyleClass)) {\n $mappingClass = $oldStyleClass;\n }\n }\n $typeClass = Tool::getModelClassMapping($mappingClass);\n\n if (Tool::classExists($typeClass)) {\n $document = new $typeClass();\n \\Zend_Registry::set($cacheKey, $document);\n $document->getResource()->getById($id);\n\n Cache::save($document, $cacheKey);\n }\n }\n else {\n \\Zend_Registry::set($cacheKey, $document);\n }\n }\n catch (\\Exception $e) {\n \\Logger::warning($e->getMessage());\n return null;\n }\n }\n\n if(!$document) {\n return null;\n }\n\n return $document;\n }", "public function document_type() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn (isset($class::_object()->document_type)) ? $class::_object()->document_type:null;\r\n }", "public function getDoc()\n {\n return $this->doc;\n }", "public function get_one_document($id_document){\n try{\n return DB::table('study_document')\n ->where('study_document.id', $id_document)\n ->join('user', 'study_document.id_lecturer', 'user.id')\n ->select('study_document.*', 'user.full_name as author')\n ->first();\n }catch (\\Exception $ex){\n return $ex;\n }\n }", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "public function getDocumentType() {\n\t\tif($this->document_type == 'DOCUMENT' && $this->document_id)\n\t\t\treturn Yii::t('store', $this->document->document_type);\n\t\telse\n\t\t\treturn Yii::t('store', $this->document_type);\n\t}", "function getDocumentContent($id) {\n\t//connecting to the database\n\t$conn = new mysqli('localhost','boubou','boubou','edel') or die('Error connecting to MySQL server.');\n\n\t// making the querry\n\t$dbQuery = \"SELECT document_name, document_type, document_size, document_content FROM Documents WHERE document_id='\".mysqli_real_escape_string($conn,$id). \"'\";\n\n\t// $result\n\t$result = $conn->query($dbQuery);\n\n\t// checking for errors\n\tif(!$result) {\n\t\techo \"Error: \" . $dbQuery . \"<br>\" . $conn->error;\n\t\tdie();\n\t}\n\n\t//if $result is successful\n\t$row = $result->fetch_array(); //by now they should have the same email address\n\n\tif(!$row) {\n\t\tdie('FATAL: document was not found');\n\t}\n\n\t// free the results array\n\t$result->close();\n\t$conn->close();\n\n\treturn $row;\n}", "public function __toString()\n {\n $str = \"Document : <br>\";\n $str .= \"numEnregistrement: $this->numEnregistrement<br>\";\n $str .= \"Title: $this->title<br>\";\n return $str;\n }", "public function getSacadoDocumento();", "function getDocument($authentication, $modulepart, $file, $refname = '')\n{\n\tglobal $db,$conf,$langs,$mysoc;\n\n\tdol_syslog(\"Function: getDocument login=\".$authentication['login'].' - modulepart='.$modulepart.' - file='.$file);\n\n\tif ($authentication['entity']) $conf->entity=$authentication['entity'];\n\n\t$objectresp=array();\n\t$errorcode='';$errorlabel='';\n\t$error=0;\n\n\t// Properties of doc\n\t$original_file = $file;\n\t$type=dol_mimetype($original_file);\n\t//$relativefilepath = $ref . \"/\";\n\t//$relativepath = $relativefilepath . $ref.'.pdf';\n\n\t$accessallowed=0;\n\n\t$fuser=check_authentication($authentication, $error, $errorcode, $errorlabel);\n\n\tif ($fuser->societe_id) $socid=$fuser->societe_id;\n\n\t// Check parameters\n\tif (! $error && ( ! $file || ! $modulepart ) )\n\t{\n\t\t$error++;\n\t\t$errorcode='BAD_PARAMETERS'; $errorlabel=\"Parameter file and modulepart must be both provided.\";\n\t}\n\n\tif (! $error)\n\t{\n\t\t$fuser->getrights();\n\n\t\t// Suppression de la chaine de caractere ../ dans $original_file\n\t\t$original_file = str_replace(\"../\", \"/\", $original_file);\n\n\t\t// find the subdirectory name as the reference\n\t\tif (empty($refname)) $refname=basename(dirname($original_file).\"/\");\n\n\t\t// Security check\n\t\t$check_access = dol_check_secure_access_document($modulepart, $original_file, $conf->entity, $fuser, $refname);\n\t\t$accessallowed = $check_access['accessallowed'];\n\t\t$sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals'];\n\t\t$original_file = $check_access['original_file'];\n\n\t\t// Basic protection (against external users only)\n\t\tif ($fuser->societe_id > 0)\n\t\t{\n\t\t\tif ($sqlprotectagainstexternals)\n\t\t\t{\n\t\t\t\t$resql = $db->query($sqlprotectagainstexternals);\n\t\t\t\tif ($resql)\n\t\t\t\t{\n\t\t\t\t\t$num=$db->num_rows($resql);\n\t\t\t\t\t$i=0;\n\t\t\t\t\twhile ($i < $num)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = $db->fetch_object($resql);\n\t\t\t\t\t\tif ($fuser->societe_id != $obj->fk_soc)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$accessallowed=0;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Security:\n\t\t// Limite acces si droits non corrects\n\t\tif (! $accessallowed)\n\t\t{\n\t\t\t$errorcode='NOT_PERMITTED';\n\t\t\t$errorlabel='Access not allowed';\n\t\t\t$error++;\n\t\t}\n\n\t\t// Security:\n\t\t// On interdit les remontees de repertoire ainsi que les pipe dans\n\t\t// les noms de fichiers.\n\t\tif (preg_match('/\\.\\./', $original_file) || preg_match('/[<>|]/', $original_file))\n\t\t{\n\t\t\tdol_syslog(\"Refused to deliver file \".$original_file);\n\t\t\t$errorcode='REFUSED';\n\t\t\t$errorlabel='';\n\t\t\t$error++;\n\t\t}\n\n\t\tclearstatcache();\n\n\t\tif(!$error)\n\t\t{\n\t\t\tif(file_exists($original_file))\n\t\t\t{\n\t\t\t\tdol_syslog(\"Function: getDocument $original_file $filename content-type=$type\");\n\n\t\t\t\t$file=$fileparams['fullname'];\n\t\t\t\t$filename = basename($file);\n\n\t\t\t\t$f = fopen($original_file, 'r');\n\t\t\t\t$content_file = fread($f, filesize($original_file));\n\n\t\t\t\t$objectret = array(\n\t\t\t\t\t'filename' => basename($original_file),\n\t\t\t\t\t'mimetype' => dol_mimetype($original_file),\n\t\t\t\t\t'content' => base64_encode($content_file),\n\t\t\t\t\t'length' => filesize($original_file)\n\t\t\t\t);\n\n\t\t\t\t// Create return object\n\t\t\t\t$objectresp = array(\n\t\t\t\t\t'result'=>array('result_code'=>'OK', 'result_label'=>''),\n\t\t\t\t\t'document'=>$objectret\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdol_syslog(\"File doesn't exist \".$original_file);\n\t\t\t\t$errorcode='NOT_FOUND';\n\t\t\t\t$errorlabel='';\n\t\t\t\t$error++;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($error)\n\t{\n\t\t$objectresp = array(\n\t\t'result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)\n\t\t);\n\t}\n\n\treturn $objectresp;\n}", "public function getDocumentName()\n {\n $value = $this->get(self::DOCUMENTNAME);\n return $value === null ? (string)$value : $value;\n }", "public function document($path = '')\n {\n return $this->resolvePath($this->documentRoot, $path);\n }", "public function string();", "public function getDocumentation(): string;", "function _apachesolr_index_process_entity_get_document($entity, $entity_type) {\n list($entity_id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);\n\n $document = new ApacheSolrDocument();\n\n // Define our url options in advance. This differs depending on the\n // language\n $languages = language_list();\n $url_options = array('absolute' => TRUE);\n if (isset($entity->language) && isset($languages[$entity->language])) {\n $url_options['language'] = $languages[$entity->language];\n }\n\n $document->id = apachesolr_document_id($entity_id, $entity_type);\n $document->site = url(NULL, $url_options);\n $document->hash = apachesolr_site_hash();\n\n $document->entity_id = $entity_id;\n $document->entity_type = $entity_type;\n $document->bundle = $bundle;\n $document->bundle_name = entity_bundle_label($entity_type, $bundle);\n\n if (empty($entity->language)) {\n // 'und' is the language-neutral code in Drupal 7.\n $document->ss_language = LANGUAGE_NONE;\n }\n else {\n $document->ss_language = $entity->language;\n }\n\n $path = entity_uri($entity_type, $entity);\n // A path is not a requirement of an entity\n if (!empty($path)) {\n $document->path = $path['path'];\n $document->url = url($path['path'], $path['options'] + $url_options);\n // Path aliases can have important information about the content.\n // Add them to the index as well.\n if (function_exists('drupal_get_path_alias')) {\n // Add any path alias to the index, looking first for language specific\n // aliases but using language neutral aliases otherwise.\n $output = drupal_get_path_alias($document->path, $document->ss_language);\n if ($output && $output != $document->path) {\n $document->path_alias = $output;\n }\n }\n }\n return $document;\n}", "public function documents_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n $operator=\"OR\";\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n \n $temp = $this->input->get('default_operator', TRUE);\n if(!is_null($temp))\n {\n $operator = $temp;\n }\n \n \n $result = null;\n if(is_null($search))\n $result = $sutil->getDocument($id,$from,$size);\n else \n {\n $result = $sutil->searchDocuments($search,$from,$size,$operator);\n }\n $this->response($result);\n }", "private function readDocument($filename,$originalClientName) {\n $content = '';\n \n $fileType = strrchr($filename,'.'); //TODO: retrieve filetype\n \n switch($fileType) {\n case '.xls':\n case '.xlsx':\n $inputFileType = IOFactory::identify($filename);\n $reader = IOFactory::createReader($inputFileType);\n $reader->setReadDataOnly(true);\n try {\n $content = $reader->load($filename);\n } catch (Exception $e) {\n dd(\"erreur\". $e);\n }\n\n $content = $content->getActiveSheet()->toArray(null, true, true, true);\n\n array_walk($content, function(&$row) {\n $ligne = '';\n foreach($row as $cell) {\n if($cell) {\n $ligne .= $cell.\"\\t\";\n }\n }\n $row = $ligne.PHP_EOL;\n });\n\n $content = array_filter($content, function($row) { return $row!=PHP_EOL; });\n $content = implode('',$content);\n break;\n case '.pdf':\n // Parse pdf file and build necessary objects.\n $parser = new Parser();\n $pdf = $parser->parseFile($filename);\n\n $content = $pdf->getText();\n break;\n case '.doc':\n case '.docx':\n case '.odt':\n case '.rtf':\n if($fileType=='.doc') { //Format Word97\n $phpWord = WordIOFactory::load($filename, 'MsDoc');\n } elseif($fileType=='.docx') { //Format Word2007\n $phpWord = WordIOFactory::load($filename);\n } elseif($fileType=='.odt') { //Format ODT\n $phpWord = WordIOFactory::load($filename, 'ODText');\n } elseif($fileType=='.rtf') { //Format RTF\n $phpWord = WordIOFactory::load($filename, 'RTF');//\n }\n $content = '';\n foreach ($phpWord->getSections()[0]->getElements() as $element) { \n switch(get_class($element)) {\n case 'PhpOffice\\PhpWord\\Element\\PageBreak':\n break;\n case 'PhpOffice\\PhpWord\\Element\\Text':\n $content .= $element->getText().\"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Link':\n $content .= $element->getText();\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextRun':\n $cpt = 0;\n foreach ($element->getElements() as $runElement) {\n if($runElement->getText()==null) { $cpt++; }\n if($cpt==2) {\n $content .= $runElement->getText().\"\\t\";\n $cpt = 0;\n } else {\n $content .= $runElement->getText().\"\";\n }\n }\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextBreak':\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\ListItem':\n $content .= \"- \".$element->getTextObject()->getText().\"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Table':\n foreach ($element->getRows() as $row) {\n foreach ($row->getCells() as $cell) {\n foreach ($cell->getElements() as $element) {\n switch(get_class($element)) {\n case 'PhpOffice\\PhpWord\\Element\\Text':\n $content .= $element->getText().\"\\t\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\Link':\n $content .= $element->getText().\"\\t\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextRun':\n $cpt = 0;\n foreach ($element->getElements() as $runElement) {\n if($runElement->getText()==null) { $cpt++; }\n if($cpt==2) {\n $content .= $runElement->getText().\"\\t\";\n $cpt = 0;\n } else {\n $content .= $runElement->getText().\"\";\n }\n }\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\TextBreak':\n $content .= \"\\r\\n\";\n break;\n case 'PhpOffice\\PhpWord\\Element\\ListItem':\n $content .= \"- \".$element->getTextObject()->getText().\"\\r\\n\";\n break;\n default :\n dd($element);\n }\n }\n \n }\n $content .= \"\\r\\n\";\n }\n break;\n default:\n $class = get_class($element);\n }\n }\n break;dd($content);\n case '.html':\n case '.htm':\n case '.xml':\n $content = strip_tags(file_get_contents($filename));\n\n $encodingList = ['UTF-8', 'UTF-7', 'ASCII', 'EUC-JP','SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP', 'ISO-8859-1'];\n $encoding = mb_detect_encoding($content,$encodingList);\n if($encoding!='UTF-8'){\n $content = mb_convert_encoding($content,'UTF-8',$encodingList);\n $encoding = 'UTF-8';\n }\n $content = html_entity_decode($content,ENT_COMPAT | ENT_HTML5, $encoding);\n //Suppresion des espaces et retour superflus\n $content = preg_replace('/ {2,}/',\" \",$content);\n $content = preg_replace('/( )*(\\r( )*){2,}/',\"\\r\",$content);\n $content = preg_replace('/( )*(\\n( )*){2,}/',\"\\n\",$content);\n $content = preg_replace('/( )*((\\r\\n)( )*){2,}/',\"\\r\\n\",$content);\n $content = preg_replace('/( )*(\\t( )*){2,}/',\"\\t\",$content);\n break;\n case '.txt':\n case '.csv':\n $content = file_get_contents($filename);\n \n $encodingList = ['UTF-8', 'UTF-7', 'ASCII', 'EUC-JP','SJIS', 'eucJP-win', 'SJIS-win', 'JIS', 'ISO-2022-JP', 'ISO-8859-1'];\n $encoding = mb_detect_encoding($content,$encodingList);\n if($encoding!='UTF-8'){\n $content = mb_convert_encoding($content,'UTF-8',$encodingList);\n }\n break;\n case '.png':\n case '.jpeg':\n case '.jpg':\n case '.bmp':\n case '.gif':\n default: \n $content .= substr($originalClientName,0,strrpos($originalClientName,\".\")); \n }\n \n return $content;\n }", "public function isExpectingDocument();", "public function getDocument($document, $id, $type)\n {\n if (!in_array($type, ['info', 'xml', 'pdf'])) {\n return $this->response(404);\n }\n\n $doc = $this->documentRepository->get($id);\n if ($doc === null) {\n return $this->response(404);\n }\n if ($doc['cliente_doc'] !== $document) {\n return $this->response(401);\n }\n if ($type == 'info') {\n return $this->ok($doc);\n }\n\n $filter = $this->documentConverter->convertToDoc($doc);\n $storageId = $this->documentRepository->getStorageId($filter);\n\n $result = [\n 'file' => $this->fileRepository->read($storageId, $type),\n 'type' => $type === 'xml' ? 'text/xml' : 'application/pdf',\n ];\n\n $headers = [\n 'Content-Type' => $result['type'],\n 'Content-Disposition' => 'attachment',\n 'Content-Length' => strlen($result['file']),\n ];\n\n return $this->response(200, $result, $headers);\n }", "public function get_document($document_id) \n {\n $endpoint_name = \"/documents/{$document_id}/\";\n $request_arguments = [ \"id\" => $document_id ];\n $document = $this->request(\"GET\", $endpoint_name, $request_arguments);\n return $document;\n }", "public function get_document($record, $options = array()) {\n\n $context = \\context_system::instance();\n\n // Prepare associative array with data from DB.\n $doc = \\core_search\\document_factory::instance($record->id, $this->componentname, $this->areaname);\n // Include all alternate names in title.\n $array = [];\n foreach (get_all_user_name_fields(false, null, null, null, true) as $field) {\n $array[$field] = $record->$field;\n }\n $fullusername = join(' ', $array);\n // Assigning properties to our document.\n $doc->set('title', content_to_text($fullusername, false));\n $doc->set('contextid', $context->id);\n $doc->set('courseid', SITEID);\n $doc->set('itemid', $record->id);\n $doc->set('modified', $record->timemodified);\n $doc->set('owneruserid', \\core_search\\manager::NO_OWNER_ID);\n $doc->set('content', content_to_text($record->description, $record->descriptionformat));\n\n // Check if this document should be considered new.\n if (isset($options['lastindexedtime']) && $options['lastindexedtime'] < $record->timecreated) {\n // If the document was created after the last index time, it must be new.\n $doc->set_is_new(true);\n }\n\n return $doc;\n }", "public function testReadDocument()\n {\n }", "abstract public function data(): JsonApiParser\\Collections\\Document;", "public function document($filename = null) {\n if(is_null($filename)) return $this->documents()->first();\n return $this->documents()->find($filename);\n }", "public function getContentText(): ?string;", "public function getDocContent()\n {\n return $this->doc_content;\n }", "public function read_doc()\n {\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n $fileHandle = fopen($f, \"r\");\n $line = @fread($fileHandle, filesize($this->file));\n $lines = explode(chr(0x0D), $line);\n $outtext = \"\";\n foreach ($lines as $thisline) {\n $pos = strpos($thisline, chr(0x00));\n if (($pos !== false) || (strlen($thisline) == 0)) {\n } else {\n $outtext .= $thisline . \" \";\n }\n }\n $outtext = preg_replace(\"/[^a-zA-Z0-9\\s\\,\\.\\-\\n\\r\\t@\\/\\_\\(\\)]/\", \"\", $outtext);\n\n return $outtext;\n }", "public function getOfficialDocuments() {}", "public function getString()\n\t{\n\t\treturn $this->_string ;\n\t}", "private function createDocument()\n {\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function read_doc_file()\n {\n $path = getcwd();\n $f = $path . \"/\" . $this->file;\n if (file_exists($f)) {\n if (($fh = fopen($f, 'r')) !== false) {\n $headers = fread($fh, 0xA00);\n\n // 1 = (ord(n)*1) ; Document has from 0 to 255 characters\n $n1 = (ord($headers[0x21C]) - 1);\n\n // 1 = ((ord(n)-8)*256) ; Document has from 256 to 63743 characters\n $n2 = ((ord($headers[0x21D]) - 8) * 256);\n\n // 1 = ((ord(n)*256)*256) ; Document has from 63744 to 16775423 characters\n $n3 = ((ord($headers[0x21E]) * 256) * 256);\n\n // 1 = (((ord(n)*256)*256)*256) ; Document has from 16775424 to 4294965504 characters\n $n4 = (((ord($headers[0x21F]) * 256) * 256) * 256);\n\n // Total length of text in the document\n $textLength = ($n1 + $n2 + $n3 + $n4);\n\n $extracted_plaintext = fread($fh, $textLength);\n $extracted_plaintext = mb_convert_encoding($extracted_plaintext, 'UTF-8');\n // simple print character stream without new lines\n //echo $extracted_plaintext;\n\n // if you want to see your paragraphs in a new line, do this\n return nl2br($extracted_plaintext);\n // need more spacing after each paragraph use another nl2br\n }\n }\n }", "function getDocument($id = 0, $fields = '*') {\r\n if ($id == 0) {\r\n return false;\r\n } else {\r\n $ids = array($id);\r\n $docs = $this->getDocuments($ids, '', '', $fields);\r\n\r\n return ($docs != false) ? $docs[0] : false;\r\n }\r\n }", "function getDoc(){\n\t\t$sql = \"SELECT tl.TenTL, tl.TenKhongDauTL, gd.TenGD, gd.TomtatGD FROM theloai tl INNER JOIN giaidoan gd ON tl.MaTL = gd.MaTL\";\n\t\t$this->setQuery($sql);\n\t\treturn $this->loadAllRows(); \n\t}", "public function getDocumentType()\n {\n $value = $this->get(self::DOCUMENTTYPE);\n return $value === null ? (integer)$value : $value;\n }", "public function getDocument() {\n return (new \\Treto\\PortalBundle\\Model\\DocumentSerializer($this,[]))->toArray();\n }", "public function getCedenteDocumento();" ]
[ "0.7038305", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6897357", "0.6896831", "0.6896831", "0.6896831", "0.6896831", "0.6603759", "0.63798285", "0.6251721", "0.6240621", "0.6206133", "0.60387385", "0.6033544", "0.60162055", "0.5989132", "0.5968777", "0.5940862", "0.59355557", "0.59208333", "0.5894824", "0.5882709", "0.58723885", "0.58701587", "0.58701587", "0.58213425", "0.5772135", "0.5770724", "0.57692534", "0.574971", "0.5746518", "0.57232404", "0.57158875", "0.5677102", "0.5674857", "0.5656573", "0.5648227", "0.5641337", "0.5641337", "0.5635104", "0.56313443", "0.5629204", "0.562153", "0.5593788", "0.5590025", "0.5570839", "0.55536634", "0.5532119", "0.55230427", "0.5522661", "0.55157286", "0.5513863", "0.55135053", "0.5509766", "0.5509766", "0.5508495", "0.5508312", "0.5508312", "0.5506355", "0.5506355", "0.5506355", "0.5506355", "0.54903173", "0.54774743", "0.54691", "0.5466434", "0.54609656", "0.54461354", "0.5443857", "0.5430186", "0.54192764", "0.54120284", "0.5407496", "0.54020774", "0.5399244", "0.53869265", "0.5379732", "0.5378218", "0.536775", "0.5357185", "0.53560233", "0.53522134", "0.5346824", "0.53425753", "0.53294253", "0.5326248", "0.53216875", "0.53181195", "0.53149384", "0.53123635", "0.53022724", "0.52972573", "0.5294271" ]
0.0
-1
This is a helpping method to create a project using the local prj.json file.
private function createProject() { $input = file_get_contents('prj.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/projects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\nCreate project:".$response."\n"; $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "static private function createProject($name, User $leader, $overview, $client = null, $category = null, $template = null, $first_milestone_starts_on = null, $based_on = null, $label_id = null, $currency_id = null, $budget = null, $custom_field_1 = null, $custom_field_2 = null, $custom_field_3 = null) {\n $project = new Project();\n\n $project->setAttributes(array(\n 'name' => $name,\n 'slug' => Inflector::slug($name),\n 'label_id' => (isset($label_id) && $label_id) ? $label_id : 0,\n 'overview' => trim($overview) ? trim($overview) : null,\n 'company_id' => $client instanceof Company ? $client->getId() : null,\n 'category_id' => $category instanceof ProjectCategory ? $category->getId() : null,\n 'custom_field_1' => $custom_field_1,\n 'custom_field_2' => $custom_field_2,\n 'custom_field_3' => $custom_field_3,\n ));\n\n $project->setState(STATE_VISIBLE);\n $project->setLeader($leader);\n\n if($template instanceof ProjectTemplate) {\n $project->setTemplate($template);\n } // if\n\n if($based_on instanceof IProjectBasedOn) {\n $project->setBasedOn($based_on);\n } // if\n\n $project->setCurrencyId($currency_id);\n\n if(AngieApplication::isModuleLoaded('tracking') && $budget) {\n $project->setBudget($budget);\n } // if\n\n $project->setMailToProjectCode(Projects::newMailToProjectCode());\n\n $project->save();\n\n if($template instanceof ProjectTemplate && $first_milestone_starts_on instanceof DateValue) {\n ConfigOptions::setValueFor('first_milestone_starts_on', $project, $first_milestone_starts_on->toMySQL());\n } // if\n\n return $project;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function create_existing () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\tif ($selection = $dialog->select_folder(\"Choose folder\", \"Choose existing folder to create new TextMate project from.\", false, null)) {\n\t\t\t\n\t\t\t// Get the name of the existing project\n\t\t\t$project_name = basename($selection);\n\t\t\t\n\t\t\t// Get path to new project\n\t\t\t$project = \"$selection/$project_name.tmproj\";\n\t\t\t\n\t\t\t// Prevent duplicate project\n\t\t\tif (file_exists($project)) {\n\t\t\t\tdie(\"There is already an existing TextMate project at this location.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Use the Empty template as our base\n\t\t\t$template = $this->standard_templates.\"/Empty\";\n\t\t\tif (file_exists($template)) {\n\t\t\t\t\n\t\t\t\t// Make Targets directory\n\t\t\t\t@mkdir(\"$selection/Targets\", 0777);\n\t\t\t\t\n\t\t\t\t// Copy default target\n\t\t\t\tcopy(\"$template/Targets/development.xml\", \"$selection/Targets/development.xml\");\n\t\t\t\t\n\t\t\t\t// Copy TextMate project file\n\t\t\t\t@copy(\"$template/project.tmproj\", $project);\n\t\t\t\t$this->replace_macros($project, array(self::MACRO_PROJECT => $project_name));\n\t\t\t\t\n\t\t\t\tprint(\"Successfully created the new project.\\n\");\n\t\t\t\t\n\t\t\t\t$this->open_project($project);\n\t\t\t} else {\n\t\t\t\tdie(\"Can't find project template to start from!\");\n\t\t\t}\n\t\t}\n\t}", "public function makeProject()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpProject());\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function actionCreate()\n {\n $model = new Project();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n OperationRecord::record($model->tableName(), $model->pj_id, $model->pj_name, OperationRecord::ACTION_ADD);\n return $this->redirect(['view', 'id' => $model->pj_id]);\n }\n\n if (Yii::$app->request->isPost) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Create project failed!'));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $shortcut = session()->get('shortcut');\n $from_api = session()->get('from_api');\n\n //\n $json = $this->jiraApi($shortcut);\n\n // Connect both arrays\n// $data = array_merge($data, $json);\n // Connect both Objects\n// $data = (object) array_merge((array) $data, (array) $json);\n //\n return view('projects.create', compact( 'json', 'from_api'));\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function create(CreateProjectRequest $request)\n {\n $newEntry = Project::create([\n 'author' => Auth::user()->username,\n 'user_id' => Auth::user()->id,\n 'title' => $request->getTitle(),\n 'description' => $request->getDescription(),\n 'body' => $request->getBody(),\n 'statement_title' => 'Mission Statement',\n 'statement_body' => 'This is where you write about your mission statement or make it whatever you want.',\n 'tab_title' => 'Welcome',\n 'tab_body' => 'Here you can write a message or maybe the status of your project for all your members to see.',\n ]);\n\n $thumbnail = $request->file('thumbnail');\n $thumbnail->move(base_path() . '/public/images/projects', 'product' . $newEntry->id . '.jpg');\n\n //Sets banner image to a random pre-made banner\n $images = glob(base_path() . \"/public/images/banners/*\");\n $imagePath = base_path() . '/public/images/projects/' . 'banner' . $newEntry->id . '.jpg';\n $rand = random_int(0, count($images) - 1);\n \\File::copy($images[$rand], $imagePath);\n\n //Add creator as a member and make admin of the project\n $newEntry->addMember(true);\n //Add creator as a follower of the project\n $newEntry->addFollower();\n\n return redirect('/project/'.$newEntry->title);\n }", "public function create_new () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\t$templates = array();\n\t\t\n\t\t// Find items in standard project templates\n\t\t$contents = directory_contents($this->standard_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->standard_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find items in user project templates\n\t\t$contents = directory_contents($this->user_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->user_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\n\t\t// Prompt to select template\n\t\tif ($selection = $dialog->standard_dropdown(\"New Project\", \"Choose a project template to start from.\", $items, false, false, false, false)) {\n\t\t\t//print($selection);\n\t\t\t\n\t\t\t// Prompt to save\n\t\t\tif ($path = $dialog->save_file(\"Save Project\", \"Choose a location to save the new project.\", null, null, null)) {\n\t\t\t\t$this->copy_template($templates[$selection], $path);\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function create_project( $options ) {\n\n\t\tif ( ! isset( $options['project_name'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$defaults = array(\n\t\t\t'project_status' => 'Active',\n\t\t\t'include_jquery' => FALSE,\n\t\t\t'project_javascript' => null,\n\t\t\t'enable_force_variation' => FALSE,\n\t\t\t'exclude_disabled_experiments' => FALSE,\n\t\t\t'exclude_names' => null,\n\t\t\t'ip_anonymization' => FALSE,\n\t\t\t'ip_filter' => null,\n\t\t);\n\n\t\t$options = array_replace( $defaults, $options );\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "static function create($name, $additional = null, $instantly = true) {\n $logged_user = Authentication::getLoggedUser();\n \n $based_on = array_var($additional, 'based_on');\n $template = array_var($additional, 'template');\n \n $leader = array_var($additional, 'leader');\n if(!($leader instanceof User)) {\n $leader = $logged_user;\n } // if\n\n try {\n DB::beginWork('Creating a project @ ' . __CLASS__);\n\n // Create a new project instance\n $project = self::createProject(\n $name,\n $leader,\n array_var($additional, 'overview'),\n array_var($additional, 'company'),\n array_var($additional, 'category'),\n $template,\n array_var($additional, 'first_milestone_starts_on'),\n $based_on,\n array_var($additional, 'label_id'),\n array_var($additional, 'currency_id'),\n array_var($additional, 'budget'),\n array_var($additional, 'custom_field_1'),\n array_var($additional, 'custom_field_2'),\n array_var($additional, 'custom_field_3')\n );\n\n // Add leader and person who created a project to the project\n $project->users()->add($logged_user);\n\n if($logged_user->getId() != $leader->getId()) {\n $project->users()->add($leader);\n } // if\n\n // If project is created from a template, copy items\n if($template instanceof ProjectTemplate) {\n $positions = array_var($additional, 'positions', array());\n $template->copyItems($project, $positions);\n\n ConfigOptions::removeValuesFor($project, 'first_milestone_starts_on');\n\n // In case of a blank project, import users and master categories\n } else {\n Users::importAutoAssignIntoProject($project);\n $project->availableCategories()->importMasterCategories($logged_user);\n } // if\n\n // Close project request or quote\n if($based_on instanceof ProjectRequest) {\n $based_on->close($logged_user);\n } elseif($based_on instanceof Quote) {\n $based_on->markAsWon($logged_user);\n } // if\n\n EventsManager::trigger('on_project_created', array(&$project, &$logged_user));\n\n DB::commit('Project created @ ' . __CLASS__);\n\n return $project;\n } catch(Exception $e) {\n DB::rollback('Failed to create a project @ ' . __CLASS__);\n throw $e;\n } // try\n }", "public function store(CreateProject $request)\n {\n $project = new Project();\n $project->setAttributes($request->all());\n $project->save();\n\n return response()->json($project, $status = 201)->setStatusCode(201);\n }", "public function creator($projectId = false) {\n\n // Call builder code\n $data = $this->builder(true, $projectId);\n\n // Create controller\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/controllers/' . ucfirst($this->formName) . '.php', 'w');\n fwrite($fp, $data['phpcontroller']);\n fclose($fp);\n // Create model\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/models/' . ucfirst($this->formName) . '_model.php', 'w');\n fwrite($fp, $data['phpmodel']);\n fclose($fp);\n\n // Create view\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '.php', 'w');\n fwrite($fp, $data['htmlview']);\n fclose($fp);\n // Create success page\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '_success.php', 'w');\n fwrite($fp, $this->successBuilder());\n fclose($fp);\n\n $data['myFolder'] = $this->listMyFolder($this->pathCreator . '/' . $projectId);\n echo json_encode($data);\n }", "public function run()\n {\n \t$project_owner = User::where('name', 'Owner Name')->first();\n \t$project = new Project();\n \t$project->name = 'New Project';\n \t$project->owner = $project_owner->id;\n \t$project->save();\n }", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "private function createProjectPool() {\n //TODO\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function handleCreate(Request $request) {\n\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n $project = Auth::user()->projects()->create($request->all());\n\n return response()->json($project, 201);\n }", "public function create(ProjectModel $project): void {\n\t\tFilesystemUtils::dirShouldExist($this->di_context->varPath('tmp'));\n\n\t\t$basepath = FilesystemUtils::dirpath($this->projectDir, $project->slugname());\n\t\tif (file_exists($basepath)) {\n\t\t\tthrow new RuntimeException(\"Project directory '{$basepath}' already exists\");\n\t\t}\n\n\t\t$tempnewdir = $this->di_context->varPath('tmp', $project->slugname().'_temp');\n\t\tif (file_exists($tempnewdir)) {\n\t\t\tFilesystemUtils::rrmdir($tempnewdir);\n\t\t}\n\n\t\tmkdir($tempnewdir);\n\n\t\t//create git repository folder\n\t\tmkdir($tempnewdir.\\DIRECTORY_SEPARATOR.'REPO');\n\t\t$gitRepo = $tempnewdir.\\DIRECTORY_SEPARATOR.'REPO'.\\DIRECTORY_SEPARATOR.$project->slugname().'.git';\n\n\t\t//create the main git repository\n\t\t$tempdir = $this->di_context->varPath('tmp', basename($gitRepo));\n\t\tFilesystemUtils::rrmdir($tempdir);\n\t\t$this->di_gitservice->execGit(\"init --bare {$gitRepo}\");\n\n\t\t//clone a working copy into a temporary folder\n\t\t$repo = $this->di_gitservice->clone($gitRepo);\n\t\t$repo->execGit(\"config user.name 'hgit daemon'\");\n\t\t$repo->execGit(\"config user.email 'hgitdaemon@localhost'\");\n\t\t$repo->add('.gitignore');\n\t\t$repo->commit('Create .gitignore file in master branch');\n\t\t$repo->execGit('push --set-upstream origin master');\n\n\t\t//create wiki branch\n\t\t$repo->checkout('wiki', true);\n\t\t$repo->add('readme.md', \"{$project->description}\\nDocumentation\\n\");\n\t\t$repo->commit('Create readme file in wiki branch');\n\t\t$repo->execGit('push --set-upstream origin wiki');\n\t\t$repo->checkout('master');\n\n\t\t//create developement branch\n\t\t$repo->checkout('develop', true);\n\t\t$repo->add('readme.md', \"{$project->description}\");\n\t\t$repo->commit('Create readme file in develop branch');\n\t\t$repo->execGit('push --set-upstream origin develop');\n\n\t\t//delete the temporary working directory\n\t\tFilesystemUtils::rrmdir($repo->path);\n\n\t\t//\"commit\" the newly created folder structure to the project root\n\t\trename($tempnewdir, $basepath);\n\t}", "public function createProject($project)\n {\n $data = new Project();\n $data->setName($project['name'])\n ->setDescription($project['description'])\n ->setIsArchived(0)\n ->setCreatedTime(time())\n ->setUpdatedTime(time());\n $em = $this->getDoctrine()->getManager();\n $em->persist($data);\n $em->flush();\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "public function run()\n {\n Project::truncate();\n \n factory(Project::class)->create([\n 'owner_id' => 1,\n 'client_id' => 1,\n 'name' => 'Project Test',\n 'description' => 'Lorem ipsum',\n 'progress' => rand(1, 100),\n 'status' => rand(1, 3),\n 'due_date' => '2016-06-06'\n ]);\n\n factory(Project::class, 10)->create();\n }", "function createExternalTasksProject($projectName = \"CodevTT_ExternalTasks\", $projectDesc = \"CodevTT ExternalTasks Project\") {\n // create project\n $projectid = Project::getIdFormName($projectName);\n if (false === $projectid) {\n throw new Exception(\"CodevTT external tasks project creation failed\");\n }\n if (-1 !== $projectid) {\n echo \"<script type=\\\"text/javascript\\\">console.info(\\\"INFO: CodevTT external tasks project already exists: $projectName\\\");</script>\";\n } else {\n $projectid = Project::createExternalTasksProject($projectName, $projectDesc);\n }\n return $projectid;\n}", "public function projectAction()\n {\n $projectId = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4Admin');\n\n try {\n $project = Project::fetch($projectId, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n if (!$project) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $config = $services->get('config');\n $mainlines = isset($config['projects']['mainlines']) ? (array) $config['projects']['mainlines'] : array();\n $branches = $project->getBranches('name', $mainlines);\n\n // check each path of each mainline branch to see if there's a readme.md file present\n $readme = false;\n foreach ($branches as $branch) {\n foreach ($branch['paths'] as $depotPath) {\n if (substr($depotPath, -3) == '...') {\n $filePath = substr($depotPath, 0, -3);\n }\n\n // filter is case insensitive\n $filter = Filter::create()->add(\n 'depotFile',\n $filePath . 'readme.md',\n Filter::COMPARE_EQUAL,\n Filter::CONNECTIVE_AND,\n true\n );\n $query = Query::create()->setFilter($filter);\n $query->setFilespecs($depotPath);\n\n $fileList = File::fetchAll($query);\n // there may be multiple files present, break out of the loops on the first one found\n foreach ($fileList as $file) {\n $readme = File::fetch($file->getFileSpec(), $p4Admin, true);\n break(3);\n }\n }\n }\n\n if ($readme === false) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $helpers = $services->get('ViewHelperManager');\n $purifiedMarkdown = $helpers->get('purifiedMarkdown');\n\n $maxSize = 1048576; // 1MB\n $contents = $readme->getDepotContents(\n array(\n $readme::UTF8_CONVERT => true,\n $readme::UTF8_SANITIZE => true,\n $readme::MAX_FILESIZE => $maxSize\n )\n );\n\n // baseUrl is used for locating relative images\n return new JsonModel(\n array(\n 'readme' => '<div class=\"view view-md markdown\">' . $purifiedMarkdown($contents) . '</div>',\n 'baseUrl' => '/projects/' . $projectId . '/view/' . $branch['id'] . '/'\n )\n );\n }", "public function onPostCreateProject(Event $event): void\n {\n if (self::$isGlobalCommand) {\n return;\n }\n\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n // new projects are most of the time proprietary\n $manipulator->addMainKey('license', 'proprietary');\n\n // 'name' and 'description' are only required for public packages\n $manipulator->removeProperty('name');\n $manipulator->removeProperty('description');\n\n foreach ($this->container->get('composer-extra') as $key => $value) {\n if ($key !== self::COMPOSER_EXTRA_KEY) {\n $manipulator->addSubNode('extra', $key, $value);\n }\n }\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n\n $this->updateComposerLock();\n }", "private function createProject(Database $db, User $user, string $name): Project\n {\n $project = new Project();\n $project->setOwnerId($user);\n $project->setName($name);\n $db->save($project);\n\n return $project;\n }", "public function createProject($name, $clientID, $websiteFrontURL, $websiteBackURL,$color, $tasksScheduledTime, $ticketsScheduledTime)\n {\n }", "public function projects_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n }\n \n $jutil->setExpStatus($params,$owner);\n \n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addProject($params);\n \n $this->response($result);\n }", "public static function run(): void\n {\n $projectName = Console\\Layer::readline('Enter project name: ');\n\n $env = file_get_contents(__DIR__ . '/../Res/Create/env.tpl');\n\n $env = str_replace('%project_name%', $projectName, $env);\n\n Fs\\Layer::filePutContents(__DIR__ . '/../../../../../../.env', $env);\n }", "public function store(CreateProjectRequest $request)\n {\n $project = $this->dispatchFrom(CreateProject::class, $request, [\n 'user' => $this->currentUser\n ]);\n\n return response()\n ->json($project)\n ->setStatusCode(201);\n }", "public function create($data)\n {\n $project = $this->project->create([\n 'name' => $data['name'],\n 'slug' => Arr::get($data, 'slug', slugify($data['name'])),\n 'template' => Arr::get($data, 'template.name'),\n 'uuid' => $data['uuid'] ?? Str::random(36),\n 'published' => $data['published'] ?? false,\n 'updated_at' => $data['updated_at'] ?? now(),\n ])->fresh();\n $project->users()->attach($data['userId'] ?? Auth::user()->id);\n\n $projectPath = $this->getProjectPath($project);\n\n $this->addBootstrapFiles($projectPath, $project->framework);\n\n //thumbnail\n $this->storage->put(\"$projectPath/thumbnail.png\", Storage::disk('builder')->get(TemplateLoader::DEFAULT_THUMBNAIL));\n\n //custom css\n $this->storage->put(\"$projectPath/css/code_editor_styles.css\", '');\n\n //custom js\n $this->storage->put(\"$projectPath/js/code_editor_scripts.js\", '');\n\n //custom elements css\n $this->addCustomElementCss($projectPath, '');\n\n //empty theme\n $this->applyTheme($projectPath, null);\n\n //apply template\n if ($data['template']) {\n $this->applyTemplate($data['template'], $projectPath);\n }\n\n //create pages\n if (isset($data['pages'])) {\n $this->updatePages($project, $data['pages']);\n }\n\n return $project;\n }", "public function run()\n {\n AboutProject::create([\n 'main_title' => 'Жамбыл жастарының ресурстық орталығы',\n 'main_description' => 'default',\n 'main_image' => 'modules/front/assets/img/picture_slider.png',\n 'footer_title' => 'Жастар Саясаты басқармасы',\n 'footer_image' => 'modules/front/assets/img/logo.png',\n 'footer_address' => 'Желтоқсан көшесі, 78',\n 'footer_number' => '555-556-557'\n ]);\n }", "public function actionCreate() {\n $model = new Project;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n\n $this->redirect(['document/index', 'project_id' => $model->id]);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create(Request $request) {\n $this->validate($request, [\n 'user_id' => 'required|integer',\n 'name' => 'required|string',\n 'description' => 'required|string'\n ]);\n\n $project = new Project();\n if($request->input('p_id') != '') {\n $project->p_id = $request->input('p_id');\n } else {\n $project->p_id = Uuid::uuid();\n }\n $project->user_id = $request->input('user_id');\n $project->name = $request->input('name');\n $project->description = $request->input('description');\n\n return response()->success($project->save());\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->input = $input;\n $this->output = $output;\n\n // Define the new project's metadata\n $this->project = new Project();\n $this->project->setConfig($this->config);\n $this->project->setName($input->getArgument('name'));\n $this->project->generateProperties();\n $this->project->setDirectory(getcwd() . '/' . $this->project->getName(true));\n $this->project->setDescription($input->getOption('description'));\n\n // Check if directory already exists\n if (file_exists($this->project->getDirectory())) {\n throw new \\RuntimeException('Directory \"' . $this->project->getDirectory() . '\" already exists!');\n }\n\n // Validate framework\n $frameworkName = $input->getOption('framework');\n\n if ($frameworkName) {\n $frameworkName = strtolower($frameworkName);\n\n foreach (Framework::availableFrameworks() as $framework) {\n if (in_array($frameworkName, $framework->getShortcuts())) {\n $this->project->setFramework($framework);\n break;\n }\n }\n\n if ($this->project->getFramework() === FALSE) {\n throw new \\InvalidArgumentException('Invalid framework ' . $frameworkName . ', valid frameworks are: ' . implode(' ', Framework::validFrameworkShortcuts()));\n }\n }\n\n // Perform project creation actions\n $output->writeln('Creating new project in ' . $this->project->getDirectory());\n\n // Only create repository if skip-repository flag hasn't been set\n if (!$input->getOption('skip-repository')) {\n $this->createRepository();\n }\n\n $this->initializeProjectDirectory();\n\n // Install framework if needed\n if ($this->project->getFramework() !== FALSE) {\n $this->output->writeln('Installing ' . $this->project->getFramework()->getName(false) . '...');\n\n $o = $this->output;\n $this->project->getFramework()->install($this->project, function ($message) use ($o) {\n $o->write($message);\n });\n $this->project->getFramework()->configureEnvironment('dev', $this->project);\n\n // Push this change to the git remote\n $this->output->write(\"\\t\" . 'Pushing changes to git remote.');\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git add -A .',\n 'git commit -m \"Added '. $this->project->getFramework()->getName(false) .'\"'\n );\n\n if (!$input->getOption('skip-repository')) {\n $commands[] = 'git push origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n $this->output->write('.');\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n $this->output->writeln('<info>OK</info>');\n } else {\n // Just create the public directory\n mkdir($this->project->getDirectory() . '/public');\n }\n\n // Output final project information\n $this->showProjectInfo();\n }", "public function createProject(CreateProjectRequest $request)\n {\n $project = (new ProjectService())->create(\n $request->title,\n $request->url,\n $request->folder,\n $request->active == 'true' ? true : false,\n $request->secureUrl == 'true' ? true : false,\n $request->asset ?? null\n );\n\n return redirect()->to(route('dashboard'));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function run()\n {\n \n $project = Project::create([\n 'project_code' => '10001',\n 'name' => 'Head Office',\n 'short_name' => 'HQ',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10002',\n 'name' => 'Depot',\n 'short_name' => 'DEPOT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10003',\n 'name' => 'Safty',\n 'short_name' => 'SAFTY',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10004',\n 'name' => 'IT',\n 'short_name' => 'IT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11016',\n 'name' => 'Amber',\n 'short_name' => 'AMBER',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11023',\n 'name' => 'Niche Mono Borom Sales Office',\n 'short_name' => 'MONO',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n }", "public function actionCreate() {\n\n $model = new Project;\n // Only users who are approved members of an approved commmunity partner\n // can create projects\n\n $result = Involved::model()->approved()->with('communityPartner:approved')->findAll();\n if(!empty($result)) {\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n echo CJSON::encode(array('status' => 't',\n 'response' => $this->renderPartial('/project/continueCreating',\n array('projectOID' => $model->id), true)));\n Yii::app()->end();\n } else {\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n Yii::app()->end();\n }\n }\n } else {\n $model->addError('user_fk','You must be an approved member of an approved community partner\n before creating projects.');\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n }\n }", "public function store( ProjectCreateRequest $request ) {\n $project = new Project();\n $project->code = $request->code;\n $project->name = $request->name;\n $project->description = $request->description;\n\n $project->save();\n\n return $this->response->array( [ 'message' => trans( 'frontend.save' ) ] )->setStatusCode( Response::HTTP_CREATED );\n }", "private function createPedestalBasedSite()\n {\n $process = new Process('composer create-project -s dev versionpress/pedestal .', $this->siteConfig->path);\n $process->run();\n\n $this->updateConfigConstant('DB_NAME', $this->siteConfig->dbName);\n $this->updateConfigConstant('DB_USER', $this->siteConfig->dbUser);\n $this->updateConfigConstant('DB_PASSWORD', $this->siteConfig->dbPassword);\n $this->updateConfigConstant('DB_HOST', $this->siteConfig->dbHost);\n $this->updateConfigConstant('WP_HOME', $this->siteConfig->url);\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function create()\n {\n $stores = $this->project->getStores();\n $statistics = $this->project->getStatistics();\n $licensors = $this->project->getLicensors();\n $categories = $this->project->getAllCategories();\n $skills = $this->project->getAllSkills();\n $services = $this->project->getAllServices();\n $canDo = auth()->user()->role->canDoAll();\n $sub_categories = $this->project->getAllSubCategories();\n\n return view('pages.projects.create', compact('canDo', \n 'sub_categories', 'services', 'stores', \n 'categories', 'statistics', \n 'licensors', 'skills'));\n }", "public function store(StoreProjectRequest $request)\n {\n try{\n // Create project with properties filtered by StoreProjectRequest\n $project = Project::create($request->all());\n\n return response(new ProjectResource($project));\n } catch(Exception $e) {\n return $this->errorResponse($e);\n }\n }", "public function createProject(){\n\t\tif(!Auth::check())\n\t\t\treturn Redirect::to('/');\n\n\t\treturn View::make('projects.create');\n\t}", "public function create()\n {\n return view('backend.project.create');\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function create()\n {\n return view('create_project');\n }", "public function createAction()\n {\n $entity = new Project();\n $request = $this->getRequest();\n $form = $this->createForm(new ProjectType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $securityContext = $this->get('security.context');\n $user = $securityContext->getToken()->getUser();\n $entity->setOwner($user);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n // creating the ACL\n $aclProvider = $this->get('security.acl.provider');\n $objectIdentity = ObjectIdentity::fromDomainObject($entity);\n $acl = $aclProvider->createAcl($objectIdentity);\n\n // retrieving the security identity of the currently logged-in user\n $securityIdentity = UserSecurityIdentity::fromAccount($user);\n\n // grant owner access\n $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);\n $aclProvider->updateAcl($acl);\n\n return $this->redirect($this->generateUrl('project_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('SitronnierSmBoxBundle:Project:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\t\t$this->authorize('create', Project::class);\n\t\t/*--get all representatives--*/\n\t\t$project_managers=User::where('role','Like','PROJECT_MANAGER')->get();\n\t\t// get all clients\n\t\t$clients=Client::all();\n\t\treturn view('projects.create',compact('project_managers','clients'));\n\t}", "public function create()\n {\n\n return view('backend.project.create');\n }", "public function create()\n {\n $this->authorize('projects.create');\n $description = \"- What does the project do?\\n- Project Objectives,...\";\n $roles = $this->roleRepository->getByCompanyId($this->user->company_id);\n $users = $this->userRepository->getStaffInCompany($this->user->company_id);\n\n return view('projects.create', compact('description', 'roles', 'users'));\n }", "public function create()\n {\n $project = new Project;\n\n return view('projects.create', compact('project'))\n ->with([\n 'pap_types' => RefPapType::all(),\n ]);\n }", "private function initializeProjectDirectory()\n {\n $this->output->write('Adding initial files... ');\n\n // Create directory\n if (!@mkdir($this->project->getDirectory())) {\n $message = 'Error: Could not create directory';\n $this->output->writeln('<error>' . $message . '</error>');\n throw new \\RuntimeException($message);\n }\n\n // Add template files\n $templateHandler = new TemplateHandler();\n $templateHandler->setProject($this->project);\n\n $templateHandler->writeTemplate('README.md');\n $templateHandler->writeTemplate('gitignore');\n $templateHandler->writeTemplate('Vagrantfile');\n\n // Add Dirtfile\n $this->project->save();\n\n // Initialize git for working directory\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git init',\n 'git add -A .',\n 'git commit -m \"Initial commit, added README, gitignore, Dirtfile and Vagrantfile\"'\n );\n\n if (!$this->input->getOption('skip-repository')) {\n $commands[] = 'git remote add origin ' . $this->project->getRepositoryUrl();\n $commands[] = 'git push -u origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n\n $this->output->writeln('<info>OK</info>');\n }", "function createProject() {\n $dbConnection = mysqli_connect(Config::HOST, Config::UNAME,\n Config::PASSWORD, Config::DB_NAME) or die('Unable to connect to DB.');\n\n //Taking the values and inserting it into the user table\n $sqlQuery = \"INSERT INTO PROJECT VALUES ('$this->id','$this->title','$this->description','$this->year','$this->category',\n '$this->picture','$this->sid')\";\n\n if(mysqli_query($dbConnection,$sqlQuery)){\n echo \"Project created successfully\";\n }\n\n else {\n echo \"Project not added! \" . mysqli_error($dbConnection);\n }\n mysqli_close($dbConnection);\n }", "public function create()\n {\n $this->authorize('create', Project::class);\n\n $activeYear = BudgetYear::active()->first();\n\n if(is_null($activeYear))\n abort(497, 'Unathorized Action. There is no active Budget Year set.');\n\n return view(\"create_project\", compact('activeYear'));\n }", "public function create()\n {\n return view('admin.project.create', $this->projectRepositoryInterface->createProject());\n }", "public function create()\n {\n $categories = Category::all();\n $tracing = Tracing::all();\n return view('projects.create')->with('categories', $categories)\n ->with('tracings', $tracing);\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function creating(Project $project)\n {\n if(!$project){\n return back()->withInput()->with('errors', 'Error creating new Project');\n }\n }", "public function create()\n {\n try {\n $this->authorize('create', Project::class);\n } catch (AuthorizationException $e) {\n Flash::error($e->getMessage());\n return redirect()->back();\n }\n return view('projects.create');\n }", "public function store()\n {\n if (!$this->isValid()) {\n return Response::error();\n }\n\n $project = new Project;\n $project->company_id = Input::get('company_id');\n $project->user_id = Auth::user()->id;\n $project->name = Input::get('name');\n $project->description = Input::get('description');\n $project->save();\n\n Log::info('Successfully created project !');\n return Response::string(\n [\n 'messages' => ['Successfully created project ' . print_r($project->toArray(), true) . ' !'],\n 'data' => $project->toArray()\n ]\n );\n }", "public function create()\n {\n\t\t$programs = Program::active()->select('id', 'title')->latest()->get();\n return view('projects.create', compact('programs'));\n }", "public function create()\n {\n return view('contractor.projects.create');\n }", "public function run()\n {\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 2\n ]);\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 3\n ]);\n }", "public function create() // метод для создания\n {\n\n return view('project.create',\n [\n \"tasks\" => $this->tasks->all()\n ]\n );\n }", "public function actionCreate()\n {\n $model = new Requirement();\n\n $defaultProjectId = UserOption::getOption(UserOption::NAME_ACTIVE_PROJECT);\n if ($defaultProjectId) {\n $model->projectId = $defaultProjectId;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('projects.create');\n\t}", "public function store()\n\t{\n\t\tLog::debug('Innuti proj store!');\n\n\t\tif(!Auth::check())\n\t\t{\n\t\t\treturn Response::json(null, 401);\n\t\t}\n\t\t\n\t\t$inputArray = array (\n\t\t\t'title' => Input::get('title'),\n\t\t\t'company_name' => Input::get('company_name'),\n\t\t\t'description' => Input::get('description'),\n\t\t\t'vacation_weeks' => Input::get('vacation_weeks'),\n\t\t\t'area' => Input::get('area'),\n\t\t\t'user_id' => Auth::user()->id,\n\t\t\t);\n\t\t\t\n\n\t\tLog::debug('inputarray: ' . json_encode($inputArray));\n\n\t\t$validator = Validator::make($inputArray, Project::$rules);\n\n\t\t$wronglyFormattedParametersCode = 400;\n\t\t$bookNotFoundCode = 401;\n\t\t$successCode = 200;\n\t\t$statusCode = $bookNotFoundCode;\n\n\n\t\t$newProject = null;\n // Check if the form validates with success.\n\t\tif ($validator->passes())\n\t\t{\n\t\t\tLog::debug('validation passed');\n\t\t\t$statusCode = $successCode;\n\t\t\t$newProject = Project::create($inputArray);\n\t\t\t$newProject->user()->associate(Auth::user());\n\n\t\t\t$newProject->fillUpWithEnergyTypes();\n\t\t\t\n\t\t\t$newProject->save();\n\t\t} else\n\t\t{\n\t\t\tLog::debug('validation passed NOTNOTNOT');\n\t\t\t$statusCode = $wronglyFormattedParametersCode;\n\t\t}\n\n\t\tLog::debug('Just before response!');\n\t\treturn Response::json($newProject, $statusCode);\n\t}", "public function create()\n {\n $invoices = Invoice::all();\n $project_statuses = ProjectStatus::all();\n return view('backend.project.create', compact('invoices','project_statuses'));\n }", "public function run()\n {\n $faker = Faker::create();\n // Create Project\n foreach (range(1, 10) as $i) {\n Project::create([\n 'name' => $faker->name,\n 'manager' => $i\n ]);\n }\n }", "public function newProject($source , $target , $content , $word_count=0 , $notes='' , $callback_url='', $params=array()){\n\t\t$url = '/project/new/';\n\t\t$method = 'post';\n\t\t$params['source'] = $source;\n\t\t$params['target'] = $target;\n\t\t$params['content'] = $content;\n\t\t$params['word_count'] = $word_count;\n\t\t$params['notes'] = $notes;\n\t\t$params['callback_url'] = $callback_url;\n\t\t\n\t\treturn $this->request($url , $method , $params);\n\t\t\n\t}", "public function store(ProjectRequest $request): Project\n {\n return Project::create($request->validated());\n }", "public function create()\n {\n $project= new Project();\n $languages = Language::get();\n return view('project.create',compact(['project','languages']));\n }", "public function create($project_id)\n {\n //Get the project associated with that work item\n $project = Project::where('id', '=', $project_id)->first();\n\n\n // Load the view with create new work item form while passing the project variable\n return view('workitems.create-new-work-item', ['project' => $project]);\n }", "public function create()\n {\n return view('project.create');\n }", "public function create()\n {\n return view('admin.project.create');\n }", "public function createProject($name, $providerId, $region, $usesVanityDomain)\n {\n return $this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/projects', array_filter([\n 'cloud_provider_id' => $providerId,\n 'name' => $name,\n 'region' => $region,\n 'uses_vanity_domain' => $usesVanityDomain,\n ]));\n }", "function createProjectController(){\n\t\t\t//loads user model\n\t\t\t$this->load->model('User_model');\n\t\t\t\n\t\t\t//get posted values\n\t\t\t$userid = $_POST[\"userid\"];\n\t\t\t$projtitle = $_POST[\"projtitle\"];\n\t\t\t$projdesc = $_POST[\"projdesc\"];\n\t\t\t$projcat = $_POST[\"projcat\"];\n\t\t\t$projstartdate = $_POST[\"projstartdate\"];\n\t\t\t$projenddate = $_POST[\"projenddate\"];\n\t\t\t$projcreatedate = $_POST[\"projcreatedate\"];\n\t\t\t$projimagelink = $_POST[\"projimagelink\"];\n\t\t\t\n\t\t\t//calls method createProjectModel method from the model\n\t\t\t$success = $this->User_model->createProjectModel($userid, $projtitle, $projdesc, $projcat, $projstartdate, $projenddate, $projcreatedate, $projimagelink);\n\n\t\t\tif($success){\n\t\t\t\techo 'done';\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo 'error';\t\n\t\t\t}\n\t\t\t\t\t\t \n\t\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function store(Request $request)\n {\n $newProject = NewProject::create($request->all());\n return new NewProjectResource($newProject);\n }", "public function store($stub, CreateProjectRequest $request)\n\t{\n\t\t$client = $this->clients->findByStub($stub);\n $result = $this->projects->create($client, $request);\n\n if($result) {\n session()->flash('message', $request->name.' was created successfully.');\n return redirect()->back();\n } else {\n session()->flash('notify-type', 'error');\n session()->flash('message', 'This was unsuccessful, please try again.');\n return redirect()->back();\n }\n\t}", "public static function openProject($p)\n\t{\n\t\tGLOBAL $_REQ;\n\t\t$_SESSION['currentProject']= $p['pk_project'];\n\t\t$_SESSION['currentProjectName']= $p['name'];\n\t\t$_SESSION['currentProjectDir']= Mind::$projectsDir.$p['name'];\n\t\t$p['path']= Mind::$projectsDir.$p['name'];\n\t\t$p['sources']= Mind::$projectsDir.$p['name'].'/sources';\n\t\t$ini= parse_ini_file(Mind::$projectsDir.$p['name'].'/mind.ini');\n\t\t$p= array_merge($p, $ini);\n\n\t\tMind::$currentProject= $p;\n\t\tMind::$curLang= Mind::$currentProject['idiom'];\n\t\tMind::$content= '';\n\t\t\n\t\t// loading entities and relations from cache\n\t\t$path= Mind::$currentProject['path'].\"/temp/\";\n\t\t$entities= $path.\"entities~\";\n\t\t$relations= $path.\"relations~\";\n\t\t\n\t\t$pF= new DAO\\ProjectFactory(Mind::$currentProject);\n\t\tMind::$currentProject['version']= $pF->data['version'];\n\t\tMind::$currentProject['pk_version']= $pF->data['pk_version'];\n\t\t\n\t\tMind::write('projectOpened', true, $p['name']);\n\t\treturn true;\n\t}", "public function actionCreate($project_id = 0)\n {\n $model = new GlobalConfig();\n if (!empty($project_id)) {\n $model->autoCreate4Project($project_id);\n } else {\n $model->autoCreate();\n }\n\n return $this->redirect(['index', 'project_id'=> $project_id]);\n\n }", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function create()\n {\n return view('backend.projects.create');\n }", "private function add_project()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$projects = $serviceManager->get('PM/Model/Projects');\n \t$result = $projects->getProjectById($this->pk);\t\n \t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['company_id']));\n \t\t$project_url = $this->view->url('projects/view', array('company_id' => FALSE, 'project_id' => $result['id']));\n \t\t\n \t\t$this->add_breadcrumb($company_url, $result['company_name']);\n \t\t$this->add_breadcrumb($project_url, $result['name'], TRUE);\n \t}\n }" ]
[ "0.7480772", "0.69335276", "0.6720666", "0.6686327", "0.6674912", "0.66042274", "0.6395912", "0.62972945", "0.62956166", "0.62850964", "0.6210036", "0.6200268", "0.61972654", "0.61848426", "0.6155389", "0.61428875", "0.6134689", "0.6129079", "0.6114572", "0.6112827", "0.60919106", "0.60822004", "0.60506994", "0.6037085", "0.6022868", "0.60072535", "0.6006922", "0.60005546", "0.5987651", "0.59805876", "0.5965867", "0.5910062", "0.59017444", "0.5895673", "0.58942026", "0.5887698", "0.58863026", "0.58777535", "0.58547735", "0.5852199", "0.5845799", "0.58368444", "0.58366865", "0.5834007", "0.5832191", "0.5801112", "0.57653624", "0.5761987", "0.5752131", "0.575127", "0.5740597", "0.5674134", "0.5665337", "0.56364155", "0.56264293", "0.56106704", "0.5606829", "0.56044865", "0.5597907", "0.5597345", "0.55941033", "0.55747515", "0.55725974", "0.5569051", "0.5564973", "0.5563967", "0.55574524", "0.55340725", "0.55194193", "0.55145204", "0.55113953", "0.5508497", "0.55001926", "0.5488412", "0.54864925", "0.5477807", "0.5476002", "0.54706156", "0.5461714", "0.5451026", "0.5450929", "0.5450881", "0.54429084", "0.5438912", "0.5431604", "0.54257804", "0.5410777", "0.5407925", "0.54017943", "0.5397274", "0.5397065", "0.5392518", "0.5389198", "0.53854805", "0.53829193", "0.5381213", "0.5373837", "0.5371826", "0.537082", "0.5370205" ]
0.7445076
1
This is a helpping method to create a project using the local prj.json file.
private function createExperiment() { $input = file_get_contents('exp.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/experiments?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "static private function createProject($name, User $leader, $overview, $client = null, $category = null, $template = null, $first_milestone_starts_on = null, $based_on = null, $label_id = null, $currency_id = null, $budget = null, $custom_field_1 = null, $custom_field_2 = null, $custom_field_3 = null) {\n $project = new Project();\n\n $project->setAttributes(array(\n 'name' => $name,\n 'slug' => Inflector::slug($name),\n 'label_id' => (isset($label_id) && $label_id) ? $label_id : 0,\n 'overview' => trim($overview) ? trim($overview) : null,\n 'company_id' => $client instanceof Company ? $client->getId() : null,\n 'category_id' => $category instanceof ProjectCategory ? $category->getId() : null,\n 'custom_field_1' => $custom_field_1,\n 'custom_field_2' => $custom_field_2,\n 'custom_field_3' => $custom_field_3,\n ));\n\n $project->setState(STATE_VISIBLE);\n $project->setLeader($leader);\n\n if($template instanceof ProjectTemplate) {\n $project->setTemplate($template);\n } // if\n\n if($based_on instanceof IProjectBasedOn) {\n $project->setBasedOn($based_on);\n } // if\n\n $project->setCurrencyId($currency_id);\n\n if(AngieApplication::isModuleLoaded('tracking') && $budget) {\n $project->setBudget($budget);\n } // if\n\n $project->setMailToProjectCode(Projects::newMailToProjectCode());\n\n $project->save();\n\n if($template instanceof ProjectTemplate && $first_milestone_starts_on instanceof DateValue) {\n ConfigOptions::setValueFor('first_milestone_starts_on', $project, $first_milestone_starts_on->toMySQL());\n } // if\n\n return $project;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function create_existing () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\tif ($selection = $dialog->select_folder(\"Choose folder\", \"Choose existing folder to create new TextMate project from.\", false, null)) {\n\t\t\t\n\t\t\t// Get the name of the existing project\n\t\t\t$project_name = basename($selection);\n\t\t\t\n\t\t\t// Get path to new project\n\t\t\t$project = \"$selection/$project_name.tmproj\";\n\t\t\t\n\t\t\t// Prevent duplicate project\n\t\t\tif (file_exists($project)) {\n\t\t\t\tdie(\"There is already an existing TextMate project at this location.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Use the Empty template as our base\n\t\t\t$template = $this->standard_templates.\"/Empty\";\n\t\t\tif (file_exists($template)) {\n\t\t\t\t\n\t\t\t\t// Make Targets directory\n\t\t\t\t@mkdir(\"$selection/Targets\", 0777);\n\t\t\t\t\n\t\t\t\t// Copy default target\n\t\t\t\tcopy(\"$template/Targets/development.xml\", \"$selection/Targets/development.xml\");\n\t\t\t\t\n\t\t\t\t// Copy TextMate project file\n\t\t\t\t@copy(\"$template/project.tmproj\", $project);\n\t\t\t\t$this->replace_macros($project, array(self::MACRO_PROJECT => $project_name));\n\t\t\t\t\n\t\t\t\tprint(\"Successfully created the new project.\\n\");\n\t\t\t\t\n\t\t\t\t$this->open_project($project);\n\t\t\t} else {\n\t\t\t\tdie(\"Can't find project template to start from!\");\n\t\t\t}\n\t\t}\n\t}", "public function makeProject()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpProject());\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function actionCreate()\n {\n $model = new Project();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n OperationRecord::record($model->tableName(), $model->pj_id, $model->pj_name, OperationRecord::ACTION_ADD);\n return $this->redirect(['view', 'id' => $model->pj_id]);\n }\n\n if (Yii::$app->request->isPost) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Create project failed!'));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $shortcut = session()->get('shortcut');\n $from_api = session()->get('from_api');\n\n //\n $json = $this->jiraApi($shortcut);\n\n // Connect both arrays\n// $data = array_merge($data, $json);\n // Connect both Objects\n// $data = (object) array_merge((array) $data, (array) $json);\n //\n return view('projects.create', compact( 'json', 'from_api'));\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function create(CreateProjectRequest $request)\n {\n $newEntry = Project::create([\n 'author' => Auth::user()->username,\n 'user_id' => Auth::user()->id,\n 'title' => $request->getTitle(),\n 'description' => $request->getDescription(),\n 'body' => $request->getBody(),\n 'statement_title' => 'Mission Statement',\n 'statement_body' => 'This is where you write about your mission statement or make it whatever you want.',\n 'tab_title' => 'Welcome',\n 'tab_body' => 'Here you can write a message or maybe the status of your project for all your members to see.',\n ]);\n\n $thumbnail = $request->file('thumbnail');\n $thumbnail->move(base_path() . '/public/images/projects', 'product' . $newEntry->id . '.jpg');\n\n //Sets banner image to a random pre-made banner\n $images = glob(base_path() . \"/public/images/banners/*\");\n $imagePath = base_path() . '/public/images/projects/' . 'banner' . $newEntry->id . '.jpg';\n $rand = random_int(0, count($images) - 1);\n \\File::copy($images[$rand], $imagePath);\n\n //Add creator as a member and make admin of the project\n $newEntry->addMember(true);\n //Add creator as a follower of the project\n $newEntry->addFollower();\n\n return redirect('/project/'.$newEntry->title);\n }", "public function create_new () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\t$templates = array();\n\t\t\n\t\t// Find items in standard project templates\n\t\t$contents = directory_contents($this->standard_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->standard_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find items in user project templates\n\t\t$contents = directory_contents($this->user_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->user_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\n\t\t// Prompt to select template\n\t\tif ($selection = $dialog->standard_dropdown(\"New Project\", \"Choose a project template to start from.\", $items, false, false, false, false)) {\n\t\t\t//print($selection);\n\t\t\t\n\t\t\t// Prompt to save\n\t\t\tif ($path = $dialog->save_file(\"Save Project\", \"Choose a location to save the new project.\", null, null, null)) {\n\t\t\t\t$this->copy_template($templates[$selection], $path);\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function create_project( $options ) {\n\n\t\tif ( ! isset( $options['project_name'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$defaults = array(\n\t\t\t'project_status' => 'Active',\n\t\t\t'include_jquery' => FALSE,\n\t\t\t'project_javascript' => null,\n\t\t\t'enable_force_variation' => FALSE,\n\t\t\t'exclude_disabled_experiments' => FALSE,\n\t\t\t'exclude_names' => null,\n\t\t\t'ip_anonymization' => FALSE,\n\t\t\t'ip_filter' => null,\n\t\t);\n\n\t\t$options = array_replace( $defaults, $options );\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "static function create($name, $additional = null, $instantly = true) {\n $logged_user = Authentication::getLoggedUser();\n \n $based_on = array_var($additional, 'based_on');\n $template = array_var($additional, 'template');\n \n $leader = array_var($additional, 'leader');\n if(!($leader instanceof User)) {\n $leader = $logged_user;\n } // if\n\n try {\n DB::beginWork('Creating a project @ ' . __CLASS__);\n\n // Create a new project instance\n $project = self::createProject(\n $name,\n $leader,\n array_var($additional, 'overview'),\n array_var($additional, 'company'),\n array_var($additional, 'category'),\n $template,\n array_var($additional, 'first_milestone_starts_on'),\n $based_on,\n array_var($additional, 'label_id'),\n array_var($additional, 'currency_id'),\n array_var($additional, 'budget'),\n array_var($additional, 'custom_field_1'),\n array_var($additional, 'custom_field_2'),\n array_var($additional, 'custom_field_3')\n );\n\n // Add leader and person who created a project to the project\n $project->users()->add($logged_user);\n\n if($logged_user->getId() != $leader->getId()) {\n $project->users()->add($leader);\n } // if\n\n // If project is created from a template, copy items\n if($template instanceof ProjectTemplate) {\n $positions = array_var($additional, 'positions', array());\n $template->copyItems($project, $positions);\n\n ConfigOptions::removeValuesFor($project, 'first_milestone_starts_on');\n\n // In case of a blank project, import users and master categories\n } else {\n Users::importAutoAssignIntoProject($project);\n $project->availableCategories()->importMasterCategories($logged_user);\n } // if\n\n // Close project request or quote\n if($based_on instanceof ProjectRequest) {\n $based_on->close($logged_user);\n } elseif($based_on instanceof Quote) {\n $based_on->markAsWon($logged_user);\n } // if\n\n EventsManager::trigger('on_project_created', array(&$project, &$logged_user));\n\n DB::commit('Project created @ ' . __CLASS__);\n\n return $project;\n } catch(Exception $e) {\n DB::rollback('Failed to create a project @ ' . __CLASS__);\n throw $e;\n } // try\n }", "public function store(CreateProject $request)\n {\n $project = new Project();\n $project->setAttributes($request->all());\n $project->save();\n\n return response()->json($project, $status = 201)->setStatusCode(201);\n }", "public function creator($projectId = false) {\n\n // Call builder code\n $data = $this->builder(true, $projectId);\n\n // Create controller\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/controllers/' . ucfirst($this->formName) . '.php', 'w');\n fwrite($fp, $data['phpcontroller']);\n fclose($fp);\n // Create model\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/models/' . ucfirst($this->formName) . '_model.php', 'w');\n fwrite($fp, $data['phpmodel']);\n fclose($fp);\n\n // Create view\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '.php', 'w');\n fwrite($fp, $data['htmlview']);\n fclose($fp);\n // Create success page\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '_success.php', 'w');\n fwrite($fp, $this->successBuilder());\n fclose($fp);\n\n $data['myFolder'] = $this->listMyFolder($this->pathCreator . '/' . $projectId);\n echo json_encode($data);\n }", "public function run()\n {\n \t$project_owner = User::where('name', 'Owner Name')->first();\n \t$project = new Project();\n \t$project->name = 'New Project';\n \t$project->owner = $project_owner->id;\n \t$project->save();\n }", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "private function createProjectPool() {\n //TODO\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function handleCreate(Request $request) {\n\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n $project = Auth::user()->projects()->create($request->all());\n\n return response()->json($project, 201);\n }", "public function create(ProjectModel $project): void {\n\t\tFilesystemUtils::dirShouldExist($this->di_context->varPath('tmp'));\n\n\t\t$basepath = FilesystemUtils::dirpath($this->projectDir, $project->slugname());\n\t\tif (file_exists($basepath)) {\n\t\t\tthrow new RuntimeException(\"Project directory '{$basepath}' already exists\");\n\t\t}\n\n\t\t$tempnewdir = $this->di_context->varPath('tmp', $project->slugname().'_temp');\n\t\tif (file_exists($tempnewdir)) {\n\t\t\tFilesystemUtils::rrmdir($tempnewdir);\n\t\t}\n\n\t\tmkdir($tempnewdir);\n\n\t\t//create git repository folder\n\t\tmkdir($tempnewdir.\\DIRECTORY_SEPARATOR.'REPO');\n\t\t$gitRepo = $tempnewdir.\\DIRECTORY_SEPARATOR.'REPO'.\\DIRECTORY_SEPARATOR.$project->slugname().'.git';\n\n\t\t//create the main git repository\n\t\t$tempdir = $this->di_context->varPath('tmp', basename($gitRepo));\n\t\tFilesystemUtils::rrmdir($tempdir);\n\t\t$this->di_gitservice->execGit(\"init --bare {$gitRepo}\");\n\n\t\t//clone a working copy into a temporary folder\n\t\t$repo = $this->di_gitservice->clone($gitRepo);\n\t\t$repo->execGit(\"config user.name 'hgit daemon'\");\n\t\t$repo->execGit(\"config user.email 'hgitdaemon@localhost'\");\n\t\t$repo->add('.gitignore');\n\t\t$repo->commit('Create .gitignore file in master branch');\n\t\t$repo->execGit('push --set-upstream origin master');\n\n\t\t//create wiki branch\n\t\t$repo->checkout('wiki', true);\n\t\t$repo->add('readme.md', \"{$project->description}\\nDocumentation\\n\");\n\t\t$repo->commit('Create readme file in wiki branch');\n\t\t$repo->execGit('push --set-upstream origin wiki');\n\t\t$repo->checkout('master');\n\n\t\t//create developement branch\n\t\t$repo->checkout('develop', true);\n\t\t$repo->add('readme.md', \"{$project->description}\");\n\t\t$repo->commit('Create readme file in develop branch');\n\t\t$repo->execGit('push --set-upstream origin develop');\n\n\t\t//delete the temporary working directory\n\t\tFilesystemUtils::rrmdir($repo->path);\n\n\t\t//\"commit\" the newly created folder structure to the project root\n\t\trename($tempnewdir, $basepath);\n\t}", "public function createProject($project)\n {\n $data = new Project();\n $data->setName($project['name'])\n ->setDescription($project['description'])\n ->setIsArchived(0)\n ->setCreatedTime(time())\n ->setUpdatedTime(time());\n $em = $this->getDoctrine()->getManager();\n $em->persist($data);\n $em->flush();\n }", "public function run()\n {\n Project::truncate();\n \n factory(Project::class)->create([\n 'owner_id' => 1,\n 'client_id' => 1,\n 'name' => 'Project Test',\n 'description' => 'Lorem ipsum',\n 'progress' => rand(1, 100),\n 'status' => rand(1, 3),\n 'due_date' => '2016-06-06'\n ]);\n\n factory(Project::class, 10)->create();\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "function createExternalTasksProject($projectName = \"CodevTT_ExternalTasks\", $projectDesc = \"CodevTT ExternalTasks Project\") {\n // create project\n $projectid = Project::getIdFormName($projectName);\n if (false === $projectid) {\n throw new Exception(\"CodevTT external tasks project creation failed\");\n }\n if (-1 !== $projectid) {\n echo \"<script type=\\\"text/javascript\\\">console.info(\\\"INFO: CodevTT external tasks project already exists: $projectName\\\");</script>\";\n } else {\n $projectid = Project::createExternalTasksProject($projectName, $projectDesc);\n }\n return $projectid;\n}", "public function projectAction()\n {\n $projectId = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4Admin');\n\n try {\n $project = Project::fetch($projectId, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n if (!$project) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $config = $services->get('config');\n $mainlines = isset($config['projects']['mainlines']) ? (array) $config['projects']['mainlines'] : array();\n $branches = $project->getBranches('name', $mainlines);\n\n // check each path of each mainline branch to see if there's a readme.md file present\n $readme = false;\n foreach ($branches as $branch) {\n foreach ($branch['paths'] as $depotPath) {\n if (substr($depotPath, -3) == '...') {\n $filePath = substr($depotPath, 0, -3);\n }\n\n // filter is case insensitive\n $filter = Filter::create()->add(\n 'depotFile',\n $filePath . 'readme.md',\n Filter::COMPARE_EQUAL,\n Filter::CONNECTIVE_AND,\n true\n );\n $query = Query::create()->setFilter($filter);\n $query->setFilespecs($depotPath);\n\n $fileList = File::fetchAll($query);\n // there may be multiple files present, break out of the loops on the first one found\n foreach ($fileList as $file) {\n $readme = File::fetch($file->getFileSpec(), $p4Admin, true);\n break(3);\n }\n }\n }\n\n if ($readme === false) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $helpers = $services->get('ViewHelperManager');\n $purifiedMarkdown = $helpers->get('purifiedMarkdown');\n\n $maxSize = 1048576; // 1MB\n $contents = $readme->getDepotContents(\n array(\n $readme::UTF8_CONVERT => true,\n $readme::UTF8_SANITIZE => true,\n $readme::MAX_FILESIZE => $maxSize\n )\n );\n\n // baseUrl is used for locating relative images\n return new JsonModel(\n array(\n 'readme' => '<div class=\"view view-md markdown\">' . $purifiedMarkdown($contents) . '</div>',\n 'baseUrl' => '/projects/' . $projectId . '/view/' . $branch['id'] . '/'\n )\n );\n }", "public function onPostCreateProject(Event $event): void\n {\n if (self::$isGlobalCommand) {\n return;\n }\n\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n // new projects are most of the time proprietary\n $manipulator->addMainKey('license', 'proprietary');\n\n // 'name' and 'description' are only required for public packages\n $manipulator->removeProperty('name');\n $manipulator->removeProperty('description');\n\n foreach ($this->container->get('composer-extra') as $key => $value) {\n if ($key !== self::COMPOSER_EXTRA_KEY) {\n $manipulator->addSubNode('extra', $key, $value);\n }\n }\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n\n $this->updateComposerLock();\n }", "private function createProject(Database $db, User $user, string $name): Project\n {\n $project = new Project();\n $project->setOwnerId($user);\n $project->setName($name);\n $db->save($project);\n\n return $project;\n }", "public function createProject($name, $clientID, $websiteFrontURL, $websiteBackURL,$color, $tasksScheduledTime, $ticketsScheduledTime)\n {\n }", "public function projects_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n }\n \n $jutil->setExpStatus($params,$owner);\n \n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addProject($params);\n \n $this->response($result);\n }", "public function store(CreateProjectRequest $request)\n {\n $project = $this->dispatchFrom(CreateProject::class, $request, [\n 'user' => $this->currentUser\n ]);\n\n return response()\n ->json($project)\n ->setStatusCode(201);\n }", "public static function run(): void\n {\n $projectName = Console\\Layer::readline('Enter project name: ');\n\n $env = file_get_contents(__DIR__ . '/../Res/Create/env.tpl');\n\n $env = str_replace('%project_name%', $projectName, $env);\n\n Fs\\Layer::filePutContents(__DIR__ . '/../../../../../../.env', $env);\n }", "public function create($data)\n {\n $project = $this->project->create([\n 'name' => $data['name'],\n 'slug' => Arr::get($data, 'slug', slugify($data['name'])),\n 'template' => Arr::get($data, 'template.name'),\n 'uuid' => $data['uuid'] ?? Str::random(36),\n 'published' => $data['published'] ?? false,\n 'updated_at' => $data['updated_at'] ?? now(),\n ])->fresh();\n $project->users()->attach($data['userId'] ?? Auth::user()->id);\n\n $projectPath = $this->getProjectPath($project);\n\n $this->addBootstrapFiles($projectPath, $project->framework);\n\n //thumbnail\n $this->storage->put(\"$projectPath/thumbnail.png\", Storage::disk('builder')->get(TemplateLoader::DEFAULT_THUMBNAIL));\n\n //custom css\n $this->storage->put(\"$projectPath/css/code_editor_styles.css\", '');\n\n //custom js\n $this->storage->put(\"$projectPath/js/code_editor_scripts.js\", '');\n\n //custom elements css\n $this->addCustomElementCss($projectPath, '');\n\n //empty theme\n $this->applyTheme($projectPath, null);\n\n //apply template\n if ($data['template']) {\n $this->applyTemplate($data['template'], $projectPath);\n }\n\n //create pages\n if (isset($data['pages'])) {\n $this->updatePages($project, $data['pages']);\n }\n\n return $project;\n }", "public function run()\n {\n AboutProject::create([\n 'main_title' => 'Жамбыл жастарының ресурстық орталығы',\n 'main_description' => 'default',\n 'main_image' => 'modules/front/assets/img/picture_slider.png',\n 'footer_title' => 'Жастар Саясаты басқармасы',\n 'footer_image' => 'modules/front/assets/img/logo.png',\n 'footer_address' => 'Желтоқсан көшесі, 78',\n 'footer_number' => '555-556-557'\n ]);\n }", "public function actionCreate() {\n $model = new Project;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n\n $this->redirect(['document/index', 'project_id' => $model->id]);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create(Request $request) {\n $this->validate($request, [\n 'user_id' => 'required|integer',\n 'name' => 'required|string',\n 'description' => 'required|string'\n ]);\n\n $project = new Project();\n if($request->input('p_id') != '') {\n $project->p_id = $request->input('p_id');\n } else {\n $project->p_id = Uuid::uuid();\n }\n $project->user_id = $request->input('user_id');\n $project->name = $request->input('name');\n $project->description = $request->input('description');\n\n return response()->success($project->save());\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->input = $input;\n $this->output = $output;\n\n // Define the new project's metadata\n $this->project = new Project();\n $this->project->setConfig($this->config);\n $this->project->setName($input->getArgument('name'));\n $this->project->generateProperties();\n $this->project->setDirectory(getcwd() . '/' . $this->project->getName(true));\n $this->project->setDescription($input->getOption('description'));\n\n // Check if directory already exists\n if (file_exists($this->project->getDirectory())) {\n throw new \\RuntimeException('Directory \"' . $this->project->getDirectory() . '\" already exists!');\n }\n\n // Validate framework\n $frameworkName = $input->getOption('framework');\n\n if ($frameworkName) {\n $frameworkName = strtolower($frameworkName);\n\n foreach (Framework::availableFrameworks() as $framework) {\n if (in_array($frameworkName, $framework->getShortcuts())) {\n $this->project->setFramework($framework);\n break;\n }\n }\n\n if ($this->project->getFramework() === FALSE) {\n throw new \\InvalidArgumentException('Invalid framework ' . $frameworkName . ', valid frameworks are: ' . implode(' ', Framework::validFrameworkShortcuts()));\n }\n }\n\n // Perform project creation actions\n $output->writeln('Creating new project in ' . $this->project->getDirectory());\n\n // Only create repository if skip-repository flag hasn't been set\n if (!$input->getOption('skip-repository')) {\n $this->createRepository();\n }\n\n $this->initializeProjectDirectory();\n\n // Install framework if needed\n if ($this->project->getFramework() !== FALSE) {\n $this->output->writeln('Installing ' . $this->project->getFramework()->getName(false) . '...');\n\n $o = $this->output;\n $this->project->getFramework()->install($this->project, function ($message) use ($o) {\n $o->write($message);\n });\n $this->project->getFramework()->configureEnvironment('dev', $this->project);\n\n // Push this change to the git remote\n $this->output->write(\"\\t\" . 'Pushing changes to git remote.');\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git add -A .',\n 'git commit -m \"Added '. $this->project->getFramework()->getName(false) .'\"'\n );\n\n if (!$input->getOption('skip-repository')) {\n $commands[] = 'git push origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n $this->output->write('.');\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n $this->output->writeln('<info>OK</info>');\n } else {\n // Just create the public directory\n mkdir($this->project->getDirectory() . '/public');\n }\n\n // Output final project information\n $this->showProjectInfo();\n }", "public function createProject(CreateProjectRequest $request)\n {\n $project = (new ProjectService())->create(\n $request->title,\n $request->url,\n $request->folder,\n $request->active == 'true' ? true : false,\n $request->secureUrl == 'true' ? true : false,\n $request->asset ?? null\n );\n\n return redirect()->to(route('dashboard'));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function run()\n {\n \n $project = Project::create([\n 'project_code' => '10001',\n 'name' => 'Head Office',\n 'short_name' => 'HQ',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10002',\n 'name' => 'Depot',\n 'short_name' => 'DEPOT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10003',\n 'name' => 'Safty',\n 'short_name' => 'SAFTY',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10004',\n 'name' => 'IT',\n 'short_name' => 'IT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11016',\n 'name' => 'Amber',\n 'short_name' => 'AMBER',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11023',\n 'name' => 'Niche Mono Borom Sales Office',\n 'short_name' => 'MONO',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n }", "public function actionCreate() {\n\n $model = new Project;\n // Only users who are approved members of an approved commmunity partner\n // can create projects\n\n $result = Involved::model()->approved()->with('communityPartner:approved')->findAll();\n if(!empty($result)) {\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n echo CJSON::encode(array('status' => 't',\n 'response' => $this->renderPartial('/project/continueCreating',\n array('projectOID' => $model->id), true)));\n Yii::app()->end();\n } else {\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n Yii::app()->end();\n }\n }\n } else {\n $model->addError('user_fk','You must be an approved member of an approved community partner\n before creating projects.');\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n }\n }", "public function store( ProjectCreateRequest $request ) {\n $project = new Project();\n $project->code = $request->code;\n $project->name = $request->name;\n $project->description = $request->description;\n\n $project->save();\n\n return $this->response->array( [ 'message' => trans( 'frontend.save' ) ] )->setStatusCode( Response::HTTP_CREATED );\n }", "private function createPedestalBasedSite()\n {\n $process = new Process('composer create-project -s dev versionpress/pedestal .', $this->siteConfig->path);\n $process->run();\n\n $this->updateConfigConstant('DB_NAME', $this->siteConfig->dbName);\n $this->updateConfigConstant('DB_USER', $this->siteConfig->dbUser);\n $this->updateConfigConstant('DB_PASSWORD', $this->siteConfig->dbPassword);\n $this->updateConfigConstant('DB_HOST', $this->siteConfig->dbHost);\n $this->updateConfigConstant('WP_HOME', $this->siteConfig->url);\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function create()\n {\n $stores = $this->project->getStores();\n $statistics = $this->project->getStatistics();\n $licensors = $this->project->getLicensors();\n $categories = $this->project->getAllCategories();\n $skills = $this->project->getAllSkills();\n $services = $this->project->getAllServices();\n $canDo = auth()->user()->role->canDoAll();\n $sub_categories = $this->project->getAllSubCategories();\n\n return view('pages.projects.create', compact('canDo', \n 'sub_categories', 'services', 'stores', \n 'categories', 'statistics', \n 'licensors', 'skills'));\n }", "public function store(StoreProjectRequest $request)\n {\n try{\n // Create project with properties filtered by StoreProjectRequest\n $project = Project::create($request->all());\n\n return response(new ProjectResource($project));\n } catch(Exception $e) {\n return $this->errorResponse($e);\n }\n }", "public function createProject(){\n\t\tif(!Auth::check())\n\t\t\treturn Redirect::to('/');\n\n\t\treturn View::make('projects.create');\n\t}", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function create()\n {\n return view('backend.project.create');\n }", "public function create()\n {\n return view('create_project');\n }", "public function createAction()\n {\n $entity = new Project();\n $request = $this->getRequest();\n $form = $this->createForm(new ProjectType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $securityContext = $this->get('security.context');\n $user = $securityContext->getToken()->getUser();\n $entity->setOwner($user);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n // creating the ACL\n $aclProvider = $this->get('security.acl.provider');\n $objectIdentity = ObjectIdentity::fromDomainObject($entity);\n $acl = $aclProvider->createAcl($objectIdentity);\n\n // retrieving the security identity of the currently logged-in user\n $securityIdentity = UserSecurityIdentity::fromAccount($user);\n\n // grant owner access\n $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);\n $aclProvider->updateAcl($acl);\n\n return $this->redirect($this->generateUrl('project_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('SitronnierSmBoxBundle:Project:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\t\t$this->authorize('create', Project::class);\n\t\t/*--get all representatives--*/\n\t\t$project_managers=User::where('role','Like','PROJECT_MANAGER')->get();\n\t\t// get all clients\n\t\t$clients=Client::all();\n\t\treturn view('projects.create',compact('project_managers','clients'));\n\t}", "public function create()\n {\n\n return view('backend.project.create');\n }", "public function create()\n {\n $this->authorize('projects.create');\n $description = \"- What does the project do?\\n- Project Objectives,...\";\n $roles = $this->roleRepository->getByCompanyId($this->user->company_id);\n $users = $this->userRepository->getStaffInCompany($this->user->company_id);\n\n return view('projects.create', compact('description', 'roles', 'users'));\n }", "public function create()\n {\n $project = new Project;\n\n return view('projects.create', compact('project'))\n ->with([\n 'pap_types' => RefPapType::all(),\n ]);\n }", "private function initializeProjectDirectory()\n {\n $this->output->write('Adding initial files... ');\n\n // Create directory\n if (!@mkdir($this->project->getDirectory())) {\n $message = 'Error: Could not create directory';\n $this->output->writeln('<error>' . $message . '</error>');\n throw new \\RuntimeException($message);\n }\n\n // Add template files\n $templateHandler = new TemplateHandler();\n $templateHandler->setProject($this->project);\n\n $templateHandler->writeTemplate('README.md');\n $templateHandler->writeTemplate('gitignore');\n $templateHandler->writeTemplate('Vagrantfile');\n\n // Add Dirtfile\n $this->project->save();\n\n // Initialize git for working directory\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git init',\n 'git add -A .',\n 'git commit -m \"Initial commit, added README, gitignore, Dirtfile and Vagrantfile\"'\n );\n\n if (!$this->input->getOption('skip-repository')) {\n $commands[] = 'git remote add origin ' . $this->project->getRepositoryUrl();\n $commands[] = 'git push -u origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n\n $this->output->writeln('<info>OK</info>');\n }", "function createProject() {\n $dbConnection = mysqli_connect(Config::HOST, Config::UNAME,\n Config::PASSWORD, Config::DB_NAME) or die('Unable to connect to DB.');\n\n //Taking the values and inserting it into the user table\n $sqlQuery = \"INSERT INTO PROJECT VALUES ('$this->id','$this->title','$this->description','$this->year','$this->category',\n '$this->picture','$this->sid')\";\n\n if(mysqli_query($dbConnection,$sqlQuery)){\n echo \"Project created successfully\";\n }\n\n else {\n echo \"Project not added! \" . mysqli_error($dbConnection);\n }\n mysqli_close($dbConnection);\n }", "public function create()\n {\n $this->authorize('create', Project::class);\n\n $activeYear = BudgetYear::active()->first();\n\n if(is_null($activeYear))\n abort(497, 'Unathorized Action. There is no active Budget Year set.');\n\n return view(\"create_project\", compact('activeYear'));\n }", "public function create()\n {\n return view('admin.project.create', $this->projectRepositoryInterface->createProject());\n }", "public function create()\n {\n $categories = Category::all();\n $tracing = Tracing::all();\n return view('projects.create')->with('categories', $categories)\n ->with('tracings', $tracing);\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function creating(Project $project)\n {\n if(!$project){\n return back()->withInput()->with('errors', 'Error creating new Project');\n }\n }", "public function create()\n {\n try {\n $this->authorize('create', Project::class);\n } catch (AuthorizationException $e) {\n Flash::error($e->getMessage());\n return redirect()->back();\n }\n return view('projects.create');\n }", "public function store()\n {\n if (!$this->isValid()) {\n return Response::error();\n }\n\n $project = new Project;\n $project->company_id = Input::get('company_id');\n $project->user_id = Auth::user()->id;\n $project->name = Input::get('name');\n $project->description = Input::get('description');\n $project->save();\n\n Log::info('Successfully created project !');\n return Response::string(\n [\n 'messages' => ['Successfully created project ' . print_r($project->toArray(), true) . ' !'],\n 'data' => $project->toArray()\n ]\n );\n }", "public function create()\n {\n\t\t$programs = Program::active()->select('id', 'title')->latest()->get();\n return view('projects.create', compact('programs'));\n }", "public function create()\n {\n return view('contractor.projects.create');\n }", "public function run()\n {\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 2\n ]);\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 3\n ]);\n }", "public function create() // метод для создания\n {\n\n return view('project.create',\n [\n \"tasks\" => $this->tasks->all()\n ]\n );\n }", "public function store()\n\t{\n\t\tLog::debug('Innuti proj store!');\n\n\t\tif(!Auth::check())\n\t\t{\n\t\t\treturn Response::json(null, 401);\n\t\t}\n\t\t\n\t\t$inputArray = array (\n\t\t\t'title' => Input::get('title'),\n\t\t\t'company_name' => Input::get('company_name'),\n\t\t\t'description' => Input::get('description'),\n\t\t\t'vacation_weeks' => Input::get('vacation_weeks'),\n\t\t\t'area' => Input::get('area'),\n\t\t\t'user_id' => Auth::user()->id,\n\t\t\t);\n\t\t\t\n\n\t\tLog::debug('inputarray: ' . json_encode($inputArray));\n\n\t\t$validator = Validator::make($inputArray, Project::$rules);\n\n\t\t$wronglyFormattedParametersCode = 400;\n\t\t$bookNotFoundCode = 401;\n\t\t$successCode = 200;\n\t\t$statusCode = $bookNotFoundCode;\n\n\n\t\t$newProject = null;\n // Check if the form validates with success.\n\t\tif ($validator->passes())\n\t\t{\n\t\t\tLog::debug('validation passed');\n\t\t\t$statusCode = $successCode;\n\t\t\t$newProject = Project::create($inputArray);\n\t\t\t$newProject->user()->associate(Auth::user());\n\n\t\t\t$newProject->fillUpWithEnergyTypes();\n\t\t\t\n\t\t\t$newProject->save();\n\t\t} else\n\t\t{\n\t\t\tLog::debug('validation passed NOTNOTNOT');\n\t\t\t$statusCode = $wronglyFormattedParametersCode;\n\t\t}\n\n\t\tLog::debug('Just before response!');\n\t\treturn Response::json($newProject, $statusCode);\n\t}", "public function actionCreate()\n {\n $model = new Requirement();\n\n $defaultProjectId = UserOption::getOption(UserOption::NAME_ACTIVE_PROJECT);\n if ($defaultProjectId) {\n $model->projectId = $defaultProjectId;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('projects.create');\n\t}", "public function create()\n {\n $invoices = Invoice::all();\n $project_statuses = ProjectStatus::all();\n return view('backend.project.create', compact('invoices','project_statuses'));\n }", "public function run()\n {\n $faker = Faker::create();\n // Create Project\n foreach (range(1, 10) as $i) {\n Project::create([\n 'name' => $faker->name,\n 'manager' => $i\n ]);\n }\n }", "public function newProject($source , $target , $content , $word_count=0 , $notes='' , $callback_url='', $params=array()){\n\t\t$url = '/project/new/';\n\t\t$method = 'post';\n\t\t$params['source'] = $source;\n\t\t$params['target'] = $target;\n\t\t$params['content'] = $content;\n\t\t$params['word_count'] = $word_count;\n\t\t$params['notes'] = $notes;\n\t\t$params['callback_url'] = $callback_url;\n\t\t\n\t\treturn $this->request($url , $method , $params);\n\t\t\n\t}", "public function store(ProjectRequest $request): Project\n {\n return Project::create($request->validated());\n }", "public function create()\n {\n $project= new Project();\n $languages = Language::get();\n return view('project.create',compact(['project','languages']));\n }", "public function create($project_id)\n {\n //Get the project associated with that work item\n $project = Project::where('id', '=', $project_id)->first();\n\n\n // Load the view with create new work item form while passing the project variable\n return view('workitems.create-new-work-item', ['project' => $project]);\n }", "public function create()\n {\n return view('project.create');\n }", "public function createProject($name, $providerId, $region, $usesVanityDomain)\n {\n return $this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/projects', array_filter([\n 'cloud_provider_id' => $providerId,\n 'name' => $name,\n 'region' => $region,\n 'uses_vanity_domain' => $usesVanityDomain,\n ]));\n }", "public function create()\n {\n return view('admin.project.create');\n }", "function createProjectController(){\n\t\t\t//loads user model\n\t\t\t$this->load->model('User_model');\n\t\t\t\n\t\t\t//get posted values\n\t\t\t$userid = $_POST[\"userid\"];\n\t\t\t$projtitle = $_POST[\"projtitle\"];\n\t\t\t$projdesc = $_POST[\"projdesc\"];\n\t\t\t$projcat = $_POST[\"projcat\"];\n\t\t\t$projstartdate = $_POST[\"projstartdate\"];\n\t\t\t$projenddate = $_POST[\"projenddate\"];\n\t\t\t$projcreatedate = $_POST[\"projcreatedate\"];\n\t\t\t$projimagelink = $_POST[\"projimagelink\"];\n\t\t\t\n\t\t\t//calls method createProjectModel method from the model\n\t\t\t$success = $this->User_model->createProjectModel($userid, $projtitle, $projdesc, $projcat, $projstartdate, $projenddate, $projcreatedate, $projimagelink);\n\n\t\t\tif($success){\n\t\t\t\techo 'done';\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo 'error';\t\n\t\t\t}\n\t\t\t\t\t\t \n\t\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function store(Request $request)\n {\n $newProject = NewProject::create($request->all());\n return new NewProjectResource($newProject);\n }", "public function store($stub, CreateProjectRequest $request)\n\t{\n\t\t$client = $this->clients->findByStub($stub);\n $result = $this->projects->create($client, $request);\n\n if($result) {\n session()->flash('message', $request->name.' was created successfully.');\n return redirect()->back();\n } else {\n session()->flash('notify-type', 'error');\n session()->flash('message', 'This was unsuccessful, please try again.');\n return redirect()->back();\n }\n\t}", "public static function openProject($p)\n\t{\n\t\tGLOBAL $_REQ;\n\t\t$_SESSION['currentProject']= $p['pk_project'];\n\t\t$_SESSION['currentProjectName']= $p['name'];\n\t\t$_SESSION['currentProjectDir']= Mind::$projectsDir.$p['name'];\n\t\t$p['path']= Mind::$projectsDir.$p['name'];\n\t\t$p['sources']= Mind::$projectsDir.$p['name'].'/sources';\n\t\t$ini= parse_ini_file(Mind::$projectsDir.$p['name'].'/mind.ini');\n\t\t$p= array_merge($p, $ini);\n\n\t\tMind::$currentProject= $p;\n\t\tMind::$curLang= Mind::$currentProject['idiom'];\n\t\tMind::$content= '';\n\t\t\n\t\t// loading entities and relations from cache\n\t\t$path= Mind::$currentProject['path'].\"/temp/\";\n\t\t$entities= $path.\"entities~\";\n\t\t$relations= $path.\"relations~\";\n\t\t\n\t\t$pF= new DAO\\ProjectFactory(Mind::$currentProject);\n\t\tMind::$currentProject['version']= $pF->data['version'];\n\t\tMind::$currentProject['pk_version']= $pF->data['pk_version'];\n\t\t\n\t\tMind::write('projectOpened', true, $p['name']);\n\t\treturn true;\n\t}", "public function actionCreate($project_id = 0)\n {\n $model = new GlobalConfig();\n if (!empty($project_id)) {\n $model->autoCreate4Project($project_id);\n } else {\n $model->autoCreate();\n }\n\n return $this->redirect(['index', 'project_id'=> $project_id]);\n\n }", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function create()\n {\n return view('backend.projects.create');\n }", "private function add_project()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$projects = $serviceManager->get('PM/Model/Projects');\n \t$result = $projects->getProjectById($this->pk);\t\n \t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['company_id']));\n \t\t$project_url = $this->view->url('projects/view', array('company_id' => FALSE, 'project_id' => $result['id']));\n \t\t\n \t\t$this->add_breadcrumb($company_url, $result['company_name']);\n \t\t$this->add_breadcrumb($project_url, $result['name'], TRUE);\n \t}\n }" ]
[ "0.7480136", "0.7444799", "0.69330525", "0.6719678", "0.66860795", "0.6674323", "0.6603005", "0.6393632", "0.6296381", "0.62950104", "0.62842274", "0.62075984", "0.61977965", "0.61971235", "0.6184474", "0.6154632", "0.6142426", "0.6134152", "0.61284244", "0.6112629", "0.6112093", "0.6091629", "0.6081496", "0.6049618", "0.60364246", "0.60227746", "0.60067904", "0.60064644", "0.6000075", "0.5986761", "0.59793544", "0.59660554", "0.5909297", "0.5901246", "0.5894325", "0.58940923", "0.5885888", "0.5883193", "0.5877124", "0.58530587", "0.58523375", "0.5845805", "0.58361304", "0.58355534", "0.5834088", "0.583181", "0.58004916", "0.5765015", "0.5760321", "0.5751519", "0.5750552", "0.57399404", "0.5673827", "0.56642205", "0.56364137", "0.5624493", "0.5610576", "0.56057113", "0.56030685", "0.5597174", "0.5596432", "0.55922246", "0.55738837", "0.5571429", "0.55676484", "0.5563836", "0.55626893", "0.5556496", "0.55339485", "0.5518052", "0.5512681", "0.55111355", "0.55087984", "0.54992867", "0.54871136", "0.54861313", "0.5476606", "0.5474469", "0.5470669", "0.5460533", "0.5451051", "0.5450729", "0.5449505", "0.5441793", "0.54386616", "0.54321194", "0.542475", "0.5409411", "0.54074687", "0.54003614", "0.5397179", "0.5395684", "0.53928393", "0.53882706", "0.5385355", "0.53820765", "0.5378826", "0.53737015", "0.5372263", "0.53695077", "0.5367975" ]
0.0
-1
This is a helpping method to create a project using the local prj.json file.
private function createSubject() { $input = file_get_contents('subject.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "static private function createProject($name, User $leader, $overview, $client = null, $category = null, $template = null, $first_milestone_starts_on = null, $based_on = null, $label_id = null, $currency_id = null, $budget = null, $custom_field_1 = null, $custom_field_2 = null, $custom_field_3 = null) {\n $project = new Project();\n\n $project->setAttributes(array(\n 'name' => $name,\n 'slug' => Inflector::slug($name),\n 'label_id' => (isset($label_id) && $label_id) ? $label_id : 0,\n 'overview' => trim($overview) ? trim($overview) : null,\n 'company_id' => $client instanceof Company ? $client->getId() : null,\n 'category_id' => $category instanceof ProjectCategory ? $category->getId() : null,\n 'custom_field_1' => $custom_field_1,\n 'custom_field_2' => $custom_field_2,\n 'custom_field_3' => $custom_field_3,\n ));\n\n $project->setState(STATE_VISIBLE);\n $project->setLeader($leader);\n\n if($template instanceof ProjectTemplate) {\n $project->setTemplate($template);\n } // if\n\n if($based_on instanceof IProjectBasedOn) {\n $project->setBasedOn($based_on);\n } // if\n\n $project->setCurrencyId($currency_id);\n\n if(AngieApplication::isModuleLoaded('tracking') && $budget) {\n $project->setBudget($budget);\n } // if\n\n $project->setMailToProjectCode(Projects::newMailToProjectCode());\n\n $project->save();\n\n if($template instanceof ProjectTemplate && $first_milestone_starts_on instanceof DateValue) {\n ConfigOptions::setValueFor('first_milestone_starts_on', $project, $first_milestone_starts_on->toMySQL());\n } // if\n\n return $project;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function create_existing () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\tif ($selection = $dialog->select_folder(\"Choose folder\", \"Choose existing folder to create new TextMate project from.\", false, null)) {\n\t\t\t\n\t\t\t// Get the name of the existing project\n\t\t\t$project_name = basename($selection);\n\t\t\t\n\t\t\t// Get path to new project\n\t\t\t$project = \"$selection/$project_name.tmproj\";\n\t\t\t\n\t\t\t// Prevent duplicate project\n\t\t\tif (file_exists($project)) {\n\t\t\t\tdie(\"There is already an existing TextMate project at this location.\");\n\t\t\t}\n\t\t\t\n\t\t\t// Use the Empty template as our base\n\t\t\t$template = $this->standard_templates.\"/Empty\";\n\t\t\tif (file_exists($template)) {\n\t\t\t\t\n\t\t\t\t// Make Targets directory\n\t\t\t\t@mkdir(\"$selection/Targets\", 0777);\n\t\t\t\t\n\t\t\t\t// Copy default target\n\t\t\t\tcopy(\"$template/Targets/development.xml\", \"$selection/Targets/development.xml\");\n\t\t\t\t\n\t\t\t\t// Copy TextMate project file\n\t\t\t\t@copy(\"$template/project.tmproj\", $project);\n\t\t\t\t$this->replace_macros($project, array(self::MACRO_PROJECT => $project_name));\n\t\t\t\t\n\t\t\t\tprint(\"Successfully created the new project.\\n\");\n\t\t\t\t\n\t\t\t\t$this->open_project($project);\n\t\t\t} else {\n\t\t\t\tdie(\"Can't find project template to start from!\");\n\t\t\t}\n\t\t}\n\t}", "public function makeProject()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpProject());\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function actionCreate()\n {\n $model = new Project();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n OperationRecord::record($model->tableName(), $model->pj_id, $model->pj_name, OperationRecord::ACTION_ADD);\n return $this->redirect(['view', 'id' => $model->pj_id]);\n }\n\n if (Yii::$app->request->isPost) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Create project failed!'));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $shortcut = session()->get('shortcut');\n $from_api = session()->get('from_api');\n\n //\n $json = $this->jiraApi($shortcut);\n\n // Connect both arrays\n// $data = array_merge($data, $json);\n // Connect both Objects\n// $data = (object) array_merge((array) $data, (array) $json);\n //\n return view('projects.create', compact( 'json', 'from_api'));\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function create(CreateProjectRequest $request)\n {\n $newEntry = Project::create([\n 'author' => Auth::user()->username,\n 'user_id' => Auth::user()->id,\n 'title' => $request->getTitle(),\n 'description' => $request->getDescription(),\n 'body' => $request->getBody(),\n 'statement_title' => 'Mission Statement',\n 'statement_body' => 'This is where you write about your mission statement or make it whatever you want.',\n 'tab_title' => 'Welcome',\n 'tab_body' => 'Here you can write a message or maybe the status of your project for all your members to see.',\n ]);\n\n $thumbnail = $request->file('thumbnail');\n $thumbnail->move(base_path() . '/public/images/projects', 'product' . $newEntry->id . '.jpg');\n\n //Sets banner image to a random pre-made banner\n $images = glob(base_path() . \"/public/images/banners/*\");\n $imagePath = base_path() . '/public/images/projects/' . 'banner' . $newEntry->id . '.jpg';\n $rand = random_int(0, count($images) - 1);\n \\File::copy($images[$rand], $imagePath);\n\n //Add creator as a member and make admin of the project\n $newEntry->addMember(true);\n //Add creator as a follower of the project\n $newEntry->addFollower();\n\n return redirect('/project/'.$newEntry->title);\n }", "public function create_new () {\n\t\t$dialog = new CocoaDialog($this->cocoa_dialog);\n\t\t$templates = array();\n\t\t\n\t\t// Find items in standard project templates\n\t\t$contents = directory_contents($this->standard_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->standard_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Find items in user project templates\n\t\t$contents = directory_contents($this->user_templates);\n\t\tforeach ($contents as $path) {\n\t\t\tif ($path != $this->user_templates) {\n\t\t\t\t$items[] = basename($path);\n\t\t\t\t$templates[basename($path)] = $path;\n\t\t\t}\n\t\t}\n\n\t\t// Prompt to select template\n\t\tif ($selection = $dialog->standard_dropdown(\"New Project\", \"Choose a project template to start from.\", $items, false, false, false, false)) {\n\t\t\t//print($selection);\n\t\t\t\n\t\t\t// Prompt to save\n\t\t\tif ($path = $dialog->save_file(\"Save Project\", \"Choose a location to save the new project.\", null, null, null)) {\n\t\t\t\t$this->copy_template($templates[$selection], $path);\n\t\t\t}\n\t\t}\n\t}", "public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function create_project( $options ) {\n\n\t\tif ( ! isset( $options['project_name'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$defaults = array(\n\t\t\t'project_status' => 'Active',\n\t\t\t'include_jquery' => FALSE,\n\t\t\t'project_javascript' => null,\n\t\t\t'enable_force_variation' => FALSE,\n\t\t\t'exclude_disabled_experiments' => FALSE,\n\t\t\t'exclude_names' => null,\n\t\t\t'ip_anonymization' => FALSE,\n\t\t\t'ip_filter' => null,\n\t\t);\n\n\t\t$options = array_replace( $defaults, $options );\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "static function create($name, $additional = null, $instantly = true) {\n $logged_user = Authentication::getLoggedUser();\n \n $based_on = array_var($additional, 'based_on');\n $template = array_var($additional, 'template');\n \n $leader = array_var($additional, 'leader');\n if(!($leader instanceof User)) {\n $leader = $logged_user;\n } // if\n\n try {\n DB::beginWork('Creating a project @ ' . __CLASS__);\n\n // Create a new project instance\n $project = self::createProject(\n $name,\n $leader,\n array_var($additional, 'overview'),\n array_var($additional, 'company'),\n array_var($additional, 'category'),\n $template,\n array_var($additional, 'first_milestone_starts_on'),\n $based_on,\n array_var($additional, 'label_id'),\n array_var($additional, 'currency_id'),\n array_var($additional, 'budget'),\n array_var($additional, 'custom_field_1'),\n array_var($additional, 'custom_field_2'),\n array_var($additional, 'custom_field_3')\n );\n\n // Add leader and person who created a project to the project\n $project->users()->add($logged_user);\n\n if($logged_user->getId() != $leader->getId()) {\n $project->users()->add($leader);\n } // if\n\n // If project is created from a template, copy items\n if($template instanceof ProjectTemplate) {\n $positions = array_var($additional, 'positions', array());\n $template->copyItems($project, $positions);\n\n ConfigOptions::removeValuesFor($project, 'first_milestone_starts_on');\n\n // In case of a blank project, import users and master categories\n } else {\n Users::importAutoAssignIntoProject($project);\n $project->availableCategories()->importMasterCategories($logged_user);\n } // if\n\n // Close project request or quote\n if($based_on instanceof ProjectRequest) {\n $based_on->close($logged_user);\n } elseif($based_on instanceof Quote) {\n $based_on->markAsWon($logged_user);\n } // if\n\n EventsManager::trigger('on_project_created', array(&$project, &$logged_user));\n\n DB::commit('Project created @ ' . __CLASS__);\n\n return $project;\n } catch(Exception $e) {\n DB::rollback('Failed to create a project @ ' . __CLASS__);\n throw $e;\n } // try\n }", "public function store(CreateProject $request)\n {\n $project = new Project();\n $project->setAttributes($request->all());\n $project->save();\n\n return response()->json($project, $status = 201)->setStatusCode(201);\n }", "public function creator($projectId = false) {\n\n // Call builder code\n $data = $this->builder(true, $projectId);\n\n // Create controller\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/controllers/' . ucfirst($this->formName) . '.php', 'w');\n fwrite($fp, $data['phpcontroller']);\n fclose($fp);\n // Create model\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/models/' . ucfirst($this->formName) . '_model.php', 'w');\n fwrite($fp, $data['phpmodel']);\n fclose($fp);\n\n // Create view\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '.php', 'w');\n fwrite($fp, $data['htmlview']);\n fclose($fp);\n // Create success page\n $fp = fopen($this->pathCreator . '/' . $projectId . '/application/views/' . $this->formName . '_success.php', 'w');\n fwrite($fp, $this->successBuilder());\n fclose($fp);\n\n $data['myFolder'] = $this->listMyFolder($this->pathCreator . '/' . $projectId);\n echo json_encode($data);\n }", "public function run()\n {\n \t$project_owner = User::where('name', 'Owner Name')->first();\n \t$project = new Project();\n \t$project->name = 'New Project';\n \t$project->owner = $project_owner->id;\n \t$project->save();\n }", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "private function createProjectPool() {\n //TODO\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function handleCreate(Request $request) {\n\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n $project = Auth::user()->projects()->create($request->all());\n\n return response()->json($project, 201);\n }", "public function create(ProjectModel $project): void {\n\t\tFilesystemUtils::dirShouldExist($this->di_context->varPath('tmp'));\n\n\t\t$basepath = FilesystemUtils::dirpath($this->projectDir, $project->slugname());\n\t\tif (file_exists($basepath)) {\n\t\t\tthrow new RuntimeException(\"Project directory '{$basepath}' already exists\");\n\t\t}\n\n\t\t$tempnewdir = $this->di_context->varPath('tmp', $project->slugname().'_temp');\n\t\tif (file_exists($tempnewdir)) {\n\t\t\tFilesystemUtils::rrmdir($tempnewdir);\n\t\t}\n\n\t\tmkdir($tempnewdir);\n\n\t\t//create git repository folder\n\t\tmkdir($tempnewdir.\\DIRECTORY_SEPARATOR.'REPO');\n\t\t$gitRepo = $tempnewdir.\\DIRECTORY_SEPARATOR.'REPO'.\\DIRECTORY_SEPARATOR.$project->slugname().'.git';\n\n\t\t//create the main git repository\n\t\t$tempdir = $this->di_context->varPath('tmp', basename($gitRepo));\n\t\tFilesystemUtils::rrmdir($tempdir);\n\t\t$this->di_gitservice->execGit(\"init --bare {$gitRepo}\");\n\n\t\t//clone a working copy into a temporary folder\n\t\t$repo = $this->di_gitservice->clone($gitRepo);\n\t\t$repo->execGit(\"config user.name 'hgit daemon'\");\n\t\t$repo->execGit(\"config user.email 'hgitdaemon@localhost'\");\n\t\t$repo->add('.gitignore');\n\t\t$repo->commit('Create .gitignore file in master branch');\n\t\t$repo->execGit('push --set-upstream origin master');\n\n\t\t//create wiki branch\n\t\t$repo->checkout('wiki', true);\n\t\t$repo->add('readme.md', \"{$project->description}\\nDocumentation\\n\");\n\t\t$repo->commit('Create readme file in wiki branch');\n\t\t$repo->execGit('push --set-upstream origin wiki');\n\t\t$repo->checkout('master');\n\n\t\t//create developement branch\n\t\t$repo->checkout('develop', true);\n\t\t$repo->add('readme.md', \"{$project->description}\");\n\t\t$repo->commit('Create readme file in develop branch');\n\t\t$repo->execGit('push --set-upstream origin develop');\n\n\t\t//delete the temporary working directory\n\t\tFilesystemUtils::rrmdir($repo->path);\n\n\t\t//\"commit\" the newly created folder structure to the project root\n\t\trename($tempnewdir, $basepath);\n\t}", "public function createProject($project)\n {\n $data = new Project();\n $data->setName($project['name'])\n ->setDescription($project['description'])\n ->setIsArchived(0)\n ->setCreatedTime(time())\n ->setUpdatedTime(time());\n $em = $this->getDoctrine()->getManager();\n $em->persist($data);\n $em->flush();\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "public function run()\n {\n Project::truncate();\n \n factory(Project::class)->create([\n 'owner_id' => 1,\n 'client_id' => 1,\n 'name' => 'Project Test',\n 'description' => 'Lorem ipsum',\n 'progress' => rand(1, 100),\n 'status' => rand(1, 3),\n 'due_date' => '2016-06-06'\n ]);\n\n factory(Project::class, 10)->create();\n }", "function createExternalTasksProject($projectName = \"CodevTT_ExternalTasks\", $projectDesc = \"CodevTT ExternalTasks Project\") {\n // create project\n $projectid = Project::getIdFormName($projectName);\n if (false === $projectid) {\n throw new Exception(\"CodevTT external tasks project creation failed\");\n }\n if (-1 !== $projectid) {\n echo \"<script type=\\\"text/javascript\\\">console.info(\\\"INFO: CodevTT external tasks project already exists: $projectName\\\");</script>\";\n } else {\n $projectid = Project::createExternalTasksProject($projectName, $projectDesc);\n }\n return $projectid;\n}", "public function projectAction()\n {\n $projectId = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4Admin');\n\n try {\n $project = Project::fetch($projectId, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n if (!$project) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $config = $services->get('config');\n $mainlines = isset($config['projects']['mainlines']) ? (array) $config['projects']['mainlines'] : array();\n $branches = $project->getBranches('name', $mainlines);\n\n // check each path of each mainline branch to see if there's a readme.md file present\n $readme = false;\n foreach ($branches as $branch) {\n foreach ($branch['paths'] as $depotPath) {\n if (substr($depotPath, -3) == '...') {\n $filePath = substr($depotPath, 0, -3);\n }\n\n // filter is case insensitive\n $filter = Filter::create()->add(\n 'depotFile',\n $filePath . 'readme.md',\n Filter::COMPARE_EQUAL,\n Filter::CONNECTIVE_AND,\n true\n );\n $query = Query::create()->setFilter($filter);\n $query->setFilespecs($depotPath);\n\n $fileList = File::fetchAll($query);\n // there may be multiple files present, break out of the loops on the first one found\n foreach ($fileList as $file) {\n $readme = File::fetch($file->getFileSpec(), $p4Admin, true);\n break(3);\n }\n }\n }\n\n if ($readme === false) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $helpers = $services->get('ViewHelperManager');\n $purifiedMarkdown = $helpers->get('purifiedMarkdown');\n\n $maxSize = 1048576; // 1MB\n $contents = $readme->getDepotContents(\n array(\n $readme::UTF8_CONVERT => true,\n $readme::UTF8_SANITIZE => true,\n $readme::MAX_FILESIZE => $maxSize\n )\n );\n\n // baseUrl is used for locating relative images\n return new JsonModel(\n array(\n 'readme' => '<div class=\"view view-md markdown\">' . $purifiedMarkdown($contents) . '</div>',\n 'baseUrl' => '/projects/' . $projectId . '/view/' . $branch['id'] . '/'\n )\n );\n }", "public function onPostCreateProject(Event $event): void\n {\n if (self::$isGlobalCommand) {\n return;\n }\n\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n // new projects are most of the time proprietary\n $manipulator->addMainKey('license', 'proprietary');\n\n // 'name' and 'description' are only required for public packages\n $manipulator->removeProperty('name');\n $manipulator->removeProperty('description');\n\n foreach ($this->container->get('composer-extra') as $key => $value) {\n if ($key !== self::COMPOSER_EXTRA_KEY) {\n $manipulator->addSubNode('extra', $key, $value);\n }\n }\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n\n $this->updateComposerLock();\n }", "private function createProject(Database $db, User $user, string $name): Project\n {\n $project = new Project();\n $project->setOwnerId($user);\n $project->setName($name);\n $db->save($project);\n\n return $project;\n }", "public function createProject($name, $clientID, $websiteFrontURL, $websiteBackURL,$color, $tasksScheduledTime, $ticketsScheduledTime)\n {\n }", "public function projects_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n }\n \n $jutil->setExpStatus($params,$owner);\n \n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addProject($params);\n \n $this->response($result);\n }", "public static function run(): void\n {\n $projectName = Console\\Layer::readline('Enter project name: ');\n\n $env = file_get_contents(__DIR__ . '/../Res/Create/env.tpl');\n\n $env = str_replace('%project_name%', $projectName, $env);\n\n Fs\\Layer::filePutContents(__DIR__ . '/../../../../../../.env', $env);\n }", "public function store(CreateProjectRequest $request)\n {\n $project = $this->dispatchFrom(CreateProject::class, $request, [\n 'user' => $this->currentUser\n ]);\n\n return response()\n ->json($project)\n ->setStatusCode(201);\n }", "public function create($data)\n {\n $project = $this->project->create([\n 'name' => $data['name'],\n 'slug' => Arr::get($data, 'slug', slugify($data['name'])),\n 'template' => Arr::get($data, 'template.name'),\n 'uuid' => $data['uuid'] ?? Str::random(36),\n 'published' => $data['published'] ?? false,\n 'updated_at' => $data['updated_at'] ?? now(),\n ])->fresh();\n $project->users()->attach($data['userId'] ?? Auth::user()->id);\n\n $projectPath = $this->getProjectPath($project);\n\n $this->addBootstrapFiles($projectPath, $project->framework);\n\n //thumbnail\n $this->storage->put(\"$projectPath/thumbnail.png\", Storage::disk('builder')->get(TemplateLoader::DEFAULT_THUMBNAIL));\n\n //custom css\n $this->storage->put(\"$projectPath/css/code_editor_styles.css\", '');\n\n //custom js\n $this->storage->put(\"$projectPath/js/code_editor_scripts.js\", '');\n\n //custom elements css\n $this->addCustomElementCss($projectPath, '');\n\n //empty theme\n $this->applyTheme($projectPath, null);\n\n //apply template\n if ($data['template']) {\n $this->applyTemplate($data['template'], $projectPath);\n }\n\n //create pages\n if (isset($data['pages'])) {\n $this->updatePages($project, $data['pages']);\n }\n\n return $project;\n }", "public function run()\n {\n AboutProject::create([\n 'main_title' => 'Жамбыл жастарының ресурстық орталығы',\n 'main_description' => 'default',\n 'main_image' => 'modules/front/assets/img/picture_slider.png',\n 'footer_title' => 'Жастар Саясаты басқармасы',\n 'footer_image' => 'modules/front/assets/img/logo.png',\n 'footer_address' => 'Желтоқсан көшесі, 78',\n 'footer_number' => '555-556-557'\n ]);\n }", "public function actionCreate() {\n $model = new Project;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n\n $this->redirect(['document/index', 'project_id' => $model->id]);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create(Request $request) {\n $this->validate($request, [\n 'user_id' => 'required|integer',\n 'name' => 'required|string',\n 'description' => 'required|string'\n ]);\n\n $project = new Project();\n if($request->input('p_id') != '') {\n $project->p_id = $request->input('p_id');\n } else {\n $project->p_id = Uuid::uuid();\n }\n $project->user_id = $request->input('user_id');\n $project->name = $request->input('name');\n $project->description = $request->input('description');\n\n return response()->success($project->save());\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->input = $input;\n $this->output = $output;\n\n // Define the new project's metadata\n $this->project = new Project();\n $this->project->setConfig($this->config);\n $this->project->setName($input->getArgument('name'));\n $this->project->generateProperties();\n $this->project->setDirectory(getcwd() . '/' . $this->project->getName(true));\n $this->project->setDescription($input->getOption('description'));\n\n // Check if directory already exists\n if (file_exists($this->project->getDirectory())) {\n throw new \\RuntimeException('Directory \"' . $this->project->getDirectory() . '\" already exists!');\n }\n\n // Validate framework\n $frameworkName = $input->getOption('framework');\n\n if ($frameworkName) {\n $frameworkName = strtolower($frameworkName);\n\n foreach (Framework::availableFrameworks() as $framework) {\n if (in_array($frameworkName, $framework->getShortcuts())) {\n $this->project->setFramework($framework);\n break;\n }\n }\n\n if ($this->project->getFramework() === FALSE) {\n throw new \\InvalidArgumentException('Invalid framework ' . $frameworkName . ', valid frameworks are: ' . implode(' ', Framework::validFrameworkShortcuts()));\n }\n }\n\n // Perform project creation actions\n $output->writeln('Creating new project in ' . $this->project->getDirectory());\n\n // Only create repository if skip-repository flag hasn't been set\n if (!$input->getOption('skip-repository')) {\n $this->createRepository();\n }\n\n $this->initializeProjectDirectory();\n\n // Install framework if needed\n if ($this->project->getFramework() !== FALSE) {\n $this->output->writeln('Installing ' . $this->project->getFramework()->getName(false) . '...');\n\n $o = $this->output;\n $this->project->getFramework()->install($this->project, function ($message) use ($o) {\n $o->write($message);\n });\n $this->project->getFramework()->configureEnvironment('dev', $this->project);\n\n // Push this change to the git remote\n $this->output->write(\"\\t\" . 'Pushing changes to git remote.');\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git add -A .',\n 'git commit -m \"Added '. $this->project->getFramework()->getName(false) .'\"'\n );\n\n if (!$input->getOption('skip-repository')) {\n $commands[] = 'git push origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n $this->output->write('.');\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n $this->output->writeln('<info>OK</info>');\n } else {\n // Just create the public directory\n mkdir($this->project->getDirectory() . '/public');\n }\n\n // Output final project information\n $this->showProjectInfo();\n }", "public function createProject(CreateProjectRequest $request)\n {\n $project = (new ProjectService())->create(\n $request->title,\n $request->url,\n $request->folder,\n $request->active == 'true' ? true : false,\n $request->secureUrl == 'true' ? true : false,\n $request->asset ?? null\n );\n\n return redirect()->to(route('dashboard'));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function run()\n {\n \n $project = Project::create([\n 'project_code' => '10001',\n 'name' => 'Head Office',\n 'short_name' => 'HQ',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10002',\n 'name' => 'Depot',\n 'short_name' => 'DEPOT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10003',\n 'name' => 'Safty',\n 'short_name' => 'SAFTY',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10004',\n 'name' => 'IT',\n 'short_name' => 'IT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11016',\n 'name' => 'Amber',\n 'short_name' => 'AMBER',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11023',\n 'name' => 'Niche Mono Borom Sales Office',\n 'short_name' => 'MONO',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n }", "public function actionCreate() {\n\n $model = new Project;\n // Only users who are approved members of an approved commmunity partner\n // can create projects\n\n $result = Involved::model()->approved()->with('communityPartner:approved')->findAll();\n if(!empty($result)) {\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n echo CJSON::encode(array('status' => 't',\n 'response' => $this->renderPartial('/project/continueCreating',\n array('projectOID' => $model->id), true)));\n Yii::app()->end();\n } else {\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n Yii::app()->end();\n }\n }\n } else {\n $model->addError('user_fk','You must be an approved member of an approved community partner\n before creating projects.');\n echo CJSON::encode(array('status' => 'f', 'response' => CHtml::errorSummary($model)));\n }\n }", "public function store( ProjectCreateRequest $request ) {\n $project = new Project();\n $project->code = $request->code;\n $project->name = $request->name;\n $project->description = $request->description;\n\n $project->save();\n\n return $this->response->array( [ 'message' => trans( 'frontend.save' ) ] )->setStatusCode( Response::HTTP_CREATED );\n }", "private function createPedestalBasedSite()\n {\n $process = new Process('composer create-project -s dev versionpress/pedestal .', $this->siteConfig->path);\n $process->run();\n\n $this->updateConfigConstant('DB_NAME', $this->siteConfig->dbName);\n $this->updateConfigConstant('DB_USER', $this->siteConfig->dbUser);\n $this->updateConfigConstant('DB_PASSWORD', $this->siteConfig->dbPassword);\n $this->updateConfigConstant('DB_HOST', $this->siteConfig->dbHost);\n $this->updateConfigConstant('WP_HOME', $this->siteConfig->url);\n }", "protected function createProject($name)\n\t{\n\t\t$table = new USVN_Db_Table_Projects();\n\t\ttry {\n\t\t\t$obj = $table->fetchNew();\n\t\t\t$obj->setFromArray(array('projects_name' => $name));\n\t\t\t$obj->save();\n\t\t\treturn $obj;\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$this->fail($name . \" : \" . $e->getMessage());\n\t\t}\n\t}", "public function create()\n {\n $stores = $this->project->getStores();\n $statistics = $this->project->getStatistics();\n $licensors = $this->project->getLicensors();\n $categories = $this->project->getAllCategories();\n $skills = $this->project->getAllSkills();\n $services = $this->project->getAllServices();\n $canDo = auth()->user()->role->canDoAll();\n $sub_categories = $this->project->getAllSubCategories();\n\n return view('pages.projects.create', compact('canDo', \n 'sub_categories', 'services', 'stores', \n 'categories', 'statistics', \n 'licensors', 'skills'));\n }", "public function store(StoreProjectRequest $request)\n {\n try{\n // Create project with properties filtered by StoreProjectRequest\n $project = Project::create($request->all());\n\n return response(new ProjectResource($project));\n } catch(Exception $e) {\n return $this->errorResponse($e);\n }\n }", "public function createProject(){\n\t\tif(!Auth::check())\n\t\t\treturn Redirect::to('/');\n\n\t\treturn View::make('projects.create');\n\t}", "public function create()\n {\n return view('backend.project.create');\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function create()\n {\n return view('create_project');\n }", "public function createAction()\n {\n $entity = new Project();\n $request = $this->getRequest();\n $form = $this->createForm(new ProjectType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $securityContext = $this->get('security.context');\n $user = $securityContext->getToken()->getUser();\n $entity->setOwner($user);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n // creating the ACL\n $aclProvider = $this->get('security.acl.provider');\n $objectIdentity = ObjectIdentity::fromDomainObject($entity);\n $acl = $aclProvider->createAcl($objectIdentity);\n\n // retrieving the security identity of the currently logged-in user\n $securityIdentity = UserSecurityIdentity::fromAccount($user);\n\n // grant owner access\n $acl->insertObjectAce($securityIdentity, MaskBuilder::MASK_OWNER);\n $aclProvider->updateAcl($acl);\n\n return $this->redirect($this->generateUrl('project_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('SitronnierSmBoxBundle:Project:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n\t{\n\t\t$this->authorize('create', Project::class);\n\t\t/*--get all representatives--*/\n\t\t$project_managers=User::where('role','Like','PROJECT_MANAGER')->get();\n\t\t// get all clients\n\t\t$clients=Client::all();\n\t\treturn view('projects.create',compact('project_managers','clients'));\n\t}", "public function create()\n {\n\n return view('backend.project.create');\n }", "public function create()\n {\n $this->authorize('projects.create');\n $description = \"- What does the project do?\\n- Project Objectives,...\";\n $roles = $this->roleRepository->getByCompanyId($this->user->company_id);\n $users = $this->userRepository->getStaffInCompany($this->user->company_id);\n\n return view('projects.create', compact('description', 'roles', 'users'));\n }", "public function create()\n {\n $project = new Project;\n\n return view('projects.create', compact('project'))\n ->with([\n 'pap_types' => RefPapType::all(),\n ]);\n }", "private function initializeProjectDirectory()\n {\n $this->output->write('Adding initial files... ');\n\n // Create directory\n if (!@mkdir($this->project->getDirectory())) {\n $message = 'Error: Could not create directory';\n $this->output->writeln('<error>' . $message . '</error>');\n throw new \\RuntimeException($message);\n }\n\n // Add template files\n $templateHandler = new TemplateHandler();\n $templateHandler->setProject($this->project);\n\n $templateHandler->writeTemplate('README.md');\n $templateHandler->writeTemplate('gitignore');\n $templateHandler->writeTemplate('Vagrantfile');\n\n // Add Dirtfile\n $this->project->save();\n\n // Initialize git for working directory\n $process = new Process(null, $this->project->getDirectory());\n $process->setTimeout(3600);\n\n $commands = array(\n 'git init',\n 'git add -A .',\n 'git commit -m \"Initial commit, added README, gitignore, Dirtfile and Vagrantfile\"'\n );\n\n if (!$this->input->getOption('skip-repository')) {\n $commands[] = 'git remote add origin ' . $this->project->getRepositoryUrl();\n $commands[] = 'git push -u origin master';\n }\n\n foreach ($commands as $command) {\n $process->setCommandLine($command);\n $process->run();\n if (!$process->isSuccessful()) {\n $message = 'Error: Could not run \"'. $command .'\", git returned: ' . $process->getErrorOutput();\n $this->output->writeln('<error>'. $message . '</error>');\n throw new \\RuntimeException($message);\n }\n }\n\n $this->output->writeln('<info>OK</info>');\n }", "function createProject() {\n $dbConnection = mysqli_connect(Config::HOST, Config::UNAME,\n Config::PASSWORD, Config::DB_NAME) or die('Unable to connect to DB.');\n\n //Taking the values and inserting it into the user table\n $sqlQuery = \"INSERT INTO PROJECT VALUES ('$this->id','$this->title','$this->description','$this->year','$this->category',\n '$this->picture','$this->sid')\";\n\n if(mysqli_query($dbConnection,$sqlQuery)){\n echo \"Project created successfully\";\n }\n\n else {\n echo \"Project not added! \" . mysqli_error($dbConnection);\n }\n mysqli_close($dbConnection);\n }", "public function create()\n {\n $this->authorize('create', Project::class);\n\n $activeYear = BudgetYear::active()->first();\n\n if(is_null($activeYear))\n abort(497, 'Unathorized Action. There is no active Budget Year set.');\n\n return view(\"create_project\", compact('activeYear'));\n }", "public function create()\n {\n return view('admin.project.create', $this->projectRepositoryInterface->createProject());\n }", "public function create()\n {\n $categories = Category::all();\n $tracing = Tracing::all();\n return view('projects.create')->with('categories', $categories)\n ->with('tracings', $tracing);\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function creating(Project $project)\n {\n if(!$project){\n return back()->withInput()->with('errors', 'Error creating new Project');\n }\n }", "public function create()\n {\n try {\n $this->authorize('create', Project::class);\n } catch (AuthorizationException $e) {\n Flash::error($e->getMessage());\n return redirect()->back();\n }\n return view('projects.create');\n }", "public function store()\n {\n if (!$this->isValid()) {\n return Response::error();\n }\n\n $project = new Project;\n $project->company_id = Input::get('company_id');\n $project->user_id = Auth::user()->id;\n $project->name = Input::get('name');\n $project->description = Input::get('description');\n $project->save();\n\n Log::info('Successfully created project !');\n return Response::string(\n [\n 'messages' => ['Successfully created project ' . print_r($project->toArray(), true) . ' !'],\n 'data' => $project->toArray()\n ]\n );\n }", "public function create()\n {\n\t\t$programs = Program::active()->select('id', 'title')->latest()->get();\n return view('projects.create', compact('programs'));\n }", "public function create()\n {\n return view('contractor.projects.create');\n }", "public function run()\n {\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 2\n ]);\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 3\n ]);\n }", "public function create() // метод для создания\n {\n\n return view('project.create',\n [\n \"tasks\" => $this->tasks->all()\n ]\n );\n }", "public function store()\n\t{\n\t\tLog::debug('Innuti proj store!');\n\n\t\tif(!Auth::check())\n\t\t{\n\t\t\treturn Response::json(null, 401);\n\t\t}\n\t\t\n\t\t$inputArray = array (\n\t\t\t'title' => Input::get('title'),\n\t\t\t'company_name' => Input::get('company_name'),\n\t\t\t'description' => Input::get('description'),\n\t\t\t'vacation_weeks' => Input::get('vacation_weeks'),\n\t\t\t'area' => Input::get('area'),\n\t\t\t'user_id' => Auth::user()->id,\n\t\t\t);\n\t\t\t\n\n\t\tLog::debug('inputarray: ' . json_encode($inputArray));\n\n\t\t$validator = Validator::make($inputArray, Project::$rules);\n\n\t\t$wronglyFormattedParametersCode = 400;\n\t\t$bookNotFoundCode = 401;\n\t\t$successCode = 200;\n\t\t$statusCode = $bookNotFoundCode;\n\n\n\t\t$newProject = null;\n // Check if the form validates with success.\n\t\tif ($validator->passes())\n\t\t{\n\t\t\tLog::debug('validation passed');\n\t\t\t$statusCode = $successCode;\n\t\t\t$newProject = Project::create($inputArray);\n\t\t\t$newProject->user()->associate(Auth::user());\n\n\t\t\t$newProject->fillUpWithEnergyTypes();\n\t\t\t\n\t\t\t$newProject->save();\n\t\t} else\n\t\t{\n\t\t\tLog::debug('validation passed NOTNOTNOT');\n\t\t\t$statusCode = $wronglyFormattedParametersCode;\n\t\t}\n\n\t\tLog::debug('Just before response!');\n\t\treturn Response::json($newProject, $statusCode);\n\t}", "public function actionCreate()\n {\n $model = new Requirement();\n\n $defaultProjectId = UserOption::getOption(UserOption::NAME_ACTIVE_PROJECT);\n if ($defaultProjectId) {\n $model->projectId = $defaultProjectId;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('projects.create');\n\t}", "public function create()\n {\n $invoices = Invoice::all();\n $project_statuses = ProjectStatus::all();\n return view('backend.project.create', compact('invoices','project_statuses'));\n }", "public function run()\n {\n $faker = Faker::create();\n // Create Project\n foreach (range(1, 10) as $i) {\n Project::create([\n 'name' => $faker->name,\n 'manager' => $i\n ]);\n }\n }", "public function newProject($source , $target , $content , $word_count=0 , $notes='' , $callback_url='', $params=array()){\n\t\t$url = '/project/new/';\n\t\t$method = 'post';\n\t\t$params['source'] = $source;\n\t\t$params['target'] = $target;\n\t\t$params['content'] = $content;\n\t\t$params['word_count'] = $word_count;\n\t\t$params['notes'] = $notes;\n\t\t$params['callback_url'] = $callback_url;\n\t\t\n\t\treturn $this->request($url , $method , $params);\n\t\t\n\t}", "public function store(ProjectRequest $request): Project\n {\n return Project::create($request->validated());\n }", "public function create()\n {\n $project= new Project();\n $languages = Language::get();\n return view('project.create',compact(['project','languages']));\n }", "public function create($project_id)\n {\n //Get the project associated with that work item\n $project = Project::where('id', '=', $project_id)->first();\n\n\n // Load the view with create new work item form while passing the project variable\n return view('workitems.create-new-work-item', ['project' => $project]);\n }", "public function create()\n {\n return view('project.create');\n }", "public function createProject($name, $providerId, $region, $usesVanityDomain)\n {\n return $this->requestWithErrorHandling('post', '/api/teams/'.Helpers::config('team').'/projects', array_filter([\n 'cloud_provider_id' => $providerId,\n 'name' => $name,\n 'region' => $region,\n 'uses_vanity_domain' => $usesVanityDomain,\n ]));\n }", "public function create()\n {\n return view('admin.project.create');\n }", "function createProjectController(){\n\t\t\t//loads user model\n\t\t\t$this->load->model('User_model');\n\t\t\t\n\t\t\t//get posted values\n\t\t\t$userid = $_POST[\"userid\"];\n\t\t\t$projtitle = $_POST[\"projtitle\"];\n\t\t\t$projdesc = $_POST[\"projdesc\"];\n\t\t\t$projcat = $_POST[\"projcat\"];\n\t\t\t$projstartdate = $_POST[\"projstartdate\"];\n\t\t\t$projenddate = $_POST[\"projenddate\"];\n\t\t\t$projcreatedate = $_POST[\"projcreatedate\"];\n\t\t\t$projimagelink = $_POST[\"projimagelink\"];\n\t\t\t\n\t\t\t//calls method createProjectModel method from the model\n\t\t\t$success = $this->User_model->createProjectModel($userid, $projtitle, $projdesc, $projcat, $projstartdate, $projenddate, $projcreatedate, $projimagelink);\n\n\t\t\tif($success){\n\t\t\t\techo 'done';\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo 'error';\t\n\t\t\t}\n\t\t\t\t\t\t \n\t\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function store(Request $request)\n {\n $newProject = NewProject::create($request->all());\n return new NewProjectResource($newProject);\n }", "public function store($stub, CreateProjectRequest $request)\n\t{\n\t\t$client = $this->clients->findByStub($stub);\n $result = $this->projects->create($client, $request);\n\n if($result) {\n session()->flash('message', $request->name.' was created successfully.');\n return redirect()->back();\n } else {\n session()->flash('notify-type', 'error');\n session()->flash('message', 'This was unsuccessful, please try again.');\n return redirect()->back();\n }\n\t}", "public static function openProject($p)\n\t{\n\t\tGLOBAL $_REQ;\n\t\t$_SESSION['currentProject']= $p['pk_project'];\n\t\t$_SESSION['currentProjectName']= $p['name'];\n\t\t$_SESSION['currentProjectDir']= Mind::$projectsDir.$p['name'];\n\t\t$p['path']= Mind::$projectsDir.$p['name'];\n\t\t$p['sources']= Mind::$projectsDir.$p['name'].'/sources';\n\t\t$ini= parse_ini_file(Mind::$projectsDir.$p['name'].'/mind.ini');\n\t\t$p= array_merge($p, $ini);\n\n\t\tMind::$currentProject= $p;\n\t\tMind::$curLang= Mind::$currentProject['idiom'];\n\t\tMind::$content= '';\n\t\t\n\t\t// loading entities and relations from cache\n\t\t$path= Mind::$currentProject['path'].\"/temp/\";\n\t\t$entities= $path.\"entities~\";\n\t\t$relations= $path.\"relations~\";\n\t\t\n\t\t$pF= new DAO\\ProjectFactory(Mind::$currentProject);\n\t\tMind::$currentProject['version']= $pF->data['version'];\n\t\tMind::$currentProject['pk_version']= $pF->data['pk_version'];\n\t\t\n\t\tMind::write('projectOpened', true, $p['name']);\n\t\treturn true;\n\t}", "public function actionCreate($project_id = 0)\n {\n $model = new GlobalConfig();\n if (!empty($project_id)) {\n $model->autoCreate4Project($project_id);\n } else {\n $model->autoCreate();\n }\n\n return $this->redirect(['index', 'project_id'=> $project_id]);\n\n }", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function create()\n {\n return view('backend.projects.create');\n }", "private function add_project()\n {\n \t$helperPluginManager = $this->getServiceLocator();\n \t$serviceManager = $helperPluginManager->getServiceLocator();\n \t$projects = $serviceManager->get('PM/Model/Projects');\n \t$result = $projects->getProjectById($this->pk);\t\n \t\n \tif($result)\n \t{\n \t\t$company_url = $this->view->url('companies/view', array('company_id' => $result['company_id']));\n \t\t$project_url = $this->view->url('projects/view', array('company_id' => FALSE, 'project_id' => $result['id']));\n \t\t\n \t\t$this->add_breadcrumb($company_url, $result['company_name']);\n \t\t$this->add_breadcrumb($project_url, $result['name'], TRUE);\n \t}\n }" ]
[ "0.7480818", "0.7445576", "0.6934724", "0.67210686", "0.6687263", "0.66763437", "0.6605326", "0.63961655", "0.6297125", "0.62966764", "0.62862456", "0.62097937", "0.61995834", "0.61984736", "0.61832297", "0.6156746", "0.61425966", "0.61358184", "0.61296934", "0.6113899", "0.61136556", "0.60935307", "0.6083375", "0.6050869", "0.6037397", "0.60233706", "0.6008368", "0.6008292", "0.60011345", "0.5988444", "0.5981486", "0.59664685", "0.5911284", "0.590324", "0.58966976", "0.58957213", "0.5888308", "0.5884227", "0.5878999", "0.58540875", "0.58536", "0.58469623", "0.5837161", "0.58371145", "0.5834978", "0.58328664", "0.5801852", "0.5765637", "0.57609314", "0.57526773", "0.57521206", "0.57417864", "0.56758785", "0.5665985", "0.56382483", "0.5626148", "0.56119394", "0.5606841", "0.56052566", "0.55979085", "0.55978745", "0.5593847", "0.5575885", "0.55730975", "0.5569042", "0.5565555", "0.556414", "0.5557827", "0.553602", "0.5519865", "0.5514186", "0.5512222", "0.55104", "0.55014634", "0.5488797", "0.5487638", "0.5478038", "0.54759264", "0.5472004", "0.5462198", "0.5452174", "0.545122", "0.5450908", "0.54429597", "0.54399174", "0.5432826", "0.54255265", "0.54111916", "0.54082555", "0.54018325", "0.53975815", "0.53971297", "0.5393952", "0.53898436", "0.53852785", "0.5383512", "0.5380056", "0.5374909", "0.5371915", "0.5370831", "0.5370555" ]
0.0
-1
This is a helpping method to create a document using the local prj.json file.
private function createDocument() { $input = file_get_contents('doc.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); $result = json_decode($response); $id = $result->_id; return $id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateDocument()\n {\n echo \"\\nTesting document creation...\";\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "private function createDocument() {\n $this->createObjectProperties();\n $this->createRelationships();\n $this->createIngestFileDatastreams();\n $this->createPolicy();\n $this->createDocumentDatastream();\n $this->createDublinCoreDatastream();\n $this->createCollectionPolicy();\n $this->createWorkflowStream();\n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "function xh_createDocument()\r\n\t{\r\n\t}", "function ax_create_document() {\n\t$root = ax_indirect_dictionary('Root');\n\t$root['Pages'] = ax_indirect_dictionary('Pages');\n\t$info = ax_indirect_dictionary();\n\t$info['Creator'] = AX_ACROSTIX_CREATOR_STRING;\n\t$info['CreationDate'] = ax_date(time());\n\t$trailer = array();\n\t$trailer['Root'] =& $root;\n\t$trailer['Info'] =& $info;\t\n\t\n\t$doc_obj = new AxDocument;\n\t$doc_obj->pages = array();\n\t$doc_obj->info =& $info;\n\t$doc_obj->PDFStructure = $trailer;\t\n\treturn $doc_obj;\n}", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function storeDocument($file);", "public function create($document){\n $doc = new CouchDocument($this, $document);\n $doc->create();\n return $doc;\n \n }", "public function createPackageFile()\n\t{\n\t\t$packageFilePath = __DIR__ . \"/templates/packagefile.txt\";\n\n\t\t// If file exists, copy content into new file called package.json in project root.\n\t\tif($this->filesystem->exists($packageFilePath))\n\t\t{\n\t\t\t$this->filesystem->put('package.json', $this->filesystem->get($packageFilePath));\n\t\t}\n\t}", "public function createDocument(array $data);", "public function doc_gen_and_storage($documentid, $template_data, $doc_prefix, $doc_postfix, $customer_id, $KT_location, $direct, $pdf = FALSE, $claim_id=NULL)\n\t{\n\t\t// Set file name formats\n\t\t$pre_extension_file_name = $doc_prefix.$doc_postfix;\n\t\t$final_pdf = $pre_extension_file_name.'.pdf';\n\t\t$final_docx = $pre_extension_file_name.'.docx';\n\n\t\t$path = self::get_destination_path();\n\n\t\t// Acquire the settings for KT login and API URL\n\t\tLog::instance(Log::NOTICE, \"Dummy Connect to Knowledgetree.\");\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\n\t\ttry\n\t\t{\n\t\t\t// Create KT connection\n\t\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\n\t\t}\n\t\tLog::instance(Log::NOTICE, \"Connected.\");\n\n\t\t// Generate Document - Load template from KT\n\n\t\t$template_location = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_template_path\");\n\t\tif (!file_exists($template_location)) {\n\t\t\tmkdir($template_location, 0777, true);\n\t\t}\n\t\t$temporary_folder = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_temporary_path\");\n\t\tif (!file_exists($temporary_folder)) {\n\t\t\tmkdir($temporary_folder, 0777, true);\n\t\t}\n\n\t\t$doc_config = Kohana::$config->load('config')->get('doc_config');\n\t\t$script_location = $template_location.$doc_config['script'];\n\n\t\tLog::instance(Log::NOTICE, \"Download document to folder.\");\n\t\ttry\n\t\t{\n\t\t\t$template_file = $kt_connection->downloadDocumentToFolder($documentid, $template_location);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t}\n\n\t\tLog::instance(Log::NOTICE, \"Document downloaded.\");\n\t\tLog::instance(Log::NOTICE, \"Create .doc file.\");\n // Create document generator object - provide document generation base\n\t\t$docx = New Docgenerator($template_location, $script_location, $temporary_folder);\n $docx->add_template($template_file);\n $docx->initalise_document_template($template_data);\n $feedback = $docx->create($pre_extension_file_name);\n\n\n if ($feedback === TRUE)\n\t\t{\n\t\t\tself::set_activity($documentid, 'generate-docx');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, 'Error doc generation');\n\t\t}\n\n\t\tif ($pdf)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Generate the PDF\n\t\t\t\t$input_file = $template_location.$final_docx;\n\t\t\t\t$output_file = $template_location.$final_pdf;\n\n\t\t\t\tif (Settings::instance()->get(\"word2pdf_active\") == 1)\n\t\t\t\t{\n\n\t\t\t\t\t// convert DOCX to PDF\n\t\t\t\t\tself::doc_convert_to_pdf($input_file, $output_file);\n\n\t\t\t\t\t// save pdf to files?\n\t\t\t\t\t$pdf_save = Settings::instance()->get(\"word2pdf_savepdf\");\n\n\t\t\t\t\tif (($pdf_save == 1) AND ($direct == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t\t\t$kt_connection->addDocument($final_pdf, $template_location.$final_pdf, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n if($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tLog::instance()->add(Log::ERROR, 'PDF is not enabled in your APP Settings');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tif ($this->external_error_handing)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception($e);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// was direct option selected to download to desktop?\n\t\tif ($direct == 0)\n\t\t{\n\t\t\t// save docx to files?\n\t\t\t$save_docx = Settings::instance()->get(\"doc_save\");\n\t\t\tif (($save_docx == 1) AND ($direct == 0))\n\t\t\t{\n\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t$kt_connection->addDocument($final_docx, $template_location.$final_docx, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n\t\t\t\tif($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\n\n\t\t\t}\n\n\t\t}\n\t\telse //direct download was chosen\n\t\t{\n\t\t\t$this->generated_documents['file'] = $final_docx;\n\t\t\t$this->generated_documents['url_docx'] = $template_location.$final_docx;\n\t\t\t$this->generated_documents['url_pdf'] = $template_location.$final_pdf;\n\t\t}\n\n\t\t// ***** SEND EMAIL IF MAIL IS SET *****/\n\t\tforeach ($this->mails as $mail)\n\t\t{\n\n\t\t\t$attached_doc[0] = $template_location.$final_pdf;\n\t\t\t$this->multi_attach_mail($mail['to'], $attached_doc, $mail['sender'], $mail['subject'], $mail['message']);\n\t\t}\n\n\t\t// ***** CLEAN UP PROCESS **** //\n\t\tLog::instance(Log::NOTICE, \"Deleting temporary files.\");\n\t\tsystem('rm '.$docx->temporary_folder.$template_file);\n\n\t\t//if we dont want to download cleanup otherwise leave for controller to pickup to download\n\t\tif ($direct == 0)\n\t\t{\n\t\t\tsystem('rm '.$template_location.$final_docx);\n\t\t\tsystem('rm '.$template_location.$final_pdf);\n\t\t}\n\n\t}", "public function documents_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n $jutil->setStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addDocument($doc);\n \n $this->response($result);\n \n }", "public function testCreateDocument()\n {\n }", "public function make_json_file()\n\t{\n\t\t$json_file = fopen('recipes.json', 'w');\n\t\tfwrite($json_file, $this->json_result);\n\t\tfclose($json_file);\t\n\t}", "protected function createFile() {}", "public function create(Model\\Document\\Document $document): void\n {\n $path = $this->type.'/nuovo';\n $response = $this->client->request('POST', $path, $document);\n\n $result = Json::decode((string) $response->getBody(), true);\n (\\Closure::bind(function ($id, $token, $client): void {\n $this->id = $id;\n $this->token = $token;\n $this->client = $client;\n }, $document, Model\\Document\\Document::class))($result['new_id'], $result['token'], $this->client);\n }", "public function createDocumentFromFile($filePath, $fileName) {\n $documentModel = new CreateDocumentPropertyWithFilesModel();\n $documentModel->setBilingualFileImportSettings($this->getFileImportSettings());\n $documentModel->attachFile($filePath, $fileName);\n return $documentModel;\n }", "public static function create(\\SetaPDF_Core_Document $document, \\SetaPDF_Core_Reader_ReaderInterface $reader) {}", "public static function create(\\SetaPDF_Core_Document $document, $titleOrConfig, $config = [/** value is missing */]) {}", "public function createDocu() {\n $data = Input::all();\n if ($data[\"path\"] == \"\") {\n $validator = Validator::make($data, ['name' => 'required|max:255']);\n } else {\n $validator = Validator::make($data, ['name' => 'required|max:255', 'path' => 'required|max:255|unique:documents',]);\n }\n if ($validator->fails()) {\n return redirect('/document/new/')->withErrors($validator)->withInput();\n }\n\n $data[\"path\"] = \"/var/www/sphinx/\" . count(document::all()) . \"_\" . $data[\"name\"];\n\n $document = new document;\n\n $document->name = $data[\"name\"];\n $document->path = $data[\"path\"];\n $document->layout = $data[\"layout\"];\n $document->user_id = \\Auth::user()->id;\n $document->save();\n\n $this->createSphinxDoc($document->path, $document->name, \\Auth::user()->username);\n $this->changeRechte();\n $this->changeValueInConf(\"default\", $document->layout, $document->path);\n $this->changeValueInConf(\"#language = None\", \"language =\\\"de\\\"\", $document->path);\n $this->makeHTML($document->path);\n\n $this->addNewNews($document->id, 0, 1, \"Neues Dokument angelegt mit dem namen\" . $document->name);\n return redirect('/document/private/' . $document->id);\n }", "public function makePdf(){\n\t\t$content = $_POST['data'];\n\t\t$id = $_POST['articleId'];\n\t\t\n\t\t$rootAndFile = $this->getRootArticleName($id);\n\t\t$fileName = $rootAndFile['fileName'];\n\t\t$root = $rootAndFile['root'];\n\t\t$path = $root.\"/pdfDirectory/articlePdf\";\n\t\t\n\t\t$iscreated = createPdf($path, $fileName, $content);\n\t\tif($iscreated === true ){\n\t\t\tif($this->read_model->updatePdfExist($id, $data = array(\"havePdfVersion\" => true)) == 1)\n\t\t\t\techo json_encode(array(\"msg\" => \"success\", \n\t\t\t\t\t\"path\" => $this->articlePdfPathRelative.\"/\".$fileName.\".pdf\"));\n\t\t\telse json_encode(array(\"msg\" => \"fail\", \"error\" => \"Not updated in database\"));\n\t\t}\n\t\telse echo json_encode(array(\"msg\" => \"fail\", \"error\" => $iscreated));\n\t\t\n\t}", "protected function createResource()\n {\n $resourceOptions = [\n 'resource' => $this->info['resource'],\n '--module' => $this->moduleName,\n ];\n\n $options = $this->setOptions([\n 'parent',\n 'assets'=>'uploads',\n 'data'\n ]);\n\n $this->call('engez:resource', array_merge($resourceOptions, $options));\n }", "public function store(CreateRequest $request)\n {\n $file = $request->file('file');\n $name = $file->getClientOriginalName();\n \\Storage::disk('local')->put($name, \\File::get($file));\n $request = $request->all();\n $request['file'] = $name;\n $document = $this->document->create($request);\n $document->documentTypes()->sync($request['documentType']);\n Session::flash('message-success',' Document '. $name.' '.trans('messages.created'));\n\n }", "public function run() {\n factory(Document::class, 10)->create();\n }", "function insertJSONDocument($dbName, $collectionName, $json) {\n\n Util::throwExceptionIfNullOrBlank($dbName, \"DataBase Name\");\n Util::throwExceptionIfNullOrBlank($collectionName, \"Collection Name\");\n Util::throwExceptionIfNullOrBlank($json, \"JSON\");\n $encodedDbName = Util::encodeParams($dbName);\n $encodedCollectionName = Util::encodeParams($collectionName);\n\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n $body = '{\"app42\":{\"storage\":{\"jsonDoc\":' . $json . '}}}';\n // App42Log::debug($body);\n $signParams['body'] = $body;\n $signParams['dbName'] = $dbName;\n $signParams['collectionName'] = $collectionName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/insert\" . \"/dbName\" . \"/\" . $encodedDbName . \"/collectionName\" . \"/\" . $encodedCollectionName;\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n\n $storageResponseObj = new StorageResponseBuilder();\n $storageObj = $storageResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $storageObj;\n }", "public function actionCreate() {\n $model = new Project;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Project'])) {\n $model->attributes = $_POST['Project'];\n if ($model->save()) {\n\n $this->redirect(['document/index', 'project_id' => $model->id]);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function auto_create(){\n\n if ( $this->firebug ) \\FB::info(get_called_class().\": auto creating file\");\n\n $root = $this->use_codeza_root ? (string)new Code_Alchemy_Root_Path() : '';\n\n $filename = $root . $this->template_file;\n\n if ( file_exists($filename) && ! file_exists($this->file_path)) {\n\n $copier = new Smart_File_Copier($filename,$this->file_path,$this->string_replacements,false);\n\n $copier->copy();\n\n }\n\n\n\n }", "protected function createResource()\n {\n $this->call('make:resource', array_filter([\n 'name' => $this->getNameInput().'Resource',\n ]));\n }", "abstract protected function createResource();", "public function testInboundDocumentCreateDocument()\n {\n }", "public function createDocument()\r\n {\r\n return new Document($this);\r\n }", "public function makeRepoDocument( $sType, $sFilename, &$sText, $sRealPath, $vTimestamp ) {\n\t\treturn $this->oMainControl->makeDocument( 'external', $sType, $sFilename, $sText, -1, 998, $sRealPath, $sRealPath, $vTimestamp );\n\t}", "private function constructFilePath()\r\n {\r\n $this->filePath = MENU_PATH . \"/\" . $this->nameOfJson . \".json\";\r\n }", "private function generatePluginJsonFile()\n {\n $path = $this->pluginRepository->getPluginPath($this->getName()).'plugin.json';\n\n if (! $this->filesystem->isDirectory($dir = dirname($path))) {\n $this->filesystem->makeDirectory($dir, 0775, true);\n }\n\n $this->filesystem->put($path, $this->getStubContents('json'));\n\n $this->console->info(\"Created : {$path}\");\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function create_from_file($file);", "public function generate(DocumentInterface $document);", "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "function saveNewReviews($newJSON) {\n // Wrap up the php object to JSON\n $newJSON = json_encode($newJSON, JSON_UNESCAPED_SLASHES);\n // Try opening the file\n $fp = fopen('reviews.json', 'w');\n if ( ($fp === false) || (fwrite($fp, $newJSON) === FALSE) ) {\n // File either didn't open or write successfully\n return FALSE;\n } else {\n // All good!\n return TRUE;\n }\n}", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function create()\n {\n return renderToJson($this->folder . \"create\");\n }", "public function createQAfile()\r\n {\r\n $originalFile = realpath(__DIR__ . '/../Resources/files/templates/QA-sample.txt');\r\n $newFile = $this->destination_dir.'/QA.txt';\r\n\r\n $this->createCopiedFile($originalFile, $newFile);\r\n }", "public function createDocumentRequest($documentCreateRequest, $editorVer = null)\n {\n // verify the required parameter 'documentCreateRequest' is set\n if ($documentCreateRequest === null || (is_array($documentCreateRequest) && count($documentCreateRequest) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $documentCreateRequest when calling createDocument'\n );\n }\n\n $resourcePath = '/public/v1/documents';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($editorVer !== null) {\n if('form' === 'form' && is_array($editorVer)) {\n foreach($editorVer as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['editor_ver'] = $editorVer;\n }\n }\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json', 'multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($documentCreateRequest)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($documentCreateRequest));\n } else {\n $httpBody = $documentCreateRequest;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() != null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function insert_document(Request $request){\n //validate data\n $this->validate($request, [\n 'filename' => 'required',\n 'revision' => 'required',\n 'department' => 'required',\n 'originator' => 'required',\n 'location' => 'required',\n 'additional_security' => 'required',\n 'owner' => 'required',\n 'reviewer' => 'required',\n 'electronic_distribution' => 'required',\n 'hardcopy' => 'required',\n 'category' => 'required',\n 'system_element' => 'required',\n 'original_date' => 'required',\n 'effective_date' => 'required',\n 'url' => 'required',\n 'review_date' => 'required'\n ]);\n\n $url = $request->file('url');\n $new_url = $url->getClientOriginalName();\n $url->move(public_path('/uploads/files/'), $new_url);\n\n $form_data = array(\n 'url' => $new_url,\n 'filename' => $request->filename,\n 'revision' => $request->revision,\n 'department' => $request->department,\n 'originator' => $request->originator,\n 'location' => $request->location,\n 'additional_security' => $request->additional_security,\n 'owner' => $request->owner,\n 'reviewer' => $request->reviewer,\n 'electronic_distribution' => $request->electronic_distribution,\n 'hardcopy' => $request->hardcopy,\n 'category' => $request->category,\n 'system_element' => $request->system_element,\n 'description' => $request->description,\n 'original_date' => $request->original_date,\n 'effective_date' => $request->effective_date,\n 'review_date' => $request->review_date,\n 'user_id' => Auth::user()->id,\n 'iso_management_id' => $request->iso_management_id,\n 'folder_id' => $request->folder_id,\n 'project_id' => $request->project_id,\n 'doc_number' => $this->getNextDocNumber()\n );\n\n File::create($form_data);\n\n //store status message\n Session::flash('success_msg', 'Draft added successfully!');\n\n //redirect back to the main page\n return redirect()->route('document_control.document_new_draft');\n }", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function testcreatePdfA()\n {\n $createPdfAFile = $this->client->pdf4me()->createPdfA(\n [\n \"pdfCompliance\"=> \"pdfa1b\",\n \"file\" => __DIR__.'/testcase.pdf'\n ]\n );\n $this->assertTrue(is_string($createPdfAFile), 'Should return a valid object.');\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n $downloads = Redis::get(\"themes/download/{id}\");\n Redis::incr(\"themes/download/{id}\");\n\n //mu downloads for individual reference\n return Storage::download('mu-individual-ref.docx');\n\n }", "public function createJson(){\n $json = fopen($this->getFilePath(), 'w');\n$content = \"{\n \\\"require\\\" : {\n },\n \\\"bower\\\" : [\n ]\n}\";\n fwrite($json, $content);\n fclose($json);\n }", "private function createDocument($file_id, $body){\n $params = [\n 'index' => 'docsearch',\n 'type' => 'files',\n 'id' => $file_id,\n 'body' => $body\n ];\n\n $hosts = [$this->es_host];// IP + Port\n // Instantiate a new ClientBuilder\n $client = \\Elasticsearch\\ClientBuilder::create()\n ->setHosts($hosts) // Set the hosts\n ->build();\n $client->index($params);\n }", "public function run()\n {\n $entrada = [\n 'original_name' => 'PDF de Teste',\n 'path' => './tmp/PDFdeTeste.pdf',\n 'estagio_id' => '1',\n 'user_id' => '1',\n ];\n \n /* File::create($entrada);\n File::factory(40)->create(); */\n }", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "private function createFile()\n {\n $payload = json_decode(file_get_contents('php://input'));\n if (!isset($payload)) {\n $this->info = 'No input data';\n return false;\n }\n $fileName = strtolower($payload->path) . CONTENT_EXT;\n if (file_exists(CONTENT_DIR . $fileName)) {\n $this->info = 'File exist';\n return false;\n }\n if (\n strlen($fileName) > strlen(CONTENT_EXT) &&\n file_put_contents(CONTENT_DIR . $fileName, $payload->content)\n ) {\n return true;\n }\n return false;\n }", "public function create()\n {\n return $this->process($this->filename);\n }", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}" ]
[ "0.6670128", "0.65845555", "0.600319", "0.5912523", "0.5838329", "0.57433844", "0.57227635", "0.5698281", "0.56542516", "0.55884737", "0.5577931", "0.5573082", "0.5545931", "0.5498816", "0.5434232", "0.53983194", "0.5397232", "0.5355831", "0.534623", "0.534458", "0.5335667", "0.532984", "0.52925557", "0.5276195", "0.5255653", "0.5246427", "0.52263707", "0.5199113", "0.51781", "0.5175052", "0.51537716", "0.5133497", "0.51321167", "0.51299936", "0.5076362", "0.50756496", "0.50659543", "0.50636023", "0.50636023", "0.50570637", "0.50482357", "0.5032079", "0.5031553", "0.5027919", "0.5026465", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.50245154", "0.5019248", "0.50142235", "0.50142235", "0.50137526", "0.50122654", "0.49950564", "0.49904162", "0.49659455", "0.49653718", "0.49640852", "0.49612182", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445", "0.4958445" ]
0.6630924
1
Testing the project creation with the prj.json file
public function testCreateProject() { echo "\nTesting project creation..."; $input = file_get_contents('prj.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/projects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\nType:".$response."-----Create Response:".$response; $result = json_decode($response); if(!$result->success) { $this->assertTrue(true); } else { $this->assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function can_create_a_project()\n {\n $this->withoutExceptionHandling();\n\n $data = [\n 'name' => $this->faker->sentence,\n 'description' => $this->faker->paragraph,\n 'status' => $this->faker->randomElement(Project::$statuses),\n ];\n\n $request = $this->post('/api/projects', $data);\n $request->assertStatus(201);\n\n $this->assertDatabaseHas('projects', $data);\n\n $request->assertJsonStructure([\n 'data' => [\n 'name',\n 'status',\n 'description',\n 'id',\n ],\n ]);\n }", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function run()\n {\n $items = [\n \n ['title' => 'New Startup Project', 'client_id' => 1, 'description' => 'The best project in the world', 'start_date' => '2016-11-16', 'budget' => '10000', 'project_status_id' => 1],\n\n ];\n\n foreach ($items as $item) {\n \\App\\Project::create($item);\n }\n }", "public function run()\n {\n factory( App\\Project::class )->create( [\n 'name' => 'rbc',\n 'description' => 'sistema resto bar' \n ] ) ;\n\n factory( App\\Project::class )->create( [\n 'name' => 'pm',\n 'description' => 'project manager' \n ] ) ;\n\n factory( App\\Project::class, 20 )->create() ;\n }", "public function a_user_can_create_a_project()\n {\n\n $this->withoutExceptionHandling();\n \n //Given\n $this->actingAs(factory('App\\User')->create());\n \n //When\n $this->post('/projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n \n \n //Then\n $this->assertDatabaseHas('projects', [\n 'title' => 'ProjectTitle',\n 'description' => 'Description here',\n ]);\n }", "public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }", "public function test_creating_a_project()\n {\n $project = ProjectFactory::create();\n\n $this->assertCount(1,$project->activity);\n\n\n tap($project->activity->last(),function($activity){\n\n $this->assertEquals('created',$activity->description);\n\n $this->assertNull($activity->changes);\n\n });\n }", "public function run()\n {\n Project::truncate();\n \n factory(Project::class)->create([\n 'owner_id' => 1,\n 'client_id' => 1,\n 'name' => 'Project Test',\n 'description' => 'Lorem ipsum',\n 'progress' => rand(1, 100),\n 'status' => rand(1, 3),\n 'due_date' => '2016-06-06'\n ]);\n\n factory(Project::class, 10)->create();\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "private function createProject() {\n\n require_once('../ProjectController.php');\n $maxMembers = $this->provided['maxMembers'];\n $minMembers = $this->provided['minMembers'];\n $difficulty = $this->provided['difficulty'];\n $name = $this->provided['name'];\n $description = $this->provided['description'];\n //TODO REMOVE ONCE FETCHED\n //$tags = $this->provided['tags'];\n setcookie('userId', \"userId\", 0, \"/\");\n // TODO FIX ISSUE HERE: you have to reload the page to get the result with a cookie set\n $tags = array(new Tag(\"cool\"), new Tag(\"java\"), new Tag(\"#notphp\"));\n $project = new Project($maxMembers, $minMembers, $difficulty, $name, $description, $tags);\n foreach (ProjectController::getAllPools() as $pool) {\n if ($pool->hasID($this->provided['sessionID'])) {\n $pool->addProject($project, $tags);\n ProjectController::redirectToHomeAdmin($pool);\n }\n }\n }", "public function createProject()\n\t{\n\t\t$this->verifyTeam();\n\t\tAuthBackend::ensureWrite($this->team);\n\t\t$this->openProject($this->team, $this->projectName, true);\n\t\treturn true;\n\t}", "public function test_user_can_create_post()\n {\n $this->signIn();\n $attributes = [\n 'title' => 'my title',\n 'description' => 'my description',\n 'notes' => 'my notes'\n ];\n\n $response = $this->post('/api/projects', $attributes)->assertStatus(201);\n\n $response->assertJson([\n 'data' => [\n 'type' => 'projects',\n 'attributes' => [\n 'title' => $attributes['title'],\n 'notes' => $attributes['notes'],\n 'description' => $attributes['description'],\n 'user_id' => auth()->id()\n ]\n ]\n ]);\n }", "public function run()\n {\n \n $project = Project::create([\n 'project_code' => '10001',\n 'name' => 'Head Office',\n 'short_name' => 'HQ',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10002',\n 'name' => 'Depot',\n 'short_name' => 'DEPOT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10003',\n 'name' => 'Safty',\n 'short_name' => 'SAFTY',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '10004',\n 'name' => 'IT',\n 'short_name' => 'IT',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11016',\n 'name' => 'Amber',\n 'short_name' => 'AMBER',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n $project = Project::create([\n 'project_code' => '11023',\n 'name' => 'Niche Mono Borom Sales Office',\n 'short_name' => 'MONO',\n 'start_date' => date('Y-m-d'),\n 'end_date' => date('Y-m-d', strtotime(\"+365 days\")),\n ]);\n $this->command->info('Create Project ' . $project->project_code);\n }", "public function newProject()\n {\n\n GeneralUtility::checkReqFields(array(\"name\"), $_POST);\n\n $project = new Project();\n $project->create($_POST[\"name\"], $_SESSION[\"uuid\"]);\n\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function a_user_can_create_a_project()\n {\n $attributes = [\n \n 'title' => $this->fake->sentence,\n\n ];\n\n }", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function testCanCreateIdeaViaAPI()\n {\n $project = factory(Project::class)->create();\n $faker = Faker::create();\n $link = $faker->domainName;\n $price = $faker->randomNumber(4);\n\n $response = $this->json('POST', '/api/ideas', [\n 'link' => $link,\n 'price' => $price,\n 'notes' => 'Idea notes',\n 'user_id' => $project->user_id,\n 'project_id' => $project->id,\n 'file' => 'test'\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'link' => $link,\n 'price' => $price,\n 'user_id' => $project->user_id\n ]);\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "public function run()\n {\n AboutProject::create([\n 'main_title' => 'Жамбыл жастарының ресурстық орталығы',\n 'main_description' => 'default',\n 'main_image' => 'modules/front/assets/img/picture_slider.png',\n 'footer_title' => 'Жастар Саясаты басқармасы',\n 'footer_image' => 'modules/front/assets/img/logo.png',\n 'footer_address' => 'Желтоқсан көшесі, 78',\n 'footer_number' => '555-556-557'\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n $product_owners = DB::table('users')->select('id')->where('role_id','=','3')->get();\n $kind_num = ProjectKind::count();\n $max_project = require('Config.php');\n $max_project = $max_project['projects']['max'];\n $this->command->info($max_project);\n for($i=0;$i<$max_project;$i++)\n {\n if($i%50==0)\n $this->command->info('Project seeds: '.$i.' items out of '.$max_project);\n $dueDate = rand(1300191854,1565191854);\n $duration = rand(7776000,15552000);\n $createdDate = $dueDate - $duration;\n Project::create(array(\n 'prefix'=>$faker->randomElement(['PR','TS','WB']),\n 'name'=>$faker->sentence(2),\n //lets say 90% of projects have summary\n 'summary'=>$faker->sentence(6),\n //lets say only 80% of project have description\n 'description'=>$faker->paragraph(6),\n 'avatar'=>'assets/images/avatars/projects/'.strval(rand(1,110)).'.png',\n 'owner_id'=>$faker->randomElement($product_owners)->id,\n 'kind_id'=>rand(1,$kind_num),\n //lets say around 85% has due date\n 'end_date'=> rand(0,100)<85?date(\"Y-m-d H:i:s\",$dueDate):null,\n //let say 90% of projects are public\n 'is_public'=> rand(0,100)<90,\n //let say 90% of projects are active\n 'is_active'=> rand(0,100)<90,\n //let say 95% of projects are opt_request enabled\n 'opt_request'=> rand(0,100)<95,\n //let say 95% of projects are opt_requirement enabled\n 'opt_requirement'=> rand(0,100)<95,\n //let say 95% of projects are opt_testexecution enabled\n 'opt_testexecution'=> rand(0,100)<95,\n //let say 95% of projects are opt_bugs enabled\n 'opt_bugs'=> rand(0,100)<95,\n 'api_key'=>Hash::make($faker->sentence(20)),\n 'created_at'=>date(\"Y-m-d H:i:s\",$createdDate)\n ));\n }\n }", "public function testProjectAssignmentsDefineNew()\n {\n }", "protected function createProjects()\n {\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project1',\n 'name' => 'pro-jo',\n 'description' => 'what what!',\n 'members' => array('jdoe'),\n 'branches' => array(\n array(\n 'id' => 'main',\n 'name' => 'Main',\n 'paths' => '//depot/main/...',\n 'moderators' => array('bob')\n )\n )\n )\n );\n $project->save();\n\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'project2',\n 'name' => 'pro-tastic',\n 'description' => 'ho! ... hey!',\n 'members' => array('lumineer'),\n 'branches' => array(\n array(\n 'id' => 'dev',\n 'name' => 'Dev',\n 'paths' => '//depot/dev/...'\n )\n )\n )\n );\n $project->save();\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create('zh_TW');\n Project::create([\n 'raising_user_id' => 23,\n 'fundraiser' => 'RIG group',\n 'email' => $faker->email,\n 'name' => '典藏版《球場諜對諜》棒球鬥智精品桌遊',\n 'category_id' => 12,\n 'started_at' => '2018-10-5 ',\n 'ended_at' => '2018-12-10',\n 'curr_amount' => 16670,\n 'goal_amount' => 100000,\n 'relative_web' => 'www.zeczec.com/projects/MatchFixing?r=k2898470057',\n 'backer' => 32,\n 'brief' => '這是一款藉由互相猜忌對方身份,需要一定的運氣與智力才能做出正確決定的棒球桌遊。',\n 'description' => '影片無法播放請點選右側網址收看 https://pse.is/B6BWW #\n你知道這「黑襪事件」對美國運動史帶來的意義嗎?#\n一九一九年,號稱「球界最強」的芝加哥白襪隊驚爆八名選手集體放水、故意輸掉唾手可得的世界冠軍,自此「黑襪事件」四個字成為球壇遭封印的闇黑符號。\n但也正因如此,才有今日乾淨打球、純粹展現全球最高棒球技藝,被暱稱為「國家娛樂」的美國職棒大聯盟棒球。\n熱愛棒球的我們,絕對無法認同打假球的行為,因此特別設計了這款遊戲,讓玩家透過遊戲身歷其境體會歷史的傷痛,讓喜愛棒球或桌遊的玩家更認同乾淨打球的真義。',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 499,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n限量回饋搶先出手相挺者 \n搶先價499元(市價:699元) \n本產品只有一種版本,先搶先贏! \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 549,\n 'backer' => 11,\n 'description' => '典藏版《球場諜對諜》精品桌遊1套 \n早鳥價549元(市價:699元) \n(((臺灣本島離島免運))) \nps: \n香港澳門250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n Feedback::create([\n 'project_id' => 23,\n 'date' => '2018-12-31',\n 'price' => 998,\n 'backer' => 10,\n 'description' => '典藏版《球場諜對諜》精品桌遊2套 \n送《美國職棒》雜誌1本(市價168元) \n市價:1566元 現省568元 \n(((臺灣本島離島免運))) \n\n全球華文出版市場唯一針對大聯盟(Major League Baseball)棒球進行介紹的官方授權刊物,內容兼具深度與廣度。除了球季戰況的精闢剖析,還包括知名選手、各隊新星傳記;最新熱門話題;造訪大聯盟球場的實用旅遊資訊以及投打技術剖析。 \nps: \n港澳運費250元 \n其餘海外運費標準 \n依照包裹重量與地區另訂 \n有任何問題請洽[email protected]',\n ]);\n\n Project::create([\n 'raising_user_id' => 24,\n 'fundraiser' => ' 玩思once實境遊戲 ',\n 'email' => $faker->email,\n 'name' => '街道的隱匿者|當你用牠的眼睛看世界-流浪動物實境遊戲',\n 'category_id' => 12,\n 'started_at' => '2018-10-23',\n 'ended_at' => '2018-12-25',\n 'curr_amount' => 459695,\n 'goal_amount' => 700000,\n 'relative_web' => 'www.zeczec.com/projects/once-reality-game?r=k2751470057',\n 'backer' => 39,\n 'brief' => '一款體會毛孩處境的實境遊戲。在這個由人類掌控的世界,街上流浪動物要如何生存下去?如果是你,你會怎麼做?',\n 'description' => '把你變成流浪動物,你能存活多久?#\n一個以流浪動物的視角體驗人類社會的實境遊戲\n在街頭遇到流浪動物的時候,你是什麼心情呢?是覺得他們好可愛、好可憐,或者你是固定餵食的愛媽愛爸,照顧流浪動物的飲食,還是對於流浪動物帶來的髒亂覺得困擾?\n《街道的隱匿者》是一款從流浪動物角度出發的遊戲,帶你從動物的角度認識人類世界,認識流浪動物在街頭上的困境,不是人類的你,該怎麼生存下去呢?',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 450,\n 'backer' => 20,\n 'description' => '【個人早鳥優惠_早鳥送限定酷卡】 \n原價為550元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 2400,\n 'backer' => 18,\n 'description' => '【團體早鳥優惠_早鳥送限定酷卡】 \n原價為3300元,集資期間現省900元。\n\n◇ 街道的隱匿者-團體遊玩券一張(6人) \n◇ 集資限定酷卡六套\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*此方案為6人團體券,如果同團超過6人,現場以400元/人,加收費用。 \n*需要統編可以留言在備註欄',\n ]);\n Feedback::create([\n 'project_id' => 24,\n 'date' => '2019-5-1',\n 'price' => 600,\n 'backer' => 1,\n 'description' => '【個人票套組】 \n原價為700元,集資期間現省100元。\n\n◇ 街道的隱匿者-遊玩券一張 \n◇ 集資限定酷卡一套 \n◇ 快樂結局帆布包一個\n\n注意事項: \n*免郵資,票券以掛號方式寄出。 \n*遊戲建議人數為4~8人,低於4人以併團方式進行遊玩。 \n*需要統編可以留言在備註欄',\n ]);\n\n }", "public function run()\n {\n $faker = Faker::create();\n // Create Project\n foreach (range(1, 10) as $i) {\n Project::create([\n 'name' => $faker->name,\n 'manager' => $i\n ]);\n }\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testProjectAssignmentsSave()\n {\n }", "public function generateProject() {\n $ret = $this->getData(); //obtiene la estructura y el contenido del proyecto\n\n $plantilla = $this->getTemplateContentDocumentId($ret);\n $destino = $this->getContentDocumentId($ret);\n\n //1.1 Crea el archivo 'continguts', en la carpeta del proyecto, a partir de la plantilla especificada\n $this->createPageFromTemplate($destino, $plantilla, NULL, \"generate project\");\n\n //3. Otorga, a cada 'person', permisos adecuados sobre el directorio de proyecto y añade shortcut si no se ha otorgado antes\n $params = $this->buildParamsToPersons($ret[ProjectKeys::KEY_PROJECT_METADATA], NULL);\n $this->modifyACLPageAndShortcutToPerson($params);\n\n //4. Establece la marca de 'proyecto generado'\n $ret[ProjectKeys::KEY_GENERATED] = $this->projectMetaDataQuery->setProjectGenerated();\n\n return $ret;\n }", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testProjectsAssignTeam()\n {\n $project = factory(Project::class)->create();\n $response = $this->get('/project/team?id=' . $project->id);\n $response->assertStatus(200);\n }", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function testVolunteerHourCreateForProjectSuccess_ProjectItemManager()\n {\n // Set test user as current authenticated user\n $this->be($this->projectManager);\n \n $this->session([\n 'username' => $this->projectManager->username, \n 'access_level' => $this->projectManager->access_level\n ]);\n \n $testProjectID = 1;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/add/project/'.$testProjectID);\n \n $this->assertContains('Volunteer Hours for', $response->getContent());\n \n }", "public function onPostCreateProject(Event $event): void\n {\n if (self::$isGlobalCommand) {\n return;\n }\n\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n // new projects are most of the time proprietary\n $manipulator->addMainKey('license', 'proprietary');\n\n // 'name' and 'description' are only required for public packages\n $manipulator->removeProperty('name');\n $manipulator->removeProperty('description');\n\n foreach ($this->container->get('composer-extra') as $key => $value) {\n if ($key !== self::COMPOSER_EXTRA_KEY) {\n $manipulator->addSubNode('extra', $key, $value);\n }\n }\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n\n $this->updateComposerLock();\n }", "public function testProjectAssignmentsRead()\n {\n }", "public function run()\n {\n $projects = App\\Project::all();\n $faker = Faker\\Factory::create();\n foreach ($projects as $project) {\n \\App\\ProjectCustomer::create(\n [\n 'project_id' => $project->id,\n 'name' => $faker->name,\n 'contact_no' => $faker->phoneNumber,\n 'post_code' => $faker->postcode,\n 'address' => $faker->address,\n ]\n );\n }\n }", "public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public static function run(): void\n {\n $projectName = Console\\Layer::readline('Enter project name: ');\n\n $env = file_get_contents(__DIR__ . '/../Res/Create/env.tpl');\n\n $env = str_replace('%project_name%', $projectName, $env);\n\n Fs\\Layer::filePutContents(__DIR__ . '/../../../../../../.env', $env);\n }", "public function run()\n {\n $bases = array_rand(RefBasis::all()->pluck('id')->toArray(), 3);\n $operating_units = array_rand(RefOperatingUnit::all()->pluck('id')->toArray(), 3);\n $regions = array_rand(RefRegion::all()->pluck('id')->toArray(), 3);\n $covid_interventions = array_rand(RefCovidType::all()->pluck('id')->toArray(), 3);\n $pdp_chapters = array_rand(RefPdpChapter::all()->pluck('id')->toArray(), 3);\n $pdp_indicators = array_rand(RefPdpIndicator::all()->pluck('id')->toArray(), 3);\n $socio_econ_agendas = array_rand(RefSocioEconAgenda::all()->pluck('id')->toArray(), 3);\n $sdgs = array_rand(RefSustainableDevtAgenda::all()->pluck('id')->toArray(), 3);\n $infra_sectors = array_rand(RefInfraSector::all()->pluck('id')->toArray(), 3);\n $prerequisites = array_rand(RefPrerequisite::all()->pluck('id')->toArray(), 3);\n\n Project::factory()\n ->has(ProjectUpdate::factory()->count(1), 'project_update')\n ->create();\n }", "public function run()\n {\n $typeOfProjects = [\n [\n 'name' => 'Community Based Projects',\n 'description'=>'Community Based Projects'\n ],\n [\n 'name' => 'Group Based Projects',\n 'description'=>'Group Based Projects'\n ],\n [\n 'name' => 'Individual Projects',\n 'description'=>'Individual Projects'\n ],\n \n ];\n\n foreach($typeOfProjects as $key => $value){\n\n typeOfProject::create($value);\n\n }\n }", "protected function writeProjectFile()\r\n\t{\r\n\t\t//override to implement the parsing and file creation.\r\n\t\t//to add a new file, use: $this->addFile('path to new file', 'file contents');\r\n\t\t//echo \"Create Project File.\\r\\n\";\r\n\t}", "public function run()\n {\n \t$project_owner = User::where('name', 'Owner Name')->first();\n \t$project = new Project();\n \t$project->name = 'New Project';\n \t$project->owner = $project_owner->id;\n \t$project->save();\n }", "public function run()\n {\n Project::create([\n 'name' => 'Psychotic',\n 'type_id' => 1,\n 'flavor' => 'Apple',\n 'country_id' => 1,\n 'created_by' => 1\n ]);\n\n Project::create([\n 'name' => 'Psychotic',\n 'type_id' => 1,\n 'flavor' => 'Grape',\n 'country_id' => 1,\n 'created_by' => 1\n ]);\n\n Project::create([\n 'name' => 'Insane Amino',\n 'type_id' => 1,\n 'flavor' => 'Apple',\n 'country_id' => 1,\n 'created_by' => 1\n ]);\n\n Project::create([\n 'name' => 'Psychotic',\n 'type_id' => 1,\n 'flavor' => 'Rainbow Candy (Spartan)',\n 'country_id' => 2,\n 'created_by' => 1\n ]);\n }", "public function run()\n {\n $faker = Faker::create();\n\n $event_id = DB::table('events')->where('name', 'Crufts')->value('id');\n $client_id = DB::table('clients')->where('name', 'Caeserstone')->value('id');\n $status_id = DB::table('project_statuses')->where('name', 'Active')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'venue_id' => DB::table('venues')->where('name', 'National Exhibition Centre (NEC)')->value('id'),\n 'name' => 'Exhibition Stand',\n 'project_type_id' => DB::table('project_types')->where('name', 'Exhibition Stand')->value('id'),\n 'brief' => '<p>Test</p>',\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n\n $client_id = DB::table('clients')->where('name', 'The Kennel Club')->value('id');\n $status_id = DB::table('project_statuses')->where('name', 'Breakdown')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'venue_id' => DB::table('venues')->where('name', 'National Exhibition Centre (NEC)')->value('id'),\n 'name' => 'Exhibition Stand 2',\n 'project_type_id' => DB::table('project_types')->where('name', 'Exhibition Stand')->value('id'),\n 'brief' => '<p>Test</p>',\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n\n $status_id = DB::table('project_statuses')->where('name', 'Enquiry')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'name' => 'Exhibition Stand 3',\n 'venue_id' => DB::table('venues')->where('name', 'National Exhibition Centre (NEC)')->value('id'),\n 'project_type_id' => DB::table('project_types')->where('name', 'Exhibition Stand')->value('id'),\n 'brief' => '<p>Test</p>',\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n\n $event_id = DB::table('events')->where('name', 'KBB 2019')->value('id');\n $client_id = DB::table('clients')->where('name', 'MSD Animal Health')->value('id');\n $status_id = DB::table('project_statuses')->where('name', 'Active')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'venue_id' => DB::table('venues')->where('name', 'National Exhibition Centre (NEC)')->value('id'),\n 'name' => 'Exhibition Stand',\n 'project_type_id' => DB::table('project_types')->where('name', 'Exhibition Stand')->value('id'),\n 'brief' => '<p>Test</p>',\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n\n $event_id = DB::table('events')->where('name', 'Wimbledon 2019')->value('id');\n $client_id = DB::table('clients')->where('name', 'Pimms')->value('id');\n $status_id = DB::table('project_statuses')->where('name', 'Active')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'venue_id' => DB::table('venues')->where('name', 'All England Lawn Tennis & Croquet Club')->value('id'),\n 'name' => 'Bar Structure',\n 'brief' => '<p>Test</p>',\n 'project_type_id' => DB::table('project_types')->where('name', ' Outdoor Exhibition Stand')->value('id'),\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n\n $event_id = DB::table('events')->where('name', 'Pig & Poultry 2019')->value('id');\n $client_id = DB::table('clients')->where('name', 'Pimms')->value('id');\n $status_id = DB::table('project_statuses')->where('name', 'Active')->value('id');\n\n DB::table('projects')->insert([\n 'event_id' => $event_id,\n 'client_id' => $client_id,\n 'project_owner_id' => DB::table('users')->inRandomOrder()->first()->id,\n 'client_contact_id' => DB::table('client_contacts')->where('client_id', $client_id)->inRandomOrder()->first()->id,\n 'status_id' => $status_id,\n 'venue_id' => DB::table('venues')->where('name', 'NAEC Stoneleigh')->value('id'),\n 'name' => 'Exhibition Stand',\n 'project_type_id' => DB::table('project_types')->where('name', 'Outdoor Exhibition Stand')->value('id'),\n 'brief' => '<p>Test</p>',\n 'created_at' => $faker->dateTimeBetween($startDate = 'now', $endDate = date('y-m-d', strtotime('+1 months'))),\n 'updated_at' => $faker->dateTimeBetween($startDate = 'now', date('y-m-d', strtotime('+1 months')))\n ]);\n }", "public function a_user_can_see_single_project()\n {\n $project = factory(Project::class)->create();\n\n $this->get('/api/projects/' . $project->id)->assertStatus(200)->assertJson([\n 'data' => [\n 'id' => $project->id,\n 'name' => $project->name,\n 'description' => $project->description,\n ],\n ]);\n }", "public function run()\n {\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 2\n ]);\n $project = Project::create([\n 'name' => 'projects',\n 'mission' => 'mission',\n 'vision' => 'vision',\n 'estatud' => '1',\n 'user_id' => 3\n ]);\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectAssignmentsArchive()\n {\n }", "public function addproject() {\n\t\t\t\n\t\t\t\n\t\t}", "public function run(Faker $faker)\n {\n Project::create([\n 'id' => unique_random('projects', 'id'),\n 'name' => 'Digital Bible Platform',\n 'url_avatar' => $faker->url,\n 'url_avatar_icon' => $faker->url,\n 'url_site' => $faker->url,\n 'description' => $faker->paragraph(3, true),\n 'sensitive' => false\n ]);\n\n $project_count = random_int(3, 5);\n while ($project_count > 0) {\n\n Project::create([\n 'id' => $project_count,\n 'name' => $faker->company,\n 'url_avatar' => $faker->url,\n 'url_avatar_icon' => $faker->url,\n 'url_site' => $faker->url,\n 'description' => $faker->paragraph(3, true),\n 'sensitive' => false\n ]);\n\n ProjectOauthProvider::create([\n 'name' => 'facebook',\n 'project_id' => $project_count,\n 'client_id' => unique_random('project_oauth_providers', 'client_id'),\n 'client_secret' => unique_random('project_oauth_providers', 'client_secret'),\n 'callback_url' => 'https://dbp4.org/login/callback/facebook',\n 'description' => (string) $faker->paragraph(),\n ]);\n\n ProjectOauthProvider::create([\n 'name' => 'google',\n 'project_id' => $project_count,\n 'client_id' => unique_random('project_oauth_providers', 'client_id'),\n 'client_secret' => unique_random('project_oauth_providers', 'client_secret'),\n 'callback_url' => 'https://dbp4.org/login/callback/google',\n 'description' => (string) $faker->paragraph(),\n ]);\n\n $project_count--;\n }\n }", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function makeProject()\n {\n return $this->setDocumentPropertiesWithMetas(new PhpProject());\n }", "public function run()\n {\n $projectNum = Project::count();\n $faker = Faker::create();\n $project_limit=require('Config.php');\n for($i=1;$i<=$projectNum;$i++)\n {\n if($i%200 ==0)\n $this->command->info('Test Suite Seed :'.$i.' out of: '.$projectNum);\n $TestsTestArch = DB::table('project_assignments')->select('user_id','role_id')->\n where([['project_id','=',$i]])->\n whereIn('role_id',[7,8,9])->get();\n //let's say Tester, Test Lead and Test Architect together create around 20-40 folder per projects\n $numberOfTestSuites = rand($project_limit['projects']['min_test_suite'],$project_limit['projects']['max_test_suite']);\n for($j=0;$j<$numberOfTestSuites;++$j)\n {\n TestSuite::create(array(\n 'project_id'=>$i,\n 'name'=>$faker->sentence(4),\n //let's say only 90% of Test Suite have description\n 'description'=>rand(0,100)<80?$faker->paragraph(6):null,\n 'creator_id'=>$faker->randomElement($TestsTestArch)->user_id\n ));\n }\n }\n }", "public function createProject($project)\n {\n $data = new Project();\n $data->setName($project['name'])\n ->setDescription($project['description'])\n ->setIsArchived(0)\n ->setCreatedTime(time())\n ->setUpdatedTime(time());\n $em = $this->getDoctrine()->getManager();\n $em->persist($data);\n $em->flush();\n }", "public function testProjectNoReadme()\n {\n // create project to test with\n $project = new Project($this->p4);\n $project->set(\n array(\n 'id' => 'prj',\n 'members' => array('foo-member'),\n 'creator' => 'foo-member',\n 'owners' => array()\n )\n )->save();\n\n $this->dispatch('/project/readme/prj');\n $this->assertRoute('project-readme');\n $this->assertRouteMatch('markdown', 'markdown\\controller\\indexcontroller', 'project');\n $this->assertResponseStatusCode(200);\n $result = $this->getResult();\n\n $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $result);\n $this->assertSame('', $result->getVariable('readme'));\n }", "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testPsWithprojectOption()\n {\n $composeFiles = new ComposeFileCollection(['docker-compose.test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n\n $this->assertEquals($this->mockedManager->ps($composeFiles), 'ok');\n }", "public function testAddRenameDeleteProject() {\n\t\t$t_project_name = $this->getNewProjectName();\n\t\t$t_project_new_name = $t_project_name . '_new';\n\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_projects_array = $this->client->mc_projects_get_user_accessible( $this->userName, $this->password );\n\n\t\tforeach( $t_projects_array as $t_project ) {\n\t\t\tif( $t_project->id == $t_project_id ) {\n\t\t\t\t$this->assertEquals( $t_project_name, $t_project->name );\n\t\t\t}\n\t\t}\n\n\t\t$t_project_data_structure['name'] = $t_project_new_name;\n\n\t\t$this->client->mc_project_update( $this->userName, $this->password,\n\t\t\t$t_project_id,\n\t\t\t$t_project_data_structure\n\t\t);\n\n\t\t$t_projects_array = $this->client->mc_projects_get_user_accessible( $this->userName, $this->password );\n\n\t\tforeach( $t_projects_array as $t_project ) {\n\t\t\tif( $t_project->id == $t_project_id ) {\n\t\t\t\t$this->assertEquals( $t_project_new_name, $t_project->name );\n\t\t\t}\n\t\t}\n\t}", "public static function fromJson($json) {\n $jsonObj = json_decode($json);\n $newProject = new Project();\n $newProject->setId($jsonObj->{'id'});\n $newProject->setTitle($jsonObj->{'title'});\n $newProject->setDescription($jsonObj->{'description'});\n $newProject->setStartDate($jsonObj->{'start_date'});\n $newProject->setDuration($jsonObj->{'duration'});\n $newProject->setKeyWords($jsonObj->{'key_words'});\n $newProject->setCategories($jsonObj->{'categories'});\n $newProject->setFundingSought($jsonObj->{'funding_sought'});\n $newProject->setFundingNow($jsonObj->{'funding_now'});\n $newProject->setOwnerAccount($jsonObj->{'owner_account'});\n return $newProject;\n }", "public function main() {\n\n $fs = new Filesystem();\n\n $fs->touch($this->getTargetFile());\n\n $seedProperties = Yaml::parse(file_get_contents($this->getSeedFile()));\n $generatedProperties = [];\n\n $generatedProperties['label'] = $seedProperties['project_label'];\n $generatedProperties['machineName'] = $seedProperties['project_name'];\n $generatedProperties['group'] = $seedProperties['project_group'];\n $generatedProperties['basePath'] = '${current.basePath}';\n $generatedProperties['type'] = $seedProperties['project_type'];\n $generatedProperties['repository']['main'] = $seedProperties['project_git_repository'];\n $generatedProperties['php'] = $seedProperties['project_php_version'];\n\n // Add platform information.\n if (isset($generatedProperties['platform'])) {\n $generatedProperties['platform'] = $seedProperties['platform'];\n }\n\n $fs->dumpFile($this->getTargetFile(), Yaml::dump($generatedProperties, 5, 2));\n }", "public function a_project_can_update()\n {\n $project = factory(Project::class)->create();\n\n $newData = [\n 'name' => $this->faker->sentence,\n 'description' => 'Changed',\n ];\n\n $this->put('/api/projects/' . $project->id, $newData)->assertStatus(201);\n $this->assertDatabaseHas('projects', [\n 'id' => $project->id,\n 'name' => $newData['name'],\n 'description' => $newData['description'],\n ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n $userIds = \\App\\Models\\ClientsModel::all()->pluck('id')->toArray();\n $companiesIds = \\App\\Models\\CompaniesModel::all()->pluck('id')->toArray();\n $dealsIds = \\App\\Models\\DealsModel::all()->pluck('id')->toArray();\n $projectName = ['Geolides', 'noderston', 'ipader', 'KickSlider', 'maxim.safe', 'grunlog', 'ivier', 'easyntaxhl',\n 'bbbles', 'abombl', 'yabbit', 'quireMobi', 'Redmondup', 'Typer', 'envil.it', 'kerbuildy', 'Audione', 'rotroll',\n 'lighlight', 'Golias', 'Supernova'];\n\n for ($i = 0; $i<=20; $i++) {\n $projects = [\n 'name' => $projectName[$i],\n 'client_id' => $faker->randomElement($userIds),\n 'companies_id' => $faker->randomElement($companiesIds),\n 'deals_id' => $faker->randomElement($dealsIds),\n 'cost' => rand(100,1000),\n 'start_date' => \\Carbon\\Carbon::now(),\n 'created_at' => $faker->dateTimeBetween($startDate = '-30 days', $endDate = 'now'),\n 'updated_at' => \\Carbon\\Carbon::now()\n ];\n\n DB::table('projects')->insert($projects);\n }\n }", "public function validateProjectCreation($projectStructure) {\n $this->feature_options = json_decode( $this->feature->options );\n\n if ( $this->feature_options->id_qa_model ) {\n // pass\n } else {\n $this->validateModeFromJsonFile($projectStructure);\n }\n }", "public function a_project_require_a_name()\n {\n $project = factory(Project::class)->raw(['name' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'name',\n ],\n ]);\n }", "function validate() {\n\t\tif( !access_has_global_level( config_get( 'create_project_threshold' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Access denied to create projects',\n\t\t\t\tERROR_ACCESS_DENIED\n\t\t\t);\n\t\t}\n\n\t\tif( is_blank( $this->payload( 'name' ) ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name cannot be empty',\n\t\t\t\tERROR_EMPTY_FIELD,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_project = $this->data['payload'];\n\n\t\t$this->name = $this->payload( 'name' );\n\t\t$this->description = $this->payload( 'description', '' );\n\t\t$this->inherit_global = $this->payload( 'inherit_global', true );\n\t\t$this->file_path = $this->payload( 'file_path', '' );\n\t\t$this->view_state = isset( $t_project['view_state'] ) ? mci_get_project_view_state_id( $t_project['view_state'] ) : config_get( 'default_project_view_status' );\n\t\t$this->status = isset( $t_project['status'] ) ? mci_get_project_status_id( $t_project['status'] ) : 10 /* development */;\n\t\t$this->enabled = $this->payload( 'enabled', true );\n\n\t\tif( !project_is_name_unique( $this->name ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Project name is not unique',\n\t\t\t\tERROR_PROJECT_NAME_NOT_UNIQUE,\n\t\t\t\tarray( 'name' )\n\t\t\t);\n\t\t}\n\n\t\t$t_enum_values = MantisEnum::getValues( config_get( 'project_status_enum_string' ) );\n\t\tif( !in_array( $this->status, $t_enum_values ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project status',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'status' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->inherit_global ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project inherit global',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'inherit_global' )\n\t\t\t);\n\t\t}\n\n\t\tif( !is_bool( $this->enabled ) ) {\n\t\t\tthrow new ClientException(\n\t\t\t\t'Invalid project enabled',\n\t\t\t\tERROR_INVALID_FIELD_VALUE,\n\t\t\t\tarray( 'enabled' )\n\t\t\t);\n\t\t}\n\t}", "public function projectAction()\n {\n $projectId = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4Admin');\n\n try {\n $project = Project::fetch($projectId, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n if (!$project) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $config = $services->get('config');\n $mainlines = isset($config['projects']['mainlines']) ? (array) $config['projects']['mainlines'] : array();\n $branches = $project->getBranches('name', $mainlines);\n\n // check each path of each mainline branch to see if there's a readme.md file present\n $readme = false;\n foreach ($branches as $branch) {\n foreach ($branch['paths'] as $depotPath) {\n if (substr($depotPath, -3) == '...') {\n $filePath = substr($depotPath, 0, -3);\n }\n\n // filter is case insensitive\n $filter = Filter::create()->add(\n 'depotFile',\n $filePath . 'readme.md',\n Filter::COMPARE_EQUAL,\n Filter::CONNECTIVE_AND,\n true\n );\n $query = Query::create()->setFilter($filter);\n $query->setFilespecs($depotPath);\n\n $fileList = File::fetchAll($query);\n // there may be multiple files present, break out of the loops on the first one found\n foreach ($fileList as $file) {\n $readme = File::fetch($file->getFileSpec(), $p4Admin, true);\n break(3);\n }\n }\n }\n\n if ($readme === false) {\n return new JsonModel(array('readme' => ''));\n }\n\n $services = $this->getServiceLocator();\n $helpers = $services->get('ViewHelperManager');\n $purifiedMarkdown = $helpers->get('purifiedMarkdown');\n\n $maxSize = 1048576; // 1MB\n $contents = $readme->getDepotContents(\n array(\n $readme::UTF8_CONVERT => true,\n $readme::UTF8_SANITIZE => true,\n $readme::MAX_FILESIZE => $maxSize\n )\n );\n\n // baseUrl is used for locating relative images\n return new JsonModel(\n array(\n 'readme' => '<div class=\"view view-md markdown\">' . $purifiedMarkdown($contents) . '</div>',\n 'baseUrl' => '/projects/' . $projectId . '/view/' . $branch['id'] . '/'\n )\n );\n }", "public function projects_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n }\n \n $jutil->setExpStatus($params,$owner);\n \n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addProject($params);\n \n $this->response($result);\n }", "public function run()\n\t{\n\t\t$projects = [\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Caerus',\n\t\t\t\t\"description\" => 'Caerus is a free service to job seekers, where you can upload a resume, search for jobs, save them and apply to them directly. Employers may also keep track of their candidates and maintain a history of the interview progress.',\n\t\t\t\t\"photo\" => 'projects/caerus.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Hermes',\n\t\t\t\t\"description\" => 'Hermes is a free instant messaging app available on the web. It allows you to send text messages to other users one-on-one.',\n\t\t\t\t\"photo\" => 'projects/hermes.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'SiSr',\n\t\t\t\t\"description\" => 'SiSr is a web app that allows you to order your food at your favorite restaurant without the need of interacting with the waiters, simply choose your grub, confirm and await!',\n\t\t\t\t\"photo\" => 'projects/sisr.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Agora',\n\t\t\t\t\"description\" => 'An online marketplace where you can buy and sell anything, anywhere at anytime!',\n\t\t\t\t\"photo\" => 'projects/agora.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Artemis',\n\t\t\t\t\"description\" => 'A bug tracking software meant for software development companies',\n\t\t\t\t\"photo\" => 'projects/artemis.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Aletheia',\n\t\t\t\t\"description\" => 'No information provided',\n\t\t\t\t\"photo\" => 'projects/aletheia.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Basa Capital',\n\t\t\t\t\"description\" => 'The static version of the website of Basa Capital (https://portalweb.basacapital.com.py)',\n\t\t\t\t\"photo\" => 'projects/ui-basa-capital.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Raices',\n\t\t\t\t\"description\" => 'The static version of the website of Raices (https://usuarios.raices.com.py/login)',\n\t\t\t\t\"photo\" => 'projects/ui-raices.png',\n\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Merkto',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'A business-to-business (B2B) ecommerce, purchase goods from anywhere in Paraguay!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/merkto.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Gymmer',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Manage your customers data such as routines, schedules, muscle priorities, monthly payments/installments and more!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/gymmer.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Matse',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Software meant to manage all the real estate properties of Matse S.A.',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/matse.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t];\n\n\t\tforeach ($projects as $project) {\n\t\t\t$new_project = new Project();\n\t\t\t$new_project->status_id = $project['status_id'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->description = $project['description'];\n\t\t\t$new_project->photo = $project['photo'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->started_at = now()->subDays(rand(30, 120));\n\t\t\t$new_project->save();\n\t\t}\n\n\t}", "public function run()\n {\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 1]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 2]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 5]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 3]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 1]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 10]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 4]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 6]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 7]);\n \tfactory(\\CodeProject\\Entities\\Project::class)->create(['owner_id' => 1]);\n }", "public function create(CreateProjectRequest $request)\n {\n $newEntry = Project::create([\n 'author' => Auth::user()->username,\n 'user_id' => Auth::user()->id,\n 'title' => $request->getTitle(),\n 'description' => $request->getDescription(),\n 'body' => $request->getBody(),\n 'statement_title' => 'Mission Statement',\n 'statement_body' => 'This is where you write about your mission statement or make it whatever you want.',\n 'tab_title' => 'Welcome',\n 'tab_body' => 'Here you can write a message or maybe the status of your project for all your members to see.',\n ]);\n\n $thumbnail = $request->file('thumbnail');\n $thumbnail->move(base_path() . '/public/images/projects', 'product' . $newEntry->id . '.jpg');\n\n //Sets banner image to a random pre-made banner\n $images = glob(base_path() . \"/public/images/banners/*\");\n $imagePath = base_path() . '/public/images/projects/' . 'banner' . $newEntry->id . '.jpg';\n $rand = random_int(0, count($images) - 1);\n \\File::copy($images[$rand], $imagePath);\n\n //Add creator as a member and make admin of the project\n $newEntry->addMember(true);\n //Add creator as a follower of the project\n $newEntry->addFollower();\n\n return redirect('/project/'.$newEntry->title);\n }", "private function createProjectPool() {\n //TODO\n }", "public function create()\n {\n $shortcut = session()->get('shortcut');\n $from_api = session()->get('from_api');\n\n //\n $json = $this->jiraApi($shortcut);\n\n // Connect both arrays\n// $data = array_merge($data, $json);\n // Connect both Objects\n// $data = (object) array_merge((array) $data, (array) $json);\n //\n return view('projects.create', compact( 'json', 'from_api'));\n }", "public function run() {\n $this->base_data();\n $this->minimal_data();\n $project = Project::first();\n\n // Create a bunch more stuff, just for testin'.\n for ($i = 0; $i < 5; $i++) Factory::project($project->id);\n for ($i = 0; $i < 15; $i++) Factory::bid();\n for ($i = 0; $i < 15; $i++) Factory::question();\n for ($i = 0; $i < 10; $i++) Factory::vendor();\n for ($i = 0; $i < 40; $i++) Factory::section();\n\n for ($i = 0; $i < 20; $i++) Factory::project($project->id);\n for ($i = 0; $i < 40; $i++) Factory::bid(array(), $project->id);\n\n }", "public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }", "public function newProjectAction()\n\t\t{\n\n\t\t\tif(!empty($_POST))\n\t\t\t{\n\t\t\t\t$project=new Projects($_POST);\n\n\t\t\t\t$user=Auth::getUser();\n\n\t\t\t\tif($project->save($user->id))\n\t\t\t\t{\n\t\t\t\t\t$id=$project->returnLastID()[0];\n\n\t\t\t\t\tforeach($project->tasks as $task)\n\t\t\t\t\t{\n\t\t\t\t\t\tTasks::save($task, $id);\n\t\t\t\t\t}\n\n\t\t\t\t\tImages::save($project->imagepath, $id);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function createProject($name, $clientID, $websiteFrontURL, $websiteBackURL,$color, $tasksScheduledTime, $ticketsScheduledTime)\n {\n }", "static private function createProject($name, User $leader, $overview, $client = null, $category = null, $template = null, $first_milestone_starts_on = null, $based_on = null, $label_id = null, $currency_id = null, $budget = null, $custom_field_1 = null, $custom_field_2 = null, $custom_field_3 = null) {\n $project = new Project();\n\n $project->setAttributes(array(\n 'name' => $name,\n 'slug' => Inflector::slug($name),\n 'label_id' => (isset($label_id) && $label_id) ? $label_id : 0,\n 'overview' => trim($overview) ? trim($overview) : null,\n 'company_id' => $client instanceof Company ? $client->getId() : null,\n 'category_id' => $category instanceof ProjectCategory ? $category->getId() : null,\n 'custom_field_1' => $custom_field_1,\n 'custom_field_2' => $custom_field_2,\n 'custom_field_3' => $custom_field_3,\n ));\n\n $project->setState(STATE_VISIBLE);\n $project->setLeader($leader);\n\n if($template instanceof ProjectTemplate) {\n $project->setTemplate($template);\n } // if\n\n if($based_on instanceof IProjectBasedOn) {\n $project->setBasedOn($based_on);\n } // if\n\n $project->setCurrencyId($currency_id);\n\n if(AngieApplication::isModuleLoaded('tracking') && $budget) {\n $project->setBudget($budget);\n } // if\n\n $project->setMailToProjectCode(Projects::newMailToProjectCode());\n\n $project->save();\n\n if($template instanceof ProjectTemplate && $first_milestone_starts_on instanceof DateValue) {\n ConfigOptions::setValueFor('first_milestone_starts_on', $project, $first_milestone_starts_on->toMySQL());\n } // if\n\n return $project;\n }", "public function testInitializeProjectId()\n {\n # supplied to the snippet's function.\n $output = $this->runFirestoreSnippet('setup_client_create', [self::$projectId]);\n $this->assertStringContainsString('Created Cloud Firestore client with project ID:', $output);\n }", "static function create($name, $additional = null, $instantly = true) {\n $logged_user = Authentication::getLoggedUser();\n \n $based_on = array_var($additional, 'based_on');\n $template = array_var($additional, 'template');\n \n $leader = array_var($additional, 'leader');\n if(!($leader instanceof User)) {\n $leader = $logged_user;\n } // if\n\n try {\n DB::beginWork('Creating a project @ ' . __CLASS__);\n\n // Create a new project instance\n $project = self::createProject(\n $name,\n $leader,\n array_var($additional, 'overview'),\n array_var($additional, 'company'),\n array_var($additional, 'category'),\n $template,\n array_var($additional, 'first_milestone_starts_on'),\n $based_on,\n array_var($additional, 'label_id'),\n array_var($additional, 'currency_id'),\n array_var($additional, 'budget'),\n array_var($additional, 'custom_field_1'),\n array_var($additional, 'custom_field_2'),\n array_var($additional, 'custom_field_3')\n );\n\n // Add leader and person who created a project to the project\n $project->users()->add($logged_user);\n\n if($logged_user->getId() != $leader->getId()) {\n $project->users()->add($leader);\n } // if\n\n // If project is created from a template, copy items\n if($template instanceof ProjectTemplate) {\n $positions = array_var($additional, 'positions', array());\n $template->copyItems($project, $positions);\n\n ConfigOptions::removeValuesFor($project, 'first_milestone_starts_on');\n\n // In case of a blank project, import users and master categories\n } else {\n Users::importAutoAssignIntoProject($project);\n $project->availableCategories()->importMasterCategories($logged_user);\n } // if\n\n // Close project request or quote\n if($based_on instanceof ProjectRequest) {\n $based_on->close($logged_user);\n } elseif($based_on instanceof Quote) {\n $based_on->markAsWon($logged_user);\n } // if\n\n EventsManager::trigger('on_project_created', array(&$project, &$logged_user));\n\n DB::commit('Project created @ ' . __CLASS__);\n\n return $project;\n } catch(Exception $e) {\n DB::rollback('Failed to create a project @ ' . __CLASS__);\n throw $e;\n } // try\n }", "public function a_project_require_a_description()\n {\n $project = factory(Project::class)->raw(['description' => '']);\n $this->post('/api/projects', $project)->assertStatus(422)->assertJsonStructure([\n 'errors' => [\n 'description',\n ],\n ]);\n }", "public function testAccessAdminCreatePage()\n {\n $user = factory(User::class)->create();\n $response = $this->actingAs($user)\n ->get(route('admin.project.create'));\n\n $response->assertSuccessful();\n\n }", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function create_project( $options ) {\n\n\t\tif ( ! isset( $options['project_name'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\t$defaults = array(\n\t\t\t'project_status' => 'Active',\n\t\t\t'include_jquery' => FALSE,\n\t\t\t'project_javascript' => null,\n\t\t\t'enable_force_variation' => FALSE,\n\t\t\t'exclude_disabled_experiments' => FALSE,\n\t\t\t'exclude_names' => null,\n\t\t\t'ip_anonymization' => FALSE,\n\t\t\t'ip_filter' => null,\n\t\t);\n\n\t\t$options = array_replace( $defaults, $options );\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "public function run()\n {\n \n $faker = Faker::create();\n for($i=0; $i<=20; $i++):\n DB::table('projects')->insert([\n 'user_id'=>$faker->numberBetween(0,10),\n 'contributor_id'=>$faker->numberBetween(0,2),\n 'title'=>$faker->sentence,\n 'category'=>$faker->sentence,\n 'current_budget'=>$faker->numberBetween(0,1000000),\n 'budget'=>$faker->numberBetween(1000,100000),\n 'contributors_number'=>$faker->numberBetween(0,956),\n 'duration'=>$faker->numberBetween(30,240),\n 'progression'=>$faker->numberBetween(0,100),\n 'contact'=>$faker->numberBetween(8,11),\n ]);\n endfor;\n }", "public function run(Faker $faker)\n {\n\n // We'll be adding projects to every user\n foreach (User::all() as $user) {\n $projects = factory(Project::class, 3)->create([\n 'user_id' => $user->id\n ])->each(function ($project) use ($faker) {\n\n factory(ProjectDescription::class, 1)->create([\n 'project_id' => $project->id,\n 'order' => 0,\n ])->each(function ($description) {\n Project::find($description->project_id)->descriptions()->save($description);\n });\n\n factory(ProjectDescription::class, 1)->create([\n 'project_id' => $project->id,\n 'order' => 1,\n 'type' => 'image_left',\n 'image_id' => factory('App\\File')->create([\n 'name' => 'Project image',\n 'path' => $faker->imageUrl(700, 500, 'cats',true)\n ])->id\n ])->each(function ($description) {\n Project::find($description->project_id)->descriptions()->save($description);\n });;\n\n factory(ProjectDescription::class, 1)->create([\n 'project_id' => $project->id,\n 'order' => 2,\n ])->each(function ($description) {\n Project::find($description->project_id)->descriptions()->save($description);\n });;\n\n factory(ProjectDescription::class, 1)->create([\n 'project_id' => $project->id,\n 'order' => 3,\n 'type' => 'image_right',\n 'image_id' => factory('App\\File')->create([\n 'name' => 'Project image',\n 'path' => $faker->imageUrl(700, 500, 'cats',true)\n ])->id\n ])->each(function ($description) {\n Project::find($description->project_id)->descriptions()->save($description);\n });;\n\n factory(ProjectDescription::class, 1)->create([\n 'project_id' => $project->id,\n 'order' => 4,\n ])->each(function ($description) {\n Project::find($description->project_id)->descriptions()->save($description);\n });;\n });\n\n }\n\n }", "public function store(CreateProject $request)\n {\n $project = new Project();\n $project->setAttributes($request->all());\n $project->save();\n\n return response()->json($project, $status = 201)->setStatusCode(201);\n }", "public function run()\n {\n DB::table('project_tasks')->delete();\n $json = File::get(\"database/data/project_tasks.json\");\n $data = json_decode($json);\n foreach ($data as $obj) {\n \\App\\ProjectTask::create(array(\n 'id' => $obj->id,\n 'project_id' => $obj->project_id,\n 'absolute_day' => $obj->absolute_day,\n 'name' => $obj->name,\n 'story_id' => $obj->story_id\n ));\n }\n }", "public function test_create_task()\n {\n \n $response = $this->post('/task', [\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '12:22',\n 'project_id' => 1,\n ]);\n $response->assertStatus(302);\n }", "public function setUp(): void\n {\n try {\n self::extractStubProject('example_project.zip');\n self::extractStubProject('no_tags_project.zip');\n } catch (\\RuntimeException $exception) {\n $this->fail($exception->getMessage());\n }\n parent::setUp();\n }", "public function testCreate()\n {\n $model = $this->makeFactory();\n \n $this->json('POST', static::ROUTE, $model->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_CREATED) \n ->seeJson($model->toArray());\n }", "public function test_create_task_all_fields_correct()\n {\n\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = User::factory()->create()->createToken('my-app-token')->plainTextToken;\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(201)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Task created successfully.\");\n }", "public function testAddPackingPlanFile()\n {\n }", "public function actionCreate()\n {\n $model = new Project();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n OperationRecord::record($model->tableName(), $model->pj_id, $model->pj_name, OperationRecord::ACTION_ADD);\n return $this->redirect(['view', 'id' => $model->pj_id]);\n }\n\n if (Yii::$app->request->isPost) {\n Yii::$app->session->setFlash('error', Yii::t('app', 'Create project failed!'));\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function postProject() {\r\n $this->clientOwnsAccount();\r\n $this->checkMandatoryFields(FALSE, 400200);\r\n $this->checkReadOnlyFields(FALSE, 400201);\r\n if ($this->usertype != 'api-tenant') {\r\n $this->checkReadOnlyFields($this->tenantfields, 400201);\r\n }\r\n $projectArray = self::setProjectArray();\r\n\r\n $project = $projectArray['project'];\r\n $control = $projectArray['control'];\r\n\r\n $personalized = isset($project['personalization_mode']);\r\n if ($project['testtype'] == OPT_TESTTYPE_TEASER && $personalized && $project['personalization_mode'] != OPT_PERSOMODE_NONE) {\r\n throw new Exception('personalizationmode', 400004);\r\n }\r\n\r\n $completePerso = ($personalized && $project['personalization_mode'] == OPT_PERSOMODE_COMPLETE);\r\n $noControlRule = (!isset($control['rule_id']) || $control['rule_id'] <= 0);\r\n if ($completePerso && $noControlRule) {\r\n throw new Exception('When personalizationmode is set to COMPLETE, a valid ruleid is mandatory', 400200);\r\n }\r\n\r\n $lpcid = self::insertProject($project);\r\n\r\n if (!is_int($lpcid) || $lpcid <= 0) {\r\n throw new Exception('The project could not be created', 500);\r\n }\r\n $response = self::insertControl($control, $lpcid);\r\n $this->optimisation->flushCollectionCache($lpcid);\r\n return $response;\r\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n\n Project::truncate();\n\n foreach(range(1,30) as $index)\n {\n Project::create([\n 'title' => $faker->text(128),\n 'description' => $faker->text(300),\n ]);\n }\n }", "public function run()\n {\n $faker = Faker\\Factory::create();\n $limit = 100;\n $foreignPo = DB::table('users AS u')\n ->where('role', 'Project Owner')\n ->get();\n \n $minHarga = $faker->numberBetween(3, 7);\n for ($i=0; $i < $limit; $i++) { \n DB::table('projects')->insert([\n 'id_po' => $foreignPo[$faker->numberBetween(0, sizeof($foreignPo)-1)]->id,\n 'nama' => $faker->sentence($nbWords = 3, $variableNbWords = true),\n 'min_harga' => strval($minHarga) . '000000',\n 'max_harga' => strval($minHarga+$faker->numberBetween(1, 3)) . '000000',\n 'duration' => $faker->numberBetween(3, 7),\n 'desain' => $faker->numberBetween(0, 1),\n 'deskripsi' => $faker->paragraph($nbWords = 4, $variableNbWords = true)\n ]);\n }\n }", "public function testCreatePatrimonio()\n {\n }" ]
[ "0.7153427", "0.7153302", "0.71247894", "0.6972111", "0.6698196", "0.66626316", "0.6662225", "0.6629134", "0.64922935", "0.6370959", "0.63647586", "0.6334146", "0.6322571", "0.6286674", "0.6244069", "0.61830956", "0.61817753", "0.61736554", "0.615833", "0.61153346", "0.61009496", "0.6085048", "0.60568523", "0.6044372", "0.60154814", "0.6004302", "0.600101", "0.5987144", "0.59779835", "0.59727407", "0.5969845", "0.5968864", "0.596148", "0.59378785", "0.5905077", "0.58969915", "0.5887892", "0.58368874", "0.5820883", "0.58167946", "0.5795021", "0.5792035", "0.57881564", "0.57879496", "0.5787239", "0.5781492", "0.57805455", "0.57743514", "0.57742083", "0.57696694", "0.5745308", "0.57429475", "0.573067", "0.5723691", "0.5717245", "0.56949425", "0.56854063", "0.56666285", "0.5664476", "0.56635696", "0.5661079", "0.5660816", "0.566029", "0.5660072", "0.5656713", "0.5642143", "0.56379366", "0.5635785", "0.5626143", "0.56237584", "0.5604409", "0.55992526", "0.5576817", "0.55687976", "0.5568075", "0.55587107", "0.55581945", "0.55562025", "0.5548981", "0.5545213", "0.5535304", "0.5529899", "0.5523437", "0.552115", "0.55202734", "0.551408", "0.55133927", "0.5503453", "0.54986846", "0.5497279", "0.5485803", "0.5480733", "0.5479859", "0.54735994", "0.5468963", "0.5465736", "0.5454169", "0.5452252", "0.54434615", "0.5435993" ]
0.82499796
0
Testing the project listing method
public function testListProjects() { echo "\nTesting project listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/projects"; $response = $this->curl_get($url); //echo "\n-------testListProjects Response:".$response."\n"; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProjectListCanBeGenerated()\n {\n $title = \"Test Name\";\n $description = \"A Test Project\";\n $image = \"TestImage.png\";\n $this->createTestProject($title, $description, $image);\n\n $title2 = \"Test Name2\";\n $description2 = \"A Test Project2\";\n $image2 = \"TestImage.png2\";\n $this->createTestProject($title2, $description2, $image2);\n\n $projectsApi = new ProjectList($this->getDb());\n $answer = $projectsApi->get();\n\n $items = $answer['items'];\n $this->assertCount(2, $items, \"Two projects were created, so there should be 2 entries in the array\");\n\n $project = $items[0];\n $this->assertEquals($title, $project['title']);\n $this->assertEquals($description, $project['description']);\n $this->assertEquals(\"Default\", $project['imageType']);\n }", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "public function getProjects();", "public function getProjects()\n {\n }", "public function user_can_view_all_projects()\n {\n $this->get('/api/projects')\n ->assertStatus(200)\n ->assertJsonStructure(['data']);\n }", "public function testVolunteerHourIndexForProjectSuccess_ProjectItemManager()\n {\n // Set test user as current authenticated user\n $this->be($this->projectManager);\n \n $this->session([\n 'username' => $this->projectManager->username, \n 'access_level' => $this->projectManager->access_level\n ]);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/project/'.$projectID);\n \n $this->assertContains('Volunteer Hours for', $response->getContent());\n }", "public function testGettingStartedListing()\n\t{\n\t\t$oSDK=new BrexSdk\\SDKHost;\n\t\t$oSDK->addHttpPlugin($this->oHostPlugin);\n\n\n\t\t//Let's get company details to start\n\t\t$oTeamClient=$oSDK->setAuthKey($this->BREX_TOKEN) #consider using a token vault\n\t\t\t\t->setupTeamClient();\n\n\t\t/** @var BrexSdk\\API\\Team\\Client */\n\t\t$oTeamClient;\n\n\t\t//... OR\n\t\t//if you will be doing work across the API, use the follow convenience method\n\t\t$oTeamClient=$oSDK->setupAllClients()->getTeamClient();\n\t\t//etc...\n\n\t\t/** @var BrexSdk\\API\\Team\\Model\\CompanyResponse */\n\t\t$aCompanyDetails=$oTeamClient->getCompany();\n\n\t\t$sCompanyName=$aCompanyDetails->getLegalName();\n\t\t// ACME Corp, Inc.\n\t\tcodecept_debug($sCompanyName);\n\t\t$this->assertStringContainsString('Nxs Systems Staging 01', $sCompanyName);\n\t}", "public function get_project_all(){\n }", "public function index()\n {\n try{\n return response(ProjectResource::collection(Project::all()));\n } catch(Exception $e) {\n return $this->errorResponse($e);\n }\n }", "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function test_it_shows_manage_projects_page()\n {\n $this->browse(function (Browser $browser) {\n $browser\n ->loginAs(1)\n ->visit('/admin/projects')\n ->assertSee('Manage Projects')\n ->screenshot('admin/manage-projects');\n });\n }", "function all_projects(){\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in){\n $this->set('logged_in', $logged_in);\n $this->set('active_tab', 'projects');\n $this->set('projects', $project->getAll());\n }else $this->redirect();\n }", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "public function a_project_can_be_shown_with_all_payments()\n {\n $unseenUser = factory(Client::class)->create(['name' => 'Unseen User']);\n $unseenProject = factory(Project::class)->create(['title' => 'Unseen Project', 'client_id' => $unseenUser]);\n\n $client = factory(Client::class)->create(['name' => 'John Doe']);\n $project = factory(Project::class)->create(['title' => 'My First Project', 'client_id' => $client->id]);\n\n $response = $this->get(\"/client/{$client->id}/project/{$project->id}\");\n $response->assertStatus(200);\n\n $response->assertSee('My First Project');\n }", "public function testGetAll()\n {\n $ret =\\App\\Providers\\ListsServiceProvider::getLists();\n \n $this->assertNotEmpty($ret);\n }", "public function get_project_list_get()\n {\n \t$result = $this->Post_project_model->get_project_list();\n \treturn $this->response($result);\n }", "public function testListPeople()\n {\n }", "public function index()\n {\n $Project = Project::paginate();\n return ProjectResource::collection($Project);\n }", "public function test_list()\n {\n $response = $this->get('/proposal/all');\n\n $response->assertSee('data-js-proposal-cards');\n\n $response->assertSee('card-header');\n\n $response->assertStatus(200);\n }", "public function listProjects(ProjectListRequest $request)\n {\n $sorting = $request->getSortKey();\n $friendly = $request->getSortKeyFriendly();\n $order = $request->getSortOrderFriendly();\n \n return $request->renderViewOrEmpty('projects', compact(['sorting', 'friendly', 'order']));\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testListSiteContainers()\n {\n }", "public function show()\n {\n $service = Config::get(\"ProjectLister::service\");\n $method = \"fetch_$service\";\n // Fetch\n $projects = self::$method();\n // Sort the list\n $projects = Project::sort( $projects );\n\n $output = '';\n foreach($projects as $project)\n {\n $template = ( Config::get(\"ProjectLister::template\") ) ? Config::get(\"ProjectLister::template\") : Project::getProjectTemplate();\n\n $template = str_replace('{{PROJECT_URL}}', $project->url, $template);\n $template = str_replace('{{PROJECT_NAME}}', htmlentities($project->name), $template);\n $template = str_replace('{{PROJECT_WATCHER_COUNT}}', $project->watchers, $template);\n $template = str_replace('{{PROJECT_DESCRIPTION}}', htmlentities($project->description), $template);\n $template = str_replace('{{PROJECT_SOURCE}}', $project->source, $template);\n $template = str_replace('{{PROJECT_WATCHER_NOUN}}', $project->watcher_noun, $template);\n\n $output .= $template . \"\\n\";\n }\n return $output;\n }", "public function testListSites()\n {\n }", "public function index() {\n $sortby = Input::get('sortby');\n $order = Input::get('order');\n// Retrieve all projects from the database\n\n if ($sortby && $order) {\n $projectList = $this->projectRepo->orderBy($sortby, $order);\n } else {\n $projectList = $this->projectRepo->getAllProjects();\n }\n\n// Return that to the list view\n return View::make('project.index', compact('sortby', 'order'))->with('projects', $projectList);\n }", "public function testSeeTaskButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertSee(__(\"project.add_task\"));\n }", "public function run()\n\t{\n\t\t$projects = [\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Caerus',\n\t\t\t\t\"description\" => 'Caerus is a free service to job seekers, where you can upload a resume, search for jobs, save them and apply to them directly. Employers may also keep track of their candidates and maintain a history of the interview progress.',\n\t\t\t\t\"photo\" => 'projects/caerus.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Hermes',\n\t\t\t\t\"description\" => 'Hermes is a free instant messaging app available on the web. It allows you to send text messages to other users one-on-one.',\n\t\t\t\t\"photo\" => 'projects/hermes.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'SiSr',\n\t\t\t\t\"description\" => 'SiSr is a web app that allows you to order your food at your favorite restaurant without the need of interacting with the waiters, simply choose your grub, confirm and await!',\n\t\t\t\t\"photo\" => 'projects/sisr.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Agora',\n\t\t\t\t\"description\" => 'An online marketplace where you can buy and sell anything, anywhere at anytime!',\n\t\t\t\t\"photo\" => 'projects/agora.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Artemis',\n\t\t\t\t\"description\" => 'A bug tracking software meant for software development companies',\n\t\t\t\t\"photo\" => 'projects/artemis.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'Aletheia',\n\t\t\t\t\"description\" => 'No information provided',\n\t\t\t\t\"photo\" => 'projects/aletheia.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Basa Capital',\n\t\t\t\t\"description\" => 'The static version of the website of Basa Capital (https://portalweb.basacapital.com.py)',\n\t\t\t\t\"photo\" => 'projects/ui-basa-capital.png',\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"status_id\" => 1,\n\t\t\t\t\"name\" => 'UI Raices',\n\t\t\t\t\"description\" => 'The static version of the website of Raices (https://usuarios.raices.com.py/login)',\n\t\t\t\t\"photo\" => 'projects/ui-raices.png',\n\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Merkto',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'A business-to-business (B2B) ecommerce, purchase goods from anywhere in Paraguay!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/merkto.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Gymmer',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Manage your customers data such as routines, schedules, muscle priorities, monthly payments/installments and more!',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/gymmer.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t[\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status_id\" => 1,\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\" => 'Matse',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\" => 'Software meant to manage all the real estate properties of Matse S.A.',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"photo\" => 'projects/matse.png',\n\t\t\t//\t\t\t\t\t\t\t\t\t\t\t\t],\n\t\t];\n\n\t\tforeach ($projects as $project) {\n\t\t\t$new_project = new Project();\n\t\t\t$new_project->status_id = $project['status_id'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->description = $project['description'];\n\t\t\t$new_project->photo = $project['photo'];\n\t\t\t$new_project->name = $project['name'];\n\t\t\t$new_project->started_at = now()->subDays(rand(30, 120));\n\t\t\t$new_project->save();\n\t\t}\n\n\t}", "function getProjectList()\n\t{\n\t\t//Update Project List\n\t\t$this->Project_List = null;\n\t\t$assigned_projects_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Project');\n\t\tforeach($assigned_projects_rows as $assigned_project)\n\t\t\t$this->Project_List[] = new Projects( $assigned_project['ClientProjectTask'] );\n\t\treturn $this->Project_List;\n\t}", "public static function projectList() {\n\t\tif(!Authenticate::isAuthorized()) {\n \t\t throw new NotifyException(\"You are not authorized for this method\", 1);\n \t}\n else {\n\t\t\t$api_end_point = \"project\";\n\t\t\t$request_data=[];\n\t\t\treturn Request::sendRequest($api_end_point, $request_data);\n\t\t}\n\t}", "public function Query() {\n return FactoryService::ProjectService()->GetList()->ToList();\n }", "public function testProjectProjectIDInviteGet()\n {\n }", "function VM_projects() { return bList::getListInstance(myOrg_ID,'bList_vm_projects'); }", "function index() {\n\t\t$this->Project->recursive = 0;\n\t\t$this->set('projects', $this->paginate());\n\t}", "function project_overview(){\n extract($this->_url_params);\n /**\n * @var int $project_id\n */\n if(!isset($project_id)){\n $this->redirect();\n exit();\n }\n\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n\n if($logged_in){\n if((string) ((int) $project_id) == $project_id AND $project->verify($project_id)){\n $this->set('logged_in', $logged_in);\n $this->set('project_id', $project_id);\n $this->set(Constants::ACTIVE_TAB, 'projects');\n $this->set('isTheLastProject', (new LastProjects())->isA($project_id));\n $this->set('dissimilarity_index', (new ProjectConfig())->dissimilarity_indexes);\n $this->set('isAPendingProject', (new PendingProjects())->isA($project_id));\n $this->set('project_info', $project->get($project_id));\n $project->set_seen($project_id);\n }else{\n $this->redirect(Config::WEB_DIRECTORY . 'projects');\n }\n }else{\n $this->redirect();\n }\n }", "public function indexPage(FunctionalTester $I)\n {\n $I->wantTo('Check if projects index page is rendered correctly');\n $I->cantAccessAsGuest(['projects/index']);\n $I->amLoggedInAs(1002);\n $I->amOnPage(['projects/index']);\n $I->seeResponseCodeIs(200);\n $I->seeCurrentUrlEquals(['projects/index']);\n $I->see('Projects');\n }", "function getProjectList() {\n\n\t$outFileNew = \"/var/www/html/projectList.new\";\n\t$outFileOrig = \"/var/www/html/projectList.txt\";\n\t$repos = array();\n\t$lodRE = '/br_[0-9]+.[0-9]+.[0-9]+/';\n\t$github_repos_url = 'https://github.com/api/v2/json/repos/show/CanoeVentures'; \n\t$curlResponse = curlRequest($github_repos_url);\n\n\tif (empty($curlResponse)) {\n\t\tprint \"Sorry - no data was returned.<p>\";\n\t}\n\telse {\n\t\t$jsonResult = json_decode($curlResponse);\t\t\n\t\tforeach($jsonResult->repositories as $r) {\n\t\t\t$repos[] = $r->name;\t\n\t\t}\n\t}\n\tsort($repos);\n\t$valid_branch = \" \";\n $valid_tag = \" \";\n\t$fileHandle = fopen($outFileNew, 'w') or die(\"cannot open file \" . $outFileNew);\n\tforeach ($repos as $repo) {\n\t\t$curlResponse = curlRequest($github_repos_url . '/' . $repo . '/branches');\t\t\n\t\t$jsonResult = json_decode($curlResponse);\n\t\tsleep(2);\n\t\t\n\t\tforeach($jsonResult->branches as $key => $val) {\n\t\t\tif (preg_match($lodRE, $key)) {\n\t\t\t\t$valid_branch = \"true\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_branch = \"false\";\n\t\t\t}\n\t\t}\n\t\tif ($valid_branch == \"true\") {\n\t\t\tfwrite($fileHandle, $repo . \"=enabled\\n\");\n\t\t\t$valid_branch = \"false\";\n\t\t}\n\t\telse {\n\t\t\tfwrite($fileHandle, $repo . \"=disabled\\n\");\n\t\t}\t\t\n\t}\n\tfclose($fileHandle);\n\t// may need to put in a semaphore here\n\tcopy($outFileNew, $outFileOrig);\n}", "public function test_project($project_url)\n {\n $user = Auth::user();\n $project = Project::where('project_url', $project_url)->firstOrFail();\n if ($project->project_active == 1) {\n $content = view('pages.project_home_2', compact('project', 'user'));\n $response = response($content);\n $response->header('Cache-Control', 'max-age=5, public');\n return $response;\n }\n else {\n return redirect(env('PROJECT_URL'));\n }\n }", "public function getProjectList() { \n $q = Doctrine_Query::create()->from('Project')\n ->orderBy('id');\n \n return $q->execute(); \n }", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function index()\n {\n return new ProjectCollection(Project::paginate());\n }", "public function index() {\n\n $projects = Project::whereRaw('1=1')->get();\n //->paginate(self::COUNT_PER_PAGE);\n\n return view('backend.project.list', [\n 'projects' => $projects\n ]);\n }", "public function testList()\n {\n \t$games_factory = factory(Game::class, 3)->create();\n \t$games = Game::all();\n \t\n $this->assertCount(3, $games);\n }", "public function testIndex()\n {\n // $this->assertTrue(true);\n $response = $this->json('get','/api/todos');\n $this->seeJsonStructure($response, [\n '*' => [\n 'id', 'status', 'title', 'created_at', 'updated_at'\n ]\n ]);\n }", "public function index()\n {\n $projects = Project::all();\n return ProjectResource::collection($projects);\n }", "function imedea_project_list( $atts ){\n\textract(shortcode_atts(array(\n\t\t'page_id' => $_GET[\"page_id\"],\n\t\t'type' => $_GET[\"type\"],\n\t\t'research_unit_id' => $_GET[\"research_unit_id\"],\n\t\t'year' => $_GET[\"year\"],\n\t\t'search' => $_GET[\"search\"],\n\t\t'title'=> $_GET[\"title\"],\n\t\t'person_id' => $_GET[\"person_id\"],\n\t\t'showall' => $_GET[\"showall\"],\n\t), $atts));\n\t\n\t$iapi_plugin_options = get_option('iapi_plugin_options');\n\t$webapi_url = $iapi_plugin_options['webapi_url'];\n\t//$page_detail_id = $iapi_plugin_options['prj_detail_page_id'];\n\t$page_length = $iapi_plugin_options['webapi_pagination_length'];\n\t\n\tob_start();\n\t\n\t/* search pannel */\n\tproject_filter_pannel($webapi_url, $type, $research_unit_id, $year, $title);\n\t\n\t/* show applied filters */\n\tshow_project_filters($person_id);\n\t\n\t\n\t$count = get_projects($webapi_url, $page_length, $research_unit_id, $year, $type, $title, $person_id, $showall);\n\t\n\t/* Pagination */\n\tpagination ($page_length, $type, $count, $research_unit_id, $year, $title, $person_id, null);\n\t\n\treturn ob_get_clean();\n\t\n}", "public function test_list_page_shows_all_tasks()\n {\n\n // creiamo dei task e ci assicuriamo che nella vista ci siano un certo particolare set di dati\n // i assicuro che alla vista venga passata la ariabile dal controller ma non che sia stampata nella vista\n\n $task1 = factory(Task::class)->create();\n $task2 = factory(Task::class)->create();\n\n $this->get('tasks')\n ->assertViewHas('tasks')\n ->assertViewHas('tasks', Task::with('actions')->get())\n ->assertViewHasAll([\n 'tasks' => Task::with('actions')->get(),\n 'title' => 'Tasks page'\n ])->assertViewMissing('dogs');\n }", "function list(int $page=1): Response{\n return $this->method([\n 'path' => 'projects/?page='.$page,\n 'method' => 'GET'\n ]);\n }", "public function testSeeMemberButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertSee(__(\"project.add_member\"));\n }", "public function test_listSettings() {\n\n }", "public function testGetSubprojects() {\n\t\t$t_project_name = $this->getNewProjectName();\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_projects_array = $this->client->mc_project_get_all_subprojects( $this->userName, $this->password, $t_project_id );\n\n\t\t$this->assertCount( 0, $t_projects_array );\n\t}", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "public function index()\n {\n $projects = Project::all();\n\n return $this->showAll($projects);\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }", "public function getList() {\n $projects = Project::all();\n\n return response()->success(compact('projects'));\n }", "public function testJobList()\n {\n\n }", "public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }", "public function index()\n\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM project \");\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\t}", "public function index()\n\t{\n\t\treturn Project::all();\n\t}", "public function index(){\n return Responser::ok('Projects available',Auth::user()->companies->reduce(function($carry,$company){\n $company->projects->each(function($project) use(&$carry){\n $project->load('company');\n $carry[] = $project;\n });\n\n return $carry;\n },[]));\n }", "public function index($project = null)\n {\n //\n var_dump($project);\n }", "public function testIsOnTasksListPage()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $this->client->request('GET', '/tasks');\n\n $response = $this->client->getResponse();\n $responseContent = $response->getContent();\n\n $statusCode = $response->getStatusCode();\n $this->assertEquals(200, $statusCode);\n $this->assertContains($this->task->getTitle(), $responseContent);\n $this->assertContains($this->task->getContent(), $responseContent);\n }", "public function indexAction()\n {\n /** @var \\Doctrine\\ORM\\EntityManager $em */\n $em = $this->getDoctrine()->getManager();\n $username = $this->getUser()->getUsername();\n $entity = new Project();\n if (false === $this->get('security.authorization_checker')->isGranted('VIEW_LIST', $entity, $username)) {\n $entities = $em->getRepository('OroProjectBundle:Project')->findByProjectMember($this->getUser()->getId());\n } else {\n $entities = $em->getRepository('OroProjectBundle:Project')->findAll();\n }\n return array(\n 'entities' => $entities,\n );\n }", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function index()\n {\n return Project::where('user', auth()->user()->id)->paginate(10);\n }", "public function testListPastWebinarQA()\n {\n }", "function getProjects(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t $result = false;\n\t\t \n\t\t $sql = \"SELECT count(actTab.uuid) AS recCount, project_list.project_id, project_list.project_name\n\t\t FROM \".$this->penelopeTabID.\" AS actTab\n\t\t JOIN space ON actTab.uuid = space.uuid\n\t\t JOIN project_list ON space.project_id = project_list.project_id\n\t\t GROUP BY space.project_id \n\t\t \";\n\t\t \n\t\t $result = $db->fetchAll($sql);\n\t\t if($result){\n\t\t\t\t$projects = array();\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t $name = $row[\"project_name\"];\n\t\t\t\t\t $count = $row[\"recCount\"] + 0;\n\t\t\t\t\t $uuid = $row[\"project_id\"];\n\t\t\t\t\t $uri = self::projectBaseURI.$uuid;\n\t\t\t\t\t $projects[$uri] = array(\"name\" => $name, \"count\" => $count);\n\t\t\t\t}//end loop\n\t\t\t\t\n\t\t\t\t$projects = $this->orderURIs($projects);\n\t\t\t\t$this->projects = $projects;\n\t\t }//end case with results\n\t \n\t }", "public function testListaProdutoTest()\n {\n $response = $this->get('/pedidos');\n $response->assertStatus(200);\n\n }", "public function index()\n {\n $projects = new ProjectsResource(\n $this->project->with(['company:id,name,primary_contact'])\n ->orderByDesc('id')\n ->paginate(50)\n );\n return response($projects, Response::HTTP_OK);\n }", "public function index()\n {\n $projects = Project::getAll();\n require_once('views/projects/index.php');\n }", "public function testGetList()\n {\n $result = $this->getQueryBuilderConnection()\n ->select('field')\n ->from('querybuilder_tests')\n ->where('id', '>', 7)\n ->getList();\n\n $expected = [\n 'iiii',\n 'jjjj',\n ];\n\n $this->assertEquals($expected, $result);\n }", "public function chooseProjectAction() { \n\n //ONLY LOGGED IN USER CAN EDIT THE STYLE\n if (!$this->_helper->requireUser()->isValid())\n return; \n $this->view->TabActive = 'projects';\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer(); \n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $this->view->parent_id = $sitereview->getIdentity();\n $this->view->parent_type = $sitereview->getType();\n $listingtype_id = $sitereview->listingtype_id; \n\n //IF ADMIN HAVE SELECTED ANY PROJECT FOR LISTING PROFILE THAN DO NOT SHOW THE PROJECTS TAB OF DASHBAORD\n $adminSelectedProject = Engine_Api::_()->sitecrowdfunding()->adminSelectedProject(\"sitereview_index_view_listtype_\".$listingtype_id);\n if(!empty($adminSelectedProject)) {\n return;\n }\n //SET sitereview SUBJECT\n Engine_Api::_()->core()->setSubject($sitereview);\n if (!$sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$listingtype_id\")) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n } \n //CAN EDIT OR NOT\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n } \n $this->view->form = $form = new Sitecrowdfunding_Form_ChooseProjectContentModule(array('item' => $sitereview));\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n } \n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n }", "public function a_user_can_see_single_project()\n {\n $project = factory(Project::class)->create();\n\n $this->get('/api/projects/' . $project->id)->assertStatus(200)->assertJson([\n 'data' => [\n 'id' => $project->id,\n 'name' => $project->name,\n 'description' => $project->description,\n ],\n ]);\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function testPsWithprojectOption()\n {\n $composeFiles = new ComposeFileCollection(['docker-compose.test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n\n $this->assertEquals($this->mockedManager->ps($composeFiles), 'ok');\n }", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public function displayTask()\n {\n $filters = array(\n 'start' => Request::getInt('start', 0),\n 'limit' => Request::getInt('limit', 20),\n 'search' => Request::getVar('search', ''),\n 'project' => Request::getVar('project', ''),\n 'authorized' => false,\n 'state' => 1,\n 'access' => User::getAuthorisedViewLevels()\n );\n\n $token = $this->getToken();\n if (!$token)\n {\n $this->redirect($url='login', null, null);\n }\n\n if ($this->config->get('access-manage-component'))\n {\n //$filters['state'] = null;\n $filters['authorized'] = true;\n array_push($filters['access'], 5);\n }\n\n $projects = $this->getProjects($token->get('access_token'), $this->getRadiamURL());\n if ($projects->count > 0) {\n $query = array();\n if (isset($filters['search'])) {\n $query[\"q\"] = $filters['search'];\n }\n\n $query[\"page\"] = $this->getRadiamPage($filters[\"start\"], $filters[\"limit\"]);\n $query[\"page_size\"] = $filters[\"limit\"];\n\n if (isset($filters[\"project\"])) {\n $foundProject = false;\n foreach ($projects->projects as &$project) {\n if ($project->id == $filters[\"project\"]) {\n $foundProject = true;\n }\n }\n if (!$foundProject) {\n $filters[\"project\"] = $projects->projects[0]->id;\n }\n\n } else {\n $filters[\"project\"] = $projects->projects[0]->id;\n }\n\n $files = $this->getFiles($token->get('access_token'), $this->getRadiamURL(), $filters[\"project\"], $query);\n } else {\n $files = new Files();\n }\n\n $pagination = new \\Hubzero\\Pagination\\Paginator($files->count, $filters[\"start\"], $filters[\"limit\"]);\n\n // Need to set any extra parameters for the pagination links to maintain the state\n if (isset($filters['search'])) {\n $pagination->setAdditionalUrlParam('search', $filters['search']);\n }\n\n $pagination->setAdditionalUrlParam('project', $filters[\"project\"]);\n\n // Output HTML\n $this->view\n ->set('config', $this->config)\n ->set('filters', $filters)\n ->set('projects', $projects)\n ->set('files', $files)\n ->set('pagination', $pagination)\n ->display();\n\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "public function show(projects $projects)\n {\n //\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function testListTasks()\n {\n $this->withoutMiddleware();\n $get = $this->json('GET','/api/v1/tasks');\n $this->assertResponseOk();\n $response = json_decode($get->response->getContent(), true);\n $this->assertNotNull($response, 'Test if is a valid json');\n $this->assertTrue(json_last_error() == JSON_ERROR_NONE, 'Test if the response was ok');\n $this->assertCount(0,$response, 'Test if query count is zero');\n //Test for a non empty list\n $tasks = factory(Task::class,2)->create();\n $get = $this->json('GET', 'api/v1/tasks');\n $this->assertResponseOk();\n $response = json_decode($get->response->getContent(), true);\n $this->assertNotNull($response, 'Test if is a valid json');\n $this->assertTrue(json_last_error() == JSON_ERROR_NONE, 'Test if the response was ok');\n $this->assertCount(2, $response, 'Test if query count is 2');\n\n $tasks->each(function($item, $key) use ($response){\n $this->assertObjectEqualsExclude($item,$response[$key]);\n });\n }", "public function index()\n {\n return Project::all();\n }", "public function index()\n {\n return Project::all();\n }", "public function callProjectList(array $params = array())\n {\n return $this->call('projekt/list', $params);\n }", "public function test_admin_usecase_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'usecase_list']);\n $this->assertResponseCode(404);\n }", "public function testListarProdutos()\n {\n $response = $this->get('/api/produtos/listar');\n\n $response->assertStatus(200);\n }", "public function testVolunteerHourIndexForContactSuccess_ProjectItemManager()\n {\n // Set test user as current authenticated user\n $this->be($this->projectManager);\n \n $this->session([\n 'username' => $this->projectManager->username, \n 'access_level' => $this->projectManager->access_level\n ]);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteer/'.$volunteerID);\n \n $this->assertContains('Volunteer Hours for', $response->getContent());\n }", "public function index()\n {\n $projects = Api::get('api/v1/project', Session::get('session.token'));\n return View::make('project::site.project.list', ['projects' => $projects]);\n }", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public function index()\n {\n $projects = DB::table('projects')->paginate(2);\n return view('admin.project.list', ['projects' => $projects]);\n }", "public function show(Project $project)\n {\n //\n }", "public function show(Project $project)\n {\n //\n }", "public function show(Project $project)\n {\n //\n }" ]
[ "0.7675274", "0.7533679", "0.73240674", "0.6958769", "0.6825947", "0.67746216", "0.6722368", "0.6618595", "0.6608486", "0.65395015", "0.6535697", "0.65319735", "0.6521899", "0.6504106", "0.64853233", "0.6474815", "0.64417684", "0.6433512", "0.63543683", "0.634552", "0.63204205", "0.6290253", "0.6278038", "0.6273303", "0.6250361", "0.6196481", "0.6174679", "0.6173015", "0.6168252", "0.6151117", "0.6149169", "0.61306757", "0.6124251", "0.6118675", "0.61184174", "0.61028934", "0.61011565", "0.6095969", "0.6093485", "0.60930914", "0.60887927", "0.6086314", "0.6071784", "0.60471267", "0.6046148", "0.60413957", "0.6038414", "0.6037795", "0.6034168", "0.60329133", "0.60298246", "0.6019851", "0.60168123", "0.6013466", "0.6009726", "0.60078794", "0.6002269", "0.5996227", "0.5994521", "0.59892243", "0.598627", "0.59859824", "0.5983442", "0.5983357", "0.59828526", "0.59611976", "0.59599113", "0.5957279", "0.5952451", "0.5944004", "0.5941044", "0.5932311", "0.5931844", "0.59302276", "0.5924262", "0.5919641", "0.59155566", "0.5912516", "0.5909563", "0.5905373", "0.58983064", "0.588996", "0.5885929", "0.5885253", "0.58848524", "0.58739066", "0.5869351", "0.5868527", "0.5868384", "0.5868384", "0.5865941", "0.58642733", "0.5863682", "0.58515817", "0.58501613", "0.58471555", "0.584474", "0.5844563", "0.5844563", "0.5844563" ]
0.7509086
2
Testing the project retreival by ID
public function testGetProjectByID() { echo "\nTesting the project retrieval by ID..."; $response = $this->getProject("P1"); //echo "\ntestGetProjectByID------".$response; $result = json_decode($response); $prj = $result->Project; $this->assertTrue((!is_null($prj))); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProject($id)\n {\n }", "private function getProject($id)\n {\n ///$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/projects/\".$id;\n \n echo \"\\ngetProject URL:\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "function get_project_by_id(WP_REST_Request $request) {\n\t\t// Set the initial return status\n\t\t$status = 200;\n\t\t// Get the submitted params\n\t\t$params = json_decode(json_encode($request->get_params()));\n\t\t// Build our return object\n\t\t$return_obj = new stdClass;\n\t\t$return_obj->success = true;\n\n\t\t$project = $this->dbconn->get_results( \"SELECT * FROM $this->project_table WHERE id = $params->id AND deleted = 0;\" );\n\t\t$formatted_return = new stdClass;\n\t\tif (!empty($project)) {\n\t\t\t$formatted_return->id = $params->id;\n\t\t\t$formatted_return->name = $project[0]->name;\n\t\t\t$formatted_return->type = $project[0]->type;\n\t\t\t$formatted_return->address = $project[0]->address;\n\t\t\t$formatted_return->start_timestamp = $project[0]->start_timestamp;\n\t\t} else {\n\t\t\t$this->add_error(\"Project does not exist.\");\n\t\t}\n\t\t// Set up the return object appropriately\n\t\t$return_obj->project = $formatted_return;\n\t\t// Format and return our response\n\t\treturn client_format_return($this, $return_obj, $status);\n\t}", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "private function getProject($id)\n {\n $projectApi = new Project($this->mainModel->getDb());\n $answer = $projectApi->get($id);\n\n if (isset($answer['error'])) {\n return false;\n } else {\n $this->project = $answer['project'];\n return true;\n }\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function fetchProjectID(): string;", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "function get(string $project_id): Response{\n return $this->method([\n 'path' => 'projects/'.$project_id,\n 'method' => 'GET'\n ]);\n }", "public function testGetIdFromName() {\n\t\t$t_project_name = $this->getNewProjectName();\n\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_project_idFromName = $this->client->mc_project_get_id_from_name(\n\t\t\t$this->userName, $this->password,\n\t\t\t$t_project_name\n\t\t);\n\n\t\t$this->assertEquals( $t_project_idFromName, $t_project_id );\n\t}", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function getProject($id){\n\n\t\t$this->db->select('*');\n\t\t$this->db->where('id', $id);\n\t\t$query = $this->db->get('project');\n\t\t$row = $query->row();\n\n\t\t$project = array(\n\t\t\t'id' => $row->id,\n\t\t\t'name' => $row->name,\n\t\t\t'aggregate_url' => $row->aggregate_url,\n\t\t\t'description' => $row->description,\n\t\t\t'sample_target' => $row->sample_target,\n\t\t\t'sample_target_bs' => $row->sampel_target_bs,\n\t\t\t'sampling_table' => $row->sampling_frame_table,\n\t\t\t'loc_columns' => $row->alloc_unit_columns,\n\t\t\t'start_date' => $row->start_date,\n\t\t\t'end_date' => $row->finish_date,\n\t\t\t'delete_status' => $row->delete_status,\n\t\t\t'date_created' => $row->date_created\n\t\t );\n\t\t return $project;\t\t\t\t\t\t\n\t}", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "protected function getRequestedProject()\n {\n $id = $this->getEvent()->getRouteMatch()->getParam('project');\n $p4Admin = $this->getServiceLocator()->get('p4_admin');\n\n // attempt to retrieve the specified project\n // translate invalid/missing id's into a 404\n try {\n return Project::fetch($id, $p4Admin);\n } catch (NotFoundException $e) {\n } catch (\\InvalidArgumentException $e) {\n }\n\n $this->getResponse()->setStatusCode(404);\n return false;\n }", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "public function get($id) {\n $sql =<<<SQL\nSELECT * from $this->tableName\nwhere id=?\nSQL;\n\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n $statement->execute(array($id));\n if($statement->rowCount() === 0) {\n return null;\n }\n\n return new Project($statement->fetch(PDO::FETCH_ASSOC));\n }", "public function readProject() \n {\n \n // use the fetch method from Request to get the id parameter\n dump($this->request->fetch('id'));\n \n // Or use the fetch property to from Request to get the id parameter\n dump($this->request->fetch->id);\n \n }", "static function getProjectById($pid){\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('SELECT *\n\t\t\t\tFROM projects\n\t\t\t\tWHERE id = :pid\n\t\t\t\t');\n\t\t$statement->execute(array(\n\t\t\t\t':pid' => $pid));\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif($row = $statement->fetch())\t{\n\t\t\t$project = new Project(\n\t\t\t\t\t$row[id],\n\t\t\t\t\t$row[name],\n\t\t\t\t\t$row[description],\n\t\t\t\t\t$row[start_date],\n\t\t\t\t\t$row[deadline],\n\t\t\t\t\t$row[end_date],\n\t\t\t\t\t$row[owner]);\n\t\t} else\n\t\t\tthrow new Exception(\"no project with such id.\");\n\n\t\treturn $project;\n\n\t}", "public function a_user_can_see_single_project()\n {\n $project = factory(Project::class)->create();\n\n $this->get('/api/projects/' . $project->id)->assertStatus(200)->assertJson([\n 'data' => [\n 'id' => $project->id,\n 'name' => $project->name,\n 'description' => $project->description,\n ],\n ]);\n }", "public static function getProjectDetails($id){\n\t\t$db = DemoDB::getConnection();\n\t\tProjectModel::createViewCurrentIteration($db);\n $sql = \"SELECT project.name as project_name, description, project.created_at, first_name, last_name, project_role.name as role_name, deadline, current_iteration.id as iteration_id\n\t\t\t\tFROM project\n INNER JOIN project_member\n\t\t\t\t\tON project.id = project_member.project_id\n INNER JOIN member\n\t\t\t\t\tON member_id = member.id\n INNER JOIN project_role\n\t\t\t\t\tON role_id = project_role.id\n\t\t\t\tLEFT OUTER JOIN current_iteration\n\t\t\t\t\tON project.id = current_iteration.project_id\n\t\t\t\tWHERE project.id = :id;\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n\t\t$ok = $stmt->execute();\n\t\tif ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function getProjectDetails($project_id){\n\t\t$url = \"/project/{$project_id}/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}", "public function testValidGetById() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations (just checking enough to make sure the right thing was obtained)\n\t\t$this->assertSame($retrievedOrg->data->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data->orgName, $this->VALID_NAME);\n\n\t}", "public function show($id)\n {\n return Project::find($id);\n }", "public function show($id)\n {\n return new ProjectResource(Project::findOrFail($id));\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "public function getProjectById($id)\n {\n $this->db->query(\"SELECT * FROM projects WHERE id = :id\");\n\n $this->db->bind(':id', $id);\n\n $row = $this->db->single();\n\n return $row;\n\n }", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "public function refProject($id){\n\t\n\t\t$boxes = $this->boxe->getByProject($id)->toArray();\n\t\t\n\t\treturn Response::json(array(\n \t'error' => false,\n\t\t\t'items' => $boxes\n\t\t\t),200 );\n\t}", "public function getSingle($p_id) {\n $project = Project::find($p_id);\n\n return response()->success(compact('project'));\n }", "public function getProject($id) {\n foreach ($this->_projects as $project) {\n if ($project->id == $id) return $project;\n }\n return false;\n }", "public function show($id)\n {\n if($this->service->checks($id) == false){\n return ['error'=>'Access Forbidden or Project Not Found'];\n }\n return $this->repository->find($id);\n\n }", "function getProject($id = null)\n {\n $where = '';\n if($id) $where = \" AND idproject = '{$id}'\";\n $query = $this->db->query(\"SELECT idproject, title, DATE_FORMAT(startdate,'%m/%d/%Y') as startdate,\n\t\t DATE_FORMAT(enddate,'%m/%d/%Y') as enddate, companyname, companyurl, companycontactperson, companycontactpersonemail,\n\t\t note, active\n FROM project\n WHERE active = 1 {$where}\n ORDER BY idproject DESC\");\n\t\treturn $query; \n /*if($query->num_rows() > 1){\n return $query->result_array();\n }else{\n return $query->row_array();\n }*/\t\n }", "public function project($projectId)\n {\n return $this->request('get', '/api/projects/'.$projectId);\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function getProjectById($id) {\r\n $params = array(\r\n COL_ID_USUARIO => $this->id_usuario,\r\n COL_ID_PROYECTO => $id\r\n );\r\n $proyecto = Database::preparedQuery(ProyectoFindById, $params);\r\n $tarjetas = Database::preparedQuery(TarjetasFindAllById, $params);\r\n $imagenes = Database::preparedQuery(ImagenesFindAllById, $params);\r\n return new Project($proyecto[0]['id_proyecto'], $proyecto[0]['nombre'], $proyecto[0]['description'], $proyecto[0]['flag_finish'], $proyecto[0]['flag_activo'], $proyecto[0]['fecha_creacion'], $proyecto[0]['fecha_actualizacion'], $tarjetas, $imagenes);\r\n }", "public function get_project( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }", "public function projects_get($id = \"0\",$type=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n \n $search = $this->input->get('search',TRUE);\n \n \n \n if(strcmp($type, \"0\")==0 && is_null($search))\n $result = $sutil->getProject($id,$from,$size);\n else if(strcmp($type, \"Documents\")==0)\n {\n $result = $sutil->getDocumentByProjectID($id,$from,$size);\n }\n else if(!is_null($search))\n {\n $result = $sutil->searchProject($search,$from,$size);\n }\n else\n {\n $result = array();\n $result['Error'] = \"Invalid input:\".$type;\n \n }\n \n $this->response($result);\n \n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "function GetProjectInfoBasedOnId($projId)\n {\n $ret = '';\n \n $sql = 'SELECT * ' .\n ' FROM PROJECTS ' .\n ' WHERE PROJECT_ID = ' . $projId;\n \n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $info = array();\n $info['name'] = $row['PROJECT_NAME'];\n $info['desc'] = $row['PROJECT_DESC'];\n $info['id'] = $row['PROJECT_ID'];\n $info['timestamp'] = $row['PROJECT_TIMESTAMP'];\n $ret = $info;\n }\n \n return $ret;\n }", "public function get_project_by_id ($project_id)\n {\n $this->where('project_id', $project_id);\n $project = $this->get('projects');\n //returns an array\n return $project;\n }", "public function projectSingle($id)\n {\n $project = Projects::where('id',$id)->get()->first();\n if ($project == null){\n abort('404');\n }\n $project = $project->toArray();\n $card = Card::where('project_id', $id)->get()->toArray();\n\n $rv = array(\n 'page' => 'projectsSingle',\n 'project' => $project,\n 'card' => $card,\n\n );\n\n return view('module.projectSingle')->with($rv);\n }", "function get_project_name_by_id($id)\n{\n $CI =& get_instance();\n $CI->db->select('name');\n $CI->db->where('id', $id);\n $project = $CI->db->get('tblprojects')->row();\n if ($project) {\n return $project->name;\n }\n\n return '';\n}", "public function fetchDetail(): void\n {\n $request = Certification::$request;\n\n $url = sprintf('%s/projects/%s', Certification::$endpoint, $this->id);\n $payload = $request->get($url)->throw()->json();\n\n $attributes = Arr::get($payload, 'data.attributes');\n\n conmsg(sprintf('Project ID: %s', Arr::get($attributes, 'id')));\n conmsg(sprintf('Project Name: %s', Arr::get($attributes, 'name')));\n conmsg(sprintf('Project Description: %s', Arr::get($attributes, 'description')));\n }", "function _check_project()\n {\n if (!$this->has_arg('pid'))\n $this->_error('No project id specified');\n if (!$this->has_arg('ty'))\n $this->_error('No item type specified');\n if (!$this->has_arg('iid'))\n $this->_error('No item id specified');\n\n\n $ret = 0;\n\n if (array_key_exists($this->arg('ty'), $this->types))\n {\n $t = $this->types[$this->arg('ty')];\n\n $rows = $this->db->pq(\"SELECT projectid FROM $t[0] WHERE projectid=:1 AND $t[1]=:2\", array($this->arg('pid'), $this->arg('iid')));\n\n if (sizeof($rows))\n $ret = 1;\n }\n\n $this->_output($ret);\n }", "function show_project() {\n require_once __DIR__ . '/../../../../lib/Gocdb_Services/Factory.php';\n require_once __DIR__ . '/../utils.php';\n require_once __DIR__ . '/../../../../htdocs/web_portal/components/Get_User_Principle.php';\n\n if (!isset($_GET['id']) || !is_numeric($_GET['id']) ){\n throw new Exception(\"An id must be specified\");\n }\n $projId = $_GET['id'];\n\n $serv=\\Factory::getProjectService();\n $project = $serv->getProject($projId);\n $allRoles = $project->getRoles();\n $roles = array();\n foreach ($allRoles as $role){\n if($role->getStatus() == \\RoleStatus::GRANTED &&\n $role->getRoleType()->getName() != \\RoleTypeName::CIC_STAFF){\n $roles[] = $role;\n }\n }\n\n //get user for case that portal is read only and user is admin, so they can still see edit links\n $dn = Get_User_Principle();\n $user = \\Factory::getUserService()->getUserByPrinciple($dn);\n $params['ShowEdit'] = false;\n if (\\Factory::getRoleActionAuthorisationService()->authoriseAction(\\Action::EDIT_OBJECT, $project, $user)->getGrantAction()) {\n $params['ShowEdit'] = true;\n }\n// if(count($serv->authorize Action(\\Action::EDIT_OBJECT, $project, $user))>=1){\n// $params['ShowEdit'] = true;\n// }\n\n // Overload the 'authenticated' key for use to disable display of personal data\n list(, $params['authenticated']) = getReadPDParams($user);\n\n // Add RoleActionRecords to params\n $params['RoleActionRecords'] = \\Factory::getRoleService()->getRoleActionRecordsById_Type($project->getId(), 'project');\n\n $params['Name'] = $project->getName();\n $params['Description'] = $project->getDescription();\n $params['ID']=$project->getId();\n $params['NGIs'] = $project->getNgis();\n $params['Sites']= $serv->getSites($project);\n $params['Roles'] =$roles;\n $params['portalIsReadOnly'] = portalIsReadOnlyAndUserIsNotAdmin($user);\n show_view('project/view_project.php', $params, $params['Name']);\n}", "public function show($project_id)\n {\n return $this->get('projects/'.$this->encodePath($project_id));\n }", "public function checkCorrectProject($id)\n {\n return $this->getProject($id);\n }", "public static function details($project_id) {\n\t\tif(!Authenticate::isAuthorized()){\n \t\t throw new NotifyException(\"You are not authorized for this method\", 1);\n \t}\n else {\n\t\t\t$request_data = ['id' => $project_id];\n\t\t\t$api_end_point = \"project/detail\";\n\t\t\treturn Request::sendRequest($api_end_point, $request_data);\n\t\t}\n\t}", "public static function getProjectById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM project WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Project($results[0]);\n } else {\n return null;\n }\n }", "public function testOpenProjectWithUser()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertStatus(200);\n }", "public function get($project);", "public function show($id)\n {\n $project = Project::find($id);\n\n if (is_null($project)) {\n Log::info(\"Unkown project with ID $id\");\n return Response::string(\n [\n 'code' => API_RETURN_404,\n 'messages' => [\"Unkown project with ID $id\"]\n ]\n );\n }\n\n Log::info('Found project ' . print_r($project->toArray(), true));\n return Response::string(['data' => $project->toArray()]);\n }", "public function show($id)\n {\n return response()->json(Project::find($id));\n }", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function show($id)\n {\n $project = Project::find($id);\n\n if (!$project) {\n return response()->json('Le projet n\\'existe pas.', 404);\n }\n\n return $project;\n }", "public function test_project($project_url)\n {\n $user = Auth::user();\n $project = Project::where('project_url', $project_url)->firstOrFail();\n if ($project->project_active == 1) {\n $content = view('pages.project_home_2', compact('project', 'user'));\n $response = response($content);\n $response->header('Cache-Control', 'max-age=5, public');\n return $response;\n }\n else {\n return redirect(env('PROJECT_URL'));\n }\n }", "public function projectIdGet(string $id, &$responseCode, array &$responseHeaders);", "public static function show($id) {\r\n\t\t\tself::check_logged_in();\r\n\t\t\t$tasks = Task::listProject($id);\r\n\t\t\t$project_name = Project::getName($id);\r\n\t\t\t//Kint::dump($tasks);\r\n\t\t\t//View::make('project/show.html', array('tasks' => $tasks));\r\n\t\t\tView::make('project/show.html', array('tasks' => $tasks, 'project_name' => $project_name));\r\n\t\t}", "private function getProject() {\r\n $this->clientOwnsProject();\r\n\r\n $select = ('lpc.landingpage_collectionid, lpc.testtype, lpc.name, lpc.config, lpc.creation_date, lpc.start_date, ' .\r\n ' lpc.end_date, lpc.restart_date, lpc.status, lpc.progress, lpc.autopilot, lpc.allocation, lpc.last_sample_date, lpc.sample_time, ' .\r\n ' lpc.personalization_mode, lpc.smartmessage, lpc.ignore_ip_blacklist, lpc.device_type, lp.rule_id, ' .\r\n ' lp.landing_pageid AS originalid, lp.lp_url, lp.canonical_url ');\r\n\r\n $lpcid = mysql_real_escape_string($this->project);\r\n $lp = \"(SELECT landing_pageid, landingpage_collectionid, lp_url, canonical_url, rule_id, allocation \" .\r\n \" FROM landing_page WHERE landingpage_collectionid = $lpcid AND pagetype = 1 AND page_groupid = -1 \" .\r\n \" GROUP BY landingpage_collectionid ORDER BY landing_pageid ASC LIMIT 1 ) lp \";\r\n\r\n $this->db->select($select)\r\n ->from('landingpage_collection lpc')\r\n ->join($lp, 'lp.landingpage_collectionid = lpc.landingpage_collectionid', 'INNER')\r\n ->where('lpc.landingpage_collectionid', $this->project);\r\n\r\n if ($this->usertype == 'api-tenant') {\r\n $this->db->join('api_client ac', 'ac.clientid = lpc.clientid', 'INNER')\r\n ->where('lpc.clientid', $this->account)\r\n ->where('(ac.api_tenant = ' . $this->apiclientid . ' OR ac.api_clientid = ' . $this->apiclientid . ')');\r\n } else {\r\n $this->db->where('lpc.clientid', $this->clientid);\r\n }\r\n\r\n $query = $this->db->get();\r\n\r\n if ($query->num_rows() <= 0) {\r\n throw new Exception('', 403203);\r\n }\r\n\r\n $row = $query->row();\r\n $res = self::returnPojectFields($row, TRUE);\r\n return $this->successResponse(200, $res);\r\n }", "public function testProjectsAssignTeam()\n {\n $project = factory(Project::class)->create();\n $response = $this->get('/project/team?id=' . $project->id);\n $response->assertStatus(200);\n }", "public function singleProject($project_id, $db)\r\n {\r\n $sql = \"SELECT * FROM projects\r\n WHERE id = :project_id\";\r\n $pst = $db->prepare($sql);\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst-> execute();\r\n $p = $pst->fetch(PDO::FETCH_OBJ);\r\n return $p;\r\n }", "function get ( $id, $get_one = false )\n\t{\t\n $this->db->from('projects');\n\n\t\tif( $get_one )\n {\n $this->db->limit(1,0);\n }\n\t\telse\n {\n $this->db->where( 'id', $id );\n }\n\n\t\t$query = $this->db->get();\n\n\t\tif ( $query->num_rows() > 0 )\n\t\t{\n\t\t\t$row = $query->row_array();\n\t\t if($this->ion_auth->compare_project_groups($row['id']))\n {\n\t\t\treturn array( \n \t'id' => $row['id'],\n \t'name' => $row['name'],\n \t'description' => $row['description'],\n );\n }\n\t\t}\n else\n {\n return array();\n }\n\t}", "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "function get_projects( $id ) {\n\t\t$this->db->select( '*,customers.id as customer_id, customers.company as customercompany,customers.namesurname as individual,customers.address as customeraddress,projects.status_id as status, projects.id as id ' );\n\t\t$this->db->join( 'customers', 'projects.customer_id = customers.id', 'left' );\n\t\treturn $this->db->get_where( 'projects', array( 'projects.id' => $id ) )->row_array();\n\t}", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "public function callProjectDetail($pk)\n {\n return $this->call('projekt/detail', array('id' => $pk));\n }", "public function getProjectById(int $projectId) : ProjectInterface;", "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "public function edit($id)\n\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM project WHERE id=:id \");\n\t\t$stmt->bindParam(':id', $id);\n\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetch(PDO::FETCH_OBJ);\n\t}", "private function createProject()\n {\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\nCreate project:\".$response.\"\\n\";\n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function testGetPackingPlanById()\n {\n }", "function get_project($projectId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getProject($projectId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the project.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');\n }\n\n}", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "public function show($id)\n {\n $project = Project::findOrFail($id);\n if ($project) {\n return response()->json([\n 'success' => 'true',\n 'data' => $project->toArray()\n ], 400);\n } else {\n return response()->json([\n 'success' => false,\n 'data' => 'Project with #id:' . $id . 'not found'\n ], 401);\n }\n }", "public function index($id)\n {\n return $this->repository->findWhere(['projeto_id' => $id]);\n }", "public function edit($id)\n {\n $project = Project::findOrFail($id);\n return $project;\n }", "public function edit($id)\n {\n \n //current user\n $user_id = auth()->user()->id;\n\n //project to return with JSON. \n $returnProject = Project::where('user_id', $user_id)->where('id', $id)->get();\n\n //what informatoin do we need returned to the view from the database records? Column ID's from database.\n $keys = array('name', 'color');\n\n //sanitize the project for save output\n $sanitized_project = sanitizeForOutput_H( $keys, $returnProject );\n\n\n //return the sanitized object. \n if( $sanitized_project ) {\n dd($sanitized_project);\n Response::json( $sanitized_project );\n } else {\n return false;\n }\n \n\n }", "public function getProject($league_id = 0)\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' _project<br><pre>'.print_r($this->_project,true).'</pre>'),'Notice');\n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' _project_id<br><pre>'.print_r(self::$_project_id,true).'</pre>'),'Notice');\n \n\t\tif (!$this->_project)\n\t\t{\n\t\t\tif (!self::$_project_id && !$league_id ) \n {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n $query->select('p.id, p.name,p.league_id');\n $query->select('CONCAT_WS(\\':\\',p.id,p.alias) AS project_slug');\n $query->select('CONCAT_WS(\\':\\',s.id,s.alias) AS saeson_slug');\n $query->select('CONCAT_WS(\\':\\',l.id,l.alias) AS league_slug');\n $query->select('CONCAT_WS(\\':\\',r.id,r.alias) AS round_slug');\n $query->select('p.season_id, p.league_id, p.current_round');\n \n $query->from('#__sportsmanagement_project AS p');\n $query->join('INNER','#__sportsmanagement_season AS s on s.id = p.season_id');\n \n $query->join('INNER','#__sportsmanagement_league AS l on l.id = p.league_id');\n //$query->join('INNER','#__sportsmanagement_round AS r on p.id = r.project_id ');\n $query->join('LEFT','#__sportsmanagement_round AS r on p.current_round = r.id ');\n \n// $query->where('p.id = ' . self::$_project_id);\n \n if ( $league_id )\n {\n $query->where('p.league_id = ' . $league_id);\n }\n else\n {\n $query->where('p.id = ' . self::$_project_id);\n }\n\t\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t\t$this->_project = $db->loadObject();\n self::$_project_id = $this->_project->id;\n\t\t\t$this->_project_slug = $this->_project->project_slug;\n $this->_saeson_slug = $this->_project->saeson_slug;\n $this->_league_slug = $this->_project->league_slug;\n $this->_round_slug = $this->_project->round_slug;\n\t\t}\n \n\t\treturn $this->_project;\n\t}", "public function test_getById() {\n\n }", "public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }", "public function show($id = null)\n {\n $project = $this->project->findOrFail($id);\n $this->authorize('view', $project);\n return response(new ProjectResource($project), Response::HTTP_OK);\n }", "function getData($id){\n $query= $this->db->query('SELECT *FROM project WHERE `id` ='.$id);\n return $query->row();\n }", "public function show($id) {\n $project = $this->projectRepo->getProject($id);\n $projectInspections = $this->projectInspectionRepo->getInspectionsForProject($id);\n $projectContacts = $this->projectContactRepo->getContactsForProject($id);\n $projectItems = $this->projectItemRepo->getItemsForProject($id);\n $volunteerHours = $this->volunteerHrsRepo->getHoursForProject($id);\n $volunteers = $this->volunteerRepo->getAllVolunteersNonPaginated();\n $family = $this->familyRepo->getFamily($project->family_id);\n $roles = $this->roleRepo->getAllRoles();\n\n// if (($projectContact = $this->projectContactRepo->getProjectContact($id)) != null) {\n// return View::make('project.show', array('project' => $project,\n// 'projectInspections' => $projectInspections,\n// 'projectItems' => $projectItems, 'volunteerhours' => $volunteerHours,\n// 'volunteers' => $volunteers, 'family' => $family))\n// ->withProjectContact($projectContact);\n// } else {\n return View::make('project.show', array('project' => $project,\n 'projectInspections' => $projectInspections,\n 'projectItems' => $projectItems,\n 'volunteerhours' => $volunteerHours,\n 'volunteers' => $volunteers, 'family' => $family,\n 'projectContacts' => $projectContacts,\n 'roles' => $roles));\n// }\n }", "public function getProjectWithUsers($projectID)\n {\n }", "public function a_project_can_be_shown_with_all_payments()\n {\n $unseenUser = factory(Client::class)->create(['name' => 'Unseen User']);\n $unseenProject = factory(Project::class)->create(['title' => 'Unseen Project', 'client_id' => $unseenUser]);\n\n $client = factory(Client::class)->create(['name' => 'John Doe']);\n $project = factory(Project::class)->create(['title' => 'My First Project', 'client_id' => $client->id]);\n\n $response = $this->get(\"/client/{$client->id}/project/{$project->id}\");\n $response->assertStatus(200);\n\n $response->assertSee('My First Project');\n }", "public function show()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n\n $project = Project::find($_GET['id']);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }", "function get_project($pid){\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"root\";\n $dbname = \"Projects\";\n\n // Create connection\n $conn = new mysqli($servername, $username, $password, $dbname);\n // Check connection\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n $sql = \"SELECT head, summary, title, emails\n FROM Project\n WHERE pid = $pid\";\n $result = $conn->query($sql);\n $row = $result->fetch_assoc();\n return $row;\n }", "public function testSeeTaskButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertSee(__(\"project.add_task\"));\n }", "public function selectprojet($id){\n\n $projet = projet::find($id);\n\n return response()->json([\"projet\"=>$projet ]);\n\n }", "function getProjectDetails($project_id)\n\t{\n\t\t\n\t\t$projectArray = array();\n\t\t\n\t\tif($project_id <> '')\n\t\t{\n\t\t\t$sq_data = \"SELECT\n `mrfc_app_project`.*\n , `mrfc_app_pillar`.`title` AS `pillar`\n , `mrfc_app_sector`.`title` AS `sector`\n , `mrfc_app_ministry`.`name` AS `ministry`\n , `mrfc_app_location`.`name` AS `location`\nFROM\n `mrfc_app_project`\n LEFT JOIN `mrfc_app_pillar` \n ON (`mrfc_app_project`.`pillar_id` = `mrfc_app_pillar`.`pillar_id`)\n LEFT JOIN `mrfc_app_sector` \n ON (`mrfc_app_project`.`sector_id` = `mrfc_app_sector`.`sector_id`)\n LEFT JOIN `mrfc_app_ministry` \n ON (`mrfc_app_project`.`ministry_id` = `mrfc_app_ministry`.`ministry_id`)\n LEFT JOIN `mrfc_app_location` \n ON (`mrfc_app_project`.`location_id` = `mrfc_app_location`.`location_id`)\nWHERE (`mrfc_app_project`.`project_id` = \".quote_smart($project_id).\" AND `mrfc_app_project`.`published` =1); \";\n\t\t//echo $sq_data;\n\t\t\t$rs_data = $this->dbQuery($sq_data);\n\t\t\tif($this->recordCount($rs_data)) \n\t\t\t{\n\t\t\t\t$projectArray = $this->fetchRow($rs_data, 'assoc');\t\t\t\t\n\t\t\t}\t\n\t\t}\n\t\treturn $projectArray;\n\t}", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function getProject($id)\n {\n $project = Project::findOrFail($id);\n if($project->user_id == 0){\n $project->created_by = 'System';\n }else{\n $project->created_by = User::findOrFail($project->user_id)->value('name');\n }\n return view('project')->with('project', $project);\n }", "public function show($id) // этот метод вывод конкретную модель продукта по айдишнику из метода findById\n {\n return view('project.show',\n [\"project\" => $this->projects->findById($id),//метод возвращает конкретную модель по айдишнику\n \"task\" => $this->tasks->all()\n ]\n );\n }", "public function project($id)\n {\n $result = $this->get(\"projects/{$id}\");\n\n Validator::isArray($result);\n\n return $this->fromMantisProject($result['projects'][0]);\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $project = $em->getRepository('MyAppJobOwnerBundle:Project')->find($id);\n $deleteForm = $this->createDeleteForm($project);\n\n\n $user = $this->getUser();\n\n $free = $em->getRepository('FreelancerBundle:User')->findAll();\n $freelancer = new User();\n foreach ($free as $freel){\n $freelancer = $freel;\n }\n\n $exs = $em->getRepository('MyAppJobOwnerBundle:Examen')->findBy(array(\"project\"=>$project));\n $examen = new Examen();\n foreach($exs as $e){\n $examen = $e;\n }\n\n\n\n $test = $this->getDoctrine()\n ->getRepository('MyAppJobOwnerBundle:Tests')\n ->findBy(array('freelancer' => $user,'examen'=>$examen));\n\n $nb = count($test);\n var_dump($nb);\n\n\n\n return $this->render('MyAppJobOwnerBundle:project:show.html.twig', array(\n 'project' => $project,'examen'=>$examen,'test' => $nb,'free'=>$user,'project'=>$project,'delete_form' => $deleteForm->createView()\n ));\n }" ]
[ "0.7300688", "0.7160052", "0.71215653", "0.69065416", "0.6845172", "0.6835409", "0.6801986", "0.67409396", "0.6733202", "0.66962236", "0.6671775", "0.6654084", "0.66138893", "0.65994096", "0.65855336", "0.6583683", "0.6583683", "0.65786403", "0.65296894", "0.6519466", "0.651937", "0.6493329", "0.6478813", "0.64702475", "0.6454663", "0.64434266", "0.63868916", "0.6386527", "0.638158", "0.6368794", "0.6354923", "0.63190407", "0.6313134", "0.63072664", "0.6299467", "0.62920535", "0.62848157", "0.62761176", "0.6274309", "0.6274283", "0.62657726", "0.626234", "0.6253942", "0.6239688", "0.6231406", "0.61932105", "0.6192544", "0.6187232", "0.6184196", "0.6181845", "0.6176838", "0.61759675", "0.61730057", "0.61339456", "0.6132971", "0.613083", "0.6124296", "0.6119609", "0.61091673", "0.6108531", "0.6107386", "0.60977644", "0.60882276", "0.60871875", "0.60787165", "0.60606784", "0.60602593", "0.60598534", "0.6048464", "0.60422754", "0.6028877", "0.6026795", "0.6016983", "0.6014155", "0.6010664", "0.6008195", "0.60049343", "0.5992652", "0.5988618", "0.5988116", "0.5982952", "0.5973227", "0.596295", "0.5960512", "0.5955347", "0.5953685", "0.5953399", "0.5948553", "0.5929781", "0.59252113", "0.59246945", "0.5916563", "0.59132487", "0.59120864", "0.5911917", "0.5897094", "0.589661", "0.5890509", "0.58904225", "0.5889629" ]
0.83770955
0
Testing the project search
public function testSearchProject() { echo "\nTesting project search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects?search=test"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/projects?search=test"; $response = $this->curl_get($url); //echo "\n-------project search Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_searchByPage() {\n\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testSearch()\n {\n $crawler = $this->client->request('GET', $this->router->generate('marquejogo_homepage'));\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Cidade\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Data\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Hora\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => '',\n 'marcoshoya_marquejogobundle_search[date]' => '1111',\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n // invalid date\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"This value is not valid.\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => 'Curitiba, Paraná',\n 'marcoshoya_marquejogobundle_search[date]' => date('d-m-Y'),\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Resultados encontrados\")')->count());\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "public function testGetVoicemailSearch()\n {\n }", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testInboundDocumentSearch()\n {\n }", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testSearchModelSets()\n {\n }", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testGetSearchResults()\n {\n $search_term = $this->getSearchTerm();\n $limit = $this->getLimit();\n\n $client = $this->mockGuzzleForResults();\n $repository = new GoogleSearchRepositoryApi($client);\n\n $results = $repository->getSearchResults($search_term, $limit);\n\n $this->assertIsArray($results);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function testFindPageReturnsDataForSuccessfulSearch()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', 'name=works');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "protected function tweakTaskSearch() {\n\t\tparent::tweakTaskSearch();\n\t\tparent::setProjectsInTaskSearchForManager(TRUE);\n\t}", "public function testQuarantineFind()\n {\n\n }", "public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}", "public function testSearchParams() {\n $this->get('/api/VideoTags/search.json?tag_name=frontside');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?rider_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick-slug=frontside-360');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=invalidorder');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=begin_time');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=created');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=modified');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=best');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_slug=myslug');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick_slug=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_ids=1,2,3');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?status=pending,invalidstatus');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard&category_name=jib');\n $this->assertResponseOk();\n }", "public function test_city_search()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($god = $this->createGod())\n ->visit('/dashboard/cities')\n ->type('search_country', $this->setLocalizationByName('country'))\n ->waitForText($this->setLocalizationByName('country'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('country'));\n });\n\n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_state', $this->setLocalizationByName('state'))\n ->waitForText($this->setLocalizationByName('state'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('state'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_city', $this->setLocalizationByName('city'))\n ->waitForText($this->setLocalizationByName('city'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('city'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_region', $this->setLocalizationByName('region'))\n ->waitForText($this->setLocalizationByName('region'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('region'));\n });\n });\n }", "public function search(){}", "public function search();", "public function search();", "public function testSearchBy(): void\n {\n// $model::query();\n }", "public function testSearchModuleSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Create data stored by first user\n $this -> call('POST','api/classes',[\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"],\n 'key' => $this -> classSetting[\"key\"]\n ]);\n\n // Get module id\n $module = Module::where('code',$this -> classSetting[\"code\"])->first();\n $module_id = $module -> module_id;\n\n // Search module by code\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module by name\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"name\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module doesn't exist\n $this -> call('GET','api/classes/search',['string' => 'Module does not exist']);\n $this -> seeJsonEquals([]);\n }", "public function testPostVoicemailSearch()\n {\n }", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testFindFiles()\n {\n\n }", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function postProjectSearch(Request $request){\n\n $keyword=$request['keyWords'];\n $filter=$request['filter'];\n $projects=Project::all();\n $resultProjects=new Collection();\n foreach($projects as $project){\n\n if( (strpos($filter, 'id') !== false) and Str::equals(Str::lower($project->id),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n foreach($projects as $project){\n if($resultProjects->contains($project)){\n continue;\n }\n if((strpos($filter, 'client') !== false) and Str::contains(Str::lower($project->client_name),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n if((strpos($filter, 'title') !== false) and Str::contains(Str::lower($project->title),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n else if((strpos($filter, 'date') !== false) and Str::contains(Str::lower($project->date),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n return View::make('/project_management/search_results')->with('resultProjects',$resultProjects);\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "function testFindCompilations() {\n\t\t$result = $this->Album->find('compilation', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals($result[0]['Album']['title'], 'Micro_Superstarz_2000');\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "function testSearchByCustomField() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS&q[per_900][value]=200');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Green<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards'));\n\t}", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "function testSearchClasses() {\n $this->search->findClasses($this->test_class_dir . '/class.TestClass.php');\n\n // Create the array output that the class search should have generated.\n $comparison = array(\n $this->test_class_dir . '/class.TestClass.php' => array(\n 'TestClass'\n )\n );\n\n // Assert that they are equal.\n $this->assertEqual($this->search->getClassList(), $comparison,\n 'Single class search does not match expected result.');\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function testSearch()\n {\n $manager = new Manager($this->minimal, $this->driver);\n\n // Exception handling\n $this->assertBindingFirst($manager, 'search');\n $manager->connect();\n $this->assertBindingFirst($manager, 'search');\n $manager->bind();\n\n $this->driver->getConnection()->setFailure(Connection::ERR_MALFORMED_FILTER);\n try {\n $res = $manager->search();\n $this->fail('Filter malformed, query shall fail');\n } catch (MalformedFilterException $e) {\n $this->assertRegExp('/Malformed filter/', $e->getMessage());\n }\n\n // Basic search\n $set = array(new Entry('a'), new Entry('b'), new Entry('c'));\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'dc=example,dc=com',\n '(objectclass=*)',\n SearchInterface::SCOPE_ALL,\n null,\n $set\n );\n\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n\n $data = array();\n foreach ($result as $key => $value) {\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\Node', $value);\n $data[$key] = $value->getAttributes();\n }\n\n $this->assertArrayHasKey('a', $data);\n $this->assertArrayHasKey('b', $data);\n $this->assertArrayHasKey('c', $data);\n $this->assertEquals(\n 3,\n count($data),\n 'The right search result got retrieved'\n );\n\n // Empty result set search\n $this->driver->getConnection()->setFailure(Connection::ERR_NO_RESULT);\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n $this->assertInstanceOf(\n 'Toyota\\Component\\Ldap\\Core\\SearchResult',\n $result,\n 'Query did not fail - Exception got handled'\n );\n\n $data = array();\n foreach ($result as $key => $value) {\n $data[$key] = $value->getAttributes();\n }\n $this->assertEquals(\n 0,\n count($data),\n 'The exception got handled and the search result set has not been set in the query'\n );\n\n // Alternative parameters search\n $result = $manager->search(\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n false,\n array('attr1', 'attr2')\n );\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n SearchInterface::SCOPE_ONE,\n array('attr1', 'attr2'),\n $set\n );\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n }", "public function test_admin_search_keyword_b()\n {\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_search()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search('/(index.php|.htaccess)/');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n $this->assertArrayHasKey(ROOT.DS.'.htaccess', $res);\n }", "function quick_search() {\n if(!$this->request->isAsyncCall()) {\n $this->redirectTo('search');\n } // if\n\n //BOF:mod 20110629 search\n if (trim($this->request->post('search_for'))!=''){\n\t\t//$_SESSION['search_string'] = trim($this->request->post('search_for'));\n\t }\n //$this->smarty->assign('search_string', $_SESSION['search_string']);\n //EOF:mod 20110629 search\n\n /*$object_types = array();\n $object_types[] = array('id' => '', 'text' => '');\n $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n mysql_select_db(DB_NAME, $link);\n $query = \"select distinct type from healingcrystals_project_objects order by type\";\n $result = mysql_query($query);\n while($type = mysql_fetch_assoc($result)){\n \t$object_types[] = array('id' => $type['type'], 'text' => $type['type']);\n }\n mysql_close($link);*/\n\t $search_projects = array();\n\t $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n\t mysql_select_db(DB_NAME, $link);\n\t $query = \"select distinct a.project_id from healingcrystals_project_users a inner join healingcrystals_projects b on a.project_id=b.id where a.user_id='\" . $this->logged_user->getId() . \"' order by b.name\";\n\t $result = mysql_query($query);\n\t while($entry = mysql_fetch_assoc($result)){\n\t\t\t$search_projects[] = new Project($entry['project_id']);\n\t\t }\n\t mysql_close($link);\n $object_types = $this->get_object_types();\n if($this->request->isSubmitted()) {\n $search_for = trim($this->request->post('search_for'));\n $search_type = $this->request->post('search_type');\n $search_object_type = $this->request->post('search_object_type');\n $search_project_id = $this->request->post('search_project_id');\n\n if($search_for == '') {\n die(lang('Nothing to search for'));\n } // if\n\n $this->smarty->assign(array(\n 'search_for' => $search_for,\n 'search_type' => $search_type,\n 'search_object_type' => $search_object_type,\n 'object_types' => $object_types,\n 'search_project_id' => $search_project_id,\n 'search_projects' => $search_projects\n ));\n $per_page = 5;\n\n // Search inside the project\n if($search_type == 'in_projects') {\n\t\t //BOF:mod 20120822\n\t\t if ($search_object_type=='Attachment'){\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_attachments($search_for, $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t } else {\n\t\t //EOF:mod 20120822\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_index_search($search_for, 'ProjectObject', $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t //BOF:mod 20120822\n\t\t }\n\t\t //EOF:mod 20120822\n\t\t \n // Search for people\n } elseif($search_type == 'for_people') {\n $template = get_template_path('_quick_search_users', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'User', $this->logged_user, 1, $per_page);\n\n // Search for projects\n } elseif($search_type == 'for_projects') {\n $template = get_template_path('_quick_search_projects', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'Project', $this->logged_user, 1, $per_page);\n\n // Unknown type\n } else {\n die(lang('Unknown search type: :type', array('type' => $search_type)));\n } // if\n\n $this->smarty->assign(array(\n 'results' => $results,\n 'pagination' => $pagination,\n ));\n\n $this->smarty->display($template);\n die();\n } else {\n \t$this->smarty->assign('object_types', $object_types);\n \t$this->smarty->assign('search_projects', $search_projects);\n }\n }", "public function testFilter()\n {\n // so here we just verify that the params are passed correctly internally\n $project_repository = $this->getMockBuilder(ProjectRepository::class)\n ->disableOriginalConstructor()\n ->setMethods(['scopeByDate', 'scopeWithTags', 'scopeWithoutTags',\n 'scopeByField', 'search'])->getMock();\n\n // with tags\n $project_repository->expects($this->once())->method('scopeWithTags')\n ->with($this->equalTo('badabing'));\n $project_repository->filter(['withTags' => 'badabing']);\n\n // without tags\n $project_repository->expects($this->once())->method('scopeWithoutTags')\n ->with($this->equalTo('badabeng'));\n $project_repository->filter(['withoutTags' => 'badabeng']);\n\n // with date\n $project_repository->expects($this->once())->method('scopeByDate')\n ->with($this->equalTo('27.01.2018'));\n $project_repository->filter(['date' => '27.01.2018']);\n\n // with search\n $project_repository->expects($this->once())->method('search')\n ->with($this->equalTo('jahade'));\n $project_repository->filter(['search' => 'jahade']);\n\n // default\n $project_repository->expects($this->once())->method('scopeByField')\n ->with(\n $this->equalTo('budget_price'),\n $this->equalTo('65000')\n );\n $project_repository->filter(['budget_price' => '65000']);\n }", "public function testSearchParams()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse, 15);\n\n $sw->search();\n $sw->search('testing123');\n $sw->search('', '2017-01-01');\n $sw->search('', '', '2017-01-02');\n $sw->search('', '2017-01-01', '2017-01-02');\n $sw->search('', '', '', 'Kyle');\n $sw->search('', '', '', '', 'Smith');\n $sw->search('', '', '', 'Kyle', 'Smith');\n $sw->search('', '', '', '', '', true);\n $sw->search('', '', '', '', '', false);\n $sw->search('', '', '', '', '', null);\n $sw->search('', '', '', '', '', null, true);\n $sw->search('', '', '', '', '', null, false);\n $sw->search('', '', '', '', '', null, true, 'testing');\n $sw->search('testing123', '', '', '', '', true);\n\n $this->checkGetRequests($container, [\n '/v4/search',\n '/v4/search?templateId=testing123',\n '/v4/search?fromDts=2017-01-01',\n '/v4/search?toDts=2017-01-02',\n '/v4/search?fromDts=2017-01-01&toDts=2017-01-02',\n '/v4/search?firstName=Kyle',\n '/v4/search?lastName=Smith',\n '/v4/search?firstName=Kyle&lastName=Smith',\n '/v4/search?verified=true',\n '/v4/search?verified=false',\n '/v4/search',\n '/v4/search',\n '/v4/search?sort=asc',\n '/v4/search?tag=testing',\n '/v4/search?templateId=testing123&verified=true'\n ]);\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "function get_project_by_search($search,$approved = 0,$loc='') {\n\n\n\n $this->db->select('projects.id as id,project_slug,sub_category.price,category.id as cat_id, sub_category.id as sub_cat_id, projects.location,posted_by,budget,title,details,projects.file_path,projects.file_name,category.name as cat_name, sub_category.name as sub_cat_name,projects.duration');\n $this->db->from('projects');\n $this->db->where('users.deleted', '0');\n if($approved !=0){\n\n $this->db->where('projects.approved', $approved);\n }\n if(($search!='')){\n\n $this->db->like('projects.title', $search);\n }\n if(($loc!='')){\n \n $this->db->like('projects.location', $loc);\n }\n $this->db->join('category', 'category.id = projects.category','left outer');\n $this->db->join('sub_category', 'sub_category.id = projects.sub_category');\n $this->db->join('users', 'users.id = projects.posted_by');\n\n\n $query = $this->db->get();\n\n\n\n if ($query->num_rows() >= 1){ return $query->result_array(); }\n\n\n\n return false;\n\n }", "function search() {}", "public function testSearchMods()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testFindService()\n {\n\n }", "public function test_search_by_name()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search_by_name('index.php');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function testFindTemplates()\n {\n\n }", "public function get_project_all(){\n }", "public function unitTests($unit) {\n\t\techo \"<p>Search Results Tests:</p><ul>\";\n\t\t\n\t\techo \"<li>Known Valid Search\";\n\t\t$searchStr = $this->search(\"motrin\");\n\t\t$searchObj = $this->search(\"motrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', 'String Requested, String Returned');\n\t\techo $unit->run($searchObj,'is_object', 'Object Requested, Object Returned');\n\t\techo $unit->run($searchObj->error,'is_null', 'Error object is null');\n\t\techo $unit->run(count($searchObj->results) > 0, true, \"Result object results array has contents.\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Known Invalid Search\";\n\t\t$searchStr = $this->search(\"wallbutrin\");\n\t\t$searchObj = $this->search(\"wallbutrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj,'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Empty Search\";\n\t\t$searchStr = $this->search(\"\");\n\t\t$searchObj = $this->search(\"\", true);\n\n\t\techo $unit->run($searchStr, 'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj, 'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"</ul>\";\n\n\t\techo \"<p>Cache Results Tests</p><ul>\";\n\t\t$cacheTerm = \"testingTerm\";\n\t\t$cacheDataIn = json_encode(array('test' => true, 'error' => false));\n\n\t\techo \"<li>Cache sanity\";\n\t\t$this->_setCache($cacheTerm, $cacheDataIn);\n\t\t$cacheDataOut = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($cacheDataOut, $cacheDataIn, \"Cache returns the same values it was given\");\n\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Invalidated cache entry does not return a result\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Cache actually used and updated by search\";\n\t\t$cacheTerm = 'motrin';\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Known Search cache invalidated\");\n\t\t$searchResult = $this->search($cacheTerm);\n\n\t\techo $unit->run($searchResult, 'is_string', \"Known Search returns string\");\n\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\t\techo $unit->run($searchResult, $fetchResult, \"Known search and cache entry match\");\n\n\t\t$searchResult2 = $this->search($cacheTerm);\n\t\techo $unit->run($searchResult2, $searchResult, \"Search returns same on cache miss and hit\");\n\n\t\techo \"</li>\";\n\t\techo \"</ul>\";\n\t}", "public function testGetSubprojects() {\n\t\t$t_project_name = $this->getNewProjectName();\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_projects_array = $this->client->mc_project_get_all_subprojects( $this->userName, $this->password, $t_project_id );\n\n\t\t$this->assertCount( 0, $t_projects_array );\n\t}", "public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }", "public function testSearchPermissionSets()\n {\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function testPsWithprojectOption()\n {\n $composeFiles = new ComposeFileCollection(['docker-compose.test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n\n $this->assertEquals($this->mockedManager->ps($composeFiles), 'ok');\n }", "public function testSearchDocument()\n {\n echo \"\\nTesting document search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testIndex()\n {\n $request = $this->mockHttpRequest([]);\n $service = $this->mockGoogleSearchServiceBasic();\n $controller = new SearchResultsController($request, $service);\n\n $result = $controller->index();\n\n $this->assertInstanceOf(Views\\Index::class, $result);\n $this->assertIsArray($result->getData());\n $this->assertEquals($result->getData(), []);\n }", "public function testProjectAssignmentsRead()\n {\n }", "public function testOpenProjectWithUser()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertStatus(200);\n }", "public function testSearchModuleWithoutToken()\n {\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function testFindUsers()\n {\n\n }", "public function testProfileFind()\n {\n\n }", "private function getAllProjects($get) {\n $projectModel = new ProjectsModel();\n $projectModel->join('priorities', 'priorities.id = projects.priority','Left');\n $projectModel->join('users', 'users.id = projects.responsible','Left');\n\n if(isset($get['keywords']) && trim($get['keywords'])) {\n $projectModel->groupStart();\n $projectModel->like('projects.code', $get['keywords']);\n $projectModel->orLike('projects.name', $get['keywords']);\n $projectModel->orLike('priorities.name', $get['keywords']);\n $projectModel->orLike('projects.assign_to', $get['keywords']);\n $projectModel->groupEnd();\n }\n //coulmn search\n if(isset($get['code_id']) && trim($get['code_id']))\n $projectModel->where('projects.code', $get['code_id']);\n if(isset($get['name']) && trim($get['name']))\n $projectModel->where('projects.name', $get['name']);\n/*\n if(isset($get['priority']) && trim($get['priority']))\n $projectModel->where('priorities.name', $get['priority']);*/\n if(isset($get['priority']) and $get['priority'] != ''){\n $projectModel->like('projects.priority',$get['priority']);\n }\n \n if (!empty($get['start_at'])) \n $projectModel->where('DATE_FORMAT(projects.start_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['start_at'])));\n if (!empty($get['end_at'])) \n $projectModel->where('DATE_FORMAT(projects.end_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['end_at'])));\n\n \n $data['totalProject'] = ((new ProjectsModel())->select('count(*) as totalProject')->first())['totalProject'];\n $projectModel->select('projects.id,projects.code,projects.name, priorities.name as priority, CONCAT(users.fname,\" \",users.lname) as responsible,projects.assign_to,projects.start_at,projects.end_at,projects.description, projects.created_at, projects.created_by, projects.updated_at, projects.updated_by, projects.status');\n $projectModel->where('projects.status','1');\n $data['projects'] = $projectModel->orderBy($get['sortby'], $get['sort_order'])->findAll($get['rows'], ($get['pageno']-1)*$get['rows']);\n $data['params'] = $get;\n $prioritiesModel = new PrioritiesModel();\n $query = $prioritiesModel->findAll();\n $data['priorities'] = $query;\n //\n $userModel = new UsersModel();\n $str_query = $userModel->findAll();\n $data['users'] = $str_query;\n // /print_r($data);exit();\n return $data;\n }", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function searchProjects($conditions)\n {\n $em = $this->getDoctrine()->getManager();\n $projects = $em->getRepository('AppBundle:Project')->findAll();\n $normalizer = new ObjectNormalizer(null, new CamelCaseToSnakeCaseNameConverter());\n\n foreach ($projects as $key => $project) {\n $projects[$key] = $normalizer->normalize($project);\n\n }\n return $projects;\n }", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "public function testFindServiceData()\n {\n\n }", "public function testSearchResults()\n {\n $search = new SmartwaiverSearch([\n 'guid' => 'TestingGUID',\n 'count' => 5,\n 'pages' => 1,\n 'pageSize' => 100\n ]);\n\n $numWaivers = 5;\n\n $apiResponse = APISuccessResponses::searchResults($numWaivers);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $waivers = $sw->searchResult($search, 0);\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiver::class, $waiver);\n }\n\n $this->checkGetRequests($container, [\n '/v4/search/' . $search->guid . '/results?page=0'\n ]);\n }", "public function testGetInstitutionsUsingGET()\n {\n }", "function search()\n\t{}", "function search()\n\t{}", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public static function searchNamespace()\n\t{\n\t\treturn 'project';\n\t}", "protected function tweakTaskSearch() {\n\t\tparent::setProjectsInTaskSearchForManager(false);\n\t}", "public function test_search_returns_results_for_pages() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t\tself::factory()->post->create_many(\n\t\t\t3,\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'foo',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'bar',\n\t\t\t)\n\t\t);\n\n\t\t$request = array(\n\t\t\t'type' => 'quick-search-posttype-page',\n\t\t\t'q' => 'foo',\n\t\t\t'response-format' => 'json',\n\t\t);\n\n\t\t$output = get_echo( '_wp_ajax_menu_quick_search', array( $request ) );\n\t\t$this->assertNotEmpty( $output );\n\n\t\t$results = explode( \"\\n\", trim( $output ) );\n\t\t$this->assertCount( 3, $results );\n\t}" ]
[ "0.6858462", "0.6852012", "0.6753273", "0.66946334", "0.6673342", "0.6618049", "0.6564328", "0.6496258", "0.64323014", "0.6419851", "0.6401977", "0.639658", "0.63620675", "0.63539433", "0.63435453", "0.6327412", "0.6318944", "0.63020056", "0.6277252", "0.6253027", "0.6215104", "0.6202289", "0.6196944", "0.61906946", "0.6185744", "0.6147885", "0.61286", "0.6128118", "0.60922074", "0.60903835", "0.60875905", "0.6068737", "0.6032634", "0.6031003", "0.60246485", "0.6022071", "0.6007277", "0.59859926", "0.5983449", "0.59790504", "0.59790504", "0.59767216", "0.5957828", "0.595666", "0.59483546", "0.5947138", "0.5944084", "0.5916591", "0.5912476", "0.5906247", "0.5900608", "0.58914185", "0.58782744", "0.58765733", "0.58707047", "0.58584374", "0.58526886", "0.58274925", "0.5823303", "0.5816746", "0.58142346", "0.58009464", "0.5795413", "0.57911307", "0.5790557", "0.5783839", "0.57747084", "0.5766855", "0.5740437", "0.5733471", "0.5733471", "0.57063615", "0.570623", "0.5706226", "0.57044804", "0.57035536", "0.5698962", "0.5683342", "0.56706727", "0.5668012", "0.56654245", "0.56596917", "0.56550753", "0.56549656", "0.56509703", "0.5643708", "0.5635919", "0.56352556", "0.5632435", "0.56273425", "0.56242764", "0.56099665", "0.5604748", "0.5600299", "0.55967516", "0.55967516", "0.5581596", "0.55748904", "0.55641735", "0.5560172" ]
0.81959957
0
Testing the project update.
public function testUpdateProject() { echo "\nTesting project update..."; $id = "P5334183"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('prj_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/projects/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/projects/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function a_project_can_update()\n {\n $project = factory(Project::class)->create();\n\n $newData = [\n 'name' => $this->faker->sentence,\n 'description' => 'Changed',\n ];\n\n $this->put('/api/projects/' . $project->id, $newData)->assertStatus(201);\n $this->assertDatabaseHas('projects', [\n 'id' => $project->id,\n 'name' => $newData['name'],\n 'description' => $newData['description'],\n ]);\n }", "public function testProjectAssignmentsUpdateAvailability()\n {\n }", "public function test_accepts_dev_updates()\n {\n }", "public function test_updateSettings() {\n\n }", "public function test_accepts_minor_updates()\n {\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function test_if_failed_update()\n {\n }", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "public function testGetChangeFirstBuilds()\n {\n }", "public function test_update_item() {}", "public function test_update_item() {}", "abstract public function update(Project $project);", "public function testUpdatedTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n }", "public function testWebinarUpdate()\n {\n }", "public function testItCanRunItemUpdate()\n {\n Artisan::call('item:update');\n\n // If you need result of console output\n $resultAsText = Artisan::output();\n\n $this->assertRegExp(\"/Item #[0-9]* updated\\\\n/\", $resultAsText);\n }", "public function test_update_product_success()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit(new UpdateProduct)\n ->assertSee(__('product.admin.edit.title'))\n ->type('name', 'Milk Tea')\n ->attach('image[]', __DIR__.'/test/image1.jpg')\n ->type('describe', 'Sale off')\n ->type('price', '20000')\n ->press(__('product.admin.edit.update_product'))\n ->assertPathIs('/admin/products')\n ->assertSee(__('product.admin.edit.update_success'));\n $this->assertDatabaseHas('products', [\n 'name' => 'Milk Tea',\n 'describe' => 'Sale Off',\n 'price' => '20000',\n ]);\n });\n }", "public function testGetChangeIssue()\n {\n }", "public function testUpdateTimesheet()\n {\n }", "public function testWebinarPollUpdate()\n {\n }", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->btwServer->adminForceTeamChange('Test'));\n }", "public function testJobUpdate()\n {\n\n }", "public function test_squad_server_admin_force_team_change()\n {\n $this->assertTrue($this->postScriptumServer->adminForceTeamChange('Test'));\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "function pm_update_complete($project, $version_control) {\n drush_print(dt('Project !project was updated successfully. Installed version is now !version.', array('!project' => $project['name'], '!version' => $project['candidate_version'])));\n drush_command_invoke_all('pm_post_update', $project['name'], $project['releases'][$project['candidate_version']]);\n $version_control->post_update($project);\n}", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "public function testSaveUpdate()\n {\n $user = User::findOne(1002);\n $version = Version::findOne(1001);\n\n $this->specify('Error update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'title' => 'Some very long title...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim, lorem in bibendum.',\n 'type' => Version::TYPE_TABLET,\n 'subtype' => 31,\n 'retinaScale' => false,\n 'autoScale' => 'invalid_value',\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n $version->refresh();\n\n verify('Model should not succeed', $result)->null();\n verify('Model should have errors', $model->errors)->notEmpty();\n verify('Title error message should be set', $model->errors)->hasKey('title');\n verify('ProjectId error message should not be set', $model->errors)->hasntKey('projectId');\n verify('Type error message should not be set', $model->errors)->hasntKey('type');\n verify('Subtype error message should be set', $model->errors)->hasKey('subtype');\n verify('AutoScale error message should be set', $model->errors)->hasKey('autoScale');\n verify('RetinaScale error message should not be set', $model->errors)->hasntKey('retinaScale');\n verify('Version title should not change', $version->title)->notEquals($data['title']);\n verify('Version type should not be changed', $version->type)->notEquals($data['type']);\n verify('Version subtype should not be changed', $version->subtype)->notEquals($data['subtype']);\n });\n\n $this->specify('Success update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'projectId' => 1003, // should be ignored\n 'title' => 'My new test version title',\n 'type' => Version::TYPE_MOBILE,\n 'subtype' => 31,\n 'retinaScale' => true,\n 'autoScale' => true,\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n\n verify('Model should succeed and return an instance of Version', $result)->isInstanceOf(Version::className());\n verify('Model should not has any errors', $model->errors)->isEmpty();\n verify('The returned Version should be the same as the updated one', $result->id)->equals($version->id);\n verify('Version projectId should not change', $result->projectId)->notEquals($data['projectId']);\n verify('Version title should match', $result->title)->equals($data['title']);\n verify('Version type should match', $result->type)->equals($data['type']);\n verify('Version subtype should match', $result->subtype)->equals($data['subtype']);\n verify('Version scaleFactor should match', $result->scaleFactor)->equals(Version::AUTO_SCALE_FACTOR);\n });\n }", "public function testVolunteerHourProjectEditSuccess_Administrator()\n {\n // Set test user as current authenticated user\n $this->be($this->administrator);\n \n $this->session([\n 'username' => $this->administrator->username, \n 'access_level' => $this->administrator->access_level\n ]);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/edit/project/'.$projectID);\n \n $this->assertContains(\"Editing Project Hours for\", $response->getContent());\n }", "public function testUpdate(): void { }", "public function testChangesIndex()\n {\n $response = $this->get('admin/changes');\n $response->assertStatus(200);\n }", "public function testServeChanges()\n {\n }", "public function testProjectAssignmentsSave()\n {\n }", "public function testUpdate(): void {\n $configObject = $this->configUpdateManager->getConfig();\n\n $this->configUpdateManager->update();\n foreach ($configObject->getTargetConfigFilepaths() as $filepath) {\n self::assertFileExists($filepath);\n }\n\n $targetConfigFilepath = $configObject->getTargetConfigFilepath(Config::TARGET_CONFIG_FILENAME);\n /**\n * @var array{\n * draft: array{\n * last_applied_update: int,\n * },\n * } $config\n */\n $config = $configObject->readAndParseConfigFromTheFile($targetConfigFilepath);\n self::assertSame(App::LAST_AVAILABLE_UPDATE_WEIGHT, $config['draft']['last_applied_update']);\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testVolunteerHourProjectEditSuccess_ProjectInspectionManager()\n {\n // Set test user as current authenticated user\n $this->be($this->projectManager);\n \n $this->session([\n 'username' => $this->projectManager->username, \n 'access_level' => $this->projectManager->access_level\n ]);\n \n $projectID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/edit/project/'.$projectID);\n \n $this->assertContains(\"Editing Project Hours for\", $response->getContent());\n }", "public function testVolunteerHourProjectUpdateFailure_BasicUser()\n {\n // Set test user as current authenticated user\n $this->be($this->basicUser);\n \n $this->session([\n 'username' => $this->basicUser->username, \n 'access_level' => $this->basicUser->access_level\n ]);\n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/edit/project/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testVolunteerHourProjectUpdateFailure_ContactManager()\n {\n // Set test user as current authenticated user\n $this->be($this->contactManager);\n \n $this->session([\n 'username' => $this->contactManager->username, \n 'access_level' => $this->contactManager->access_level\n ]);\n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/edit/project/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function test_updateMessage() {\n\n }", "public function testPostUpdate()\n {\n $this->getEmailWithLocal('uk');\n /** check email with ticket pdf file */\n $this->findEmailWithText('ticket-php-day-2017.pdf');\n /** check email with string */\n $this->findEmailWithText('Шановний учасник, в вкладенні Ваш вхідний квиток. Покажіть його з екрану телефону або роздрукуйте на папері.');\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function test_admin_can_update_a_worker()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($admin = $this->createAdmin())\n ->visitRoute($this->route, $this->lastWorker()->id)\n ->type('worker_name', $this->makeWorker()->worker_name)\n ->type('worker_nif', $this->makeWorker()->worker_nif)\n ->type('worker_start', str_replace('/', '', $this->makeWorker()->worker_start))\n ->type('worker_ropo', $this->makeWorker()->worker_ropo)\n ->type('worker_ropo_date', str_replace('/', '', $this->makeWorker()->worker_ropo_date))\n ->select('worker_ropo_level', $this->makeWorker()->worker_ropo_level)\n ->type('worker_observations', $this->makeWorker()->worker_observations)\n ->press(trans('buttons.edit'))\n ->assertSee(__('The items has been updated successfuly'));\n });\n\n $this->assertDatabaseHas('workers', [\n 'worker_name' => $this->makeWorker()->worker_name,\n 'worker_nif' => $this->makeWorker()->worker_nif,\n 'worker_ropo' => $this->makeWorker()->worker_ropo,\n 'worker_ropo_level' => $this->makeWorker()->worker_ropo_level,\n 'worker_observations' => $this->makeWorker()->worker_observations,\n ]);\n }", "public function testGetRevision()\n {\n }", "function updates($details_obj,$project){\n\t\t$project->all_versions = $details_obj->project->all_versions;\n\t\t$project->testVersion = $details_obj->project->testVersion;\n\t\t$project->pomPath = $details_obj->project->pomPath;\n\t\tif ($project->pomPath==\"\"){\n\t\t\t$str_tmp_pom_path = \"\";\n\t\t}else{\n\t\t\t$str_tmp_pom_path = \"\\\\\".$project->pomPath;\n\t\t}\n\t\t$project->full_pomPath = $project->userProjectRoot.\"\\\\\".$project->gitName.$str_tmp_pom_path;\n\t\t$project->issue_tracker_product_name = $details_obj->project->issue_tracker_product_name;\n\t\t$project->issue_tracker_url = $details_obj->project->issue_tracker_url;\n\t\t$project->issue_tracker = $details_obj->project->issue_tracker;\n\t\t$project->path_online = $project->runingRoot.\"\\\\path.txt\";\n\t\t$project = update_project_list($project,\"start_offline\",true);\n\t\tupdate_project_details($project);\n\t\treturn $project;\t\t\n\t}", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function testGenerateWithUpdating() {\n\n\t\t$current_crontab = <<<CRON\n#===BEGIN Crontab for project: phpunit\n*/2 0 * * * test\n\n#===END Crontab for project: phpunit\nCRON;\n\n\t\t// EXPECTS\n\t\t$this->crontab->expects($this->once())->method('read')->willReturnCallback(function() use ($current_crontab) {\n\t\t\t$this->getCrontabProperty()->setValue($this->crontab, $current_crontab);\n\t\t});\n\t\t$this->crontab->expects($this->once())->method('save');\n\n\t\t// WHEN\n\t\t$this->crontab->update();\n\n\t\t$this->assertEquals($this->expected, $this->getCrontabProperty()->getValue($this->crontab));\n\t}", "public function testUpdated()\n {\n \t$game_factory = factory(Game::class)->create();\n \t$game_factory->game_hash_file = sha1(microtime());\n\n $this->assertTrue($game_factory->save());\n }", "public function testAccessAdminEditPage()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->create();\n $response = $this->actingAs($user)\n ->get(route('admin.project.edit', [$project]));\n\n $response->assertSuccessful();\n\n }", "public function test_updating() {\n\t\t$key = rand_str();\n\n\t\t// Setting temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, 'value1', 5 ) );\n\n\t\t// Direct retrieval of temporary value should return set value.\n\t\t$this->assertEquals( get_site_option( '_site_temporary_' . $key ), 'value1' );\n\n\t\t// Direct retrieval of temporary timeout should be integer and greater than current time.\n\t\t$raw_key1_timeout_before_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_before_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_before_sleep );\n\n\t\t// Getting of temporary should return set value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1' );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update1', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update1' );\n\n\t\t// Timeout should be unchanged.\n\t\t$this->assertEquals( $raw_key1_timeout_before_sleep, get_site_option( '_site_temporary_timeout_' . $key ) );\n\n\t\t// Sleep for two minutes.\n\t\tsleep( 2 * MINUTE_IN_SECONDS );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update2', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update2' );\n\n\t\t// Direct retrieval of temporary timeout should be integer, and greater than current time or timeout before sleep.\n\t\t$raw_key1_timeout_after_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_after_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_after_sleep );\n\t\t$this->assertGreaterThan( $raw_key1_timeout_before_sleep, $raw_key1_timeout_after_sleep );\n\t}", "public function testSuccessfullUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => true,\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n 'id' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n ]);\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function testSaveUpdates()\n {\n $this->projectItemInput = [\n 'id' => '555', \n 'project_id' => 1, \n 'item_type' => 'Refrigerator',\n 'manufacturer' => 'Cool Guys Manufacturing',\n 'model' => 'coolycool5000',\n 'serial_number' => '9238JDFH03uihFD', \n 'vendor' => 'LindenMart',\n 'comments' => 'Handles upsidedown'\n ];\n // Assemble\n //$this->mockedProjectItemsController->shouldReceive('storeItemWith')->once()->with($this->projectItemInput);\n $this->mockedProjectItemsRepo->shouldReceive('saveProjectItem')->once()->with(Mockery::type('ProjectItem'));\n\n // Act \n $response = $this->route(\"POST\", \"storeItems\", $this->projectItemInput);\n\n // Assert\n $this->assertRedirectedToAction('ProjectItemController@index',1);\n }", "public function testServeChange()\n {\n }", "public function testUpdate()\n\t{\n\t\t$params = $this->setUpParams();\n\t\t$params['title'] = 'some tag';\n\t\t$params['slug'] = 'some-tag';\n\t\t$response = $this->call('PUT', '/'.self::$endpoint.'/'.$this->obj->id, $params);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($params as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969', $params);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "public function testProfileUpdateAll()\n {\n\n }", "function update($oldversion) {\n\t\t/** globalising of the needed variables, objects and arrays */\n\t\tglobal $db, $apcms;\n\t\t\n\t\t\n\t\treturn true;\n\t\t\n\t}", "public function testUpdate()\n {\n\n // $payment = $this->payment\n // ->setEvent($this->eventId)\n // ->acceptCash()\n // ->acceptCheck()\n // ->acceptGoogle()\n // ->acceptInvoice()\n // ->acceptPaypal()\n // ->setCashInstructions($instructions)\n // ->setCheckInstructions($instructions)\n // ->setInvoiceInstructions($instructions)\n // ->setGoogleMerchantId($this->googleMerchantId)\n // ->setGoogleMerchantKey($this->googleMerchantKey)\n // ->setPaypalEmail($this->paypalEmail)\n // ->update();\n\n // $this->assertArrayHasKey('process', $payment);\n // $this->assertArrayHasKey('status', $payment['process']);\n // $this->assertTrue($payment['process']['status'] == 'OK');\n }", "function pm_update_project($project, $version_control) {\n // 1. If the version control engine is a proper vcs we need to remove project\n // files in order to not have orphan files after update.\n // 2. If the package-handler is cvs or git, it will remove upstream removed\n // files and no orphans will exist after update.\n // So, we must remove all files previous update if the directory is not a\n // working copy of cvs or git but we don't need to remove them if the version\n // control engine is backup, as it did already move the project out to the\n // backup directory.\n if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {\n // Find and unlink all files but the ones in the vcs control directories.\n $skip_list = array('.', '..');\n $skip_list = array_merge($skip_list, drush_version_control_reserved_files());\n drush_scan_directory($project['full_project_path'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE);\n }\n\n // Add the project to a context so we can roll back if needed.\n $updated = drush_get_context('DRUSH_PM_UPDATED');\n $updated[] = $project;\n drush_set_context('DRUSH_PM_UPDATED', $updated);\n\n if (!package_handler_update_project($project, $project['releases'][$project['candidate_version']])) {\n return drush_set_error('DRUSH_PM_UPDATING_FAILED', dt('Updating project !project failed. Attempting to roll back to previously installed version.', array('!project' => $project['name'])));\n }\n\n // If the version control engine is a proper vcs we also need to remove\n // orphan directories.\n if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {\n $files = drush_find_empty_directories($project['full_project_path'], $version_control->reserved_files());\n array_map('drush_delete_dir', $files);\n }\n\n return TRUE;\n}", "public function testEditTestCase()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->click('TestCase1')\n ->seePageIs('/library/testcase/detail/1')\n ->type('someNewDecription','description')\n ->type('someNewPrefixes','prefixes')\n ->type('someNewSteps','steps')\n ->type('someNewResult','expectedResult')\n ->type('someNewSuffixes','suffixes')\n ->press('submit');\n\n $this->seeInDatabase('TestCaseHistory', [\n 'TestCaseDescription' => 'someNewDecription',\n 'TestCasePrefixes' => 'someNewPrefixes',\n 'TestSteps' => 'someNewSteps',\n 'ExpectedResult' => 'someNewResult',\n 'TestCaseSuffixes' => 'someNewSuffixes'\n ]);\n\n Artisan::call('migrate:reset');\n\n }", "public function checkForUpdates()\n\t{\n\t\tif (!is_numeric(BUILD))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// HOOK: proxy module\n\t\tif (Config::get('useProxy')) {\n\t\t\t$objRequest = new \\ProxyRequest();\n\t\t} else {\n\t\t\t$objRequest = new \\Request();\n\t\t}\n\n\t\t$objRequest->send(\\Config::get('liveUpdateBase') . (LONG_TERM_SUPPORT ? 'lts-version.txt' : 'version.txt'));\n\n\t\tif (!$objRequest->hasError())\n\t\t{\n\t\t\t\\Config::set('latestVersion', $objRequest->response);\n\t\t\t\\Config::persist('latestVersion', $objRequest->response);\n\t\t}\n\n\t\t// Add a log entry\n\t\t$this->log('Checked for Contao updates', __METHOD__, TL_CRON);\n\t}", "public function testUpdateFileChanges() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldBeCalledOnce();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n file_put_contents($this->appRoot . '/drupal/modules/x/x.post_update.php', 'bar');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}", "public function testUpdateTask()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $id = $this->task->getId();\n\n $crawler = $this->client->request('GET', '/tasks/'.$id.'/edit');\n\n $form = $crawler->selectButton('Modifier')->form();\n $form['task[title]'] = 'Titre';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été modifiée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function test_updateCartonActivity() {\n\n }", "public function test_background_updates()\n {\n }", "public function testVolunteerHourProjectUpdateFailure_Inactive()\n {\n $this->session([\n 'username' => $this->inactiveUser->username, \n 'access_level' => $this->inactiveUser->access_level\n ]);\n \n // Set test user as current authenticated user\n $this->be($this->inactiveUser);\n \n $testProjectID = 1; \n // Call route under test\n $this->call('POST', 'volunteerhours/edit/project/');\n \n // Assert redirected to access denied page\n $this->assertRedirectedToRoute('unauthorized');\n }", "public function testRenderUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($branchIDs);\n $branch = $this->branch->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/branch/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('branch', $branch);\n $this->assertViewHas('dataTl');\n $this->assertPageContain('Edit Branch');\n }", "public function testWebinarRegistrantQuestionUpdate()\n {\n }", "public function testDebtorUpdate()\n {\n $this->saveDebtor();\n\n $oDebtor = (new DebtorDAO())->findByCpfCnpj('01234567890');\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $aDadosUpdate = [\n 'id' => $oDebtor->getId(),\n 'name' => 'Carlos Vinicius Atualização',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '14725836905',\n 'birthdate' => '01/01/2000',\n 'phone_number' => '(79) 9 8888-8888',\n 'zipcode' => '11111-111',\n 'address' => 'Rua Atualização',\n 'number' => '005544',\n 'complement' => 'Conjunto Atualização',\n 'neighborhood' => 'Bairro Atualização',\n 'city' => 'Maceió',\n 'state' => 'AL'\n ];\n\n $oDebtorFound = (new DebtorDAO())->find($aDadosUpdate['id']);\n $oDebtorFound->update($aDadosUpdate);\n\n $oDebtorUpdated = (new DebtorDAO())->find($aDadosUpdate['id']);\n $this->assertTrue($oDebtorUpdated->getName() == 'Carlos Vinicius Atualização');\n $this->assertTrue($oDebtorUpdated->getEmail() == '[email protected]');\n $this->assertTrue($oDebtorUpdated->getCpfCnpj() == '14725836905');\n $this->assertTrue($oDebtorUpdated->getBirthdate()->format('d/m/Y') == '01/01/2000');\n $this->assertTrue($oDebtorUpdated->getPhoneNumber() == '79988888888');\n $this->assertTrue($oDebtorUpdated->getZipcode() == '11111111');\n $this->assertTrue($oDebtorUpdated->getAddress() == 'Rua Atualização');\n $this->assertTrue($oDebtorUpdated->getNumber() == '005544');\n $this->assertTrue($oDebtorUpdated->getComplement() == 'Conjunto Atualização');\n $this->assertTrue($oDebtorUpdated->getNeighborhood() == 'Bairro Atualização');\n $this->assertTrue($oDebtorUpdated->getCity() == 'Maceió');\n $this->assertTrue($oDebtorUpdated->getState() == 'AL');\n $this->assertTrue(!is_null($oDebtorUpdated->getUpdated()));\n $oDebtorUpdated->delete();\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set params\n $params = $this->customBranchData;\n \n // Add ID\n $ID = $this->_pickRandomItem($branchIDs);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/branch/edit', $params, [], [], ['HTTP_REFERER' => '/branch/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/branch/edit');\n $this->assertSessionHas('branch-updated', '');\n \n // Validate data\n $branch = $this->branch->getOne($ID);\n $this->assertEquals($branch->name, $this->customBranchData['name']);\n $this->assertEquals($branch->promotor_ID, $this->customBranchData['promotor_ID']);\n }", "function check_update( $_, $assoc_args ) {\n\t\tself::run( 'core check-update', $_, $assoc_args );\n\t}", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "public function testUpdatePayrun()\n {\n }", "public function action_update_check()\n\t{\n\t \tUpdate::add( 'DateNinja', 'e64e02e0-38f8-11dd-ae16-0800200c9a66', $this->info->version );\n\t}", "public function test_updateExternalShipment() {\n\n }", "public function testProjectsAssignTeam()\n {\n $project = factory(Project::class)->create();\n $response = $this->get('/project/team?id=' . $project->id);\n $response->assertStatus(200);\n }", "public function testUpdate() {\n\n\t\t$request_uri = $this->root_url . 'update';\n\n\t\t$parameters = array(\n\t\t\t'uri' => $request_uri,\n\t\t\t'method' => 'POST',\n\t\t\t'database' => $this->db,\n\t\t\t'postdata' => array(\n\t\t\t\t'id' => 4,\n\t\t\t\t'firstname' => 'Andrei',\n\t\t\t\t'surname' => 'Kanchelskis',\n\t\t\t)\n\t\t);\n\n\t\t$server = new APIServer( $parameters );\n\n\t\t$server->run();\n\n\t\t$response = $server->getResponse();\n\n\t\t$this->assertArrayHasKey('status', $response);\n\t\t$this->assertArrayHasKey('command', $response);\n\n\t\t$this->assertEquals( $response['command'], 'update' );\n\t}", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "public function testUpdated()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's updated date is correct\n $this->assertTrue($feed->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n $this->verifyProperty2(\n $feed,\n \"updated\",\n \"text\",\n \"2007-05-31T01:15:00.000Z\"\n );\n\n // Assert that all entry's have an Atom Published object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n }\n\n // Assert one of the entry's Published dates\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"updated\", \"text\", \"2007-05-17T10:33:49.000Z\");\n }", "public function testUpdateSubmitted()\n {\n $file = new File;\n $file->setFilespec(\"//depot/foo\")\n ->setLocalContents(\"this is a test\")\n ->add()\n ->submit('original description');\n\n $change = Change::fetch(1);\n $this->assertSame(\"original description\\n\", $change->getDescription());\n\n $change->setDescription('updated description')\n ->save(true);\n\n $change = Change::fetch(1);\n $this->assertSame(\"updated description\\n\", $change->getDescription());\n }", "public function updateTest() {\n if (MLSetting::gi()->get('blSaveMode')) {\n throw MLException::factory('update', 'save mode', 1424074789);\n }\n if (!$this->isWritable(MLFilesystem::getCachePath())) {//needed for tests\n throw MLException::factory('update', 'Path `{#path#}` is not writable.', 1407759765)->setData(array('path' => MLFilesystem::getCachePath()));\n }\n try {// cache is writable, so no exception should come \n $blUpdate = true;\n // clean\n $blUpdate = $blUpdate ? ($this->rm(MLFilesystem::getCachePath('test'))) : false;\n // create file\n $blUpdate = $blUpdate ? ($this->write(MLFilesystem::getCachePath('test/folder/included.php'), \"<?php\\nreturn basename(__file__);\\n\")) : false;\n // includes file\n $blUpdate = $blUpdate ? ('included.php' == (@include MLFilesystem::getCachePath('test/folder/included.php'))) : false;\n // move file\n $blUpdate = \n $blUpdate \n ? $this->mv(\n MLFilesystem::getCachePath('test/folder/included.php'),\n MLFilesystem::getCachePath('test/folder/moved.php')\n )\n : false \n ;\n // include file\n $blUpdate = $blUpdate ? ('moved.php' == (@include MLFilesystem::getCachePath('test/folder/moved.php'))) : false;\n // move folder\n $blUpdate = \n $blUpdate \n ? $this->mv(\n MLFilesystem::getCachePath('test/folder'),\n MLFilesystem::getCachePath('test/otherfolder')\n )\n : false \n ;\n // include file\n $blUpdate = $blUpdate ? ('moved.php' == (@include MLFilesystem::getCachePath('test/otherfolder/moved.php'))) : false;\n } catch (Exception $oEx) {\n MLMessage::gi()->addDebug($oEx);\n $blUpdate = false;\n }\n if (!$blUpdate) {\n throw MLException::factory(\n 'update', \n 'Misc update error', \n 1424075291\n );\n }\n return $this;\n }", "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "function testDeterminingChanges() {\n // Initial creation.\n $support_ticket = entity_create('support_ticket', array(\n 'uid' => $this->webUser->id(),\n 'support_ticket_type' => 'ticket',\n 'title' => 'test_changes',\n ));\n $support_ticket->save();\n\n // Update the support_ticket without applying changes.\n $support_ticket->save();\n $this->assertEqual($support_ticket->label(), 'test_changes', 'No changes have been determined.');\n\n // Apply changes.\n $support_ticket->title = 'updated';\n $support_ticket->save();\n\n // The hook implementations support_ticket_test_support_ticket_presave() and\n // support_ticket_test_support_ticket_update() determine changes and change the title.\n $this->assertEqual($support_ticket->label(), 'updated_presave_update', 'Changes have been determined.');\n\n // Test the static support_ticket load cache to be cleared.\n $support_ticket = SupportTicket::load($support_ticket->id());\n $this->assertEqual($support_ticket->label(), 'updated_presave', 'Static cache has been cleared.');\n }", "public function PullTesst()\n {\n $this->assertTrue(true);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testUpdate()\n {\n $this->actingAs(User::factory()->make());\n $task = new Task();\n $task->title = 'refined_task';\n $task->completed = false;\n $task->save();\n\n $response = $this->put('/tasks/' . $task->id);\n\n $updated = Task::where('title', '=', 'refined_task')->first();\n\n $response->assertStatus(200);\n $this->assertEquals(true, $updated->completed);\n }", "public function testFaqInstall()\r\n {\r\n\t\t$this->faqClass->moduleInstall();\r\n\t\t$needUpdate = $this->faqClass->checkUpdate();\r\n\t\tif($needUpdate)\r\n\t\t\t$this->faqClass->moduleUpdate();\r\n\t}", "public function testEditUsersSuccess()\n {\n $user = User::find(2);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($this->user)\n ->visit('/admin/users/'.$user->id.'/edit')\n ->resize(900, 1000)\n ->assertSee('Update users')\n ->type('name',$user->name)\n ->press('Submit')\n ->assertSee('Successfully updated user!')\n ->assertPathIs('/admin/users');\n });\n $this->assertDatabaseHas('users', [\n 'name' => $user->name]);\n }", "static function updateProject($project)\t{\n\n\t\trequire_once 'DBO.class.php';\n\t\trequire_once 'Project.class.php';\n\n\t\t$db = DBO::getInstance();\n\n\t\t$statement = $db->prepare('\n\t\t\t\tUPDATE projects\n\t\t\t\tSET name = :name,\n\t\t\t\t\tdescription = :description,\n\t\t\t\t\tdeadline = :deadline\n\t\t\t\tWHERE id = :pid');\n\t\t$statement->execute(array(\n\t\t\t\t':name' => $project->getName(),\n\t\t\t\t':description' => $project->getDescription(),\n\t\t\t\t':pid' => $project->getId(),\n\t\t\t\t':deadline' => $project->getDeadline()));\n\t\t\n\t\tif($statement->errorCode() != 0)\t{\n\t\t\t$error = $statement->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\n\t\tif(!$statement->rowCount())\n\t\t\tthrow new Exception(\"No project with such id.\");\n\t\t\n\t\treturn true;\n\n\t}", "public static function checkUpdateRequest() {\n self::checkConnection();\n $data = self::validateUpdateRequest();\n if ($data != null) {\n $project = self::getProjectById($data['id']);\n $project->update($data);\n $project->save();\n $project->updateCategory($data['categories']);\n redirect(url(['_page' => 'project_detail', 'project_id' => $data['id']]));\n }\n }", "public function test_edit_task()\n {\n Task::create([\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date' => '2020-12-12 12:22:00',\n 'project_id' => 1\n ]);\n $response = $this->post('/task/update', [\n 'task_id' => 1,\n 'name' => 'Updated task name', \n 'priority' => 'normal', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '10:08',\n 'project_id' => '1',\n ]);\n $response->assertStatus(302);\n }", "public function testEdit()\n {\n $city = \\App\\City::first();\n\n $this->actingAs( \\App\\User::first() )\n ->visit('/city/'.$city->id.'/edit')\n ->see('Update City / District Information')\n ->type('Chittagong', 'name')\n ->select(2, 'state_id')\n ->select(true, 'status')\n ->press('Update Now')\n ->seePageIs('/city/'.$city->id.'/edit')\n ->see('Updated!');\n }", "function _pm_update_core(&$project, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n drush_print(dt('Code updates will be made to drupal core.'));\n drush_print(dt(\"WARNING: Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt. If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.\"));\n drush_print(dt(\"Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.\"));\n drush_print();\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array('drupal'));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n if(!drush_confirm(dt('Do you really want to continue?'))) {\n drush_print(dt('Rolling back all changes. Run again with --no-core to update modules only.'));\n return drush_user_abort();\n }\n\n // We need write permission on $drupal_root.\n if (!is_writable($drupal_root)) {\n return drush_set_error('DRUSH_PATH_NO_WRITABLE', dt('Drupal root path is not writable.'));\n }\n\n // Create a directory 'core' if it does not already exist.\n $project['path'] = 'drupal-' . $project['candidate_version'];\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (!is_dir($project['full_project_path'])) {\n drush_mkdir($project['full_project_path']);\n }\n\n // Create a list of directories to exclude from the update process.\n $skip_list = array('sites', $project['path']);\n // Add non-writable directories: we can't move them around.\n // We will also use $items_to_test later for $version_control check.\n $items_to_test = drush_scan_directory($drupal_root, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'basename', 0, TRUE);\n foreach (array_keys($items_to_test) as $item) {\n if (is_dir($item) && !is_writable($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n elseif (is_link($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n }\n $project['skip_list'] = $skip_list;\n\n // Move all files and folders in $drupal_root to the new 'core' directory\n // except for the items in the skip list\n _pm_update_move_files($drupal_root, $project['full_project_path'], $project['skip_list']);\n\n // Set a context variable to indicate that rollback should reverse\n // the _pm_update_move_files above.\n drush_set_context('DRUSH_PM_DRUPAL_CORE', $project);\n\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project, $items_to_test)) {\n return FALSE;\n }\n\n // Package handlers want the project directory in project_dir.\n $project['project_dir'] = $project['path'];\n\n // Update core.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n\n // Take the updated files in the 'core' directory that have been updated,\n // and move all except for the items in the skip list back to\n // the drupal root\n _pm_update_move_files($project['full_project_path'], $drupal_root, $project['skip_list']);\n drush_delete_dir($project['full_project_path']);\n\n // Version control engines expect full_project_path to exist and be accurate.\n $project['full_project_path'] = $project['base_project_path'];\n\n // If there is a backup target, then find items\n // in the backup target that do not exist at the\n // drupal root. These are to be moved back.\n if (array_key_exists('backup_target', $project)) {\n _pm_update_move_files($project['backup_target'], $drupal_root, $project['skip_list'], FALSE);\n _pm_update_move_files($project['backup_target'] . '/profiles', $drupal_root . '/profiles', array('default'), FALSE);\n }\n\n pm_update_complete($project, $version_control);\n\n return TRUE;\n}", "public function testVolunteerHourContactEditSuccess_ProjectItemManager()\n {\n // Set test user as current authenticated user\n $this->be($this->projectManager);\n \n $this->session([\n 'username' => $this->projectManager->username, \n 'access_level' => $this->projectManager->access_level\n ]);\n \n $volunteerID = 2;\n // Call route under test\n $response = $this->call('GET', 'volunteerhours/volunteerEdit/'.$volunteerID);\n \n $this->assertContains(\"Editing Volunteer Hours for\", $response->getContent());\n }", "public function test_updateQueue() {\n\n }", "public function testProjectAssignmentsDefineNew()\n {\n }", "public function test_it_update_database_from_api()\n {\n\n $this->json('GET', 'api/v1/update')->assertJsonFragment(\n [\n 'success' => 1\n ]\n );\n\n\n // second assertion , check that database is not empty , so we know that data has been updated after being truncate\n\n $beers = Beer::get();\n $this->assertEquals(false, $beers->isEmpty());\n }", "public function update()\n {\n if (!isset($_GET['id']) || !isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n Project::update($_GET['id'], $_POST['name'], $_POST['creator']);\n\n $project = Project::find($_GET['id']);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }" ]
[ "0.7288457", "0.7124536", "0.70928377", "0.70306", "0.67961925", "0.67551124", "0.6728597", "0.6569805", "0.65312564", "0.65162337", "0.64706093", "0.6440127", "0.6440127", "0.6425131", "0.6410093", "0.6383995", "0.6380321", "0.63390696", "0.6330524", "0.6328308", "0.6320901", "0.6316003", "0.63109547", "0.6307064", "0.62915576", "0.6269597", "0.626454", "0.6244", "0.6238153", "0.6227585", "0.6209971", "0.61740196", "0.617213", "0.6168976", "0.6153875", "0.61492175", "0.6140844", "0.6133011", "0.6113073", "0.6104844", "0.6098615", "0.60884327", "0.608398", "0.60827994", "0.60733795", "0.60621023", "0.6036637", "0.6029318", "0.602056", "0.60126096", "0.60090166", "0.60089594", "0.60027623", "0.59957284", "0.59932023", "0.5987194", "0.59813994", "0.5971712", "0.5943583", "0.5943127", "0.5942996", "0.59414476", "0.5932816", "0.5932278", "0.5925107", "0.5919536", "0.5915366", "0.5907905", "0.59066373", "0.59037346", "0.58892554", "0.58857685", "0.58759826", "0.58729666", "0.586913", "0.586891", "0.58668274", "0.5866254", "0.5863624", "0.5862684", "0.5852096", "0.5843621", "0.58431536", "0.58421177", "0.5841258", "0.58361715", "0.5834437", "0.5832317", "0.5829813", "0.5828394", "0.58247924", "0.5820864", "0.5817579", "0.5815664", "0.5808149", "0.580717", "0.5806705", "0.5803985", "0.5787606", "0.57792604" ]
0.7020412
4
Testing the experiment creation.
public function testCreateExperiment() { echo "\nTesting Experiment creation..."; $input = file_get_contents('exp.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/experiments?owner=wawong"; //echo "\n-------------------------"; //echo "\nURL:".$url; //echo "\n-------------------------"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "\n-----Create Experiment Response:".$response; $result = json_decode($response); $this->assertTrue(!$result->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInstrumentCreate()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code',uniqid('TestInstrument_'))\n ->type('@category', 'Dusk Testing')\n ->type('@module','Summer Capstone')\n ->type('@reference','Test - safe to delete')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('View Instrument - TestInstrument_');\n });\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/authors/create')\n ->type('name', 'John')\n ->type('lastname', 'Doe')\n ->press('Save')\n ->assertPathIs('/authors')\n ->assertSee('John')\n ->assertSee('Doe');\n });\n }", "public function testIntegrationCreate()\n {\n $this->visit('user/create')\n ->see('Create New Account');\n $this->assertResponseOk();\n $this->assertViewHas('model');\n }", "public function testCreateChallengeActivityTemplate()\n {\n }", "public function testCreateScenario()\n {\n $client = static::createClient();\n }", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "public function testAdministrationCreateTraining()\n {\n // Used to fill hidden inputs\n Browser::macro('hidden', function ($name, $value) {\n $this->script(\"document.getElementsByName('$name')[0].value = '$value'\");\n\n return $this;\n });\n\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login())\n ->loginAsUser('[email protected]', 'password');\n\n $browser->assertSee('Formations')\n ->click('@trainings-link')\n ->waitForText('Aucune donnée à afficher')\n ->assertSee('Aucune donnée à afficher')\n ->clickLink('Ajouter formation')\n ->assertPathIs('/admin/training/create');\n\n $name = 'Test create training';\n\n $browser->type('name', $name)\n ->hidden('visible', 1)\n ->press('Enregistrer et retour');\n\n $browser->waitForText($name)\n ->assertSee($name)\n ->assertDontSee('Aucune donnée à afficher')\n ->assertPathIs('/admin/training');\n\n $browser->visit('/')\n ->assertSee('Pas de formation en groupe annoncée pour l\\'instant')\n ->assertDontSee($name);\n });\n }", "public function testCreateChallengeTemplate()\n {\n }", "public function testCreate()\n\t{\n\t\tRoute::enableFilters();\n\t\tEvaluationTest::adminLogin();\n\t\t$response = $this->call('GET', '/evaluation/create');\n\t\t\n\t\t$this->assertResponseOk();\n\n\t\tSentry::logout();\n\t\t\n\t\t//tesing that a normal user can't retrieve a form to create \n\t\t//an evaluation and that a page displays a message as to why they can't\n\t\tEvaluationTest::userLogin();\n\t\t$crawler = $this->client->request('GET', '/evaluation/create');\n\t\t$message = $crawler->filter('body')->text();\n\n\t\t$this->assertFalse($this->client->getResponse()->isOk());\n\t\t$this->assertEquals(\"Access Forbidden! You do not have permissions to access this page!\", $message);\n\n\t\tSentry::logout();\n\t}", "public function testCreateChallengeActivity()\n {\n }", "public function testQuarantineCreate()\n {\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Locator\\\\ResultSetInterface', $subject, 'Subject is not a valid locator result set');\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Test\\\\SourceInterface', $subject, 'Subject is not a valid test source');\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testWebinarCreate()\n {\n }", "public function testCreateChallenge()\n {\n }", "public function testCreate()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n\n $this->assertTrue($player_factory->wasRecentlyCreated);\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "protected function createTests()\n {\n $name = $this->getNameInput();\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Store{$name}Test\",\n '--model' => $name,\n '--type' => 'store',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Update{$name}Test\",\n '--model' => $name,\n '--type' => 'update',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/View{$name}Test\",\n '--model' => $name,\n '--type' => 'view',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Delete{$name}Test\",\n '--model' => $name,\n '--type' => 'delete',\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testGetChallengeActivityTemplate()\n {\n }", "public function testInstance() { }", "public function testCreate()\n {\n $this->visit('/admin/school/create')\n ->submitForm($this->saveButtonText, $this->school)\n ->seePageIs('/admin/school')\n ;\n\n $this->seeInDatabase('schools', $this->school);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }", "public function testCreateTestSuite()\n {\n Artisan::call('migrate');\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->seePageIs('/library')\n ->click('#newSuite')\n ->seePageIs('/library/testsuite/create')\n ->type('TestSuite1', 'name')\n ->type('someDescription', 'description')\n ->type('someGoals', 'goals')\n ->press('submit');\n\n $this->seeInDatabase('TestSuite', [\n 'Name' => 'TestSuite1',\n 'TestSuiteDocumentation' => 'someDescription',\n 'TestSuiteGoals' => 'someGoals'\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "protected function createTest()\n {\n $name = Str::studly($this->argument('name'));\n\n $this->call('make:test', [\n 'name' => 'Controllers\\\\' . $name . 'Test',\n '--unit' => false,\n ]);\n }", "public function testCreate()\n {\n $model = $this->makeFactory();\n \n $this->json('POST', static::ROUTE, $model->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_CREATED) \n ->seeJson($model->toArray());\n }", "public function testCreateAction()\n {\n $res = $this->controller->createAction();\n $this->assertContains(\"Create\", $res->getBody());\n }", "public function testInit()\n {\n\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(static::TEST_SUBJECT_CLASSNAME, $subject, 'A valid instance of the test subject could not be created.');\n $this->assertInstanceOf('OutOfRangeException', $subject, 'Subject is not a valid out of range exception.');\n $this->assertInstanceOf('Dhii\\Exception\\OutOfRangeExceptionInterface', $subject, 'Subject does not implement required interface.');\n }", "public function testJobAdd()\n {\n\n }", "public function testGetChallengeTemplate()\n {\n }", "public function testExample()\n {\n //make unauthorized user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/newcache')\n ->type('The best cache ever', 'name')\n ->type('94.234324234,-35.74352343', 'location')\n ->type('small', 'size')\n ->type('traditional', 'type')\n ->type('like fo reals this is short yo', 'short_description')\n ->type('like fo reals this is the longest description that could be possible yo. but I am a creative fellow \n and I need to express my art in the form of comments that is where I actually discuss the true meaning of \n life and that is death and sad because I am sad my gosh what has my life become I am the excessive of \n computer I am good my friend said so. ', 'long_description')\n ->press('Create')\n ->assertResponseStatus(403);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'Subject is not a valid instance.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Modular\\Module\\ModuleInterface',\n $subject,\n 'Test subject does not implement expected interface.'\n );\n }", "public function testCreate()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testCreateInstance() {\n $tamper_manager = \\Drupal::service('plugin.manager.tamper');\n $plugin_collection = new DefaultLazyPluginCollection($tamper_manager, []);\n foreach ($tamper_manager->getDefinitions() as $plugin_id => $plugin_definition) {\n // Create instance. DefaultLazyPluginCollection uses 'id' as plugin key.\n $plugin_collection->addInstanceId($plugin_id, [\n 'id' => $plugin_id,\n ]);\n\n // Assert that the instance implements TamperInterface.\n $tamper = $plugin_collection->get($plugin_id);\n $this->assertInstanceOf(TamperInterface::class, $tamper);\n\n // Add tamper instances to the entity so that the config schema checker\n // runs.\n $this->entity->setThirdPartySetting('tamper_test', 'tampers', $plugin_collection->getConfiguration());\n $this->entity->save();\n }\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME, $subject,\n 'Subject is not a valid instance'\n );\n }", "public function create_experiment( $project_id, $options ) {\n\t\tif ( ! isset( $options['description'] )\n\t\t || ! isset( $options['edit_url'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "public function testStorage()\n {\n // Test with correct field name\n $this->visit('/cube')\n ->type('First Cube', 'name')\n ->press('submit-add')\n ->see('created successfully');\n\n // Test with incorrect field name\n $this->visit('/cube')\n ->press('submit-add')\n ->see('is required');\n }", "public function testExample()\n {\n }", "public function testWebinarPollCreate()\n {\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function test___construct() {\n\t\t}", "public function test___construct() {\n\t\t}", "public function test()\n {\n $this->executeScenario();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $values = [\n 'number' => 'Bill',\n 'attachments' => __DIR__.'/test_image.jpg',\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ];\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'/bills/create')\n ->attach('attachments[]', $values['attachments'])\n ->type('number', $values['number'])\n ->select('contract_id', $values['contract_id'])\n ->select('requisite_id', $values['requisite_id'])\n ->type('services[0][name]', $values['name'])\n ->type('services[0][quantity]', $values['quantity'])\n ->type('services[0][measure]', $values['measure'])\n ->type('services[0][price]', $values['price'])\n ->press('Сохранить')\n ->assertPathIs('/tenants/'.$this->tenant->id)\n ->assertQueryStringHas('tab')\n ->assertFragmentIs('tab')\n ->assertSee($values['number']);\n });\n }", "protected function createFeatureTest()\n {\n $model_name = Str::studly(class_basename($this->argument('name')));\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:test', [\n 'name' => \"{$model_name}Test\",\n ]);\n\n $path = base_path() . \"/tests/Feature/{$model_name}Test.php\";\n $this->cleanupDummy($path, $name);\n }", "public function setUp()\n {\n\n parent::setUp();\n\n // Create a default exhibit.\n $this->exhibit = $this->_exhibit();\n\n }", "public function testProfileCreate()\n {\n\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "protected function _initTest(){\n }", "public function run()\n {\n $projectNum = Project::count();\n $faker = Faker::create();\n $project_limit=require('Config.php');\n for($i=1;$i<=$projectNum;$i++)\n {\n if($i%200 ==0)\n $this->command->info('Test Suite Seed :'.$i.' out of: '.$projectNum);\n $TestsTestArch = DB::table('project_assignments')->select('user_id','role_id')->\n where([['project_id','=',$i]])->\n whereIn('role_id',[7,8,9])->get();\n //let's say Tester, Test Lead and Test Architect together create around 20-40 folder per projects\n $numberOfTestSuites = rand($project_limit['projects']['min_test_suite'],$project_limit['projects']['max_test_suite']);\n for($j=0;$j<$numberOfTestSuites;++$j)\n {\n TestSuite::create(array(\n 'project_id'=>$i,\n 'name'=>$faker->sentence(4),\n //let's say only 90% of Test Suite have description\n 'description'=>rand(0,100)<80?$faker->paragraph(6):null,\n 'creator_id'=>$faker->randomElement($TestsTestArch)->user_id\n ));\n }\n }\n }", "public function testBasics() {\n\t\t$model = new AElasticRecord;\n\t\t$model->id = 123;\n\t\t$model->name = \"test item\";\n\t\t$this->assertEquals(123, $model->id);\n\t\t$this->assertEquals(\"test item\",$model->name);\n\t}", "public function testCreateSite()\n {\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function run()\n {\n $count = 10;\n $this->command->info(\"Creating {$count} Testimonies.\");\n factory(App\\Testimonies::class, $count)->create();\n $this->command->info('Testimonies Created!');\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', '[email protected]')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }", "public function testCreateNewEpisode()\n {\n Channel::create([\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n\n $this->seeInDatabase('channels', [\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n }", "public function run()\n {\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Colossus'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Steven'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Capybaby'\n ]);\n }", "abstract protected function constructTestHelper();", "function a_user_can_be_created(){\n\n $profession = factory(Profession::class)->create([\n 'title' => 'Web Developer'\n ]);\n $skillA = factory(Skill::class)->create([\n 'description' => 'CSS'\n ]);\n $skillB = factory(Skill::class)->create([\n 'description' => 'HTML'\n ]);\n\n $this->browse(function(Browser $browser) use ($profession,$skillA,$skillB){\n $browser->visit('users/create')\n ->assertSeeIn('h5','Create User')\n ->type('name','Yariel Gordillo')\n ->type('email','[email protected]')\n ->type('password','secret')\n ->type('bio','This a small bio')\n ->select('profession_id',$profession->id)\n ->type('twitter' ,'https://twitter.com/yariko')\n ->check(\"skills[{$skillA->id}]\")\n ->check(\"skills[{$skillB->id}]\")\n ->radio('role', 'user')\n ->press('Create User')\n ->assertPathIs('/users')\n ->assertSee('Yariel Gordillo')\n ->assertSee('[email protected]');\n });\n\n }", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "public function testCreate()\n {\n $aircraft = new Aircraft();\n $this->assertFalse($aircraft->save());\n\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $this->assertTrue($aircraft->save());\n }", "public function testBasicTest()\n {\n $test = Test::create([\n 'title' =>'title',\n 'about' => 'about',\n 'timer' => null,\n 'full_result' => false,\n ])->fresh();\n dd($test->version->id);\n }", "public function run()\n {\n $labOrder = factory(LabOrder::class)->create();\n $SKUs = SKU::where('item_type', 'lab-test')->get()->shuffle();\n\n for ($i=0; $i < 5; $i++) {\n $labTest = factory(LabTest::class)->create([\n 'lab_order_id' => $labOrder->id,\n 'sku_id' => $SKUs->pop()->id,\n ]);\n if (maybe()) {\n factory(LabTestResult::class)->create([\n 'lab_test_id' => $labTest->id,\n ]);\n }\n }\n }", "protected function setUp() \n {\n $this->object = new Exam(); \n }", "public function testGetChallengeActivityTemplates()\n {\n }", "public function testCanBeCreated()\n {\n $subject = new Iteration('', '');\n\n $this->assertInstanceOf(\n 'Dhii\\\\Iterator\\\\IterationInterface',\n $subject,\n 'Subject does not implement expected parent.'\n );\n }", "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreate()\n {\n\n $this->createDummyPermission(\"1\");\n $this->createDummyPermission(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc,\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n 'permission1' => 2\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testCreateContador()\n {\n }", "public function run()\n {\n factory(societe_has_stage::class, 50)->create();\n }", "public function testWebinarRegistrantCreate()\n {\n }", "public function testCreate()\n {\n $this->specify(\"we want to add the history record\", function () {\n /** @var History $history history record */\n $history = Yii::createObject('inblank\\team\\models\\History');\n expect(\"we can't add the history without team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 999;\n $history->user_id = 999;\n expect(\"we can't add the history with not existing team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 1;\n $history->user_id = 2;\n expect(\"we can't add the history if user not in team\", $history->save())->false();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->user_id = 1;\n expect(\"we can't add the history without action\", $history->save())->false();\n expect(\"we must see error message `action`\", $history->getErrors('action'))->notEmpty();\n $history->action = History::ACTION_ADD;\n expect(\"we can add the history\", $history->save())->true();\n });\n }", "public function run()\n {\n factory(\\App\\challenge::class, function (Faker\\Generator $faker) {\n $type = ['Web', 'Re', 'Pwn', 'Crypto', 'Misc'];\n\n return [\n 'title' => $faker->title,\n 'class' => $faker->randomElement($type),\n 'description' => $faker->realText($maxNbChars = 100),\n 'url' => $faker->url,\n 'flag' => $faker->sha256,\n 'score' => $faker->numberBetween($min = 1, $max = 100),\n ];\n });\n }", "public function testCreate()\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $factory = new components\\Factory();\n //Success\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"gitlab\"), new components\\platforms\\Gitlab([]));\n $this->assertEquals($factory->create(\"bitbucket\"), new components\\platforms\\Bitbucket([]));\n //Exception Case\n $this->expectException(\\LogicException::class);\n $platform = $factory->create(\"Fake\");\n\n }", "public function testWebinarPanelistCreate()\n {\n }", "public function testEventCreate()\n {\n $response = $this->get('events/create');\n\n $response->assertStatus(200);\n }", "public function testCreatePatrimonio()\n {\n }", "public function testCreateTimesheet()\n {\n }", "public function run()\n {\n factory(App\\Work::class)->create([\n 'title' => 'Paseo Boulevard',\n 'content' => 'El intendente José Corral presentó a los vecinos el proyecto de remodelación del Paseo Boulevard en febrero de 2016. Las obras de puesta en valor comprenden desde el Puente Colgante hasta Avenida Freyre, priorizan la circulación peatonal por sobre la actividad vehicular. ',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class)->create([\n 'title' => 'Remodelación de la Avenida Blas Parera',\n 'content' => 'La avenida contará con un corredor exclusivo para transporte público de pasajeros urbano y metropolitano en el centro de la traza, en ambos sentidos de circulación, además de una ciclovía. Esa avenida-ruta -que fue centro de tantos reclamos durante años- modificará completamente su fisonomía a lo largo de casi 6 km.',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class, 10)->create();\n }", "public function testCreateExpedicao()\n {\n }", "protected function setUp() {\n\t$this->object = new Competition(20);\n\t$this->assertNotNull($this->object);\n }", "public function testAddTemplate()\n {\n\n }", "protected function setUp() {\n parent::setUp();\n $this->cleanUpAll();\n\n\n $this->institution = new Institution();\n $this->institution->setName('San Francisco State University');\n $this->institution->setAbbreviation(\"SFSU\");\n $this->institution->setCity('San Francisco');\n $this->institution->setStateProvince('CA');\n $this->institution->setCountry('USA');\n $this->institution->save();\n\n $this->oldInstitution = new Institution();\n $this->oldInstitution->setName('Punjabi University');\n $this->oldInstitution->setAbbreviation(\"PU\");\n $this->oldInstitution->setCity('Patiala');\n $this->oldInstitution->setStateProvince('PB');\n $this->oldInstitution->setCountry('INDIA');\n $this->oldInstitution->save();\n\n\n $this->project = new PersistentProject();\n $this->project->setProjectJnName(\"ppm-8\");\n $this->project->setSummary(\"Infinity Metrics\");\n $this->project->save();\n\n $this->oldProject = new PersistentProject();\n $this->oldProject->setProjectJnName(\"ppm\");\n $this->oldProject->setSummary(\"paticipation metrics\");\n $this->oldProject->save();\n\n $this->instructor = UserManagementController::registerInstructor(self::USERNAME,\"PASSWORD\" ,\"[email protected]\",\n \"firstname\", \"lastname\",$this->oldProject->getProjectJnName(),true,\n $this->oldInstitution->getAbbreviation(), \"Teacher1\");\n }", "public function run()\n {\n factory(App\\Subject::class,'assessment',3)->create();\n factory(App\\Group::class,'assessment',3)->create();\n factory(App\\Student::class,'assessment',14)->create();\n factory(App\\Assessment::class,'assessment',40)->create();\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testInstrumentCreateFail()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n\n //Trying when leaving the Code field empty\n //->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Category field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n //->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Module field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n //->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n });\n }", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function preTesting() {}" ]
[ "0.65538555", "0.65322083", "0.632858", "0.6290923", "0.62865835", "0.62109554", "0.62014955", "0.6199749", "0.6188527", "0.6176559", "0.61609805", "0.6158647", "0.6152849", "0.61229026", "0.6113385", "0.611306", "0.611306", "0.60945725", "0.6086307", "0.60797703", "0.60791343", "0.60791343", "0.605772", "0.60510534", "0.6046629", "0.6018587", "0.60177886", "0.59871846", "0.59777296", "0.5955141", "0.5955141", "0.5955141", "0.59276795", "0.59183586", "0.59073955", "0.5902765", "0.59024024", "0.5902232", "0.58961105", "0.58919305", "0.5879167", "0.5878877", "0.5868836", "0.5861893", "0.5851767", "0.5833216", "0.58327925", "0.5827744", "0.5826783", "0.58197093", "0.58190596", "0.58190596", "0.5815709", "0.5799656", "0.5799138", "0.57963896", "0.57838976", "0.577326", "0.57641995", "0.57619864", "0.5761214", "0.57608324", "0.5759225", "0.575873", "0.57569915", "0.5753206", "0.57507414", "0.5750209", "0.57434255", "0.57373005", "0.5736376", "0.57335186", "0.5729262", "0.57287794", "0.57259", "0.5719424", "0.5718916", "0.5714852", "0.5714852", "0.57109195", "0.5710791", "0.57102454", "0.570935", "0.57052577", "0.5694593", "0.569136", "0.56908196", "0.5689493", "0.5682476", "0.5680415", "0.5676975", "0.56638044", "0.5662279", "0.5660247", "0.5655335", "0.5654278", "0.5650159", "0.56490713", "0.56375533", "0.5636239" ]
0.8075641
0
Testing the experiment listing
public function testListExperiments() { echo "\nTesting experiment listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/experiments"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testListExperts()\n {\n }", "public function testListPastWebinarQA()\n {\n }", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function _testMultipleInventories()\n {\n\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getExperimentsList(){\n return $this->_get(1);\n }", "public function test_admin_training_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function actionTest()\n {\n $page_size = Yii::$app->request->get('per-page');\n $page_size = isset( $page_size ) ? intval($page_size) : 4;\n\n\n $provider = new ArrayDataProvider([\n 'allModels' => $this->getFakedModels(),\n 'pagination' => [\n // Should not hard coded\n 'pageSize' => $page_size,\n ],\n 'sort' => [\n 'attributes' => ['id'],\n ],\n ]);\n\n return $this->render('test', ['listDataProvider' => $provider]);\n }", "public function testListSites()\n {\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testWebinarPanelists()\n {\n }", "public function testListPastWebinarPollResults()\n {\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function test_admin_training_list_b()\n {\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function getExperimentInfosList(){\n return $this->_get(2);\n }", "public function testJobList()\n {\n\n }", "public function getTests();", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function testList()\n {\n \t$games_factory = factory(Game::class, 3)->create();\n \t$games = Game::all();\n \t\n $this->assertCount(3, $games);\n }", "public function indexAction()\n\t{\n\t\t// TODO: do not only check if experiments exist, but if treatment exist\n\t\t// fetch list of experiments to show note when none exist\n\t\t$experimentModel = Sophie_Db_Experiment :: getInstance();\n\t\t$overviewSelect = $experimentModel->getOverviewSelect();\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array('experiment.name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl::getInstance()->addSelectAcl($overviewSelect, 'experiment');\n\t\t\t$overviewSelect->order(array('experiment.name', 'acl.rule'));\n\t\t}\n\t\t$overviewSelect->group(array('experiment.id'));\n\t\t$this->view->hasTreatment = sizeof($overviewSelect->query()->fetchAll()) > 0;\n\n\t\t// fetch sessions list\n\t\t$sessionModel = Sophie_Db_Session :: getInstance();\n\t\t$db = $sessionModel->getAdapter();\n\t\t$overviewSelect = $sessionModel->getOverviewSelect();\n\n\t\t// add filters from form\n\t\t$filterExperimentId = $this->_getParam('filterExperimentId', null);\n\t\tif (!is_null($filterExperimentId))\n\t\t{\n\t\t\t$overviewSelect->where('experiment.id = ?', $filterExperimentId);\n\t\t}\n\n\t\t$filterState = $this->_getParam('filterState', null);\n\t\tif (!is_null($filterState))\n\t\t{\n\t\t\t$overviewSelect->where('session.state = ?', $filterState);\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$overviewSelect->where('session.state != ?', 'terminated');\n\t\t\t$overviewSelect->where('session.state != ?', 'archived');\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name'\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl :: getInstance()->addSelectAcl($overviewSelect, 'session');\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name',\n\t\t\t\t'acl.rule'\n\t\t\t));\n\t\t}\n\n\t\t$overviewSelect->group(array (\n\t\t\t'session.id'\n\t\t));\n\n\t\t$this->view->sessions = $overviewSelect->query()->fetchAll();\n\t\t$this->view->adminMode = $adminMode;\n\t\t$this->view->adminRight = $adminRight;\n\t}", "public function testlistAction() \n {\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->getTestDetails();\n $data = array();\n $result = json_encode($result);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "public function test_list()\n {\n $response = $this->get('/proposal/all');\n\n $response->assertSee('data-js-proposal-cards');\n\n $response->assertSee('card-header');\n\n $response->assertStatus(200);\n }", "public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }", "public function testIndexActionHasExpectedData()\n {\n $this->dispatch('/index');\n $this->assertQueryContentContains('h1', 'My Albums');\n\n // At this point, i'd like to do a basic listing count of items.\n // However, we're not using a seperate test db with controlled seeds.\n // $this->assertQueryCount('table tr', 6);\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function test_listIndexAction ( )\n {\n $params = array(\n 'event_id' => 1,\n 'action' => 'list',\n 'controller'=> 'scales',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n\n }", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public function TestListAll()\n {\n $temp = BASE_FOLDER . '/.dev/Tests/Data/Testcases';\n\n $this->options = array(\n 'recursive' => true,\n 'exclude_files' => false,\n 'exclude_folders' => false,\n 'extension_list' => array(),\n 'name_mask' => null\n );\n $this->path = BASE_FOLDER . '/.dev/Tests/Data/Testcases/';\n\n $adapter = new fsAdapter($this->action, $this->path, $this->filesystem_type, $this->options);\n\n $this->assertEquals(38, count($adapter->fs->data));\n\n return;\n }", "public function testIntegrationIndex()\n {\n $userFaker = factory(Model::class)->create([\n 'name' => 'Foo Bar'\n ]);\n $this->visit('user')\n ->see($userFaker->name);\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'name' => $userFaker->name,\n 'email' => $userFaker->email,\n ]);\n $this->assertViewHas('models');\n }", "protected function getTestList() \n {\n $invalid = 'invalid';\n $description = 'text';\n $empty_description = '';\n $testlist = [];\n $testlist[] = new ArgumentTestConfig($this->empty_argument, $empty_description,CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_optional, $empty_description, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_required, $empty_description, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_invalid, $empty_description, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string_description, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array_description, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_invalid_description, $this->argument_name, $invalid, $invalid, $description, \\InvalidArgumentException::class);\n \n return $testlist;\n }", "public static function get_tests()\n {\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testListPastWebinarFiles()\n {\n }", "public function test_notes_list()\n {\n Note::create(['note'] => 'Mi primera nota');\n Note::create(['note'] => 'Segunda nota');\n $this->visit('notes')\n ->see('Mi primera nota')\n ->see('Segunda nota');\n }", "public function testIndex()\n {\n $this->visit('/cube')\n ->see('Choose a Cube')\n ->see('Add a Cube')\n ->see('Upload Cube')\n ->see('This is an application just to show how the Cube Summation')\n ->dontSee('Update Cube')\n ->dontSee('Query Cube')\n ->dontSee('Blocks for');\n }", "public function testListManifests()\n {\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }", "public function test_listSettings() {\n\n }", "public function testGetAll()\n {\n $ret =\\App\\Providers\\ListsServiceProvider::getLists();\n \n $this->assertNotEmpty($ret);\n }", "public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }", "public function testListSiteContainers()\n {\n }", "public function testListPeople()\n {\n }", "public function testListMetadata()\n {\n }", "public function testListAndListItems(array $test) {\n $this->performTest($test);\n }", "public function testWebinarPanelistCreate()\n {\n }", "public function testShow()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n Item::factory()->count(10)->create();\n\n //Test success get the item\n $this->json('GET', '/items/1')\n ->seeJson([\n 'status' => 'ok',\n ])\n ->seeJson([\n 'email' => '[email protected]',\n ])\n ->seeJson([\n 'name' => 'test',\n ])\n ->seeJsonStructure([\n 'data' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]);\n\n //test item not found\n $this->call('GET', '/items/11111')\n ->assertStatus(404);\n }", "public function test_individual_item_is_displayed()\n {\n $response = $this->get(\"/item-detail/1\");\n $response->assertSeeInOrder(['<strong>Title :</strong>', '<strong>Category :</strong>', '<strong>Details :</strong>']);\n }", "public function testIndex()\n\t{\n\t\t$data = [];\n\n\t\tforeach ($this->saddles as $saddle) {\n\t\t\t$data[] = [\n\t\t\t\t'id' => $saddle->id,\n\t\t\t\t'name' => $saddle->name,\n\t\t\t\t'horse' => [\n\t\t\t\t\t'id' => $saddle->horse->id,\n\t\t\t\t\t'stable_name' => $saddle->horse->stable_name,\n\t\t\t\t],\n\t\t\t\t'brand' => [\n\t\t\t\t\t'id' => $saddle->brand->id,\n\t\t\t\t\t'name' => $saddle->brand->name,\n\t\t\t\t],\n\t\t\t\t'style' => [\n\t\t\t\t\t'id' => $saddle->style->id,\n\t\t\t\t\t'name' => $saddle->style->name,\n\t\t\t\t],\n\t\t\t\t'type' => $saddle->type,\n\t\t\t\t'serial_number' => $saddle->serial_number,\n\t\t\t\t'created_at' => $saddle->created_at->format('d/m/Y'),\n\t\t\t];\n\t\t}\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->get('/api/v1/admin/saddles?per_page=9999')\n\t\t\t ->assertStatus(200)\n\t\t\t ->assertJson(['data' => $data]);\n\t}", "public function testGetExtensionIndexPage()\n\t{\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@index');\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewIs('orchestra::extensions.index');\n\t}", "public function testShow()\n {\n $client = static::createClient();\n $max_jobs_on_category = static::$kernel->getContainer()->getParameter('max_jobs_on_category');\n $em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');\n\n $slug = 'programming';\n $crawler = $client->request('GET', '/category/'.$slug);\n\n // only $max_jobs_on_category jobs are listed\n $category = $em->getRepository(Category::class)->findOneBySlug(['slug' => $slug]);\n $totalActiveJobs = $em->getRepository(Job::class)->countActiveJobs($category->getId());\n\n $jobsOnPage = ($totalActiveJobs <= $max_jobs_on_category) ? $totalActiveJobs : $max_jobs_on_category;\n $pages = ceil($totalActiveJobs / $max_jobs_on_category);\n\n $this->assertTrue($crawler->filter('.jobs tr')->count() == $jobsOnPage);\n $this->assertRegExp(\"/$totalActiveJobs jobs/\", $crawler->filter('.pagination_desc')->text());\n $this->assertRegExp(\"/page 1\\/$pages/\", $crawler->filter('.pagination_desc')->text());\n\n $link = $crawler->selectLink('2')->link();\n $crawler = $client->click($link);\n $this->assertEquals(2, $client->getRequest()->attributes->get('page'));\n $this->assertRegExp(\"/page 2\\/$pages/\", $crawler->filter('.pagination_desc')->text());\n }", "public function testIndex()\n {\n $client = static::createClient();\n $crawler = $client->request('GET', '/');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertCount(1, $crawler->filter('h1'));\n $this->assertEquals(1, $crawler->filter('html:contains(\"Trick List\")')->count());\n }", "public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }", "public function testGetAllEspMeds()\n {\n \n $controller = new EspMedController();\n $reponse = $controller->index();\n $this->assertJson($reponse);\n \n }", "function testOverview() {\n $this->drupalGet(Url::fromRoute('linkit.matchers', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ]));\n $this->assertText(t('No matchers added.'));\n\n $this->assertLinkByHref(Url::fromRoute('linkit.matcher.add', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ])->toString());\n }", "public function testExample()\n {\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.login'))\n ->type('username', 'admin1')\n ->type('password', '123456')\n ->press('login')\n ->assertPathIs('/admin/index');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'abcd')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'nhân dâu')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'valentine')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n }", "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testList()\n {\n \t$player_factory = factory(KillingMode::class, 3)->create();\n \t$player = KillingMode::all();\n \t\n $this->assertCount(3, $player);\n }", "public function testIndex()\n {\n // $this->assertTrue(true);\n $response = $this->json('get','/api/todos');\n $this->seeJsonStructure($response, [\n '*' => [\n 'id', 'status', 'title', 'created_at', 'updated_at'\n ]\n ]);\n }", "public function testDevicesIndex()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/devices')\n ->assertSee('Devices')\n ->assertSee('Kitchen Fridge')\n ->assertSee('Thermostat')\n ->assertSee('Gas Meter')\n ->assertSee('Water Meter')\n ->assertSee('Electricity Meter');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n \n $browser->visit('/')\n ->pause(2000)\n ->assertSee('后台登录');\n \n\n // 页面 url, 是否有All按钮, select 选择框\n // 模板 [\"url\" => \"\", \"select\" => [\"name\" => \"\", \"value\" => \"\"]]\n /*\n $pages = [\n [\"url\" => \"/user_manage/all_users\", \"all\" => true, \"select\" => [\"name\" => \"id_grade\", \"value\" => 102], \"click\" => \".td-info\"],\n [\"url\" => \"human_resource/index_new\", \"select\" => [\"name\" => \"id_teacher_money_type\", \"value\" => 0], \"click\" => \".opt-freeze-list\"],\n [\"url\" => \"/authority/manager_list\", \"select\" =>[\"name\" => \"id_call_phone_type\", \"value\" => \"2\"]]\n ];\n \n foreach($pages as $item) {\n $browser->visit($item[\"url\"])->pause(5000);\n if (isset($item[\"all\"]))\n $browser->press(\"ALL\");\n //$browser->select($item[\"select\"]['name'], $item[\"select\"][\"value\"]);\n if (isset($item[\"click\"]) && $item[\"click\"])\n $browser->click($item[\"click\"]);\n //$browser->pause(5000);\n }*/\n\n /* $browser->visit(\"/user_manage/all_users\")\n ->press(\"ALL\")\n ->select(\"id_grade\", 101)\n ->select(\"id_grade\", 102)\n ->click(\".td-info\")\n ->pause(500);\n /*\n\n //$browser->click(\".bootstrap-dialog-body .opt-user\");\n\n $browser->click(\".bootstrap-dialog-header .close\"); // 关闭模态框\n\n $browser->visit(\"/tea_manage/lesson_list\")\n ->press(\"ALL\")\n ->pause(2000);\n */\n\n });\n }", "public function testGetList()\n {\n $result = $this->getQueryBuilderConnection()\n ->select('field')\n ->from('querybuilder_tests')\n ->where('id', '>', 7)\n ->getList();\n\n $expected = [\n 'iiii',\n 'jjjj',\n ];\n\n $this->assertEquals($expected, $result);\n }", "public function testShow()\n {\n $this->visit('/cube/1')\n ->see('Update Cube')\n ->see('Query Cube')\n ->see('Blocks for');\n }", "public function test_admin_usecase_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'usecase_list']);\n $this->assertResponseCode(404);\n }", "public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "public function test_list_of_resource()\n {\n $response = $this->artisan('resource:list');\n $this->assertEquals(0, $response);\n }", "public function action_index()\n {\n $this->model->show_test_data();\n //$this->view->generate('test_view.php', $this->template, $page, $this->data);\n }", "public function testListDocuments()\n {\n }", "public function test_getByExample() {\n\n }", "public function testCheckIfOverviewContainsSuite()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestSuite1')\n ->assertViewHas('testSuites');\n\n }", "public function overviewallAction() {\n\n $this->validateUser();\n\n $testCase = new Yourdelivery_Model_Testing_TestCase();\n $this->view->testcases = $testCase->getTable()->fetchAll()->toArray();\n $this->view->exp = $testCase->getExpectations();\n }", "public function test_shows_skills_list()\n {\n factory(Skill::class)->create(['name' => 'PHP']);\n factory(Skill::class)->create(['name' => 'JS']);\n factory(Skill::class)->create(['name' => 'SQL']);\n\n $this->get('/habilidades')\n \t\t ->assertStatus(200)\n \t\t ->assertSeeInOrder([\n \t\t \t'JS',\n \t\t \t'PHP',\n \t\t \t'SQL'\n \t\t ]);\n }", "public function testIndexActionGet()\n {\n $res = $this->controller->indexActionGet();\n $this->assertContains(\"View all items\", $res->getBody());\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function imagesListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Images List is displayed on the Edit Episode page. - C15646');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Images List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('IMAGES');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $I->see('e653f1094306790084dd8262c5a0e168.png', ContentPage::$imagesTable);\n }\n else\n {\n $I->see('45ad52a32ca5e4d374086aaa19c49e02.png', ContentPage::$imagesTable);\n }\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', '[email protected]')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }", "public function testListServers()\n {\n }", "public function testExample()\n {\n $this->seeInDatabase('geolite', [\n 'city_name' => 'Toledo'\n ]);\n $this->seeInDatabase('geolite', [\n 'country_name' => 'Cyprus'\n ]);\n\n }", "public function test_list_page_shows_all_tasks()\n {\n\n // creiamo dei task e ci assicuriamo che nella vista ci siano un certo particolare set di dati\n // i assicuro che alla vista venga passata la ariabile dal controller ma non che sia stampata nella vista\n\n $task1 = factory(Task::class)->create();\n $task2 = factory(Task::class)->create();\n\n $this->get('tasks')\n ->assertViewHas('tasks')\n ->assertViewHas('tasks', Task::with('actions')->get())\n ->assertViewHasAll([\n 'tasks' => Task::with('actions')->get(),\n 'title' => 'Tasks page'\n ])->assertViewMissing('dogs');\n }", "public function index()\n {\n return Inertia::render('TestResult', [\n 'testResultList' => TestResult::latest()->paginate(5)\n ]);\n }", "public function setUp(){\n $this->testCases = Files::listFilesInFolder(__DIR__.\"/../../examples/sections/components\",\"ExamplePanel.php\");\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testIndexPageCanBeOpened()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@index');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function testList()\n {\n //Tests all products\n $this->clientAuthenticated->request('GET', '/product/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n\n //Tests all products linked to a child\n $this->clientAuthenticated->request('GET', '/product/list/child/1');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n }", "public function testIndex(): void\n {\n $demoJob = factory(JobPoster::class)->states(['draft', 'byDemoManager'])->create();\n $otherDemoJob = factory(JobPoster::class)->states(['draft', 'byDemoManager'])->create();\n $draftJob = factory(JobPoster::class)->states(['draft', 'byUpgradedManager'])->create();\n $reviewJob = factory(JobPoster::class)->states(['review_requested', 'byUpgradedManager'])->create();\n $openJob = factory(JobPoster::class)->states(['live', 'byUpgradedManager'])->create();\n $closedJob = factory(JobPoster::class)->states(['closed', 'byUpgradedManager'])->create();\n\n $demoJson = $this->jobToArray($demoJob);\n $draftJson = $this->jobToArray($draftJob);\n $reviewJson = $this->jobToArray($reviewJob);\n $openJson = $this->jobToArray($openJob);\n $closedJson = $this->jobToArray($closedJob);\n\n // A guest receives open and closed jobs\n $guestResponse = $this->json('get', route('api.v1.jobs.index'));\n $guestResponse->assertJsonCount(2);\n $guestResponse->assertJsonFragment($openJson);\n $guestResponse->assertJsonFragment($closedJson);\n\n // An demo manager (ie applicant) can see open/closed jobs, and its own demo jobs\n $applicantResponse = $this->actingAs($demoJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $applicantResponse->assertJsonCount(3);\n $applicantResponse->assertJsonFragment($demoJson);\n $applicantResponse->assertJsonFragment($openJson);\n $applicantResponse->assertJsonFragment($closedJson);\n\n // A manager can view its own draft job, and open/closed jobs\n $draftManagerResponse = $this->actingAs($draftJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $draftManagerResponse->assertJsonCount(3);\n $draftManagerResponse->assertJsonFragment($draftJson);\n $draftManagerResponse->assertJsonFragment($openJson);\n $draftManagerResponse->assertJsonFragment($closedJson);\n\n // A manager can also view its on job in review\n $reviewManagerResponse = $this->actingAs($reviewJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $reviewManagerResponse->assertJsonCount(3);\n $reviewManagerResponse->assertJsonFragment($reviewJson);\n $reviewManagerResponse->assertJsonFragment($openJson);\n $reviewManagerResponse->assertJsonFragment($closedJson);\n\n // An admin can view all jobs\n $adminUser = factory(User::class)->state('admin')->create();\n $adminResponse = $this->actingAs($adminUser)->json('get', route('api.v1.jobs.index'));\n $adminResponse->assertJsonCount(6);\n }", "public function test_all_item_listed_or_no_listed_items_message_is_displayed()\n {\n $response = $this->get('/');\n if($response->assertSeeText(\"Details\")){\n $response->assertDontSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n } else {\n $response->assertSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n }\n }", "public function testGettingStartedListing()\n\t{\n\t\t$oSDK=new BrexSdk\\SDKHost;\n\t\t$oSDK->addHttpPlugin($this->oHostPlugin);\n\n\n\t\t//Let's get company details to start\n\t\t$oTeamClient=$oSDK->setAuthKey($this->BREX_TOKEN) #consider using a token vault\n\t\t\t\t->setupTeamClient();\n\n\t\t/** @var BrexSdk\\API\\Team\\Client */\n\t\t$oTeamClient;\n\n\t\t//... OR\n\t\t//if you will be doing work across the API, use the follow convenience method\n\t\t$oTeamClient=$oSDK->setupAllClients()->getTeamClient();\n\t\t//etc...\n\n\t\t/** @var BrexSdk\\API\\Team\\Model\\CompanyResponse */\n\t\t$aCompanyDetails=$oTeamClient->getCompany();\n\n\t\t$sCompanyName=$aCompanyDetails->getLegalName();\n\t\t// ACME Corp, Inc.\n\t\tcodecept_debug($sCompanyName);\n\t\t$this->assertStringContainsString('Nxs Systems Staging 01', $sCompanyName);\n\t}", "public function testIndex()\n {\n $this->visit('/')\n ->see('STUDENT MONEY ASSISTANCE');\n }", "public function testShowAllAuthors()\n {\n\n $this->seeInDatabase('authors',[\n 'username'=> 'Smith72'\n ]);\n\n\n \n }", "public function videoListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Video List is displayed on the Edit Episode page. - C15640');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Video List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('VIDEOS');\n $I->see('series_view_filled_data_automation_1_episode_1_media_id', ContentPage::$videoTable);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function testDisplayedTest() {\n\n $this->open('?r=site/page&view=test');\n $this->assertEquals('My Web Application - Test', $this->title());\n\n $elements = $this->elements($this->using('css selector')->value('#yw0 > li'));\n error_log(__METHOD__ . ' . count($var): ' . count($elements));\n foreach ($elements as $element) {\n $text = $element->byCssSelector('#yw0 > li > a')->text();\n error_log(__METHOD__ . ' . $text: ' . $text);\n\n if ($text === 'Test') {\n $element->click();\n $breadcrumbsTest = $this->byCssSelector('#page > div.breadcrumbs > span');\n $bool = $breadcrumbsTest->displayed();\n $this->assertEquals(True, $bool);\n $this->assertEquals('Test', $this->byCssSelector('#page > div.breadcrumbs > span')->text());\n break;\n }\n }\n sleep(1);\n }", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function testListAllDocuments()\n {\n }", "public function testExample()\n {\n $data = People::where('id', '=', 6)->get();\n foreach ($data as $peps => $pep) {\n if (!$pep->fb_completed || $pep->fb_completed == '') {\n $this->browse(function (Browser $browser) use ($pep) {\n $browser->visit('www.facebook.com/')\n ->pause(1500)\n ->clickLink('Create New Account')\n ->pause(3000)\n ->type('firstname', $pep->first_name)\n ->type('lastname', $pep->last_name)\n ->type('reg_passwd__', 'refrigerator')\n ->type('reg_email__', $pep->email . '@yandex.com')\n ->pause(120000)\n ->assertSee('Facebook');\n });\n $pep->fb_completed = 'true';\n }\n }\n }", "public function index()\n {\n \n\n $experiments = Experiment::all();\n return view('experiment_index', ['data' => $experiments]);\n /*foreach ($experiments as $experiment) {\n echo $experiment->name;\n echo '<br>';\n echo $experiment->comment;\n }*/\n }", "public function test()\n {\n $this->executeScenario();\n }", "function babeliumsubmission_get_available_exercise_list(){\n Logging::logBabelium(\"Getting available exercise list\");\n $this->exercises = $this->getBabeliumRemoteService()->getExerciseList();\n return $this->getExercisesMenu();\n }", "function test_all () {\n\n\t\t$this->layout = 'test';\n\n\t\t$tests_folder = new Folder('../tests');\n\n\t\t$results = array();\n\t\t$total_errors = 0;\n\t\tforeach ($tests_folder->findRecursive('.*\\.php') as $test) {\n\t\t\tif (preg_match('/^(.+)\\.php/i', basename($test), $r)) {\n\t\t\t\trequire_once($test);\n\t\t\t\t$test_name = Inflector::Camelize($r[1]);\n\t\t\t\tif (preg_match('/^(.+)Test$/i', $test_name, $r)) {\n\t\t\t\t\t$module_name = $r[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$module_name = $test_name;\n\t\t\t\t}\n\t\t\t\t$suite = new TestSuite($test_name);\n\t\t\t\t$result = TestRunner::run($suite);\n\n\t\t\t\t$total_errors += $result['errors'];\n\n\t\t\t\t$results[] = array(\n\t\t\t\t\t'name'=>$module_name,\n\t\t\t\t\t'result'=>$result,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->set('success', !$total_errors);\n\t\t$this->set('results', $results);\n\t}", "public function testListServer()\n {\n }" ]
[ "0.68568736", "0.66832024", "0.66007644", "0.65801185", "0.64103985", "0.6407482", "0.638836", "0.6362429", "0.6359445", "0.63123435", "0.6307033", "0.6217772", "0.61934084", "0.6183226", "0.6171969", "0.61591905", "0.61553687", "0.61552304", "0.6153641", "0.6147386", "0.6132729", "0.6124384", "0.612207", "0.61194843", "0.6115621", "0.6110016", "0.6108674", "0.61053497", "0.6104634", "0.6103048", "0.60987395", "0.6070581", "0.606867", "0.60256004", "0.6024196", "0.6011511", "0.6002442", "0.5994654", "0.59936833", "0.59688365", "0.5956264", "0.5942542", "0.59361804", "0.5932327", "0.5930851", "0.5918663", "0.59040135", "0.5902574", "0.5898706", "0.58950007", "0.5888186", "0.5882672", "0.5869083", "0.5868679", "0.5863485", "0.58598584", "0.58594036", "0.5858321", "0.5856742", "0.58485883", "0.5846269", "0.58296275", "0.5826827", "0.58208305", "0.58043766", "0.5795204", "0.5793092", "0.57850885", "0.57820857", "0.5761185", "0.5749364", "0.5743119", "0.5739674", "0.5735136", "0.571555", "0.57092553", "0.5703536", "0.5693727", "0.5692995", "0.5690038", "0.56879413", "0.5680681", "0.56775403", "0.5671382", "0.56677336", "0.5667314", "0.5663368", "0.565431", "0.565288", "0.5647248", "0.5642645", "0.5638321", "0.5638024", "0.56319374", "0.5630131", "0.56224096", "0.5619952", "0.5616849", "0.5599903", "0.55949455" ]
0.7766579
0
Testing the experiment retreival by ID
public function testGetExperimentByID() { echo "\nTesting the experiment retrieval by ID..."; $response = $this->getExperiment("1"); $result = json_decode($response); $exp = $result->Experiment; $this->assertTrue((!is_null($exp))); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getExperiment($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/experiments/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function experiments_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n $result = null;\n if(is_null($search))\n $result = $sutil->getExperiment($id,$from,$size);\n else \n {\n $result = $sutil->searchExperiments($search,$from,$size);\n }\n $this->response($result);\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function get_experiment( $experiment_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function testUpdateExperiment()\n {\n echo \"\\nTesting experiment update...\";\n $id = \"0\";\n \n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('exp_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id.\"?owner=wawong\";\n \n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function test_getById() {\n\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "function get_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getExperiment($expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n\n}", "public function test_byinstanceid_route() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n $this->assertContains('<h2>Talkpoint activity name</h2>', $client->getResponse()->getContent());\n }", "private function getCurrentExperiment() {\n\t\tif(isset($_SESSION) && isset($_SESSION['experiment'])) {\n\t\t\t$iExperimentId = (int) $_SESSION['experiment'];\n\t\t} else {\n\t\t\techo $this->_translator->error_experiment;\n\t\t\texit();\n\t\t}\n\t\treturn $iExperimentId;\n\t}", "public function testGetSingleHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for id=3\r\n\t\t$response= $this->http->request('GET','api/v1/hospital/3');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Test single element\r\n\t\t$jsonPHP=json_decode($response->getBody());\r\n\t\t$this->assertCount(1, $jsonPHP);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function imodAction ()\r\n {\r\n $request = $this->getRequest();\r\n $params = array_diff($request->getParams(), $request->getUserParams());\r\n \r\n $sessional = new Acad_Model_Test_Sessional($params);\r\n $sessional->setTest_info_id($params['id']);\r\n $result = $sessional->save();\r\n if ($result) {\r\n echo 'Successfully saved!! Test Id :'.var_export($result, true);\r\n }\r\n }", "public function experiments_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteExperiment($id);\n $this->response($result); \n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testElementMatchingWithID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function testGetDocumentByID()\n {\n echo \"\\nTesting the document retrieval by ID...\";\n $response = $this->getDocument(\"CCDB_2\");\n //echo $response;\n $result = json_decode($response);\n $exp = $result->CIL_CCDB;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\t\n\t\t$this->stubedGene->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGene->getId () );\n\t}", "public function actionGetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n // Get to da responsa!\n $this->sendSuccessResponse($exercise->getExerciseTests()->getValues());\n }", "public function getExperimentID() {\n return $this->_experiment_id;\n }", "public function renderTestDetails($id=null,$testKey=''){\n try{\n $breTest=$this->breTestsFacade->findBreTest($id);\n }catch (\\Exception $e){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($testKey);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n }\n if ($breTest->user->userId!=$this->user->getId()){\n throw new ForbiddenRequestException($this->translator->translate('You are not authorized to access selected experiment!'));\n }\n\n $this->template->breTest=$breTest;\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getById($id) {\r\n return $this->testcaseEntity->find($id);\r\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function testGetSitesTestsByID()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->testsController->shouldReceive('retrieve')->once()->andReturn('Get Test 2 or site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTests(array(1, 'tests', 2));\n $this->assertEquals('Get Test 2 or site 1 Mocked', $output);\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function testGetReplenishmentById()\n {\n }", "public function testQuestionEditExistingID() {\n $response = $this->get('question/' . $this->question->id . '/edit');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public static function getAcceptanceTest($id){\n $db = DemoDB::getConnection();\n ProjectModel::createViewCurrentIteration($db);\n $sql= \"select description,is_satisfied\n from feature\n INNER Join acceptance_test on feature.id = acceptance_test.feature_id\n INNER join acceptance_test_status on acceptance_test.id = acceptance_test_status.acceptance_test_id\n where feature.id=:id;\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "protected function _test_byinstanceid_route($id) {\n $client = new Client($this->_app);\n $client->request('GET', '/' . $id);\n $this->assertTrue($client->getResponse()->isOk());\n $this->assertRegExp('/<h2>Community wall [1-3]{1}<\\/h2>/', $client->getResponse()->getContent());\n $this->assertContains('Header goes here', $client->getResponse()->getContent());\n $this->assertContains('Footer goes here', $client->getResponse()->getContent());\n }", "function launch_experiment($expId)\n{\n global $airavataclient;\n global $tokenFilePath;\n global $tokenFile;\n\n try\n {\n /* temporarily using hard-coded token\n open_tokens_file($tokenFilePath);\n\n $communityToken = $tokenFile->tokenId;\n\n\n $token = isset($_SESSION['tokenId'])? $_SESSION['tokenId'] : $communityToken;\n\n $airavataclient->launchExperiment($expId, $token);\n\n $tokenString = isset($_SESSION['tokenId'])? 'personal' : 'community';\n\n print_success_message('Experiment launched using ' . $tokenString . ' allocation!');\n */\n\n $hardCodedToken = '2c308fa9-99f8-4baa-92e4-d062e311483c';\n $airavataclient->launchExperiment($expId, $hardCodedToken);\n\n //print_success_message('Experiment launched!');\n print_success_message(\"<p>Experiment launched!</p>\" .\n '<p>You will be redirected to the summary page shortly, or you can\n <a href=\"experiment_summary.php?expId=' . $expId . '\">go directly</a> to the experiment summary page.</p>');\n redirect('experiment_summary.php?expId=' . $expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n}", "public function actionTest($id=0) {\n //(new Start)->test(); \n //echo \"End \" . $this->udate('Y-m-d H:i:s.u T'); \n //$vr=[];\n \n if ($id>0){\n echo \"bolshe\";\n } else {\n echo \"net\";\n }\n }", "public function show($id)\n\n {\n\n \n $user = auth()->guard('client')->user();\n $testReview =$user->testReviews()->find($id);\n \n\n\n if (is_null($testReview)) {\n return $this->sendError('Test not found or you dont have access to this test');\n }\n\n\n return $this->sendResponse($testReview->toArray(), 'Test retrieved successfully.');\n\n }", "public function test3($id)\n {\n $tecmarcaextintor = \\App\\TecExtintor::find($id)->tecmarcaextintor;\n return response()->json(['result' => $tecmarcaextintor]);\n }", "public function testListExperiments()\n {\n echo \"\\nTesting experiment listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testGetSelf($id)\n {\n if ($id) {\n $product = static::$shopify->{$this->resourceName}($id)->get();\n\n $this->assertTrue(is_array($product));\n $this->assertNotEmpty($product);\n $this->assertEquals($id, $product['id']);\n }\n }", "public function show($id)\n\t{\n $result = Test::find($id);\n\n if ($result) {\n return $result->toArray();\n } else {\n return 'Resource not found, check id.';\n }\n\t}", "public function testValidGetById() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations (just checking enough to make sure the right thing was obtained)\n\t\t$this->assertSame($retrievedOrg->data->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data->orgName, $this->VALID_NAME);\n\n\t}", "function execute_test($run_id, $case_id, $test_id)\n{\n\t// triggering an external command line tool or API. This function\n\t// is expected to return a valid TestRail status ID. We just\n\t// generate a random status ID as a placeholder.\n\t\n\t\n\t$statuses = array(1, 2, 3, 4, 5);\n\t$status_id = $statuses[rand(0, count($statuses) - 1)];\n\tif ($status_id == 3) // Untested?\n\t{\n\t\treturn null;\t\n\t}\n\telse \n\t{\n\t\treturn $status_id;\n\t}\n}", "public function experiments_put($id=\"0\")\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n \n if(strcmp($id,\"0\")==0)\n {\n $array = array();\n $array['Error'] = 'Empty ID!';\n $this->response($array);\n }\n \n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n \n if(is_null($params))\n {\n $array = array();\n $array['Error'] = 'Empty document!';\n $this->response($array);\n }\n \n $jutil->setExpStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n \n $result = $sutil->updateExperiment($id,$doc);\n $this->response($result);\n }", "public function get_experiments( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function get( $id ){}", "function TestRun_get($run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.get', array(new xmlrpcval($run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function TestCase_get($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function experiment($experiment_id)\n\t{\n\t\t$experiment = $this->experimentModel->get_experiment_by_id($experiment_id);\n\n\t\tif (empty($experiment)) return;\n\n\t\tcreate_caller_table();\n\t\t$data['ajax_source'] = 'caller/table_by_experiment/' . $experiment_id;\n\t\t$data['page_title'] = sprintf(lang('callers_for_exp'), $experiment->name);\n\t\t$data['page_info'] = sprintf(lang('add_callers_exp'), $experiment->id);\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->authenticate->authenticate_redirect('templates/list_view', $data, UserRole::ADMIN);\n\t\t$this->load->view('templates/footer');\n\t}", "public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function actionTest($id){\n \n $model = $this->findModel($id);\n return $this->render('_auto', ['model' => $model]);\n \n \n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function getById($id) {\r\n return $this->testsetEntity->find($id);\r\n }", "public function getContest($contestid);", "public function testGetID() {\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getID (), 'control ID was incorrectly identified' );\r\n\t}", "public function testRequestItemId3()\n {\n $response = $this->get('/api/items/3');\n\n $response->assertStatus(200);\n }", "public function run($id) {\n return $this->getNikePlusFile('http://nikeplus.nike.com/plus/running/ajax/'.$id);\n }", "function GetTestId()\n {\n if (isset($_SESSION[GetTestIdIdentifier()]))\n {\n return $_SESSION[GetTestIdIdentifier()];\n }\n \n return FALSE;\n }", "function TestCaseRun_get($case_run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.get', array(new xmlrpcval($case_run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function get(string $id);", "public function rethinktestInterfacerSend()\n {\n App\\Api\\Facades\\Interfacer::send('13');\n\n $dump1 = ExternalDump::find(1);\n\n $this->assertEquals($dump1->result_returned, 1);\n\n $extD = new ExternalDump();\n $externalLabRequestTree = $extD->getLabRequestAndMeasures($dump1->lab_no);\n\n foreach ($externalLabRequestTree as $key => $externalLabRequest) {\n $this->assertEquals(1, $externalLabRequest->result_returned);\n }\n }", "public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }", "public function show($id)\n {\n $test = Test::where('test_id','=',$id)->first();\n return $test;\n }", "public function renderTest($id=''){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($id);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n\n $this->template->breTest=$breTest;\n }", "public function testGetVesselById()\n {\n $client = new Client(['base_uri' => 'http://localhost:8000/api/']);\n $token = $this->getAuthenticationToken();\n $headers = [\n 'Authorization' => 'Bearer ' . $token,\n 'Accept' => 'application/json',\n ];\n\n $response = $client->request('GET', 'vessel_statuses/3', [\n 'headers' => $headers\n ]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(['application/json; charset=utf-8'], $response->getHeader('Content-Type'));\n $data = json_decode($response->getBody(), true);\n $this->assertEquals('Restricted Manoeuvrability', $data['name']);\n\n }", "public function test_get_all_by_instanceid_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $talkpoints = $this->_cut->get_all_by_instanceid($module->id);\n $this->assertEquals(array(), $talkpoints);\n }", "public function testGetPostById()\n {\n $post = factory(Post::class)->create();\n \n $this->call('Get', '/post/' . $post->id);\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }", "public function testDemoteAutomatchUrlUsingGET()\n {\n }", "public function getEpisodeById($id) \n { \n return $this->get('/episodes/'.$id);\n }", "function StoreTestId($testID)\n {\n StartSession();\n \n $_SESSION[GetTestIdIdentifier()] = $testID;\n }", "function get($id)\n {\n return $this->specs->get($id);\n }", "public function testGetPetById()\n {\n // initialize the API client without host\n $pet_id = 10005; // ID of pet that needs to be fetched\n $pet_api = new Api\\PetApi();\n $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');\n // return Pet (model)\n $response = $pet_api->getPetById($pet_id);\n $this->assertSame($response->getId(), $pet_id);\n $this->assertSame($response->getName(), 'PHP Unit Test');\n $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com');\n $this->assertSame($response->getCategory()->getId(), $pet_id);\n $this->assertSame($response->getCategory()->getName(), 'test php category');\n $this->assertSame($response->getTags()[0]->getId(), $pet_id);\n $this->assertSame($response->getTags()[0]->getName(), 'test php tag');\n }", "public function test_getByExample() {\n\n }", "public function getSiteById(ApiTester $I)\n {\n $I->sendGet(URL_API . '/sites/' . PARAMS_SITE);\n $I->seeResponseCodeIs(200);\n $I->seeResponseIsJson();\n }", "public function show($id)\n\t{\n\t\t$step = \\App\\TestStep::find($id);\n\t\t$execution = \\App\\Execution::where('ts_id', $id)->first(); \t\n\n\t\treturn view('show.step', ['step' => $step, 'execution' => $execution]);\n\t}", "public function testGetIDValue()\n {\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://p1> <http://www.w3.org/2000/01/rdf-schema#range> <http://foobar> .\n }');\n\n $res = $this->fixture->getIDValue(1);\n\n $this->assertEquals('http://example.com/', $res);\n }", "public function get_experiment_results( $experiment_id, $options = array() ) {\n\t\t// @TODO: support options\n\t\t// @TODO: check for 503 in case this endpoint is overloaded (from docs)\n\t\t$extra = '';\n\t\tif ( $options ) {\n\t\t\t$extra = '?' . http_build_query( $options );\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/results' . $extra,\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "function getTestValueById($id) {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_table);\n\t\t$this->db->where('test_id', $id);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function testReGetResource() { \n \t$uuid = $this->temp_uuid;\n\n $data = $this->ceenRU->CEERNResourceCall('/resource'.'/'.$uuid.'.php', 'GET', NULL, FALSE, 'resource_resource.retrieve');\n $this->assertTrue(isset($data['title']));\n }", "function update_experiment($expId, $updatedExperiment)\n{\n global $airavataclient;\n\n try\n {\n $airavataclient->updateExperiment($expId, $updatedExperiment);\n\n print_success_message(\"<p>Experiment updated!</p>\" .\n '<p>Click\n <a href=\"experiment_summary.php?expId=' . $expId . '\">here</a> to visit the experiment summary page.</p>');\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n\n}", "public function testGetInstitutionsUsingGET()\n {\n }", "function test_getId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $result = $test_task->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n\n }", "public function testRetrieveMultipleRequests()\n {\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n App\\Api\\Facades\\Interfacer::retrieve($this->labRequestUrinalysis[$i]);\n }\n\n $labR = $this->labRequestJsonSimpleTest;\n\n if (strpos($labR,'=') !== false && strpos($labR,'labRequest') !== false) {\n $labR = str_replace(['labRequest', '='], ['', ''], $labR);\n $labR = json_decode($labR);\n }\n\n App\\Api\\Facades\\Interfacer::retrieve($labR); //bs for mps\n\n // Check that all the 'urinalysis' data was stored\n // Was the data stored in the external dump?\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n $externalDump[] = ExternalDump::where('lab_no', '=', $this->labRequestUrinalysis[$i]->labNo)->get();\n $this->assertTrue(count($externalDump{$i}) > 0);\n }\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDump[0]->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n\n // Check that the 'bs for mps' data was stored\n // Was the data stored in the external dump?\n $externalDumpBS = ExternalDump::where('lab_no', '=', $labR->labNo)->get();\n $this->assertTrue(count($externalDump) > 0);\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDumpBS->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n }", "public function getAction(int $id)\n {\n // TODO: Implement getAction() method.\n\n $this->getVerifyProvider()->entry();\n\n }", "function babeliumsubmission_get_exercise_data($exerciseid,$responseid=0){\n Logging::logBabelium(\"Getting exercise data\");\n $g = $this->getBabeliumRemoteService();\n $data = null;\n if($responseid){\n $data = $g->getResponseInformation($responseid);\n if(!$data){\n return null;\n }\n $subtitleId = isset($data['subtitleId']) ? $data['subtitleId'] : 0;\n $mediaId= isset($data['mediaId']) ? $data['mediaId']: 0;\n } else {\n $data = $g->getExerciseInformation($exerciseid);\n if(!$data){\n return null;\n }\n $media = $data['media'];\n $subtitleId = isset($media['subtitleId']) ? $media['subtitleId'] : 0;\n $mediaId= isset($media['id']) ? $media['id']: 0;\n }\n $captions = $g->getCaptions($subtitleId,$mediaId);\n if(!$captions){\n return null;\n }\n\n $exerciseRoles = $this->getExerciseRoles($captions);\n\n //WTF??\n //$recinfo = $g->newServiceCall('requestRecordingSlot');\n $recinfo = null;\n $returnData = $this->getResponseInfo($data, $captions, $exerciseRoles, $recinfo);\n return $returnData;\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function testGetSitesReportById()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->reportsController->shouldReceive('retrieveBySiteIdAndTestName')->once()->andReturn('Report 3 for Test 2 and Site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTestsReports(array(1, 'tests', '2', 'reports', '3'));\n $this->assertEquals('Report 3 for Test 2 and Site 1 Mocked', $output);\n }", "public function actionSetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n $req = $this->getRequest();\n $tests = $req->getPost(\"tests\");\n\n /*\n * We need to implement CoW on tests.\n * All modified tests has to be newly created (with new IDs) and these\n * new IDs has to be propagated into configuration and limits.\n * Therefore a replacement mapping of updated tests is kept.\n */\n\n $newTests = [];\n $namesToOldIds = []; // new test name => old test ID\n $testsModified = false;\n\n foreach ($tests as $test) {\n // Perform checks on the test name...\n if (!array_key_exists(\"name\", $test)) {\n throw new InvalidArgumentException(\"tests\", \"name item not found in particular test\");\n }\n\n $name = trim($test[\"name\"]);\n if (!preg_match('/^[-a-zA-Z0-9_()\\[\\].! ]+$/', $name)) {\n throw new InvalidArgumentException(\"tests\", \"test name contains illicit characters\");\n }\n if (strlen($name) > 64) {\n throw new InvalidArgumentException(\"tests\", \"test name too long (exceeds 64 characters)\");\n }\n if (array_key_exists($name, $newTests)) {\n throw new InvalidArgumentException(\"tests\", \"two tests with the same name '$name' were specified\");\n }\n\n $id = Arrays::get($test, \"id\", null);\n $description = trim(Arrays::get($test, \"description\", \"\"));\n\n // Prepare a test entity that is to be inserted into the new list of tests...\n $testEntity = $id ? $exercise->getExerciseTestById($id) : null;\n if ($testEntity === null) {\n // new exercise test was requested to be created\n $testsModified = true;\n\n if ($exercise->getExerciseTestByName($name)) {\n throw new InvalidArgumentException(\"tests\", \"given test name '$name' is already taken\");\n }\n\n $testEntity = new ExerciseTest($name, $description, $this->getCurrentUser());\n $this->exerciseTests->persist($testEntity);\n } elseif ($testEntity->getName() !== $name || $testEntity->getDescription() !== $description) {\n // an update is needed => a copy is made and old ID mapping is kept\n $testsModified = true;\n $namesToOldIds[$name] = $id;\n $testEntity = new ExerciseTest($name, $description, $testEntity->getAuthor());\n $this->exerciseTests->persist($testEntity);\n }\n // otherwise, the $testEntity is unchanged\n\n $newTests[$name] = $testEntity;\n }\n\n if (!$testsModified && count($exercise->getExerciseTestsIds()) === count($newTests)) {\n // nothing has changed\n $this->sendSuccessResponse(array_values($newTests));\n return;\n }\n\n $testCountLimit = $this->exerciseRestrictionsConfig->getTestCountLimit();\n if (count($newTests) > $testCountLimit) {\n throw new InvalidArgumentException(\n \"tests\",\n \"The number of tests exceeds the configured limit ($testCountLimit)\"\n );\n }\n\n // first, we create the new tests as independent entities, to get their IDs\n $this->exerciseTests->flush(); // actually creates the entities\n $idMapping = []; // old ID => new ID\n foreach ($newTests as $test) {\n $this->exerciseTests->refresh($test);\n if (array_key_exists($test->getName(), $namesToOldIds)) {\n $oldId = $namesToOldIds[$test->getName()];\n $idMapping[$oldId] = $test->getId();\n }\n }\n\n // clear old tests and set new ones\n $exercise->getExerciseTests()->clear();\n $exercise->setExerciseTests(new ArrayCollection($newTests));\n $exercise->updatedNow();\n\n // update exercise configuration and test in here\n $this->exerciseConfigUpdater->testsUpdated($exercise, $this->getCurrentUser(), $idMapping, false);\n $this->configChecker->check($exercise);\n\n $this->exercises->flush();\n $this->sendSuccessResponse(array_values($newTests));\n }", "public function show($id){\n return \\App\\Models\\Puzzel::where(\"id\", \"=\", $id)->get()->first();\n }", "public function testElementMatchingWithTagAndID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'tag' => 'h1',\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }", "function test_get_by_id()\n {\n $dm = new mdl_direct_message();\n $result = $dm->get_by_id(1, 1);\n\n $this->assertEquals(count($result), 1);\n }", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "public function get( $id );", "abstract public function retrieve($id);", "public function testRequestItemEditId3()\n {\n $response = $this->get('/api/items/3/edit');\n\n $response->assertStatus(200);\n }", "public function testMediaFileIdGet()\n {\n $client = static::createClient();\n\n $path = '/media/file/{id}';\n $pattern = '{id}';\n $data = $this->genTestData('\\d+');\n $path = str_replace($pattern, $data, $path);\n\n $crawler = $client->request('GET', $path);\n }", "public function edit($id)\n {\n return $this->exerciseResultsService->findWith($id, ['exercise', 'user', 'attachments']);\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}" ]
[ "0.70720243", "0.66221786", "0.6372758", "0.6348471", "0.6327254", "0.6164168", "0.61540025", "0.6119591", "0.6040424", "0.59662414", "0.59080625", "0.58955175", "0.58827364", "0.5867978", "0.5862803", "0.5862368", "0.5860236", "0.5822475", "0.5786058", "0.57855254", "0.5783987", "0.5779225", "0.57521576", "0.57371855", "0.5727865", "0.5717", "0.5700085", "0.56925637", "0.5679692", "0.5673236", "0.56705755", "0.56593525", "0.5651872", "0.5637597", "0.56355715", "0.56341237", "0.563027", "0.56240165", "0.56204396", "0.5611084", "0.5595774", "0.559391", "0.55780834", "0.55722046", "0.55633605", "0.555339", "0.5549499", "0.5534357", "0.5533448", "0.5525256", "0.55067486", "0.5499233", "0.54837173", "0.5479338", "0.54789805", "0.54694563", "0.54675376", "0.5463197", "0.5456817", "0.5445041", "0.54255223", "0.5420578", "0.5419946", "0.54187995", "0.54154646", "0.54060274", "0.5399564", "0.53889424", "0.5381727", "0.53803664", "0.53764594", "0.5375551", "0.5374207", "0.5358641", "0.53548765", "0.5354743", "0.5338948", "0.53204644", "0.5320142", "0.5316047", "0.5314381", "0.5306207", "0.5303384", "0.5302666", "0.5297816", "0.52931696", "0.5290679", "0.5288377", "0.52860343", "0.52837175", "0.52803993", "0.52780706", "0.5273266", "0.52676564", "0.526169", "0.52557725", "0.52551734", "0.5254453", "0.52482885", "0.5244543" ]
0.8079397
0
Testing the project search
public function testSearchExperiment() { echo "\nTesting experiment search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments?search=test"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/experiments?search=test"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_searchByPage() {\n\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testSearch()\n {\n $crawler = $this->client->request('GET', $this->router->generate('marquejogo_homepage'));\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Cidade\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Data\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Hora\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => '',\n 'marcoshoya_marquejogobundle_search[date]' => '1111',\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n // invalid date\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"This value is not valid.\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => 'Curitiba, Paraná',\n 'marcoshoya_marquejogobundle_search[date]' => date('d-m-Y'),\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Resultados encontrados\")')->count());\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "public function testGetVoicemailSearch()\n {\n }", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testInboundDocumentSearch()\n {\n }", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testSearchModelSets()\n {\n }", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testGetSearchResults()\n {\n $search_term = $this->getSearchTerm();\n $limit = $this->getLimit();\n\n $client = $this->mockGuzzleForResults();\n $repository = new GoogleSearchRepositoryApi($client);\n\n $results = $repository->getSearchResults($search_term, $limit);\n\n $this->assertIsArray($results);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function testFindPageReturnsDataForSuccessfulSearch()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', 'name=works');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "protected function tweakTaskSearch() {\n\t\tparent::tweakTaskSearch();\n\t\tparent::setProjectsInTaskSearchForManager(TRUE);\n\t}", "public function testQuarantineFind()\n {\n\n }", "public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}", "public function testSearchParams() {\n $this->get('/api/VideoTags/search.json?tag_name=frontside');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?rider_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick-slug=frontside-360');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=invalidorder');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=begin_time');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=created');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=modified');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=best');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_slug=myslug');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick_slug=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_ids=1,2,3');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?status=pending,invalidstatus');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard&category_name=jib');\n $this->assertResponseOk();\n }", "public function test_city_search()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($god = $this->createGod())\n ->visit('/dashboard/cities')\n ->type('search_country', $this->setLocalizationByName('country'))\n ->waitForText($this->setLocalizationByName('country'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('country'));\n });\n\n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_state', $this->setLocalizationByName('state'))\n ->waitForText($this->setLocalizationByName('state'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('state'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_city', $this->setLocalizationByName('city'))\n ->waitForText($this->setLocalizationByName('city'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('city'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_region', $this->setLocalizationByName('region'))\n ->waitForText($this->setLocalizationByName('region'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('region'));\n });\n });\n }", "public function search(){}", "public function search();", "public function search();", "public function testSearchBy(): void\n {\n// $model::query();\n }", "public function testSearchModuleSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Create data stored by first user\n $this -> call('POST','api/classes',[\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"],\n 'key' => $this -> classSetting[\"key\"]\n ]);\n\n // Get module id\n $module = Module::where('code',$this -> classSetting[\"code\"])->first();\n $module_id = $module -> module_id;\n\n // Search module by code\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module by name\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"name\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module doesn't exist\n $this -> call('GET','api/classes/search',['string' => 'Module does not exist']);\n $this -> seeJsonEquals([]);\n }", "public function testPostVoicemailSearch()\n {\n }", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testFindFiles()\n {\n\n }", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function postProjectSearch(Request $request){\n\n $keyword=$request['keyWords'];\n $filter=$request['filter'];\n $projects=Project::all();\n $resultProjects=new Collection();\n foreach($projects as $project){\n\n if( (strpos($filter, 'id') !== false) and Str::equals(Str::lower($project->id),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n foreach($projects as $project){\n if($resultProjects->contains($project)){\n continue;\n }\n if((strpos($filter, 'client') !== false) and Str::contains(Str::lower($project->client_name),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n if((strpos($filter, 'title') !== false) and Str::contains(Str::lower($project->title),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n else if((strpos($filter, 'date') !== false) and Str::contains(Str::lower($project->date),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n return View::make('/project_management/search_results')->with('resultProjects',$resultProjects);\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "function testFindCompilations() {\n\t\t$result = $this->Album->find('compilation', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals($result[0]['Album']['title'], 'Micro_Superstarz_2000');\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "function testSearchByCustomField() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS&q[per_900][value]=200');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Green<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards'));\n\t}", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "function testSearchClasses() {\n $this->search->findClasses($this->test_class_dir . '/class.TestClass.php');\n\n // Create the array output that the class search should have generated.\n $comparison = array(\n $this->test_class_dir . '/class.TestClass.php' => array(\n 'TestClass'\n )\n );\n\n // Assert that they are equal.\n $this->assertEqual($this->search->getClassList(), $comparison,\n 'Single class search does not match expected result.');\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function testSearch()\n {\n $manager = new Manager($this->minimal, $this->driver);\n\n // Exception handling\n $this->assertBindingFirst($manager, 'search');\n $manager->connect();\n $this->assertBindingFirst($manager, 'search');\n $manager->bind();\n\n $this->driver->getConnection()->setFailure(Connection::ERR_MALFORMED_FILTER);\n try {\n $res = $manager->search();\n $this->fail('Filter malformed, query shall fail');\n } catch (MalformedFilterException $e) {\n $this->assertRegExp('/Malformed filter/', $e->getMessage());\n }\n\n // Basic search\n $set = array(new Entry('a'), new Entry('b'), new Entry('c'));\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'dc=example,dc=com',\n '(objectclass=*)',\n SearchInterface::SCOPE_ALL,\n null,\n $set\n );\n\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n\n $data = array();\n foreach ($result as $key => $value) {\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\Node', $value);\n $data[$key] = $value->getAttributes();\n }\n\n $this->assertArrayHasKey('a', $data);\n $this->assertArrayHasKey('b', $data);\n $this->assertArrayHasKey('c', $data);\n $this->assertEquals(\n 3,\n count($data),\n 'The right search result got retrieved'\n );\n\n // Empty result set search\n $this->driver->getConnection()->setFailure(Connection::ERR_NO_RESULT);\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n $this->assertInstanceOf(\n 'Toyota\\Component\\Ldap\\Core\\SearchResult',\n $result,\n 'Query did not fail - Exception got handled'\n );\n\n $data = array();\n foreach ($result as $key => $value) {\n $data[$key] = $value->getAttributes();\n }\n $this->assertEquals(\n 0,\n count($data),\n 'The exception got handled and the search result set has not been set in the query'\n );\n\n // Alternative parameters search\n $result = $manager->search(\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n false,\n array('attr1', 'attr2')\n );\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n SearchInterface::SCOPE_ONE,\n array('attr1', 'attr2'),\n $set\n );\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n }", "public function test_admin_search_keyword_b()\n {\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_search()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search('/(index.php|.htaccess)/');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n $this->assertArrayHasKey(ROOT.DS.'.htaccess', $res);\n }", "function quick_search() {\n if(!$this->request->isAsyncCall()) {\n $this->redirectTo('search');\n } // if\n\n //BOF:mod 20110629 search\n if (trim($this->request->post('search_for'))!=''){\n\t\t//$_SESSION['search_string'] = trim($this->request->post('search_for'));\n\t }\n //$this->smarty->assign('search_string', $_SESSION['search_string']);\n //EOF:mod 20110629 search\n\n /*$object_types = array();\n $object_types[] = array('id' => '', 'text' => '');\n $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n mysql_select_db(DB_NAME, $link);\n $query = \"select distinct type from healingcrystals_project_objects order by type\";\n $result = mysql_query($query);\n while($type = mysql_fetch_assoc($result)){\n \t$object_types[] = array('id' => $type['type'], 'text' => $type['type']);\n }\n mysql_close($link);*/\n\t $search_projects = array();\n\t $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n\t mysql_select_db(DB_NAME, $link);\n\t $query = \"select distinct a.project_id from healingcrystals_project_users a inner join healingcrystals_projects b on a.project_id=b.id where a.user_id='\" . $this->logged_user->getId() . \"' order by b.name\";\n\t $result = mysql_query($query);\n\t while($entry = mysql_fetch_assoc($result)){\n\t\t\t$search_projects[] = new Project($entry['project_id']);\n\t\t }\n\t mysql_close($link);\n $object_types = $this->get_object_types();\n if($this->request->isSubmitted()) {\n $search_for = trim($this->request->post('search_for'));\n $search_type = $this->request->post('search_type');\n $search_object_type = $this->request->post('search_object_type');\n $search_project_id = $this->request->post('search_project_id');\n\n if($search_for == '') {\n die(lang('Nothing to search for'));\n } // if\n\n $this->smarty->assign(array(\n 'search_for' => $search_for,\n 'search_type' => $search_type,\n 'search_object_type' => $search_object_type,\n 'object_types' => $object_types,\n 'search_project_id' => $search_project_id,\n 'search_projects' => $search_projects\n ));\n $per_page = 5;\n\n // Search inside the project\n if($search_type == 'in_projects') {\n\t\t //BOF:mod 20120822\n\t\t if ($search_object_type=='Attachment'){\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_attachments($search_for, $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t } else {\n\t\t //EOF:mod 20120822\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_index_search($search_for, 'ProjectObject', $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t //BOF:mod 20120822\n\t\t }\n\t\t //EOF:mod 20120822\n\t\t \n // Search for people\n } elseif($search_type == 'for_people') {\n $template = get_template_path('_quick_search_users', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'User', $this->logged_user, 1, $per_page);\n\n // Search for projects\n } elseif($search_type == 'for_projects') {\n $template = get_template_path('_quick_search_projects', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'Project', $this->logged_user, 1, $per_page);\n\n // Unknown type\n } else {\n die(lang('Unknown search type: :type', array('type' => $search_type)));\n } // if\n\n $this->smarty->assign(array(\n 'results' => $results,\n 'pagination' => $pagination,\n ));\n\n $this->smarty->display($template);\n die();\n } else {\n \t$this->smarty->assign('object_types', $object_types);\n \t$this->smarty->assign('search_projects', $search_projects);\n }\n }", "public function testFilter()\n {\n // so here we just verify that the params are passed correctly internally\n $project_repository = $this->getMockBuilder(ProjectRepository::class)\n ->disableOriginalConstructor()\n ->setMethods(['scopeByDate', 'scopeWithTags', 'scopeWithoutTags',\n 'scopeByField', 'search'])->getMock();\n\n // with tags\n $project_repository->expects($this->once())->method('scopeWithTags')\n ->with($this->equalTo('badabing'));\n $project_repository->filter(['withTags' => 'badabing']);\n\n // without tags\n $project_repository->expects($this->once())->method('scopeWithoutTags')\n ->with($this->equalTo('badabeng'));\n $project_repository->filter(['withoutTags' => 'badabeng']);\n\n // with date\n $project_repository->expects($this->once())->method('scopeByDate')\n ->with($this->equalTo('27.01.2018'));\n $project_repository->filter(['date' => '27.01.2018']);\n\n // with search\n $project_repository->expects($this->once())->method('search')\n ->with($this->equalTo('jahade'));\n $project_repository->filter(['search' => 'jahade']);\n\n // default\n $project_repository->expects($this->once())->method('scopeByField')\n ->with(\n $this->equalTo('budget_price'),\n $this->equalTo('65000')\n );\n $project_repository->filter(['budget_price' => '65000']);\n }", "public function testSearchParams()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse, 15);\n\n $sw->search();\n $sw->search('testing123');\n $sw->search('', '2017-01-01');\n $sw->search('', '', '2017-01-02');\n $sw->search('', '2017-01-01', '2017-01-02');\n $sw->search('', '', '', 'Kyle');\n $sw->search('', '', '', '', 'Smith');\n $sw->search('', '', '', 'Kyle', 'Smith');\n $sw->search('', '', '', '', '', true);\n $sw->search('', '', '', '', '', false);\n $sw->search('', '', '', '', '', null);\n $sw->search('', '', '', '', '', null, true);\n $sw->search('', '', '', '', '', null, false);\n $sw->search('', '', '', '', '', null, true, 'testing');\n $sw->search('testing123', '', '', '', '', true);\n\n $this->checkGetRequests($container, [\n '/v4/search',\n '/v4/search?templateId=testing123',\n '/v4/search?fromDts=2017-01-01',\n '/v4/search?toDts=2017-01-02',\n '/v4/search?fromDts=2017-01-01&toDts=2017-01-02',\n '/v4/search?firstName=Kyle',\n '/v4/search?lastName=Smith',\n '/v4/search?firstName=Kyle&lastName=Smith',\n '/v4/search?verified=true',\n '/v4/search?verified=false',\n '/v4/search',\n '/v4/search',\n '/v4/search?sort=asc',\n '/v4/search?tag=testing',\n '/v4/search?templateId=testing123&verified=true'\n ]);\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "function get_project_by_search($search,$approved = 0,$loc='') {\n\n\n\n $this->db->select('projects.id as id,project_slug,sub_category.price,category.id as cat_id, sub_category.id as sub_cat_id, projects.location,posted_by,budget,title,details,projects.file_path,projects.file_name,category.name as cat_name, sub_category.name as sub_cat_name,projects.duration');\n $this->db->from('projects');\n $this->db->where('users.deleted', '0');\n if($approved !=0){\n\n $this->db->where('projects.approved', $approved);\n }\n if(($search!='')){\n\n $this->db->like('projects.title', $search);\n }\n if(($loc!='')){\n \n $this->db->like('projects.location', $loc);\n }\n $this->db->join('category', 'category.id = projects.category','left outer');\n $this->db->join('sub_category', 'sub_category.id = projects.sub_category');\n $this->db->join('users', 'users.id = projects.posted_by');\n\n\n $query = $this->db->get();\n\n\n\n if ($query->num_rows() >= 1){ return $query->result_array(); }\n\n\n\n return false;\n\n }", "function search() {}", "public function testSearchMods()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testFindService()\n {\n\n }", "public function test_search_by_name()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search_by_name('index.php');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function testFindTemplates()\n {\n\n }", "public function get_project_all(){\n }", "public function unitTests($unit) {\n\t\techo \"<p>Search Results Tests:</p><ul>\";\n\t\t\n\t\techo \"<li>Known Valid Search\";\n\t\t$searchStr = $this->search(\"motrin\");\n\t\t$searchObj = $this->search(\"motrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', 'String Requested, String Returned');\n\t\techo $unit->run($searchObj,'is_object', 'Object Requested, Object Returned');\n\t\techo $unit->run($searchObj->error,'is_null', 'Error object is null');\n\t\techo $unit->run(count($searchObj->results) > 0, true, \"Result object results array has contents.\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Known Invalid Search\";\n\t\t$searchStr = $this->search(\"wallbutrin\");\n\t\t$searchObj = $this->search(\"wallbutrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj,'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Empty Search\";\n\t\t$searchStr = $this->search(\"\");\n\t\t$searchObj = $this->search(\"\", true);\n\n\t\techo $unit->run($searchStr, 'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj, 'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"</ul>\";\n\n\t\techo \"<p>Cache Results Tests</p><ul>\";\n\t\t$cacheTerm = \"testingTerm\";\n\t\t$cacheDataIn = json_encode(array('test' => true, 'error' => false));\n\n\t\techo \"<li>Cache sanity\";\n\t\t$this->_setCache($cacheTerm, $cacheDataIn);\n\t\t$cacheDataOut = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($cacheDataOut, $cacheDataIn, \"Cache returns the same values it was given\");\n\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Invalidated cache entry does not return a result\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Cache actually used and updated by search\";\n\t\t$cacheTerm = 'motrin';\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Known Search cache invalidated\");\n\t\t$searchResult = $this->search($cacheTerm);\n\n\t\techo $unit->run($searchResult, 'is_string', \"Known Search returns string\");\n\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\t\techo $unit->run($searchResult, $fetchResult, \"Known search and cache entry match\");\n\n\t\t$searchResult2 = $this->search($cacheTerm);\n\t\techo $unit->run($searchResult2, $searchResult, \"Search returns same on cache miss and hit\");\n\n\t\techo \"</li>\";\n\t\techo \"</ul>\";\n\t}", "public function testGetSubprojects() {\n\t\t$t_project_name = $this->getNewProjectName();\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_projects_array = $this->client->mc_project_get_all_subprojects( $this->userName, $this->password, $t_project_id );\n\n\t\t$this->assertCount( 0, $t_projects_array );\n\t}", "public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }", "public function testSearchPermissionSets()\n {\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function testPsWithprojectOption()\n {\n $composeFiles = new ComposeFileCollection(['docker-compose.test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n\n $this->assertEquals($this->mockedManager->ps($composeFiles), 'ok');\n }", "public function testSearchDocument()\n {\n echo \"\\nTesting document search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testIndex()\n {\n $request = $this->mockHttpRequest([]);\n $service = $this->mockGoogleSearchServiceBasic();\n $controller = new SearchResultsController($request, $service);\n\n $result = $controller->index();\n\n $this->assertInstanceOf(Views\\Index::class, $result);\n $this->assertIsArray($result->getData());\n $this->assertEquals($result->getData(), []);\n }", "public function testProjectAssignmentsRead()\n {\n }", "public function testOpenProjectWithUser()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertStatus(200);\n }", "public function testSearchModuleWithoutToken()\n {\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function testFindUsers()\n {\n\n }", "public function testProfileFind()\n {\n\n }", "private function getAllProjects($get) {\n $projectModel = new ProjectsModel();\n $projectModel->join('priorities', 'priorities.id = projects.priority','Left');\n $projectModel->join('users', 'users.id = projects.responsible','Left');\n\n if(isset($get['keywords']) && trim($get['keywords'])) {\n $projectModel->groupStart();\n $projectModel->like('projects.code', $get['keywords']);\n $projectModel->orLike('projects.name', $get['keywords']);\n $projectModel->orLike('priorities.name', $get['keywords']);\n $projectModel->orLike('projects.assign_to', $get['keywords']);\n $projectModel->groupEnd();\n }\n //coulmn search\n if(isset($get['code_id']) && trim($get['code_id']))\n $projectModel->where('projects.code', $get['code_id']);\n if(isset($get['name']) && trim($get['name']))\n $projectModel->where('projects.name', $get['name']);\n/*\n if(isset($get['priority']) && trim($get['priority']))\n $projectModel->where('priorities.name', $get['priority']);*/\n if(isset($get['priority']) and $get['priority'] != ''){\n $projectModel->like('projects.priority',$get['priority']);\n }\n \n if (!empty($get['start_at'])) \n $projectModel->where('DATE_FORMAT(projects.start_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['start_at'])));\n if (!empty($get['end_at'])) \n $projectModel->where('DATE_FORMAT(projects.end_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['end_at'])));\n\n \n $data['totalProject'] = ((new ProjectsModel())->select('count(*) as totalProject')->first())['totalProject'];\n $projectModel->select('projects.id,projects.code,projects.name, priorities.name as priority, CONCAT(users.fname,\" \",users.lname) as responsible,projects.assign_to,projects.start_at,projects.end_at,projects.description, projects.created_at, projects.created_by, projects.updated_at, projects.updated_by, projects.status');\n $projectModel->where('projects.status','1');\n $data['projects'] = $projectModel->orderBy($get['sortby'], $get['sort_order'])->findAll($get['rows'], ($get['pageno']-1)*$get['rows']);\n $data['params'] = $get;\n $prioritiesModel = new PrioritiesModel();\n $query = $prioritiesModel->findAll();\n $data['priorities'] = $query;\n //\n $userModel = new UsersModel();\n $str_query = $userModel->findAll();\n $data['users'] = $str_query;\n // /print_r($data);exit();\n return $data;\n }", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function searchProjects($conditions)\n {\n $em = $this->getDoctrine()->getManager();\n $projects = $em->getRepository('AppBundle:Project')->findAll();\n $normalizer = new ObjectNormalizer(null, new CamelCaseToSnakeCaseNameConverter());\n\n foreach ($projects as $key => $project) {\n $projects[$key] = $normalizer->normalize($project);\n\n }\n return $projects;\n }", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "public function testFindServiceData()\n {\n\n }", "public function testSearchResults()\n {\n $search = new SmartwaiverSearch([\n 'guid' => 'TestingGUID',\n 'count' => 5,\n 'pages' => 1,\n 'pageSize' => 100\n ]);\n\n $numWaivers = 5;\n\n $apiResponse = APISuccessResponses::searchResults($numWaivers);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $waivers = $sw->searchResult($search, 0);\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiver::class, $waiver);\n }\n\n $this->checkGetRequests($container, [\n '/v4/search/' . $search->guid . '/results?page=0'\n ]);\n }", "public function testGetInstitutionsUsingGET()\n {\n }", "function search()\n\t{}", "function search()\n\t{}", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public static function searchNamespace()\n\t{\n\t\treturn 'project';\n\t}", "protected function tweakTaskSearch() {\n\t\tparent::setProjectsInTaskSearchForManager(false);\n\t}", "public function test_search_returns_results_for_pages() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t\tself::factory()->post->create_many(\n\t\t\t3,\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'foo',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'bar',\n\t\t\t)\n\t\t);\n\n\t\t$request = array(\n\t\t\t'type' => 'quick-search-posttype-page',\n\t\t\t'q' => 'foo',\n\t\t\t'response-format' => 'json',\n\t\t);\n\n\t\t$output = get_echo( '_wp_ajax_menu_quick_search', array( $request ) );\n\t\t$this->assertNotEmpty( $output );\n\n\t\t$results = explode( \"\\n\", trim( $output ) );\n\t\t$this->assertCount( 3, $results );\n\t}" ]
[ "0.81959957", "0.6858462", "0.6852012", "0.6753273", "0.66946334", "0.6673342", "0.6618049", "0.6564328", "0.6496258", "0.64323014", "0.6419851", "0.6401977", "0.639658", "0.63620675", "0.63539433", "0.63435453", "0.6327412", "0.6318944", "0.63020056", "0.6277252", "0.6253027", "0.6215104", "0.6202289", "0.6196944", "0.61906946", "0.6185744", "0.6147885", "0.61286", "0.6128118", "0.60922074", "0.60903835", "0.60875905", "0.6068737", "0.6031003", "0.60246485", "0.6022071", "0.6007277", "0.59859926", "0.5983449", "0.59790504", "0.59790504", "0.59767216", "0.5957828", "0.595666", "0.59483546", "0.5947138", "0.5944084", "0.5916591", "0.5912476", "0.5906247", "0.5900608", "0.58914185", "0.58782744", "0.58765733", "0.58707047", "0.58584374", "0.58526886", "0.58274925", "0.5823303", "0.5816746", "0.58142346", "0.58009464", "0.5795413", "0.57911307", "0.5790557", "0.5783839", "0.57747084", "0.5766855", "0.5740437", "0.5733471", "0.5733471", "0.57063615", "0.570623", "0.5706226", "0.57044804", "0.57035536", "0.5698962", "0.5683342", "0.56706727", "0.5668012", "0.56654245", "0.56596917", "0.56550753", "0.56549656", "0.56509703", "0.5643708", "0.5635919", "0.56352556", "0.5632435", "0.56273425", "0.56242764", "0.56099665", "0.5604748", "0.5600299", "0.55967516", "0.55967516", "0.5581596", "0.55748904", "0.55641735", "0.5560172" ]
0.6032634
33
Testing the experiment update.
public function testUpdateExperiment() { echo "\nTesting experiment update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('exp_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/experiments/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/experiments/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function test_accepts_dev_updates()\n {\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function test_updateSettings() {\n\n }", "public function testWebinarUpdate()\n {\n }", "public function testJobUpdate()\n {\n\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function test_if_failed_update()\n {\n }", "public function test_update() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n self::$outage->starttime += 10;\n outagedb::save(self::$outage);\n\n // Should still exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object($event));\n self::assertSame(self::$event->id, $event->id);\n self::$event = $event;\n }", "public function testUpdateTimesheet()\n {\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "function testUpdateFitness() {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }", "public function test_admin_can_update_a_worker()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($admin = $this->createAdmin())\n ->visitRoute($this->route, $this->lastWorker()->id)\n ->type('worker_name', $this->makeWorker()->worker_name)\n ->type('worker_nif', $this->makeWorker()->worker_nif)\n ->type('worker_start', str_replace('/', '', $this->makeWorker()->worker_start))\n ->type('worker_ropo', $this->makeWorker()->worker_ropo)\n ->type('worker_ropo_date', str_replace('/', '', $this->makeWorker()->worker_ropo_date))\n ->select('worker_ropo_level', $this->makeWorker()->worker_ropo_level)\n ->type('worker_observations', $this->makeWorker()->worker_observations)\n ->press(trans('buttons.edit'))\n ->assertSee(__('The items has been updated successfuly'));\n });\n\n $this->assertDatabaseHas('workers', [\n 'worker_name' => $this->makeWorker()->worker_name,\n 'worker_nif' => $this->makeWorker()->worker_nif,\n 'worker_ropo' => $this->makeWorker()->worker_ropo,\n 'worker_ropo_level' => $this->makeWorker()->worker_ropo_level,\n 'worker_observations' => $this->makeWorker()->worker_observations,\n ]);\n }", "public function testUpdate(): void { }", "function updateTest()\n {\n $this->cD->updateElement(new Product(1, \"Trang\"));\n }", "public function test_background_updates()\n {\n }", "public function testUpdated()\n {\n \t$game_factory = factory(Game::class)->create();\n \t$game_factory->game_hash_file = sha1(microtime());\n\n $this->assertTrue($game_factory->save());\n }", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function testSaveUpdate()\n {\n $user = User::findOne(1002);\n $version = Version::findOne(1001);\n\n $this->specify('Error update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'title' => 'Some very long title...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim, lorem in bibendum.',\n 'type' => Version::TYPE_TABLET,\n 'subtype' => 31,\n 'retinaScale' => false,\n 'autoScale' => 'invalid_value',\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n $version->refresh();\n\n verify('Model should not succeed', $result)->null();\n verify('Model should have errors', $model->errors)->notEmpty();\n verify('Title error message should be set', $model->errors)->hasKey('title');\n verify('ProjectId error message should not be set', $model->errors)->hasntKey('projectId');\n verify('Type error message should not be set', $model->errors)->hasntKey('type');\n verify('Subtype error message should be set', $model->errors)->hasKey('subtype');\n verify('AutoScale error message should be set', $model->errors)->hasKey('autoScale');\n verify('RetinaScale error message should not be set', $model->errors)->hasntKey('retinaScale');\n verify('Version title should not change', $version->title)->notEquals($data['title']);\n verify('Version type should not be changed', $version->type)->notEquals($data['type']);\n verify('Version subtype should not be changed', $version->subtype)->notEquals($data['subtype']);\n });\n\n $this->specify('Success update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'projectId' => 1003, // should be ignored\n 'title' => 'My new test version title',\n 'type' => Version::TYPE_MOBILE,\n 'subtype' => 31,\n 'retinaScale' => true,\n 'autoScale' => true,\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n\n verify('Model should succeed and return an instance of Version', $result)->isInstanceOf(Version::className());\n verify('Model should not has any errors', $model->errors)->isEmpty();\n verify('The returned Version should be the same as the updated one', $result->id)->equals($version->id);\n verify('Version projectId should not change', $result->projectId)->notEquals($data['projectId']);\n verify('Version title should match', $result->title)->equals($data['title']);\n verify('Version type should match', $result->type)->equals($data['type']);\n verify('Version subtype should match', $result->subtype)->equals($data['subtype']);\n verify('Version scaleFactor should match', $result->scaleFactor)->equals(Version::AUTO_SCALE_FACTOR);\n });\n }", "public function testItCanRunItemUpdate()\n {\n Artisan::call('item:update');\n\n // If you need result of console output\n $resultAsText = Artisan::output();\n\n $this->assertRegExp(\"/Item #[0-9]* updated\\\\n/\", $resultAsText);\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testServeChanges()\n {\n }", "public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "protected function doEmbeddedUpdateTests()\n {\n $this->objectRepository->setClassName(TestParent::class);\n $parent = $this->objectRepository->find(1);\n $parent->getAddress()->setTown('Somewhereborough');\n $this->objectRepository->saveEntity($parent);\n $refreshedParent = $this->objectRepository->find(1);\n $this->assertEquals('Somewhereborough', $refreshedParent->getAddress()->getTown());\n }", "public function testUpdatedTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n }", "public function test_updating() {\n\t\t$key = rand_str();\n\n\t\t// Setting temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::set_site( $key, 'value1', 5 ) );\n\n\t\t// Direct retrieval of temporary value should return set value.\n\t\t$this->assertEquals( get_site_option( '_site_temporary_' . $key ), 'value1' );\n\n\t\t// Direct retrieval of temporary timeout should be integer and greater than current time.\n\t\t$raw_key1_timeout_before_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_before_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_before_sleep );\n\n\t\t// Getting of temporary should return set value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1' );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update1', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update1' );\n\n\t\t// Timeout should be unchanged.\n\t\t$this->assertEquals( $raw_key1_timeout_before_sleep, get_site_option( '_site_temporary_timeout_' . $key ) );\n\n\t\t// Sleep for two minutes.\n\t\tsleep( 2 * MINUTE_IN_SECONDS );\n\n\t\t// Updating temporary should be true.\n\t\t$this->assertTrue( WP_Temporary::update_site( $key, 'value1-update2', 5 ) );\n\n\t\t// Getting of temporary should return updated value.\n\t\t$this->assertEquals( WP_Temporary::get_site( $key ), 'value1-update2' );\n\n\t\t// Direct retrieval of temporary timeout should be integer, and greater than current time or timeout before sleep.\n\t\t$raw_key1_timeout_after_sleep = get_site_option( '_site_temporary_timeout_' . $key );\n\t\t$this->assertTrue( is_int( $raw_key1_timeout_after_sleep ) );\n\t\t$this->assertGreaterThan( time(), $raw_key1_timeout_after_sleep );\n\t\t$this->assertGreaterThan( $raw_key1_timeout_before_sleep, $raw_key1_timeout_after_sleep );\n\t}", "public function testWebinarRegistrantQuestionUpdate()\n {\n }", "public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }", "public function test_accepts_minor_updates()\n {\n }", "public function test_update_product_success()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit(new UpdateProduct)\n ->assertSee(__('product.admin.edit.title'))\n ->type('name', 'Milk Tea')\n ->attach('image[]', __DIR__.'/test/image1.jpg')\n ->type('describe', 'Sale off')\n ->type('price', '20000')\n ->press(__('product.admin.edit.update_product'))\n ->assertPathIs('/admin/products')\n ->assertSee(__('product.admin.edit.update_success'));\n $this->assertDatabaseHas('products', [\n 'name' => 'Milk Tea',\n 'describe' => 'Sale Off',\n 'price' => '20000',\n ]);\n });\n }", "public function test_updateMessage() {\n\n }", "public function update(Request $request, TestResult $testResult)\n {\n //\n }", "public function updateTest() {\n if (MLSetting::gi()->get('blSaveMode')) {\n throw MLException::factory('update', 'save mode', 1424074789);\n }\n if (!$this->isWritable(MLFilesystem::getCachePath())) {//needed for tests\n throw MLException::factory('update', 'Path `{#path#}` is not writable.', 1407759765)->setData(array('path' => MLFilesystem::getCachePath()));\n }\n try {// cache is writable, so no exception should come \n $blUpdate = true;\n // clean\n $blUpdate = $blUpdate ? ($this->rm(MLFilesystem::getCachePath('test'))) : false;\n // create file\n $blUpdate = $blUpdate ? ($this->write(MLFilesystem::getCachePath('test/folder/included.php'), \"<?php\\nreturn basename(__file__);\\n\")) : false;\n // includes file\n $blUpdate = $blUpdate ? ('included.php' == (@include MLFilesystem::getCachePath('test/folder/included.php'))) : false;\n // move file\n $blUpdate = \n $blUpdate \n ? $this->mv(\n MLFilesystem::getCachePath('test/folder/included.php'),\n MLFilesystem::getCachePath('test/folder/moved.php')\n )\n : false \n ;\n // include file\n $blUpdate = $blUpdate ? ('moved.php' == (@include MLFilesystem::getCachePath('test/folder/moved.php'))) : false;\n // move folder\n $blUpdate = \n $blUpdate \n ? $this->mv(\n MLFilesystem::getCachePath('test/folder'),\n MLFilesystem::getCachePath('test/otherfolder')\n )\n : false \n ;\n // include file\n $blUpdate = $blUpdate ? ('moved.php' == (@include MLFilesystem::getCachePath('test/otherfolder/moved.php'))) : false;\n } catch (Exception $oEx) {\n MLMessage::gi()->addDebug($oEx);\n $blUpdate = false;\n }\n if (!$blUpdate) {\n throw MLException::factory(\n 'update', \n 'Misc update error', \n 1424075291\n );\n }\n return $this;\n }", "public function testProfileUpdateAll()\n {\n\n }", "public function testUpdated()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n \t$player_factory->mode = sprintf('Randon mode %s', microtime());\n\n $this->assertTrue($player_factory->save());\n }", "public function testEditTestCase()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->click('TestCase1')\n ->seePageIs('/library/testcase/detail/1')\n ->type('someNewDecription','description')\n ->type('someNewPrefixes','prefixes')\n ->type('someNewSteps','steps')\n ->type('someNewResult','expectedResult')\n ->type('someNewSuffixes','suffixes')\n ->press('submit');\n\n $this->seeInDatabase('TestCaseHistory', [\n 'TestCaseDescription' => 'someNewDecription',\n 'TestCasePrefixes' => 'someNewPrefixes',\n 'TestSteps' => 'someNewSteps',\n 'ExpectedResult' => 'someNewResult',\n 'TestCaseSuffixes' => 'someNewSuffixes'\n ]);\n\n Artisan::call('migrate:reset');\n\n }", "public function testUpdated()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's updated date is correct\n $this->assertTrue($feed->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n $this->verifyProperty2(\n $feed,\n \"updated\",\n \"text\",\n \"2007-05-31T01:15:00.000Z\"\n );\n\n // Assert that all entry's have an Atom Published object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n }\n\n // Assert one of the entry's Published dates\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"updated\", \"text\", \"2007-05-17T10:33:49.000Z\");\n }", "public function testUpdate()\n {\n\n $this->createDummyRole();\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->updateAction,\n 'id' => 1,\n 'name' => \"updatedName\",\n 'description' => \"updatedDesc\",\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => \"updatedName\",\n 'description' => \"updatedDesc\"\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1]\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [2]\n ]);\n }", "public function testEdit()\n {\n $city = \\App\\City::first();\n\n $this->actingAs( \\App\\User::first() )\n ->visit('/city/'.$city->id.'/edit')\n ->see('Update City / District Information')\n ->type('Chittagong', 'name')\n ->select(2, 'state_id')\n ->select(true, 'status')\n ->press('Update Now')\n ->seePageIs('/city/'.$city->id.'/edit')\n ->see('Updated!');\n }", "public function testUpdateValue()\n {\n $response = $this->json('PATCH', '/api/values');\n $response->assertStatus(200);\n }", "public function testServeChange()\n {\n }", "public function test_updateQueue() {\n\n }", "public function testGenerateWithUpdating() {\n\n\t\t$current_crontab = <<<CRON\n#===BEGIN Crontab for project: phpunit\n*/2 0 * * * test\n\n#===END Crontab for project: phpunit\nCRON;\n\n\t\t// EXPECTS\n\t\t$this->crontab->expects($this->once())->method('read')->willReturnCallback(function() use ($current_crontab) {\n\t\t\t$this->getCrontabProperty()->setValue($this->crontab, $current_crontab);\n\t\t});\n\t\t$this->crontab->expects($this->once())->method('save');\n\n\t\t// WHEN\n\t\t$this->crontab->update();\n\n\t\t$this->assertEquals($this->expected, $this->getCrontabProperty()->getValue($this->crontab));\n\t}", "public function test_changing_question() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $time = mktime(9, 0, 0, 11, 7, 2013);\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $time, $time, 2, 'dummy text')\n )\n )));\n\n $question = array(\n 'text' => 'I have updated my question.',\n 'timemodified' => time()\n );\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('PUT', '/api/v1/' . $videoquanda->id . '/questions/1', array(), array(), array(), json_encode($question));\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertGreaterThan($time, $DB->get_field('videoquanda_questions', 'timemodified', array('id' => 1)));\n }", "public function testUpdate()\n\t{\n\t\t$params = $this->setUpParams();\n\t\t$params['title'] = 'some tag';\n\t\t$params['slug'] = 'some-tag';\n\t\t$response = $this->call('PUT', '/'.self::$endpoint.'/'.$this->obj->id, $params);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($params as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969', $params);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "public function testD_update() {\n\n $fname = self::$generator->firstName();\n $lname = self::$generator->lastName;\n\n $resp = $this->wrapper->update( self::$randomEmail, [\n 'FNAME' => $fname,\n 'LNAME' => $lname\n ]);\n\n $this->assertObjectHasAttribute('id', $resp);\n $this->assertObjectHasAttribute('merge_fields', $resp);\n\n $updated = $resp->merge_fields;\n\n $this->assertEquals($lname, $updated->LNAME);\n\n }", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "public function testUpdate(): void {\n $configObject = $this->configUpdateManager->getConfig();\n\n $this->configUpdateManager->update();\n foreach ($configObject->getTargetConfigFilepaths() as $filepath) {\n self::assertFileExists($filepath);\n }\n\n $targetConfigFilepath = $configObject->getTargetConfigFilepath(Config::TARGET_CONFIG_FILENAME);\n /**\n * @var array{\n * draft: array{\n * last_applied_update: int,\n * },\n * } $config\n */\n $config = $configObject->readAndParseConfigFromTheFile($targetConfigFilepath);\n self::assertSame(App::LAST_AVAILABLE_UPDATE_WEIGHT, $config['draft']['last_applied_update']);\n }", "public function testUpdate()\n {\n\n // $payment = $this->payment\n // ->setEvent($this->eventId)\n // ->acceptCash()\n // ->acceptCheck()\n // ->acceptGoogle()\n // ->acceptInvoice()\n // ->acceptPaypal()\n // ->setCashInstructions($instructions)\n // ->setCheckInstructions($instructions)\n // ->setInvoiceInstructions($instructions)\n // ->setGoogleMerchantId($this->googleMerchantId)\n // ->setGoogleMerchantKey($this->googleMerchantKey)\n // ->setPaypalEmail($this->paypalEmail)\n // ->update();\n\n // $this->assertArrayHasKey('process', $payment);\n // $this->assertArrayHasKey('status', $payment['process']);\n // $this->assertTrue($payment['process']['status'] == 'OK');\n }", "private function updateOperation() {\n sleep(1);\n }", "public function testDmlGettingStartedUpdate()\n {\n $db = self::$instance->database(self::$databaseId);\n $db->runTransaction(function (Transaction $t) {\n $t->executeUpdateBatch([\n [\n 'sql' => 'INSERT INTO Albums (SingerId, AlbumId, MarketingBudget) VALUES($1, $2, $3)',\n 'parameters' => [\n 'p1' => 1,\n 'p2' => 1,\n 'p3' => 0\n ]\n ],\n [\n 'sql' => 'INSERT INTO Albums (SingerId, AlbumId, MarketingBudget) VALUES($1, $2, $3)',\n 'parameters' => [\n 'p1' => 2,\n 'p2' => 2,\n 'p3' => 200001\n ]\n ]\n ]);\n\n $t->commit();\n });\n\n $output = $this->runFunctionSnippet('pg_dml_getting_started_update');\n $this->assertStringContainsString('Marketing budget updated.', $output);\n }", "public function testUpdateStorage() {\n // Setting values in both key stores, then installing the module and\n // testing if these key values are cleared.\n $keyvalue_update = $this->container->get('keyvalue.expirable')->get('update');\n $keyvalue_update->set('key', 'some value');\n $keyvalue_update_available_release = $this->container->get('keyvalue.expirable')->get('update_available_release');\n $keyvalue_update_available_release->set('key', 'some value');\n $this->container->get('module_installer')->install(['help']);\n $this->assertNull($keyvalue_update->get('key'));\n $this->assertNull($keyvalue_update_available_release->get('key'));\n\n // Setting new values in both key stores, then uninstalling the module and\n // testing if these new key values are cleared.\n $keyvalue_update->set('another_key', 'some value');\n $keyvalue_update_available_release->set('another_key', 'some value');\n $this->container->get('module_installer')->uninstall(['help']);\n $this->assertNull($keyvalue_update->get('another_key'));\n $this->assertNull($keyvalue_update_available_release->get('another_key'));\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testRenderUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($branchIDs);\n $branch = $this->branch->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/branch/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('branch', $branch);\n $this->assertViewHas('dataTl');\n $this->assertPageContain('Edit Branch');\n }", "public function testUpdateSubmitted()\n {\n $file = new File;\n $file->setFilespec(\"//depot/foo\")\n ->setLocalContents(\"this is a test\")\n ->add()\n ->submit('original description');\n\n $change = Change::fetch(1);\n $this->assertSame(\"original description\\n\", $change->getDescription());\n\n $change->setDescription('updated description')\n ->save(true);\n\n $change = Change::fetch(1);\n $this->assertSame(\"updated description\\n\", $change->getDescription());\n }", "public function testEditAction()\n {\n // create review record for change 1\n $this->createChange();\n Review::createFromChange('1')->save();\n\n $postData = new Parameters(array('state' => 'approved', 'testStatus' => 'pass'));\n $this->getRequest()\n ->setMethod(\\Zend\\Http\\Request::METHOD_POST)\n ->setPost($postData);\n\n // dispatch and check output\n $this->dispatch('/reviews/2');\n $result = $this->getResult();\n $review = $result->getVariable('review');\n $this->assertRoute('review');\n $this->assertResponseStatusCode(200);\n $this->assertInstanceOf('Zend\\View\\Model\\JsonModel', $result);\n $this->assertSame(true, $result->getVariable('isValid'));\n $this->assertSame('approved', $review['state']);\n $this->assertSame('pass', $review['testStatus']);\n }", "public function test_it_update_database_from_api()\n {\n\n $this->json('GET', 'api/v1/update')->assertJsonFragment(\n [\n 'success' => 1\n ]\n );\n\n\n // second assertion , check that database is not empty , so we know that data has been updated after being truncate\n\n $beers = Beer::get();\n $this->assertEquals(false, $beers->isEmpty());\n }", "public function testSuccessfullUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => true,\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n 'id' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n ]);\n }", "public function testUpdateFileChanges() {\n $this->installProcedure->shouldBeCalledOnce();\n $this->updateProcedure->shouldBeCalledOnce();\n\n $this->cachedInstall->install($this->installer, $this->updater);\n file_put_contents($this->appRoot . '/drupal/modules/x/x.post_update.php', 'bar');\n $this->cachedInstall->install($this->installer, $this->updater);\n\n $this->assertSiteInstalled();\n $this->assertSiteCached($this->cachedInstall->getInstallCacheId());\n $this->assertSiteCached($this->cachedInstall->getUpdateCacheId());\n }", "protected function doUpdateTests()\n {\n $this->objectRepository->setClassName(TestPolicy::class);\n $policy = $this->objectRepository->find(19071974);\n $policy->policyNo = 'TESTPOLICY UPDATED';\n $policy->contact->lastName = 'ChildUpdate';\n $recordsAffected = $this->objectRepository->saveEntity($policy);\n $recordsAffected = 2;\n if ($this->getCacheSuffix()) {\n $this->assertGreaterThanOrEqual(2, $recordsAffected);\n } else {\n $this->assertEquals(2, $recordsAffected);\n }\n\n //Verify update\n $policy2 = $this->objectRepository->find(19071974);\n $this->assertEquals('TESTPOLICY UPDATED', $policy2->policyNo);\n $this->assertEquals('ChildUpdate', $policy2->contact->lastName);\n\n //If we tell it not to update children, ensure foreign keys are ignored\n $policy = $this->objectRepository->find(19071974);\n $policy->vehicle->policy = null;\n $policy->contact = null;\n $this->objectRepository->saveEntity($policy, false);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertEquals(123, $refreshedPolicy->contact->id);\n $this->assertEquals(1, $refreshedPolicy->vehicle->id);\n $this->assertEquals(19071974, $refreshedPolicy->vehicle->policy->id);\n\n //And if we tell it to update children, they are not ignored\n //(known issue: if child owns relationship, the relationship won't be deleted unless you save the child\n //directly - hence we don't check for a null vehicle or vehicle->policy here, as it will not have removed the\n //relationship)\n $this->objectRepository->saveEntity($policy, true);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertNull($refreshedPolicy->contact);\n\n //Put the contact back, ready for the next test (quicker than running $this->setUp() again)\n $refreshedPolicy->contact = $this->objectRepository->getObjectReference(TestContact::class, ['id' => 123]);\n $this->objectRepository->saveEntity($refreshedPolicy);\n }", "public function update() {\r\n }", "public function testSaveUpdate()\n {\n $city = $this->existing_city;\n\n // set string properties to \"updated <property_name>\"\n // set numeric properties to strlen(<property_name>)\n foreach (get_object_vars($city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($value)) {\n $city->$key = \"updated \".$key;\n } elseif (is_numeric($value)) {\n $city->$key = strlen($key);\n }\n }\n }\n\n // update the city\n $city->save();\n\n // go get the updated record\n $updated_city = new City($city->id);\n // check the properties of the updatedCity\n foreach (get_object_vars($updated_city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($city->$key)) {\n $this->assertEquals(\"updated \".$key, $value);\n } elseif (is_numeric($city->$key)) {\n $this->assertEquals(strlen($key), $value);\n }\n }\n }\n }", "public function testUpdate() {\n\n\t\t$request_uri = $this->root_url . 'update';\n\n\t\t$parameters = array(\n\t\t\t'uri' => $request_uri,\n\t\t\t'method' => 'POST',\n\t\t\t'database' => $this->db,\n\t\t\t'postdata' => array(\n\t\t\t\t'id' => 4,\n\t\t\t\t'firstname' => 'Andrei',\n\t\t\t\t'surname' => 'Kanchelskis',\n\t\t\t)\n\t\t);\n\n\t\t$server = new APIServer( $parameters );\n\n\t\t$server->run();\n\n\t\t$response = $server->getResponse();\n\n\t\t$this->assertArrayHasKey('status', $response);\n\t\t$this->assertArrayHasKey('command', $response);\n\n\t\t$this->assertEquals( $response['command'], 'update' );\n\t}", "public function testUpdateInstance() {\r\n $this->assertInstanceOf('\\PM\\Main\\Database\\Update', $this->_instance->update());\r\n }", "public function testUpdateFiles()\n {\n $timeFormat = 'Y-m-d\\TH:i:sP';\n\n $jsonData = '{\n \"links\": [\n {\n \"$ref\": \"http://localhost/testcase/readonly/101\",\n \"type\": \"owner\"\n },\n {\n \"$ref\": \"http://localhost/testcase/readonly/102\",\n \"type\": \"module\"\n }\n ],\n \"metadata\": {\n \"action\":[{\"command\":\"print\"},{\"command\":\"archive\"}]\n }\n }';\n\n $uploadedFile = $this->getUploadFile('test.txt');\n $client = $this->createClient();\n $client->request(\n 'POST',\n '/file',\n [\n 'metadata' => $jsonData,\n ],\n [\n 'upload' => $uploadedFile,\n ]\n );\n $response = $client->getResponse();\n $location = $response->headers->get('location');\n\n $this->assertEquals(Response::HTTP_CREATED, $response->getStatusCode());\n $this->assertStringContainsString('/file/', $location);\n\n // receive generated file information\n $client = $this->createClient();\n $client->request('GET', $location, [], [], ['HTTP_ACCEPT' => 'application/json']);\n\n $response = $client->getResponse();\n $contentArray = json_decode($response->getContent(), true);\n\n // Check contain data\n $this->assertArrayHasKey('modificationDate', $contentArray['metadata']);\n $this->assertArrayHasKey('createDate', $contentArray['metadata']);\n // Test Metadata, and Remove date.\n $originalAt = \\DateTime::createFromFormat($timeFormat, $contentArray['metadata']['modificationDate']);\n unset($contentArray['metadata']['modificationDate']);\n unset($contentArray['metadata']['createDate']);\n\n // PUT Lets UPDATE some additional Params\n $client = $this->createClient();\n $value = new \\stdClass();\n $value->name = 'aField';\n $value->value = 'aValue';\n $contentArray['metadata']['additionalProperties'] = [$value];\n sleep(1);\n $client->request(\n 'PUT',\n $location,\n [\n 'metadata' => json_encode($contentArray),\n ]\n );\n $response = $client->getResponse();\n $this->assertEquals(Response::HTTP_NO_CONTENT, $response->getStatusCode(), $response->getContent());\n\n $client = $this->createClient();\n $client->request('GET', $location, [], [], ['HTTP_ACCEPT' => 'application/json']);\n\n $response = $client->getResponse();\n $contentUpdatedArray = json_decode($response->getContent(), true);\n $modifiedAt = \\DateTime::createFromFormat($timeFormat, $contentUpdatedArray['metadata']['modificationDate']);\n\n $this->assertTrue($modifiedAt > $originalAt, 'File put should have changed modification date and did not');\n\n // PATCH Lets patch, and time should be changed\n $value->value = 'bValue';\n $patchJson = json_encode(\n array(\n 'op' => 'replace',\n 'path' => '/metadata/additionalProperties',\n 'value' => [$value]\n )\n );\n sleep(1);\n $client = $this->createClient();\n $client->request('PATCH', $location, [], [], [], $patchJson);\n $response = $client->getResponse();\n $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());\n\n $client->request('GET', $location, [], [], ['HTTP_ACCEPT' => 'application/json']);\n $response = $client->getResponse();\n $contentPatchedArray = json_decode($response->getContent(), true);\n $pacthedAt = \\DateTime::createFromFormat($timeFormat, $contentPatchedArray['metadata']['modificationDate']);\n $this->assertTrue($pacthedAt > $modifiedAt, 'File patched should have changed modification date and did not');\n\n // clean up\n $client = $this->createClient();\n $client->request(\n 'DELETE',\n $location\n );\n }", "public function Do_update_Example1(){\n\n\t}", "public function testUpdate() {\n $legacy_tour_config = $this->container->get('config.factory')->get('tour.tour.views-ui');\n $tips = $legacy_tour_config->get('tips');\n\n // Confirm the existing tour tip configurations match expectations.\n $this->assertFalse(isset($tips['views-ui-view-admin']['selector']));\n $this->assertEquals('views-display-extra-actions', $tips['views-ui-view-admin']['attributes']['data-id']);\n $this->assertEquals('views-ui-display-tab-bucket.format', $tips['views-ui-format']['attributes']['data-class']);\n $this->assertSame('left', $tips['views-ui-view-admin']['location']);\n $this->assertArrayNotHasKey('position', $tips['views-ui-view-admin']);\n\n $this->runUpdates();\n\n $updated_legacy_tour_config = $this->container->get('config.factory')->get('tour.tour.views-ui');\n $updated_tips = $updated_legacy_tour_config->get('tips');\n\n // Confirm that views-ui-view-admin uses `selector` instead of `data-id`.\n $this->assertSame('#views-display-extra-actions', $updated_tips['views-ui-view-admin']['selector']);\n\n // Confirm that views-ui-format uses `selector` instead of `data-class`.\n $this->assertSame('.views-ui-display-tab-bucket.format', $updated_tips['views-ui-format']['selector']);\n\n // Assert that the deprecated attributes key has been removed now that it is\n // empty.\n $this->assertArrayNotHasKey('attributes', $updated_tips['views-ui-view-admin']);\n\n $this->assertSame('left-start', $updated_tips['views-ui-view-admin']['position']);\n $this->assertArrayNotHasKey('location', $updated_tips['views-ui-view-admin']);\n }", "public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function test_edit_existing_talkpoint_no_change_of_file() {\n global $CFG, $DB;\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the page\n $client = new Client($this->_app);\n $crawler = $client->request('GET', '/' . $talkpoint->id . '/edit/1');\n $this->assertTrue($client->getResponse()->isOk());\n\n // spit a dummy existing file\n check_dir_exists($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1');\n file_put_contents($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/mod_talkpoint_web_test.txt', 'dummy contents');\n\n // post some data\n $form = $crawler->selectButton(get_string('savechanges'))->form();\n $client->submit($form, array(\n 'form[title]' => 'Talkpoint 001a',\n 'form[mediatype]' => 'file',\n ));\n $url = $CFG->wwwroot . SLUG . $this->_app['url_generator']->generate('talkpoint', array(\n 'id' => 1,\n ));\n $this->assertTrue($client->getResponse()->isRedirect($url));\n\n // ensure the title got changed as expected\n $this->assertEquals('Talkpoint 001a', $DB->get_field('talkpoint_talkpoint', 'title', array('id' => 1)));\n\n // ensure the old file still exists in the expected location\n $this->assertStringEqualsFile($CFG->dataroot . '/into/mod_talkpoint/' . $talkpoint->id . '/1/mod_talkpoint_web_test.txt', 'dummy contents');\n }", "public function testIntegrationEdit()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->see('Edit Account');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => $userFaker->username,\n 'email' => $userFaker->email\n ]);\n $this->assertViewHas('model');\n }", "function testDeterminingChanges() {\n // Initial creation.\n $support_ticket = entity_create('support_ticket', array(\n 'uid' => $this->webUser->id(),\n 'support_ticket_type' => 'ticket',\n 'title' => 'test_changes',\n ));\n $support_ticket->save();\n\n // Update the support_ticket without applying changes.\n $support_ticket->save();\n $this->assertEqual($support_ticket->label(), 'test_changes', 'No changes have been determined.');\n\n // Apply changes.\n $support_ticket->title = 'updated';\n $support_ticket->save();\n\n // The hook implementations support_ticket_test_support_ticket_presave() and\n // support_ticket_test_support_ticket_update() determine changes and change the title.\n $this->assertEqual($support_ticket->label(), 'updated_presave_update', 'Changes have been determined.');\n\n // Test the static support_ticket load cache to be cleared.\n $support_ticket = SupportTicket::load($support_ticket->id());\n $this->assertEqual($support_ticket->label(), 'updated_presave', 'Static cache has been cleared.');\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function testAllUpdate($name)\n {\n $arguments = $this->getRequiredArguments($name);\n self::executeMethod($name, $arguments)->getResponse();\n }", "public function testUserUpdate() {\n\t\t// make new User and save it to the database\n\t\t$uploadTestFile = realpath(base_path().'/tests/files/upload_test.png');\n\t\tif(!file_exists($uploadTestFile)) {\n\t\t\t$this->fail('Upload test file is missing!');\n\t\t}\n\t\t$oldImage = $this->User->getImage();\n\t\t$newName = Generate::string();\n\t\t$Role = Role::where('name', 'user')->first();\n\n\t\t// navigate to and submit new User details\n\t\t$this->visit('/home')->within('.body-content', function() use($oldImage) {\n\t\t\t$this->see('/'.$oldImage);\n\t\t});\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->type($newName, 'name')\n\t\t\t->attach($uploadTestFile, 'image')\n\t\t\t->press('Save');\n\n\t\t// check the details have been updated\n\t\t$this->seeInDatabase('users', [\n\t\t\t'email' => $this->User->email,\n\t\t\t'name' => $newName\n\t\t]);\n\n\t\t// update our User object and check the image name has changed\n\t\t$this->User = User::find($this->User->id);\n\t\tif($oldImage===$this->User->getImage()) {\n\t\t\t$this->fail('Image was not updated!');\n\t\t}\n\t}", "public function update()\n\t{\n\n\t}", "public function update() {\r\n\r\n\t}", "function TestRun_update($run_id, $build_id, $environment_id, $manager_id, $plan_text_version, $summary, $notes = NULL, $start_date = NULL, $stop_date = NULL) {\n\t$varray = array(\"build_id\" => \"int\", \"environment_id\" => \"int\", \"manager_id\" => \"int\", \"plan_text_version\" => \"int\", \"summary\" => \"string\", \"notes\" => \"string\", \"start_date\" => \"string\", \"stop_date\" => \"string\");\n\tforeach($varray as $key => $val) {\n\t\tif (isset(${$key})) {\n\t\t\t$carray[$key] = new xmlrpcval(${$key}, $val);\n\t\t}\n\t}\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.update', array(new xmlrpcval($run_id, \"int\"), new xmlrpcval($carray, \"struct\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function testJobPatch()\n {\n\n }", "public function testNothingModifiedLastRunSet()\n {\n $this->_cs->updateLastRun($this->_name);\n sleep(2);\n\n $check = $this->_cs->checkEntitiesChanged($this->_name, array(self::ENTITY_NAME));\n $this->assertFalse($check);\n }", "public function test_update( $people )\n\t{\n\t\t// randomize the peoples age\n\t\tforeach( $people as $key => $person )\n\t\t{\n\t\t\t$people[$key]['age'] = mt_rand( 16, 40 );\n\t\t}\n\t\t\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t// run the updaes\n\t\t$query = 'update people set age = ? where id = ?';\n\t\t\n\t\tforeach( $people as $key => $person )\n\t\t{\t\n\t\t\t$this->assertEquals( 1, $handler->run( $query, array( $person['age'], $key+1 ) ) );\n\t\t}\n\t\t\n\t\t// check the data\n\t\tforeach( $handler->fetch( 'select * from people', array() ) as $record )\n\t\t{\n\t\t\t$person = $people[ $record->id -1 ];\n\t\t\t\n\t\t\t// check the attributes\n\t\t\tforeach( $person as $key => $attr )\n\t\t\t{\n\t\t\t\t$this->assertEquals( $attr, $record->$key );\n\t\t\t}\n\t\t}\n\t}", "public function test_changing_non_existing_answer() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $time = mktime(9, 0, 0, 11, 7, 2013);\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $time, $time, 2, 'dummy text')\n ),\n 'videoquanda_answers' => array(\n array('id', 'questionid', 'userid', 'timecreated', 'timemodified', 'text'),\n array(1, 1, $user->id, $time, $time, 'dummy answer 1.')\n )\n )));\n\n $answer = array(\n 'text' => 'I have updated my answer.',\n 'timemodified' => time()\n );\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('PUT', '/api/v1/' . $videoquanda->id . '/questions/1/answers/2', array(), array(), array(), json_encode($answer));\n\n $this->assertEquals(404, $client->getResponse()->getStatusCode());\n $this->assertEquals($time, $DB->get_field('videoquanda_answers', 'timemodified', array('id' => 1)));\n }", "public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }", "public function testEverythingIsNotChanged()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => 'datasource_name',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n // Execute -----------------------------\n $updatePostData = [\n 'id' => $targetDataSourceId,\n 'datasource_name' => 'datasource_name', // not change\n 'table_id' => 1, // not change\n 'starting_row_number' => 2, // not change\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data of 'datasource' table\n $this->assertEquals($updatePostData['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($updatePostData['table_id'], $updatedTable->table_id);\n $this->assertEquals($updatePostData['starting_row_number'], $updatedTable->starting_row_number);\n $this->assertTrue($updatedTable->created_at != null);\n $this->assertTrue($updatedTable->updated_at != null);\n $this->assertTrue($updatedTable->created_by == null);\n $this->assertTrue($updatedTable->updated_by == null);\n\n //Check response\n $updateResponse\n ->assertStatus(200)\n ->assertJsonFragment([\n 'id' => $updatedTable->id,\n 'datasource_name' => $updatePostData['datasource_name'],\n 'table_id' => $updatePostData['table_id'],\n 'starting_row_number' => $updatePostData['starting_row_number'],\n ]);\n }", "public function testUpdateSurvey()\n {\n $survey = Survey::factory()->create();\n\n $response = $this->json('PATCH', \"survey/{$survey->id}\", [\n 'survey' => ['epilogue' => 'epilogue your behind']\n ]);\n\n $response->assertStatus(200);\n $this->assertDatabaseHas('survey', ['id' => $survey->id, 'epilogue' => 'epilogue your behind']);\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }" ]
[ "0.67539436", "0.6726989", "0.6693528", "0.6693528", "0.6681331", "0.6661945", "0.66463745", "0.6578476", "0.6578056", "0.657795", "0.6551882", "0.6551256", "0.6530346", "0.6482285", "0.64588344", "0.6385265", "0.63442075", "0.6335847", "0.6331066", "0.632276", "0.6302533", "0.6285765", "0.62669086", "0.6259578", "0.6240317", "0.6235338", "0.62195385", "0.6200822", "0.6193498", "0.6192996", "0.6187975", "0.6146165", "0.61453986", "0.61374843", "0.6124358", "0.6110745", "0.60688674", "0.6045954", "0.60372746", "0.60361737", "0.6031969", "0.59402806", "0.5934745", "0.593205", "0.59235704", "0.5907706", "0.58828545", "0.5881902", "0.58794504", "0.58651006", "0.58636457", "0.586209", "0.58572066", "0.5854356", "0.5852922", "0.5842146", "0.5841085", "0.58388025", "0.5829222", "0.5823037", "0.58212376", "0.5820525", "0.5810148", "0.58082014", "0.5807416", "0.5794513", "0.5792688", "0.57909864", "0.57870424", "0.57867867", "0.57840973", "0.5779773", "0.57786924", "0.5777437", "0.5773878", "0.57651305", "0.57641006", "0.5759793", "0.5759793", "0.5754985", "0.5752819", "0.5749419", "0.5748202", "0.57389647", "0.5734829", "0.5733272", "0.57330453", "0.5732254", "0.57246006", "0.5722068", "0.57197183", "0.5716712", "0.5716712", "0.5716712", "0.5716712", "0.5716712", "0.5716712", "0.5716712", "0.5716712", "0.5716712" ]
0.78741
0
Testing the prject deletion. Note that this is logical deletion. The document will remain in the Elasticsearch
public function testDeleteExperiment() { echo "\nTesting experiment deletion..."; $id = "0"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/experiments/".$id; echo "\ntestDeleteExperiment:".$url; $response = $this->curl_delete($url); //echo $response; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteDocument()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testDeleteDocument()\n {\n }", "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function delete() {\n // Find document ID.\n if (!$this->find()) {\n debugging('Failed to find ousearch document');\n return false;\n }\n self::wipe_document($this->id);\n }", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "public function deleteFromIndex()\n {\n if ($this->es_info) {\n ESHelper::deleteDocumentFromType($this);\n }\n }", "public function testDelete()\n\t{\n\t\t$obj2 = $this->setUpObj();\n\t\t$response = $this->call('DELETE', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah sudah terdelete\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($obj2->attributesToArray() as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\t}", "protected function doDeleteDocument() {\n try{\n $this->service->remove($this->owner);\n }\n catch(NotFoundException $e)\n {\n trigger_error(\"Deleted document not found in search index.\", E_USER_NOTICE);\n }\n\n }", "function delete() {\n\n $document = Doctrine::getTable('DocDocument')->find($this->input->post('doc_document_id'));\n $node = Doctrine::getTable('Node')->find($document->node_id);\n\n if ($document && $document->delete()) {\n//echo '{\"success\": true}';\n\n $this->syslog->register('delete_document', array(\n $document->doc_document_filename,\n $node->getPath()\n )); // registering log\n\n $success = 'true';\n $msg = $this->translateTag('General', 'operation_successful');\n } else {\n//echo '{\"success\": false}';\n $success = 'false';\n $msg = $e->getMessage();\n }\n\n $json_data = $this->json->encode(array('success' => $success, 'msg' => $msg));\n echo $json_data;\n }", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function testDeleteIdsIdxObjectTypeObject(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // Using the existing $index variable which is \\Elastica\\Index object\n $index->getClient()->deleteIds($ids, $index);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "public function testDelete()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 60, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // delete\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([60])\n ->setIdName('id')\n ->build();\n\n $this->cacheManager->delete($searchCriteria);\n\n // search\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertFalse($searchResult->hasData());\n $this->assertEquals(0, $searchResult->count());\n $this->assertCount(1, $searchResult->getMissedData());\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/product/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Product', 'productId', self::$objectId);\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function index_delete(){\n\t\t\n\t\t}", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function testDeleteForm() {\n $document = $this->createDocument();\n\n $document_name = $document->id();\n\n // Log in and check for existence of the created document.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/structure/legal');\n $this->assertRaw($document_name, 'Document found in overview list');\n\n // Delete the document.\n $this->drupalPostForm('admin/structure/legal/manage/' . $document_name . '/delete', [], 'Delete');\n\n // Ensure document no longer exists on the overview page.\n $this->assertUrl('admin/structure/legal', [], 'Returned to overview page after deletion');\n $this->assertNoText($document_name, 'Document not found in overview list');\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testRemovePageWhenDeleted()\n {\n\n // Add a public page.\n $page = $this->_simplePage(true);\n\n // Delete.\n $page->delete();\n\n // Should remove Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function testOnDeletedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $obj->onDeletedDocument($this->doc1);\n $this->assertFileNotExists($this->directory . \"/1/2/4\");\n }", "public function delete() {\n\t\t$delete_array = array();\n\t\tif ($this->getIdType() === self::ID_TYPE_MONGO) {\n\t\t\t$delete_array['_id'] = new \\MongoId($this->getId());\n\t\t} else {\n\t\t\t$delete_array['_id'] = $this->getId();\n\t\t}\n\t\t$rows_affected = $this->getCollection()->remove($delete_array);\n\t\treturn $rows_affected;\n\t}", "public function testDeleteMetadata1UsingDELETE()\n {\n }", "public function testDelete()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table2',\r\n\t\t));\r\n\r\n\t\t// Delete all indices\r\n\t\tforeach($table->indices AS $index)\r\n\t\t{\r\n\t\t\t$this->assertNotSame(false, $index->delete());\r\n\t\t}\r\n\r\n\t\t// Reload table\r\n\t\t$table->refresh();\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(0, count($table->indices));\r\n\t}", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "public function testDeleteMetadata2UsingDELETE()\n {\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}", "public function postDelete() {\n if ($server = $this->server()) {\n if ($server->enabled) {\n $server->removeIndex($this);\n }\n // Once the index is deleted, servers won't be able to tell whether it was\n // read-only. Therefore, we prefer to err on the safe side and don't call\n // the server method at all if the index is read-only and the server\n // currently disabled.\n elseif (empty($this->read_only)) {\n $tasks = variable_get('search_api_tasks', array());\n $tasks[$server->machine_name][$this->machine_name] = array('remove');\n variable_set('search_api_tasks', $tasks);\n }\n }\n\n // Stop tracking entities for indexing.\n $this->dequeueItems();\n }", "public function testDeleteProductUsingDELETE()\n {\n }", "function __safeDeleteDocument() {\n\t\ttry {\n\t\t\t$this->solr->deleteById($this->__createDocId());\n\t\t\t$this->solr->commit();\n\t\t\t$this->solr->optimize();\t\n\t\t} catch (Exception $e) {\n\t\t\t$this->log($e, 'solr');\n\t\t}\n\t}", "public function testDeleteSubject()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testDelete()\n {\n }", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "protected function deleted()\n {\n $this->response = $this->response->withStatus(204);\n $this->jsonBody($this->payload->getOutput());\n }", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "public function testDeleteOne()\n {\n $obj_request = new \\google\\appengine\\datastore\\v4\\CommitRequest();\n $obj_request->setMode(\\google\\appengine\\datastore\\v4\\CommitRequest\\Mode::NON_TRANSACTIONAL);\n $obj_mutation = $obj_request->mutableDeprecatedMutation();\n $obj_key = $obj_mutation->addDelete();\n $obj_key->mutablePartitionId()->setDatasetId('Dataset')->setNamespace('Test');\n $obj_key->addPathElement()->setKind('Book')->setName('PoEAA');\n\n $this->apiProxyMock->expectCall('datastore_v4', 'Commit', $obj_request, new \\google\\appengine\\datastore\\v4\\CommitResponse());\n\n $obj_store = $this->getBookstoreWithTestNamespace();\n $obj_result = $obj_store->delete($obj_store->createEntity()->setKeyName('PoEAA'));\n\n $this->assertEquals($obj_result, TRUE);\n $this->apiProxyMock->verify();\n }", "public function delete(){\n $client = ClientBuilder::create()->build();\n\n $params = [\n 'index' => 'properties',\n 'id' => '16'\n ];\n \n $response = $client->delete($params);\n return response()->json($response);\n }", "public function testDeleteMetadata3UsingDELETE()\n {\n }", "public function testDeleteWrongObjectTypeSubmitAsAdmin()\n {\n $crawler = $this->requestAsAdmin('/tasks');\n\n // Can't use assertSelectorTextContains() because it only checks the first selector occurrence\n // and the task we are looking for is not the first one in the displayed list of tasks.\n // See: https://github.com/symfony/symfony-docs/issues/13036\n //$this->assertSelectorTextContains('h4 > a', 'Tâche Eric n°1');\n $this->assertEquals(1, $crawler->filter('h4 > a:contains(\"Tâche Eric n°1\")')->count());\n\n // Then we delete it\n $task_id = self::getTaskIdByTitle('Tâche Eric n°1');\n\n $this->requestAsAdmin('/tasks/'.$task_id.'/delete');\n\n $crawler = $this->client->followRedirect();\n\n $this->assertRegExp('/tasks$/', $crawler->getUri());\n $this->assertContains(\n 'La tâche a bien été supprimée.',\n $this->client->getResponse()->getContent()\n );\n $this->assertSelectorTextNotContains('h4 > a', 'Tâche Eric n°1');\n }", "public function testDelete(): void\n {\n $this->markTestSkipped('Skipping as PostsService::delete() is not yet ready for prod/testing');\n $this->mock(PostsRepository::class, static function ($mock) {\n $mock->shouldReceive('find')->with(123)->andReturn(new Post());\n $mock->shouldReceive('delete')->with(123)->andReturn(true);\n });\n\n $service = resolve(PostsService::class);\n\n $this->expectsEvents(BlogPostWillBeDeleted::class);\n\n $response = $service->delete(123);\n\n $this->assertIsArray($response);\n }", "public function delete($document_id);", "public function delete() {}", "public function delete() {}", "public function testDeleteReplenishmentTag()\n {\n }", "public function delete() {}", "public function delete() {}", "public function testQuarantineDeleteById()\n {\n\n }", "public function testDeleteMetadata()\n {\n }", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function testCreateReplaceDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->replace($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayNotHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function delete() {\r\n }", "function delete( string $_group_key, IIndexedEntity $_entity ): bool;", "public function test__GetDelete()\n\t{\n\t\t$this->assertThat(\n\t\t\t$this->object->objects->delete,\n\t\t\t$this->isInstanceOf('JAmazons3OperationsObjectsDelete')\n\t\t);\n\t}", "public function DELETE() {\n #\n }", "public function testDeletePostById()\n {\n $post = factory(Post::class)->create();\n \n $this->call('Delete', '/post/' . $post->id);\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }", "public function testDeleteSingleSuccess()\n {\n $entity = $this->findOneEntity();\n\n // Delete Entity\n $this->getClient(true)->request('DELETE', $this->getBaseUrl() . '/' . $entity->getId(),\n [], [], ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n }", "public function delete()\n {\n \n }", "public function delete()\n {\n \n }", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function testDeleteNew()\r\n\t{\r\n\t\t$index = new Index();\r\n\t\t$index->delete();\r\n\t}", "public function testDeleteDelete()\n {\n $this->mockSecurity();\n $this->_loginUser(1);\n $source = 2;\n\n $readPostings = function () use ($source) {\n $read = [];\n $read['all'] = $this->Entries->find()->all()->count();\n $read['source'] = $this->Entries->find()\n ->where(['category_id' => $source])\n ->count();\n\n return $read;\n };\n\n $this->assertTrue($this->Categories->exists($source));\n $before = $readPostings();\n $this->assertGreaterThan(0, $before['source']);\n\n $data = ['mode' => 'delete'];\n $this->post('/admin/categories/delete/2', $data);\n\n $this->assertFalse($this->Categories->exists($source));\n $this->assertRedirect('/admin/categories');\n\n $after = $readPostings();\n $this->assertEquals(0, $after['source']);\n $expected = $before['all'] - $before['source'];\n $this->assertEquals($expected, $after['all']);\n }", "public function testCreateUpdateDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->update($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "function test_treatments_can_be_deleted_true()\n {\n $this->seed();\n \n $user = User::where('email', '=', '[email protected]')->first();\n\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create();\n $treatment = Treatment::first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('DELETE', '/api/treatments/'.$treatment->id.'?token='.$token);\n $response->assertNoContent();\n }", "public function delete() {\n\t\tif (!$this->preDelete()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireDatabase();\n\t\t$this->requireId();\n\t\t$this->requireRev();\n\n\t\t$this->options[\"rev\"] = $this->document->_rev;\n\n\t\ttry {\n\t\t\t$request = new HttpRequest();\n\t\t\t$request->setUrl($this->databaseHost . \"/\" . rawurlencode($this->databaseName) . \"/\" . rawurlencode($this->document->_id) . self::encodeOptions($this->options));\n\t\t\t$request->setMethod(\"delete\");\n\t\t\t$request->send();\n\n\t\t\t$request->response = json_decode($request->response);\n\t\t} catch (Exception $exception) {\n\t\t\tthrow new DocumentException(\"HTTP request failed.\", DocumentException::HTTP_REQUEST_FAILED, $exception);\n\t\t}\n\n\t\tif ($request->status === 200) {\n\t\t\t$this->document->_id = $request->response->id;\n\t\t\t$this->document->_rev = $request->response->rev;\n\n\t\t\treturn $this->postDelete();\n\t\t} else {\n\t\t\tthrow new DocumentException(self::describeError($request->response));\n\t\t}\n\t}", "public function delete()\r\n\t{\r\n\t}", "public function testDeleteFail() {\n $this->delete('/api/author/100')\n ->seeJson(['message' => 'invalid request']);\n }", "public function deleteDocument() {\n $file = $this->getDocumentFile().$this->getAttribute('evidencias')[2];\n\n// check if file exists on server\n if (empty($file) || !file_exists($file)) {\n return false;\n }\n\n// check if uploaded file can be deleted on server\n if (!unlink($file)) {\n return false;\n }\n\n// if deletion successful, reset your file attributes\n $this->evidencias = null;\n\n return true;\n }", "public function testPageDelete()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::where(\"admin\", true)->whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('DELETE', \"/api/pages/\" . $page->slug);\n $response\n ->assertStatus(200);\n }", "public final function delete() {\n }", "public function testDeleteDocumentWithValues()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n $documentId = $eavDocument->getId();\n\n $values = $eavDocument->getValues();\n\n $this->assertGreaterThan(0, $values->count());\n\n $this->em->remove($eavDocument);\n $this->em->flush();\n\n $eavDocument = $this->getEavDocumentRepo()->find($documentId);\n\n $this->assertNull($eavDocument);\n\n $eavValues = $this->getEavValueRepo()->findBy(['document' => $documentId]);\n\n $this->assertEmpty($eavValues);\n }", "protected function delete() {\n\t}", "public function testDeleteBrandUsingDELETE()\n {\n }", "protected function _delete()\n\t{\n\t}", "public function testDelete()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function deleteObject(){\n $qry = new DeleteEntityQuery($this);\n $this->getContext()->addQuery($qry);\n //$this->removeFromParentCollection();\n }", "protected function _postDelete()\n\t{\n\t}", "public function delete() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => 'Error', 'message' => 'Id is null']);\n else:\n $collection = GuidedLearningGamesMap::findFirstByid($id);\n if ($collection):\n if ($collection->delete()):\n return $this->response->setJsonContent(['status' => 'OK', 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => 'Error', 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => 'Error', 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }", "public function delete()\n\t{\n\t}", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}", "public function testDeleteField()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Fields\";\n $fieldFolder = \"DocumentElements/Fields\";\n $localFileName = \"GetField.docx\";\n $remoteFileName = \"TestDeleteField.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $fieldFolder . \"/\" . $localFileName,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $request = new DeleteFieldRequest(\n $remoteFileName,\n 0,\n \"sections/0/paragraphs/0\",\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n Assert::assertNull($this->words->deleteField($request));\n }", "public function removeFromIndex()\n\t{\n\t\t$params = $this->getBasicEsParams();\n\t\t// By default all writes to index will be synchronous\n\t\t$params['custom'] = ['refresh' => true];\n\n\t\ttry {\n\t\t\t$result = $this->getElasticSearchClient()->delete($params);\n\t\t}\n\t\tcatch (Missing404Exception $e) {\n\t\t\t// That will mean the document was not found in index\n\t\t}\n\n\t\tDB::table($this->getTable())\n\t\t\t->where($this->getKeyName(), '=', $this->getKeyForSaveQuery())\n\t\t\t->update(['indexed_at' => null]);\n\n\t\treturn isset($result) ? $result : null;\n\t}", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function testDeleteOnPost() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_post', array(1), $Action);\n\t}", "public function delete() {\n\n $input_data = $this->request->getJsonRawBody();\n $id = isset($input_data->id) ? $input_data->id : '';\n if (empty($id)):\n return $this->response->setJsonContent(['status' => false, 'message' => 'Id is null']);\n else:\n $kidphysical_delete = NidaraKidPhysicalInfo::findFirstByid($id);\n if ($kidphysical_delete):\n if ($kidphysical_delete->delete()):\n return $this->response->setJsonContent(['status' => true, 'Message' => 'Record has been deleted succefully ']);\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'Data could not be deleted']);\n endif;\n else:\n return $this->response->setJsonContent(['status' => false, 'Message' => 'ID doesn\\'t']);\n endif;\n endif;\n }", "public function test_deleteReplenishmentProcessTag() {\n\n }", "public function testDeleteDocument($name, $fields, $expectedValues)\n {\n $crud = new Enumerates();\n $crud->setUrlParameters(array(\n \"familyId\" => $name\n ));\n try {\n $crud->delete(null);\n $this->assertFalse(true, \"An exception must occur\");\n }\n catch(DocumentException $exception) {\n $this->assertEquals(501, $exception->getHttpStatus());\n }\n }", "public function delete() {\n\n if (!$this->isUsed()) {\n // Database deletion\n $result = Db::getInstance()->delete($this->def['table'], '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n\n if (!$result) {\n return false;\n }\n\n // Database deletion for multilingual fields related to the object\n\n if (!empty($this->def['multilang'])) {\n Db::getInstance()->delete(bqSQL($this->def['table']) . '_lang', '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n }\n\n return $result;\n } else {\n return false;\n }\n\n }", "public function testDeleteCategoryUsingDELETE()\n {\n }", "public function testExample()\n {\n $car = \\App\\Car::find(32);\n $delete= $car->delete();\n $this->assertTrue($delete);\n\n }", "public function delete_post( $post ) \n\t{\n\t\t$term = new Zend_Search_Lucene_Index_Term( $post->id, 'postid' );\n\t\t$docIds = $this->_index->termDocs( $term );\n\t\tforeach ( $docIds as $id ) {\n\t\t\t$this->_index->delete( $id );\n\t\t}\n\t}", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }" ]
[ "0.7721979", "0.72195476", "0.71160734", "0.6860015", "0.6648042", "0.66346395", "0.6630051", "0.66213447", "0.65666604", "0.65341294", "0.6483629", "0.648147", "0.6480438", "0.64733475", "0.6467028", "0.646439", "0.64584017", "0.64555895", "0.64398015", "0.6432262", "0.6398767", "0.63675475", "0.6363841", "0.63281494", "0.63097465", "0.63073856", "0.6296913", "0.6295587", "0.6286288", "0.6284835", "0.62831295", "0.6261856", "0.6235988", "0.6227568", "0.6223143", "0.6218059", "0.62119734", "0.62107575", "0.6186574", "0.6174831", "0.6161902", "0.615697", "0.61532813", "0.61165875", "0.6107896", "0.61060023", "0.61060023", "0.61059475", "0.61059433", "0.6105805", "0.6104012", "0.6103126", "0.61006206", "0.6096938", "0.60941094", "0.6088832", "0.60719264", "0.60712117", "0.60536957", "0.6051206", "0.6039143", "0.6037598", "0.60362077", "0.603604", "0.6035472", "0.6025822", "0.602316", "0.6020776", "0.60184854", "0.60029125", "0.6001069", "0.5995312", "0.5993172", "0.5985556", "0.5983717", "0.59759897", "0.59695923", "0.59679073", "0.5960739", "0.5958999", "0.5957868", "0.59575325", "0.5953768", "0.5949421", "0.59469754", "0.59469384", "0.5936669", "0.5935359", "0.59314805", "0.5928743", "0.59211177", "0.59053564", "0.5904812", "0.59038806", "0.5901976", "0.5901976", "0.5901976", "0.5901976", "0.5901976", "0.5901976" ]
0.62347394
33
Testing the experiment creation.
public function testCreateSubject() { echo "\nTesting Subject creation..."; $input = file_get_contents('subject.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "-----Create Response:".$response; $result = json_decode($response); $this->assertTrue(!$result->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testInstrumentCreate()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code',uniqid('TestInstrument_'))\n ->type('@category', 'Dusk Testing')\n ->type('@module','Summer Capstone')\n ->type('@reference','Test - safe to delete')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('View Instrument - TestInstrument_');\n });\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/authors/create')\n ->type('name', 'John')\n ->type('lastname', 'Doe')\n ->press('Save')\n ->assertPathIs('/authors')\n ->assertSee('John')\n ->assertSee('Doe');\n });\n }", "public function testIntegrationCreate()\n {\n $this->visit('user/create')\n ->see('Create New Account');\n $this->assertResponseOk();\n $this->assertViewHas('model');\n }", "public function testCreateChallengeActivityTemplate()\n {\n }", "public function testCreateScenario()\n {\n $client = static::createClient();\n }", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "public function testAdministrationCreateTraining()\n {\n // Used to fill hidden inputs\n Browser::macro('hidden', function ($name, $value) {\n $this->script(\"document.getElementsByName('$name')[0].value = '$value'\");\n\n return $this;\n });\n\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login())\n ->loginAsUser('[email protected]', 'password');\n\n $browser->assertSee('Formations')\n ->click('@trainings-link')\n ->waitForText('Aucune donnée à afficher')\n ->assertSee('Aucune donnée à afficher')\n ->clickLink('Ajouter formation')\n ->assertPathIs('/admin/training/create');\n\n $name = 'Test create training';\n\n $browser->type('name', $name)\n ->hidden('visible', 1)\n ->press('Enregistrer et retour');\n\n $browser->waitForText($name)\n ->assertSee($name)\n ->assertDontSee('Aucune donnée à afficher')\n ->assertPathIs('/admin/training');\n\n $browser->visit('/')\n ->assertSee('Pas de formation en groupe annoncée pour l\\'instant')\n ->assertDontSee($name);\n });\n }", "public function testCreateChallengeTemplate()\n {\n }", "public function testCreate()\n\t{\n\t\tRoute::enableFilters();\n\t\tEvaluationTest::adminLogin();\n\t\t$response = $this->call('GET', '/evaluation/create');\n\t\t\n\t\t$this->assertResponseOk();\n\n\t\tSentry::logout();\n\t\t\n\t\t//tesing that a normal user can't retrieve a form to create \n\t\t//an evaluation and that a page displays a message as to why they can't\n\t\tEvaluationTest::userLogin();\n\t\t$crawler = $this->client->request('GET', '/evaluation/create');\n\t\t$message = $crawler->filter('body')->text();\n\n\t\t$this->assertFalse($this->client->getResponse()->isOk());\n\t\t$this->assertEquals(\"Access Forbidden! You do not have permissions to access this page!\", $message);\n\n\t\tSentry::logout();\n\t}", "public function testCreateChallengeActivity()\n {\n }", "public function testQuarantineCreate()\n {\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Locator\\\\ResultSetInterface', $subject, 'Subject is not a valid locator result set');\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Test\\\\SourceInterface', $subject, 'Subject is not a valid test source');\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testWebinarCreate()\n {\n }", "public function testCreateChallenge()\n {\n }", "public function testCreate()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n\n $this->assertTrue($player_factory->wasRecentlyCreated);\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "protected function createTests()\n {\n $name = $this->getNameInput();\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Store{$name}Test\",\n '--model' => $name,\n '--type' => 'store',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Update{$name}Test\",\n '--model' => $name,\n '--type' => 'update',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/View{$name}Test\",\n '--model' => $name,\n '--type' => 'view',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Delete{$name}Test\",\n '--model' => $name,\n '--type' => 'delete',\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testGetChallengeActivityTemplate()\n {\n }", "public function testInstance() { }", "public function testCreate()\n {\n $this->visit('/admin/school/create')\n ->submitForm($this->saveButtonText, $this->school)\n ->seePageIs('/admin/school')\n ;\n\n $this->seeInDatabase('schools', $this->school);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }", "public function testCreateTestSuite()\n {\n Artisan::call('migrate');\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->seePageIs('/library')\n ->click('#newSuite')\n ->seePageIs('/library/testsuite/create')\n ->type('TestSuite1', 'name')\n ->type('someDescription', 'description')\n ->type('someGoals', 'goals')\n ->press('submit');\n\n $this->seeInDatabase('TestSuite', [\n 'Name' => 'TestSuite1',\n 'TestSuiteDocumentation' => 'someDescription',\n 'TestSuiteGoals' => 'someGoals'\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "protected function createTest()\n {\n $name = Str::studly($this->argument('name'));\n\n $this->call('make:test', [\n 'name' => 'Controllers\\\\' . $name . 'Test',\n '--unit' => false,\n ]);\n }", "public function testCreate()\n {\n $model = $this->makeFactory();\n \n $this->json('POST', static::ROUTE, $model->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_CREATED) \n ->seeJson($model->toArray());\n }", "public function testCreateAction()\n {\n $res = $this->controller->createAction();\n $this->assertContains(\"Create\", $res->getBody());\n }", "public function testInit()\n {\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(static::TEST_SUBJECT_CLASSNAME, $subject, 'A valid instance of the test subject could not be created.');\n $this->assertInstanceOf('OutOfRangeException', $subject, 'Subject is not a valid out of range exception.');\n $this->assertInstanceOf('Dhii\\Exception\\OutOfRangeExceptionInterface', $subject, 'Subject does not implement required interface.');\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function testJobAdd()\n {\n\n }", "public function testGetChallengeTemplate()\n {\n }", "public function testExample()\n {\n //make unauthorized user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/newcache')\n ->type('The best cache ever', 'name')\n ->type('94.234324234,-35.74352343', 'location')\n ->type('small', 'size')\n ->type('traditional', 'type')\n ->type('like fo reals this is short yo', 'short_description')\n ->type('like fo reals this is the longest description that could be possible yo. but I am a creative fellow \n and I need to express my art in the form of comments that is where I actually discuss the true meaning of \n life and that is death and sad because I am sad my gosh what has my life become I am the excessive of \n computer I am good my friend said so. ', 'long_description')\n ->press('Create')\n ->assertResponseStatus(403);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'Subject is not a valid instance.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Modular\\Module\\ModuleInterface',\n $subject,\n 'Test subject does not implement expected interface.'\n );\n }", "public function testCreate()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testCreateInstance() {\n $tamper_manager = \\Drupal::service('plugin.manager.tamper');\n $plugin_collection = new DefaultLazyPluginCollection($tamper_manager, []);\n foreach ($tamper_manager->getDefinitions() as $plugin_id => $plugin_definition) {\n // Create instance. DefaultLazyPluginCollection uses 'id' as plugin key.\n $plugin_collection->addInstanceId($plugin_id, [\n 'id' => $plugin_id,\n ]);\n\n // Assert that the instance implements TamperInterface.\n $tamper = $plugin_collection->get($plugin_id);\n $this->assertInstanceOf(TamperInterface::class, $tamper);\n\n // Add tamper instances to the entity so that the config schema checker\n // runs.\n $this->entity->setThirdPartySetting('tamper_test', 'tampers', $plugin_collection->getConfiguration());\n $this->entity->save();\n }\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME, $subject,\n 'Subject is not a valid instance'\n );\n }", "public function create_experiment( $project_id, $options ) {\n\t\tif ( ! isset( $options['description'] )\n\t\t || ! isset( $options['edit_url'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "public function testStorage()\n {\n // Test with correct field name\n $this->visit('/cube')\n ->type('First Cube', 'name')\n ->press('submit-add')\n ->see('created successfully');\n\n // Test with incorrect field name\n $this->visit('/cube')\n ->press('submit-add')\n ->see('is required');\n }", "public function testExample()\n {\n }", "public function testWebinarPollCreate()\n {\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function test___construct() {\n\t\t}", "public function test___construct() {\n\t\t}", "public function test()\n {\n $this->executeScenario();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $values = [\n 'number' => 'Bill',\n 'attachments' => __DIR__.'/test_image.jpg',\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ];\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'/bills/create')\n ->attach('attachments[]', $values['attachments'])\n ->type('number', $values['number'])\n ->select('contract_id', $values['contract_id'])\n ->select('requisite_id', $values['requisite_id'])\n ->type('services[0][name]', $values['name'])\n ->type('services[0][quantity]', $values['quantity'])\n ->type('services[0][measure]', $values['measure'])\n ->type('services[0][price]', $values['price'])\n ->press('Сохранить')\n ->assertPathIs('/tenants/'.$this->tenant->id)\n ->assertQueryStringHas('tab')\n ->assertFragmentIs('tab')\n ->assertSee($values['number']);\n });\n }", "protected function createFeatureTest()\n {\n $model_name = Str::studly(class_basename($this->argument('name')));\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:test', [\n 'name' => \"{$model_name}Test\",\n ]);\n\n $path = base_path() . \"/tests/Feature/{$model_name}Test.php\";\n $this->cleanupDummy($path, $name);\n }", "public function setUp()\n {\n\n parent::setUp();\n\n // Create a default exhibit.\n $this->exhibit = $this->_exhibit();\n\n }", "public function testProfileCreate()\n {\n\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "protected function _initTest(){\n }", "public function testBasics() {\n\t\t$model = new AElasticRecord;\n\t\t$model->id = 123;\n\t\t$model->name = \"test item\";\n\t\t$this->assertEquals(123, $model->id);\n\t\t$this->assertEquals(\"test item\",$model->name);\n\t}", "public function testCreateSite()\n {\n }", "public function run()\n {\n $projectNum = Project::count();\n $faker = Faker::create();\n $project_limit=require('Config.php');\n for($i=1;$i<=$projectNum;$i++)\n {\n if($i%200 ==0)\n $this->command->info('Test Suite Seed :'.$i.' out of: '.$projectNum);\n $TestsTestArch = DB::table('project_assignments')->select('user_id','role_id')->\n where([['project_id','=',$i]])->\n whereIn('role_id',[7,8,9])->get();\n //let's say Tester, Test Lead and Test Architect together create around 20-40 folder per projects\n $numberOfTestSuites = rand($project_limit['projects']['min_test_suite'],$project_limit['projects']['max_test_suite']);\n for($j=0;$j<$numberOfTestSuites;++$j)\n {\n TestSuite::create(array(\n 'project_id'=>$i,\n 'name'=>$faker->sentence(4),\n //let's say only 90% of Test Suite have description\n 'description'=>rand(0,100)<80?$faker->paragraph(6):null,\n 'creator_id'=>$faker->randomElement($TestsTestArch)->user_id\n ));\n }\n }\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function run()\n {\n $count = 10;\n $this->command->info(\"Creating {$count} Testimonies.\");\n factory(App\\Testimonies::class, $count)->create();\n $this->command->info('Testimonies Created!');\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', '[email protected]')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }", "public function testCreateNewEpisode()\n {\n Channel::create([\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n\n $this->seeInDatabase('channels', [\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n }", "abstract protected function constructTestHelper();", "public function run()\n {\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Colossus'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Steven'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Capybaby'\n ]);\n }", "function a_user_can_be_created(){\n\n $profession = factory(Profession::class)->create([\n 'title' => 'Web Developer'\n ]);\n $skillA = factory(Skill::class)->create([\n 'description' => 'CSS'\n ]);\n $skillB = factory(Skill::class)->create([\n 'description' => 'HTML'\n ]);\n\n $this->browse(function(Browser $browser) use ($profession,$skillA,$skillB){\n $browser->visit('users/create')\n ->assertSeeIn('h5','Create User')\n ->type('name','Yariel Gordillo')\n ->type('email','[email protected]')\n ->type('password','secret')\n ->type('bio','This a small bio')\n ->select('profession_id',$profession->id)\n ->type('twitter' ,'https://twitter.com/yariko')\n ->check(\"skills[{$skillA->id}]\")\n ->check(\"skills[{$skillB->id}]\")\n ->radio('role', 'user')\n ->press('Create User')\n ->assertPathIs('/users')\n ->assertSee('Yariel Gordillo')\n ->assertSee('[email protected]');\n });\n\n }", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "public function testCreate()\n {\n $aircraft = new Aircraft();\n $this->assertFalse($aircraft->save());\n\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $this->assertTrue($aircraft->save());\n }", "public function testBasicTest()\n {\n $test = Test::create([\n 'title' =>'title',\n 'about' => 'about',\n 'timer' => null,\n 'full_result' => false,\n ])->fresh();\n dd($test->version->id);\n }", "protected function setUp() \n {\n $this->object = new Exam(); \n }", "public function run()\n {\n $labOrder = factory(LabOrder::class)->create();\n $SKUs = SKU::where('item_type', 'lab-test')->get()->shuffle();\n\n for ($i=0; $i < 5; $i++) {\n $labTest = factory(LabTest::class)->create([\n 'lab_order_id' => $labOrder->id,\n 'sku_id' => $SKUs->pop()->id,\n ]);\n if (maybe()) {\n factory(LabTestResult::class)->create([\n 'lab_test_id' => $labTest->id,\n ]);\n }\n }\n }", "public function testGetChallengeActivityTemplates()\n {\n }", "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testCanBeCreated()\n {\n $subject = new Iteration('', '');\n\n $this->assertInstanceOf(\n 'Dhii\\\\Iterator\\\\IterationInterface',\n $subject,\n 'Subject does not implement expected parent.'\n );\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateContador()\n {\n }", "public function testCreate()\n {\n\n $this->createDummyPermission(\"1\");\n $this->createDummyPermission(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc,\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n 'permission1' => 2\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function run()\n {\n factory(societe_has_stage::class, 50)->create();\n }", "public function testWebinarRegistrantCreate()\n {\n }", "public function testCreate()\n {\n $this->specify(\"we want to add the history record\", function () {\n /** @var History $history history record */\n $history = Yii::createObject('inblank\\team\\models\\History');\n expect(\"we can't add the history without team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 999;\n $history->user_id = 999;\n expect(\"we can't add the history with not existing team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 1;\n $history->user_id = 2;\n expect(\"we can't add the history if user not in team\", $history->save())->false();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->user_id = 1;\n expect(\"we can't add the history without action\", $history->save())->false();\n expect(\"we must see error message `action`\", $history->getErrors('action'))->notEmpty();\n $history->action = History::ACTION_ADD;\n expect(\"we can add the history\", $history->save())->true();\n });\n }", "public function run()\n {\n factory(\\App\\challenge::class, function (Faker\\Generator $faker) {\n $type = ['Web', 'Re', 'Pwn', 'Crypto', 'Misc'];\n\n return [\n 'title' => $faker->title,\n 'class' => $faker->randomElement($type),\n 'description' => $faker->realText($maxNbChars = 100),\n 'url' => $faker->url,\n 'flag' => $faker->sha256,\n 'score' => $faker->numberBetween($min = 1, $max = 100),\n ];\n });\n }", "public function testWebinarPanelistCreate()\n {\n }", "public function testCreate()\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $factory = new components\\Factory();\n //Success\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"gitlab\"), new components\\platforms\\Gitlab([]));\n $this->assertEquals($factory->create(\"bitbucket\"), new components\\platforms\\Bitbucket([]));\n //Exception Case\n $this->expectException(\\LogicException::class);\n $platform = $factory->create(\"Fake\");\n\n }", "public function testEventCreate()\n {\n $response = $this->get('events/create');\n\n $response->assertStatus(200);\n }", "public function testCreatePatrimonio()\n {\n }", "public function testCreateTimesheet()\n {\n }", "public function run()\n {\n factory(App\\Work::class)->create([\n 'title' => 'Paseo Boulevard',\n 'content' => 'El intendente José Corral presentó a los vecinos el proyecto de remodelación del Paseo Boulevard en febrero de 2016. Las obras de puesta en valor comprenden desde el Puente Colgante hasta Avenida Freyre, priorizan la circulación peatonal por sobre la actividad vehicular. ',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class)->create([\n 'title' => 'Remodelación de la Avenida Blas Parera',\n 'content' => 'La avenida contará con un corredor exclusivo para transporte público de pasajeros urbano y metropolitano en el centro de la traza, en ambos sentidos de circulación, además de una ciclovía. Esa avenida-ruta -que fue centro de tantos reclamos durante años- modificará completamente su fisonomía a lo largo de casi 6 km.',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class, 10)->create();\n }", "public function testCreateExpedicao()\n {\n }", "protected function setUp() {\n\t$this->object = new Competition(20);\n\t$this->assertNotNull($this->object);\n }", "public function testAddTemplate()\n {\n\n }", "protected function setUp() {\n parent::setUp();\n $this->cleanUpAll();\n\n\n $this->institution = new Institution();\n $this->institution->setName('San Francisco State University');\n $this->institution->setAbbreviation(\"SFSU\");\n $this->institution->setCity('San Francisco');\n $this->institution->setStateProvince('CA');\n $this->institution->setCountry('USA');\n $this->institution->save();\n\n $this->oldInstitution = new Institution();\n $this->oldInstitution->setName('Punjabi University');\n $this->oldInstitution->setAbbreviation(\"PU\");\n $this->oldInstitution->setCity('Patiala');\n $this->oldInstitution->setStateProvince('PB');\n $this->oldInstitution->setCountry('INDIA');\n $this->oldInstitution->save();\n\n\n $this->project = new PersistentProject();\n $this->project->setProjectJnName(\"ppm-8\");\n $this->project->setSummary(\"Infinity Metrics\");\n $this->project->save();\n\n $this->oldProject = new PersistentProject();\n $this->oldProject->setProjectJnName(\"ppm\");\n $this->oldProject->setSummary(\"paticipation metrics\");\n $this->oldProject->save();\n\n $this->instructor = UserManagementController::registerInstructor(self::USERNAME,\"PASSWORD\" ,\"[email protected]\",\n \"firstname\", \"lastname\",$this->oldProject->getProjectJnName(),true,\n $this->oldInstitution->getAbbreviation(), \"Teacher1\");\n }", "public function run()\n {\n factory(App\\Subject::class,'assessment',3)->create();\n factory(App\\Group::class,'assessment',3)->create();\n factory(App\\Student::class,'assessment',14)->create();\n factory(App\\Assessment::class,'assessment',40)->create();\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testInstrumentCreateFail()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n\n //Trying when leaving the Code field empty\n //->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Category field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n //->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Module field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n //->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n });\n }", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function preTesting() {}" ]
[ "0.80771506", "0.65540594", "0.6533857", "0.63267875", "0.6290049", "0.62855506", "0.62106407", "0.6200179", "0.6197811", "0.6186913", "0.6175659", "0.6159984", "0.6157745", "0.61525404", "0.6121399", "0.61126214", "0.6111783", "0.6111783", "0.6093513", "0.608522", "0.60782385", "0.60774946", "0.60774946", "0.6055844", "0.6050206", "0.60463905", "0.60179496", "0.60169053", "0.5986531", "0.5976364", "0.5954233", "0.5954233", "0.5954233", "0.59255093", "0.5916776", "0.59063303", "0.59027743", "0.5901736", "0.5900679", "0.58958554", "0.5891082", "0.5879167", "0.5878502", "0.5867602", "0.58618593", "0.5851111", "0.583439", "0.5832492", "0.58278745", "0.58258224", "0.581963", "0.58188426", "0.58188426", "0.5815109", "0.5797702", "0.5797528", "0.5796573", "0.578243", "0.5772514", "0.5764459", "0.57618064", "0.57605475", "0.57603014", "0.5758484", "0.5757235", "0.575615", "0.57536525", "0.5749704", "0.57485026", "0.5741249", "0.5735922", "0.5735047", "0.5732731", "0.5728993", "0.57273436", "0.57255304", "0.5719995", "0.5719668", "0.571335", "0.571335", "0.57094276", "0.5709378", "0.5708647", "0.57081753", "0.5704266", "0.5692782", "0.5690044", "0.5689411", "0.56891274", "0.56809604", "0.56803447", "0.5675097", "0.56629986", "0.56611145", "0.5659524", "0.5654173", "0.5652156", "0.56491727", "0.56484735", "0.5636983", "0.563574" ]
0.0
-1
Testing the subject listing
public function testListSubjects() { echo "\nTesting subject listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSearchSubject()\n {\n echo \"\\nTesting subject search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "public function testGetAuthorizationSubjectsMe()\n {\n }", "public function testGetAuthorizationSubjectsRolecounts()\n {\n }", "public function subjectList()\n\t{\n\t\t$data = array();\n\t\t$subjects = (object) $this->subjects->fetchData();\n\n\t\tif($subjects)\n\t\t{\n\t\t\tforeach ($subjects as $subject) {\n\t\t\t\t$lab_unit = '';\n\t\t if (!empty($subject['lab_unit'])) {\n\t\t $lab_unit = $subject['lab_unit'];\n\t\t }\n\t\t $data[] = array(\n\t\t 'subj_id'=>$subject['subj_id'],\n\t\t 'subj_code'=>$subject['subj_code'],\n\t\t 'subj_name'=>$subject['subj_name'],\n\t\t 'subj_desc'=>$subject['subj_desc'],\n\t\t 'lec_unit'=>$subject['lec_unit'],\n\t\t 'lab_unit'=>$lab_unit,\n\t\t 'lec_hour'=>$subject['lec_hour'],\n\t\t 'lab_hour'=>$subject['lab_hour'],\n\t\t 'split' =>$subject['split'],\n\t\t 'subj_type' =>$subject['subj_type'],\n\t\t 'type'=> $subject['subj_type']\n\t\t );\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\techo json_encode($data);\n\t}", "public function Course_subjects_list(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/course_module_list';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Lodnontec course Subject List',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t\t'course_subjects' =>$this->setting_model->Get_All('course_module_subject'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function testGetAuthorizationDivisionspermittedSubjectId()\n {\n }", "public function testListExperts()\n {\n }", "abstract public function get_subject();", "public function testGetSubject()\n {\n $subject = $this->createInstance(['_getSubject']);\n $_subject = $this->reflect($subject);\n $arg = uniqid('subject-');\n\n $subject->expects($this->exactly(1))\n ->method('_getSubject')\n ->will($this->returnValue($arg));\n\n $result = $subject->getSubject();\n $this->assertEquals($arg, $result, 'Subject did not retrieve required exception subject');\n }", "public function testDeleteSubject()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testGetAuthorizationSubject()\n {\n }", "public function testMailingList() {\n\t}", "public function testPostAuthorizationSubjectBulkadd()\n {\n }", "public function getSubjects() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT * FROM tblsubject ORDER BY Description ASC\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Find if a page exists for subject\n\t\t\t$subjects = array();\n\t\t\t$subject_ids = array();\n\t\t\t$i = 0; // array counter\n\t\t\twhile ($sql->next_record()) {\n\t\t\t\t$subject_ids[] = $sql->Record['ID'];\n\t\t\t\t$subjects[$i]['ID'] = $sql->Record['ID'];\n\t\t\t\t$subjects[$i]['Description'] = $sql->Record['Description'];\n\t\t\t\t$subjects[$i]['Exists'] = $this->pageExists($sql->Record['ID']);\n\t\t\t\t$subjects[$i]['Active'] = $this->getPageActive($sql->Record['Description']);\n\t\t\t\t$stats = $this->getSubjectStats($sql->Record['ID']);\n\t\t\t\t$subjects[$i]['No_Pages'] = $stats['pages'];\n\t\t\t\t$subjects[$i]['No_Courses'] = $stats['courses'];\n\t\t\t\t$subjects[$i]['No_News_Events'] = $stats['news_events'];\n\t\t\t\t$subjects[$i]['Valid_STC'] = (in_array($sql->Record['ID'],$this->valid_subject_codes)) ? TRUE : FALSE;\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$missing_subjects = array();\n\t\t\tforeach ($this->valid_subject_codes as $title => $topic_code) {\n\t\t\t\t// If a valid subject topic code is not found in the subjects table, add it\n\t\t\t\tif (!in_array($topic_code, $subject_ids)) {\n\t\t\t\t\t// Add Subject to tblsubject\n\t\t\t\t\t$query = \"INSERT INTO tblsubject VALUES ('$topic_code','$title')\";\n\t\t\t\t\t$sql->query($query, $this->debug);\n\t\t\t\t\tif ($sql->num_rows_affected() > 0) {\n\t\t\t\t\t\t// Success\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"Error adding $title to subjects table\";\n\t\t\t\t\t\texit;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // foreach\n\t\t\t\n\t\t\treturn $subjects;\n\n\t\t}", "public function index()\n {\n //\n return $this->respond($this->_repo->subjects());\n }", "public function get_seubjects_list(){\n\t\t$this->verify();\n\t\t$subjects=$this->admin_model->fetch_subjects_list($_GET['search']);\n\t\tforeach ($subjects as $key => $value) {\n\t\t\t$data[] = array('id' => $value['SUBJECT_ID'], 'text' => $value['SUBJECT']);\t\t\t \t\n \t\t}\n\t\techo $officers=json_encode($data);\n\t}", "public function actionList()\n {\n $model = new SubjectPreg();\n $params = \\Yii::$app->request->getBodyParams();\n// var_dump($params);exit;\n $dataProvider = $model->searchList($params);\n\n return $this->renderList('list', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(Subject $subject)\n {\n \n }", "public function testListPeople()\n {\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function show(Subject $subject)\n {\n //\n }", "public function test_all_item_listed_or_no_listed_items_message_is_displayed()\n {\n $response = $this->get('/');\n if($response->assertSeeText(\"Details\")){\n $response->assertDontSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n } else {\n $response->assertSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n }\n }", "public function testListPastWebinarQA()\n {\n }", "public function getSubject()\n {\n }", "public function init() {\n\n\t\t//CHECK SUBJECT\n if (Engine_Api::_()->core()->hasSubject())\n return;\n\n\t\t//SET LISTING SUBJECT\n if (0 != ($listing_id = (int) $this->_getParam('listing_id')) &&\n null != ($list = Engine_Api::_()->getItem('list_listing', $listing_id))) {\n Engine_Api::_()->core()->setSubject($list);\n }\n }", "public function testManyDisciplineNameReturn()\n {\n $result = false;\n $student = new StudentProfile();\n $course = new Course();\n $course->set(\"department\",\"MUSI\");\n $student->set(\"courses\",$course);\n $course2 = new Course();\n $course2->set(\"department\",\"CPSC\");\n $student->set(\"courses\",$course2);\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 1 && $status[\"result\"] == true && $status[\"dept\"] == (\"MUSI,CPSC\"))\n $result = true;\n $this->assertEquals(true, $result);\n }", "function selectParticularSubject($subject) {\n if ($subject === 'none') {\n print 'Nenurodyta';\n }\n if ($subject === 'complains') {\n print 'Skundai';\n }\n if ($subject === 'questions') {\n print 'Klausimai';\n }\n}", "#[@test]\n public function withSubject() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation :subject \"Out of office\" \"I\\'ll be back\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertEquals('Out of office', $action->subject);\n $this->assertEquals('I\\'ll be back', $action->reason);\n }", "function subject($subject = '')\n\t{\n\t\tif (!$subject)\n\t\t\treturn FALSE;\n\t\t\t\n\t\t$this->subject = $subject;\n\t}", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public\tfunction load_subjects()\n\t\t{\n\t\t\tglobal $connection, $subjects_rows, $retrieved;\n\t\t\t\n\t\t\t$sql = \"call load_subjects()\";\n\t\t\t$connection->next_result();\n\t\t\t$retrieved = $connection -> query( $sql );\n\t\t\t\n\t\t\tif ( $retrieved ->num_rows )\n\t\t\t{\n\t\t\t\t$subjects_rows = $retrieved -> fetch_all( MYSQLI_ASSOC );\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tdie('Database Query Failed loading subjects');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}", "public function testBuild()\n {\n $case = new \\ParserCase();\n $subjects = $this->parser->buildSubjects($case);\n $this->assertContainsOnlyInstancesOf('PhpBench\\\\Benchmark\\\\Subject', $subjects);\n $this->assertCount(2, $subjects);\n $subject = reset($subjects);\n\n $this->assertEquals(array('group1'), $subject->getGroups());\n $this->assertEquals(array('beforeSelectSql'), $subject->getBeforeMethods());\n $this->assertEquals(array('provideNodes', 'provideColumns'), $subject->getParameterProviders());\n $this->assertEquals(3, $subject->getNbIterations());\n $this->assertInternalType('int', $subject->getNbIterations());\n $this->assertEquals('Run a select query', $subject->getDescription());\n }", "public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "function getContactUsSubjects() {\n return array(\n '0' => 'I would like to know the advertising prices',\n '1' => 'I would like to know how to create my profile',\n '2' => 'I would like to make a booking with an escort',\n '3' => 'Problems logging in',\n '4' => \"I didn't recieve my activation email\",\n '5' => 'Technical Support',\n '6' => 'Other'\n );\n}", "abstract protected function getSubject();", "function isValidSubject($subject){\n $qh = new QueryHelper();\n\n $columnName = \"SubjectName\";\n $selectSubject = \"SELECT * FROM Subject;\";\n if($qh -> verifyDropDownInput($subject, $selectSubject, $columnName)){\n return true;\n }\n else{\n return false;\n }\n }", "public function test_admin_tribe_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }", "public function testListMembers()\n {\n }", "public function testListEnrollmentRequests()\n {\n }", "public function subjectClick ()\n {\n $aid = $_REQUEST[\"msgid\"];\n $stat = $_REQUEST['stat'];\n $this->createUser();\n if ($stat == '0') {\n $this->_objUser->changestatus($aid);\n list ($messages, $result2) = $this->_objUser->messageBody($aid);\n \n $this->showSubViews(\"MessageBody\", $messages, $result2);\n } else {\n \n list ($messages, $result2) = $this->_objUser->messageBody($aid);\n \n $this->showSubViews(\"MessageBody\", $messages, $result2);\n }\n }", "function find_all_subjects($public = true) {\r\n\t\tglobal $db;\r\n\r\n\t\t$query = \"SELECT * \";\r\n\t\t$query .= \"FROM subjects \";\r\n\t\tif($public) {\r\n\t\t$query .= \"WHERE visible = 1 \";\r\n\t\t}\r\n\t\t$query .= \"ORDER BY position ASC\";\r\n\r\n\t\t$subject_set = mysqli_query($db, $query);\r\n\t\tconfirm_query($subject_set);\r\n\r\n\t\treturn $subject_set;\r\n\t}", "public function subject($subject);", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function index()\n {\n $subjects = Subject::all();\n\n\n return view('subject.list')->withSubjects($subjects);\n }", "public function show(subjects $subjects)\n {\n //\n }", "public function subjects($id='list'){\n\t\t$this->verify();\n\t\t$data['title']=\"Subjects\";\n\t\t$data['subjects']=$this->admin_model->get_subjects();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('subjects/subjects', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}", "public function loadMySubjects()\n {\n $logged_email = Auth::user()->email;\n $instructor_id = Instructor::where('email', $logged_email)->first()->id;\n $instructor = Instructor::find($instructor_id);\n\n $subjects = Subject::orderBy('code')->pluck('name', 'id');\n \n return view('subjects.instructor-own', ['instructor' => $instructor, 'subjects' => $subjects]);\n }", "protected function setSubject() {}", "public function subject($param1 = '', $param2 = ''){\n\n\t\tif($param1 == 'list'){\n\t\t\t$page_data['class_id'] = $param2;\n\t\t\t$this->load->view('backend/student/subject/list', $page_data);\n\t\t}\n\n\t\tif(empty($param1)){\n\t\t\t$page_data['folder_name'] = 'subject';\n\t\t\t$page_data['page_title'] = 'subject';\n\t\t\t$this->load->view('backend/index', $page_data);\n\t\t}\n\t}", "public function testManipulationCollection() {\n $this->assertEquals(true, $this->subject->isEmpty());\n $this->assertTrue($this->subject->size() == 0);\n //adding items\n $this->subject->add(\"Marcello\");\n $this->subject->add(\"de Sales\");\n //asserting the size of the collection changed and is not empty\n $this->assertTrue($this->subject->size() == 2);\n $this->assertEquals(false, $this->subject->isEmpty());\n //verifying the elements\n $this->assertTrue($this->subject->contains(\"Marcello\"));\n $this->assertTrue($this->subject->contains(\"de Sales\"));\n }", "public function testSubscriptionsList()\n {\n }", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "public function showsubjectsAction() { \r\n $subjects = $this->getDoctrine()\r\n ->getRepository(Subject::class)\r\n ->findAll();\r\n\r\n foreach ($subjects as $subject) {\r\n $subject->getClassroom();\r\n $subject->getTeacher();\r\n }\r\n\r\n return $this->render('admin/admin-subject/adminSubjectDashboard.html.twig', [\r\n 'subjects' => $subjects,\r\n ]);\r\n }", "public function set_subject($subject);", "public function test_that_a_parent_enrollment_only_appears_once_in_students_lists()\n {\n }", "public static function getSubjectList()\n {\n return self::pluck('name', 'id');\n }", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function getSubject();", "public function testGetStudentTakesCourseList()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->get($this->url('student-courses'));\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'data' => [\n [\n 'student_id',\n 'staff_teach_course_id'\n ]\n ]\n ]);\n }", "public function test_admin_certification_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'certification_programs']);\n $this->assertResponseCode(404);\n }", "public function hasSubject(): bool;", "public function testListCategories()\n {\n }", "private function createSubject()\n {\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "function _setSubjectMenu() {\n\t\t$this->loadModel('Subject');\n\t\t$subjects = $this->Subject->find('threaded');\n\t\t$this->set('subjects', $subjects);\n\t}", "function list_subjects($objet) {\n\t// Filter by text exists\n\t\t$condition = (!empty($objet['text'])) ? \n\t\t\t\t\t' AND (vchCodigoMateria LIKE \\'%'.$objet['text'].'%\\'\n\t\t\t\t\t\t\tOR vchMateria LIKE \\'%'.$objet['text'].'%\\')' : '';\n\n\t\t$sql = \"SELECT \n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\tcat_materia \n\t\t\t\tWHERE\n\t\t\t\t\t1 = 1 \".\n\t\t\t\t$condition;\n\t\t$result = $this -> query_array($sql);\n\t\t\n\t\treturn $result;\n\t}", "public function subjects_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n if(is_null($search))\n $result = $sutil->getSubject($id,$from,$size);\n else \n {\n $result = $sutil->searchSubjects($search,$from,$size);\n }\n $this->response($result);\n }", "public function test_that_users_can_view_individual_topics()\n {\n $topic = Topic::factory()->create();\n\n $this->get(route('topics.show', $topic))\n ->assertSee($topic->title)\n ->assertSee($topic->description);\n }", "public function getSubject(): string;", "abstract function getSubject() : string;", "public function testGetSurveys0()\n {\n }", "public function testGetSurveys0()\n {\n }", "public function index()\n {\n $subjects = Subject::all();\n $qualifications = Qualification::all();\n return view('admin.subjects.subjectsList',compact('subjects','qualifications'));\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "public function index()\n {\n return new SubjectCollection(Subject::all());\n }", "public function test_admin_tribe_list_b()\n {\n $this->request('GET', ['pages/Assignments', 'tribe_list']);\n $this->assertResponseCode(404);\n }", "public function testListPastWebinarPollResults()\n {\n }", "abstract public function subject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function index()\n {\n return Subjects::all();\n }", "public function index(SubjectIndex $request)\n {\n return map_collection(Subject::all());\n }", "public function index(Request $request, FormBuilder $formBuilder,$page=null)\n\t{\n\t\t$subjectList = new SubjectList($request,$this->main_page,$page);\n\t\t\n\t\t$keys = $subjectList->getKeys();\n\t\t$data_arr = $subjectList->getDataArr();\n\t\t$paginationForm = $subjectList->getPaginationForm();\n\t\t$filter = session('subject_filter');\n\t\tsession(['attribute' => \\Lang::get('general.SUBJECT')]);\n\t\t\n\t\t$form_filter = $formBuilder->create('App\\Filters\\SubjectFilter', [\n\t\t\t'method' => 'PATCH',\n\t\t\t'action' => ['SubjectController@index'],\n\t\t\t'model' => $filter,\n\t\t\t'class' => 'form-inline'\n\t\t]);\n\t\t\n\t\treturn view('list', [\n\t\t\t\t\t\t\t\t'controller' => 'SubjectController',\n\t\t\t\t\t\t\t\t'data_arr' => $data_arr,\n\t\t\t\t\t\t\t\t'keys' => $keys,\n\t\t\t\t\t\t\t\t'perm_path' => $this->main_page,\n\t\t\t\t\t\t\t\t'path' => $this->main_page,\n\t\t\t\t\t\t\t\t'title' => 'SUBJECTS',\n\t\t\t\t\t\t\t\t'filter' => $form_filter,\n\t\t\t\t\t\t\t\t'pagination' => $paginationForm,\n\t\t\t\t\t\t\t\t'add' => true,\n\t\t\t\t\t\t\t\t'additional_info' => false,\n 'back' => false,\n 'parent_table_id' => false\n\t\t\t\t\t\t\t]);\n\t}", "public function testListSiteMembershipRequestsForPerson()\n {\n }", "public function testPostAuthorizationSubjectBulkremove()\n {\n }", "public function test_rangLista()\n\t{\n\t\t$output = $this->request('GET', ['UserController','rangLista']);\n\t\t$this->assertContains('<h3 class=\"text-center text-dark\"><i>Običan korisnik -> Rang lista</i></h3>\t', $output);\n\t}", "function printSubjects($para){\n\t\t$th = json_decode($para);\n\t\tforeach($th as $t){\n\t\t\techo $t;\n\t\t}\n\t}", "function stp_getSubject($date_to_use='now') {\r\n\r\n\t// Array of Christian Science Bible Lesson subjects \r\n\t$cs_lesson_subjects = array(\r\n\t\t__('God', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Sacrament', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Life', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Truth', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Love', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Spirit', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mind', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christ Jesus', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Substance', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Matter', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Reality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Unreality', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Are Sin, Disease, and Death Real?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Doctrine of Atonement', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Probation After Death', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Everlasting Punishment', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Adam and Fallen Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Mortals and Immortals', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Soul and Body', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Ancient and Modern Necromancy, <i>alias</i> Mesmerism and Hypnotism, Denounced', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Only Cause and Creator', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('God the Preserver of Man', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Is the Universe, Including Man, Evolved by Atomic Force?', 'christian-science-bible-lesson-subjects'),\r\n\t\t__('Christian Science', 'christian-science-bible-lesson-subjects')\r\n\t\t);\r\n\t\r\n\t// repeat the array since lesson subjects are repeated twice a year in the same order\r\n\t$cs_lesson_subjects = array_merge($cs_lesson_subjects, $cs_lesson_subjects);\r\n\r\n\t// Bonus lesson for years with 53 Sundays\r\n\t$cs_lesson_subjects[] = __('Christ Jesus', 'christian-science-bible-lesson-subjects');\r\n\t\r\n\t// Add a blank entry to the front of the array so we're matching week 1 = [1]\r\n\tarray_unshift($cs_lesson_subjects, \"\");\r\n\r\n\t// Get the lesson for the upcoming next Sunday for any given date\r\n // Use strftime('%U, ...) not date(\"W\", ...) in order to get weeks of the year using Sunday as starting day, not Monday\r\n\t$week_num_sun = (int) strftime('%U', strtotime('next Sunday ' . $date_to_use));\r\n\r\n\treturn $cs_lesson_subjects[$week_num_sun];\r\n\r\n}", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testUpdateSubject()\n {\n echo \"\\nTesting subject update...\";\n $id = \"0\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('subject_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function testListSiteMemberships()\n {\n }" ]
[ "0.7150568", "0.6835536", "0.6827731", "0.6740685", "0.6314994", "0.630082", "0.62982154", "0.61793965", "0.6175428", "0.6151272", "0.6118109", "0.6099513", "0.60254", "0.6021194", "0.6016612", "0.59747297", "0.59371346", "0.5911985", "0.59065306", "0.58826673", "0.5865573", "0.585488", "0.585488", "0.585488", "0.585488", "0.58522236", "0.58257914", "0.5825052", "0.5822553", "0.58152634", "0.5811606", "0.5809654", "0.5800587", "0.57964796", "0.5795763", "0.57856905", "0.57666755", "0.5766009", "0.5757513", "0.5751262", "0.57467836", "0.5735515", "0.5720996", "0.56659424", "0.56594396", "0.56588435", "0.5645375", "0.56359404", "0.5625403", "0.5622965", "0.55885524", "0.5585682", "0.5580827", "0.55799127", "0.5578271", "0.5577024", "0.55721176", "0.5563633", "0.55627954", "0.5551491", "0.55508834", "0.55508834", "0.55508834", "0.55508834", "0.55508834", "0.55508834", "0.55508834", "0.55500257", "0.5538368", "0.5531804", "0.55280924", "0.5527329", "0.5522331", "0.5521927", "0.5520287", "0.5520233", "0.55147916", "0.5513853", "0.55132174", "0.55132174", "0.5509597", "0.55042195", "0.5502552", "0.5490305", "0.54880124", "0.54873925", "0.5482667", "0.5482667", "0.5482667", "0.54811466", "0.548091", "0.5478998", "0.5478153", "0.54766047", "0.54763055", "0.54702973", "0.54692054", "0.5464173", "0.5462903", "0.5462497" ]
0.79010934
0
Testing the experiment retreival by ID
public function testGetSubjectByID() { echo "\nTesting the subject retrieval by ID..."; $response = $this->getSubject("20"); //echo $response; $result = json_decode($response); $sub = $result->Subject; $this->assertTrue((!is_null($sub))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "private function getExperiment($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/experiments/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function experiments_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n $result = null;\n if(is_null($search))\n $result = $sutil->getExperiment($id,$from,$size);\n else \n {\n $result = $sutil->searchExperiments($search,$from,$size);\n }\n $this->response($result);\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function get_experiment( $experiment_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function testUpdateExperiment()\n {\n echo \"\\nTesting experiment update...\";\n $id = \"0\";\n \n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('exp_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id.\"?owner=wawong\";\n \n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function test_getById() {\n\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "function get_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getExperiment($expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n\n}", "public function test_byinstanceid_route() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n $this->assertContains('<h2>Talkpoint activity name</h2>', $client->getResponse()->getContent());\n }", "private function getCurrentExperiment() {\n\t\tif(isset($_SESSION) && isset($_SESSION['experiment'])) {\n\t\t\t$iExperimentId = (int) $_SESSION['experiment'];\n\t\t} else {\n\t\t\techo $this->_translator->error_experiment;\n\t\t\texit();\n\t\t}\n\t\treturn $iExperimentId;\n\t}", "public function imodAction ()\r\n {\r\n $request = $this->getRequest();\r\n $params = array_diff($request->getParams(), $request->getUserParams());\r\n \r\n $sessional = new Acad_Model_Test_Sessional($params);\r\n $sessional->setTest_info_id($params['id']);\r\n $result = $sessional->save();\r\n if ($result) {\r\n echo 'Successfully saved!! Test Id :'.var_export($result, true);\r\n }\r\n }", "public function testGetSingleHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for id=3\r\n\t\t$response= $this->http->request('GET','api/v1/hospital/3');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Test single element\r\n\t\t$jsonPHP=json_decode($response->getBody());\r\n\t\t$this->assertCount(1, $jsonPHP);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function experiments_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteExperiment($id);\n $this->response($result); \n }", "public function testElementMatchingWithID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function testGetDocumentByID()\n {\n echo \"\\nTesting the document retrieval by ID...\";\n $response = $this->getDocument(\"CCDB_2\");\n //echo $response;\n $result = json_decode($response);\n $exp = $result->CIL_CCDB;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\t\n\t\t$this->stubedGene->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGene->getId () );\n\t}", "public function actionGetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n // Get to da responsa!\n $this->sendSuccessResponse($exercise->getExerciseTests()->getValues());\n }", "public function getExperimentID() {\n return $this->_experiment_id;\n }", "public function renderTestDetails($id=null,$testKey=''){\n try{\n $breTest=$this->breTestsFacade->findBreTest($id);\n }catch (\\Exception $e){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($testKey);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n }\n if ($breTest->user->userId!=$this->user->getId()){\n throw new ForbiddenRequestException($this->translator->translate('You are not authorized to access selected experiment!'));\n }\n\n $this->template->breTest=$breTest;\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getById($id) {\r\n return $this->testcaseEntity->find($id);\r\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function testGetSitesTestsByID()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->testsController->shouldReceive('retrieve')->once()->andReturn('Get Test 2 or site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTests(array(1, 'tests', 2));\n $this->assertEquals('Get Test 2 or site 1 Mocked', $output);\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function testGetReplenishmentById()\n {\n }", "public function testQuestionEditExistingID() {\n $response = $this->get('question/' . $this->question->id . '/edit');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public static function getAcceptanceTest($id){\n $db = DemoDB::getConnection();\n ProjectModel::createViewCurrentIteration($db);\n $sql= \"select description,is_satisfied\n from feature\n INNER Join acceptance_test on feature.id = acceptance_test.feature_id\n INNER join acceptance_test_status on acceptance_test.id = acceptance_test_status.acceptance_test_id\n where feature.id=:id;\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "protected function _test_byinstanceid_route($id) {\n $client = new Client($this->_app);\n $client->request('GET', '/' . $id);\n $this->assertTrue($client->getResponse()->isOk());\n $this->assertRegExp('/<h2>Community wall [1-3]{1}<\\/h2>/', $client->getResponse()->getContent());\n $this->assertContains('Header goes here', $client->getResponse()->getContent());\n $this->assertContains('Footer goes here', $client->getResponse()->getContent());\n }", "public function actionTest($id=0) {\n //(new Start)->test(); \n //echo \"End \" . $this->udate('Y-m-d H:i:s.u T'); \n //$vr=[];\n \n if ($id>0){\n echo \"bolshe\";\n } else {\n echo \"net\";\n }\n }", "function launch_experiment($expId)\n{\n global $airavataclient;\n global $tokenFilePath;\n global $tokenFile;\n\n try\n {\n /* temporarily using hard-coded token\n open_tokens_file($tokenFilePath);\n\n $communityToken = $tokenFile->tokenId;\n\n\n $token = isset($_SESSION['tokenId'])? $_SESSION['tokenId'] : $communityToken;\n\n $airavataclient->launchExperiment($expId, $token);\n\n $tokenString = isset($_SESSION['tokenId'])? 'personal' : 'community';\n\n print_success_message('Experiment launched using ' . $tokenString . ' allocation!');\n */\n\n $hardCodedToken = '2c308fa9-99f8-4baa-92e4-d062e311483c';\n $airavataclient->launchExperiment($expId, $hardCodedToken);\n\n //print_success_message('Experiment launched!');\n print_success_message(\"<p>Experiment launched!</p>\" .\n '<p>You will be redirected to the summary page shortly, or you can\n <a href=\"experiment_summary.php?expId=' . $expId . '\">go directly</a> to the experiment summary page.</p>');\n redirect('experiment_summary.php?expId=' . $expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n}", "public function show($id)\n\n {\n\n \n $user = auth()->guard('client')->user();\n $testReview =$user->testReviews()->find($id);\n \n\n\n if (is_null($testReview)) {\n return $this->sendError('Test not found or you dont have access to this test');\n }\n\n\n return $this->sendResponse($testReview->toArray(), 'Test retrieved successfully.');\n\n }", "public function test3($id)\n {\n $tecmarcaextintor = \\App\\TecExtintor::find($id)->tecmarcaextintor;\n return response()->json(['result' => $tecmarcaextintor]);\n }", "public function testListExperiments()\n {\n echo \"\\nTesting experiment listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testGetSelf($id)\n {\n if ($id) {\n $product = static::$shopify->{$this->resourceName}($id)->get();\n\n $this->assertTrue(is_array($product));\n $this->assertNotEmpty($product);\n $this->assertEquals($id, $product['id']);\n }\n }", "public function show($id)\n\t{\n $result = Test::find($id);\n\n if ($result) {\n return $result->toArray();\n } else {\n return 'Resource not found, check id.';\n }\n\t}", "public function testValidGetById() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations (just checking enough to make sure the right thing was obtained)\n\t\t$this->assertSame($retrievedOrg->data->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data->orgName, $this->VALID_NAME);\n\n\t}", "function execute_test($run_id, $case_id, $test_id)\n{\n\t// triggering an external command line tool or API. This function\n\t// is expected to return a valid TestRail status ID. We just\n\t// generate a random status ID as a placeholder.\n\t\n\t\n\t$statuses = array(1, 2, 3, 4, 5);\n\t$status_id = $statuses[rand(0, count($statuses) - 1)];\n\tif ($status_id == 3) // Untested?\n\t{\n\t\treturn null;\t\n\t}\n\telse \n\t{\n\t\treturn $status_id;\n\t}\n}", "public function experiments_put($id=\"0\")\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n \n if(strcmp($id,\"0\")==0)\n {\n $array = array();\n $array['Error'] = 'Empty ID!';\n $this->response($array);\n }\n \n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n \n if(is_null($params))\n {\n $array = array();\n $array['Error'] = 'Empty document!';\n $this->response($array);\n }\n \n $jutil->setExpStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n \n $result = $sutil->updateExperiment($id,$doc);\n $this->response($result);\n }", "public function get_experiments( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function get( $id ){}", "function TestRun_get($run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.get', array(new xmlrpcval($run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function TestCase_get($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function experiment($experiment_id)\n\t{\n\t\t$experiment = $this->experimentModel->get_experiment_by_id($experiment_id);\n\n\t\tif (empty($experiment)) return;\n\n\t\tcreate_caller_table();\n\t\t$data['ajax_source'] = 'caller/table_by_experiment/' . $experiment_id;\n\t\t$data['page_title'] = sprintf(lang('callers_for_exp'), $experiment->name);\n\t\t$data['page_info'] = sprintf(lang('add_callers_exp'), $experiment->id);\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->authenticate->authenticate_redirect('templates/list_view', $data, UserRole::ADMIN);\n\t\t$this->load->view('templates/footer');\n\t}", "public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function actionTest($id){\n \n $model = $this->findModel($id);\n return $this->render('_auto', ['model' => $model]);\n \n \n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function getById($id) {\r\n return $this->testsetEntity->find($id);\r\n }", "public function testGetID() {\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getID (), 'control ID was incorrectly identified' );\r\n\t}", "public function getContest($contestid);", "public function testRequestItemId3()\n {\n $response = $this->get('/api/items/3');\n\n $response->assertStatus(200);\n }", "public function run($id) {\n return $this->getNikePlusFile('http://nikeplus.nike.com/plus/running/ajax/'.$id);\n }", "function GetTestId()\n {\n if (isset($_SESSION[GetTestIdIdentifier()]))\n {\n return $_SESSION[GetTestIdIdentifier()];\n }\n \n return FALSE;\n }", "function TestCaseRun_get($case_run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.get', array(new xmlrpcval($case_run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function get(string $id);", "public function rethinktestInterfacerSend()\n {\n App\\Api\\Facades\\Interfacer::send('13');\n\n $dump1 = ExternalDump::find(1);\n\n $this->assertEquals($dump1->result_returned, 1);\n\n $extD = new ExternalDump();\n $externalLabRequestTree = $extD->getLabRequestAndMeasures($dump1->lab_no);\n\n foreach ($externalLabRequestTree as $key => $externalLabRequest) {\n $this->assertEquals(1, $externalLabRequest->result_returned);\n }\n }", "public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }", "public function show($id)\n {\n $test = Test::where('test_id','=',$id)->first();\n return $test;\n }", "public function renderTest($id=''){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($id);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n\n $this->template->breTest=$breTest;\n }", "public function testGetVesselById()\n {\n $client = new Client(['base_uri' => 'http://localhost:8000/api/']);\n $token = $this->getAuthenticationToken();\n $headers = [\n 'Authorization' => 'Bearer ' . $token,\n 'Accept' => 'application/json',\n ];\n\n $response = $client->request('GET', 'vessel_statuses/3', [\n 'headers' => $headers\n ]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(['application/json; charset=utf-8'], $response->getHeader('Content-Type'));\n $data = json_decode($response->getBody(), true);\n $this->assertEquals('Restricted Manoeuvrability', $data['name']);\n\n }", "public function test_get_all_by_instanceid_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $talkpoints = $this->_cut->get_all_by_instanceid($module->id);\n $this->assertEquals(array(), $talkpoints);\n }", "public function testGetPostById()\n {\n $post = factory(Post::class)->create();\n \n $this->call('Get', '/post/' . $post->id);\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }", "public function testDemoteAutomatchUrlUsingGET()\n {\n }", "public function getEpisodeById($id) \n { \n return $this->get('/episodes/'.$id);\n }", "function StoreTestId($testID)\n {\n StartSession();\n \n $_SESSION[GetTestIdIdentifier()] = $testID;\n }", "function get($id)\n {\n return $this->specs->get($id);\n }", "public function testGetPetById()\n {\n // initialize the API client without host\n $pet_id = 10005; // ID of pet that needs to be fetched\n $pet_api = new Api\\PetApi();\n $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');\n // return Pet (model)\n $response = $pet_api->getPetById($pet_id);\n $this->assertSame($response->getId(), $pet_id);\n $this->assertSame($response->getName(), 'PHP Unit Test');\n $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com');\n $this->assertSame($response->getCategory()->getId(), $pet_id);\n $this->assertSame($response->getCategory()->getName(), 'test php category');\n $this->assertSame($response->getTags()[0]->getId(), $pet_id);\n $this->assertSame($response->getTags()[0]->getName(), 'test php tag');\n }", "public function test_getByExample() {\n\n }", "public function getSiteById(ApiTester $I)\n {\n $I->sendGet(URL_API . '/sites/' . PARAMS_SITE);\n $I->seeResponseCodeIs(200);\n $I->seeResponseIsJson();\n }", "public function testGetIDValue()\n {\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://p1> <http://www.w3.org/2000/01/rdf-schema#range> <http://foobar> .\n }');\n\n $res = $this->fixture->getIDValue(1);\n\n $this->assertEquals('http://example.com/', $res);\n }", "public function show($id)\n\t{\n\t\t$step = \\App\\TestStep::find($id);\n\t\t$execution = \\App\\Execution::where('ts_id', $id)->first(); \t\n\n\t\treturn view('show.step', ['step' => $step, 'execution' => $execution]);\n\t}", "public function get_experiment_results( $experiment_id, $options = array() ) {\n\t\t// @TODO: support options\n\t\t// @TODO: check for 503 in case this endpoint is overloaded (from docs)\n\t\t$extra = '';\n\t\tif ( $options ) {\n\t\t\t$extra = '?' . http_build_query( $options );\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/results' . $extra,\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "function getTestValueById($id) {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_table);\n\t\t$this->db->where('test_id', $id);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "function testReGetResource() { \n \t$uuid = $this->temp_uuid;\n\n $data = $this->ceenRU->CEERNResourceCall('/resource'.'/'.$uuid.'.php', 'GET', NULL, FALSE, 'resource_resource.retrieve');\n $this->assertTrue(isset($data['title']));\n }", "function update_experiment($expId, $updatedExperiment)\n{\n global $airavataclient;\n\n try\n {\n $airavataclient->updateExperiment($expId, $updatedExperiment);\n\n print_success_message(\"<p>Experiment updated!</p>\" .\n '<p>Click\n <a href=\"experiment_summary.php?expId=' . $expId . '\">here</a> to visit the experiment summary page.</p>');\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n\n}", "public function testGetInstitutionsUsingGET()\n {\n }", "function test_getId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $result = $test_task->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n\n }", "public function testRetrieveMultipleRequests()\n {\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n App\\Api\\Facades\\Interfacer::retrieve($this->labRequestUrinalysis[$i]);\n }\n\n $labR = $this->labRequestJsonSimpleTest;\n\n if (strpos($labR,'=') !== false && strpos($labR,'labRequest') !== false) {\n $labR = str_replace(['labRequest', '='], ['', ''], $labR);\n $labR = json_decode($labR);\n }\n\n App\\Api\\Facades\\Interfacer::retrieve($labR); //bs for mps\n\n // Check that all the 'urinalysis' data was stored\n // Was the data stored in the external dump?\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n $externalDump[] = ExternalDump::where('lab_no', '=', $this->labRequestUrinalysis[$i]->labNo)->get();\n $this->assertTrue(count($externalDump{$i}) > 0);\n }\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDump[0]->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n\n // Check that the 'bs for mps' data was stored\n // Was the data stored in the external dump?\n $externalDumpBS = ExternalDump::where('lab_no', '=', $labR->labNo)->get();\n $this->assertTrue(count($externalDump) > 0);\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDumpBS->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n }", "public function getAction(int $id)\n {\n // TODO: Implement getAction() method.\n\n $this->getVerifyProvider()->entry();\n\n }", "function babeliumsubmission_get_exercise_data($exerciseid,$responseid=0){\n Logging::logBabelium(\"Getting exercise data\");\n $g = $this->getBabeliumRemoteService();\n $data = null;\n if($responseid){\n $data = $g->getResponseInformation($responseid);\n if(!$data){\n return null;\n }\n $subtitleId = isset($data['subtitleId']) ? $data['subtitleId'] : 0;\n $mediaId= isset($data['mediaId']) ? $data['mediaId']: 0;\n } else {\n $data = $g->getExerciseInformation($exerciseid);\n if(!$data){\n return null;\n }\n $media = $data['media'];\n $subtitleId = isset($media['subtitleId']) ? $media['subtitleId'] : 0;\n $mediaId= isset($media['id']) ? $media['id']: 0;\n }\n $captions = $g->getCaptions($subtitleId,$mediaId);\n if(!$captions){\n return null;\n }\n\n $exerciseRoles = $this->getExerciseRoles($captions);\n\n //WTF??\n //$recinfo = $g->newServiceCall('requestRecordingSlot');\n $recinfo = null;\n $returnData = $this->getResponseInfo($data, $captions, $exerciseRoles, $recinfo);\n return $returnData;\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function testGetSitesReportById()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->reportsController->shouldReceive('retrieveBySiteIdAndTestName')->once()->andReturn('Report 3 for Test 2 and Site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTestsReports(array(1, 'tests', '2', 'reports', '3'));\n $this->assertEquals('Report 3 for Test 2 and Site 1 Mocked', $output);\n }", "public function actionSetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n $req = $this->getRequest();\n $tests = $req->getPost(\"tests\");\n\n /*\n * We need to implement CoW on tests.\n * All modified tests has to be newly created (with new IDs) and these\n * new IDs has to be propagated into configuration and limits.\n * Therefore a replacement mapping of updated tests is kept.\n */\n\n $newTests = [];\n $namesToOldIds = []; // new test name => old test ID\n $testsModified = false;\n\n foreach ($tests as $test) {\n // Perform checks on the test name...\n if (!array_key_exists(\"name\", $test)) {\n throw new InvalidArgumentException(\"tests\", \"name item not found in particular test\");\n }\n\n $name = trim($test[\"name\"]);\n if (!preg_match('/^[-a-zA-Z0-9_()\\[\\].! ]+$/', $name)) {\n throw new InvalidArgumentException(\"tests\", \"test name contains illicit characters\");\n }\n if (strlen($name) > 64) {\n throw new InvalidArgumentException(\"tests\", \"test name too long (exceeds 64 characters)\");\n }\n if (array_key_exists($name, $newTests)) {\n throw new InvalidArgumentException(\"tests\", \"two tests with the same name '$name' were specified\");\n }\n\n $id = Arrays::get($test, \"id\", null);\n $description = trim(Arrays::get($test, \"description\", \"\"));\n\n // Prepare a test entity that is to be inserted into the new list of tests...\n $testEntity = $id ? $exercise->getExerciseTestById($id) : null;\n if ($testEntity === null) {\n // new exercise test was requested to be created\n $testsModified = true;\n\n if ($exercise->getExerciseTestByName($name)) {\n throw new InvalidArgumentException(\"tests\", \"given test name '$name' is already taken\");\n }\n\n $testEntity = new ExerciseTest($name, $description, $this->getCurrentUser());\n $this->exerciseTests->persist($testEntity);\n } elseif ($testEntity->getName() !== $name || $testEntity->getDescription() !== $description) {\n // an update is needed => a copy is made and old ID mapping is kept\n $testsModified = true;\n $namesToOldIds[$name] = $id;\n $testEntity = new ExerciseTest($name, $description, $testEntity->getAuthor());\n $this->exerciseTests->persist($testEntity);\n }\n // otherwise, the $testEntity is unchanged\n\n $newTests[$name] = $testEntity;\n }\n\n if (!$testsModified && count($exercise->getExerciseTestsIds()) === count($newTests)) {\n // nothing has changed\n $this->sendSuccessResponse(array_values($newTests));\n return;\n }\n\n $testCountLimit = $this->exerciseRestrictionsConfig->getTestCountLimit();\n if (count($newTests) > $testCountLimit) {\n throw new InvalidArgumentException(\n \"tests\",\n \"The number of tests exceeds the configured limit ($testCountLimit)\"\n );\n }\n\n // first, we create the new tests as independent entities, to get their IDs\n $this->exerciseTests->flush(); // actually creates the entities\n $idMapping = []; // old ID => new ID\n foreach ($newTests as $test) {\n $this->exerciseTests->refresh($test);\n if (array_key_exists($test->getName(), $namesToOldIds)) {\n $oldId = $namesToOldIds[$test->getName()];\n $idMapping[$oldId] = $test->getId();\n }\n }\n\n // clear old tests and set new ones\n $exercise->getExerciseTests()->clear();\n $exercise->setExerciseTests(new ArrayCollection($newTests));\n $exercise->updatedNow();\n\n // update exercise configuration and test in here\n $this->exerciseConfigUpdater->testsUpdated($exercise, $this->getCurrentUser(), $idMapping, false);\n $this->configChecker->check($exercise);\n\n $this->exercises->flush();\n $this->sendSuccessResponse(array_values($newTests));\n }", "public function show($id){\n return \\App\\Models\\Puzzel::where(\"id\", \"=\", $id)->get()->first();\n }", "public function testElementMatchingWithTagAndID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'tag' => 'h1',\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }", "function test_get_by_id()\n {\n $dm = new mdl_direct_message();\n $result = $dm->get_by_id(1, 1);\n\n $this->assertEquals(count($result), 1);\n }", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "public function get( $id );", "abstract public function retrieve($id);", "public function testMediaFileIdGet()\n {\n $client = static::createClient();\n\n $path = '/media/file/{id}';\n $pattern = '{id}';\n $data = $this->genTestData('\\d+');\n $path = str_replace($pattern, $data, $path);\n\n $crawler = $client->request('GET', $path);\n }", "public function testRequestItemEditId3()\n {\n $response = $this->get('/api/items/3/edit');\n\n $response->assertStatus(200);\n }", "public function edit($id)\n {\n return $this->exerciseResultsService->findWith($id, ['exercise', 'user', 'attachments']);\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}" ]
[ "0.80787545", "0.7070373", "0.6621763", "0.6369168", "0.6349985", "0.6325129", "0.61617726", "0.6152334", "0.61204946", "0.6038902", "0.5967052", "0.5904932", "0.5893938", "0.5883273", "0.58651966", "0.5863077", "0.5862608", "0.5860091", "0.578838", "0.57871497", "0.5786301", "0.57802427", "0.57502216", "0.5736459", "0.57252765", "0.5718544", "0.5702382", "0.5693338", "0.5682104", "0.56747854", "0.5671185", "0.56606513", "0.56527406", "0.5638907", "0.56360954", "0.56332594", "0.563189", "0.56252086", "0.5618011", "0.5613051", "0.5597222", "0.55945003", "0.5578203", "0.5572066", "0.55612886", "0.55560094", "0.55499613", "0.5535193", "0.5531551", "0.5525767", "0.550812", "0.5499923", "0.5486079", "0.5481684", "0.5480348", "0.5469546", "0.5468478", "0.54633296", "0.5457106", "0.5447675", "0.5423421", "0.54228276", "0.54221034", "0.5419054", "0.5415608", "0.54073787", "0.5401047", "0.5387381", "0.5382858", "0.538172", "0.5377828", "0.5376845", "0.5374334", "0.53586155", "0.53571904", "0.5355308", "0.5337384", "0.5321907", "0.53214526", "0.5315565", "0.5313325", "0.5305826", "0.53054893", "0.53014815", "0.52989215", "0.5292929", "0.52892697", "0.5288892", "0.528718", "0.528493", "0.52825475", "0.52809215", "0.5276529", "0.526932", "0.52644", "0.52588224", "0.525653", "0.52552795", "0.5249849", "0.5245888" ]
0.5823668
18
Testing the subject update.
public function testUpdateSubject() { echo "\nTesting subject update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('subject_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/subjects/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(\\SplSubject $subject) {}", "public function update(SplSubject $subject)\n {\n echo 1;\n }", "public function update(SplSubject $subject)\n {\n echo 2;\n }", "public function update(SplSubject $subject)\n {\n // TODO: Implement update() method.\n print_r($subject);\n}", "public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(SubjectInterface $subject);", "public function update(SubjectInterface $subject): void;", "public function test_updateMessage() {\n\n }", "public function testPostUpdate()\n {\n $this->getEmailWithLocal('uk');\n /** check email with ticket pdf file */\n $this->findEmailWithText('ticket-php-day-2017.pdf');\n /** check email with string */\n $this->findEmailWithText('Шановний учасник, в вкладенні Ваш вхідний квиток. Покажіть його з екрану телефону або роздрукуйте на папері.');\n }", "public function update(\\SplSubject $subject)\n {\n if($subject === $this->login){\n $this->doUpdate($subject);\n }\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testCollectionTicketsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testWebinarUpdate()\n {\n }", "public function testWebinarRegistrantQuestionUpdate()\n {\n }", "public function update(SplSubject $publisher){\r\n \r\n }", "public function testD_update() {\n\n $fname = self::$generator->firstName();\n $lname = self::$generator->lastName;\n\n $resp = $this->wrapper->update( self::$randomEmail, [\n 'FNAME' => $fname,\n 'LNAME' => $lname\n ]);\n\n $this->assertObjectHasAttribute('id', $resp);\n $this->assertObjectHasAttribute('merge_fields', $resp);\n\n $updated = $resp->merge_fields;\n\n $this->assertEquals($lname, $updated->LNAME);\n\n }", "public function update(SubjectRequest $request, Subject $subject)\n {\n //\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "public function updateObserver (Observable $subject) {\n /* @var $subject Repository\\AbstractRepository */\n $measureId = $subject->getMeasureId();\n $executor = $this->_commander->getExecutor(__CLASS__)->clean(); /* @var $executor Executor */\n\n $executor->add('getMeasure', $this->_measureService)\n ->getResult()\n ->setMeasureId($measureId)\n ->setType(Type::MYSQL);\n\n $measure = $executor->execute()->getData(); /* @var $measure Entity\\Measure */\n $testId = $measure->getTestId();\n\n $executor->clean()\n ->add('updateTestState', $this->_testService)\n ->getResult()\n ->setTestId($testId);\n $executor->execute();\n\n return true;\n }", "public function update(Request $request, Subject $subject)\n {\n //\n }", "public function update(Request $request, Subject $subject)\n {\n //\n }", "function tests_can_update_a_note() \n {\n $text = 'Update note';\n\n /*\n * Create a new category\n */\n $category = factory(Category::class)->create();\n\n /*\n * Create another category for update\n */\n\n $anotherCategory = factory(Category::class)->create();\n\n /*\n * Create a note\n */\n\n $note = factory(Note::class)->make();\n\n /*\n * Relation note with category\n */\n\n $category->notes()->save($note);\n\n\n /*\n * Send request for update note\n */\n $this->put('api/v1/notes'. $note->id, [\n 'note' => $text,\n 'category_id' => $anotherCategory->id,\n ], ['Content-Type' => 'application/x-www-form-urlencoded']);\n\n /*\n * Check that in database update note\n */\n $this->seeInDatabase('notes', [\n 'note' => $text,\n 'category_id' => $anotherCategory->id\n\n ]);\n\n\n /*\n * Ckeck that response in format Json\n */\n\n // $this->seeJsonEquals([\n // 'success' => true,\n // 'note' => [\n // 'id' => $note->id,\n // 'note' => $text,\n // 'category_id' => $anotherCategory->id,\n // ],\n // ]);\n }", "public function testJobUpdate()\n {\n\n }", "public function testEmailUpdate(): void {\n\t\t$user = $this->createUser();\n\t\t$newEmail = '[email protected]';\n\t\tPassport::actingAs($user);\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->postJson($this->route.'/email/update', [\n\t\t\t'email' => $user->email,\n\t\t\t'email_update' => $newEmail]);\n\t\t$response->assertStatus(HttpStatus::STATUS_OK);\n\t\t$response->assertJson([\n\t\t\t'message' => 'We have e-mailed you your e-mail verification link!',\n\t\t]);\n\t\t$this->assertDatabaseHas('email_verification',[\n\t\t\t'user_id' => $user->id,\n\t\t\t'email_update' => $newEmail\n\t\t]);\n\t}", "public function testShouldValidateSaveSubject ()\n {\n $this->entity->setDsMessage('mensagem teste');\n\n $this->_setUser();\n\n $this->business->_validateSave($this->entity);\n }", "function update(AbstractSubject $subject)\n {\n write_in(\"Alert to observer\");\n write_in($subject->favorite);\n }", "public function updated(Subject $subject)\n {\n if ($subject->isDirty(['code','name'])){\n $this->updateHasChange($subject,1);\n }\n }", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function testServeChanges()\n {\n }", "public function editSubject($subject_name, $subject_id, $update_time){\n\t\t\t$query = $this->connection()->prepare(\"UPDATE subject SET name='$subject_name', updated_at='$update_time' WHERE id='$subject_id'\");\n\t\t $query->execute();\n\t\t return true;\n\t\t}", "public function updateSubject($subject, $id) {\n $this->updateSubjectStatement->bind_param(\"si\", $subject, $id);\n \n if(!$this->updateSubjectStatement->execute()) return false; // if the query didn't execute, return false\n\t\t\treturn true;\n }", "public function update($subject) {\n prinft(\"State Change, new subject: %s\", $subject);\n }", "public function update (SplSubject $subject)\n {\n $this->_subject = $subject;\n $this->display();\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "protected function _syncSubject() {}", "public function update($subject)\n {\n $method = \"subjectAction\" . $subject->getState();\n if (method_exists($this, $method)) {\n call_user_func_array(array($this, $method), array($subject));\n }\n }", "public function testPatchVoicemailMessage()\n {\n }", "public function test_if_failed_update()\n {\n }", "function update_subject($cid)\n {\n // form validations\n $this->form_validation->set_rules('subjectname', 'Subject Name', 'required');\n if ($this->form_validation->run() == FALSE) {\n $this->edit_subject($cid);\n } else {\n $resultstatus = $this->subject->update_subject($cid);\n $this->edit_subject($cid, $resultstatus);\n }\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function testPutVoicemailMessage()\n {\n }", "public function update(SplSubject $subject)\n {\n return $this->subject = $subject;\n }", "protected function setSubject() {}", "function update_subject($subject) {\n global $db;\n\n $errors = validate_subject($subject);\n if(!empty($errors)) {\n return $errors;\n }\n\n $old_subject = find_subject_by_id($subject['id']);\n $old_position = $old_subject['position'];\n shift_subject_positions($old_position, $subject['position'], $subject['id']);\n\n $sql = \"UPDATE subjects SET \";\n $sql .= \"menu_name='\" . db_escape($db, $subject['menu_name']) . \"', \";\n $sql .= \"position='\" . db_escape($db, $subject['position']) . \"', \";\n $sql .= \"visible='\" . db_escape($db, $subject['visible']) . \"' \";\n $sql .= \"WHERE id='\" . db_escape($db, $subject['id']) . \"' \";\n $sql .= \"LIMIT 1\";\n\n $result = mysqli_query($db, $sql);\n // For UPDATE statements, $result is true/false\n if($result) {\n return true;\n } else {\n // UPDATE failed\n echo mysqli_error($db);\n db_disconnect($db);\n exit;\n }\n\n }", "public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }", "public function edit(SubjectTest $subjectTest)\n {\n //\n }", "public function testUnitUpdate()\n {\n $input = [\n 'username' => 'foo.bar',\n 'email' => '[email protected]',\n 'password' => 'asdfg',\n 'password_confirmation' => 'asdfg',\n 'name' => 'foo bar'\n ];\n $request = Mockery::mock('Suitcoda\\Http\\Requests\\UserEditRequest[all]');\n $request->shouldReceive('all')->once()->andReturn($input);\n\n $model = Mockery::mock('Suitcoda\\Model\\User[save]');\n $model->shouldReceive('findOrFailByUrlKey')->once()->andReturn($model);\n $model->shouldReceive('save')->once();\n\n $user = new UserController($model);\n\n $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $user->update($request, 1));\n }", "public function updateSubject( $subject )\n {\n \n $request = new Request( \n 'PUT', \n self::ENDPOINT_URL . '/subjects/' . $subject->id, \n [ 'content-type' => 'application/json' ], \n json_encode($subject->toArray())\n );\n\n $response = $this->request($request);\n \n $subject->configure($response);\n \n return $subject;\n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testSaveUpdate()\n {\n $city = $this->existing_city;\n\n // set string properties to \"updated <property_name>\"\n // set numeric properties to strlen(<property_name>)\n foreach (get_object_vars($city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($value)) {\n $city->$key = \"updated \".$key;\n } elseif (is_numeric($value)) {\n $city->$key = strlen($key);\n }\n }\n }\n\n // update the city\n $city->save();\n\n // go get the updated record\n $updated_city = new City($city->id);\n // check the properties of the updatedCity\n foreach (get_object_vars($updated_city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($city->$key)) {\n $this->assertEquals(\"updated \".$key, $value);\n } elseif (is_numeric($city->$key)) {\n $this->assertEquals(strlen($key), $value);\n }\n }\n }\n }", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set params\n $params = $this->customBranchData;\n \n // Add ID\n $ID = $this->_pickRandomItem($branchIDs);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/branch/edit', $params, [], [], ['HTTP_REFERER' => '/branch/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/branch/edit');\n $this->assertSessionHas('branch-updated', '');\n \n // Validate data\n $branch = $this->branch->getOne($ID);\n $this->assertEquals($branch->name, $this->customBranchData['name']);\n $this->assertEquals($branch->promotor_ID, $this->customBranchData['promotor_ID']);\n }", "public function set_subject($subject);", "public function testUpdatingNote()\n {\n $manager = $this->getModelManager();\n\n // Get the first tutor\n $tutor = $manager->findById(1);\n\n // Set the Note on his first tutorLanguage, to the START tag\n /** @var TutorLanguage $tutorLanguage*/\n $tutorLanguage = $tutor->getTutorLanguages()->first();\n $tutorLanguage->setNote(TestSlug::START_1);\n\n $manager->saveEntity($tutor);\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::START_1, $tutor->getTutorLanguages()->first()->getNote());\n\n $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language-note');\n\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::END_1, $tutor->getTutorLanguages()->first()->getNote());\n }", "public function testMakePutRequest()\n {\n $body = ['teacher' => 'Charles Xavier', 'job' => 'Professor'];\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse($body),\n ]);\n\n $this->assertEquals($client->put('teachers/1', ['job' => 'Professor']), $body);\n }", "public function testUpdatedTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n }", "public function testDebtorUpdate()\n {\n $this->saveDebtor();\n\n $oDebtor = (new DebtorDAO())->findByCpfCnpj('01234567890');\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $aDadosUpdate = [\n 'id' => $oDebtor->getId(),\n 'name' => 'Carlos Vinicius Atualização',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '14725836905',\n 'birthdate' => '01/01/2000',\n 'phone_number' => '(79) 9 8888-8888',\n 'zipcode' => '11111-111',\n 'address' => 'Rua Atualização',\n 'number' => '005544',\n 'complement' => 'Conjunto Atualização',\n 'neighborhood' => 'Bairro Atualização',\n 'city' => 'Maceió',\n 'state' => 'AL'\n ];\n\n $oDebtorFound = (new DebtorDAO())->find($aDadosUpdate['id']);\n $oDebtorFound->update($aDadosUpdate);\n\n $oDebtorUpdated = (new DebtorDAO())->find($aDadosUpdate['id']);\n $this->assertTrue($oDebtorUpdated->getName() == 'Carlos Vinicius Atualização');\n $this->assertTrue($oDebtorUpdated->getEmail() == '[email protected]');\n $this->assertTrue($oDebtorUpdated->getCpfCnpj() == '14725836905');\n $this->assertTrue($oDebtorUpdated->getBirthdate()->format('d/m/Y') == '01/01/2000');\n $this->assertTrue($oDebtorUpdated->getPhoneNumber() == '79988888888');\n $this->assertTrue($oDebtorUpdated->getZipcode() == '11111111');\n $this->assertTrue($oDebtorUpdated->getAddress() == 'Rua Atualização');\n $this->assertTrue($oDebtorUpdated->getNumber() == '005544');\n $this->assertTrue($oDebtorUpdated->getComplement() == 'Conjunto Atualização');\n $this->assertTrue($oDebtorUpdated->getNeighborhood() == 'Bairro Atualização');\n $this->assertTrue($oDebtorUpdated->getCity() == 'Maceió');\n $this->assertTrue($oDebtorUpdated->getState() == 'AL');\n $this->assertTrue(!is_null($oDebtorUpdated->getUpdated()));\n $oDebtorUpdated->delete();\n }", "public function update_subject(Request $request)\n {\n $subject =Subject::find($request->id);\n $subject->name=strtoupper($request->name);\n $subject->save();\n $request->session()->flash('success', 'Subject was successfuly Updated!');\n return redirect()->action('HomeController@subject');\n }", "public function test_updateSettings() {\n\n }", "public function test_updateQueue() {\n\n }", "public function testGetSubject()\n {\n $subject = $this->createInstance(['_getSubject']);\n $_subject = $this->reflect($subject);\n $arg = uniqid('subject-');\n\n $subject->expects($this->exactly(1))\n ->method('_getSubject')\n ->will($this->returnValue($arg));\n\n $result = $subject->getSubject();\n $this->assertEquals($arg, $result, 'Subject did not retrieve required exception subject');\n }", "public function update(Request $request, $subject)\n {\n $this->validate($request,[\n 'name'=>'unique:subjects'\n ]);\n $subject = Subject::findOrfail($subject);\n $subject-> name = $request->name;\n $status = $subject->update();\n if($status){\n session()->flash('message','Subjects Updated successfully');\n Session::flash('type', 'success'); \n return redirect()->route('setting.subject.index');\n }\n }", "public function testUpdateObserver() {\n\t\t$this->testSave();\n\t\t/** @var \\arConnector $observerConnector */\n\t\t$observerConnector = Mockery::namedMock(\"observerConnectorMock\", \\arConnector::class);\n\n\t\t\\arConnectorMap::register(new BucketContainer(), $observerConnector);\n\n\t\t// Observer is updated after tasks are added.\n\t\t$observerConnector->shouldReceive(\"read\")->once()->andReturn(1);\n\t\t$observerConnector->shouldReceive(\"update\")->once()->andReturn(true);\n\n\t\t$this->persistence->setConnector($observerConnector);\n\t\t$this->persistence->updateBucket($this->bucket);\n\t}", "public function testSuccessfullUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => true,\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n 'id' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n ]);\n }", "public function testUpdatePayloadSuccessFeature()\n {\n $user = factory(User::class)->create();\n $webhook = factory(Webhook::class)->create(['user_id' => $user->id]);\n $payload = factory(Payload::class)->create(['webhook_id' => $webhook->id, 'content' => 'old content']);\n $this->actingAs($user);\n $response = $this->put(route('webhooks.payloads.update', ['webhook' => $webhook, 'payload' => $payload]), [\n 'content' => 'Hi my name is {{name}}',\n 'content_type' => 'text',\n 'params' => '{\"name\": \"rasmus\", \"age\": \"30\"}',\n ]);\n $payload = Payload::find($payload->id);\n\n $response->assertStatus(200);\n $response->assertSessionHas('messageSuccess', [\n 'status' => 'Update success',\n 'message' => 'This payload successfully updated',\n ]);\n $this->assertEquals($payload->content, 'Hi my name is {{name}}');\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function testCollectionTicketCommentsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "protected function doUpdateTests()\n {\n $this->objectRepository->setClassName(TestPolicy::class);\n $policy = $this->objectRepository->find(19071974);\n $policy->policyNo = 'TESTPOLICY UPDATED';\n $policy->contact->lastName = 'ChildUpdate';\n $recordsAffected = $this->objectRepository->saveEntity($policy);\n $recordsAffected = 2;\n if ($this->getCacheSuffix()) {\n $this->assertGreaterThanOrEqual(2, $recordsAffected);\n } else {\n $this->assertEquals(2, $recordsAffected);\n }\n\n //Verify update\n $policy2 = $this->objectRepository->find(19071974);\n $this->assertEquals('TESTPOLICY UPDATED', $policy2->policyNo);\n $this->assertEquals('ChildUpdate', $policy2->contact->lastName);\n\n //If we tell it not to update children, ensure foreign keys are ignored\n $policy = $this->objectRepository->find(19071974);\n $policy->vehicle->policy = null;\n $policy->contact = null;\n $this->objectRepository->saveEntity($policy, false);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertEquals(123, $refreshedPolicy->contact->id);\n $this->assertEquals(1, $refreshedPolicy->vehicle->id);\n $this->assertEquals(19071974, $refreshedPolicy->vehicle->policy->id);\n\n //And if we tell it to update children, they are not ignored\n //(known issue: if child owns relationship, the relationship won't be deleted unless you save the child\n //directly - hence we don't check for a null vehicle or vehicle->policy here, as it will not have removed the\n //relationship)\n $this->objectRepository->saveEntity($policy, true);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertNull($refreshedPolicy->contact);\n\n //Put the contact back, ready for the next test (quicker than running $this->setUp() again)\n $refreshedPolicy->contact = $this->objectRepository->getObjectReference(TestContact::class, ['id' => 123]);\n $this->objectRepository->saveEntity($refreshedPolicy);\n }", "public function update(SubjectRequest $request, $id)\n {\n $sub = $this->_repo->updateSubject($id,$request->all());\n\n return $this->respond($sub);\n }", "public function testUpdated()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's updated date is correct\n $this->assertTrue($feed->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n $this->verifyProperty2(\n $feed,\n \"updated\",\n \"text\",\n \"2007-05-31T01:15:00.000Z\"\n );\n\n // Assert that all entry's have an Atom Published object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getUpdated() instanceof Zend_Gdata_App_Extension_Updated);\n }\n\n // Assert one of the entry's Published dates\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"updated\", \"text\", \"2007-05-17T10:33:49.000Z\");\n }", "public function testRenderUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($branchIDs);\n $branch = $this->branch->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/branch/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('branch', $branch);\n $this->assertViewHas('dataTl');\n $this->assertPageContain('Edit Branch');\n }", "public function testGetAuthorizationSubject()\n {\n }", "public function testEmailUpdateAnauthenticated(): void {\n\t\t$user = $this->createUser();\n\t\t$newEmail = '[email protected]';\n\t\t$response = $this->withHeaders([\n\t\t\t'Accept' => 'application/json',\n\t\t\t'Content-Type' => 'application/json',\n\t\t])->postJson($this->route.'/email/update', [\n\t\t\t'email' => $user->email,\n\t\t\t'email_update' => $newEmail]);\n\t\t$response->assertStatus(HttpStatus::STATUS_UNAUTHORIZED);\n\t\t$response->assertJson([\n\t\t\t'message' => 'Unauthenticated.'\n\t\t]);\n\t\t$this->assertDatabaseMissing('email_verification',[\n\t\t\t'user_id' => $user->id,\n\t\t\t'email_update' => $newEmail\n\t\t]);\n\t}", "public function testAuthenticationServiceAuthenticationUpdate()\n {\n }", "public function update(UpdateSubject $request, Subject $subject)\n {\n $subject->name = $request->input('label');\n\n if ($subject->save()) {\n return response()->json([\n 'success' => true,\n 'subject' => $subject->load(['chapters'])\n ]);\n }\n\n return $this->jsonErrorRespond('Fail updating subject', 500);\n }", "public function update(Request $request, Subject $subject)\n {\n $subjectId = $subject->id;\n $subject = Subject::findorFail($subjectId);\n $this->validate($request, [\n 'teacher_id' => 'required|numeric',\n 'name' => ['required',\n Rule::unique('subjects')->ignore($subject->id),\n ]\n ]);\n\n if($request->input('name') == $subject->name && $request->input('teacher_id') == $subject->teacher_id\n && !$request->input('classroom_remove_ids') && !$request->input('classroom_add_ids')){\n return redirect()->back()->with('warning_message', \"You didn't change any data.\");\n }\n if($request->input('classroom_remove_ids')){\n\n foreach($request->input('classroom_remove_ids') as $classroomRemoveId){\n DB::table('classroom_subject')->where('subject_id', '=', $subject->id)\n ->where('classroom_id', '=', $classroomRemoveId)->delete();\n }\n }\n if($request->input('classroom_add_ids')){\n foreach($request->input('classroom_add_ids') as $classroomAddId){\n DB::table('classroom_subject')->insert([\n ['subject_id' => $subject->id, 'classroom_id' => $classroomAddId]\n ]);\n }\n }\n $updatedSubject = $request->all();\n $subject->fill($updatedSubject)->save();\n return redirect()->back()->with('flash_message', \"Subject successfully updated!\");\n\n\n }", "public function testEmailCampaignPut()\n {\n }", "public function testUpdate()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->count(10)->create();\n\n //test item not found\n $this->call('PUT', '/items/11111')\n ->assertStatus(404);\n\n //test validation\n $this->put('items/1', array('email' => 'test1!kl'))\n ->seeJson([\n 'email' => array('The email must be a valid email address.'),\n ]);\n\n //test exception\n $this->put('items/1', array('email' => '[email protected]'))\n ->seeJsonStructure([\n 'error', 'code'\n ])\n ->seeJson(['code' => 400]);\n\n //test success updated item\n $this->put('items/1', array('email' => '[email protected]', 'name' => 'test1 updated'))\n ->seeJson([\n 'status' => 'ok',\n ])\n ->seeJson([\n 'email' => '[email protected]',\n ])\n ->seeJson([\n 'name' => 'test1 updated',\n ])\n ->seeJsonStructure([\n 'data' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]);\n\n $this->seeInDatabase('items', array('email' => '[email protected]', 'name' => 'test1 updated'));\n }", "public function test_updateLegacyLowstockContact() {\n\n }", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function testUpdateNotOwnCreated()\r\n {\r\n //create teacher user\r\n $teacher = $this->CreateTeacher();\r\n $lisUser = $this->CreateTeacherUser($teacher);\r\n\r\n //now we have created teacheruser set to current controller\r\n $this->controller->setLisUser($lisUser);\r\n $this->controller->setLisPerson($teacher);\r\n\r\n //create other teacher user\r\n $otherTeacher = $this->CreateTeacher();\r\n $otherLisUser = $this->CreateTeacherUser($otherTeacher);\r\n\r\n //$name = uniqid() . 'Name';\r\n $subjectRound = $this->CreateSubjectRound();\r\n $student = $this->CreateStudent();\r\n //$anotherTeacher = $this->CreateTeacher();\r\n \r\n\r\n $independentWork = $this->CreateIndependentWork([\r\n 'name' => uniqid() . 'Name',\r\n 'duedate' => new \\DateTime,\r\n 'description' => uniqid() . ' Description for independentwork',\r\n 'durationAK' => (int) uniqid(),\r\n 'subjectRound' => $subjectRound->getId(),\r\n 'teacher' => $teacher->getId(),\r\n 'student' => $student->getId(),\r\n 'createdBy' => $otherLisUser->getId()\r\n ]);\r\n\r\n //$subjectRoundIdOld = $independentWork->getSubjectRound()->getId();\r\n //$studentIdOld = $independentWork->getStudent()->getId();\r\n //$teacherIdOld = $independentWork->getTeacher()->getId();\r\n\r\n $this->request->setMethod('put');\r\n $this->routeMatch->setParam('id', $independentWork->getId());\r\n\r\n $this->request->setContent(http_build_query([\r\n 'student' => $this->CreateStudent()->getId(),\r\n 'subjectRound' => $this->CreateSubjectRound()->getId(),\r\n 'teacher' => $teacher->getId(),\r\n ]));\r\n\r\n //fire request\r\n $result = $this->controller->dispatch($this->request);\r\n $response = $this->controller->getResponse();\r\n\r\n $this->PrintOut($result, false);\r\n\r\n $this->assertEquals(200, $response->getStatusCode());\r\n $this->assertEquals(false, $result->success);\r\n $this->assertEquals('SELF_CREATED_RESTRICTION', $result->message);\r\n }", "public function the_subject_value_in_the_database_will_be_set()\n {\n $subject = ['sender' => $this->faker->sentence, 'recipient' => $this->faker->sentence];\n $form = new FormMail(['subject' => $subject]);\n $this->assertSame($form->subject, $subject);\n\n }", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $dealerAccountID = $this->_populate();\n \n // Set params\n $params = $this->customDealerAccountData;\n \n // Add ID\n $ID = $this->_pickRandomItem($dealerAccountID);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $params, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHas('dealer-account-updated', '');\n \n // Validate data\n $dealerAccount = $this->dealer_account->getOne($ID);\n $this->assertEquals($dealerAccount->name, $this->customDealerAccountData['name']);\n $this->assertEquals($dealerAccount->branch_ID, $this->customDealerAccountData['branch_ID']);\n }", "public function testAuthorMutator()\n {\n $this->assertTrue(true);\n }", "public function testSaveUpdates()\n {\n $this->projectItemInput = [\n 'id' => '555', \n 'project_id' => 1, \n 'item_type' => 'Refrigerator',\n 'manufacturer' => 'Cool Guys Manufacturing',\n 'model' => 'coolycool5000',\n 'serial_number' => '9238JDFH03uihFD', \n 'vendor' => 'LindenMart',\n 'comments' => 'Handles upsidedown'\n ];\n // Assemble\n //$this->mockedProjectItemsController->shouldReceive('storeItemWith')->once()->with($this->projectItemInput);\n $this->mockedProjectItemsRepo->shouldReceive('saveProjectItem')->once()->with(Mockery::type('ProjectItem'));\n\n // Act \n $response = $this->route(\"POST\", \"storeItems\", $this->projectItemInput);\n\n // Assert\n $this->assertRedirectedToAction('ProjectItemController@index',1);\n }", "public function testUpdateTimesheet()\n {\n }", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }" ]
[ "0.7487688", "0.7255924", "0.7250931", "0.72051895", "0.70829284", "0.70773464", "0.70773464", "0.70773464", "0.70773464", "0.70759016", "0.70759016", "0.68281275", "0.6787441", "0.67633486", "0.6650405", "0.6597262", "0.6563807", "0.6552678", "0.6539471", "0.6524724", "0.6476421", "0.6473057", "0.6462073", "0.644398", "0.644398", "0.64341617", "0.64238244", "0.6419897", "0.6419897", "0.6358471", "0.6345826", "0.6340525", "0.6305894", "0.62981904", "0.6248073", "0.6235686", "0.62008417", "0.6199629", "0.61789215", "0.6165644", "0.6147819", "0.6144761", "0.61426294", "0.6135355", "0.6121902", "0.61185515", "0.60882604", "0.6077046", "0.60644037", "0.60507166", "0.6036707", "0.6036435", "0.6011971", "0.60032284", "0.597216", "0.5968938", "0.5966625", "0.59508383", "0.5938175", "0.59303826", "0.59274316", "0.5924952", "0.5919143", "0.59128255", "0.5912465", "0.5908212", "0.5903346", "0.5898711", "0.58882535", "0.5874419", "0.58715487", "0.5863551", "0.58557296", "0.58471704", "0.583729", "0.5831594", "0.5825568", "0.58170474", "0.58152544", "0.58123493", "0.5803381", "0.57916653", "0.5787609", "0.5785841", "0.5774613", "0.5759447", "0.5758393", "0.57555246", "0.5754137", "0.5752375", "0.5752325", "0.5752325", "0.5752325", "0.57485026", "0.5748428", "0.5743341", "0.5740725", "0.57319653", "0.5730971", "0.5728003" ]
0.78042865
0
Testing the project search
public function testSearchSubject() { echo "\nTesting subject search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects?search=mouse"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/subjects?search=mouse"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testProjects()\n {\n $response = $this->get('/projects'); \t\t\t\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function testListProjects()\n {\n echo \"\\nTesting project listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------testListProjects Response:\".$response.\"\\n\";\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function testProjectsIndex()\n {\n $response = $this->get('/projects');\n $response->assertStatus(200);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_searchByPage() {\n\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testSearch()\n {\n $crawler = $this->client->request('GET', $this->router->generate('marquejogo_homepage'));\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Cidade\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Data\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Hora\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => '',\n 'marcoshoya_marquejogobundle_search[date]' => '1111',\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n // invalid date\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"This value is not valid.\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => 'Curitiba, Paraná',\n 'marcoshoya_marquejogobundle_search[date]' => date('d-m-Y'),\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Resultados encontrados\")')->count());\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testIndexProjectAdmin()\n {\n $user = User::factory()->create();\n\n $project = Project::factory()->create();\n\n $response = $this->actingAs($user)->get('/admin/project');\n\n $response->assertStatus(200);\n\n $response->assertSeeTextInOrder([$project->name, $project->short_description]);\n }", "public function testGetVoicemailSearch()\n {\n }", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function test_project_home()\n {\n $response = $this->get('/project');\n $response->assertStatus(200);\n }", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testInboundDocumentSearch()\n {\n }", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testSearchModelSets()\n {\n }", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }", "function testProject()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\tcreateClient('Mountain Dew', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', '[email protected]', 'The streets', 'Las Vegas', 'NV');\n\tcreateProject('Mountain Dew', 'Make App', 'Build an app for Mountain Dew.');\n\n\t//prints out project's information\n\techo \"<h3>Projects</h3>\";\n\ttest(\"SELECT * FROM Projects\");\n\n\t//delete's information from the database\n\tdeleteProject('Mountain Dew', 'Make App');\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\tdeleteClient('The Business');\n\tdeleteClient('Mountain Dew');\n\t\n\t//prints information\n\ttest(\"SELECT * FROM Projects\");\n}", "public function testProjectPermissions()\n {\n URL::forceRootUrl('http://localhost');\n\n // Create some projects.\n $this->public_project = new Project();\n $this->public_project->Name = 'PublicProject';\n $this->public_project->Public = Project::ACCESS_PUBLIC;\n $this->public_project->Save();\n $this->public_project->InitialSetup();\n\n $this->protected_project = new Project();\n $this->protected_project->Name = 'ProtectedProject';\n $this->protected_project->Public = Project::ACCESS_PROTECTED;\n $this->protected_project->Save();\n $this->protected_project->InitialSetup();\n\n $this->private_project1 = new Project();\n $this->private_project1->Name = 'PrivateProject1';\n $this->private_project1->Public = Project::ACCESS_PRIVATE;\n $this->private_project1->Save();\n $this->private_project1->InitialSetup();\n\n $this->private_project2 = new Project();\n $this->private_project2->Name = 'PrivateProject2';\n $this->private_project2->Public = Project::ACCESS_PRIVATE;\n $this->private_project2->Save();\n $this->private_project2->InitialSetup();\n\n // Verify that we can access the public project.\n $_GET['project'] = 'PublicProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that viewProjects.php only lists the public project.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 1,\n 'projects' => [\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Verify that we cannot access the protected project or the private projects.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->get('/api/v1/index.php');\n $response->assertJson(['requirelogin' => 1]);\n\n // Create a non-administrator user.\n $this->normal_user = $this->makeNormalUser();\n $this->assertDatabaseHas('user', ['email' => 'jane@smith']);\n\n // Verify that we can still access the public project when logged in\n // as this user.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n\n // Verify that we can access the protected project when logged in\n // as this user.\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n\n // Add the user to PrivateProject1.\n \\DB::table('user2project')->insert([\n 'userid' => $this->normal_user->id,\n 'projectid' => $this->private_project1->Id,\n 'role' => 0,\n 'cvslogin' => '',\n 'emailtype' => 0,\n 'emailcategory' => 0,\n 'emailsuccess' => 0,\n 'emailmissingsites' => 0,\n ]);\n\n // Verify that she can access it.\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that she cannot access PrivateProject2.\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->normal_user)->get('/api/v1/index.php');\n $response->assertJson(['error' => 'You do not have permission to access this page.']);\n\n // Verify that viewProjects.php lists public, protected, and private1, but not private2.\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->normal_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 3,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n\n // Make an admin user.\n $this->admin_user = $this->makeAdminUser();\n $this->assertDatabaseHas('user', ['email' => 'admin@user', 'admin' => '1']);\n\n // Verify that they can access all 4 projects.\n $_GET['project'] = 'PublicProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PublicProject',\n 'public' => Project::ACCESS_PUBLIC\n ]);\n $_GET['project'] = 'ProtectedProject';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'ProtectedProject',\n 'public' => Project::ACCESS_PROTECTED\n ]);\n $_GET['project'] = 'PrivateProject1';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject1',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n $_GET['project'] = 'PrivateProject2';\n $response = $this->actingAs($this->admin_user)->get('/api/v1/index.php');\n $response->assertJson([\n 'projectname' => 'PrivateProject2',\n 'public' => Project::ACCESS_PRIVATE\n ]);\n\n // Verify that admin sees all four projects on viewProjects.php\n $_GET['project'] = '';\n $_SERVER['SERVER_NAME'] = '';\n $_GET['allprojects'] = 1;\n $response = $this->actingAs($this->admin_user)->get('/api/v1/viewProjects.php');\n $response->assertJson([\n 'nprojects' => 4,\n 'projects' => [\n ['name' => 'PrivateProject1'],\n ['name' => 'PrivateProject2'],\n ['name' => 'ProtectedProject'],\n ['name' => 'PublicProject'],\n ],\n ]);\n }", "public function testGetSearchResults()\n {\n $search_term = $this->getSearchTerm();\n $limit = $this->getLimit();\n\n $client = $this->mockGuzzleForResults();\n $repository = new GoogleSearchRepositoryApi($client);\n\n $results = $repository->getSearchResults($search_term, $limit);\n\n $this->assertIsArray($results);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function testFindPageReturnsDataForSuccessfulSearch()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', 'name=works');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "protected function tweakTaskSearch() {\n\t\tparent::tweakTaskSearch();\n\t\tparent::setProjectsInTaskSearchForManager(TRUE);\n\t}", "public function testQuarantineFind()\n {\n\n }", "public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}", "public function testSearchParams() {\n $this->get('/api/VideoTags/search.json?tag_name=frontside');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?rider_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick-slug=frontside-360');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=invalidorder');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=begin_time');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=created');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=modified');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?order=best');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_id=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?tag_slug=myslug');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?trick_slug=1');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?video_tag_ids=1,2,3');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?status=pending,invalidstatus');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard');\n $this->assertResponseOk();\n $this->get('/api/VideoTags/search.json?sport_name=snowboard&category_name=jib');\n $this->assertResponseOk();\n }", "public function test_city_search()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($god = $this->createGod())\n ->visit('/dashboard/cities')\n ->type('search_country', $this->setLocalizationByName('country'))\n ->waitForText($this->setLocalizationByName('country'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('country'));\n });\n\n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_state', $this->setLocalizationByName('state'))\n ->waitForText($this->setLocalizationByName('state'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('state'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_city', $this->setLocalizationByName('city'))\n ->waitForText($this->setLocalizationByName('city'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('city'));\n });\n \n $browser->click('.buttons-reset')\n ->pause(500)\n ->type('search_region', $this->setLocalizationByName('region'))\n ->waitForText($this->setLocalizationByName('region'))\n ->with('.table', function ($table) {\n $table->assertSee($this->setLocalizationByName('region'));\n });\n });\n }", "public function search(){}", "public function search();", "public function search();", "public function testSearchBy(): void\n {\n// $model::query();\n }", "public function testSearchModuleSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Create data stored by first user\n $this -> call('POST','api/classes',[\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"],\n 'key' => $this -> classSetting[\"key\"]\n ]);\n\n // Get module id\n $module = Module::where('code',$this -> classSetting[\"code\"])->first();\n $module_id = $module -> module_id;\n\n // Search module by code\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module by name\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"name\"]]);\n $this -> seeJsonEquals([[\n 'id' => $module_id,\n 'name' => $this -> classSetting[\"name\"],\n 'description' => $this -> classSetting[\"description\"],\n 'code' => $this -> classSetting[\"code\"]\n ]]);\n\n // Search module doesn't exist\n $this -> call('GET','api/classes/search',['string' => 'Module does not exist']);\n $this -> seeJsonEquals([]);\n }", "public function testPostVoicemailSearch()\n {\n }", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testFindFiles()\n {\n\n }", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testSeeNewProjectButton()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects');\n $response->assertSee(__('project.new_project'));\n }", "public function postProjectSearch(Request $request){\n\n $keyword=$request['keyWords'];\n $filter=$request['filter'];\n $projects=Project::all();\n $resultProjects=new Collection();\n foreach($projects as $project){\n\n if( (strpos($filter, 'id') !== false) and Str::equals(Str::lower($project->id),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n foreach($projects as $project){\n if($resultProjects->contains($project)){\n continue;\n }\n if((strpos($filter, 'client') !== false) and Str::contains(Str::lower($project->client_name),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n if((strpos($filter, 'title') !== false) and Str::contains(Str::lower($project->title),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n else if((strpos($filter, 'date') !== false) and Str::contains(Str::lower($project->date),Str::lower($keyword))){\n $resultProjects->add($project);\n }\n }\n return View::make('/project_management/search_results')->with('resultProjects',$resultProjects);\n }", "public function testProject() {\n $project = factory(\\App\\Project::class)->make();\n $project->method = 'Scrum';\n $project->save();\n\n $sprint = factory(\\App\\Sprint::class)->make();\n $sprint->project_id = $project->id;\n $sprint->save();\n\n $projectTemp = $sprint->project();\n $project = Project::find($project->id);\n\n $this->assertEquals($projectTemp, $project);\n $sprint->delete();\n $project->delete();\n }", "function testFindCompilations() {\n\t\t$result = $this->Album->find('compilation', array('limit' => 1, 'order' => 'release_date ASC'));\n\n\t\t$this->assertNotEmpty($result);\n\t\t$this->assertEquals($result[0]['Album']['title'], 'Micro_Superstarz_2000');\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "function testSearchByCustomField() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS&q[per_900][value]=200');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Green<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards'));\n\t}", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "function testSearchClasses() {\n $this->search->findClasses($this->test_class_dir . '/class.TestClass.php');\n\n // Create the array output that the class search should have generated.\n $comparison = array(\n $this->test_class_dir . '/class.TestClass.php' => array(\n 'TestClass'\n )\n );\n\n // Assert that they are equal.\n $this->assertEqual($this->search->getClassList(), $comparison,\n 'Single class search does not match expected result.');\n }", "public function testProjectProjectIDUsersUserIDGet()\n {\n }", "public function testSearch()\n {\n $manager = new Manager($this->minimal, $this->driver);\n\n // Exception handling\n $this->assertBindingFirst($manager, 'search');\n $manager->connect();\n $this->assertBindingFirst($manager, 'search');\n $manager->bind();\n\n $this->driver->getConnection()->setFailure(Connection::ERR_MALFORMED_FILTER);\n try {\n $res = $manager->search();\n $this->fail('Filter malformed, query shall fail');\n } catch (MalformedFilterException $e) {\n $this->assertRegExp('/Malformed filter/', $e->getMessage());\n }\n\n // Basic search\n $set = array(new Entry('a'), new Entry('b'), new Entry('c'));\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'dc=example,dc=com',\n '(objectclass=*)',\n SearchInterface::SCOPE_ALL,\n null,\n $set\n );\n\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n\n $data = array();\n foreach ($result as $key => $value) {\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\Node', $value);\n $data[$key] = $value->getAttributes();\n }\n\n $this->assertArrayHasKey('a', $data);\n $this->assertArrayHasKey('b', $data);\n $this->assertArrayHasKey('c', $data);\n $this->assertEquals(\n 3,\n count($data),\n 'The right search result got retrieved'\n );\n\n // Empty result set search\n $this->driver->getConnection()->setFailure(Connection::ERR_NO_RESULT);\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n $this->assertInstanceOf(\n 'Toyota\\Component\\Ldap\\Core\\SearchResult',\n $result,\n 'Query did not fail - Exception got handled'\n );\n\n $data = array();\n foreach ($result as $key => $value) {\n $data[$key] = $value->getAttributes();\n }\n $this->assertEquals(\n 0,\n count($data),\n 'The exception got handled and the search result set has not been set in the query'\n );\n\n // Alternative parameters search\n $result = $manager->search(\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n false,\n array('attr1', 'attr2')\n );\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n SearchInterface::SCOPE_ONE,\n array('attr1', 'attr2'),\n $set\n );\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n }", "public function test_admin_search_keyword_b()\n {\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_search()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search('/(index.php|.htaccess)/');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n $this->assertArrayHasKey(ROOT.DS.'.htaccess', $res);\n }", "function quick_search() {\n if(!$this->request->isAsyncCall()) {\n $this->redirectTo('search');\n } // if\n\n //BOF:mod 20110629 search\n if (trim($this->request->post('search_for'))!=''){\n\t\t//$_SESSION['search_string'] = trim($this->request->post('search_for'));\n\t }\n //$this->smarty->assign('search_string', $_SESSION['search_string']);\n //EOF:mod 20110629 search\n\n /*$object_types = array();\n $object_types[] = array('id' => '', 'text' => '');\n $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n mysql_select_db(DB_NAME, $link);\n $query = \"select distinct type from healingcrystals_project_objects order by type\";\n $result = mysql_query($query);\n while($type = mysql_fetch_assoc($result)){\n \t$object_types[] = array('id' => $type['type'], 'text' => $type['type']);\n }\n mysql_close($link);*/\n\t $search_projects = array();\n\t $link = mysql_connect(DB_HOST, DB_USER, DB_PASS);\n\t mysql_select_db(DB_NAME, $link);\n\t $query = \"select distinct a.project_id from healingcrystals_project_users a inner join healingcrystals_projects b on a.project_id=b.id where a.user_id='\" . $this->logged_user->getId() . \"' order by b.name\";\n\t $result = mysql_query($query);\n\t while($entry = mysql_fetch_assoc($result)){\n\t\t\t$search_projects[] = new Project($entry['project_id']);\n\t\t }\n\t mysql_close($link);\n $object_types = $this->get_object_types();\n if($this->request->isSubmitted()) {\n $search_for = trim($this->request->post('search_for'));\n $search_type = $this->request->post('search_type');\n $search_object_type = $this->request->post('search_object_type');\n $search_project_id = $this->request->post('search_project_id');\n\n if($search_for == '') {\n die(lang('Nothing to search for'));\n } // if\n\n $this->smarty->assign(array(\n 'search_for' => $search_for,\n 'search_type' => $search_type,\n 'search_object_type' => $search_object_type,\n 'object_types' => $object_types,\n 'search_project_id' => $search_project_id,\n 'search_projects' => $search_projects\n ));\n $per_page = 5;\n\n // Search inside the project\n if($search_type == 'in_projects') {\n\t\t //BOF:mod 20120822\n\t\t if ($search_object_type=='Attachment'){\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_attachments($search_for, $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t } else {\n\t\t //EOF:mod 20120822\n\t\t\t$template = get_template_path('_quick_search_project_objects', null, SYSTEM_MODULE);\n\t\t\tlist($results, $pagination) = search_index_search($search_for, 'ProjectObject', $this->logged_user, 1, $per_page, $search_object_type, $search_project_id);\n\t\t //BOF:mod 20120822\n\t\t }\n\t\t //EOF:mod 20120822\n\t\t \n // Search for people\n } elseif($search_type == 'for_people') {\n $template = get_template_path('_quick_search_users', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'User', $this->logged_user, 1, $per_page);\n\n // Search for projects\n } elseif($search_type == 'for_projects') {\n $template = get_template_path('_quick_search_projects', null, SYSTEM_MODULE);\n list($results, $pagination) = search_index_search($search_for, 'Project', $this->logged_user, 1, $per_page);\n\n // Unknown type\n } else {\n die(lang('Unknown search type: :type', array('type' => $search_type)));\n } // if\n\n $this->smarty->assign(array(\n 'results' => $results,\n 'pagination' => $pagination,\n ));\n\n $this->smarty->display($template);\n die();\n } else {\n \t$this->smarty->assign('object_types', $object_types);\n \t$this->smarty->assign('search_projects', $search_projects);\n }\n }", "public function testFilter()\n {\n // so here we just verify that the params are passed correctly internally\n $project_repository = $this->getMockBuilder(ProjectRepository::class)\n ->disableOriginalConstructor()\n ->setMethods(['scopeByDate', 'scopeWithTags', 'scopeWithoutTags',\n 'scopeByField', 'search'])->getMock();\n\n // with tags\n $project_repository->expects($this->once())->method('scopeWithTags')\n ->with($this->equalTo('badabing'));\n $project_repository->filter(['withTags' => 'badabing']);\n\n // without tags\n $project_repository->expects($this->once())->method('scopeWithoutTags')\n ->with($this->equalTo('badabeng'));\n $project_repository->filter(['withoutTags' => 'badabeng']);\n\n // with date\n $project_repository->expects($this->once())->method('scopeByDate')\n ->with($this->equalTo('27.01.2018'));\n $project_repository->filter(['date' => '27.01.2018']);\n\n // with search\n $project_repository->expects($this->once())->method('search')\n ->with($this->equalTo('jahade'));\n $project_repository->filter(['search' => 'jahade']);\n\n // default\n $project_repository->expects($this->once())->method('scopeByField')\n ->with(\n $this->equalTo('budget_price'),\n $this->equalTo('65000')\n );\n $project_repository->filter(['budget_price' => '65000']);\n }", "public function testSearchParams()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse, 15);\n\n $sw->search();\n $sw->search('testing123');\n $sw->search('', '2017-01-01');\n $sw->search('', '', '2017-01-02');\n $sw->search('', '2017-01-01', '2017-01-02');\n $sw->search('', '', '', 'Kyle');\n $sw->search('', '', '', '', 'Smith');\n $sw->search('', '', '', 'Kyle', 'Smith');\n $sw->search('', '', '', '', '', true);\n $sw->search('', '', '', '', '', false);\n $sw->search('', '', '', '', '', null);\n $sw->search('', '', '', '', '', null, true);\n $sw->search('', '', '', '', '', null, false);\n $sw->search('', '', '', '', '', null, true, 'testing');\n $sw->search('testing123', '', '', '', '', true);\n\n $this->checkGetRequests($container, [\n '/v4/search',\n '/v4/search?templateId=testing123',\n '/v4/search?fromDts=2017-01-01',\n '/v4/search?toDts=2017-01-02',\n '/v4/search?fromDts=2017-01-01&toDts=2017-01-02',\n '/v4/search?firstName=Kyle',\n '/v4/search?lastName=Smith',\n '/v4/search?firstName=Kyle&lastName=Smith',\n '/v4/search?verified=true',\n '/v4/search?verified=false',\n '/v4/search',\n '/v4/search',\n '/v4/search?sort=asc',\n '/v4/search?tag=testing',\n '/v4/search?templateId=testing123&verified=true'\n ]);\n }", "public function testProjectWithUser()\n {\n $user = factory(User::class)->create();\n \n $response = $this->actingAs($user)->get('/projects');\n $response->assertStatus(200);\n }", "function get_project_by_search($search,$approved = 0,$loc='') {\n\n\n\n $this->db->select('projects.id as id,project_slug,sub_category.price,category.id as cat_id, sub_category.id as sub_cat_id, projects.location,posted_by,budget,title,details,projects.file_path,projects.file_name,category.name as cat_name, sub_category.name as sub_cat_name,projects.duration');\n $this->db->from('projects');\n $this->db->where('users.deleted', '0');\n if($approved !=0){\n\n $this->db->where('projects.approved', $approved);\n }\n if(($search!='')){\n\n $this->db->like('projects.title', $search);\n }\n if(($loc!='')){\n \n $this->db->like('projects.location', $loc);\n }\n $this->db->join('category', 'category.id = projects.category','left outer');\n $this->db->join('sub_category', 'sub_category.id = projects.sub_category');\n $this->db->join('users', 'users.id = projects.posted_by');\n\n\n $query = $this->db->get();\n\n\n\n if ($query->num_rows() >= 1){ return $query->result_array(); }\n\n\n\n return false;\n\n }", "function search() {}", "public function testSearchMods()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testFindService()\n {\n\n }", "public function test_search_by_name()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search_by_name('index.php');\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function testFindTemplates()\n {\n\n }", "public function get_project_all(){\n }", "public function unitTests($unit) {\n\t\techo \"<p>Search Results Tests:</p><ul>\";\n\t\t\n\t\techo \"<li>Known Valid Search\";\n\t\t$searchStr = $this->search(\"motrin\");\n\t\t$searchObj = $this->search(\"motrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', 'String Requested, String Returned');\n\t\techo $unit->run($searchObj,'is_object', 'Object Requested, Object Returned');\n\t\techo $unit->run($searchObj->error,'is_null', 'Error object is null');\n\t\techo $unit->run(count($searchObj->results) > 0, true, \"Result object results array has contents.\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Known Invalid Search\";\n\t\t$searchStr = $this->search(\"wallbutrin\");\n\t\t$searchObj = $this->search(\"wallbutrin\", true);\n\n\t\techo $unit->run($searchStr,'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj,'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Empty Search\";\n\t\t$searchStr = $this->search(\"\");\n\t\t$searchObj = $this->search(\"\", true);\n\n\t\techo $unit->run($searchStr, 'is_string', \"String Requested, String Returned\");\n\t\techo $unit->run($searchObj, 'is_object', \"Object Requested, Object Returned\");\n\t\techo $unit->run($searchObj->error, 'is_object', \"Error object is valid\");\n\t\techo $unit->run($searchObj->error->code, 'NOT_FOUND', \"Error object contains code NOT_FOUND\");\n\n\t\techo \"</li>\";\n\n\t\techo \"</ul>\";\n\n\t\techo \"<p>Cache Results Tests</p><ul>\";\n\t\t$cacheTerm = \"testingTerm\";\n\t\t$cacheDataIn = json_encode(array('test' => true, 'error' => false));\n\n\t\techo \"<li>Cache sanity\";\n\t\t$this->_setCache($cacheTerm, $cacheDataIn);\n\t\t$cacheDataOut = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($cacheDataOut, $cacheDataIn, \"Cache returns the same values it was given\");\n\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Invalidated cache entry does not return a result\");\n\n\t\techo \"</li>\";\n\n\t\techo \"<li>Cache actually used and updated by search\";\n\t\t$cacheTerm = 'motrin';\n\t\t$this->_invalidateCache($cacheTerm);\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\n\t\techo $unit->run($fetchResult, 'is_false', \"Known Search cache invalidated\");\n\t\t$searchResult = $this->search($cacheTerm);\n\n\t\techo $unit->run($searchResult, 'is_string', \"Known Search returns string\");\n\n\t\t$fetchResult = $this->_getCache($cacheTerm);\n\t\techo $unit->run($searchResult, $fetchResult, \"Known search and cache entry match\");\n\n\t\t$searchResult2 = $this->search($cacheTerm);\n\t\techo $unit->run($searchResult2, $searchResult, \"Search returns same on cache miss and hit\");\n\n\t\techo \"</li>\";\n\t\techo \"</ul>\";\n\t}", "public function testGetSubprojects() {\n\t\t$t_project_name = $this->getNewProjectName();\n\t\t$t_project_data_structure = $this->newProjectAsArray( $t_project_name );\n\n\t\t$t_project_id = $this->client->mc_project_add( $this->userName, $this->password, $t_project_data_structure );\n\n\t\t$this->projectIdToDelete[] = $t_project_id;\n\n\t\t$t_projects_array = $this->client->mc_project_get_all_subprojects( $this->userName, $this->password, $t_project_id );\n\n\t\t$this->assertCount( 0, $t_projects_array );\n\t}", "public function testFindAllByName()\n {\n $this->assertCount(2, $this->appService->findAllByName('api'));\n }", "public function testSearchPermissionSets()\n {\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function testPsWithprojectOption()\n {\n $composeFiles = new ComposeFileCollection(['docker-compose.test.yml']);\n $composeFiles->setProjectName('unittest');\n\n $this->mockedManager->method('execute')->willReturn(array('output' => 'ok', 'code' => 0));\n\n $this->assertEquals($this->mockedManager->ps($composeFiles), 'ok');\n }", "public function testSearchDocument()\n {\n echo \"\\nTesting document search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function testIndex()\n {\n $request = $this->mockHttpRequest([]);\n $service = $this->mockGoogleSearchServiceBasic();\n $controller = new SearchResultsController($request, $service);\n\n $result = $controller->index();\n\n $this->assertInstanceOf(Views\\Index::class, $result);\n $this->assertIsArray($result->getData());\n $this->assertEquals($result->getData(), []);\n }", "public function testProjectAssignmentsRead()\n {\n }", "public function testOpenProjectWithUser()\n {\n $user = User::first();\n $project = $user->projects()->first();\n \\Auth::login($user);\n $response = $this->actingAs($user)->get('/projects/'.$project->id);\n $response->assertStatus(200);\n }", "public function testSearchModuleWithoutToken()\n {\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function testFindUsers()\n {\n\n }", "public function testProfileFind()\n {\n\n }", "private function getAllProjects($get) {\n $projectModel = new ProjectsModel();\n $projectModel->join('priorities', 'priorities.id = projects.priority','Left');\n $projectModel->join('users', 'users.id = projects.responsible','Left');\n\n if(isset($get['keywords']) && trim($get['keywords'])) {\n $projectModel->groupStart();\n $projectModel->like('projects.code', $get['keywords']);\n $projectModel->orLike('projects.name', $get['keywords']);\n $projectModel->orLike('priorities.name', $get['keywords']);\n $projectModel->orLike('projects.assign_to', $get['keywords']);\n $projectModel->groupEnd();\n }\n //coulmn search\n if(isset($get['code_id']) && trim($get['code_id']))\n $projectModel->where('projects.code', $get['code_id']);\n if(isset($get['name']) && trim($get['name']))\n $projectModel->where('projects.name', $get['name']);\n/*\n if(isset($get['priority']) && trim($get['priority']))\n $projectModel->where('priorities.name', $get['priority']);*/\n if(isset($get['priority']) and $get['priority'] != ''){\n $projectModel->like('projects.priority',$get['priority']);\n }\n \n if (!empty($get['start_at'])) \n $projectModel->where('DATE_FORMAT(projects.start_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['start_at'])));\n if (!empty($get['end_at'])) \n $projectModel->where('DATE_FORMAT(projects.end_at,\"%Y-%m-%d\") =', date('Y-m-d',strtotime($get['end_at'])));\n\n \n $data['totalProject'] = ((new ProjectsModel())->select('count(*) as totalProject')->first())['totalProject'];\n $projectModel->select('projects.id,projects.code,projects.name, priorities.name as priority, CONCAT(users.fname,\" \",users.lname) as responsible,projects.assign_to,projects.start_at,projects.end_at,projects.description, projects.created_at, projects.created_by, projects.updated_at, projects.updated_by, projects.status');\n $projectModel->where('projects.status','1');\n $data['projects'] = $projectModel->orderBy($get['sortby'], $get['sort_order'])->findAll($get['rows'], ($get['pageno']-1)*$get['rows']);\n $data['params'] = $get;\n $prioritiesModel = new PrioritiesModel();\n $query = $prioritiesModel->findAll();\n $data['priorities'] = $query;\n //\n $userModel = new UsersModel();\n $str_query = $userModel->findAll();\n $data['users'] = $str_query;\n // /print_r($data);exit();\n return $data;\n }", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function searchProjects($conditions)\n {\n $em = $this->getDoctrine()->getManager();\n $projects = $em->getRepository('AppBundle:Project')->findAll();\n $normalizer = new ObjectNormalizer(null, new CamelCaseToSnakeCaseNameConverter());\n\n foreach ($projects as $key => $project) {\n $projects[$key] = $normalizer->normalize($project);\n\n }\n return $projects;\n }", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "public function testFindServiceData()\n {\n\n }", "public function testSearchResults()\n {\n $search = new SmartwaiverSearch([\n 'guid' => 'TestingGUID',\n 'count' => 5,\n 'pages' => 1,\n 'pageSize' => 100\n ]);\n\n $numWaivers = 5;\n\n $apiResponse = APISuccessResponses::searchResults($numWaivers);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $waivers = $sw->searchResult($search, 0);\n\n $this->assertCount($numWaivers, $waivers);\n foreach($waivers as $waiver) {\n $this->assertInstanceOf(SmartwaiverWaiver::class, $waiver);\n }\n\n $this->checkGetRequests($container, [\n '/v4/search/' . $search->guid . '/results?page=0'\n ]);\n }", "public function testGetInstitutionsUsingGET()\n {\n }", "function search()\n\t{}", "function search()\n\t{}", "public function test_create_project()\n {\n $response = $this->post('/project', [\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n \n $response->assertStatus(302);\n }", "public static function searchNamespace()\n\t{\n\t\treturn 'project';\n\t}", "protected function tweakTaskSearch() {\n\t\tparent::setProjectsInTaskSearchForManager(false);\n\t}", "public function test_search_returns_results_for_pages() {\n\t\tinclude_once ABSPATH . 'wp-admin/includes/nav-menu.php';\n\n\t\tself::factory()->post->create_many(\n\t\t\t3,\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'foo',\n\t\t\t)\n\t\t);\n\t\tself::factory()->post->create(\n\t\t\tarray(\n\t\t\t\t'post_type' => 'page',\n\t\t\t\t'post_content' => 'bar',\n\t\t\t)\n\t\t);\n\n\t\t$request = array(\n\t\t\t'type' => 'quick-search-posttype-page',\n\t\t\t'q' => 'foo',\n\t\t\t'response-format' => 'json',\n\t\t);\n\n\t\t$output = get_echo( '_wp_ajax_menu_quick_search', array( $request ) );\n\t\t$this->assertNotEmpty( $output );\n\n\t\t$results = explode( \"\\n\", trim( $output ) );\n\t\t$this->assertCount( 3, $results );\n\t}" ]
[ "0.81959957", "0.6858462", "0.6852012", "0.6753273", "0.66946334", "0.6673342", "0.6618049", "0.6564328", "0.6496258", "0.64323014", "0.6419851", "0.6401977", "0.639658", "0.63620675", "0.63539433", "0.63435453", "0.6327412", "0.6318944", "0.63020056", "0.6277252", "0.6253027", "0.6215104", "0.6202289", "0.6196944", "0.61906946", "0.6185744", "0.6147885", "0.61286", "0.6128118", "0.60922074", "0.60903835", "0.60875905", "0.6068737", "0.6032634", "0.6031003", "0.60246485", "0.6022071", "0.6007277", "0.59859926", "0.5983449", "0.59790504", "0.59790504", "0.59767216", "0.5957828", "0.595666", "0.59483546", "0.5947138", "0.5944084", "0.5916591", "0.5912476", "0.5906247", "0.5900608", "0.58914185", "0.58782744", "0.58765733", "0.58707047", "0.58584374", "0.58526886", "0.58274925", "0.5823303", "0.5816746", "0.58142346", "0.58009464", "0.5795413", "0.57911307", "0.5790557", "0.5783839", "0.57747084", "0.5766855", "0.5740437", "0.5733471", "0.5733471", "0.57063615", "0.570623", "0.5706226", "0.57044804", "0.57035536", "0.5698962", "0.5683342", "0.56706727", "0.5668012", "0.56654245", "0.56596917", "0.56550753", "0.56549656", "0.56509703", "0.5643708", "0.5635919", "0.56352556", "0.5632435", "0.56273425", "0.56242764", "0.56099665", "0.5604748", "0.5600299", "0.55967516", "0.55967516", "0.5581596", "0.55748904", "0.55641735", "0.5560172" ]
0.0
-1
Testing the subject deletion. Note that this is logical deletion. The subject will remain in the Elasticsearch
public function testDeleteSubject() { echo "\nTesting subject deletion..."; $id = "0"; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/subjects/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/subjects/".$id; $response = $this->curl_delete($url); // echo $response; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDeleteDocument()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testPostAuthorizationSubjectBulkremove()\n {\n }", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "public function testDeleteAuthorizationSubjectDivisionRole()\n {\n }", "public function deleted(Subject $subject)\n {\n $this->updateHasChange($subject,2);\n }", "public function testDeleteDocument()\n {\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testSendDeletesOnly()\n {\n $expectedBody = $this->getExpectedBody([], ['test123']);\n $this->mockEndpoint();\n $this->mockCurl($expectedBody);\n\n $this->subject->addDelete('test123');\n $responses = $this->subject->send();\n\n $this->assertEquals(1, count($responses));\n\n $this->assertEquals(\n [\n 'status' => 200,\n 'body' => ''\n ],\n $responses[0]\n );\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function subjects_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteSubject($id);\n $this->response($result); \n }", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function destroy(Subject $subject)\n {\n //where('id', 1)->wherePivot('year', 2011)->detach(1);\n \n $subject->delete();\n $subject->tutors()->detach();\n return redirect()->route('subject.index');\n }", "public function testRejectMatchingSuggestionsUsingDELETE()\n {\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testDeleteIfAuthor()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $this->logInAsUser();\n\n $this->task->setUser($this->authUser);\n $this->client->request('GET', '/tasks/'.$id.'/delete');\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été supprimée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testMarketingCampaignsTypesIdSubTypesSubTypeIdDelete()\n {\n\n }", "public function testSearchSubject()\n {\n echo \"\\nTesting subject search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function test_deleteSubscriber() {\n\n }", "public function testDelete()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 60, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // delete\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([60])\n ->setIdName('id')\n ->build();\n\n $this->cacheManager->delete($searchCriteria);\n\n // search\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertFalse($searchResult->hasData());\n $this->assertEquals(0, $searchResult->count());\n $this->assertCount(1, $searchResult->getMissedData());\n }", "public function testUpdateSubject()\n {\n echo \"\\nTesting subject update...\";\n $id = \"0\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('subject_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function testDeleteMetadata1UsingDELETE()\n {\n }", "public function testDeleteReplenishmentTag()\n {\n }", "public function forceDeleted(Subject $subject)\n {\n //\n }", "public function testDeleteMember()\n {\n }", "public function testQuarantineDeleteById()\n {\n\n }", "function delete_level_subject($id)\n {\n return $this->db->delete('level_subjects',array('id'=>$id));\n }", "public function testMakeDeleteRequest()\n {\n $client = new MockClient('https://api.xavierinstitute.edu', [\n new JsonResponse([\n 'success' => [\n 'code' => 200,\n 'message' => 'Deleted.',\n ],\n ], 200),\n ]);\n\n $this->assertEquals($client->delete('teachers/1'), true);\n }", "public function testDeleteWrongObjectTypeSubmitAsAdmin()\n {\n $crawler = $this->requestAsAdmin('/tasks');\n\n // Can't use assertSelectorTextContains() because it only checks the first selector occurrence\n // and the task we are looking for is not the first one in the displayed list of tasks.\n // See: https://github.com/symfony/symfony-docs/issues/13036\n //$this->assertSelectorTextContains('h4 > a', 'Tâche Eric n°1');\n $this->assertEquals(1, $crawler->filter('h4 > a:contains(\"Tâche Eric n°1\")')->count());\n\n // Then we delete it\n $task_id = self::getTaskIdByTitle('Tâche Eric n°1');\n\n $this->requestAsAdmin('/tasks/'.$task_id.'/delete');\n\n $crawler = $this->client->followRedirect();\n\n $this->assertRegExp('/tasks$/', $crawler->getUri());\n $this->assertContains(\n 'La tâche a bien été supprimée.',\n $this->client->getResponse()->getContent()\n );\n $this->assertSelectorTextNotContains('h4 > a', 'Tâche Eric n°1');\n }", "public function testDeleteMetadata2UsingDELETE()\n {\n }", "public function testDeleteMessageOkay()\n {\n $this->deleteMessageTest(true);\n }", "public function testDelete()\n {\n }", "public function testDeleteIdsIdxObjectTypeObject(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // Using the existing $index variable which is \\Elastica\\Index object\n $index->getClient()->deleteIds($ids, $index);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "public function testDeleteIdsIdxString(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // And verify that the variables we are doing to send to\n // deleteIds are the type we are testing for\n $idxString = $index->getName();\n\n // Using the existing $index variable that is a string\n $index->getClient()->deleteIds($ids, $idxString);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "public function testDeleteDelete()\n {\n $this->mockSecurity();\n $this->_loginUser(1);\n $source = 2;\n\n $readPostings = function () use ($source) {\n $read = [];\n $read['all'] = $this->Entries->find()->all()->count();\n $read['source'] = $this->Entries->find()\n ->where(['category_id' => $source])\n ->count();\n\n return $read;\n };\n\n $this->assertTrue($this->Categories->exists($source));\n $before = $readPostings();\n $this->assertGreaterThan(0, $before['source']);\n\n $data = ['mode' => 'delete'];\n $this->post('/admin/categories/delete/2', $data);\n\n $this->assertFalse($this->Categories->exists($source));\n $this->assertRedirect('/admin/categories');\n\n $after = $readPostings();\n $this->assertEquals(0, $after['source']);\n $expected = $before['all'] - $before['source'];\n $this->assertEquals($expected, $after['all']);\n }", "public function testDeleteSingleSuccess()\n {\n $entity = $this->findOneEntity();\n\n // Delete Entity\n $this->getClient(true)->request('DELETE', $this->getBaseUrl() . '/' . $entity->getId(),\n [], [], ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n }", "function test_treatments_can_be_deleted_true()\n {\n $this->seed();\n \n $user = User::where('email', '=', '[email protected]')->first();\n\n $treatments = Treatment::factory()\n ->count(3)\n ->for($user)\n ->create();\n $treatment = Treatment::first();\n \n $token = JWTAuth::fromUser($user);\n $response = $this->json('DELETE', '/api/treatments/'.$treatment->id.'?token='.$token);\n $response->assertNoContent();\n }", "public function reset($subject)\n {\n $subject = $this->key . ':' . $subject;\n\n return (bool) $this->client->del($subject);\n }", "public function testDeleteEnrollmentRequest()\n {\n }", "public function testDelete()\n\t{\n\t\t$obj2 = $this->setUpObj();\n\t\t$response = $this->call('DELETE', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah sudah terdelete\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($obj2->attributesToArray() as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\t}", "public function testValidDelete() {\n\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//perform the actual delete\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(),\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t// grab the data from guzzle and enforce that the status codes are correct\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//try retrieving entry from database and ensuring it was deleted\n\t\t$deletedOrg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());\n\t\t$this->assertNull($deletedOrg);\n\n\t}", "public function testDeleteCategoryUsingDELETE()\n {\n }", "function delete( string $_group_key, IIndexedEntity $_entity ): bool;", "public function testDeleteNotTrashedAndOwnCreated()\r\n {\r\n //create teacher user\r\n $teacher = $this->CreateTeacher();\r\n $lisUser = $this->CreateTeacherUser($teacher);\r\n\r\n //now we have created studentuser set to current controller\r\n $this->controller->setLisUser($lisUser);\r\n $this->controller->setLisPerson($teacher);\r\n\r\n $subjectRound = $this->CreateSubjectRound();\r\n $student = $this->CreateStudent();\r\n $anotherTeacher = $this->CreateTeacher();\r\n //$studentGrade = $this->CreateStudentGrade();\r\n\r\n $independentWork = $this->CreateIndependentWork([\r\n 'name' => uniqid() . 'Name',\r\n 'duedate' => new \\DateTime,\r\n 'description' => uniqid() . ' Description for independentwork',\r\n 'durationAK' => (int) uniqid(),\r\n 'subjectRound' => $subjectRound->getId(),\r\n 'teacher' => $anotherTeacher->getId(),\r\n 'student' => $student->getId(),\r\n 'createdBy' => $lisUser->getId()\r\n ]);\r\n\r\n\r\n $this->em->persist($independentWork);\r\n $this->em->flush($independentWork);\r\n\r\n $id = $independentWork->getId();\r\n\r\n //prepare request\r\n $this->routeMatch->setParam('id', $id);\r\n\r\n $this->request->setMethod('delete');\r\n $result = $this->controller->dispatch($this->request);\r\n $response = $this->controller->getResponse();\r\n\r\n $this->PrintOut($result, false);\r\n\r\n //assertions\r\n $this->assertEquals(200, $response->getStatusCode());\r\n $this->assertEquals(false, $result->success);\r\n $this->assertEquals('NOT_TRASHED', $result->message);\r\n }", "public function testDeleteAction()\n {\n $res = $this->controller->deleteAction();\n $this->assertContains(\"Delete\", $res->getBody());\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "function mDELETE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DELETE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:14:3: ( 'delete' ) \n // Tokenizer11.g:15:3: 'delete' \n {\n $this->matchString(\"delete\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }", "public function testDeleteMetadata3UsingDELETE()\n {\n }", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function testDeleteFail() {\n $this->delete('/api/author/100')\n ->seeJson(['message' => 'invalid request']);\n }", "public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function testDeleteCampaignFromPromotionUsingDELETE()\n {\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "protected function deleted()\n {\n $this->response = $this->response->withStatus(204);\n $this->jsonBody($this->payload->getOutput());\n }", "public function postDelete() {\n if ($server = $this->server()) {\n if ($server->enabled) {\n $server->removeIndex($this);\n }\n // Once the index is deleted, servers won't be able to tell whether it was\n // read-only. Therefore, we prefer to err on the safe side and don't call\n // the server method at all if the index is read-only and the server\n // currently disabled.\n elseif (empty($this->read_only)) {\n $tasks = variable_get('search_api_tasks', array());\n $tasks[$server->machine_name][$this->machine_name] = array('remove');\n variable_set('search_api_tasks', $tasks);\n }\n }\n\n // Stop tracking entities for indexing.\n $this->dequeueItems();\n }", "public function testSystemMembersTypesIdDelete()\n {\n\n }", "public function testDelete()\n {\n\n $this->createDummyRole();\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n ]);\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->deleteAction,\n 'id' => 1,\n ));\n\n $this->assertDatabaseMissing('roles', [\n 'id' => 1,\n ]);\n\n $this->assertDatabaseMissing('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testDeleteMetadata()\n {\n }", "public function testCreateSubject()\n {\n echo \"\\nTesting Subject creation...\";\n $input = file_get_contents('subject.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/subjects?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "function deletecouse_subjects(){\n\n\t\t$course_Module_id = $this->input->post('id'); // this input post came on custom js\n\n\t\t$this->setting_model->delete('course_module_subject','module_id',$course_Module_id);\n\n\t\t//================= Activity Log Monitoring==========================//\n $activity_log_activity = \"One of course deleted\"; \n\n $activitylogs = array( \n 'activity_log_activity' =>$activity_log_activity, \n 'activity_date'=> date('Y-m-d h:i:s:a') ,\n 'user_id'=> $this->session->userdata('user_id')\n ); \n\n $this->setting_model->insert($activitylogs , 'activity_log');\n\n //==================== Activity Log Monitoring End=====================//\n\t}", "public function testDelete()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table2',\r\n\t\t));\r\n\r\n\t\t// Delete all indices\r\n\t\tforeach($table->indices AS $index)\r\n\t\t{\r\n\t\t\t$this->assertNotSame(false, $index->delete());\r\n\t\t}\r\n\r\n\t\t// Reload table\r\n\t\t$table->refresh();\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(0, count($table->indices));\r\n\t}", "public function testQuestionDeleteWithValidData() {\n $response = $this->get('question/' . $this->question->id . '/delete');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function testWorkflowsWorkflowIdDelete()\n {\n }", "public function testDelete()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t// On clique sur le lien entreprise de test\n\t\t$crawler = $client->request('GET', '/clients');\n\t\t$link = $crawler->filter('.bloc__title a:contains(\"Entreprise de test\")')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Entreprise de test\")')->count());\n\n\t\t// On clique sur le bouton modifier\n\t\t$link = $crawler->filter('.btn--delete')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('.breadcrumb:contains(\"Supprimer\")')->count()); \n\n\t\t// On modifie le métier\n\t\t$form = $crawler->selectButton('Supprimer')->form();\n\t\t$crawler = $client->submit($form);\t\n\n\t\t//On vérifie que ça a marché\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Le client a bien été supprimé.\")')->count());\n\n\t}", "public function testOnDeletedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $obj->onDeletedDocument($this->doc1);\n $this->assertFileNotExists($this->directory . \"/1/2/4\");\n }", "public function testDeleteVoicemailMessage()\n {\n }", "function testDeleteSecurity() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\t\t$anonymous = new AntUser($dbh, USER_ANONYMOUS); // should only be a member of the everyone group\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $anonymous);\r\n\t\t$this->assertFalse($obj->remove());\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->remove();\r\n\t\t$obj->remove();\r\n\t}", "public function testDeleteAuthorizationDivision()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function testSpecificAllowedEmailAddressDelete()\n {\n }", "public function testDeleteIfNotAuthor()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $this->logInAsUser();\n\n $this->client->request('GET', '/tasks/'.$id.'/delete');\n\n $title = $this->task->getTitle();\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Oops! La tâche '.$title.' n\\'a pas été supprimée car vous n\\'en êtes pas l\\'auteur.', $crawler->filter('div.alert.alert-danger')->text());\n }", "public function testDeleteMessageFailed()\n {\n $this->deleteMessageTest(false);\n }", "public function test_deleteMessage() {\n\n }", "public function testDeleteAttachment()\n {\n }", "public function fnDeletestaffsubject($idStaffSubject ) {\r\n\t\t\t$db = Zend_Db_Table::getDefaultAdapter();\r\n\t\t\t$table = \"tbl_staffsubject\";\r\n\t \t$where = $db->quoteInto('idStaffSubject = ?', $idStaffSubject);\r\n\t\t\t$db->delete($table, $where);\r\n\t }", "public function testDeleteTrashedAndNotOwnCreated()\r\n {\r\n //create teacher user\r\n $teacher = $this->CreateTeacher();\r\n $lisUser = $this->CreateTeacherUser($teacher);\r\n\r\n //now we have created teacheruser set to current controller\r\n $this->controller->setLisUser($lisUser);\r\n $this->controller->setLisPerson($teacher);\r\n \r\n //create other teacher user\r\n $otherTeacher = $this->CreateTeacher();\r\n $otherLisUser = $this->CreateTeacherUser($otherTeacher);\r\n\r\n $subjectRound = $this->CreateSubjectRound();\r\n $student = $this->CreateStudent();\r\n //$anotherTeacher = $this->CreateTeacher();\r\n \r\n\r\n $independentWork = $this->CreateIndependentWork([\r\n 'name' => uniqid() . 'Name',\r\n 'duedate' => new \\DateTime,\r\n 'description' => uniqid() . ' Description for independentwork',\r\n 'durationAK' => (int) uniqid(),\r\n 'subjectRound' => $subjectRound->getId(),\r\n 'teacher' => $otherTeacher->getId(),\r\n 'student' => $student->getId(),\r\n 'createdBy' => $otherLisUser->getId()\r\n ]);\r\n\r\n $independentWork->setTrashed(1);\r\n $this->em->persist($independentWork);\r\n $this->em->flush($independentWork);\r\n\r\n $id = $independentWork->getId();\r\n\r\n //prepare request\r\n $this->routeMatch->setParam('id', $id);\r\n\r\n $this->request->setMethod('delete');\r\n $result = $this->controller->dispatch($this->request);\r\n $response = $this->controller->getResponse();\r\n\r\n $this->PrintOut($result, false);\r\n\r\n //assertions\r\n $this->assertEquals(200, $response->getStatusCode());\r\n $this->assertEquals(false, $result->success);\r\n $this->assertEquals('SELF_CREATED_RESTRICTION', $result->message);\r\n }", "public function testDeleteVoicemailMessages()\n {\n }", "public function testDelete(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $article = $table->find()->first();\n $this->assertTrue($table->delete($article));\n\n $translations = $this->getTableLocator()->get('I18n')->find()\n ->where(['model' => 'Articles', 'foreign_key' => $article->id])\n ->count();\n $this->assertSame(0, $translations);\n }", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function test_delete_item() {}", "public function test_delete_item() {}", "public function test_delete_components() {\n $result = cy\\JORK::from('Model_Topic')\n ->with('posts')\n ->where('id', '=', cy\\DB::esc(1))\n ->exec('jork_test');\n $topic = $result[0];\n $topic->delete();\n $this->assertEquals(2, count(DB::select()->from('t_posts')\n ->where('topicFk', 'is', NULL)->exec('jork_test')));\n\n }", "public function testDeleteUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "public function testDeleteTemplate()\n {\n\n }", "public function onDeleting($payload): bool\n {\n $type = get_class($payload);\n $id = $payload->id;\n\n TranslationModel::where('entity_id', $id)->where('entity_type', $type)->delete();\n return true;\n }", "public function testDeleteReport() {\n $operator = $this->createOperator();\n $patient = $this->createPatient();\n $report = $this->createReport($patient);\n $this->actingAs($operator)->visit(\"dashboard\")->see(\"delete_$report->id\")\n ->press(\"delete_$report->id\")\n ->seePageIs(\"dashboard\")\n ->dontSee($patient->name)\n ->dontSee($report->report_name)\n ->dontSee(\"delete_$report->id\")\n ->dontSee($report->case_number);\n \n $this->deleteReport($report);\n $this->deleteUser($patient);\n $this->deleteUser($operator);\n }", "public function testDeleteBrandUsingDELETE()\n {\n }", "public function testDelete()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function test_it_can_delete_an_entity()\n {\n $this->mockHandler\n ->append(\n new Response(200, [], file_get_contents(__DIR__ . '/fixture/delete_response_success.json'))\n );\n $response = $this->client->delete('db2e5c63-3c54-4962-bf4a-d6ced1e9cf33');\n $this->assertEquals(DeleteEntityRepository::RESULT_SUCCESS, $response);\n }", "public function removeFromIndex(Searchable $subject)\n {\n $this->elasticsearch->delete(\n [\n 'index' => $this->indexName,\n 'type' => $subject->getSearchableType(),\n 'id' => $subject->getSearchableId(),\n ]\n );\n }", "function deleteThemengebietes() {\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_topic_detail', 'uid='.intval(t3lib_div::_POST('uid')));\n\t\treturn $status;\n\t}", "public function index_delete(){\n\t\t\n\t\t}", "public function testDeleteSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/admin/deferred/delete/2';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been deleted.'));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function DELETE() {\n #\n }", "public function destroy($id)\n {\n if ($this->_repo->deleteSubject($id)){\n return $this->respondWithSuccess(\"subject Deleted Success fully\");\n }\n return $this->respondWithError(\"Sorry Could not delete the subject\");\n }", "public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}" ]
[ "0.777233", "0.69906515", "0.6699793", "0.6470792", "0.64638245", "0.6381767", "0.6278607", "0.6157048", "0.61286646", "0.6072591", "0.6058868", "0.60418016", "0.6032439", "0.60274434", "0.60081273", "0.60062474", "0.60042393", "0.59941715", "0.5994005", "0.59828883", "0.5974379", "0.5970258", "0.59701556", "0.5965135", "0.5961059", "0.59529316", "0.593857", "0.59268343", "0.5920076", "0.5913776", "0.589723", "0.58938843", "0.5888247", "0.5878572", "0.5874439", "0.58743167", "0.5871734", "0.5870683", "0.5863591", "0.5861991", "0.5845858", "0.5838497", "0.58371675", "0.58370465", "0.582255", "0.5813203", "0.5809092", "0.58072007", "0.5807074", "0.57995", "0.5781872", "0.57809055", "0.57807004", "0.5776635", "0.5765198", "0.5762359", "0.5750109", "0.5749349", "0.57477957", "0.57433224", "0.57379466", "0.5728426", "0.57193595", "0.57186395", "0.57140607", "0.5711408", "0.5699761", "0.5698011", "0.5696818", "0.5689628", "0.56893307", "0.568883", "0.568883", "0.56872714", "0.568617", "0.5683579", "0.56833565", "0.5670871", "0.5669236", "0.5667957", "0.5666648", "0.5662272", "0.5660054", "0.5653369", "0.5653369", "0.56498754", "0.56473964", "0.5633111", "0.5631667", "0.5628815", "0.5628026", "0.5627554", "0.56274", "0.56209266", "0.5618988", "0.5618874", "0.5618362", "0.56176126", "0.5616754", "0.56145006" ]
0.8416284
0
Testing the experiment creation.
public function testCreateDocument() { echo "\nTesting document creation..."; $input = file_get_contents('doc.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/documents?owner=wawong"; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_post($url,$data); //echo "-----Create Response:".$response; $result = json_decode($response); $this->assertTrue(!$result->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testInstrumentCreate()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code',uniqid('TestInstrument_'))\n ->type('@category', 'Dusk Testing')\n ->type('@module','Summer Capstone')\n ->type('@reference','Test - safe to delete')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('View Instrument - TestInstrument_');\n });\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function run()\n {\n // $faker = \\Faker\\Factory::create();\n // Assessment::create([\n // 'teacher_id' => rand(0, 10),\n // 'pupil_id' => rand(0, 10),\n // 'test_id' => rand(0, 10),\n // 'assessment_no' => rand(0, 120),\n // 'assessment_date' => $faker->date,\n // ]);\n factory(App\\Models\\Assessment::class, 10)->create();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/authors/create')\n ->type('name', 'John')\n ->type('lastname', 'Doe')\n ->press('Save')\n ->assertPathIs('/authors')\n ->assertSee('John')\n ->assertSee('Doe');\n });\n }", "public function testIntegrationCreate()\n {\n $this->visit('user/create')\n ->see('Create New Account');\n $this->assertResponseOk();\n $this->assertViewHas('model');\n }", "public function testCreateChallengeActivityTemplate()\n {\n }", "public function testCreateScenario()\n {\n $client = static::createClient();\n }", "public function testCreateNew()\n {\n $diagramApi = TestBase::getDiagramApi();\n $json = $diagramApi->createNew(DrawingTest::$fileName,TestBase::$storageTestFOLDER,\"true\");\n $result = json_decode($json);\n $this->assertNotEmpty( $result->Created);\n TestBase::PrintDebugInfo(\"TestCreateNew result:\".$json);\n\n }", "public function testCreate()\n {\n \t$game_factory = factory(Game::class)->create();\n\n $this->assertTrue($game_factory->wasRecentlyCreated);\n }", "public function testAdministrationCreateTraining()\n {\n // Used to fill hidden inputs\n Browser::macro('hidden', function ($name, $value) {\n $this->script(\"document.getElementsByName('$name')[0].value = '$value'\");\n\n return $this;\n });\n\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login())\n ->loginAsUser('[email protected]', 'password');\n\n $browser->assertSee('Formations')\n ->click('@trainings-link')\n ->waitForText('Aucune donnée à afficher')\n ->assertSee('Aucune donnée à afficher')\n ->clickLink('Ajouter formation')\n ->assertPathIs('/admin/training/create');\n\n $name = 'Test create training';\n\n $browser->type('name', $name)\n ->hidden('visible', 1)\n ->press('Enregistrer et retour');\n\n $browser->waitForText($name)\n ->assertSee($name)\n ->assertDontSee('Aucune donnée à afficher')\n ->assertPathIs('/admin/training');\n\n $browser->visit('/')\n ->assertSee('Pas de formation en groupe annoncée pour l\\'instant')\n ->assertDontSee($name);\n });\n }", "public function testCreateChallengeTemplate()\n {\n }", "public function testCreate()\n\t{\n\t\tRoute::enableFilters();\n\t\tEvaluationTest::adminLogin();\n\t\t$response = $this->call('GET', '/evaluation/create');\n\t\t\n\t\t$this->assertResponseOk();\n\n\t\tSentry::logout();\n\t\t\n\t\t//tesing that a normal user can't retrieve a form to create \n\t\t//an evaluation and that a page displays a message as to why they can't\n\t\tEvaluationTest::userLogin();\n\t\t$crawler = $this->client->request('GET', '/evaluation/create');\n\t\t$message = $crawler->filter('body')->text();\n\n\t\t$this->assertFalse($this->client->getResponse()->isOk());\n\t\t$this->assertEquals(\"Access Forbidden! You do not have permissions to access this page!\", $message);\n\n\t\tSentry::logout();\n\t}", "public function testCreateChallengeActivity()\n {\n }", "public function testQuarantineCreate()\n {\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Locator\\\\ResultSetInterface', $subject, 'Subject is not a valid locator result set');\n $this->assertInstanceOf('Dhii\\\\SimpleTest\\\\Test\\\\SourceInterface', $subject, 'Subject is not a valid test source');\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testWebinarCreate()\n {\n }", "public function testCreateChallenge()\n {\n }", "public function testCreate()\n {\n \t$player_factory = factory(KillingMode::class)->create();\n\n $this->assertTrue($player_factory->wasRecentlyCreated);\n }", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\n }", "protected function createTests()\n {\n $name = $this->getNameInput();\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Store{$name}Test\",\n '--model' => $name,\n '--type' => 'store',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Update{$name}Test\",\n '--model' => $name,\n '--type' => 'update',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/View{$name}Test\",\n '--model' => $name,\n '--type' => 'view',\n ]);\n\n $this->call('make:test', [\n 'name' => \"Api/{$name}/Delete{$name}Test\",\n '--model' => $name,\n '--type' => 'delete',\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance(['_getArgsForDefinition']);\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testGetChallengeActivityTemplate()\n {\n }", "public function testInstance() { }", "public function testCreate()\n {\n $this->visit('/admin/school/create')\n ->submitForm($this->saveButtonText, $this->school)\n ->seePageIs('/admin/school')\n ;\n\n $this->seeInDatabase('schools', $this->school);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Output\\TemplateInterface',\n $subject,\n 'Test subject does not implement expected parent interface.'\n );\n }", "public function testCreateTestSuite()\n {\n Artisan::call('migrate');\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->seePageIs('/library')\n ->click('#newSuite')\n ->seePageIs('/library/testsuite/create')\n ->type('TestSuite1', 'name')\n ->type('someDescription', 'description')\n ->type('someGoals', 'goals')\n ->press('submit');\n\n $this->seeInDatabase('TestSuite', [\n 'Name' => 'TestSuite1',\n 'TestSuiteDocumentation' => 'someDescription',\n 'TestSuiteGoals' => 'someGoals'\n ]);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInternalType(\n 'object',\n $subject,\n 'A valid instance of the test subject could not be created.'\n );\n }", "protected function createTest()\n {\n $name = Str::studly($this->argument('name'));\n\n $this->call('make:test', [\n 'name' => 'Controllers\\\\' . $name . 'Test',\n '--unit' => false,\n ]);\n }", "public function testCreate()\n {\n $model = $this->makeFactory();\n \n $this->json('POST', static::ROUTE, $model->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_CREATED) \n ->seeJson($model->toArray());\n }", "public function testCreateAction()\n {\n $res = $this->controller->createAction();\n $this->assertContains(\"Create\", $res->getBody());\n }", "public function testInit()\n {\n\n }", "public function testProjectCreation()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->make();\n $response = $this->actingAs($user)\n ->post(route('projects.store'), [\n 'owner_id' => $user->id,\n 'name' => $project->name,\n 'desc' => $project->desc\n ]);\n $response->assertSessionHas(\"success\",__(\"project.save_success\"));\n\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(static::TEST_SUBJECT_CLASSNAME, $subject, 'A valid instance of the test subject could not be created.');\n $this->assertInstanceOf('OutOfRangeException', $subject, 'Subject is not a valid out of range exception.');\n $this->assertInstanceOf('Dhii\\Exception\\OutOfRangeExceptionInterface', $subject, 'Subject does not implement required interface.');\n }", "public function testJobAdd()\n {\n\n }", "public function testGetChallengeTemplate()\n {\n }", "public function testExample()\n {\n //make unauthorized user\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/newcache')\n ->type('The best cache ever', 'name')\n ->type('94.234324234,-35.74352343', 'location')\n ->type('small', 'size')\n ->type('traditional', 'type')\n ->type('like fo reals this is short yo', 'short_description')\n ->type('like fo reals this is the longest description that could be possible yo. but I am a creative fellow \n and I need to express my art in the form of comments that is where I actually discuss the true meaning of \n life and that is death and sad because I am sad my gosh what has my life become I am the excessive of \n computer I am good my friend said so. ', 'long_description')\n ->press('Create')\n ->assertResponseStatus(403);\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME,\n $subject,\n 'Subject is not a valid instance.'\n );\n\n $this->assertInstanceOf(\n 'Dhii\\Modular\\Module\\ModuleInterface',\n $subject,\n 'Test subject does not implement expected interface.'\n );\n }", "public function testCreate()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testCreateInstance() {\n $tamper_manager = \\Drupal::service('plugin.manager.tamper');\n $plugin_collection = new DefaultLazyPluginCollection($tamper_manager, []);\n foreach ($tamper_manager->getDefinitions() as $plugin_id => $plugin_definition) {\n // Create instance. DefaultLazyPluginCollection uses 'id' as plugin key.\n $plugin_collection->addInstanceId($plugin_id, [\n 'id' => $plugin_id,\n ]);\n\n // Assert that the instance implements TamperInterface.\n $tamper = $plugin_collection->get($plugin_id);\n $this->assertInstanceOf(TamperInterface::class, $tamper);\n\n // Add tamper instances to the entity so that the config schema checker\n // runs.\n $this->entity->setThirdPartySetting('tamper_test', 'tampers', $plugin_collection->getConfiguration());\n $this->entity->save();\n }\n }", "public function testCanBeCreated()\n {\n $subject = $this->createInstance();\n\n $this->assertInstanceOf(\n static::TEST_SUBJECT_CLASSNAME, $subject,\n 'Subject is not a valid instance'\n );\n }", "public function create_experiment( $project_id, $options ) {\n\t\tif ( ! isset( $options['description'] )\n\t\t || ! isset( $options['edit_url'] ) ) {\n\t\t\treturn FALSE;\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'POST',\n\t\t\t'data' => $options,\n\t\t) );\n\t}", "public function testStorage()\n {\n // Test with correct field name\n $this->visit('/cube')\n ->type('First Cube', 'name')\n ->press('submit-add')\n ->see('created successfully');\n\n // Test with incorrect field name\n $this->visit('/cube')\n ->press('submit-add')\n ->see('is required');\n }", "public function testExample()\n {\n }", "public function testWebinarPollCreate()\n {\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function test___construct() {\n\t\t}", "public function test___construct() {\n\t\t}", "public function test()\n {\n $this->executeScenario();\n }", "public function testCreate()\n {\n $this->browse(function (Browser $browser) {\n $values = [\n 'number' => 'Bill',\n 'attachments' => __DIR__.'/test_image.jpg',\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ];\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'/bills/create')\n ->attach('attachments[]', $values['attachments'])\n ->type('number', $values['number'])\n ->select('contract_id', $values['contract_id'])\n ->select('requisite_id', $values['requisite_id'])\n ->type('services[0][name]', $values['name'])\n ->type('services[0][quantity]', $values['quantity'])\n ->type('services[0][measure]', $values['measure'])\n ->type('services[0][price]', $values['price'])\n ->press('Сохранить')\n ->assertPathIs('/tenants/'.$this->tenant->id)\n ->assertQueryStringHas('tab')\n ->assertFragmentIs('tab')\n ->assertSee($values['number']);\n });\n }", "protected function createFeatureTest()\n {\n $model_name = Str::studly(class_basename($this->argument('name')));\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:test', [\n 'name' => \"{$model_name}Test\",\n ]);\n\n $path = base_path() . \"/tests/Feature/{$model_name}Test.php\";\n $this->cleanupDummy($path, $name);\n }", "public function setUp()\n {\n\n parent::setUp();\n\n // Create a default exhibit.\n $this->exhibit = $this->_exhibit();\n\n }", "public function testProfileCreate()\n {\n\n }", "function testSample() {\n\t\t$this->assertTrue( true );\n\t}", "protected function _initTest(){\n }", "public function run()\n {\n $projectNum = Project::count();\n $faker = Faker::create();\n $project_limit=require('Config.php');\n for($i=1;$i<=$projectNum;$i++)\n {\n if($i%200 ==0)\n $this->command->info('Test Suite Seed :'.$i.' out of: '.$projectNum);\n $TestsTestArch = DB::table('project_assignments')->select('user_id','role_id')->\n where([['project_id','=',$i]])->\n whereIn('role_id',[7,8,9])->get();\n //let's say Tester, Test Lead and Test Architect together create around 20-40 folder per projects\n $numberOfTestSuites = rand($project_limit['projects']['min_test_suite'],$project_limit['projects']['max_test_suite']);\n for($j=0;$j<$numberOfTestSuites;++$j)\n {\n TestSuite::create(array(\n 'project_id'=>$i,\n 'name'=>$faker->sentence(4),\n //let's say only 90% of Test Suite have description\n 'description'=>rand(0,100)<80?$faker->paragraph(6):null,\n 'creator_id'=>$faker->randomElement($TestsTestArch)->user_id\n ));\n }\n }\n }", "public function testBasics() {\n\t\t$model = new AElasticRecord;\n\t\t$model->id = 123;\n\t\t$model->name = \"test item\";\n\t\t$this->assertEquals(123, $model->id);\n\t\t$this->assertEquals(\"test item\",$model->name);\n\t}", "public function testCreateSite()\n {\n }", "function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}", "public function run()\n {\n $count = 10;\n $this->command->info(\"Creating {$count} Testimonies.\");\n factory(App\\Testimonies::class, $count)->create();\n $this->command->info('Testimonies Created!');\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', '[email protected]')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }", "public function testCreateNewEpisode()\n {\n Channel::create([\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n\n $this->seeInDatabase('channels', [\n 'channel_name' => 'test',\n 'channel_description' => 'test',\n 'user_id' => 3,\n 'subscription_count' => 0\n ]);\n }", "public function run()\n {\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Colossus'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Steven'\n ]);\n\n \\App\\Models\\Capybara::factory()->create([\n 'name' => 'Capybaby'\n ]);\n }", "abstract protected function constructTestHelper();", "function a_user_can_be_created(){\n\n $profession = factory(Profession::class)->create([\n 'title' => 'Web Developer'\n ]);\n $skillA = factory(Skill::class)->create([\n 'description' => 'CSS'\n ]);\n $skillB = factory(Skill::class)->create([\n 'description' => 'HTML'\n ]);\n\n $this->browse(function(Browser $browser) use ($profession,$skillA,$skillB){\n $browser->visit('users/create')\n ->assertSeeIn('h5','Create User')\n ->type('name','Yariel Gordillo')\n ->type('email','[email protected]')\n ->type('password','secret')\n ->type('bio','This a small bio')\n ->select('profession_id',$profession->id)\n ->type('twitter' ,'https://twitter.com/yariko')\n ->check(\"skills[{$skillA->id}]\")\n ->check(\"skills[{$skillB->id}]\")\n ->radio('role', 'user')\n ->press('Create User')\n ->assertPathIs('/users')\n ->assertSee('Yariel Gordillo')\n ->assertSee('[email protected]');\n });\n\n }", "public function testCreate()\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n //test creation as admin\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with admin');\n\n //test creation as user\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res);\n $this->assertEquals('Hello title',$res->title, 'Testing discussion creation with user');\n\n\n\n }", "public function testCreate()\n {\n $aircraft = new Aircraft();\n $this->assertFalse($aircraft->save());\n\n $aircraft = factory(\\App\\Aircraft::class)->create();\n $this->assertTrue($aircraft->save());\n }", "public function testBasicTest()\n {\n $test = Test::create([\n 'title' =>'title',\n 'about' => 'about',\n 'timer' => null,\n 'full_result' => false,\n ])->fresh();\n dd($test->version->id);\n }", "public function run()\n {\n $labOrder = factory(LabOrder::class)->create();\n $SKUs = SKU::where('item_type', 'lab-test')->get()->shuffle();\n\n for ($i=0; $i < 5; $i++) {\n $labTest = factory(LabTest::class)->create([\n 'lab_order_id' => $labOrder->id,\n 'sku_id' => $SKUs->pop()->id,\n ]);\n if (maybe()) {\n factory(LabTestResult::class)->create([\n 'lab_test_id' => $labTest->id,\n ]);\n }\n }\n }", "protected function setUp() \n {\n $this->object = new Exam(); \n }", "public function testGetChallengeActivityTemplates()\n {\n }", "public function testCanBeCreated()\n {\n $subject = new Iteration('', '');\n\n $this->assertInstanceOf(\n 'Dhii\\\\Iterator\\\\IterationInterface',\n $subject,\n 'Subject does not implement expected parent.'\n );\n }", "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreate()\n {\n\n $this->createDummyPermission(\"1\");\n $this->createDummyPermission(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc,\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n 'permission1' => 2\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testCreateContador()\n {\n }", "public function run()\n {\n factory(societe_has_stage::class, 50)->create();\n }", "public function testWebinarRegistrantCreate()\n {\n }", "public function testCreate()\n {\n $this->specify(\"we want to add the history record\", function () {\n /** @var History $history history record */\n $history = Yii::createObject('inblank\\team\\models\\History');\n expect(\"we can't add the history without team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 999;\n $history->user_id = 999;\n expect(\"we can't add the history with not existing team or user\", $history->save())->false();\n expect(\"we must see error message `team_id`\", $history->getErrors('team_id'))->notEmpty();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->team_id = 1;\n $history->user_id = 2;\n expect(\"we can't add the history if user not in team\", $history->save())->false();\n expect(\"we must see error message `user_id`\", $history->getErrors('user_id'))->notEmpty();\n $history->user_id = 1;\n expect(\"we can't add the history without action\", $history->save())->false();\n expect(\"we must see error message `action`\", $history->getErrors('action'))->notEmpty();\n $history->action = History::ACTION_ADD;\n expect(\"we can add the history\", $history->save())->true();\n });\n }", "public function run()\n {\n factory(\\App\\challenge::class, function (Faker\\Generator $faker) {\n $type = ['Web', 'Re', 'Pwn', 'Crypto', 'Misc'];\n\n return [\n 'title' => $faker->title,\n 'class' => $faker->randomElement($type),\n 'description' => $faker->realText($maxNbChars = 100),\n 'url' => $faker->url,\n 'flag' => $faker->sha256,\n 'score' => $faker->numberBetween($min = 1, $max = 100),\n ];\n });\n }", "public function testCreate()\n {\n /**\n * @todo IMPLEMENT THIS\n */\n $factory = new components\\Factory();\n //Success\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"github\"), new components\\platforms\\Github([]));\n $this->assertEquals($factory->create(\"gitlab\"), new components\\platforms\\Gitlab([]));\n $this->assertEquals($factory->create(\"bitbucket\"), new components\\platforms\\Bitbucket([]));\n //Exception Case\n $this->expectException(\\LogicException::class);\n $platform = $factory->create(\"Fake\");\n\n }", "public function testWebinarPanelistCreate()\n {\n }", "public function testEventCreate()\n {\n $response = $this->get('events/create');\n\n $response->assertStatus(200);\n }", "public function testCreatePatrimonio()\n {\n }", "public function testCreateTimesheet()\n {\n }", "public function run()\n {\n factory(App\\Work::class)->create([\n 'title' => 'Paseo Boulevard',\n 'content' => 'El intendente José Corral presentó a los vecinos el proyecto de remodelación del Paseo Boulevard en febrero de 2016. Las obras de puesta en valor comprenden desde el Puente Colgante hasta Avenida Freyre, priorizan la circulación peatonal por sobre la actividad vehicular. ',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class)->create([\n 'title' => 'Remodelación de la Avenida Blas Parera',\n 'content' => 'La avenida contará con un corredor exclusivo para transporte público de pasajeros urbano y metropolitano en el centro de la traza, en ambos sentidos de circulación, además de una ciclovía. Esa avenida-ruta -que fue centro de tantos reclamos durante años- modificará completamente su fisonomía a lo largo de casi 6 km.',\n 'action_id' => 2\n ]);\n\n factory(App\\Work::class, 10)->create();\n }", "public function testCreateExpedicao()\n {\n }", "protected function setUp() {\n\t$this->object = new Competition(20);\n\t$this->assertNotNull($this->object);\n }", "public function testAddTemplate()\n {\n\n }", "protected function setUp() {\n parent::setUp();\n $this->cleanUpAll();\n\n\n $this->institution = new Institution();\n $this->institution->setName('San Francisco State University');\n $this->institution->setAbbreviation(\"SFSU\");\n $this->institution->setCity('San Francisco');\n $this->institution->setStateProvince('CA');\n $this->institution->setCountry('USA');\n $this->institution->save();\n\n $this->oldInstitution = new Institution();\n $this->oldInstitution->setName('Punjabi University');\n $this->oldInstitution->setAbbreviation(\"PU\");\n $this->oldInstitution->setCity('Patiala');\n $this->oldInstitution->setStateProvince('PB');\n $this->oldInstitution->setCountry('INDIA');\n $this->oldInstitution->save();\n\n\n $this->project = new PersistentProject();\n $this->project->setProjectJnName(\"ppm-8\");\n $this->project->setSummary(\"Infinity Metrics\");\n $this->project->save();\n\n $this->oldProject = new PersistentProject();\n $this->oldProject->setProjectJnName(\"ppm\");\n $this->oldProject->setSummary(\"paticipation metrics\");\n $this->oldProject->save();\n\n $this->instructor = UserManagementController::registerInstructor(self::USERNAME,\"PASSWORD\" ,\"[email protected]\",\n \"firstname\", \"lastname\",$this->oldProject->getProjectJnName(),true,\n $this->oldInstitution->getAbbreviation(), \"Teacher1\");\n }", "public function run()\n {\n factory(App\\Subject::class,'assessment',3)->create();\n factory(App\\Group::class,'assessment',3)->create();\n factory(App\\Student::class,'assessment',14)->create();\n factory(App\\Assessment::class,'assessment',40)->create();\n }", "public function testCreateProject()\n {\n echo \"\\nTesting project creation...\";\n $input = file_get_contents('prj.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/projects?owner=wawong\";\n \n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n //echo \"\\nType:\".$response.\"-----Create Response:\".$response;\n \n $result = json_decode($response);\n if(!$result->success)\n {\n $this->assertTrue(true);\n }\n else\n {\n $this->assertTrue(false);\n }\n \n }", "public function testInstrumentCreateFail()\n {\n $this->browse(function (Browser $browser) {\n $user = User::find(1);\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n\n //Trying when leaving the Code field empty\n //->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Category field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n //->type('@category', 'Fail Test')\n ->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n\n //Trying when leaving the Module field empty\n $browser->loginAs($user)\n ->visit(new instrumentManagementPage())\n ->assertSee('Instruments')\n ->press('@actions-button')\n ->press('@actions-create-menu')\n ->assertSee('New Instrument')\n ->type('@code', 'Fail Test')\n ->type('@category', 'Fail Test')\n //->type('@module','Fail Test')\n ->type('@reference','Fail Test')\n ->press('Save')\n //->press('@save-button') //TODO: use this once DUSK tag is fixed\n ->assertsee('New Instrument');\n });\n }", "private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}", "public function preTesting() {}" ]
[ "0.8075641", "0.65538555", "0.65322083", "0.632858", "0.6290923", "0.62865835", "0.62109554", "0.62014955", "0.6199749", "0.6188527", "0.6176559", "0.61609805", "0.6158647", "0.6152849", "0.61229026", "0.6113385", "0.611306", "0.611306", "0.60945725", "0.6086307", "0.60797703", "0.60791343", "0.60791343", "0.605772", "0.60510534", "0.6046629", "0.6018587", "0.60177886", "0.59871846", "0.59777296", "0.5955141", "0.5955141", "0.5955141", "0.59276795", "0.59183586", "0.59073955", "0.5902765", "0.59024024", "0.5902232", "0.58961105", "0.58919305", "0.5879167", "0.5878877", "0.5868836", "0.5861893", "0.5851767", "0.5833216", "0.58327925", "0.5827744", "0.5826783", "0.58197093", "0.58190596", "0.58190596", "0.5815709", "0.5799656", "0.5799138", "0.57963896", "0.57838976", "0.577326", "0.57641995", "0.57619864", "0.5761214", "0.57608324", "0.5759225", "0.575873", "0.57569915", "0.5753206", "0.57507414", "0.5750209", "0.57434255", "0.57373005", "0.5736376", "0.57335186", "0.5729262", "0.57287794", "0.57259", "0.5719424", "0.5718916", "0.5714852", "0.5714852", "0.57109195", "0.5710791", "0.57102454", "0.570935", "0.57052577", "0.5694593", "0.569136", "0.56908196", "0.5689493", "0.5682476", "0.5680415", "0.5676975", "0.56638044", "0.5662279", "0.5660247", "0.5655335", "0.5654278", "0.5650159", "0.56490713", "0.56375533", "0.5636239" ]
0.0
-1
Testing the experiment listing
public function testListDocuments() { echo "\nTesting document listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testListExperiments()\n {\n echo \"\\nTesting experiment listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testListExperts()\n {\n }", "public function testListPastWebinarQA()\n {\n }", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function _testMultipleInventories()\n {\n\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getExperimentsList(){\n return $this->_get(1);\n }", "public function test_admin_training_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function actionTest()\n {\n $page_size = Yii::$app->request->get('per-page');\n $page_size = isset( $page_size ) ? intval($page_size) : 4;\n\n\n $provider = new ArrayDataProvider([\n 'allModels' => $this->getFakedModels(),\n 'pagination' => [\n // Should not hard coded\n 'pageSize' => $page_size,\n ],\n 'sort' => [\n 'attributes' => ['id'],\n ],\n ]);\n\n return $this->render('test', ['listDataProvider' => $provider]);\n }", "public function testListSites()\n {\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "public function testWebinarPanelists()\n {\n }", "public function testListPastWebinarPollResults()\n {\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function test_admin_training_list_b()\n {\n $this->request('GET', ['pages/MemberSkills', 'training_programs']);\n $this->assertResponseCode(404);\n }", "public function getExperimentInfosList(){\n return $this->_get(2);\n }", "public function testJobList()\n {\n\n }", "public function getTests();", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function testList()\n {\n \t$games_factory = factory(Game::class, 3)->create();\n \t$games = Game::all();\n \t\n $this->assertCount(3, $games);\n }", "public function indexAction()\n\t{\n\t\t// TODO: do not only check if experiments exist, but if treatment exist\n\t\t// fetch list of experiments to show note when none exist\n\t\t$experimentModel = Sophie_Db_Experiment :: getInstance();\n\t\t$overviewSelect = $experimentModel->getOverviewSelect();\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array('experiment.name'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl::getInstance()->addSelectAcl($overviewSelect, 'experiment');\n\t\t\t$overviewSelect->order(array('experiment.name', 'acl.rule'));\n\t\t}\n\t\t$overviewSelect->group(array('experiment.id'));\n\t\t$this->view->hasTreatment = sizeof($overviewSelect->query()->fetchAll()) > 0;\n\n\t\t// fetch sessions list\n\t\t$sessionModel = Sophie_Db_Session :: getInstance();\n\t\t$db = $sessionModel->getAdapter();\n\t\t$overviewSelect = $sessionModel->getOverviewSelect();\n\n\t\t// add filters from form\n\t\t$filterExperimentId = $this->_getParam('filterExperimentId', null);\n\t\tif (!is_null($filterExperimentId))\n\t\t{\n\t\t\t$overviewSelect->where('experiment.id = ?', $filterExperimentId);\n\t\t}\n\n\t\t$filterState = $this->_getParam('filterState', null);\n\t\tif (!is_null($filterState))\n\t\t{\n\t\t\t$overviewSelect->where('session.state = ?', $filterState);\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$overviewSelect->where('session.state != ?', 'terminated');\n\t\t\t$overviewSelect->where('session.state != ?', 'archived');\n\t\t\t$overviewSelect->where('session.state != ?', 'deleted');\n\t\t}\n\n\t\t// allow admin to see everything\n\t\t$adminMode = (boolean)$this->_getParam('adminMode', false);\n\t\t$adminRight = Symbic_User_Session::getInstance()->hasRight('admin');\n\n\t\tif ($adminMode && $adminRight)\n\t\t{\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name'\n\t\t\t));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem_Acl :: getInstance()->addSelectAcl($overviewSelect, 'session');\n\t\t\t$overviewSelect->order(array (\n\t\t\t\t'session.name',\n\t\t\t\t'acl.rule'\n\t\t\t));\n\t\t}\n\n\t\t$overviewSelect->group(array (\n\t\t\t'session.id'\n\t\t));\n\n\t\t$this->view->sessions = $overviewSelect->query()->fetchAll();\n\t\t$this->view->adminMode = $adminMode;\n\t\t$this->view->adminRight = $adminRight;\n\t}", "public function testlistAction() \n {\n $model = new Application_Model_Mapper_Server($vars);\n $result = $model->getTestDetails();\n $data = array();\n $result = json_encode($result);\n $this->view->assign('result', $result);\n $this->_helper->viewRenderer('index');\n }", "public function test_list()\n {\n $response = $this->get('/proposal/all');\n\n $response->assertSee('data-js-proposal-cards');\n\n $response->assertSee('card-header');\n\n $response->assertStatus(200);\n }", "public function test_list()\n {\n $response = $this->get('/api/employees');\n\n $response->assertStatus(200);\n }", "public function testIndexActionHasExpectedData()\n {\n $this->dispatch('/index');\n $this->assertQueryContentContains('h1', 'My Albums');\n\n // At this point, i'd like to do a basic listing count of items.\n // However, we're not using a seperate test db with controlled seeds.\n // $this->assertQueryCount('table tr', 6);\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function test_listIndexAction ( )\n {\n $params = array(\n 'event_id' => 1,\n 'action' => 'list',\n 'controller'=> 'scales',\n 'module' => 'default'\n );\n\n $urlParams = $this->urlizeOptions($params);\n $url = $this->url($urlParams);\n $this->dispatch($url);\n\n // assertions\n $this->assertModule($urlParams['module']);\n $this->assertController($urlParams['controller']);\n $this->assertAction($urlParams['action']);\n\n }", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public function TestListAll()\n {\n $temp = BASE_FOLDER . '/.dev/Tests/Data/Testcases';\n\n $this->options = array(\n 'recursive' => true,\n 'exclude_files' => false,\n 'exclude_folders' => false,\n 'extension_list' => array(),\n 'name_mask' => null\n );\n $this->path = BASE_FOLDER . '/.dev/Tests/Data/Testcases/';\n\n $adapter = new fsAdapter($this->action, $this->path, $this->filesystem_type, $this->options);\n\n $this->assertEquals(38, count($adapter->fs->data));\n\n return;\n }", "public function testIntegrationIndex()\n {\n $userFaker = factory(Model::class)->create([\n 'name' => 'Foo Bar'\n ]);\n $this->visit('user')\n ->see($userFaker->name);\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'name' => $userFaker->name,\n 'email' => $userFaker->email,\n ]);\n $this->assertViewHas('models');\n }", "protected function getTestList() \n {\n $invalid = 'invalid';\n $description = 'text';\n $empty_description = '';\n $testlist = [];\n $testlist[] = new ArgumentTestConfig($this->empty_argument, $empty_description,CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_optional, $empty_description, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_required, $empty_description, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n $testlist[] = new ArgumentTestConfig($this->argument_empty_need_invalid, $empty_description, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class );\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_string, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $empty_description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $empty_description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $empty_description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_string_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_string_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_string_description, $this->argument_name, $invalid, CreateModuleCommandArgument::STRING, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_array_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_array_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, CreateModuleCommandArgument::ARRAY, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_array_description, $this->argument_name, $invalid, CreateModuleCommandArgument::ARRAY, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $description);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_empty_type_empty_description_empty, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, CreateModuleCommandArgument::STRING, $empty_description);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_optional_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::OPTIONAL, $invalid, $description, \\InvalidArgumentException::class);\n $testlist[] = new ArgumentTestConfig($this->argument_name_need_required_type_invalid_description, $this->argument_name, CreateModuleCommandArgument::REQUIRED, $invalid, $description, \\InvalidArgumentException::class);\n \n $testlist[] = new ArgumentTestConfig($this->argument_name_need_invalid_type_invalid_description, $this->argument_name, $invalid, $invalid, $description, \\InvalidArgumentException::class);\n \n return $testlist;\n }", "public static function get_tests()\n {\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testListPastWebinarFiles()\n {\n }", "public function test_notes_list()\n {\n Note::create(['note'] => 'Mi primera nota');\n Note::create(['note'] => 'Segunda nota');\n $this->visit('notes')\n ->see('Mi primera nota')\n ->see('Segunda nota');\n }", "public function testIndex()\n {\n $this->visit('/cube')\n ->see('Choose a Cube')\n ->see('Add a Cube')\n ->see('Upload Cube')\n ->see('This is an application just to show how the Cube Summation')\n ->dontSee('Update Cube')\n ->dontSee('Query Cube')\n ->dontSee('Blocks for');\n }", "public function testListManifests()\n {\n }", "public function showTestResults() {\n echo \"Tests: {$this->tests}\\n\";\n echo \"Pass: {$this->pass}\\n\";\n echo \"Fail: {$this->fail}\\n\";\n }", "function getTests(){\n $listOfAvailableTests = parent::getTests();\n $url = get_instance()->uri->uri_string();\n $listOfSubTests = trim(Text::getSubstringAfter($url, '/subtests/'));\n if($listOfSubTests){\n $listOfSubTests = explode(',', $listOfSubTests);\n foreach($listOfSubTests as $key => &$subTest){\n $subTest = trim($subTest);\n if(!in_array($subTest, $listOfAvailableTests)){\n unset($listOfSubTests[$key]);\n echo \"Test '$subTest' does not exist as a test within \" . $this->getLabel() . \"<br/>\";\n }\n }\n $listOfSkippedTests = array_diff($listOfAvailableTests, $listOfSubTests);\n $this->reporter->paintSkip(count($listOfSkippedTests) . \" tests not run.\");\n $listOfAvailableTests = $listOfSubTests;\n }\n return $listOfAvailableTests;\n }", "public function test_listSettings() {\n\n }", "public function testGetAll()\n {\n $ret =\\App\\Providers\\ListsServiceProvider::getLists();\n \n $this->assertNotEmpty($ret);\n }", "public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }", "public function testListSiteContainers()\n {\n }", "public function testListPeople()\n {\n }", "public function testListMetadata()\n {\n }", "public function testListAndListItems(array $test) {\n $this->performTest($test);\n }", "public function testWebinarPanelistCreate()\n {\n }", "public function testShow()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n Item::factory()->count(10)->create();\n\n //Test success get the item\n $this->json('GET', '/items/1')\n ->seeJson([\n 'status' => 'ok',\n ])\n ->seeJson([\n 'email' => '[email protected]',\n ])\n ->seeJson([\n 'name' => 'test',\n ])\n ->seeJsonStructure([\n 'data' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]);\n\n //test item not found\n $this->call('GET', '/items/11111')\n ->assertStatus(404);\n }", "public function test_individual_item_is_displayed()\n {\n $response = $this->get(\"/item-detail/1\");\n $response->assertSeeInOrder(['<strong>Title :</strong>', '<strong>Category :</strong>', '<strong>Details :</strong>']);\n }", "public function testIndex()\n\t{\n\t\t$data = [];\n\n\t\tforeach ($this->saddles as $saddle) {\n\t\t\t$data[] = [\n\t\t\t\t'id' => $saddle->id,\n\t\t\t\t'name' => $saddle->name,\n\t\t\t\t'horse' => [\n\t\t\t\t\t'id' => $saddle->horse->id,\n\t\t\t\t\t'stable_name' => $saddle->horse->stable_name,\n\t\t\t\t],\n\t\t\t\t'brand' => [\n\t\t\t\t\t'id' => $saddle->brand->id,\n\t\t\t\t\t'name' => $saddle->brand->name,\n\t\t\t\t],\n\t\t\t\t'style' => [\n\t\t\t\t\t'id' => $saddle->style->id,\n\t\t\t\t\t'name' => $saddle->style->name,\n\t\t\t\t],\n\t\t\t\t'type' => $saddle->type,\n\t\t\t\t'serial_number' => $saddle->serial_number,\n\t\t\t\t'created_at' => $saddle->created_at->format('d/m/Y'),\n\t\t\t];\n\t\t}\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->get('/api/v1/admin/saddles?per_page=9999')\n\t\t\t ->assertStatus(200)\n\t\t\t ->assertJson(['data' => $data]);\n\t}", "public function testGetExtensionIndexPage()\n\t{\n\t\t$this->be($this->user);\n\t\t$this->call('orchestra::extensions@index');\n\t\t$this->assertResponseOk();\n\t\t$this->assertViewIs('orchestra::extensions.index');\n\t}", "public function testShow()\n {\n $client = static::createClient();\n $max_jobs_on_category = static::$kernel->getContainer()->getParameter('max_jobs_on_category');\n $em = static::$kernel->getContainer()->get('doctrine.orm.entity_manager');\n\n $slug = 'programming';\n $crawler = $client->request('GET', '/category/'.$slug);\n\n // only $max_jobs_on_category jobs are listed\n $category = $em->getRepository(Category::class)->findOneBySlug(['slug' => $slug]);\n $totalActiveJobs = $em->getRepository(Job::class)->countActiveJobs($category->getId());\n\n $jobsOnPage = ($totalActiveJobs <= $max_jobs_on_category) ? $totalActiveJobs : $max_jobs_on_category;\n $pages = ceil($totalActiveJobs / $max_jobs_on_category);\n\n $this->assertTrue($crawler->filter('.jobs tr')->count() == $jobsOnPage);\n $this->assertRegExp(\"/$totalActiveJobs jobs/\", $crawler->filter('.pagination_desc')->text());\n $this->assertRegExp(\"/page 1\\/$pages/\", $crawler->filter('.pagination_desc')->text());\n\n $link = $crawler->selectLink('2')->link();\n $crawler = $client->click($link);\n $this->assertEquals(2, $client->getRequest()->attributes->get('page'));\n $this->assertRegExp(\"/page 2\\/$pages/\", $crawler->filter('.pagination_desc')->text());\n }", "public function testIndex()\n {\n $client = static::createClient();\n $crawler = $client->request('GET', '/');\n\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $this->assertCount(1, $crawler->filter('h1'));\n $this->assertEquals(1, $crawler->filter('html:contains(\"Trick List\")')->count());\n }", "public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }", "public function testGetAllEspMeds()\n {\n \n $controller = new EspMedController();\n $reponse = $controller->index();\n $this->assertJson($reponse);\n \n }", "function testOverview() {\n $this->drupalGet(Url::fromRoute('linkit.matchers', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ]));\n $this->assertText(t('No matchers added.'));\n\n $this->assertLinkByHref(Url::fromRoute('linkit.matcher.add', [\n 'linkit_profile' => $this->linkitProfile->id(),\n ])->toString());\n }", "public function testExample()\n {\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.login'))\n ->type('username', 'admin1')\n ->type('password', '123456')\n ->press('login')\n ->assertPathIs('/admin/index');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'abcd')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'nhân dâu')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n\n /**\n * @group search\n */\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin.product.list'))\n ->type('search-product', 'valentine')\n ->press('submit-product-search')\n ->assertPathIs('/admin/product/search');\n });\n }", "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "public function testList()\n {\n \t$player_factory = factory(KillingMode::class, 3)->create();\n \t$player = KillingMode::all();\n \t\n $this->assertCount(3, $player);\n }", "public function testIndex()\n {\n // $this->assertTrue(true);\n $response = $this->json('get','/api/todos');\n $this->seeJsonStructure($response, [\n '*' => [\n 'id', 'status', 'title', 'created_at', 'updated_at'\n ]\n ]);\n }", "public function testDevicesIndex()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/devices')\n ->assertSee('Devices')\n ->assertSee('Kitchen Fridge')\n ->assertSee('Thermostat')\n ->assertSee('Gas Meter')\n ->assertSee('Water Meter')\n ->assertSee('Electricity Meter');\n });\n }", "public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n \n $browser->visit('/')\n ->pause(2000)\n ->assertSee('后台登录');\n \n\n // 页面 url, 是否有All按钮, select 选择框\n // 模板 [\"url\" => \"\", \"select\" => [\"name\" => \"\", \"value\" => \"\"]]\n /*\n $pages = [\n [\"url\" => \"/user_manage/all_users\", \"all\" => true, \"select\" => [\"name\" => \"id_grade\", \"value\" => 102], \"click\" => \".td-info\"],\n [\"url\" => \"human_resource/index_new\", \"select\" => [\"name\" => \"id_teacher_money_type\", \"value\" => 0], \"click\" => \".opt-freeze-list\"],\n [\"url\" => \"/authority/manager_list\", \"select\" =>[\"name\" => \"id_call_phone_type\", \"value\" => \"2\"]]\n ];\n \n foreach($pages as $item) {\n $browser->visit($item[\"url\"])->pause(5000);\n if (isset($item[\"all\"]))\n $browser->press(\"ALL\");\n //$browser->select($item[\"select\"]['name'], $item[\"select\"][\"value\"]);\n if (isset($item[\"click\"]) && $item[\"click\"])\n $browser->click($item[\"click\"]);\n //$browser->pause(5000);\n }*/\n\n /* $browser->visit(\"/user_manage/all_users\")\n ->press(\"ALL\")\n ->select(\"id_grade\", 101)\n ->select(\"id_grade\", 102)\n ->click(\".td-info\")\n ->pause(500);\n /*\n\n //$browser->click(\".bootstrap-dialog-body .opt-user\");\n\n $browser->click(\".bootstrap-dialog-header .close\"); // 关闭模态框\n\n $browser->visit(\"/tea_manage/lesson_list\")\n ->press(\"ALL\")\n ->pause(2000);\n */\n\n });\n }", "public function testGetList()\n {\n $result = $this->getQueryBuilderConnection()\n ->select('field')\n ->from('querybuilder_tests')\n ->where('id', '>', 7)\n ->getList();\n\n $expected = [\n 'iiii',\n 'jjjj',\n ];\n\n $this->assertEquals($expected, $result);\n }", "public function testShow()\n {\n $this->visit('/cube/1')\n ->see('Update Cube')\n ->see('Query Cube')\n ->see('Blocks for');\n }", "public function test_admin_usecase_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'usecase_list']);\n $this->assertResponseCode(404);\n }", "public function testShowListSuccessfully(): void\n {\n $list = $this->createList(static::$listData);\n\n $this->get(\\sprintf('/mailchimp/lists/%s', $list->getId()));\n $content = \\json_decode($this->response->content(), true);\n\n $this->assertResponseOk();\n\n self::assertArrayHasKey('list_id', $content);\n self::assertEquals($list->getId(), $content['list_id']);\n\n foreach (static::$listData as $key => $value) {\n self::assertArrayHasKey($key, $content);\n self::assertEquals($value, $content[$key]);\n }\n }", "public function test_list_of_resource()\n {\n $response = $this->artisan('resource:list');\n $this->assertEquals(0, $response);\n }", "public function action_index()\n {\n $this->model->show_test_data();\n //$this->view->generate('test_view.php', $this->template, $page, $this->data);\n }", "public function testListDocuments()\n {\n }", "public function test_getByExample() {\n\n }", "public function testCheckIfOverviewContainsSuite()\n {\n $user = factory(App\\User::class)->create();\n\n $this->actingAs($user)\n ->visit('/library')\n ->see('TestSuite1')\n ->assertViewHas('testSuites');\n\n }", "public function overviewallAction() {\n\n $this->validateUser();\n\n $testCase = new Yourdelivery_Model_Testing_TestCase();\n $this->view->testcases = $testCase->getTable()->fetchAll()->toArray();\n $this->view->exp = $testCase->getExpectations();\n }", "public function test_shows_skills_list()\n {\n factory(Skill::class)->create(['name' => 'PHP']);\n factory(Skill::class)->create(['name' => 'JS']);\n factory(Skill::class)->create(['name' => 'SQL']);\n\n $this->get('/habilidades')\n \t\t ->assertStatus(200)\n \t\t ->assertSeeInOrder([\n \t\t \t'JS',\n \t\t \t'PHP',\n \t\t \t'SQL'\n \t\t ]);\n }", "public function testIndexActionGet()\n {\n $res = $this->controller->indexActionGet();\n $this->assertContains(\"View all items\", $res->getBody());\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $a = [\n 'last_name' => 'Catacutan',\n 'first_name' => 'Romeo',\n 'middle_name' => 'Dimaandal',\n 'sex' => 'M',\n 'mobile' => '9876543210',\n 'email' => '[email protected]',\n 'qualification_id' => Qualification::first()->qualification_id\n ];\n $browser->visit(route('applications.create'))\n ->type('last_name', $a['last_name'])\n ->assertSee('Laravel');\n });\n }", "public function imagesListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Images List is displayed on the Edit Episode page. - C15646');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Images List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('IMAGES');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $I->see('e653f1094306790084dd8262c5a0e168.png', ContentPage::$imagesTable);\n }\n else\n {\n $I->see('45ad52a32ca5e4d374086aaa19c49e02.png', ContentPage::$imagesTable);\n }\n }", "public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', '[email protected]')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }", "public function testListServers()\n {\n }", "public function testExample()\n {\n $this->seeInDatabase('geolite', [\n 'city_name' => 'Toledo'\n ]);\n $this->seeInDatabase('geolite', [\n 'country_name' => 'Cyprus'\n ]);\n\n }", "public function test_list_page_shows_all_tasks()\n {\n\n // creiamo dei task e ci assicuriamo che nella vista ci siano un certo particolare set di dati\n // i assicuro che alla vista venga passata la ariabile dal controller ma non che sia stampata nella vista\n\n $task1 = factory(Task::class)->create();\n $task2 = factory(Task::class)->create();\n\n $this->get('tasks')\n ->assertViewHas('tasks')\n ->assertViewHas('tasks', Task::with('actions')->get())\n ->assertViewHasAll([\n 'tasks' => Task::with('actions')->get(),\n 'title' => 'Tasks page'\n ])->assertViewMissing('dogs');\n }", "public function index()\n {\n return Inertia::render('TestResult', [\n 'testResultList' => TestResult::latest()->paginate(5)\n ]);\n }", "public function setUp(){\n $this->testCases = Files::listFilesInFolder(__DIR__.\"/../../examples/sections/components\",\"ExamplePanel.php\");\n }", "public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }", "public function testIndexPageCanBeOpened()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@index');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function testList()\n {\n //Tests all products\n $this->clientAuthenticated->request('GET', '/product/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n\n //Tests all products linked to a child\n $this->clientAuthenticated->request('GET', '/product/list/child/1');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('productId', $first);\n }", "public function testIndex(): void\n {\n $demoJob = factory(JobPoster::class)->states(['draft', 'byDemoManager'])->create();\n $otherDemoJob = factory(JobPoster::class)->states(['draft', 'byDemoManager'])->create();\n $draftJob = factory(JobPoster::class)->states(['draft', 'byUpgradedManager'])->create();\n $reviewJob = factory(JobPoster::class)->states(['review_requested', 'byUpgradedManager'])->create();\n $openJob = factory(JobPoster::class)->states(['live', 'byUpgradedManager'])->create();\n $closedJob = factory(JobPoster::class)->states(['closed', 'byUpgradedManager'])->create();\n\n $demoJson = $this->jobToArray($demoJob);\n $draftJson = $this->jobToArray($draftJob);\n $reviewJson = $this->jobToArray($reviewJob);\n $openJson = $this->jobToArray($openJob);\n $closedJson = $this->jobToArray($closedJob);\n\n // A guest receives open and closed jobs\n $guestResponse = $this->json('get', route('api.v1.jobs.index'));\n $guestResponse->assertJsonCount(2);\n $guestResponse->assertJsonFragment($openJson);\n $guestResponse->assertJsonFragment($closedJson);\n\n // An demo manager (ie applicant) can see open/closed jobs, and its own demo jobs\n $applicantResponse = $this->actingAs($demoJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $applicantResponse->assertJsonCount(3);\n $applicantResponse->assertJsonFragment($demoJson);\n $applicantResponse->assertJsonFragment($openJson);\n $applicantResponse->assertJsonFragment($closedJson);\n\n // A manager can view its own draft job, and open/closed jobs\n $draftManagerResponse = $this->actingAs($draftJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $draftManagerResponse->assertJsonCount(3);\n $draftManagerResponse->assertJsonFragment($draftJson);\n $draftManagerResponse->assertJsonFragment($openJson);\n $draftManagerResponse->assertJsonFragment($closedJson);\n\n // A manager can also view its on job in review\n $reviewManagerResponse = $this->actingAs($reviewJob->manager->user)->json('get', route('api.v1.jobs.index'));\n $reviewManagerResponse->assertJsonCount(3);\n $reviewManagerResponse->assertJsonFragment($reviewJson);\n $reviewManagerResponse->assertJsonFragment($openJson);\n $reviewManagerResponse->assertJsonFragment($closedJson);\n\n // An admin can view all jobs\n $adminUser = factory(User::class)->state('admin')->create();\n $adminResponse = $this->actingAs($adminUser)->json('get', route('api.v1.jobs.index'));\n $adminResponse->assertJsonCount(6);\n }", "public function test_all_item_listed_or_no_listed_items_message_is_displayed()\n {\n $response = $this->get('/');\n if($response->assertSeeText(\"Details\")){\n $response->assertDontSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n } else {\n $response->assertSeeText(\"Sorry not items have been listed yet. Please check back later.\");\n }\n }", "public function testGettingStartedListing()\n\t{\n\t\t$oSDK=new BrexSdk\\SDKHost;\n\t\t$oSDK->addHttpPlugin($this->oHostPlugin);\n\n\n\t\t//Let's get company details to start\n\t\t$oTeamClient=$oSDK->setAuthKey($this->BREX_TOKEN) #consider using a token vault\n\t\t\t\t->setupTeamClient();\n\n\t\t/** @var BrexSdk\\API\\Team\\Client */\n\t\t$oTeamClient;\n\n\t\t//... OR\n\t\t//if you will be doing work across the API, use the follow convenience method\n\t\t$oTeamClient=$oSDK->setupAllClients()->getTeamClient();\n\t\t//etc...\n\n\t\t/** @var BrexSdk\\API\\Team\\Model\\CompanyResponse */\n\t\t$aCompanyDetails=$oTeamClient->getCompany();\n\n\t\t$sCompanyName=$aCompanyDetails->getLegalName();\n\t\t// ACME Corp, Inc.\n\t\tcodecept_debug($sCompanyName);\n\t\t$this->assertStringContainsString('Nxs Systems Staging 01', $sCompanyName);\n\t}", "public function testIndex()\n {\n $this->visit('/')\n ->see('STUDENT MONEY ASSISTANCE');\n }", "public function testShowAllAuthors()\n {\n\n $this->seeInDatabase('authors',[\n 'username'=> 'Smith72'\n ]);\n\n\n \n }", "public function videoListDisplayed(AcceptanceTester $I)\n {\n $I->wantTo('Verify Video List is displayed on the Edit Episode page. - C15640');\n if(EpisodeEditCest::$environment == 'staging')\n {\n $guid = TestContentGuids::$episodeViewData_staging;\n }\n else //proto0\n {\n $guid = TestContentGuids::$episodeViewData_proto0;\n }\n $I->amOnPage(ContentPage::$contentUrl . $guid);\n\n $I->expect('Video List is displayed.');\n $I->waitForElementVisible(ContentPage::$clickableTable, 30);\n $I->see('VIDEOS');\n $I->see('series_view_filled_data_automation_1_episode_1_media_id', ContentPage::$videoTable);\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function testDisplayedTest() {\n\n $this->open('?r=site/page&view=test');\n $this->assertEquals('My Web Application - Test', $this->title());\n\n $elements = $this->elements($this->using('css selector')->value('#yw0 > li'));\n error_log(__METHOD__ . ' . count($var): ' . count($elements));\n foreach ($elements as $element) {\n $text = $element->byCssSelector('#yw0 > li > a')->text();\n error_log(__METHOD__ . ' . $text: ' . $text);\n\n if ($text === 'Test') {\n $element->click();\n $breadcrumbsTest = $this->byCssSelector('#page > div.breadcrumbs > span');\n $bool = $breadcrumbsTest->displayed();\n $this->assertEquals(True, $bool);\n $this->assertEquals('Test', $this->byCssSelector('#page > div.breadcrumbs > span')->text());\n break;\n }\n }\n sleep(1);\n }", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function testListAllDocuments()\n {\n }", "public function testExample()\n {\n $data = People::where('id', '=', 6)->get();\n foreach ($data as $peps => $pep) {\n if (!$pep->fb_completed || $pep->fb_completed == '') {\n $this->browse(function (Browser $browser) use ($pep) {\n $browser->visit('www.facebook.com/')\n ->pause(1500)\n ->clickLink('Create New Account')\n ->pause(3000)\n ->type('firstname', $pep->first_name)\n ->type('lastname', $pep->last_name)\n ->type('reg_passwd__', 'refrigerator')\n ->type('reg_email__', $pep->email . '@yandex.com')\n ->pause(120000)\n ->assertSee('Facebook');\n });\n $pep->fb_completed = 'true';\n }\n }\n }", "public function index()\n {\n \n\n $experiments = Experiment::all();\n return view('experiment_index', ['data' => $experiments]);\n /*foreach ($experiments as $experiment) {\n echo $experiment->name;\n echo '<br>';\n echo $experiment->comment;\n }*/\n }", "public function test()\n {\n $this->executeScenario();\n }", "function babeliumsubmission_get_available_exercise_list(){\n Logging::logBabelium(\"Getting available exercise list\");\n $this->exercises = $this->getBabeliumRemoteService()->getExerciseList();\n return $this->getExercisesMenu();\n }", "function test_all () {\n\n\t\t$this->layout = 'test';\n\n\t\t$tests_folder = new Folder('../tests');\n\n\t\t$results = array();\n\t\t$total_errors = 0;\n\t\tforeach ($tests_folder->findRecursive('.*\\.php') as $test) {\n\t\t\tif (preg_match('/^(.+)\\.php/i', basename($test), $r)) {\n\t\t\t\trequire_once($test);\n\t\t\t\t$test_name = Inflector::Camelize($r[1]);\n\t\t\t\tif (preg_match('/^(.+)Test$/i', $test_name, $r)) {\n\t\t\t\t\t$module_name = $r[1];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$module_name = $test_name;\n\t\t\t\t}\n\t\t\t\t$suite = new TestSuite($test_name);\n\t\t\t\t$result = TestRunner::run($suite);\n\n\t\t\t\t$total_errors += $result['errors'];\n\n\t\t\t\t$results[] = array(\n\t\t\t\t\t'name'=>$module_name,\n\t\t\t\t\t'result'=>$result,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->set('success', !$total_errors);\n\t\t$this->set('results', $results);\n\t}", "public function testListServer()\n {\n }" ]
[ "0.7766579", "0.68568736", "0.66832024", "0.66007644", "0.65801185", "0.64103985", "0.6407482", "0.638836", "0.6362429", "0.6359445", "0.63123435", "0.6307033", "0.6217772", "0.61934084", "0.6183226", "0.6171969", "0.61591905", "0.61553687", "0.61552304", "0.6153641", "0.6147386", "0.6132729", "0.6124384", "0.612207", "0.61194843", "0.6115621", "0.6110016", "0.6108674", "0.61053497", "0.6104634", "0.6103048", "0.60987395", "0.6070581", "0.606867", "0.60256004", "0.6024196", "0.6011511", "0.6002442", "0.5994654", "0.59936833", "0.59688365", "0.5956264", "0.5942542", "0.59361804", "0.5932327", "0.5930851", "0.5918663", "0.59040135", "0.5902574", "0.5898706", "0.58950007", "0.5888186", "0.5882672", "0.5869083", "0.5868679", "0.5863485", "0.58598584", "0.58594036", "0.5858321", "0.5856742", "0.58485883", "0.5846269", "0.58296275", "0.5826827", "0.58208305", "0.58043766", "0.5795204", "0.5793092", "0.57850885", "0.57820857", "0.5761185", "0.5749364", "0.5743119", "0.5739674", "0.5735136", "0.571555", "0.57092553", "0.5703536", "0.5693727", "0.5692995", "0.5690038", "0.56879413", "0.5680681", "0.56775403", "0.5671382", "0.56677336", "0.5667314", "0.5663368", "0.565431", "0.565288", "0.5647248", "0.5642645", "0.5638321", "0.5638024", "0.56319374", "0.5630131", "0.56224096", "0.5619952", "0.5616849", "0.5599903", "0.55949455" ]
0.0
-1
Testing the experiment retreival by ID
public function testGetDocumentByID() { echo "\nTesting the document retrieval by ID..."; $response = $this->getDocument("CCDB_2"); //echo $response; $result = json_decode($response); $exp = $result->CIL_CCDB; $this->assertTrue((!is_null($exp))); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetExperimentByID()\n {\n echo \"\\nTesting the experiment retrieval by ID...\";\n $response = $this->getExperiment(\"1\");\n $result = json_decode($response);\n $exp = $result->Experiment;\n $this->assertTrue((!is_null($exp)));\n return $result;\n }", "private function getExperiment($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/experiments/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function experiments_get($id = \"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n $result = null;\n if(is_null($search))\n $result = $sutil->getExperiment($id,$from,$size);\n else \n {\n $result = $sutil->searchExperiments($search,$from,$size);\n }\n $this->response($result);\n }", "function launchExperiment() {\n\t\tif(isset($_GET) && isset($_GET['experiment'])) {\n\t\t\t$_SESSION['experiment'] = (int) $_GET['experiment'];\n\t\t}\n\t}", "public function testGettingReleaseByID()\n {\n $this->buildTestData();\n\n // This gets the second ID that was created for the test case, so that we can be sure the\n // correct item is returned.\n $secondID = intval(end($this->currentIDs));\n $result = $this->release->get($secondID);\n\n $this->assertTrue($result['contents'][0]['Artist'] == 'Tester2');\n }", "private function createExperiment()\n {\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }", "public function get_experiment( $experiment_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function testUpdateExperiment()\n {\n echo \"\\nTesting experiment update...\";\n $id = \"0\";\n \n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('exp_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id.\"?owner=wawong\";\n \n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function test_getById() {\n\n }", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function test_get_movie_by_id()\n {\n $movie = Movie::first();\n\n $this->get( route('v1.movie.show', ['id' => $movie->id ] ) );\n\n $this->response->assertJson([\n 'success' => 'Movie Found'\n ])->assertStatus(200);\n\n }", "public function testCreateExperiment()\n {\n echo \"\\nTesting Experiment creation...\";\n $input = file_get_contents('exp.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments?owner=wawong\";\n //echo \"\\n-------------------------\";\n //echo \"\\nURL:\".$url;\n //echo \"\\n-------------------------\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"\\n-----Create Experiment Response:\".$response;\n \n $result = json_decode($response);\n \n $this->assertTrue(!$result->success);\n \n }", "function get_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n return $airavataclient->getExperiment($expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem getting the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n\n}", "public function test_byinstanceid_route() {\n list(, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // request the page\n $client = new Client($this->_app);\n $client->request('GET', '/' . $talkpoint->id);\n $this->assertTrue($client->getResponse()->isOk());\n\n $this->assertContains('<h2>Talkpoint activity name</h2>', $client->getResponse()->getContent());\n }", "private function getCurrentExperiment() {\n\t\tif(isset($_SESSION) && isset($_SESSION['experiment'])) {\n\t\t\t$iExperimentId = (int) $_SESSION['experiment'];\n\t\t} else {\n\t\t\techo $this->_translator->error_experiment;\n\t\t\texit();\n\t\t}\n\t\treturn $iExperimentId;\n\t}", "public function testGetSingleHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\r\n\t\t//Test HTTP status ok for id=3\r\n\t\t$response= $this->http->request('GET','api/v1/hospital/3');//Change ID here\r\n\t\t$this->assertEquals(200,$response->getStatusCode());\r\n\r\n\t\t//Test JSON content\r\n\t\t$contentType = $response->getHeaders()[\"Content-Type\"][0];\r\n\t\t$this->assertEquals(\"application/json\", $contentType);\r\n\r\n\t\t//Test single element\r\n\t\t$jsonPHP=json_decode($response->getBody());\r\n\t\t$this->assertCount(1, $jsonPHP);\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}", "public function imodAction ()\r\n {\r\n $request = $this->getRequest();\r\n $params = array_diff($request->getParams(), $request->getUserParams());\r\n \r\n $sessional = new Acad_Model_Test_Sessional($params);\r\n $sessional->setTest_info_id($params['id']);\r\n $result = $sessional->save();\r\n if ($result) {\r\n echo 'Successfully saved!! Test Id :'.var_export($result, true);\r\n }\r\n }", "public function experiments_delete($id)\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n $sutil = new CILServiceUtil();\n $result = $sutil->deleteExperiment($id);\n $this->response($result); \n }", "public function testGetSubjectByID()\n {\n echo \"\\nTesting the subject retrieval by ID...\";\n $response = $this->getSubject(\"20\");\n //echo $response;\n $result = json_decode($response);\n $sub = $result->Subject;\n $this->assertTrue((!is_null($sub)));\n \n }", "public function testElementMatchingWithID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function testGetId() {\n\t\techo (\"\\n********************Test GetId()************************************************************\\n\");\n\t\t\n\t\t$this->stubedGene->method ( 'getId' )->willReturn ( 1 );\n\t\t$this->assertEquals ( 1, $this->stubedGene->getId () );\n\t}", "public function actionGetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n // Get to da responsa!\n $this->sendSuccessResponse($exercise->getExerciseTests()->getValues());\n }", "public function getExperimentID() {\n return $this->_experiment_id;\n }", "public function renderTestDetails($id=null,$testKey=''){\n try{\n $breTest=$this->breTestsFacade->findBreTest($id);\n }catch (\\Exception $e){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($testKey);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n }\n if ($breTest->user->userId!=$this->user->getId()){\n throw new ForbiddenRequestException($this->translator->translate('You are not authorized to access selected experiment!'));\n }\n\n $this->template->breTest=$breTest;\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function getById($id) {\r\n return $this->testcaseEntity->find($id);\r\n }", "public function testGetUsertByID()\n {\n echo \"\\nTesting the user retrieval by ID...\";\n $response = $this->getUser(\"44225\");\n //echo $response;\n $result = json_decode($response);\n $user = $result->User;\n $this->assertTrue((!is_null($user)));\n \n }", "public function testGetSitesTestsByID()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->testsController->shouldReceive('retrieve')->once()->andReturn('Get Test 2 or site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTests(array(1, 'tests', 2));\n $this->assertEquals('Get Test 2 or site 1 Mocked', $output);\n }", "function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}", "public function testGetReplenishmentById()\n {\n }", "public function testQuestionEditExistingID() {\n $response = $this->get('question/' . $this->question->id . '/edit');\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public static function getAcceptanceTest($id){\n $db = DemoDB::getConnection();\n ProjectModel::createViewCurrentIteration($db);\n $sql= \"select description,is_satisfied\n from feature\n INNER Join acceptance_test on feature.id = acceptance_test.feature_id\n INNER join acceptance_test_status on acceptance_test.id = acceptance_test_status.acceptance_test_id\n where feature.id=:id;\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function testShow()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$this->obj->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result);\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969');\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "protected function _test_byinstanceid_route($id) {\n $client = new Client($this->_app);\n $client->request('GET', '/' . $id);\n $this->assertTrue($client->getResponse()->isOk());\n $this->assertRegExp('/<h2>Community wall [1-3]{1}<\\/h2>/', $client->getResponse()->getContent());\n $this->assertContains('Header goes here', $client->getResponse()->getContent());\n $this->assertContains('Footer goes here', $client->getResponse()->getContent());\n }", "function launch_experiment($expId)\n{\n global $airavataclient;\n global $tokenFilePath;\n global $tokenFile;\n\n try\n {\n /* temporarily using hard-coded token\n open_tokens_file($tokenFilePath);\n\n $communityToken = $tokenFile->tokenId;\n\n\n $token = isset($_SESSION['tokenId'])? $_SESSION['tokenId'] : $communityToken;\n\n $airavataclient->launchExperiment($expId, $token);\n\n $tokenString = isset($_SESSION['tokenId'])? 'personal' : 'community';\n\n print_success_message('Experiment launched using ' . $tokenString . ' allocation!');\n */\n\n $hardCodedToken = '2c308fa9-99f8-4baa-92e4-d062e311483c';\n $airavataclient->launchExperiment($expId, $hardCodedToken);\n\n //print_success_message('Experiment launched!');\n print_success_message(\"<p>Experiment launched!</p>\" .\n '<p>You will be redirected to the summary page shortly, or you can\n <a href=\"experiment_summary.php?expId=' . $expId . '\">go directly</a> to the experiment summary page.</p>');\n redirect('experiment_summary.php?expId=' . $expId);\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem launching the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n}", "public function actionTest($id=0) {\n //(new Start)->test(); \n //echo \"End \" . $this->udate('Y-m-d H:i:s.u T'); \n //$vr=[];\n \n if ($id>0){\n echo \"bolshe\";\n } else {\n echo \"net\";\n }\n }", "public function show($id)\n\n {\n\n \n $user = auth()->guard('client')->user();\n $testReview =$user->testReviews()->find($id);\n \n\n\n if (is_null($testReview)) {\n return $this->sendError('Test not found or you dont have access to this test');\n }\n\n\n return $this->sendResponse($testReview->toArray(), 'Test retrieved successfully.');\n\n }", "public function test3($id)\n {\n $tecmarcaextintor = \\App\\TecExtintor::find($id)->tecmarcaextintor;\n return response()->json(['result' => $tecmarcaextintor]);\n }", "public function testListExperiments()\n {\n echo \"\\nTesting experiment listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testGetSelf($id)\n {\n if ($id) {\n $product = static::$shopify->{$this->resourceName}($id)->get();\n\n $this->assertTrue(is_array($product));\n $this->assertNotEmpty($product);\n $this->assertEquals($id, $product['id']);\n }\n }", "public function show($id)\n\t{\n $result = Test::find($id);\n\n if ($result) {\n return $result->toArray();\n } else {\n return 'Resource not found, check id.';\n }\n\t}", "public function testValidGetById() {\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//send the get request to the API\n\t\t$response = $this->guzzle->get('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(), [\n\t\t\t\t'headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t//ensure the response was sent, and the api returned a positive status\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//ensure the returned values meet expectations (just checking enough to make sure the right thing was obtained)\n\t\t$this->assertSame($retrievedOrg->data->orgId, $organization->getOrgId());\n\t\t$this->assertSame($retrievedOrg->data->orgName, $this->VALID_NAME);\n\n\t}", "function execute_test($run_id, $case_id, $test_id)\n{\n\t// triggering an external command line tool or API. This function\n\t// is expected to return a valid TestRail status ID. We just\n\t// generate a random status ID as a placeholder.\n\t\n\t\n\t$statuses = array(1, 2, 3, 4, 5);\n\t$status_id = $statuses[rand(0, count($statuses) - 1)];\n\tif ($status_id == 3) // Untested?\n\t{\n\t\treturn null;\t\n\t}\n\telse \n\t{\n\t\treturn $status_id;\n\t}\n}", "public function experiments_put($id=\"0\")\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n \n if(strcmp($id,\"0\")==0)\n {\n $array = array();\n $array['Error'] = 'Empty ID!';\n $this->response($array);\n }\n \n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n \n if(is_null($params))\n {\n $array = array();\n $array['Error'] = 'Empty document!';\n $this->response($array);\n }\n \n $jutil->setExpStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n \n $result = $sutil->updateExperiment($id,$doc);\n $this->response($result);\n }", "public function get_experiments( $project_id ) {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects/' . abs( intval( $project_id ) ) . '/experiments/',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function get( $id ){}", "function TestRun_get($run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestRun.get', array(new xmlrpcval($run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function TestCase_get($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function experiment($experiment_id)\n\t{\n\t\t$experiment = $this->experimentModel->get_experiment_by_id($experiment_id);\n\n\t\tif (empty($experiment)) return;\n\n\t\tcreate_caller_table();\n\t\t$data['ajax_source'] = 'caller/table_by_experiment/' . $experiment_id;\n\t\t$data['page_title'] = sprintf(lang('callers_for_exp'), $experiment->name);\n\t\t$data['page_info'] = sprintf(lang('add_callers_exp'), $experiment->id);\n\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->authenticate->authenticate_redirect('templates/list_view', $data, UserRole::ADMIN);\n\t\t$this->load->view('templates/footer');\n\t}", "public function testQuestionViewExistingID() {\n $response = $this->get('question/' . $this->question->id);\n $this->assertEquals('200', $response->foundation->getStatusCode());\n $this->assertEquals('general.permission', $response->content->view);\n }", "public function actionTest($id){\n \n $model = $this->findModel($id);\n return $this->render('_auto', ['model' => $model]);\n \n \n }", "public function testGetProjectByID()\n {\n echo \"\\nTesting the project retrieval by ID...\";\n $response = $this->getProject(\"P1\");\n \n //echo \"\\ntestGetProjectByID------\".$response;\n \n \n $result = json_decode($response);\n $prj = $result->Project;\n $this->assertTrue((!is_null($prj)));\n return $result;\n }", "public function getById($id) {\r\n return $this->testsetEntity->find($id);\r\n }", "public function getContest($contestid);", "public function testGetID() {\r\n\t\t$this->assertTrue ( self::TEST_CONTROL_ID == $this->testObject->getID (), 'control ID was incorrectly identified' );\r\n\t}", "public function testRequestItemId3()\n {\n $response = $this->get('/api/items/3');\n\n $response->assertStatus(200);\n }", "public function run($id) {\n return $this->getNikePlusFile('http://nikeplus.nike.com/plus/running/ajax/'.$id);\n }", "function GetTestId()\n {\n if (isset($_SESSION[GetTestIdIdentifier()]))\n {\n return $_SESSION[GetTestIdIdentifier()];\n }\n \n return FALSE;\n }", "function TestCaseRun_get($case_run_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCaseRun.get', array(new xmlrpcval($case_run_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function get(string $id);", "public function rethinktestInterfacerSend()\n {\n App\\Api\\Facades\\Interfacer::send('13');\n\n $dump1 = ExternalDump::find(1);\n\n $this->assertEquals($dump1->result_returned, 1);\n\n $extD = new ExternalDump();\n $externalLabRequestTree = $extD->getLabRequestAndMeasures($dump1->lab_no);\n\n foreach ($externalLabRequestTree as $key => $externalLabRequest) {\n $this->assertEquals(1, $externalLabRequest->result_returned);\n }\n }", "public function testGetId()\n {\n $name = \"Computer Harry Potter\";\n $player = new ComputerPlayer($name);\n $res = $player -> getId();\n $this->assertSame($name, $res);\n }", "public function show($id)\n {\n $test = Test::where('test_id','=',$id)->first();\n return $test;\n }", "public function renderTest($id=''){\n try{\n $breTest=$this->breTestsFacade->findBreTestByKey($id);\n }catch (\\Exception $e){\n throw new BadRequestException();\n }\n\n $this->template->breTest=$breTest;\n }", "public function testGetVesselById()\n {\n $client = new Client(['base_uri' => 'http://localhost:8000/api/']);\n $token = $this->getAuthenticationToken();\n $headers = [\n 'Authorization' => 'Bearer ' . $token,\n 'Accept' => 'application/json',\n ];\n\n $response = $client->request('GET', 'vessel_statuses/3', [\n 'headers' => $headers\n ]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(['application/json; charset=utf-8'], $response->getHeader('Content-Type'));\n $data = json_decode($response->getBody(), true);\n $this->assertEquals('Restricted Manoeuvrability', $data['name']);\n\n }", "public function test_get_all_by_instanceid_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $talkpoints = $this->_cut->get_all_by_instanceid($module->id);\n $this->assertEquals(array(), $talkpoints);\n }", "public function testGetPostById()\n {\n $post = factory(Post::class)->create();\n \n $this->call('Get', '/post/' . $post->id);\n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n }", "public function testDemoteAutomatchUrlUsingGET()\n {\n }", "public function getEpisodeById($id) \n { \n return $this->get('/episodes/'.$id);\n }", "function StoreTestId($testID)\n {\n StartSession();\n \n $_SESSION[GetTestIdIdentifier()] = $testID;\n }", "function get($id)\n {\n return $this->specs->get($id);\n }", "public function testGetPetById()\n {\n // initialize the API client without host\n $pet_id = 10005; // ID of pet that needs to be fetched\n $pet_api = new Api\\PetApi();\n $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555');\n // return Pet (model)\n $response = $pet_api->getPetById($pet_id);\n $this->assertSame($response->getId(), $pet_id);\n $this->assertSame($response->getName(), 'PHP Unit Test');\n $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com');\n $this->assertSame($response->getCategory()->getId(), $pet_id);\n $this->assertSame($response->getCategory()->getName(), 'test php category');\n $this->assertSame($response->getTags()[0]->getId(), $pet_id);\n $this->assertSame($response->getTags()[0]->getName(), 'test php tag');\n }", "public function test_getByExample() {\n\n }", "public function getSiteById(ApiTester $I)\n {\n $I->sendGet(URL_API . '/sites/' . PARAMS_SITE);\n $I->seeResponseCodeIs(200);\n $I->seeResponseIsJson();\n }", "public function show($id)\n\t{\n\t\t$step = \\App\\TestStep::find($id);\n\t\t$execution = \\App\\Execution::where('ts_id', $id)->first(); \t\n\n\t\treturn view('show.step', ['step' => $step, 'execution' => $execution]);\n\t}", "public function testGetIDValue()\n {\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://p1> <http://www.w3.org/2000/01/rdf-schema#range> <http://foobar> .\n }');\n\n $res = $this->fixture->getIDValue(1);\n\n $this->assertEquals('http://example.com/', $res);\n }", "public function get_experiment_results( $experiment_id, $options = array() ) {\n\t\t// @TODO: support options\n\t\t// @TODO: check for 503 in case this endpoint is overloaded (from docs)\n\t\t$extra = '';\n\t\tif ( $options ) {\n\t\t\t$extra = '?' . http_build_query( $options );\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ) . '/results' . $extra,\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function shouldGetProductWhenGivenIdExist()\n {\n $product = factory(Product::class)->create();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint))\n ->assertOk()\n ->assertJsonPath('data.id', $product->id)\n ->assertJsonPath('data.short_name', $product->short_name)\n ->assertJsonPath('data.internal_code', $product->internal_code)\n ->assertJsonPath('data.customer_code', $product->customer_code)\n ->assertJsonPath('data.wire_gauge_in_bwg', $product->wire_gauge_in_bwg)\n ->assertJsonPath('data.wire_gauge_in_mm', $product->wire_gauge_in_mm);\n }", "function getTestValueById($id) {\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->test_table);\n\t\t$this->db->where('test_id', $id);\n $query = $this->db->get();\n\t\treturn $query->result();\n\t}", "function testReGetResource() { \n \t$uuid = $this->temp_uuid;\n\n $data = $this->ceenRU->CEERNResourceCall('/resource'.'/'.$uuid.'.php', 'GET', NULL, FALSE, 'resource_resource.retrieve');\n $this->assertTrue(isset($data['title']));\n }", "function update_experiment($expId, $updatedExperiment)\n{\n global $airavataclient;\n\n try\n {\n $airavataclient->updateExperiment($expId, $updatedExperiment);\n\n print_success_message(\"<p>Experiment updated!</p>\" .\n '<p>Click\n <a href=\"experiment_summary.php?expId=' . $expId . '\">here</a> to visit the experiment summary page.</p>');\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem updating the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n\n}", "public function testGetInstitutionsUsingGET()\n {\n }", "function test_getId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $result = $test_task->getId();\n\n //Assert\n $this->assertEquals(true, is_numeric($result));\n\n }", "public function testRetrieveMultipleRequests()\n {\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n App\\Api\\Facades\\Interfacer::retrieve($this->labRequestUrinalysis[$i]);\n }\n\n $labR = $this->labRequestJsonSimpleTest;\n\n if (strpos($labR,'=') !== false && strpos($labR,'labRequest') !== false) {\n $labR = str_replace(['labRequest', '='], ['', ''], $labR);\n $labR = json_decode($labR);\n }\n\n App\\Api\\Facades\\Interfacer::retrieve($labR); //bs for mps\n\n // Check that all the 'urinalysis' data was stored\n // Was the data stored in the external dump?\n for ($i=0; $i < count($this->labRequestUrinalysis); $i++) { \n $externalDump[] = ExternalDump::where('lab_no', '=', $this->labRequestUrinalysis[$i]->labNo)->get();\n $this->assertTrue(count($externalDump{$i}) > 0);\n }\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDump[0]->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n\n // Check that the 'bs for mps' data was stored\n // Was the data stored in the external dump?\n $externalDumpBS = ExternalDump::where('lab_no', '=', $labR->labNo)->get();\n $this->assertTrue(count($externalDump) > 0);\n\n // Was a new patient created?\n $patient = Patient::where('external_patient_number', '=', $externalDumpBS->first()->patient_id)->get();\n $this->assertTrue(count($patient) > 0);\n\n // Is there a Visit for this new patient?\n $visit = Visit::where('patient_id', '=', $patient->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Test for this visit?\n $test = Test::where('visit_id', '=', $visit->first()->id)->get();\n $this->assertTrue(count($visit) > 0);\n\n // Is there a Specimen for this new Test?\n $specimen = $test->first()->specimen;\n $this->assertTrue(count($specimen) > 0);\n }", "public function getAction(int $id)\n {\n // TODO: Implement getAction() method.\n\n $this->getVerifyProvider()->entry();\n\n }", "function babeliumsubmission_get_exercise_data($exerciseid,$responseid=0){\n Logging::logBabelium(\"Getting exercise data\");\n $g = $this->getBabeliumRemoteService();\n $data = null;\n if($responseid){\n $data = $g->getResponseInformation($responseid);\n if(!$data){\n return null;\n }\n $subtitleId = isset($data['subtitleId']) ? $data['subtitleId'] : 0;\n $mediaId= isset($data['mediaId']) ? $data['mediaId']: 0;\n } else {\n $data = $g->getExerciseInformation($exerciseid);\n if(!$data){\n return null;\n }\n $media = $data['media'];\n $subtitleId = isset($media['subtitleId']) ? $media['subtitleId'] : 0;\n $mediaId= isset($media['id']) ? $media['id']: 0;\n }\n $captions = $g->getCaptions($subtitleId,$mediaId);\n if(!$captions){\n return null;\n }\n\n $exerciseRoles = $this->getExerciseRoles($captions);\n\n //WTF??\n //$recinfo = $g->newServiceCall('requestRecordingSlot');\n $recinfo = null;\n $returnData = $this->getResponseInfo($data, $captions, $exerciseRoles, $recinfo);\n return $returnData;\n }", "public function test_index()\n {\n Instrument::factory(2)->create();\n $response = $this->get('instrument');\n $response->assertStatus(200);\n }", "public function testGetSitesReportById()\n {\n $this->sitesController->shouldReceive('retrieve')->once()->andReturn('Get Site 10 Mocked');\n $this->reportsController->shouldReceive('retrieveBySiteIdAndTestName')->once()->andReturn('Report 3 for Test 2 and Site 1 Mocked');\n\n $output = $this->behatRoutes->getSitesTestsReports(array(1, 'tests', '2', 'reports', '3'));\n $this->assertEquals('Report 3 for Test 2 and Site 1 Mocked', $output);\n }", "public function actionSetTests(string $id)\n {\n $exercise = $this->exercises->findOrThrow($id);\n\n $req = $this->getRequest();\n $tests = $req->getPost(\"tests\");\n\n /*\n * We need to implement CoW on tests.\n * All modified tests has to be newly created (with new IDs) and these\n * new IDs has to be propagated into configuration and limits.\n * Therefore a replacement mapping of updated tests is kept.\n */\n\n $newTests = [];\n $namesToOldIds = []; // new test name => old test ID\n $testsModified = false;\n\n foreach ($tests as $test) {\n // Perform checks on the test name...\n if (!array_key_exists(\"name\", $test)) {\n throw new InvalidArgumentException(\"tests\", \"name item not found in particular test\");\n }\n\n $name = trim($test[\"name\"]);\n if (!preg_match('/^[-a-zA-Z0-9_()\\[\\].! ]+$/', $name)) {\n throw new InvalidArgumentException(\"tests\", \"test name contains illicit characters\");\n }\n if (strlen($name) > 64) {\n throw new InvalidArgumentException(\"tests\", \"test name too long (exceeds 64 characters)\");\n }\n if (array_key_exists($name, $newTests)) {\n throw new InvalidArgumentException(\"tests\", \"two tests with the same name '$name' were specified\");\n }\n\n $id = Arrays::get($test, \"id\", null);\n $description = trim(Arrays::get($test, \"description\", \"\"));\n\n // Prepare a test entity that is to be inserted into the new list of tests...\n $testEntity = $id ? $exercise->getExerciseTestById($id) : null;\n if ($testEntity === null) {\n // new exercise test was requested to be created\n $testsModified = true;\n\n if ($exercise->getExerciseTestByName($name)) {\n throw new InvalidArgumentException(\"tests\", \"given test name '$name' is already taken\");\n }\n\n $testEntity = new ExerciseTest($name, $description, $this->getCurrentUser());\n $this->exerciseTests->persist($testEntity);\n } elseif ($testEntity->getName() !== $name || $testEntity->getDescription() !== $description) {\n // an update is needed => a copy is made and old ID mapping is kept\n $testsModified = true;\n $namesToOldIds[$name] = $id;\n $testEntity = new ExerciseTest($name, $description, $testEntity->getAuthor());\n $this->exerciseTests->persist($testEntity);\n }\n // otherwise, the $testEntity is unchanged\n\n $newTests[$name] = $testEntity;\n }\n\n if (!$testsModified && count($exercise->getExerciseTestsIds()) === count($newTests)) {\n // nothing has changed\n $this->sendSuccessResponse(array_values($newTests));\n return;\n }\n\n $testCountLimit = $this->exerciseRestrictionsConfig->getTestCountLimit();\n if (count($newTests) > $testCountLimit) {\n throw new InvalidArgumentException(\n \"tests\",\n \"The number of tests exceeds the configured limit ($testCountLimit)\"\n );\n }\n\n // first, we create the new tests as independent entities, to get their IDs\n $this->exerciseTests->flush(); // actually creates the entities\n $idMapping = []; // old ID => new ID\n foreach ($newTests as $test) {\n $this->exerciseTests->refresh($test);\n if (array_key_exists($test->getName(), $namesToOldIds)) {\n $oldId = $namesToOldIds[$test->getName()];\n $idMapping[$oldId] = $test->getId();\n }\n }\n\n // clear old tests and set new ones\n $exercise->getExerciseTests()->clear();\n $exercise->setExerciseTests(new ArrayCollection($newTests));\n $exercise->updatedNow();\n\n // update exercise configuration and test in here\n $this->exerciseConfigUpdater->testsUpdated($exercise, $this->getCurrentUser(), $idMapping, false);\n $this->configChecker->check($exercise);\n\n $this->exercises->flush();\n $this->sendSuccessResponse(array_values($newTests));\n }", "public function show($id){\n return \\App\\Models\\Puzzel::where(\"id\", \"=\", $id)->get()->first();\n }", "public function testElementMatchingWithTagAndID()\n {\n $mock = Mockery::mock('ZafBoxRequest');\n\n $test_result = new stdClass;\n $test_result->status_code = 200;\n $test_result->body = '<html><body><h1 id=\"title\">Some Text</h1></body></html>';\n $mock->shouldReceive('get')->andReturn($test_result);\n\n // set the requests object to be our stub\n IoC::instance('requests', $mock);\n\n $tester = IoC::resolve('tester');\n\n $result = $tester->test('element', 'http://dhwebco.com', array(\n 'tag' => 'h1',\n 'id' => 'title',\n ));\n\n $this->assertTrue($result);\n }", "public function test_findId() {\n $data = $this->SampleSet->find('all', ['conditions' => ['id' => 1]]);\n $this->assertNotNull($data);\n $this->assertEquals(1, $data[0]['SampleSet']['id']);\n $this->assertEquals(1, count($data));\n }", "function test_get_by_id()\n {\n $dm = new mdl_direct_message();\n $result = $dm->get_by_id(1, 1);\n\n $this->assertEquals(count($result), 1);\n }", "public function search_id($id){\n $imdb_id = urlencode($id);\n $url = 'http://mymovieapi.com/?ids='.$imdb_id.'&type=json&plot=simple&episode=1&lang=en-US&aka=simple&release=simple&business=0&tech=0';\n search_url($url);\n }", "public function get( $id );", "abstract public function retrieve($id);", "public function testRequestItemEditId3()\n {\n $response = $this->get('/api/items/3/edit');\n\n $response->assertStatus(200);\n }", "public function testMediaFileIdGet()\n {\n $client = static::createClient();\n\n $path = '/media/file/{id}';\n $pattern = '{id}';\n $data = $this->genTestData('\\d+');\n $path = str_replace($pattern, $data, $path);\n\n $crawler = $client->request('GET', $path);\n }", "public function edit($id)\n {\n return $this->exerciseResultsService->findWith($id, ['exercise', 'user', 'attachments']);\n }", "function echo_contest_summary_for_id($id) {\n echo_summary_view_for_contest($id);\n}" ]
[ "0.8079397", "0.70720243", "0.66221786", "0.6372758", "0.6348471", "0.6327254", "0.6164168", "0.61540025", "0.6119591", "0.6040424", "0.59662414", "0.59080625", "0.58955175", "0.58827364", "0.5867978", "0.5862803", "0.5862368", "0.5860236", "0.5822475", "0.5786058", "0.5783987", "0.5779225", "0.57521576", "0.57371855", "0.5727865", "0.5717", "0.5700085", "0.56925637", "0.5679692", "0.5673236", "0.56705755", "0.56593525", "0.5651872", "0.5637597", "0.56355715", "0.56341237", "0.563027", "0.56240165", "0.56204396", "0.5611084", "0.5595774", "0.559391", "0.55780834", "0.55722046", "0.55633605", "0.555339", "0.5549499", "0.5534357", "0.5533448", "0.5525256", "0.55067486", "0.5499233", "0.54837173", "0.5479338", "0.54789805", "0.54694563", "0.54675376", "0.5463197", "0.5456817", "0.5445041", "0.54255223", "0.5420578", "0.5419946", "0.54187995", "0.54154646", "0.54060274", "0.5399564", "0.53889424", "0.5381727", "0.53803664", "0.53764594", "0.5375551", "0.5374207", "0.5358641", "0.53548765", "0.5354743", "0.5338948", "0.53204644", "0.5320142", "0.5316047", "0.5314381", "0.5306207", "0.5303384", "0.5302666", "0.5297816", "0.52931696", "0.5290679", "0.5288377", "0.52860343", "0.52837175", "0.52803993", "0.52780706", "0.5273266", "0.52676564", "0.526169", "0.52557725", "0.52551734", "0.5254453", "0.52482885", "0.5244543" ]
0.57855254
20
Testing the document search
public function testSearchDocument() { echo "\nTesting document search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents?search=mouse"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/documents?search=mouse"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInboundDocumentSearch()\n {\n }", "function testFindSearchcontentSco() {\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function search(){}", "public function search();", "public function search();", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function testListDocuments()\n {\n }", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function searchAction() {\n $search = $this->getParam('search');\n\n\n $queryBuilder = new Application_Util_QueryBuilder($this->getLogger());\n\n $queryBuilderInput = array(\n 'searchtype' => 'simple',\n 'start' => '0',\n 'rows' => '10',\n 'sortOrder' => 'desc',\n 'sortField'=> 'score',\n 'docId' => null,\n 'query' => $search,\n 'author' => '',\n 'modifier' => 'contains_all',\n 'title' => '',\n 'titlemodifier' => 'contains_all',\n 'persons' => '',\n 'personsmodifier' => 'contains_all',\n 'referee' => '',\n 'refereemodifier' => 'contains_all',\n 'abstract' => '',\n 'abstractmodifier' => 'contains_all',\n 'fulltext' => '',\n 'fulltextmodifier' => 'contains_all',\n 'year' => '',\n 'yearmodifier' => 'contains_all',\n 'author_facetfq' => '',\n 'languagefq' => '',\n 'yearfq' => '',\n 'doctypefq' => '',\n 'has_fulltextfq' => '',\n 'belongs_to_bibliographyfq' => '',\n 'subjectfq' => '',\n 'institutefq' => ''\n );\n\n\n $query = $queryBuilder->createSearchQuery($queryBuilderInput, $this->getLogger());\n\n $result = array();\n\n $searcher = new Opus_SolrSearch_Searcher();\n try {\n $result = $searcher->search($query);\n }\n catch (Opus_SolrSearch_Exception $ex) {\n var_dump($ex);\n }\n\n $matches = $result->getReturnedMatches();\n\n $this->view->total = $result->getAllMatchesCount();\n $this->view->matches = $matches;\n }", "function search() {}", "public function testSearchUsingGET()\n {\n\n }", "public function testListAllDocuments()\n {\n }", "public function action_search_doc()\n\t{\n\t\tglobal $context;\n\n\t\t$context['doc_apiurl'] = 'https://github.com/elkarte/Elkarte/wiki/api.php';\n\t\t$context['doc_scripturl'] = 'https://github.com/elkarte/Elkarte/wiki/';\n\n\t\t// Set all the parameters search might expect.\n\t\t$postVars = explode(' ', $context['search_term']);\n\n\t\t// Encode the search data.\n\t\tforeach ($postVars as $k => $v)\n\t\t{\n\t\t\t$postVars[$k] = urlencode($v);\n\t\t}\n\n\t\t// This is what we will send.\n\t\t$postVars = implode('+', $postVars);\n\n\t\t// Get the results from the doc site.\n\t\trequire_once(SUBSDIR . '/Package.subs.php');\n\t\t// Demo URL:\n\t\t// https://github.com/elkarte/Elkarte/wiki/api.php?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=template+eval\n\t\t$search_results = fetch_web_data($context['doc_apiurl'] . '?action=query&list=search&srprop=timestamp|snippet&format=xml&srwhat=text&srsearch=' . $postVars);\n\n\t\t// If we didn't get any xml back we are in trouble - perhaps the doc site is overloaded?\n\t\tif (!$search_results || preg_match('~<' . '\\?xml\\sversion=\"\\d+\\.\\d+\"\\?' . '>\\s*(<api>.+?</api>)~is', $search_results, $matches) !== 1)\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t$search_results = !empty($matches[1]) ? $matches[1] : '';\n\n\t\t// Otherwise we simply walk through the XML and stick it in context for display.\n\t\t$context['search_results'] = array();\n\n\t\t// Get the results loaded into an array for processing!\n\t\t$results = new XmlArray($search_results, false);\n\n\t\t// Move through the api layer.\n\t\tif (!$results->exists('api'))\n\t\t{\n\t\t\tthrow new Exception('cannot_connect_doc_site');\n\t\t}\n\n\t\t// Are there actually some results?\n\t\tif ($results->exists('api/query/search/p'))\n\t\t{\n\t\t\t$relevance = 0;\n\t\t\tforeach ($results->set('api/query/search/p') as $result)\n\t\t\t{\n\t\t\t\t$title = $result->fetch('@title');\n\t\t\t\t$context['search_results'][$title] = array(\n\t\t\t\t\t'title' => $title,\n\t\t\t\t\t'relevance' => $relevance++,\n\t\t\t\t\t'snippet' => str_replace('class=\\'searchmatch\\'', 'class=\"highlight\"', un_htmlspecialchars($result->fetch('@snippet'))),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function testGetDocument()\n {\n }", "public function testReadDocument()\n {\n }", "function search()\n\t{}", "function search()\n\t{}", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "public function test_searchByPage() {\n\n }", "public function testBookSearchMustOK()\n {\n $dataSearch = [];\n $dataSearch['search'] = 'TestBook';\n $dataSearch['limit'] = 100;\n $buildParams = http_build_query($dataSearch, PHP_QUERY_RFC1738);\n $url = route('book.index');\n $fullUrl = \"$url?$buildParams\";\n $response = $this->getJson($fullUrl);\n\n $response\n ->assertStatus(200)\n ->assertJsonPath('page_info.total', 1);\n }", "public function testListDocuments()\n {\n echo \"\\nTesting document listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function search($search);", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function testCreateDocument()\n {\n echo \"\\nTesting document creation...\";\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n //echo \"-----Create Response:\".$response;\n \n $result = json_decode($response);\n $this->assertTrue(!$result->success);\n \n \n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "public function testSearchExperiment()\n {\n echo \"\\nTesting experiment search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/experiments?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "function test_general_entries_search_on_post_content() {\n\t\t$search_string = 'Different';\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 1, array( 'post-entry-2' ) );\n\t}", "public function testGetPublicDocument()\n {\n }", "public function testSearch()\n {\n $manager = new Manager($this->minimal, $this->driver);\n\n // Exception handling\n $this->assertBindingFirst($manager, 'search');\n $manager->connect();\n $this->assertBindingFirst($manager, 'search');\n $manager->bind();\n\n $this->driver->getConnection()->setFailure(Connection::ERR_MALFORMED_FILTER);\n try {\n $res = $manager->search();\n $this->fail('Filter malformed, query shall fail');\n } catch (MalformedFilterException $e) {\n $this->assertRegExp('/Malformed filter/', $e->getMessage());\n }\n\n // Basic search\n $set = array(new Entry('a'), new Entry('b'), new Entry('c'));\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'dc=example,dc=com',\n '(objectclass=*)',\n SearchInterface::SCOPE_ALL,\n null,\n $set\n );\n\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n\n $data = array();\n foreach ($result as $key => $value) {\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\Node', $value);\n $data[$key] = $value->getAttributes();\n }\n\n $this->assertArrayHasKey('a', $data);\n $this->assertArrayHasKey('b', $data);\n $this->assertArrayHasKey('c', $data);\n $this->assertEquals(\n 3,\n count($data),\n 'The right search result got retrieved'\n );\n\n // Empty result set search\n $this->driver->getConnection()->setFailure(Connection::ERR_NO_RESULT);\n $this->driver->getConnection()->stackResults($set);\n $result = $manager->search();\n $this->assertInstanceOf(\n 'Toyota\\Component\\Ldap\\Core\\SearchResult',\n $result,\n 'Query did not fail - Exception got handled'\n );\n\n $data = array();\n foreach ($result as $key => $value) {\n $data[$key] = $value->getAttributes();\n }\n $this->assertEquals(\n 0,\n count($data),\n 'The exception got handled and the search result set has not been set in the query'\n );\n\n // Alternative parameters search\n $result = $manager->search(\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n false,\n array('attr1', 'attr2')\n );\n $this->assertSearchLog(\n $this->driver->getConnection()->shiftLog(),\n 'ou=other,dc=example,dc=com',\n '(objectclass=test)',\n SearchInterface::SCOPE_ONE,\n array('attr1', 'attr2'),\n $set\n );\n $this->assertInstanceOf('Toyota\\Component\\Ldap\\Core\\SearchResult', $result);\n }", "function search( $searchText, $params = array(), $searchTypes = array() )\n {\t\n \n $cl = new SphinxClient();\n\t \t$cl->SetServer( $this->SphinxServerHost, $this->SphinxServerPort );\n\t \t\n\t \t// Match mode\n\t \t$matchModes = array(\n\t \t\t'SPH_MATCH_ANY' => SPH_MATCH_ANY,\n\t \t\t'SPH_MATCH_ALL' => SPH_MATCH_ALL,\n\t \t\t'SPH_MATCH_PHRASE' => SPH_MATCH_PHRASE,\n\t \t\t'SPH_MATCH_BOOLEAN' => SPH_MATCH_BOOLEAN,\n\t \t\t'SPH_MATCH_EXTENDED' => SPH_MATCH_EXTENDED,\n\t \t\t'SPH_MATCH_FULLSCAN' => SPH_MATCH_FULLSCAN,\n\t \t\t'SPH_MATCH_EXTENDED2' => SPH_MATCH_EXTENDED2,\n\t \t);\t \t\n\t \t$cl->SetMatchMode((isset($params['MatchType']) and key_exists($params['MatchType'],$matchModes)) ? $matchModes[$params['MatchType']] : SPH_MATCH_ANY);\n\t \t\n\t \t \n\t \t// Perhaps anyone have an idea how to implement this type checking in Sphinx ?\n\t \t// (ezcontentobject.section_id in (1)) OR (ezcontentobject.contentclass_id in (1, 19, 20, 27, 29, 30, 31, 32, 33, 34, 40, 44, 47, 48, 50, 51, 52, 57, 59, 61) AND ezcontentobject.section_id in (3))\n\t \t// At this moment it can be implemented directly in sphinx configuration query.\n\t \t/*$limitation = false;\n if ( isset( $params['Limitation'] ) )\n {\n $limitation = $params['Limitation'];\n }\n $limitationList = eZContentObjectTreeNode::getLimitationList( $limitation );\n $sqlPermissionChecking = eZContentObjectTreeNode::createPermissionCheckingSQL( $limitationList );*/\n \n\t \t\n\t \t// Set limit, offset\t \t\n\t\t$cl->SetLimits((int)$params['SearchOffset'],(int)$params['SearchLimit']);\n\t\t\t \n\t\t// Language filter, eZFind copied and changed a little bit :D\n\t\t$ini = eZINI::instance();\n $languages = $ini->variable( 'RegionalSettings', 'SiteLanguageList' );\n $mainLanguage = $languages[0]; \n $cl->SetFilter( 'language_code',array(abs(crc32($mainLanguage))));\n \n // Fetch only not deleted records\n\t\t$cl->SetFilter( 'is_deleted',array(0));\n\t\t\n\t\t\t\n\t \t// Build section filter\n\t \t$searchSectionID = $params['SearchSectionID'];\n\t \tif ( is_numeric( $searchSectionID ) and $searchSectionID > 0 )\n { \n $cl->SetFilter( 'section_id', array( (int)$searchSectionID ) );\n }\n else if ( is_array( $searchSectionID ) )\n {\n \t$cl->SetFilter( 'section_id',$searchSectionID);\n }\n \n // Build class filter \n $searchContentClassID = isset($params['SearchContentClassID']) ? $params['SearchContentClassID'] : 0 ; \n if ( is_numeric( $searchContentClassID ) and $searchContentClassID > 0 )\n {\n \t $cl->SetFilter( 'contentclass_id', array((int)$searchContentClassID));\n }\n else if ( is_array( $searchContentClassID ) )\n { \n $cl->SetFilter( 'contentclass_id',$searchContentClassID);\n }\n \n // Build parent node filter\n $searchParentNodeID = isset($params['ParentNodeID']) ? $params['ParentNodeID'] : 0 ; \n if ( is_numeric( $searchParentNodeID ) and $searchParentNodeID > 0 )\n {\n \t $cl->SetFilter( 'parent_node_id', array((int)$searchParentNodeID));\n }\n else if ( is_array( $searchParentNodeID ) )\n { \n $cl->SetFilter( 'parent_node_id',$searchParentNodeID);\n }\n \n // Build subtree filter\n $searchSubtreeNodeID = isset($params['SearchSubTreeArray']) ? $params['SearchSubTreeArray'] : 0 ; \n if ( is_numeric( $searchSubtreeNodeID ) and $searchSubtreeNodeID > 0 )\n {\n \t $cl->SetFilter( 'pathnodes', array((int)$searchSubtreeNodeID));\n }\n else if ( is_array( $searchSubtreeNodeID ) and count( $searchSubtreeNodeID ) )\n { \n $cl->SetFilter( 'pathnodes',$searchSubtreeNodeID);\n }\n \n \n // Visibility check\n $ignoreVisibility = $params['IgnoreVisibility'] == 'true' ? true : false;\n if (!$ignoreVisibility)\n {\n \t\t$cl->SetFilter( 'is_invisible',array(0));\n } \n \n // Publish date,timestamp date filter, borrowed from ezsearchengine plugin. :) \n if ( isset( $params['SearchDate'] ) )\n \t$searchDate = $params['SearchDate'];\n\t else\n\t\t $searchDate = -1;\n\t\t\n\t if ( isset( $params['SearchTimestamp'] ) )\n\t\t $searchTimestamp = $params['SearchTimestamp'];\n\t else\n\t\t $searchTimestamp = false;\n \t\t \n \n if ( ( is_numeric( $searchDate ) and $searchDate > 0 ) or\n $searchTimestamp )\n {\n $date = new eZDateTime();\n $timestamp = $date->timeStamp();\n $day = $date->attribute('day');\n $month = $date->attribute('month');\n $year = $date->attribute('year');\n $publishedDateStop = false;\n if ( $searchTimestamp )\n {\n if ( is_array( $searchTimestamp ) )\n {\n $publishedDate = $searchTimestamp[0];\n $publishedDateStop = $searchTimestamp[1];\n }\n else\n $publishedDate = $searchTimestamp;\n }\n else\n {\n switch ( $searchDate )\n {\n case 1:\n {\n $adjustment = 24*60*60; //seconds for one day\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 2:\n {\n $adjustment = 7*24*60*60; //seconds for one week\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 3:\n {\n $adjustment = 31*24*60*60; //seconds for one month\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 4:\n {\n $adjustment = 3*31*24*60*60; //seconds for three months\n $publishedDate = $timestamp - $adjustment;\n } break;\n case 5:\n {\n $adjustment = 365*24*60*60; //seconds for one year\n $publishedDate = $timestamp - $adjustment;\n } break;\n default:\n {\n $publishedDate = $date->timeStamp();\n }\n }\n }\n \n if ($publishedDateStop)\n {\n \t$cl->SetFilterRange('published', $publishedDate, $publishedDateStop); // Range type\n } else {\n \t$cl->SetFilterRange('published', 0, $publishedDate, true); // > type\n }\n }\n \n if ( isset( $params['SortBy'] ) )\n $sortArray = $params['SortBy'];\n else\n $sortArray = array(); \n \n // Build sort params \n \t$sortString = $this->buildSort($sortArray); \t\n \tif ($sortString != '')\n \t{\n \t\t$cl->SetSortMode(SPH_SORT_EXTENDED, $sortString); // During sorting we set extended sort mode\n \t}\n \n \n \t\n // Filter , Partly based on ezpersistenobject eZPersistentObject::conditionTextByRow() method \t\n\t\t$fitlerRanges = isset($params['Filter']) ? $params['Filter'] : null;\n\t\tif ( is_array( $fitlerRanges ) and\n count( $fitlerRanges ) > 0 )\n {\n \t\n \tforeach ($fitlerRanges as $id => $cond)\n \t{ \t\t\n \t\tif ( is_array( $cond ) )\n {\n if ( is_array( $cond[0] ) ) // = operator behaviour\n {\n \t$cl->SetFilter( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) , (int)$cond[0] ); \n }\n else if ( is_array( $cond[1] ) ) // Betweeen range\n { \n $range = $cond[1];\n $cl->SetFilterRange('attr_srch_int_pos'.$this->getPositionClassAttribute($id), (int)$range[0], (int)$range[1], $cond[0] == 'true' ); \t\n }\n else\n {\n switch ( $cond[0] )\n {\n case '>=': \n case '>': \n {\n \t $cl->SetFilterRange( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) ,0, (int)$cond[1], true );\n \n } break;\n \n case '<=': \n case '<': \n {\n \t $cl->SetFilterRange( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id),0, (int)$cond[1], false );\n \n } break;\n \n \n default:\n {\n eZDebug::writeError( \"Conditional operator '$cond[0]' is not supported.\",'eZSphinx::search()' );\n } break;\n }\n\n }\n } else {\n \t$cl->SetFilter( 'attr_srch_int_pos'.$this->getPositionClassAttribute($id) , array($cond) ); \t\n }\n \t}\n }\n\t\t\n // Sphinx field weightning\n if (isset($params['FieldWeight']) and is_array($params['FieldWeight']) and count($params['FieldWeight']) > 0)\n {\n \t$tmpFields = array();\n \tforeach ($params['FieldWeight'] as $classAttributeID => $weight)\n \t{\n \t\t$tmpFields['attr_srch_pos'.$this->getPositionClassAttribute($classAttributeID)] = $weight;\n \t} \n \t$cl->SetFieldWeights($tmpFields);\n \tunset($tmpFields);\n }\n \n \n // this will work only if SPH_MATCH_EXTENDED mode is set\n $AppendExtendQuery = '';\n if (isset($params['MatchType']) and key_exists($params['MatchType'],$matchModes) and $matchModes[$params['MatchType']] == SPH_MATCH_EXTENDED)\n {\n \t$searchClassAttributeID = isset($params['SearchClassAttributeID']) ? $params['SearchClassAttributeID'] : 0 ; \n\t if ( is_numeric( $searchClassAttributeID ) and $searchClassAttributeID > 0 )\n\t {\n\t \t $AppendExtendQuery = '@attr_srch_pos'.$this->getPositionClassAttribute((int)$searchClassAttributeID).' ';\n\t }\n\t else if ( is_array( $searchClassAttributeID ) )\n\t { \n\t \n\t $SubElements = array();\n\t foreach ($searchClassAttributeID as $ClassAttributeID)\n\t {\n\t \t$SubElements[] = 'attr_srch_pos'.$this->getPositionClassAttribute($ClassAttributeID);\n\t }\n\t \t$AppendExtendQuery = '@('.implode(',',$SubElements).') ';\t \n\t }\n }\n \n // Transofrm without special characters like i understood. Actualy in sphinx it's not needed. But like indexing converts them to normalized text, it will be changed in futher versions..\n $trans = eZCharTransform::instance();\n $searchText = $trans->transformByGroup( $searchText, 'search' ); \n\t \t$result = $cl->Query( $AppendExtendQuery.trim($searchText) , isset($params['IndexName']) ? $params['IndexName'] : $this->SphinxIndexName );\n\t \t\t\n\t \t// If nothing found return immediately \t\n\t \tif ($result['total_found'] == 0)\n\t \t{\t \t\n\t\t \treturn array( \"SearchResult\" => array(),\n\t \"SearchCount\" => 0,\n\t \"StopWordArray\" => array() );\n\t \t} \n\t \t\n\t \t$NodeIDList = array();\n\t \n\t \t$SingleNodeID = null;\n\t \t\n\t \tif ($result['total_found'] > 1)\n\t \t{\n\t\t \t// Build nodes ID's\n\t\t \tforeach ($result['matches'] as $match)\n\t\t \t{ \t\t\n\t\t \t\t$NodeIDList[$match['attrs']['node_id']] = $match['attrs']['node_id'];\n\t\t \t}\n\t \t} else {\n\t \t\t\tforeach ($result['matches'] as $match)\n\t\t\t \t{\t \t\t\n\t\t\t \t\t$NodeIDList = $match['attrs']['node_id'];\n\t\t\t \t\t$SingleNodeID = $match['attrs']['node_id'];\n\t\t\t \t}\n\t \t}\n\t \t\n\t \t\n\t \t$nodeRowList = array();\n \t\t$tmpNodeRowList = eZContentObjectTreeNode::fetch( $NodeIDList, false, isset($params['AsObjects']) ? $params['AsObjects'] : true );\n \t\t \t\n // Workaround for eZContentObjectTreeNode::fetch behaviour\n if ( count( $tmpNodeRowList ) === 1 )\n {\n $tmpNodeRowList = array( $tmpNodeRowList ); \n unset($NodeIDList); \n $NodeIDList = array();\n $NodeIDList[$SingleNodeID] = $SingleNodeID;\n }\n \n // If fetched objects, keeps fetched sorting as Sphinx returned it\n if (!isset($params['AsObjects']) || $params['AsObjects'] === true)\n { \n\t\t\tforeach ($tmpNodeRowList as $node)\n\t\t\t{\n\t\t\t\t$NodeIDList[$node->attribute('node_id')] = $node;\n\t\t\t}\n } else { // If fetched array\n \tforeach ($tmpNodeRowList as $node)\n\t\t\t{\n\t\t\t\t$NodeIDList[$node['node_id']] = $node;\n\t\t\t}\n } \n \tunset($tmpNodeRowList);\n \t \t\n\t \t$searchResult = array(\n\t \t\t'SearchCount' => $result['total_found'],\n\t \t\t'SearchResult' => $NodeIDList,\n\t \t\t'SearchTook' => $result['time'],\n\t \t\t\"StopWordArray\" => array() // Perhaps anyone nows how to set this ? :)\n\t \t);\n \n return $searchResult; \n }", "function test_field_specific_search_on_post_title() {\n\n\t\t// Single word. Two matching entries should be found.\n\t\t$search_string = \"Jamie's\";\n\t\t$field_key = 'yi6yvm';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\n\t\t// Single word. No entries should be found.\n\t\t$search_string = 'TextThatShouldNotBeFound';\n\t\t$items = self::generate_and_run_field_specific_query( 'create-a-post', $field_key, $search_string );\n\t\t$msg = 'A search for ' . $search_string . ' in post title field ' . $field_key;\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "public function test_admin_search_keyword_b()\n {\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function searchAction()\n {\n $user_id = $this->getSecurityContext()->getUser()->getId();\n $drive = $this->_driveHelper->getRepository()->getDriveByUserId($user_id);\n\n $q = $this->getScalarParam('q');\n // $hits = $this->getResource('drive.file_indexer')->searchInDrive($q, $drive->drive_id);\n $hits = $this->getResource('drive.file_indexer')->search($q);\n\n echo '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />';\n echo '<strong>', $hits->hitCount, '</strong> hits<br/>';\n foreach ($hits->hits as $hit) {\n $file = $this->_driveHelper->getRepository()->getFile($hit->document->file_id);\n if (empty($file)) {\n echo 'Invalid file ID: ', $hit->document->file_id;\n }\n if ($file && $this->_driveHelper->isFileReadable($file)) {\n echo '<div>', '<strong>', $file->name, '</strong> ', $this->view->fileSize($file->size), '</div>';\n }\n }\n exit;\n }", "public function search($query);", "public function is_search()\n {\n }", "public function testSearchUser()\n {\n echo \"\\nTesting user search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users?search=Vicky\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/users?search=Vicky\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "function search() {\n // ...\n }", "public function testPostVoicemailSearch()\n {\n }", "function findDocument(){\r\n\t\r\n\t\r\n\t\r\n\t//get the value form the textbox\r\n\tif ( ! empty($_GET['searchTextBox']) && isset($_GET['page']) && $_GET['page']==1){\r\n\t\t\r\n\t\tsession_start();\r\n\t\t$_SESSION['docNames'] = json_decode(file_get_contents('docIndex.json'), true);\r\n\t\t\r\n\t\t//read the stopwords\r\n\t\t$stopWords = file_get_contents(\"StopWords.txt\");\t\t\r\n\t\t$postingList = json_decode(file_get_contents('PL.json'), true);//$_SESSION['PL'];\r\n\t\t$stopW = explode(\" \",$stopWords);\r\n\t\t\r\n \t$query = $_GET['searchTextBox'];\r\n\t\t\r\n\t\t//clean the query\r\n\t\t$query = preg_replace(\"/[^a-zA-Z ]/\",\"\",$query);\r\n\t\t\r\n\t\t//change everything to lowercase\r\n\t\t$query = strtolower($query);\r\n\t\t$query = trim($query);\t\t\r\n\t\t$query = preg_replace(\"/\\s+$/\",\" \",$query);\r\n\t\t//echo $query;\r\n\t\t\r\n\t\t//parse the query\r\n\t\t$qTemp = explode(\" \",$query);\r\n\t\t$qArray = array();\r\n\t\t$j = 0;\r\n\t\t\r\n\t\t//remove stop words\r\n\t\tfor($i=0;$i<count($qTemp);$i++){\r\n\t\t\tif(!in_array($qTemp[$i],$stopW)){\r\n\t\t\t\t$qArray[$j] = $qTemp[$i];\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//print_r($qArray);\r\n\t\t$_SESSION['queryFinal'] = $qArray;\r\n\t\t\r\n\t\tif(count($qArray)==0 || !array_key_exists($qArray[0],$postingList)){\r\n\t\t\t\techo \"</br>\";\r\n\t\t\t\techo \"No Results Found\";\r\n\t\t\t\texit (0);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$docIndex = $postingList[$qArray[0]][\"token\"];\r\n\t\t\t\r\n\t\t\t//collect document index\r\n\t\t\tfor($i=1;$i<count($qArray);$i++){\r\n\t\t\t\tif(!array_key_exists($qArray[$i],$postingList)){\r\n\t\t\t\t\techo \"</br>\";\r\n\t\t\t\t\techo \"No Results Found\";\r\n\t\t\t\t\texit (0);\r\n\t\t\t\t}\r\n\t\t\t\t$tempIndex = $postingList[$qArray[$i]][\"token\"];\r\n\t\t\t\t$docIndex = array_intersect($docIndex,$tempIndex);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$_SESSION['docIndex'] = array_values($docIndex);\r\n\t\t$_SESSION['numD'] = count($docIndex);\r\n\t\techo \"<br />\";\r\n\t\techo $_SESSION['numD'].\",000,000\".\" results\";\r\n\t\techo \"<br /><br />\";\r\n\t\t//print_r($_SESSION['docIndex']);\r\n\t\t//exit(0);\r\n\t\r\n\t\treturnDoc();\r\n\t}\t\r\n\telse if(isset($_GET['page'])){\r\n\t\tsession_start();\r\n\t\techo \"<br />\";\r\n\t\techo $_SESSION['numD'].\",000,000\".\" relevant results\";\r\n\t\techo \"<br /><br />\";\r\n\t\treturnDoc();\r\n\t}\r\n\t\r\n}", "function fullTextSearch($client, $html, $query)\n{\n if ($html) {echo \"<h2>Documents containing $query</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed(\n 'https://docs.google.com/feeds/documents/private/full?q=' . $query);\n\n printDocumentsFeed($feed, $html);\n}", "public function testSearchModelSets()\n {\n }", "public function testReadPublicDocument()\n {\n }", "public function testSearchBy(): void\n {\n// $model::query();\n }", "public function testSearchBlankKeyword() {\n $aCategory = factory(App\\Category::class)->create();\n $aLocation = factory(App\\Location::class)->create();\n\n $expectedPost = factory(App\\Post::class)->create([\n 'title' => 'harambe',\n 'category_id' => $aCategory->id,\n 'location_id' => $aLocation->id\n ]);\n\n $acutalPost = $this->call('GET', 'posts/search')->original->getData()['posts']->first();\n\n $this->assertEquals($expectedPost->id, $acutalPost->id);\n $this->assertEquals($expectedPost->title, $acutalPost->title);\n }", "public function test_text_search_group() {\n\t\t$public_domain_access_group = \\App\\Models\\User\\AccessGroup::with('filesets')->where('name','PUBLIC_DOMAIN')->first();\n\t\t$fileset_hashes = $public_domain_access_group->filesets->pluck('hash_id');\n\t\t$fileset = \\App\\Models\\Bible\\BibleFileset::with('files')->whereIn('hash_id',$fileset_hashes)->where('set_type_code','text_plain')->inRandomOrder()->first();\n\n\t\t$sophia = \\DB::connection('sophia')->table(strtoupper($fileset->id).'_vpl')->inRandomOrder()->take(1)->first();\n\t\t$text = collect(explode(' ',$sophia->verse_text))->random(1)->first();\n\n\t\t$this->params['dam_id'] = $fileset->id;\n\t\t$this->params['query'] = $text;\n\t\t$this->params['limit'] = 5;\n\n\t\techo \"\\nTesting: \" . route('v2_text_search_group', $this->params);\n\t\t$response = $this->get(route('v2_text_search_group'), $this->params);\n\t\t$response->assertSuccessful();\n\t}", "public function testSearchSubject()\n {\n echo \"\\nTesting subject search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testQuarantineFind()\n {\n\n }", "public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}", "public function testCreateDocument()\n {\n }", "public function testGetVoicemailSearch()\n {\n }", "function testFindBooksResults() {\n\n /* test title */\n echo '<h2 style=\"color: black;\">testFindBookResults...</h2>';\n\n /* can't page layout because of the indeterminate nature of\n * results (i.e. we can't guarantee there's a book in the \n * production database, and the page layout depends on whether\n * or not there's a result)*/\n\n /* a fix for this could be to possibly display the\n * container (div or whatever) for results, then just\n * not populate it with anything if no results */\n\n $this->assertTrue(1);\n\n }", "public function testInboundDocumentGet()\n {\n }", "function is_search()\n {\n }", "public function testListAllPublicDocuments()\n {\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "function testSearchByCustomField() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS&q[per_900][value]=200');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Green<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards'));\n\t}", "public function testEnableFulltextSearch()\n {\n $res1 = $this->fixture->enableFulltextSearch();\n $res2 = $this->fixture->disableFulltextSearch();\n\n $this->assertNull($res1);\n $this->assertEquals(1, $res2);\n\n $this->assertEquals(0, $this->fixture->a['db_object']->getErrorCode());\n $this->assertEquals('', $this->fixture->a['db_object']->getErrorMessage());\n }", "public function search($q);", "public function testSearchApi()\n {\n $response = $this->callJsonApi('GET', '/api/v1/resources/search');\n $code = $response['response']['code'];\n $this->assertSame(200, $code);\n $this->assertSame(16, $response['result']['query']['total']);\n $this->assertSame(16, count($response['result']['hits']));\n }", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "public function matchedDocs() {\n\t\tthrow new \\Core\\Search\\Lucene\\Exception ( 'Wildcard query should not be directly used for search. Use $query->rewrite($index)' );\n\t}", "public function getSearch();", "public function actionSearch($info){\n $cl = new SphinxClient();\n $cl->SetServer ( '127.0.0.1', 9312);\n//$cl->SetServer ( '10.6.0.6', 9312);\n//$cl->SetServer ( '10.6.0.22', 9312);\n//$cl->SetServer ( '10.8.8.2', 9312);\n $cl->SetConnectTimeout ( 10 );\n $cl->SetArrayResult ( true );\n// $cl->SetMatchMode ( SPH_MATCH_ANY);\n $cl->SetMatchMode ( SPH_MATCH_EXTENDED2);\n $cl->SetLimits(0, 1000);\n// $info = '戴尔';\n $res = $cl->Query($info, 'goods');//shopstore_search\n//print_r($cl);\n// print_r($res);\n// var_dump($res);exit;\n if (isset($res)){\n $ids=[];\n foreach ($res['matches'] as $r){\n $ids[] = $r['id'];\n }\n $pager = new Pagination();\n $pager->totalCount = Goods::find()->where(['in','id',$ids])->count();\n $pager->defaultPageSize = 4;\n $goods = Goods::find()->where(['in','id',$ids])->andWhere(['status'=>1])->offset($pager->offset)->limit($pager->limit)->all();\n //实例化表单模型\n// var_dump($ids);exit;\n// $goods = Goods::find()->where(['goods_category_id'=>$parent_id])->andWhere(['status'=>1])->all();\n// var_dump($pager);exit;\n return $this->render('/list/index',['goods'=>$goods,'pager'=>$pager]);\n\n\n }else{\n\n }\n }", "public function search()\n {\n // Start calculating the execution time.\n $start = microtime(true);\n\n $query = Document::sanitize(Input::get('query'));\n\n // Validate the input.\n $validator = Validator::make([\n 'query' => $query,\n ], [\n 'query' => 'required|min:4'\n ]);\n\n // Check the validation.\n if ($validator->fails())\n {\n return Redirect::home()->with('error_message', 'الرجاء إدخال كلمة البحث و التي لا تقل عن 3 أحرف.');\n }\n\n // Other than that, everything is great.\n // TODO: Maybe rank them then order them by the ranking.\n $results = Document::whereRaw('MATCH(title, content) AGAINST(?)', [$query])->get();\n\n if ($results->count() == 0)\n {\n return Redirect::home()->with('warning_message', 'لم يتم العثور على نتائج لبحثك.');\n }\n\n $keywords = explode(' ', $query);\n\n $finish = microtime(true);\n\n $taken_time = round(($finish-$start), 3);\n\n // If there is at least one result, show it.\n return View::make('pages.search')->with(compact('results', 'query', 'keywords', 'taken_time'));\n }", "public function testSearchForProductByAttribute()\n {\n // full results flag returns the full data set for the product\n }", "public function testValidateDocumentDocValidation()\n {\n }", "function test_general_entries_search_on_post_title() {\n\t\t$search_string = \"Jamie's\";\n\t\t$items = self::generate_and_run_search_query( 'create-a-post', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in posts table';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'post-entry-1', 'post-entry-3' ) );\n\t}", "public function test_scan_document()\n {\n $ocr = new \\App\\Modules\\OCR\\OCR();\n\n $location = $ocr->image(__DIR__ . '/test.png')->process('test.txt');\n\n PHPUnit::assertEquals(\n \"/Users/mark.fluehmann/Documents/60.Technik/Code/cerbo/storage/app/ocr/test.txt\",\n $location,\n );\n\n $content = file_get_contents($location);\n\n PHPUnit::assertTrue(\n strpos($content, 'Bundesrat') > 0\n );\n\n }", "public function testFindPageReturnsDataForSuccessfulSearch()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', 'name=works');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields, $branch);\n }", "function testInputDocument() {\n\t\tMock::generatePartial('DocumentHelper', 'MockDocumentHelperInput', array('input'));\n\t\t$this->helper->Document = new MockDocumentHelperInput();\n\t\t$this->helper->Document->setReturnValue('input', 'bar');\n\t\t$result = $this->helper->input('Text.document_foo');\n\t\t$this->assertEqual($result, 'bar');\n\t}", "public function searchAction()\n {\n $search = $this->createSearchObject();\n $result = $search->searchWord($this->view->word);\n $this->view->assign($result);\n\n if (Model_Query::$debug) {\n $this->view->actionTrace = [\n 'action' => sprintf('%s::searchWord()', get_class($search)),\n 'result' => $result,\n ];\n\n $this->view->queryTrace = Model_Query::$trace;\n }\n\n }", "public function DoSearch()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $this->GetSearchResults_Obj(true);\n \n $ret = $this->GetNumberOfResults();\n \n return $ret;\n }", "public function testIndexText()\n {\n\n // Add a page with text.\n $page = $this->_simplePage(true);\n $page->text = 'text';\n $page->save();\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Get the name of the `text` Solr key.\n $indexKey = $this->_getAddonKey($page, 'text');\n\n // Should index the text field.\n $this->assertEquals('text', $document->$indexKey);\n\n }", "public function testSearchParams()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse, 15);\n\n $sw->search();\n $sw->search('testing123');\n $sw->search('', '2017-01-01');\n $sw->search('', '', '2017-01-02');\n $sw->search('', '2017-01-01', '2017-01-02');\n $sw->search('', '', '', 'Kyle');\n $sw->search('', '', '', '', 'Smith');\n $sw->search('', '', '', 'Kyle', 'Smith');\n $sw->search('', '', '', '', '', true);\n $sw->search('', '', '', '', '', false);\n $sw->search('', '', '', '', '', null);\n $sw->search('', '', '', '', '', null, true);\n $sw->search('', '', '', '', '', null, false);\n $sw->search('', '', '', '', '', null, true, 'testing');\n $sw->search('testing123', '', '', '', '', true);\n\n $this->checkGetRequests($container, [\n '/v4/search',\n '/v4/search?templateId=testing123',\n '/v4/search?fromDts=2017-01-01',\n '/v4/search?toDts=2017-01-02',\n '/v4/search?fromDts=2017-01-01&toDts=2017-01-02',\n '/v4/search?firstName=Kyle',\n '/v4/search?lastName=Smith',\n '/v4/search?firstName=Kyle&lastName=Smith',\n '/v4/search?verified=true',\n '/v4/search?verified=false',\n '/v4/search',\n '/v4/search',\n '/v4/search?sort=asc',\n '/v4/search?tag=testing',\n '/v4/search?templateId=testing123&verified=true'\n ]);\n }", "function testNormalUsage () {\n \t$doc = new SolrSimpleDocument();\n \t$this->assertEquals(array(), $doc->getFields());\n \t$this->assertNull($doc->getBoost());\n \t\n \t$field1 = new SolrSimpleField('dummy1', 'foobar');\n \t$doc->addField($field1);\n \t$this->assertEquals(array($field1), $doc->getFields());\n \t$this->assertNull($doc->getBoost());\n \t\n \t$field2 = new SolrSimpleField('dummy2', 'foobar', 3.414);\n \t$doc->addField($field2);\n \t$this->assertEquals(array($field1, $field2), $doc->getFields());\n \t$this->assertNull($doc->getBoost());\n }", "public function testSearchProject()\n {\n echo \"\\nTesting project search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects?search=test\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/projects?search=test\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------project search Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function test_partial_search()\n {\n /* @var $clients Collection */\n\n // create some random Client, so we have a large collection\n // plus one expected for tests purposes\n factory(Client::class, 50)->create();\n\n $partialName = str_random(10);\n $partialEmail = str_random(10);\n $partialWhats = '14521452';\n\n $expectedName = 'Client test ' . $partialName;\n $expectedEmail = $partialEmail . '@test.com';\n $expectedWhats = '99 ' . $partialWhats;\n\n factory(Client::class, 1)->create([\n 'nome' => $expectedName,\n 'email' => $expectedEmail,\n 'whatsapp' => $expectedWhats,\n ]);\n\n // search with known name part\n $response = $this->get(route('admin.clients.index') . '?search=' . $partialName);\n $response->assertStatus(200);\n $clients = $response->original->getData()['clients'];\n $this->assertCount(1, $clients);\n $this->assertEquals($expectedName, $clients->first()->nome);\n\n // search with known email part\n $response = $this->get(route('admin.clients.index') . '?search=' . $partialEmail);\n $response->assertStatus(200);\n $clients = $response->original->getData()['clients'];\n $this->assertCount(1, $clients);\n $this->assertEquals($expectedEmail, $clients->first()->email);\n\n // search with known whatsapp part\n $response = $this->get(route('admin.clients.index') . '?search=' . $partialWhats);\n $response->assertStatus(200);\n $clients = $response->original->getData()['clients'];\n $this->assertCount(1, $clients);\n $this->assertEquals($expectedWhats, $clients->first()->whatsapp);\n }", "public function func_search() {}", "public function testGetSearchResults()\n {\n $search_term = $this->getSearchTerm();\n $limit = $this->getLimit();\n\n $client = $this->mockGuzzleForResults();\n $repository = new GoogleSearchRepositoryApi($client);\n\n $results = $repository->getSearchResults($search_term, $limit);\n\n $this->assertIsArray($results);\n }", "public function testChainedFinders()\n {\n $index = new Index();\n $query = new Query($index);\n\n $finder = $query->find()->find();\n $this->assertInstanceOf(\\Cake\\ElasticSearch\\Query::class, $finder);\n }", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "public function searchAction()\n {\n $cleanTypes = $this->_getTypesList();\n $this->view->documentTypes = $cleanTypes;\n }", "public function test_view_has_search_term_when_supplied()\n {\n $response = $this->get(route('admin.clients.index') . '?search=searchTermValue');\n $response->assertStatus(200);\n $response->assertViewHas('searchTerm');\n $this->assertEquals('searchTermValue', $response->original->getData()['searchTerm']);\n }", "public function testSetSearch() {\n\n $obj = new DataTablesRequest();\n\n $obj->setSearch($this->dtSearch);\n $this->assertSame($this->dtSearch, $obj->getSearch());\n }", "public function testPutDocument()\n {\n }", "public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testIndexResultType()\n {\n\n // Add a page to the index.\n $page = $this->_simplePage(true);\n\n // Get the Solr document for the page.\n $document = $this->_getRecordDocument($page);\n\n // Should index the result type.\n $this->assertEquals('Simple Page', $document->resulttype);\n\n }", "public function test_search_item_result_with_keyword(){\n $this->browse(function (Browser $browser) {\n $browser->visit('/item-search')\n ->assertPathIs('/item-search')\n ->select('type', 1)\n ->value('#keyword', 'truck')\n ->value('#minprice', '10000')\n ->value('#maxprice', '20000')\n ->click('button[type=\"submit\"]')\n ->assertPathIs('/item-search-result')\n ->assertSee(\"Details\");\n });\n }", "function testDontGettingAnyDocumentIfNoContain() {\n\t\t$result = $this->page->find('first', array('conditions' => array('Page.id' => 2), 'contain' => false));\n\t\t$this->assertTrue(empty($result['Document']));\n\t}" ]
[ "0.7785687", "0.75202906", "0.72430456", "0.6984289", "0.69202304", "0.69202304", "0.6891472", "0.686389", "0.6850928", "0.6846033", "0.68441135", "0.6820873", "0.68099535", "0.6800658", "0.67511064", "0.67509943", "0.67172694", "0.6615381", "0.65921086", "0.6586356", "0.6583704", "0.65794736", "0.65603477", "0.65603477", "0.65480226", "0.6544873", "0.6540953", "0.6482006", "0.6481535", "0.6464413", "0.6460639", "0.6460639", "0.64434683", "0.6383179", "0.63829595", "0.63691455", "0.6356781", "0.6338013", "0.6325305", "0.6321367", "0.63207126", "0.6306338", "0.63011485", "0.6289248", "0.62812936", "0.62633616", "0.6261465", "0.62593263", "0.62562585", "0.6234568", "0.6216396", "0.62137765", "0.6203594", "0.61904484", "0.6188256", "0.6185723", "0.6176644", "0.61742926", "0.6170091", "0.6158656", "0.61551636", "0.6146324", "0.6144922", "0.6144069", "0.6142537", "0.6139661", "0.61300635", "0.61137384", "0.611167", "0.6091187", "0.6086098", "0.60776746", "0.60756856", "0.6073235", "0.6071046", "0.6055942", "0.6055711", "0.6047904", "0.6046419", "0.60325515", "0.6031932", "0.6031791", "0.60312736", "0.6013604", "0.6013229", "0.5992922", "0.5991041", "0.59794766", "0.59665775", "0.59640753", "0.5962819", "0.59619474", "0.5943475", "0.5936745", "0.59197134", "0.591782", "0.59094423", "0.5903292", "0.58982015", "0.5885162" ]
0.8208773
0
Testing the document update.
public function testUpdateDocument() { echo "\nTesting dcoument update..."; $id = "0"; //echo "\n-----Is string:".gettype ($id); $input = file_get_contents('doc_update.json'); //echo $input; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents/".$id."?owner=wawong"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents/".$id."?owner=wawong"; //echo "\nURL:".$url; $params = json_decode($input); $data = json_encode($params); $response = $this->curl_put($url,$data); $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPutDocument()\n {\n }", "public function test_update_item() {}", "public function test_update_item() {}", "public function testUpdate()\n {\n // Test with correct field name\n $this->visit('/cube/1')\n ->type('3', 'x')\n ->type('3', 'y')\n ->type('3', 'z')\n ->type('1', 'value')\n ->press('submit-update')\n ->see('updated successfully');\n\n /*\n * Tests with incorrect fields\n */\n // Field required\n $this->visit('/cube/1')\n ->press('submit-update')\n ->see('is required');\n\n // Field must be integer\n $this->visit('/cube/1')\n ->type('1a', 'x')\n ->press('submit-update')\n ->see('integer');\n\n // Field value very great\n $this->visit('/cube/1')\n ->type('1000000000', 'y')\n ->press('submit-update')\n ->see('greater');\n }", "public function testD_update() {\n\n $fname = self::$generator->firstName();\n $lname = self::$generator->lastName;\n\n $resp = $this->wrapper->update( self::$randomEmail, [\n 'FNAME' => $fname,\n 'LNAME' => $lname\n ]);\n\n $this->assertObjectHasAttribute('id', $resp);\n $this->assertObjectHasAttribute('merge_fields', $resp);\n\n $updated = $resp->merge_fields;\n\n $this->assertEquals($lname, $updated->LNAME);\n\n }", "public function testUpdate()\n {\n $data = array(\n 'foo' => 'baz'\n );\n\n $transaction = $this->client->transaction()->Update(654, $data);\n\n $this->assertEquals($data, get_object_vars($transaction->put), 'Passed variables are not correct');\n $this->assertEquals('PUT', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/654', $transaction->path, 'The path is incorrect');\n\n }", "public function testDeveloperUpdate()\n {\n $developer = factory(Developer::class)->create();\n $response = $this->get('/developer/update?id=' . $developer->id);\n $response->assertStatus(200);\n }", "public function testUpdate(): void { }", "public function testUpdate()\n {\n $documentHandler = new DocumentHandler($this->connection);\n $result = $documentHandler->save($this->collection1->getName(), [ '_key' => 'test', 'value' => 'test' ]);\n static::assertEquals('test', $result);\n\n $trx = new StreamingTransaction($this->connection, [\n TransactionBase::ENTRY_COLLECTIONS => [\n TransactionBase::ENTRY_WRITE => [ $this->collection1->getName() ]\n ]\n ]);\n\n $trx = $this->transactionHandler->create($trx);\n $this->_shutdown[] = $trx;\n static::assertInstanceOf(StreamingTransaction::class, $trx);\n \n static::assertTrue(is_string($trx->getId()));\n\n $trxCollection = $trx->getCollection($this->collection1->getName());\n static::assertEquals($this->collection1->getName(), $trxCollection->getName());\n\n // document should be present inside transaction\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n\n // update document inside transaction\n $doc->value = 'foobar';\n $result = $documentHandler->updateById($trxCollection, 'test', $doc);\n static::assertTrue($result);\n\n // transactional lookup should find the modified document\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('foobar', $doc->value);\n \n // non-transactional lookup should still see the old document\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n \n // now commit\n static::assertTrue($this->transactionHandler->commit($trx->getId()));\n\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('foobar', $doc->value);\n }", "public function testExampleUpdateRequestShouldSucceed()\n {\n $example = Example::factory()->create();\n $response = $this->put(route('example.update', $example->id), [\n 'param1' => 100,\n 'param2' => 'Hello World',\n ]);\n $response->assertStatus(200);\n }", "public function testUpdate()\n\t{\n\t\t$params = $this->setUpParams();\n\t\t$params['title'] = 'some tag';\n\t\t$params['slug'] = 'some-tag';\n\t\t$response = $this->call('PUT', '/'.self::$endpoint.'/'.$this->obj->id, $params);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($params as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\n\t\t// tes tak ada yang dicari\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/696969', $params);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\t}", "public function testUpdateDocumentMetadata()\n {\n }", "public function testQuarantineUpdateAll()\n {\n\n }", "public function testUpdateAction()\n {\n $res = $this->controller->updateAction(\"1\");\n $this->assertContains(\"Update\", $res->getBody());\n }", "public function testWebinarUpdate()\n {\n }", "public function testSaveUpdate()\n {\n $city = $this->existing_city;\n\n // set string properties to \"updated <property_name>\"\n // set numeric properties to strlen(<property_name>)\n foreach (get_object_vars($city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($value)) {\n $city->$key = \"updated \".$key;\n } elseif (is_numeric($value)) {\n $city->$key = strlen($key);\n }\n }\n }\n\n // update the city\n $city->save();\n\n // go get the updated record\n $updated_city = new City($city->id);\n // check the properties of the updatedCity\n foreach (get_object_vars($updated_city) as $key => $value) {\n if ($key !== 'id' && $key != 'created') {\n if (is_string($city->$key)) {\n $this->assertEquals(\"updated \".$key, $value);\n } elseif (is_numeric($city->$key)) {\n $this->assertEquals(strlen($key), $value);\n }\n }\n }\n }", "public function test_if_failed_update()\n {\n }", "public function testIntegrationUpdate()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->type('Foo bar', 'name')\n ->type('Foobar', 'username')\n ->type('[email protected]', 'email')\n ->type('foobar123', 'password')\n ->type('foobar123', 'password_confirmation')\n ->press('Save')\n ->seePageIs('user');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => 'Foobar',\n 'email' => '[email protected]'\n ]);\n $this->assertViewHas('models');\n }", "public function testUpdate()\n {\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->create(\n ['email' => '[email protected]', 'name' => 'test']\n );\n\n Item::factory()->count(10)->create();\n\n //test item not found\n $this->call('PUT', '/items/11111')\n ->assertStatus(404);\n\n //test validation\n $this->put('items/1', array('email' => 'test1!kl'))\n ->seeJson([\n 'email' => array('The email must be a valid email address.'),\n ]);\n\n //test exception\n $this->put('items/1', array('email' => '[email protected]'))\n ->seeJsonStructure([\n 'error', 'code'\n ])\n ->seeJson(['code' => 400]);\n\n //test success updated item\n $this->put('items/1', array('email' => '[email protected]', 'name' => 'test1 updated'))\n ->seeJson([\n 'status' => 'ok',\n ])\n ->seeJson([\n 'email' => '[email protected]',\n ])\n ->seeJson([\n 'name' => 'test1 updated',\n ])\n ->seeJsonStructure([\n 'data' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]);\n\n $this->seeInDatabase('items', array('email' => '[email protected]', 'name' => 'test1 updated'));\n }", "public function testDebtorUpdate()\n {\n $this->saveDebtor();\n\n $oDebtor = (new DebtorDAO())->findByCpfCnpj('01234567890');\n $this->assertTrue(!is_null($oDebtor->getId()));\n\n $aDadosUpdate = [\n 'id' => $oDebtor->getId(),\n 'name' => 'Carlos Vinicius Atualização',\n 'email' => '[email protected]',\n 'cpf_cnpj' => '14725836905',\n 'birthdate' => '01/01/2000',\n 'phone_number' => '(79) 9 8888-8888',\n 'zipcode' => '11111-111',\n 'address' => 'Rua Atualização',\n 'number' => '005544',\n 'complement' => 'Conjunto Atualização',\n 'neighborhood' => 'Bairro Atualização',\n 'city' => 'Maceió',\n 'state' => 'AL'\n ];\n\n $oDebtorFound = (new DebtorDAO())->find($aDadosUpdate['id']);\n $oDebtorFound->update($aDadosUpdate);\n\n $oDebtorUpdated = (new DebtorDAO())->find($aDadosUpdate['id']);\n $this->assertTrue($oDebtorUpdated->getName() == 'Carlos Vinicius Atualização');\n $this->assertTrue($oDebtorUpdated->getEmail() == '[email protected]');\n $this->assertTrue($oDebtorUpdated->getCpfCnpj() == '14725836905');\n $this->assertTrue($oDebtorUpdated->getBirthdate()->format('d/m/Y') == '01/01/2000');\n $this->assertTrue($oDebtorUpdated->getPhoneNumber() == '79988888888');\n $this->assertTrue($oDebtorUpdated->getZipcode() == '11111111');\n $this->assertTrue($oDebtorUpdated->getAddress() == 'Rua Atualização');\n $this->assertTrue($oDebtorUpdated->getNumber() == '005544');\n $this->assertTrue($oDebtorUpdated->getComplement() == 'Conjunto Atualização');\n $this->assertTrue($oDebtorUpdated->getNeighborhood() == 'Bairro Atualização');\n $this->assertTrue($oDebtorUpdated->getCity() == 'Maceió');\n $this->assertTrue($oDebtorUpdated->getState() == 'AL');\n $this->assertTrue(!is_null($oDebtorUpdated->getUpdated()));\n $oDebtorUpdated->delete();\n }", "public function test_it_updates_a_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $update = ['email' => '[email protected]', 'given_name' => 'A', 'family_name' => 'H'];\n\n $this->json('PUT', sprintf('/users/%d', $user->id), $update)\n ->seeJson($update);\n }", "function tests_can_update_a_note() \n {\n $text = 'Update note';\n\n /*\n * Create a new category\n */\n $category = factory(Category::class)->create();\n\n /*\n * Create another category for update\n */\n\n $anotherCategory = factory(Category::class)->create();\n\n /*\n * Create a note\n */\n\n $note = factory(Note::class)->make();\n\n /*\n * Relation note with category\n */\n\n $category->notes()->save($note);\n\n\n /*\n * Send request for update note\n */\n $this->put('api/v1/notes'. $note->id, [\n 'note' => $text,\n 'category_id' => $anotherCategory->id,\n ], ['Content-Type' => 'application/x-www-form-urlencoded']);\n\n /*\n * Check that in database update note\n */\n $this->seeInDatabase('notes', [\n 'note' => $text,\n 'category_id' => $anotherCategory->id\n\n ]);\n\n\n /*\n * Ckeck that response in format Json\n */\n\n // $this->seeJsonEquals([\n // 'success' => true,\n // 'note' => [\n // 'id' => $note->id,\n // 'note' => $text,\n // 'category_id' => $anotherCategory->id,\n // ],\n // ]);\n }", "public function testUnitUpdate()\n {\n $input = [\n 'username' => 'foo.bar',\n 'email' => '[email protected]',\n 'password' => 'asdfg',\n 'password_confirmation' => 'asdfg',\n 'name' => 'foo bar'\n ];\n $request = Mockery::mock('Suitcoda\\Http\\Requests\\UserEditRequest[all]');\n $request->shouldReceive('all')->once()->andReturn($input);\n\n $model = Mockery::mock('Suitcoda\\Model\\User[save]');\n $model->shouldReceive('findOrFailByUrlKey')->once()->andReturn($model);\n $model->shouldReceive('save')->once();\n\n $user = new UserController($model);\n\n $this->assertInstanceOf('Illuminate\\Http\\RedirectResponse', $user->update($request, 1));\n }", "function updateTest()\n {\n $this->cD->updateElement(new Product(1, \"Trang\"));\n }", "public function testRequestUpdateItem()\n {\n\t\t$response = $this\n\t\t\t\t\t->json('PUT', '/api/items/6', [\n\t\t\t\t\t\t'name' => 'Produkt zostal dodany i zaktualizowany przez test PHPUnit', \n\t\t\t\t\t\t'amount' => 0\n\t\t\t\t\t]);\n\n $response->assertJson([\n 'message' => 'Items updated.',\n\t\t\t\t'updated' => true\n ]);\n }", "public function testSaveUpdate()\n {\n $user = User::findOne(1002);\n $version = Version::findOne(1001);\n\n $this->specify('Error update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'title' => 'Some very long title...Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dignissim, lorem in bibendum.',\n 'type' => Version::TYPE_TABLET,\n 'subtype' => 31,\n 'retinaScale' => false,\n 'autoScale' => 'invalid_value',\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n $version->refresh();\n\n verify('Model should not succeed', $result)->null();\n verify('Model should have errors', $model->errors)->notEmpty();\n verify('Title error message should be set', $model->errors)->hasKey('title');\n verify('ProjectId error message should not be set', $model->errors)->hasntKey('projectId');\n verify('Type error message should not be set', $model->errors)->hasntKey('type');\n verify('Subtype error message should be set', $model->errors)->hasKey('subtype');\n verify('AutoScale error message should be set', $model->errors)->hasKey('autoScale');\n verify('RetinaScale error message should not be set', $model->errors)->hasntKey('retinaScale');\n verify('Version title should not change', $version->title)->notEquals($data['title']);\n verify('Version type should not be changed', $version->type)->notEquals($data['type']);\n verify('Version subtype should not be changed', $version->subtype)->notEquals($data['subtype']);\n });\n\n $this->specify('Success update attempt', function () use ($user, $version) {\n $data = [\n 'scenario' => VersionForm::SCENARIO_UPDATE,\n 'projectId' => 1003, // should be ignored\n 'title' => 'My new test version title',\n 'type' => Version::TYPE_MOBILE,\n 'subtype' => 31,\n 'retinaScale' => true,\n 'autoScale' => true,\n ];\n $model = new VersionForm($user, $data);\n\n $result = $model->save($version);\n\n verify('Model should succeed and return an instance of Version', $result)->isInstanceOf(Version::className());\n verify('Model should not has any errors', $model->errors)->isEmpty();\n verify('The returned Version should be the same as the updated one', $result->id)->equals($version->id);\n verify('Version projectId should not change', $result->projectId)->notEquals($data['projectId']);\n verify('Version title should match', $result->title)->equals($data['title']);\n verify('Version type should match', $result->type)->equals($data['type']);\n verify('Version subtype should match', $result->subtype)->equals($data['subtype']);\n verify('Version scaleFactor should match', $result->scaleFactor)->equals(Version::AUTO_SCALE_FACTOR);\n });\n }", "public function testApiUpdate()\n {\n $user = User::find(1);\n\n \n $compte = Compte::where('name', 'compte22')->first();\n\n $data = [\n 'num' => '2019',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('PUT', '/api/comptes/'.$compte->id, $data);\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function updated(Document $document)\n {\n //\n }", "public function testUpdateDocumentValue()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n\n $documentId = $eavDocument->getId();\n\n $this->assertTrue($eavDocument->hasValue('documentReference'));\n\n $eavDocument->setValue('documentReference', 'F 2020202');\n $this->em->persist($eavDocument);\n $this->em->flush();\n\n $eavDocument = $this->getEavDocumentRepo()->find($documentId);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n\n $eavValue = $eavDocument->getValue('documentReference');\n\n $this->assertSame('F 2020202', $eavValue->getValue());\n }", "public function testCreateUpdateDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->update($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function test_update() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n self::$outage->starttime += 10;\n outagedb::save(self::$outage);\n\n // Should still exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage)\",\n ['idoutage' => self::$outage->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertTrue(is_object($event));\n self::assertSame(self::$event->id, $event->id);\n self::$event = $event;\n }", "protected function doUpdateTests()\n {\n $this->objectRepository->setClassName(TestPolicy::class);\n $policy = $this->objectRepository->find(19071974);\n $policy->policyNo = 'TESTPOLICY UPDATED';\n $policy->contact->lastName = 'ChildUpdate';\n $recordsAffected = $this->objectRepository->saveEntity($policy);\n $recordsAffected = 2;\n if ($this->getCacheSuffix()) {\n $this->assertGreaterThanOrEqual(2, $recordsAffected);\n } else {\n $this->assertEquals(2, $recordsAffected);\n }\n\n //Verify update\n $policy2 = $this->objectRepository->find(19071974);\n $this->assertEquals('TESTPOLICY UPDATED', $policy2->policyNo);\n $this->assertEquals('ChildUpdate', $policy2->contact->lastName);\n\n //If we tell it not to update children, ensure foreign keys are ignored\n $policy = $this->objectRepository->find(19071974);\n $policy->vehicle->policy = null;\n $policy->contact = null;\n $this->objectRepository->saveEntity($policy, false);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertEquals(123, $refreshedPolicy->contact->id);\n $this->assertEquals(1, $refreshedPolicy->vehicle->id);\n $this->assertEquals(19071974, $refreshedPolicy->vehicle->policy->id);\n\n //And if we tell it to update children, they are not ignored\n //(known issue: if child owns relationship, the relationship won't be deleted unless you save the child\n //directly - hence we don't check for a null vehicle or vehicle->policy here, as it will not have removed the\n //relationship)\n $this->objectRepository->saveEntity($policy, true);\n $this->objectRepository->clearCache();\n $refreshedPolicy = $this->objectRepository->find(19071974);\n $this->assertNull($refreshedPolicy->contact);\n\n //Put the contact back, ready for the next test (quicker than running $this->setUp() again)\n $refreshedPolicy->contact = $this->objectRepository->getObjectReference(TestContact::class, ['id' => 123]);\n $this->objectRepository->saveEntity($refreshedPolicy);\n }", "public function testSuccessfullUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => true,\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(200);\n $response->seeJsonStructure([\n 'data' => [\n 'content',\n 'is_active',\n 'is_completed',\n 'created_at',\n 'updated_at',\n ],\n ]);\n $response->seeJson([\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n 'id' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n ]);\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => 'updated content',\n 'is_active' => true,\n 'is_completed' => false,\n ]);\n }", "public function test_it_update_database_from_api()\n {\n\n $this->json('GET', 'api/v1/update')->assertJsonFragment(\n [\n 'success' => 1\n ]\n );\n\n\n // second assertion , check that database is not empty , so we know that data has been updated after being truncate\n\n $beers = Beer::get();\n $this->assertEquals(false, $beers->isEmpty());\n }", "public function testUpdate()\n {\n\n // $payment = $this->payment\n // ->setEvent($this->eventId)\n // ->acceptCash()\n // ->acceptCheck()\n // ->acceptGoogle()\n // ->acceptInvoice()\n // ->acceptPaypal()\n // ->setCashInstructions($instructions)\n // ->setCheckInstructions($instructions)\n // ->setInvoiceInstructions($instructions)\n // ->setGoogleMerchantId($this->googleMerchantId)\n // ->setGoogleMerchantKey($this->googleMerchantKey)\n // ->setPaypalEmail($this->paypalEmail)\n // ->update();\n\n // $this->assertArrayHasKey('process', $payment);\n // $this->assertArrayHasKey('status', $payment['process']);\n // $this->assertTrue($payment['process']['status'] == 'OK');\n }", "public function testReplace()\n {\n $documentHandler = new DocumentHandler($this->connection);\n $result = $documentHandler->save($this->collection1->getName(), [ '_key' => 'test', 'value' => 'test' ]);\n static::assertEquals('test', $result);\n\n $trx = new StreamingTransaction($this->connection, [\n TransactionBase::ENTRY_COLLECTIONS => [\n TransactionBase::ENTRY_WRITE => [ $this->collection1->getName() ]\n ]\n ]);\n\n $trx = $this->transactionHandler->create($trx);\n $this->_shutdown[] = $trx;\n static::assertInstanceOf(StreamingTransaction::class, $trx);\n \n static::assertTrue(is_string($trx->getId()));\n\n $trxCollection = $trx->getCollection($this->collection1->getName());\n static::assertEquals($this->collection1->getName(), $trxCollection->getName());\n\n // document should be present inside transaction\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n\n // replace document inside transaction\n unset($doc->value);\n $doc->hihi = 'hoho';\n $result = $documentHandler->replaceById($trxCollection, 'test', $doc);\n static::assertTrue($result);\n\n // transactional lookup should find the modified document\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('hoho', $doc->hihi);\n static::assertObjectNotHasAttribute('value', $doc);\n \n // non-transactional lookup should still see the old document\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('test', $doc->value);\n static::assertObjectNotHasAttribute('hihi', $doc);\n \n // now commit\n static::assertTrue($this->transactionHandler->commit($trx->getId()));\n\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n static::assertEquals('hoho', $doc->hihi);\n static::assertObjectNotHasAttribute('value', $doc);\n }", "function test_update()\n {\n // Arrange\n $brand_name = \"Nike\";\n $test_brand = new Brand($brand_name);\n $test_brand->save();\n\n\n $brand_id = $test_brand->getId();\n $new_brand_name = \"Adidas\";\n\n // Act\n $test_brand->update($new_brand_name);\n\n // Assert\n $this->assertEquals($new_brand_name, $test_brand->getBrandName());\n }", "protected function doEmbeddedUpdateTests()\n {\n $this->objectRepository->setClassName(TestParent::class);\n $parent = $this->objectRepository->find(1);\n $parent->getAddress()->setTown('Somewhereborough');\n $this->objectRepository->saveEntity($parent);\n $refreshedParent = $this->objectRepository->find(1);\n $this->assertEquals('Somewhereborough', $refreshedParent->getAddress()->getTown());\n }", "public function testUpdate(): void\n {\n $this->markTestSkipped('Skipping as PostsService::update() is not yet ready for prod/testing');\n// $belongsToMany = $this->mock(BelongsToMany::class, static function ($mock) {\n// $mock->shouldReceive('sync');\n// });\n//\n// $mockedModel = $this->mock(Post::class, static function ($mock) use ($belongsToMany) {\n// $mock->shouldReceive('fill')->once();\n// $mock->shouldReceive('save')->once();\n// $mock->shouldReceive('categories')->andReturn($belongsToMany);\n// });\n//\n// $this->mock(PostsRepository::class, static function ($mock) use ($mockedModel) {\n// $mock->shouldReceive('find')->once()->andReturn($mockedModel);\n// });\n//\n// $this->mock(UploadsService::class, static function ($mock) {\n// $mock->shouldReceive('processFeaturedUpload')->once();\n// });\n//\n// $service = resolve(PostsService::class);\n//\n// $request = $this->createRequest($this->createParams());\n//\n// $this->expectsEvents(BlogPostEdited::class);\n//\n// $service->update(1, $request);\n }", "public function test_users_update_valid_perists_to_db(){\n $this->signInUser();\n $user = User::find(5);\n $this->patch(route('users.update', ['user' => $user->id]), $this->user); \n $this->assertDatabaseHas('users', [\n 'id' => $user->id,\n 'name' => $this->user['name'],\n 'email' => $this->user['email']\n ]);\n }", "public function testWebinarPollUpdate()\n {\n }", "public function testSaveUpdates()\n {\n $this->projectItemInput = [\n 'id' => '555', \n 'project_id' => 1, \n 'item_type' => 'Refrigerator',\n 'manufacturer' => 'Cool Guys Manufacturing',\n 'model' => 'coolycool5000',\n 'serial_number' => '9238JDFH03uihFD', \n 'vendor' => 'LindenMart',\n 'comments' => 'Handles upsidedown'\n ];\n // Assemble\n //$this->mockedProjectItemsController->shouldReceive('storeItemWith')->once()->with($this->projectItemInput);\n $this->mockedProjectItemsRepo->shouldReceive('saveProjectItem')->once()->with(Mockery::type('ProjectItem'));\n\n // Act \n $response = $this->route(\"POST\", \"storeItems\", $this->projectItemInput);\n\n // Assert\n $this->assertRedirectedToAction('ProjectItemController@index',1);\n }", "public function testCollectionTicketsUpdate()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $dealerAccountID = $this->_populate();\n \n // Set params\n $params = $this->customDealerAccountData;\n \n // Add ID\n $ID = $this->_pickRandomItem($dealerAccountID);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/dealer-account/edit', $params, [], [], ['HTTP_REFERER' => '/dealer-account/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/dealer-account/edit');\n $this->assertSessionHas('dealer-account-updated', '');\n \n // Validate data\n $dealerAccount = $this->dealer_account->getOne($ID);\n $this->assertEquals($dealerAccount->name, $this->customDealerAccountData['name']);\n $this->assertEquals($dealerAccount->branch_ID, $this->customDealerAccountData['branch_ID']);\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function Do_update_Example1(){\n\n\t}", "protected function _update()\n\t{\n\t}", "public function testUpdateActionOk()\n {\n // Mock the property object.\n $oProperty = $this->getMock('Hook\\Commit\\Diff\\Property', array(), array('svn:keywords'));\n $oProperty->expects($this->any())\n ->method('getOldValue')\n ->will($this->returnValue(''));\n\n $oProperty->expects($this->any())\n ->method('getNewValue')\n ->will($this->returnValue('Id'));\n\n $aParams = array(\n 'txn' => '666-1',\n 'rev' => 666,\n 'action' => 'U',\n 'item' => 'file.php',\n 'real' => 'file.php',\n 'ext' => 'php',\n 'isdir' => false,\n 'props' => array('svn:keywords' => $oProperty),\n 'lines' => null,\n 'info' => null\n );\n\n $oObject = new Object($aParams);\n\n $this->oIdListener->processAction($oObject);\n\n // Check.\n $aErrors = $oObject->getErrorLines();\n\n $this->assertTrue(empty($aErrors));\n }", "public function testHandleUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set params\n $params = $this->customBranchData;\n \n // Add ID\n $ID = $this->_pickRandomItem($branchIDs);\n $params['ID'] = $ID;\n \n // Request\n $this->withSession($this->adminSession)\n ->call('POST', '/branch/edit', $params, [], [], ['HTTP_REFERER' => '/branch/edit']);\n \n // Validate response\n $this->assertRedirectedTo('/branch/edit');\n $this->assertSessionHas('branch-updated', '');\n \n // Validate data\n $branch = $this->branch->getOne($ID);\n $this->assertEquals($branch->name, $this->customBranchData['name']);\n $this->assertEquals($branch->promotor_ID, $this->customBranchData['promotor_ID']);\n }", "public function testUpdatingData()\n {\n $store = new Storage(TESTING_STORE);\n\n // get id from our first item\n $id = $store->read()[0]['_id'];\n\n // new dummy data\n $new_dummy = array(\n 'label' => 'test update',\n 'message' => 'let me update this old data',\n );\n\n // do update our data\n $store->update($id, $new_dummy);\n\n // fetch single item from data by id\n $item = $store->read($id);\n\n // testing data\n $test = array($item['label'], $item['message']);\n\n // here we make a test that count diff values from data between 2 array_values\n $diff_count = count(array_diff(array_values($new_dummy), $test));\n $this->assertEquals(0, $diff_count);\n }", "public function testUpdateEvents()\n {\n $event= Event::factory(1)->create();\n // dd($event);\n $event->title = 'Maria';\n $this->put(\"/events\". $event[0]->id, $event->toArray());\n\n $this->assertDatabaseHas('events', [\n 'id' => 1,\n 'title' => 'Maria'\n ]);\n }", "public function test_updateSettings() {\n\n }", "public function test_updateMessage() {\n\n }", "public function test_authenticated_admin_users_can_hit_the_update_endpoint()\n {\n // First we create a test country\n $country = $this->createCountry();\n\n // Then we check if it was successfully added into the database\n $this->assertDatabaseHas('countries', $country->toArray());\n\n // Then we create an update request with auth headers and empty params\n $this->authenticatedAdmin()->update($country->code, [])\n // We assert status is 422, because now we are authenticated, but request params are invalid\n ->assertStatus(422)\n // Then we assert errors structure matches expected\n ->assertJsonStructure([\n 'errors' => [\n 'name',\n 'code'\n ]\n ]);\n }", "public function testModify()\n {\n $user = User::factory()->create();\n $old_name = $user->name;\n $old_email = $user->email;\n\n $user->name = 'David';\n $user->email = '[email protected]';\n $update = $user->save();\n\n $this->assertTrue($update);\n $this->assertNotEquals($old_name, $user->name);\n $this->assertNotEquals($old_email, $user->email);\n }", "public function testUpdateDocumentValueFailed()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n $this->assertTrue($eavDocument->hasValue('customerId'));\n\n $eavDocument->setValue('customerId', '6789');\n $this->em->persist($eavDocument);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavDocument->getLastViolations();\n\n $this->assertCount(1, $violations);\n $this->assertContains('customerId', (string) $violations);\n }", "public function testUpdate() {\n\n\t\t$request_uri = $this->root_url . 'update';\n\n\t\t$parameters = array(\n\t\t\t'uri' => $request_uri,\n\t\t\t'method' => 'POST',\n\t\t\t'database' => $this->db,\n\t\t\t'postdata' => array(\n\t\t\t\t'id' => 4,\n\t\t\t\t'firstname' => 'Andrei',\n\t\t\t\t'surname' => 'Kanchelskis',\n\t\t\t)\n\t\t);\n\n\t\t$server = new APIServer( $parameters );\n\n\t\t$server->run();\n\n\t\t$response = $server->getResponse();\n\n\t\t$this->assertArrayHasKey('status', $response);\n\t\t$this->assertArrayHasKey('command', $response);\n\n\t\t$this->assertEquals( $response['command'], 'update' );\n\t}", "public function update($uavmDocument);", "function test_updateName()\n {\n //Arrange\n $title = \"Whimsical Fairytales...and other stories\";\n $genre = \"Fantasy\";\n $test_book = new Book($title, $genre);\n $test_book->save();\n\n $column_to_update = \"title\";\n $new_info = \"Generic Fantasy Novel\";\n\n //Act\n $test_book->update($column_to_update, $new_info);\n\n //Assert\n $result = Book::getAll();\n $this->assertEquals(\"Generic Fantasy Novel\", $result[0]->getTitle());\n }", "public function testUpdateInstance() {\r\n $this->assertInstanceOf('\\PM\\Main\\Database\\Update', $this->_instance->update());\r\n }", "public function testUpdatedTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n }", "public function testSellerUpdatedSuccess()\n {\n $this->demoUserLoginIn();\n $spu = Spu::create([\n 'users_id' => '1',\n 'name' => 'test',\n 'description' => 'test',\n ]);\n $response = $this->call('PATCH', '/seller/4/update', [\n 'name' => 'testUpdate',\n 'description' => 'testUpdate',\n ]);\n $this->assertEquals(302, $response->status());\n }", "public function update(Request $request, TestResult $testResult)\n {\n //\n }", "public function testUpdateExperiment()\n {\n echo \"\\nTesting experiment update...\";\n $id = \"0\";\n \n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('exp_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/experiments/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id.\"?owner=wawong\";\n \n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "public function testJobUpdate()\n {\n\n }", "public function testPageUpdate()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('PUT', \"/api/pages/\" . $page->slug, [\n \"data\" => [\n \"name\" => $faker->sentence(4, true),\n ],\n \"relationships\" => [\n \"body\" => [\n \"data\" => [\n \"content\" => $faker->paragraphs(4, true),\n ],\n ],\n ],\n ]);\n $response\n ->assertStatus(200);\n }", "public function testEdit() {\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', null);\r\n\r\n\t\t$expected = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\t\t$this->assertEqual($result['ShopProductAttribute'], $expected['ShopProductAttribute']);\r\n\r\n\t\t// put invalidated data here\r\n\t\t$data = $this->record;\r\n\t\t//$data['ShopProductAttribute']['title'] = null;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertEqual($result, $data);\r\n\r\n\t\t$data = $this->record;\r\n\r\n\t\t$result = $this->ShopProductAttribute->edit('shopproductattribute-1', $data);\r\n\t\t$this->assertTrue($result);\r\n\r\n\t\t$result = $this->ShopProductAttribute->read(null, 'shopproductattribute-1');\r\n\r\n\t\t// put record specific asserts here for example\r\n\t\t// $this->assertEqual($result['ShopProductAttribute']['title'], $data['ShopProductAttribute']['title']);\r\n\r\n\t\ttry {\r\n\t\t\t$this->ShopProductAttribute->edit('wrong_id', $data);\r\n\t\t\t$this->fail('No exception');\r\n\t\t} catch (OutOfBoundsException $e) {\r\n\t\t\t$this->pass('Correct exception thrown');\r\n\t\t}\r\n\t}", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function testeditTrade() {\n $user = 1;\n $product = 1;\n $price = 999;\n $newprice = 500;\n $desc = 'test';\n $newdesc = 'uusi testi';\n R::exec('UPDATE collection set products = \"{\"\"1\"\": 1}\" WHERE id = :id', [':id' => $user]);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n addNewTrade($user, $product, $price, $desc);\n $trades = getOpenTrades($user);\n editTrade($user, $trades[0]['id'], $newprice, $newdesc);\n $trades = getOpenTrades($user);\n $this->assertEquals($newprice, $trades[0]['price']);\n $this->assertEquals($newdesc, $trades[0]['description']);\n R::exec('DELETE FROM trades WHERE seller_id = :id', [':id' => $user]);\n }", "protected function update() {}", "public function testRenderUpdateSuccess()\n {\n // Populate data\n $branchIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($branchIDs);\n $branch = $this->branch->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/branch/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('branch', $branch);\n $this->assertViewHas('dataTl');\n $this->assertPageContain('Edit Branch');\n }", "public function shouldUpdateProductSuccessfully()\n {\n $product = factory(Product::class)->create();\n $input = factory(Product::class)->make()->toArray();\n\n $this->json($this->method, str_replace(':id', $product->id, $this->endpoint), $input)\n ->assertOk()\n ->assertJsonPath('data', 'ok');\n\n $this->assertDatabaseHas('products', ['id' => $product->id] + $input);\n }", "public function testUpdatingNote()\n {\n $manager = $this->getModelManager();\n\n // Get the first tutor\n $tutor = $manager->findById(1);\n\n // Set the Note on his first tutorLanguage, to the START tag\n /** @var TutorLanguage $tutorLanguage*/\n $tutorLanguage = $tutor->getTutorLanguages()->first();\n $tutorLanguage->setNote(TestSlug::START_1);\n\n $manager->saveEntity($tutor);\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::START_1, $tutor->getTutorLanguages()->first()->getNote());\n\n $this->performMockedUpdate($tutor, $tutorLanguage, 'tutor-language-note');\n\n $manager->reloadEntity($tutor);\n $this->assertEquals(TestSlug::END_1, $tutor->getTutorLanguages()->first()->getNote());\n }", "public function testUpdate()\n {\n $this->actingAs(User::factory()->make());\n $task = new Task();\n $task->title = 'refined_task';\n $task->completed = false;\n $task->save();\n\n $response = $this->put('/tasks/' . $task->id);\n\n $updated = Task::where('title', '=', 'refined_task')->first();\n\n $response->assertStatus(200);\n $this->assertEquals(true, $updated->completed);\n }", "public function db_update() {}", "public function testUpdate()\n {\n\n if ($this->skipBaseTests) $this->markTestSkipped('Skipping Base Tests');\n\n $item = $this->model->factory()->create();\n $updatedItem = $this->model->factory()->make();\n\n // Removes the dates for comparison\n $itemArray = $item->toArray();\n unset($itemArray['created_at']);\n unset($itemArray['updated_at']);\n\n // Check that the database contains the factory item\n $this->assertDatabaseHas($this->table, $itemArray);\n\n // Update the item with the second factory updatedItem\n $response = $this->patch(\"{$this->baseUrl}/{$item->getKey()}\", $updatedItem->toArray(), ['FORCE_CONTENT_TYPE'=>'json'])\n ->assertStatus(200);\n\n // Check that the original item does not exist anymore\n $this->assertDatabaseMissing($this->table, $itemArray);\n // Check that the updatedItem now exists in the database\n $this->assertDatabaseHas($this->table, $updatedItem->toArray());\n\n\n }", "public function testUpdate()\n {\n $newData = array('id' => 1, 'username' => 'newroot', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('perform'));\n $mockPDO\n ->expects($this->once())\n ->method('perform')\n ->will($this->returnCallback(function($arg1, $arg2) use ($newData) {\n $sql = 'UPDATE `users`\nSET\n `id` = :id,\n `username` = :username,\n `password` = :password\nWHERE\n id = :id';\n\n if($arg1 == $sql && $arg2 == $newData) {\n return 1;\n } else {\n return array();\n }\n }))\n ;\n\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n\n $id = $storage->save($newData, 'users');\n\n $this->assertEquals(1, $id);\n }", "public function test_user_update()\n {\n $this->withoutMiddleware(ValidJWTMiddleware::class);\n\n $user = User::first();\n\n $response = $this->json('PUT', \"api/usuario/$user->id\", [\n 'first_name' => $this->faker->firstName(),\n 'last_name' => $this->faker->lastName(),\n 'email' => $this->faker->email(),\n 'telephone' => '+55' . $this->faker->phoneNumberCleared(),\n ]);\n\n $userValidate = User::first();\n\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n ]);\n\n $this->assertNotEquals($userValidate, $user);\n }", "public function testUpdateUser()\n {\n $user = factory(User::class)->create();\n \n $userRepo = new UserRepository(new User);\n $update = $userRepo->update($user->id, $this->data);\n $updatedUser = $userRepo->get($user->id);\n \n $this->assertTrue($update);\n foreach ($this->data as $key => $value) {\n \t$this->assertEquals($value, $updatedUser->$key);\n }\n }", "public function testUpdateStore()\n {\n\n }", "public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function testUpdate()\n {\n Debrief::exists() || Debrief::factory()->create();\n $debrief = Debrief::latest()->first();\n $newDebrief = Debrief::factory()->make();\n\n $tutor = Tutor::find($debrief['tutor_id']);\n $student = Student::find($debrief['student_id']);\n $contact = Contact::find($debrief['contact_id']);\n\n $data = [\n 'date' => $newDebrief->date,\n 'summary' => $newDebrief->summary,\n 'student' => $student->getKey(),\n 'tutor' => $tutor->getKey(),\n 'contact' => $contact->getKey()\n ];\n\n $response = $this->actingAs($this->adminUser)->putJson('/api/debriefs/' . $debrief->getKey(), $data);\n if ($response->exception) {\n dd($response->exception);\n }\n\n $debrief = $debrief->fresh();\n $expectedResponseContent = (new DebriefResource($debrief))->toArray(request());\n\n\n $response->assertOk()\n ->assertJson([\n 'data' => $expectedResponseContent\n ]);\n\n $this->actingAs($this->unauthorizedUser)->putJson('/api/debriefs/' . $debrief->getKey(), $data)\n ->assertForbidden();\n }", "public function testUpdateValue()\n {\n $response = $this->json('PATCH', '/api/values');\n $response->assertStatus(200);\n }", "public function testUserUpdate()\n {\n $this->browse(function (Browser $browser) {\n $update_button = self::$locator . ' td .update_button';\n\n self::$username = 'A0Tester' . uniqid();\n $browser->visit('/')\n ->click($update_button)\n ->type('username', self::$username)\n ->type('first_name', 'aaaab')\n ->type('last_name', 'aaaab')\n ->click('button[type=\"submit\"]')\n\n ->waitForText('User data successfully updated!')\n ->assertSee('User data successfully updated!')\n ->assertValue('input[name=\"username\"]', self::$username)\n ->assertValue('input[name=\"first_name\"]', 'aaaab')\n ->assertValue('input[name=\"last_name\"]', 'aaaab');\n });\n }", "public function test_updateReplenishmentProcessCustomFields() {\n\n }", "public function testInsertUpdate()\n {\n // Prepare a basic user and insert it into the database\n $user = new User(\"test@user\", \"Some User\", \"test-pass\", \"student\");\n $id = $user->insert();\n // Ensure that the insert was successful\n $this->assertNotEquals(false, $id);\n // Verify that the model updated the instance ID.\n $this->assertEquals($id, $user->getId());\n\n // Fetch the user from hte database\n $fetchedUser = User::getById($id);\n\n // Verify that at least one field matches as it should, NOT NULL\n // constraints should be enough to verify that the other fields at least\n // holds a value.\n $this->assertInstanceOf(User::class, $fetchedUser);\n\n // Check that some fields contains defaults before testing update\n $this->assertFalse($fetchedUser->isVerified());\n $this->assertEquals(\"student\", $fetchedUser->getType());\n\n // Change some values and update\n $user->setVerified(true);\n $user->setType(\"admin\");\n $this->assertTrue($user->update());\n\n // Refetch the user from the database\n $fetchedUser = User::getById($id);\n\n // Verify that the fields got changed\n $this->assertTrue($fetchedUser->isVerified());\n $this->assertEquals(\"admin\", $fetchedUser->getType());\n }", "public function test_updateCustomer() {\n\n }", "public function testUpdateUser()\n {\n $user = factory(User::class)->create();\n $this->assertTrue($user->update([\n 'name' => 'Test Updated'\n ]));\n }", "public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }", "public function testUpdateCar()\n {\n $id = 1;\n $car = Cars::find($id);\n $year = $car->year;\n $yearUpdate = 2000;\n //Test for user before update\n $this->assertNotEquals($yearUpdate, $year,\"Before update\");\n $statement = \"The year before updating is \" .$year. \" . \";\n ExampleTest::validate($this,$statement);\n DB::table('cars')\n ->where('id', $id)\n ->update(['year'=>$yearUpdate]);\n $newCar = Cars::find($id);\n $newYear = $newCar->year;\n $this->assertEquals($yearUpdate, $newYear,\"After Update\");\n $statement = \"The car year after updating is \".$newYear.\". \";\n ExampleTest::validate($this,$statement);\n }", "public function test_update_product_success()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit(new UpdateProduct)\n ->assertSee(__('product.admin.edit.title'))\n ->type('name', 'Milk Tea')\n ->attach('image[]', __DIR__.'/test/image1.jpg')\n ->type('describe', 'Sale off')\n ->type('price', '20000')\n ->press(__('product.admin.edit.update_product'))\n ->assertPathIs('/admin/products')\n ->assertSee(__('product.admin.edit.update_success'));\n $this->assertDatabaseHas('products', [\n 'name' => 'Milk Tea',\n 'describe' => 'Sale Off',\n 'price' => '20000',\n ]);\n });\n }", "public function testCreateReplaceDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->replace($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayNotHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function testUnvalidUpdateTodo()\n {\n $todoForUpdate = Todo::where('uuid', 'a207329e-6264-4960-a377-5b6dc8995d19')->first();\n\n $response = $this->json('PUT', '/todos/a207329e-6264-4960-a377-5b6dc8995d19', [\n 'content' => 'updated content',\n 'is_active' => 'some string',\n ], [\n 'apikey' => $this->apiAuth['uuid'],\n 'Authorization' => 'Bearer ' . $this->token,\n ]);\n\n $response->assertResponseStatus(422);\n $response->seeJsonStructure([\n 'message',\n 'errors' => [\n 'is_active'\n ],\n ]);\n\n $response->seeInDatabase('todos', [\n 'uuid' => 'a207329e-6264-4960-a377-5b6dc8995d19',\n 'content' => $todoForUpdate->content,\n 'is_active' => $todoForUpdate->is_active,\n 'is_completed' => $todoForUpdate->is_completed,\n ]);\n }", "public function testItCanUpdateEntity()\n {\n $values = [\n 'first_name' => 'First name account update',\n 'last_name' => 'Last name account update',\n 'email' => '[email protected]',\n ];\n $ignore = [\n 'is_active' => false,\n 'is_superuser' => true,\n 'is_staff' => true,\n ];\n $password = 'testpassupdate';\n\n $token = factory(User::class)->create([\n 'is_active' => true,\n 'is_superuser' => false,\n 'is_staff' => false,\n ])->createToken('TokenAccountTest')->token->id;\n\n $entity = $this->accountService->update(array_merge(\n $values, $ignore, ['password' => $password]\n ), $token);\n\n $data = $entity->toArray();\n $this->assertDatabaseHas('user_users', $values);\n $this->assertInstanceOf(User::class, $entity);\n $this->assertTrue(Hash::check($password, $entity->password));\n $this->assertTrue($entity->is_active);\n $this->assertFalse($entity->is_superuser);\n $this->assertFalse($entity->is_staff);\n\n foreach ($this->dataStructure() as $key) {\n $this->assertArrayHasKey($key, $data);\n }\n }", "public function testUpdateAndFindRecord()\r\n\t{\r\n\t\t$mongo = new \\MongoClient();\r\n\t\t$db = $mongo->test;\r\n\t\t$db->node->remove();\r\n\t\t\r\n\t\t$array = [\t\r\n\t\t\t\t'children' => null,\r\n\t\t\t\t'parents' => null,\r\n\t\t\t\t'type' => 'Model.TextModel', \r\n\t\t\t\t'_id' => new \\MongoId(),\r\n\t\t\t\t'tags' => [['name' => 'haus'],['name' => 'balkon']],\r\n\t\t\t\t'content' => 'text text text'];\r\n\t\t$textModel = new \\Model\\TextModel($array);\r\n\t\t$db->node->insert($textModel->toArray());\r\n\t\t\r\n\t\t$cursor = $db->node->find(['tags' => ['name' => 'haus']]);\r\n\t\t$ele = [];\r\n\t\tforeach($cursor as $doc)\r\n\t\t{\r\n\t\t\t$ele[] = $doc;\r\n\t\t}\r\n\t\t\r\n\t\t$mongoDbAdapter = new MongoDbAdapter();\r\n\t\t$mongoDbAdapter->setUp(['db' => 'test']);\r\n\t\t$ele2 = $mongoDbAdapter->findRecord(['condition' => \r\n\t\t\t\t\t\t\t\t\t\t['_id' => $ele[0]['_id']],\r\n\t\t\t\t\t\t\t\t\t 'table' => 'node',\r\n\t\t\t\t\t\t\t\t\t ]);\t\t\t\r\n\t\t$this->assertEquals($ele[0],$ele2);\r\n\t\t\r\n\t\t$ele2['content'] = 'updated...';\r\n\t\t\r\n\t\t$mongoDbAdapter->updateRecord(\r\n\t\t\t\t\t\t\t\t\t['condition' => ['_id' => $ele2['_id']],\r\n\t\t\t\t\t\t\t\t\t'table' => 'node',\r\n\t\t\t\t\t\t\t\t\t'data' => ['content' => $ele2['content']]]);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t$ele3 = $mongoDbAdapter->findRecord(['condition' => \r\n\t\t\t\t\t\t\t\t\t\t['_id' => $ele[0]['_id']],\r\n\t\t\t\t\t\t\t\t\t 'table' => 'node',\r\n\t\t\t\t\t\t\t\t\t ]);\r\n\t\t$this->assertEquals($ele3,$ele2);\r\n\t\t$this->assertNotEquals($ele3,null);\r\n\t\t\r\n\t}", "public function testWebinarRegistrantQuestionUpdate()\n {\n }", "public function testRenderUpdateSuccess()\n {\n // Populate data\n $dealerAccountIDs = $this->_populate();\n \n // Set data\n $ID = $this->_pickRandomItem($dealerAccountIDs);\n $dealerAccount = $this->dealer_account->getOne($ID);\n \n // Request\n $this->withSession($this->adminSession)\n ->call('GET', '/dealer-account/edit', ['ID' => $ID]);\n \n // Verify\n $this->assertResponseOk();\n $this->assertViewHas('dealer_account', $dealerAccount);\n $this->assertViewHas('dataBranch');\n $this->assertPageContain('Edit Dealer Account');\n }", "public function update()\n\t{\n\n\t}" ]
[ "0.7445582", "0.7350307", "0.7350307", "0.7308162", "0.73037523", "0.7143603", "0.710914", "0.7107103", "0.7079882", "0.7067057", "0.70222914", "0.7011263", "0.6999789", "0.6995497", "0.6980029", "0.69385535", "0.6929259", "0.69202584", "0.68766135", "0.68698466", "0.6856206", "0.6853961", "0.6837075", "0.68358576", "0.6769747", "0.67558444", "0.6747325", "0.6723854", "0.6703572", "0.6653104", "0.6633244", "0.6619444", "0.6604679", "0.6603976", "0.6591219", "0.6581294", "0.6576261", "0.65684426", "0.65390456", "0.65275645", "0.65273106", "0.6518841", "0.6502814", "0.64952576", "0.64863104", "0.64863104", "0.6484776", "0.6477653", "0.646716", "0.64639664", "0.6446654", "0.6441411", "0.64368486", "0.6434575", "0.6420613", "0.6416932", "0.6416407", "0.6410744", "0.6409792", "0.6406256", "0.6384133", "0.6380995", "0.6377457", "0.63685703", "0.6367879", "0.63651836", "0.63612956", "0.6361255", "0.63609445", "0.63606095", "0.63586915", "0.635234", "0.63467544", "0.63416445", "0.63399404", "0.6339012", "0.6338205", "0.6337176", "0.63346535", "0.63344955", "0.6330189", "0.6327067", "0.63213307", "0.6305082", "0.63019425", "0.6299899", "0.6295386", "0.62901676", "0.6284659", "0.62822336", "0.6279706", "0.6275525", "0.6272669", "0.6272658", "0.6259036", "0.62570184", "0.6255652", "0.6255114", "0.6253296", "0.62484604" ]
0.8108038
0
Testing the document deletion. Note that this is logical deletion. The document will remain in the Elasticsearch
public function testDeleteDocument() { echo "\nTesting subject deletion..."; $id = "0"; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/documents/".$id; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/documents/".$id; $response = $this->curl_delete($url); // echo $response; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDelete()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n $db->create(array('a' => 1), 'mydoc');\n \n // Make sure document exists in DB\n $doc = $db->retrieve('mydoc');\n $this->assertType('Sopha_Document', $doc);\n \n // Delete document\n $ret = $db->delete('mydoc', $doc->getRevision());\n \n // Make sure return value is true\n $this->assertTrue($ret);\n \n // Try to fetch doc again \n $this->assertFalse($db->retrieve('mydoc'));\n \n $this->_teardownDb();\n }", "public function testDeleteDocument()\n {\n }", "protected function doDeleteDocument() {\n try{\n $this->service->remove($this->owner);\n }\n catch(NotFoundException $e)\n {\n trigger_error(\"Deleted document not found in search index.\", E_USER_NOTICE);\n }\n\n }", "public function delete() {\n // Find document ID.\n if (!$this->find()) {\n debugging('Failed to find ousearch document');\n return false;\n }\n self::wipe_document($this->id);\n }", "public function testOnDeletedDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $obj->onDeletedDocument($this->doc1);\n $this->assertFileNotExists($this->directory . \"/1/2/4\");\n }", "public function testDeleteForm() {\n $document = $this->createDocument();\n\n $document_name = $document->id();\n\n // Log in and check for existence of the created document.\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/structure/legal');\n $this->assertRaw($document_name, 'Document found in overview list');\n\n // Delete the document.\n $this->drupalPostForm('admin/structure/legal/manage/' . $document_name . '/delete', [], 'Delete');\n\n // Ensure document no longer exists on the overview page.\n $this->assertUrl('admin/structure/legal', [], 'Returned to overview page after deletion');\n $this->assertNoText($document_name, 'Document not found in overview list');\n }", "function delete() {\n\n $document = Doctrine::getTable('DocDocument')->find($this->input->post('doc_document_id'));\n $node = Doctrine::getTable('Node')->find($document->node_id);\n\n if ($document && $document->delete()) {\n//echo '{\"success\": true}';\n\n $this->syslog->register('delete_document', array(\n $document->doc_document_filename,\n $node->getPath()\n )); // registering log\n\n $success = 'true';\n $msg = $this->translateTag('General', 'operation_successful');\n } else {\n//echo '{\"success\": false}';\n $success = 'false';\n $msg = $e->getMessage();\n }\n\n $json_data = $this->json->encode(array('success' => $success, 'msg' => $msg));\n echo $json_data;\n }", "public function testDeleted()\n {\n // Make a tag, then request it's deletion\n $tag = $this->resources->tag();\n $result = $this->writedown->getService('api')->tag()->delete($tag->id);\n\n // Attempt to grab the tag from the database\n $databaseResult = $this->writedown->getService('entityManager')\n ->getRepository('ByRobots\\WriteDown\\Database\\Entities\\Tag')\n ->findOneBy(['id' => $tag->id]);\n\n $this->assertTrue($result['success']);\n $this->assertNull($databaseResult);\n }", "public function testDelete()\n {\n $sampleIndexDir = dirname(__FILE__) . '/_indexSample/_files';\n $tempIndexDir = dirname(__FILE__) . '/_files';\n if (!is_dir($tempIndexDir)) {\n mkdir($tempIndexDir);\n }\n\n $this->_clearDirectory($tempIndexDir);\n\n $indexDir = opendir($sampleIndexDir);\n while (($file = readdir($indexDir)) !== false) {\n if (!is_dir($sampleIndexDir . '/' . $file)) {\n copy($sampleIndexDir . '/' . $file, $tempIndexDir . '/' . $file);\n }\n }\n closedir($indexDir);\n\n\n $index = Zend_Search_Lucene::open($tempIndexDir);\n\n $this->assertFalse($index->isDeleted(2));\n $index->delete(2);\n $this->assertTrue($index->isDeleted(2));\n\n $index->commit();\n\n unset($index);\n\n $index1 = Zend_Search_Lucene::open($tempIndexDir);\n $this->assertTrue($index1->isDeleted(2));\n unset($index1);\n\n $this->_clearDirectory($tempIndexDir);\n }", "public function deleteFromIndex()\n {\n if ($this->es_info) {\n ESHelper::deleteDocumentFromType($this);\n }\n }", "public function testDelete()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table2',\r\n\t\t));\r\n\r\n\t\t// Delete all indices\r\n\t\tforeach($table->indices AS $index)\r\n\t\t{\r\n\t\t\t$this->assertNotSame(false, $index->delete());\r\n\t\t}\r\n\r\n\t\t// Reload table\r\n\t\t$table->refresh();\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(0, count($table->indices));\r\n\t}", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "public function testDeleteIdsIdxObjectTypeObject(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // Using the existing $index variable which is \\Elastica\\Index object\n $index->getClient()->deleteIds($ids, $index);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "function __safeDeleteDocument() {\n\t\ttry {\n\t\t\t$this->solr->deleteById($this->__createDocId());\n\t\t\t$this->solr->commit();\n\t\t\t$this->solr->optimize();\t\n\t\t} catch (Exception $e) {\n\t\t\t$this->log($e, 'solr');\n\t\t}\n\t}", "public function delete($document_id);", "public function testDelete()\n {\n $dataLoader = $this->getDataLoader();\n $data = $dataLoader->getOne();\n $this->deleteTest($data['user']);\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/transaction/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Transaction', 'transactionId', self::$objectId);\n }", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/invoice/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Invoice', 'invoiceId', self::$objectId);\n }", "public function delete() {\n\t\tif (!$this->preDelete()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireDatabase();\n\t\t$this->requireId();\n\t\t$this->requireRev();\n\n\t\t$this->options[\"rev\"] = $this->document->_rev;\n\n\t\ttry {\n\t\t\t$request = new HttpRequest();\n\t\t\t$request->setUrl($this->databaseHost . \"/\" . rawurlencode($this->databaseName) . \"/\" . rawurlencode($this->document->_id) . self::encodeOptions($this->options));\n\t\t\t$request->setMethod(\"delete\");\n\t\t\t$request->send();\n\n\t\t\t$request->response = json_decode($request->response);\n\t\t} catch (Exception $exception) {\n\t\t\tthrow new DocumentException(\"HTTP request failed.\", DocumentException::HTTP_REQUEST_FAILED, $exception);\n\t\t}\n\n\t\tif ($request->status === 200) {\n\t\t\t$this->document->_id = $request->response->id;\n\t\t\t$this->document->_rev = $request->response->rev;\n\n\t\t\treturn $this->postDelete();\n\t\t} else {\n\t\t\tthrow new DocumentException(self::describeError($request->response));\n\t\t}\n\t}", "public function testDelete()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 60, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n\n // delete\n $searchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setIdList([60])\n ->setIdName('id')\n ->build();\n\n $this->cacheManager->delete($searchCriteria);\n\n // search\n $searchResult = $this->cacheManager->search($searchCriteria);\n $this->assertFalse($searchResult->hasData());\n $this->assertEquals(0, $searchResult->count());\n $this->assertCount(1, $searchResult->getMissedData());\n }", "public function testCreateReplaceDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->replace($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayNotHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function testCreateUpdateDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'Frank', 'bike' => 'vfr', '_key' => '1'];\n\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $requestBody = ['name' => 'Mike'];\n\n $document = new Document($this->client);\n\n $responseObject = $document->update($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $document = new Document($this->client);\n\n $responseObject = $document->get($collectionName . '/1', $requestBody);\n $responseBody = $responseObject->body;\n\n $this->assertArrayHasKey('bike', json_decode($responseBody, true));\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals('Mike', $decodedJsonBody['name']);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function deleteDocument() {\n\n // should get instance of model and run delete-function\n\n // softdeletes-column is found inside database table\n\n return redirect('/home');\n }", "public function testDelete()\n {\n // test data\n $this->fixture->query('INSERT INTO <http://example.com/> {\n <http://s> <http://p1> \"baz\" .\n <http://s> <http://xmlns.com/foaf/0.1/name> \"label1\" .\n }');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(2, \\count($res['result']['rows']));\n\n // remove graph\n $this->fixture->delete(false, 'http://example.com/');\n\n $res = $this->fixture->query('SELECT * WHERE {?s ?p ?o.}');\n $this->assertEquals(0, \\count($res['result']['rows']));\n }", "public function testDelete()\n\t{\n\t\t$obj2 = $this->setUpObj();\n\t\t$response = $this->call('DELETE', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\n\t\t// tes apakah sudah terdelete\n\t\t$response = $this->call('GET', '/'.self::$endpoint.'/'.$obj2->id);\n\t\t$this->assertEquals(500, $response->getStatusCode());\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($obj2->attributesToArray() as $key => $val) {\n\t\t\t$this->assertArrayHasKey($key, $result);\n\t\t\tif (isset($result[$key])&&($key!='created_at')&&($key!='updated_at'))\n\t\t\t\t$this->assertEquals($val, $result[$key]);\n\t\t}\n\t}", "public function testDeleteExperiment()\n {\n echo \"\\nTesting experiment deletion...\";\n $id = \"0\";\n\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/experiments/\".$id;\n echo \"\\ntestDeleteExperiment:\".$url;\n $response = $this->curl_delete($url);\n //echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function deleteTest()\n {\n $this->assertEquals(true, $this->object->delete(1));\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "public function testDeleteDocument($name, $fields, $expectedValues)\n {\n $crud = new Enumerates();\n $crud->setUrlParameters(array(\n \"familyId\" => $name\n ));\n try {\n $crud->delete(null);\n $this->assertFalse(true, \"An exception must occur\");\n }\n catch(DocumentException $exception) {\n $this->assertEquals(501, $exception->getHttpStatus());\n }\n }", "public function delete() {\n\t\t$delete_array = array();\n\t\tif ($this->getIdType() === self::ID_TYPE_MONGO) {\n\t\t\t$delete_array['_id'] = new \\MongoId($this->getId());\n\t\t} else {\n\t\t\t$delete_array['_id'] = $this->getId();\n\t\t}\n\t\t$rows_affected = $this->getCollection()->remove($delete_array);\n\t\treturn $rows_affected;\n\t}", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/product/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Product', 'productId', self::$objectId);\n }", "public function testDeleteSingleSuccess()\n {\n $entity = $this->findOneEntity();\n\n // Delete Entity\n $this->getClient(true)->request('DELETE', $this->getBaseUrl() . '/' . $entity->getId(),\n [], [], ['Authorization' => 'Bearer ' . $this->adminToken, 'HTTP_AUTHORIZATION' => 'Bearer ' . $this->adminToken]);\n $this->assertEquals(StatusCodesHelper::SUCCESSFUL_CODE, $this->getClient()->getResponse()->getStatusCode());\n }", "public function testDeleteMetadata2UsingDELETE()\n {\n }", "public function testDelete(): void\n {\n $this->createInstance();\n $this->createAndLogin();\n\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],null)->wait();\n $res2 = $this->fConnector->getDiscussionManagement()->deleteTopic($res->id)->wait();\n $this->assertTrue($res2, 'Test delete of a topic');\n $res3 = $this->fConnector->getDiscussionManagement()->getDiscussions($this->configTest['testTagName'])->wait();\n $found = false;\n foreach($res3 as $discussion){\n if($discussion->id === $res->id){\n $found = true;\n break;\n }\n }\n $this->assertFalse($found, 'Test delete of a topic, search for deleted topic');\n\n }", "public function testDeleteMetadata1UsingDELETE()\n {\n }", "public function index_delete(){\n\t\t\n\t\t}", "public function testCreateGetListGetDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'frank', '_key' => '1'];\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->getAll($collectionName);\n $responseBody = $responseObject->body;\n\n $this->markTestSkipped(\n 'The functionality needs to be implemented in the API first (simple queries API).'\n );\n\n// $this->assertArrayHasKey('documents', json_decode($responseBody, true));\n//\n// $decodedJsonBody = json_decode($responseBody, true);\n//\n// $this->assertEquals(\n// '/_api/document/ArangoDB-PHP-Core-CollectionTestSuite-Collection/1',\n// $decodedJsonBody['documents'][0]\n// );\n//\n// $responseObject = $document->delete($collectionName . '/1');\n// $responseBody = $responseObject->body;\n//\n// $decodedJsonBody = json_decode($responseBody, true);\n//\n// $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "public function deleteDocument() {\n $file = $this->getDocumentFile().$this->getAttribute('evidencias')[2];\n\n// check if file exists on server\n if (empty($file) || !file_exists($file)) {\n return false;\n }\n\n// check if uploaded file can be deleted on server\n if (!unlink($file)) {\n return false;\n }\n\n// if deletion successful, reset your file attributes\n $this->evidencias = null;\n\n return true;\n }", "public function deleted(Document $document)\n {\n if(isset($document->path)) {\n // delete the associated file\n $path = $document->path;\n $fileExists = Storage::disk('spaces')->exists($path);\n if($fileExists) {\n Storage::disk('spaces')->delete($path);\n }\n } \n }", "public function testDelete()\n {\n }", "public function testDeleteFail() {\n $this->delete('/api/author/100')\n ->seeJson(['message' => 'invalid request']);\n }", "public function testRemovePageWhenDeleted()\n {\n\n // Add a public page.\n $page = $this->_simplePage(true);\n\n // Delete.\n $page->delete();\n\n // Should remove Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function postDelete() {\n if ($server = $this->server()) {\n if ($server->enabled) {\n $server->removeIndex($this);\n }\n // Once the index is deleted, servers won't be able to tell whether it was\n // read-only. Therefore, we prefer to err on the safe side and don't call\n // the server method at all if the index is read-only and the server\n // currently disabled.\n elseif (empty($this->read_only)) {\n $tasks = variable_get('search_api_tasks', array());\n $tasks[$server->machine_name][$this->machine_name] = array('remove');\n variable_set('search_api_tasks', $tasks);\n }\n }\n\n // Stop tracking entities for indexing.\n $this->dequeueItems();\n }", "public function testDeleteDocumentWithValues()\n {\n $eavDocument = $this->getEavDocumentRepo()->findOneBy(['path' => 'some/path/to/bucket/document1.pdf']);\n\n $this->assertInstanceOf(EavDocument::class, $eavDocument);\n $documentId = $eavDocument->getId();\n\n $values = $eavDocument->getValues();\n\n $this->assertGreaterThan(0, $values->count());\n\n $this->em->remove($eavDocument);\n $this->em->flush();\n\n $eavDocument = $this->getEavDocumentRepo()->find($documentId);\n\n $this->assertNull($eavDocument);\n\n $eavValues = $this->getEavValueRepo()->findBy(['document' => $documentId]);\n\n $this->assertEmpty($eavValues);\n }", "protected function deleted()\n {\n $this->response = $this->response->withStatus(204);\n $this->jsonBody($this->payload->getOutput());\n }", "public function testDeleteOnDelete() {\n\t\t$Action = $this->_actionSuccess();\n\t\t$this->setReflectionClassInstance($Action);\n\t\t$this->callProtectedMethod('_delete', array(1), $Action);\n\t}", "public function testDeleteMissingDocument()\n {\n if (! $this->_url) $this->markTestSkipped(\"Test requires a CouchDb server set up - see TestConfiguration.php\");\n $db = $this->_setupDb();\n \n // Delete missing document\n $ret = $db->delete('mydoc', 12345);\n $this->assertFalse($ret);\n \n $this->_teardownDb();\n }", "public function testRemove()\n {\n $documentHandler = new DocumentHandler($this->connection);\n $result = $documentHandler->save($this->collection1->getName(), [ '_key' => 'test', 'value' => 'test' ]);\n static::assertEquals('test', $result);\n\n $trx = new StreamingTransaction($this->connection, [\n TransactionBase::ENTRY_COLLECTIONS => [\n TransactionBase::ENTRY_WRITE => [ $this->collection1->getName() ]\n ]\n ]);\n\n $trx = $this->transactionHandler->create($trx);\n $this->_shutdown[] = $trx;\n static::assertInstanceOf(StreamingTransaction::class, $trx);\n \n static::assertTrue(is_string($trx->getId()));\n\n $trxCollection = $trx->getCollection($this->collection1->getName());\n static::assertEquals($this->collection1->getName(), $trxCollection->getName());\n\n // document should be present inside transaction\n $doc = $documentHandler->getById($trxCollection, \"test\");\n static::assertEquals('test', $doc->getKey());\n\n // remove document inside transaction\n $result = $documentHandler->removeById($trxCollection, 'test');\n static::assertTrue($result);\n\n // transactional lookup should not find the document\n $found = false;\n try {\n $documentHandler->getById($trxCollection, \"test\");\n $found = true;\n } catch (\\Exception $e) {\n static::assertEquals(404, $e->getCode());\n }\n static::assertFalse($found);\n \n // non-transactional lookup should still see it\n $doc = $documentHandler->getById($this->collection1->getName(), \"test\");\n static::assertEquals('test', $doc->getKey());\n \n // now commit\n static::assertTrue($this->transactionHandler->commit($trx->getId()));\n\n // now it should be gone\n $found = false;\n try {\n $documentHandler->getById($this->collection1->getName(), \"test\");\n $found = true;\n } catch (\\Exception $e) {\n static::assertEquals(404, $e->getCode());\n }\n static::assertFalse($found);\n }", "public function testDeleteField()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Fields\";\n $fieldFolder = \"DocumentElements/Fields\";\n $localFileName = \"GetField.docx\";\n $remoteFileName = \"TestDeleteField.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . $fieldFolder . \"/\" . $localFileName,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $request = new DeleteFieldRequest(\n $remoteFileName,\n 0,\n \"sections/0/paragraphs/0\",\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n Assert::assertNull($this->words->deleteField($request));\n }", "public function testDeleteWrongObjectTypeSubmitAsAdmin()\n {\n $crawler = $this->requestAsAdmin('/tasks');\n\n // Can't use assertSelectorTextContains() because it only checks the first selector occurrence\n // and the task we are looking for is not the first one in the displayed list of tasks.\n // See: https://github.com/symfony/symfony-docs/issues/13036\n //$this->assertSelectorTextContains('h4 > a', 'Tâche Eric n°1');\n $this->assertEquals(1, $crawler->filter('h4 > a:contains(\"Tâche Eric n°1\")')->count());\n\n // Then we delete it\n $task_id = self::getTaskIdByTitle('Tâche Eric n°1');\n\n $this->requestAsAdmin('/tasks/'.$task_id.'/delete');\n\n $crawler = $this->client->followRedirect();\n\n $this->assertRegExp('/tasks$/', $crawler->getUri());\n $this->assertContains(\n 'La tâche a bien été supprimée.',\n $this->client->getResponse()->getContent()\n );\n $this->assertSelectorTextNotContains('h4 > a', 'Tâche Eric n°1');\n }", "function deleteDocument($document)\r\n\t{\r\n\t\t$fullPath = $this->library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $document->file;\r\n\t\tif (file_exists($fullPath))\r\n\t\t{\r\n\t\t\tunlink($fullPath);\r\n\t\t}\r\n\t\t\r\n\t\t$document->delete();\r\n\t\treturn true;\r\n\t}", "public function testDeleteSubject()\n {\n echo \"\\nTesting subject deletion...\";\n $id = \"0\";\n \n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/subjects/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/subjects/\".$id;\n \n $response = $this->curl_delete($url);\n // echo $response;\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function testDeleteMetadata3UsingDELETE()\n {\n }", "public function testDeleteOne()\n {\n $obj_request = new \\google\\appengine\\datastore\\v4\\CommitRequest();\n $obj_request->setMode(\\google\\appengine\\datastore\\v4\\CommitRequest\\Mode::NON_TRANSACTIONAL);\n $obj_mutation = $obj_request->mutableDeprecatedMutation();\n $obj_key = $obj_mutation->addDelete();\n $obj_key->mutablePartitionId()->setDatasetId('Dataset')->setNamespace('Test');\n $obj_key->addPathElement()->setKind('Book')->setName('PoEAA');\n\n $this->apiProxyMock->expectCall('datastore_v4', 'Commit', $obj_request, new \\google\\appengine\\datastore\\v4\\CommitResponse());\n\n $obj_store = $this->getBookstoreWithTestNamespace();\n $obj_result = $obj_store->delete($obj_store->createEntity()->setKeyName('PoEAA'));\n\n $this->assertEquals($obj_result, TRUE);\n $this->apiProxyMock->verify();\n }", "public function testDeleteAction()\n {\n $res = $this->controller->deleteAction();\n $this->assertContains(\"Delete\", $res->getBody());\n }", "public function testDelete(): void\n {\n $this->markTestSkipped('Skipping as PostsService::delete() is not yet ready for prod/testing');\n $this->mock(PostsRepository::class, static function ($mock) {\n $mock->shouldReceive('find')->with(123)->andReturn(new Post());\n $mock->shouldReceive('delete')->with(123)->andReturn(true);\n });\n\n $service = resolve(PostsService::class);\n\n $this->expectsEvents(BlogPostWillBeDeleted::class);\n\n $response = $service->delete(123);\n\n $this->assertIsArray($response);\n }", "public function testDeleteMetadata()\n {\n }", "public function testDeletedEntity() {\n $settings = Settings::getAll();\n // Set up the fixtures.\n $settings['file_link_test_middleware'] = [\n 'http://file_link.drupal/latentcy-test-file.txt' => [\n 'status' => 200,\n 'headers' => ['Content-Type' => 'text/plain', 'Content-Length' => 27],\n ],\n ];\n new Settings($settings);\n\n /** @var \\Drupal\\entity_test\\Entity\\EntityTest $entity */\n $entity = EntityTest::create(['name' => 'Foo', 'type' => 'article']);\n\n $entity->get('deferred_url')->set(0, ['uri' => 'http://file_link.drupal/latentcy-test-file.txt']);\n\n $entity->save();\n\n static::assertEquals(1, file_link_test_entity_save_counter($entity));\n\n static::assertEquals(NULL, $entity->get('deferred_url')->get(0)->getFormat());\n static::assertEquals(0, $entity->get('deferred_url')->get(0)->getSize());\n\n static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file.txt'));\n\n $entity->delete();\n\n $this->container->get('cron')->run();\n\n static::assertEquals(0, HttpMiddleware::getRequestCount('http://file_link.drupal/latentcy-test-file.txt'));\n }", "public function testDeleteDelete()\n {\n $this->mockSecurity();\n $this->_loginUser(1);\n $source = 2;\n\n $readPostings = function () use ($source) {\n $read = [];\n $read['all'] = $this->Entries->find()->all()->count();\n $read['source'] = $this->Entries->find()\n ->where(['category_id' => $source])\n ->count();\n\n return $read;\n };\n\n $this->assertTrue($this->Categories->exists($source));\n $before = $readPostings();\n $this->assertGreaterThan(0, $before['source']);\n\n $data = ['mode' => 'delete'];\n $this->post('/admin/categories/delete/2', $data);\n\n $this->assertFalse($this->Categories->exists($source));\n $this->assertRedirect('/admin/categories');\n\n $after = $readPostings();\n $this->assertEquals(0, $after['source']);\n $expected = $before['all'] - $before['source'];\n $this->assertEquals($expected, $after['all']);\n }", "public function forceDeleted(Document $document)\n {\n //\n }", "public function testDeleteNew()\r\n\t{\r\n\t\t$index = new Index();\r\n\t\t$index->delete();\r\n\t}", "public function testDelete() {\n $this->loadFixtures('Users');\n\n $last = User::select()->orderBy('_id', 'asc')->first();\n $user = User::find($last->_id);\n\n $this->assertTrue($user->exists());\n $this->assertSame(1, $user->delete(false));\n $this->assertFalse($user->exists());\n }", "public function delete($id) {\r\n\t\treturn $this->execute(sprintf('/docs/%s.json', $id), null, self::DELETE) ? true : false;\r\n\t}", "public function testValidDelete() {\n\n\t\t//create a new organization, and insert into the database\n\t\t$organization = new Organization(null, $this->VALID_ADDRESS1, $this->VALID_ADDRESS2, $this->VALID_CITY, $this->VALID_DESCRIPTION,\n\t\t\t\t$this->VALID_HOURS, $this->VALID_NAME, $this->VALID_PHONE, $this->VALID_STATE, $this->VALID_TYPE, $this->VALID_ZIP);\n\t\t$organization->insert($this->getPDO());\n\n\t\t//perform the actual delete\n\t\t$response = $this->guzzle->delete('https://bootcamp-coders.cnm.edu/~bbrown52/bread-basket/public_html/php/api/organization/' . $organization->getOrgId(),\n\t\t\t\t['headers' => ['X-XSRF-TOKEN' => $this->token]\n\t\t]);\n\n\t\t// grab the data from guzzle and enforce that the status codes are correct\n\t\t$this->assertSame($response->getStatusCode(), 200);\n\t\t$body = $response->getBody();\n\t\t$retrievedOrg = json_decode($body);\n\t\t$this->assertSame(200, $retrievedOrg->status);\n\n\t\t//try retrieving entry from database and ensuring it was deleted\n\t\t$deletedOrg = Organization::getOrganizationByOrgId($this->getPDO(), $organization->getOrgId());\n\t\t$this->assertNull($deletedOrg);\n\n\t}", "public function test_it_can_delete_an_entity()\n {\n $this->mockHandler\n ->append(\n new Response(200, [], file_get_contents(__DIR__ . '/fixture/delete_response_success.json'))\n );\n $response = $this->client->delete('db2e5c63-3c54-4962-bf4a-d6ced1e9cf33');\n $this->assertEquals(DeleteEntityRepository::RESULT_SUCCESS, $response);\n }", "public function testDeleteTagAdmin(): void\n {\n // given\n $expectedStatusCode = 200;\n $adminUser = $this->createUser([User::ROLE_USER, User::ROLE_ADMIN]);\n $this->logIn($adminUser);\n\n $expectedTag = new Tag();\n $expectedTag->setName('Test Tag To Delete');\n $tagRepository = self::$container->get(TagRepository::class);\n $tagRepository->save($expectedTag);\n\n // when\n $crawler = $this->httpClient->request('GET', '/tag/'.$expectedTag->getId().'/delete');\n $resultStatusCode = $this->httpClient->getResponse()->getStatusCode();\n $form = $crawler->selectButton('usuń')->form();\n $this->httpClient->submit($form);\n $this->httpClient->followRedirect();\n\n // then\n $this->assertEquals($expectedStatusCode, $resultStatusCode);\n $this->assertStringContainsString('Usuwanie powiodło się', $this->httpClient->getResponse()->getContent());\n }", "public function testDeleteIdsIdxString(): void\n {\n $data = ['username' => 'hans'];\n $userSearch = 'username:hans';\n\n $index = $this->_createIndex();\n\n // Create the index, deleting it first if it already exists\n $index->create([], [\n 'recreate' => true,\n ]);\n\n // Adds 1 document to the index\n $doc = new Document(null, $data);\n $result = $index->addDocument($doc);\n\n // Refresh index\n $index->refresh();\n\n $resultData = $result->getData();\n $ids = [$resultData['_id']];\n\n // Check to make sure the document is in the index\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(1, $totalHits);\n\n // And verify that the variables we are doing to send to\n // deleteIds are the type we are testing for\n $idxString = $index->getName();\n\n // Using the existing $index variable that is a string\n $index->getClient()->deleteIds($ids, $idxString);\n\n // Refresh the index to clear out deleted ID information\n $index->refresh();\n\n // Research the index to verify that the items have been deleted\n $resultSet = $index->search($userSearch);\n $totalHits = $resultSet->getTotalHits();\n $this->assertEquals(0, $totalHits);\n }", "public function testQuarantineDeleteById()\n {\n\n }", "public function removeFromIndex()\n\t{\n\t\t$params = $this->getBasicEsParams();\n\t\t// By default all writes to index will be synchronous\n\t\t$params['custom'] = ['refresh' => true];\n\n\t\ttry {\n\t\t\t$result = $this->getElasticSearchClient()->delete($params);\n\t\t}\n\t\tcatch (Missing404Exception $e) {\n\t\t\t// That will mean the document was not found in index\n\t\t}\n\n\t\tDB::table($this->getTable())\n\t\t\t->where($this->getKeyName(), '=', $this->getKeyForSaveQuery())\n\t\t\t->update(['indexed_at' => null]);\n\n\t\treturn isset($result) ? $result : null;\n\t}", "public function testDelete()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}", "public function testDeleteProductUsingDELETE()\n {\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function deleteDocumentAction()\n {\n try {\n $this->_helper->viewRenderer->setNoRender();\n\n // Les modèles\n $model_commission = new Model_DbTable_Commission();\n\n $commission = $model_commission->find($this->_request->id_commission)->current();\n\n // On supprime le fichier\n unlink(REAL_DATA_PATH.DS.'uploads'.DS.'documents_commission'.DS.$commission->DOCUMENT_CR);\n\n // On met à null dans la DB\n $commission->DOCUMENT_CR = null;\n $commission->save();\n\n $this->_helper->flashMessenger([\n 'context' => 'success',\n 'title' => 'Le document a bien été supprimé',\n 'message' => '',\n ]);\n } catch (Exception $e) {\n $this->_helper->flashMessenger([\n 'context' => 'error',\n 'title' => 'Erreur lors de la suppression du document',\n 'message' => $e->getMessage(),\n ]);\n }\n }", "public function DeleteDocente() {\n\t\t\t$this->objDocente->Delete();\n\t\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "public function testExample()\n {\n $car = \\App\\Car::find(32);\n $delete= $car->delete();\n $this->assertTrue($delete);\n\n }", "public function testDelete()\n\t{\n\t\t// Add test bookings\n\t\t$bookings = [];\n\t\tforeach ($this->clients as $client) {\n\t\t\t$booking = factory(\\App\\Booking::class)->create([\n\t\t\t\t'fitter_id' => $this->admin->fitter->id,\n\t\t\t\t'client_id' => $client->id,\n\t\t\t\t'horse_id' => factory(\\App\\Horse::class)->create(['client_id' => $client->id])->id,\n\t\t\t\t'rider_id' => factory(\\App\\Rider::class)->create(['client_id' => $client->id])->id,\n\t\t\t\t'user_id' => factory(\\App\\User::class)->create([\n\t\t\t\t\t'fitter_id' => $this->admin->fitter->id,\n\t\t\t\t\t'type' => 'fitter-user',\n\t\t\t\t])->id,\n\t\t\t]);\n\n\t\t\t$bookings[] = $booking->toArray();\n\t\t}\n\n\t\t$booking = \\App\\Booking::find($bookings[0]['id']);\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->delete('/api/v1/admin/bookings/' . $booking->id)\n\t\t\t ->assertStatus(200)\n\t\t\t ->assertJsonStructure([\n\t\t\t\t 'success',\n\t\t\t ]);\n\n\t\t$this->assertDatabaseMissing('bookings', ['id' => $booking->id]);\n\t}", "public function testDelete()\n\t{\n\t\t$client = static::createClient(array(), array(\n\t\t 'PHP_AUTH_USER' => 'jr',\n\t\t 'PHP_AUTH_PW' => 'jr',\n\t\t));\n\t\t$client->followRedirects();\n\n\t\t// On clique sur le lien entreprise de test\n\t\t$crawler = $client->request('GET', '/clients');\n\t\t$link = $crawler->filter('.bloc__title a:contains(\"Entreprise de test\")')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Entreprise de test\")')->count());\n\n\t\t// On clique sur le bouton modifier\n\t\t$link = $crawler->filter('.btn--delete')->first()->link();\n\t\t$crawler = $client->click($link);\n\t\t//On vérifie qu'on est bien sur la bonne page\n\t\t$this->assertEquals(1, $crawler->filter('.breadcrumb:contains(\"Supprimer\")')->count()); \n\n\t\t// On modifie le métier\n\t\t$form = $crawler->selectButton('Supprimer')->form();\n\t\t$crawler = $client->submit($form);\t\n\n\t\t//On vérifie que ça a marché\n\t\t$this->assertEquals(1, $crawler->filter('html:contains(\"Le client a bien été supprimé.\")')->count());\n\n\t}", "public static function delete_doc($id, $doc) {\r\n\t\t$client = self::get_client();\r\n\t\r\n\t\t$index = $client->getIndex(self::get_index());\r\n\t\t$type = $index->getType($doc->get_type());\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tif ($index->exists()) {\r\n\t\t\t\t$type->deleteDocument(new \\Elastica\\Document($id, array()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (\\Elastica\\Exception\\Connection\\HttpException $e)\r\n\t\t{\r\n\t\t\techo 'ESWP: Error deleting: ', $e->getMessage(), \"\\n\";\r\n\t\t}\r\n\t}", "public function testDelete()\n\t{\n\t\t$saddle = $this->saddles[0];\n\n\t\t$this->actingAs($this->admin, 'api')\n\t\t\t ->delete('/api/v1/admin/saddles/' . $saddle->id)\n\t\t\t ->assertStatus(200);\n\n\t\t$this->assertDatabaseMissing('saddles', ['id' => $saddle->id]);\n\t}", "protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }", "public function testDeleteUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "public function testDelete()\n {\n $context = $this->createPageContext();\n $storage = $this->createStorage();\n $tokenStorage = $this->createTokenStorage();\n\n $layout1 = $storage->create();\n $layout2 = $storage->create();\n $layout3 = $storage->create();\n\n $context->addLayoutList([$layout1->getId(), $layout2->getId(), $layout3->getId()]);\n $token = $context->createEditToken([$layout1->getId(), $layout3->getId()], ['user_id' => 17]);\n $tokenString = $token->getToken();\n $tokenStorage->saveToken($token);\n\n // Save our editable instances\n $tokenStorage->update($tokenString, $layout1);\n $tokenStorage->update($tokenString, $layout3);\n\n // Validate that load still work\n $tokenStorage->loadToken($tokenString);\n $tokenStorage->loadMultiple($tokenString, [$layout1->getId(), $layout3->getId()]);\n\n // And now delete\n $tokenStorage->deleteAll($tokenString);\n\n try {\n $tokenStorage->loadToken($tokenString);\n $this->fail();\n } catch (InvalidTokenError $e) {\n $this->assertTrue(true);\n }\n try {\n $tokenStorage->loadMultiple($tokenString, [$layout1->getId()]);\n $this->fail();\n } catch (InvalidTokenError $e) {\n $this->assertTrue(true);\n }\n try {\n $tokenStorage->load($tokenString, $layout3->getId());\n $this->fail();\n } catch (InvalidTokenError $e) {\n $this->assertTrue(true);\n }\n }", "public function testOnDeletedDocumentWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onDeletedDocument($this->dir1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a document\", $ex->getMessage());\n }\n }", "public function deleteAction()\n {\n if ( $this->getRequest()->getParam('id') > 0) {\n try {\n $traineedoc = Mage::getModel('bs_traineedoc/traineedoc');\n $traineedoc->setId($this->getRequest()->getParam('id'))->delete();\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_traineedoc')->__('Trainee Document was successfully deleted.')\n );\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('There was an error deleting trainee document.')\n );\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n Mage::logException($e);\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_traineedoc')->__('Could not find trainee document to delete.')\n );\n $this->_redirect('*/*/');\n }", "public function testDeleteDocumentFields()\n {\n $remoteDataFolder = self::$baseRemoteFolderPath . \"/DocumentElements/Fields\";\n $localFileName = \"test_multi_pages.docx\";\n $remoteFileName = \"TestDeleteSectionParagraphFields.docx\";\n\n $this->uploadFile(\n realpath(__DIR__ . '/../../..') . \"/TestData/\" . \"Common/\" . $localFileName,\n $remoteDataFolder . \"/\" . $remoteFileName\n );\n\n $request = new DeleteFieldsRequest(\n $remoteFileName,\n \"\",\n $remoteDataFolder,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL,\n NULL\n );\n\n Assert::assertNull($this->words->deleteFields($request));\n }", "public function testDocumentIntegrityAfterManualValueDeletion()\n {\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => '123']);\n $this->em->remove($eavValue);\n\n $eavValue = $this->getEavValueRepo()->findOneBy(['value' => 'customer_invoice']);\n $this->em->remove($eavValue);\n\n try {\n $this->em->flush();\n } catch (\\Exception $e) {\n $this->assertInstanceOf(EavDocumentValidationException::class, $e);\n }\n\n $violations = $eavValue->getDocument()->getLastViolations();\n\n $this->assertCount(2, $violations);\n $this->assertContains('customerId', (string) $violations);\n $this->assertContains('customerDocumentType', (string) $violations);\n }", "public function DELETE() {\n #\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "function delete() {\n\t\t$this->status = \"deleted\";\n\t\t$sql = \"UPDATE \" . POLARBEAR_DB_PREFIX . \"_articles SET status = '$this->status' WHERE id = '$this->id'\";\n\t\tglobal $polarbear_db;\n\t\t$polarbear_db->query($sql);\n\n\t\t$args = array(\n\t\t\t\"article\" => $this,\n\t\t\t\"objectName\" => $this->getTitleArticle()\n\t\t);\n\t\tpb_event_fire(\"pb_article_deleted\", $args);\n\n\t\treturn true;\n\t}", "public function delete( $post=null, $config=null ) {\n\n $re = $post->delete();\n\n if ( is_success($re) ) success( ['idx' => in('idx') ]);\n else error( $re );\n\n }", "protected function doDeleteDocumentIfInSearch() {\n if ($this->showRecordInSearch())\n {\n $this->doDeleteDocument();\n }\n }", "public function testDeleteReplenishmentTag()\n {\n }", "public function testDeleteIfAuthor()\n {\n $this->addTestFixtures();\n $id = $this->task->getId();\n $this->logInAsUser();\n\n $this->task->setUser($this->authUser);\n $this->client->request('GET', '/tasks/'.$id.'/delete');\n\n $statusCode = $this->client->getResponse()->getStatusCode();\n $this->assertEquals(302, $statusCode);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été supprimée.', $crawler->filter('div.alert.alert-success')->text());\n }", "public function testPageDelete()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::where(\"admin\", true)->whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('DELETE', \"/api/pages/\" . $page->slug);\n $response\n ->assertStatus(200);\n }", "public function testDelete_Error()\r\n\t{\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\t\r\n\t\t$response = $this->http->delete('/api/v1/hospital/5', [ //Change ID here to a Hospital that isn't in the datastore'\r\n\t\t\t'http_errors' => false\r\n\t\t]);\r\n\t\r\n\t\t//Test invalid requests\r\n\t\t$this->assertEquals(405, $response->getStatusCode());\r\n\r\n\t\t//Stopping the connexion with Guzzle\r\n\t\t$this->http = null;\r\n\t\t\r\n\t}" ]
[ "0.7819554", "0.7742444", "0.7180947", "0.7146807", "0.7044822", "0.6999556", "0.6970119", "0.69247323", "0.68608874", "0.6719958", "0.6718927", "0.67063123", "0.6704686", "0.6703076", "0.6648219", "0.6647937", "0.6635172", "0.66290015", "0.6604365", "0.66010773", "0.65809053", "0.65808105", "0.65717274", "0.65401775", "0.6521773", "0.65099317", "0.6507093", "0.6498915", "0.64362574", "0.6409235", "0.64051133", "0.6391775", "0.6389787", "0.6367187", "0.636715", "0.6340815", "0.63366914", "0.63249344", "0.63170177", "0.6282716", "0.62813723", "0.627654", "0.62764883", "0.62666625", "0.626133", "0.62580913", "0.62572664", "0.6251968", "0.62482095", "0.623271", "0.62183696", "0.6216282", "0.6191267", "0.6189214", "0.61772084", "0.6176441", "0.617004", "0.6163342", "0.6155684", "0.6138514", "0.6127928", "0.61137193", "0.61086047", "0.60986215", "0.60858303", "0.6081529", "0.6078558", "0.60771954", "0.6070718", "0.60481375", "0.60473776", "0.60425645", "0.6040752", "0.60366166", "0.60356313", "0.6033452", "0.60195667", "0.60131013", "0.6009186", "0.6006747", "0.6001667", "0.60000724", "0.59984815", "0.59980536", "0.5996005", "0.5992942", "0.5982704", "0.5978652", "0.59577936", "0.59461886", "0.59460676", "0.59460676", "0.59460205", "0.59452355", "0.5916466", "0.59128237", "0.59120715", "0.5910696", "0.5910059", "0.59059787" ]
0.8316177
0
Testing document listing with the parameters, "from" and "size"
public function testListDocumentsFromTo() { echo "\nTesting the document retrieval by ID..."; $response = $this->listDocumentsFromTo(0,26); //echo $response; $result = json_decode($response); $hits = $result->hits; //echo "\nCOUNT:".count($hits); $this->assertTrue(count($hits)==26); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function listDocumentsFromTo($from,$size)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context. \"/documents\";\n \n $url = $url.\"?from=\".$from.\"&size=\".$size;\n \n \n echo \"\\n\".$url;\n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "public function testListDocuments()\n {\n }", "public function testListAllDocuments()\n {\n }", "public function testListDocuments()\n {\n echo \"\\nTesting document listing...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents\";\n \n $response = $this->curl_get($url);\n //echo \"-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->total;\n \n $this->assertTrue(($total > 0));\n \n }", "public function testListAllPublicDocuments()\n {\n }", "public function testPagination()\n {\n\n // Set public page length to 2.\n set_option('per_page_public', 2);\n\n $item1 = $this->_item(true, 'Item 1');\n $item2 = $this->_item(true, 'Item 2');\n $item3 = $this->_item(true, 'Item 3');\n $item4 = $this->_item(true, 'Item 4');\n $item5 = $this->_item(true, 'Item 5');\n $item6 = $this->_item(true, 'Item 6');\n\n // --------------------------------------------------------------------\n\n // Page 1.\n $this->dispatch('solr-search');\n\n // Should just list items 1-2.\n $this->assertXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link to page 2.\n $next = public_url('solr-search?page=2');\n $this->assertXpath('//a[@href=\"'.$next.'\"]');\n\n $this->resetResponse();\n $this->resetRequest();\n\n // --------------------------------------------------------------------\n\n // Page 2.\n $_GET['page'] = '2';\n $this->dispatch('solr-search');\n\n // Should just list items 3-4.\n $this->assertNotXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link to page 3.\n $next = public_url('solr-search?page=3');\n $this->assertXpath('//a[@href=\"'.$next.'\"]');\n\n $this->resetResponse();\n $this->resetRequest();\n\n // --------------------------------------------------------------------\n\n // Page 3.\n $_GET['page'] = '3';\n $this->dispatch('solr-search');\n\n // Should just list items 5-6.\n $this->assertNotXpath('//a[@href=\"'.record_url($item1).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item2).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item3).'\"]');\n $this->assertNotXpath('//a[@href=\"'.record_url($item4).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item5).'\"]');\n $this->assertXpath('//a[@href=\"'.record_url($item6).'\"]');\n\n // Should link back to page 2.\n $prev = public_url('solr-search?page=2');\n $this->assertXpath('//a[@href=\"'.$prev.'\"]');\n\n // --------------------------------------------------------------------\n\n }", "public function testGETProductsCollectionPaginated()\n {\n $this->assertEquals(\n 4,\n $this->crawler->filter('span:contains(\"Title\")')->count()\n );\n //in the last page have 2 product\n $crawler = $this->client->request('GET', '/?page=8');\n $this->assertEquals(\n 2,\n $crawler->filter('span:contains(\"Title\")')->count()\n );\n }", "public function testInboundDocumentSearch()\n {\n }", "public function testReadDocument()\n {\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function testIndex()\n {\n Item::factory()->count(20)->create();\n\n $this->call('GET', '/items')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', 1);\n\n //test paginate\n $parameters = array(\n 'per_page' => 10,\n 'page' => 2,\n );\n\n $this->call('GET', '/items', $parameters)\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n '*' => [\n 'id',\n 'guid',\n 'name',\n 'email',\n 'created_dates',\n 'updated_dates',\n ]\n ]\n ])\n ->assertJsonPath('meta.current_page', $parameters['page'])\n ->assertJsonPath('meta.per_page', $parameters['per_page']);\n }", "abstract public function getDocuments();", "public function testGetPositionsWithPagination()\n {\n $client = new Client(['base_uri' => 'http://localhost:8000/api/']);\n $token = $this->getAuthenticationToken();\n $headers = [\n 'Authorization' => 'Bearer ' . $token,\n 'Accept' => 'application/json'\n ];\n $params = [\n 'page' => 2\n ];\n $response = $client->request('GET', 'positions', [\n 'headers' => $headers,\n 'query' => $params\n ]);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals(['application/json; charset=utf-8'], $response->getHeader('Content-Type'));\n $data = json_decode($response->getBody(), true);\n $this->assertEquals(30, count($data));\n\n }", "public function test_list_all_offices_paginated() {\n Office::factory(3)->create();\n\n $response = $this->get('/api/offices');\n\n $response->assertOk();\n\n // Assert the returned json data has 3 items - the ones we created above\n $response->assertJsonCount(3, 'data');\n\n // Assert atleast the ID of the first item is not null\n $this->assertNotNull($response->json('data')[0]['id']);\n\n // Assert there is meta for the paginated results. You can include links as well\n $this->assertNotNull($response->json('meta'));\n\n //dd($response->json());\n\n }", "function retrieveAllDocuments($client, $html)\n{\n if ($html) {echo \"<h2>Your documents</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed();\n\n printDocumentsFeed($feed, $html);\n}", "public function testCreatePaginatedList(): void\n {\n // given\n $page = 1;\n $dataSetSize = 10;\n $expectedResultSize = 10;\n\n $counter = 0;\n while ($counter < $dataSetSize) {\n $film = new Films();\n $category = new \\App\\Entity\\Category();\n $category->setName('test3'.$counter);\n $categoryRepository = self::$container->get(CategoryRepository::class);\n $categoryRepository->save($category);\n $film->setReleaseDate('2021-07-15');\n $film->setDescription('ssa');\n $film->setCategory($category);\n $film->setTitle('Test film #'.$counter);\n $this->filmsRepository->save($film);\n\n $user = new User();\n $user->setEmail('test'.$counter.'@gmail.com');\n $user->setPassword('123445');\n $user->setUsersprofile($this->createUserProfile());\n $userprofile = $user->getUsersprofile();\n $comment = new Comments();\n $comment->setLogin($userprofile);\n $comment->setFilms($film);\n $comment->setContent(' Content#2'.$counter);\n\n $this->commentsRepository->save($comment);\n\n ++$counter;\n }\n\n // when\n $result = $this->commentsService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function testListingWithFilters()\n {\n $filters[] = ['limit' => 30, 'page' => 30];\n $filters[] = ['listing_type' => 'public'];\n foreach ($filters as $k => $v) {\n $client = static::createClient();\n $client->request('GET', '/v2/story', $v, [], $this->headers);\n $this->assertStatusCode(200, $client);\n\n $response = json_decode($client->getResponse()->getContent(), true);\n $this->assertTrue(is_array($response));\n }\n }", "public function testIndex() \n {\n $flickr = new flickr(\"0469684d0d4ff7bb544ccbb2b0e8c848\"); \n \n #check if search performed, otherwise default to 'sunset'\n $page=(isset($this->params['url']['p']))?$this->params['url']['p']:1;\n $search=(isset($this->params['url']['query']))?$this->params['url']['query']:'sunset';\n \n #execute search function\n $photos = $flickr->searchPhotos($search, $page);\n $pagination = $flickr->pagination($page,$photos['pages'],$search);\n \n echo $pagination;\n \n #ensure photo index in array\n $this->assertTrue(array_key_exists('photo', $photos)); \n \n #ensure 5 photos are returned\n $this->assertTrue(count($photos['photo'])==5); \n \n #ensure page, results + search in array\n $this->assertTrue(isset($photos['total'], $photos['displaying'], $photos['search'], $photos['pages']));\n \n #ensure pagination returns\n $this->assertTrue(substr_count($pagination, '<div class=\"pagination\">') > 0);\n \n #ensure pagination links\n $this->assertTrue(substr_count($pagination, '<a href') > 0);\n \n }", "public function testInboundDocumentCount()\n {\n }", "public function testPage()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->page(10));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(225, $elasticQuery['from']);\n $this->assertSame(25, $elasticQuery['size']);\n\n $this->assertSame($query, $query->page(20, 50));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(950, $elasticQuery['from']);\n $this->assertSame(50, $elasticQuery['size']);\n\n $query->limit(15);\n $this->assertSame($query, $query->page(20));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertSame(285, $elasticQuery['from']);\n $this->assertSame(15, $elasticQuery['size']);\n }", "public function listing();", "public function testReadPublicDocument()\n {\n }", "public function testInboundDocumentGet()\n {\n }", "public function getDocuments();", "public function test_list_stores_pagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit(new ListStores());\n $number_page = count($browser->elements('.pagination li')) - 2;\n $this->assertEquals($number_page, ceil((self::NUMBER_RECORD) / (self::ROW_LIMIT)));\n });\n }", "public function testRetrieveTheMediaObjectList(): void\n {\n $response = $this->request('GET', '/api/media_objects');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(10, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('fileName', $json[$key]);\n $this->assertArrayHasKey('mimeType', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]);\n } \n }", "public function testCreatePaginatedList(): void\n {\n // given\n $page = 1;\n $dataSetSize = 3;\n $expectedResultSize = 3;\n\n $counter = 0;\n while ($counter < $dataSetSize) {\n $category = new Category();\n $category->setName('Test Category #'.$counter);\n $this->categoryService->save($category);\n\n ++$counter;\n }\n\n // when\n $result = $this->categoryService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function testGetList_SortingLimit()\n\t{\n\t\t$this->object->Save();\n\t\t$newObject1 = new object(\"efg\");\n\t\t$newObject2 = new object(\"abc\");\n\t\t$newObject3 = new object(\"d\");\n\n\t\t$newObject1->Save();\n\t\t$newObject2->Save();\n\t\t$newObject3->Save();\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", true, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"abc\", $objectList[0]->attribute);\n\n\t\t$objectList = $newObject1->GetList(array(array(\"objectId\", \">\", 0)), \"attribute\", false, 2);\n\n\t\t$this->assertEquals(2, sizeof($objectList));\n\t\t$this->assertEquals(\"obj att\", $objectList[0]->attribute);\n\t\t$this->assertEquals(\"efg\", $objectList[1]->attribute);\n\t}", "public function index()\n\t{\n $search = Input::get(\"search\");\n $from = date(\"Y-m-d H:i:s\",strtotime(Input::get(\"from\")) );\n $to = date(\"Y-m-d H:i:s\",strtotime(Input::get(\"to\")) );\n\n\t\t$documents = Document::orderBy('created_at','desc')->with('fromUnit')\n ->search($search)\n ->dateBetween($from,$to)\n ->paginate(5);\n\n\n\t\treturn View::make('documents.index', compact('documents'));\n\t}", "public function testShowRecordPaginate()\n {\n $this->makeData(21);\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/comment')\n ->resize(1920, 2000)\n ->assertSee('List comment & rating');\n //Count row number in one page \n $elements = $browser->elements('#list-table tbody tr');\n $this->assertCount(10, $elements);\n $this->assertNotNull($browser->element('.pagination'));\n\n //Count page number of pagination\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element)- 2;\n $this->assertTrue($number_page == 3);\n });\n }", "public function testGetWithPagination()\n {\n $expected_count = 2;\n\n $results_1 = self::$api->getAll([], 0, $expected_count);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount($expected_count, $results_1);\n\n $expected_page = 1;\n $results_2 = self::$api->getAll([], $expected_page, 1);\n usleep(AUTH0_PHP_TEST_INTEGRATION_SLEEP);\n $this->assertCount(1, $results_2);\n $this->assertEquals($results_1[$expected_page]['client_id'], $results_2[0]['client_id']);\n $this->assertEquals($results_1[$expected_page]['audience'], $results_2[0]['audience']);\n }", "public function testListMetadata()\n {\n }", "public function testBookSearchMustOK()\n {\n $dataSearch = [];\n $dataSearch['search'] = 'TestBook';\n $dataSearch['limit'] = 100;\n $buildParams = http_build_query($dataSearch, PHP_QUERY_RFC1738);\n $url = route('book.index');\n $fullUrl = \"$url?$buildParams\";\n $response = $this->getJson($fullUrl);\n\n $response\n ->assertStatus(200)\n ->assertJsonPath('page_info.total', 1);\n }", "public function testCreatePaginatedListEmptyList(): void\n {\n // given\n $page = 1;\n $expectedResultSize = 0;\n\n $user = $this->simpleUser();\n\n // when\n $result = $this->eventService->createPaginatedList($page, $user);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function test_searchByPage() {\n\n }", "function searchPhotos($request,$from,$size){\r\n\t $gestionTagDao = new GestionTagDao();\r\n $tab = $gestionTagDao->search($request,$from,$size);\r\n\r\n $photos = $tab[1];\r\n $nb = $tab[0];\r\n \r\n if(sizeof($photos) == 0){\r\n echo \"{\\\"message\\\":\\\"Pas de données\\\"}\";\r\n\t\t\treturn;\r\n }\r\n $tab = new Data();\r\n $tab->addInfo(\"photos\",$photos);\r\n $tab->addInfo(\"nb\",$nb);\r\n $json = $this->writePhotosJSON($tab);\r\n echo $json;\r\n }", "public function index()\n {\n $documents = Document::paginate(env('PAGINATE_SIZE'));\n\n if($documents->first()){\n return $this->respond($documents);\n } else{\n return $this->respondNotFound('Oops! no hay Documentos');\n }\n }", "public function testRecordingListPage(): void\n {\n $recordingListPage = self::$recordingListPage;\n\n $this->assertInstanceOf(RecordingListPage::class, $recordingListPage);\n $this->assertSame(25, count($recordingListPage));\n\n $recording = $recordingListPage[0];\n\n $this->assertInstanceOf(Recording::class, $recording);\n }", "public function test_can_get_all_todos_paginated()\n {\n $this->withoutExceptionHandling();\n\n $response = $this->get('/api/todos');\n $response->assertJson($response->decodeResponseJson());\n $response->assertStatus(200);\n }", "public function testGetPublicDocument()\n {\n }", "public function testInboundDocumentDocumentFile()\n {\n }", "public function testGetDocument()\n {\n }", "public function testPathPagination()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/qrcodes?page=' . ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.qrcodes.limit_rows'))));\n $elements = $browser->elements('#list-qrcodes tbody tr');\n $browser->assertPathIs('/admin/qrcodes')\n ->assertQueryStringHas('page', ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.qrcodes.limit_rows'))));\n });\n }", "public function testInboundDocumentFileContent()\n {\n }", "public function testSearchParams()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse, 15);\n\n $sw->search();\n $sw->search('testing123');\n $sw->search('', '2017-01-01');\n $sw->search('', '', '2017-01-02');\n $sw->search('', '2017-01-01', '2017-01-02');\n $sw->search('', '', '', 'Kyle');\n $sw->search('', '', '', '', 'Smith');\n $sw->search('', '', '', 'Kyle', 'Smith');\n $sw->search('', '', '', '', '', true);\n $sw->search('', '', '', '', '', false);\n $sw->search('', '', '', '', '', null);\n $sw->search('', '', '', '', '', null, true);\n $sw->search('', '', '', '', '', null, false);\n $sw->search('', '', '', '', '', null, true, 'testing');\n $sw->search('testing123', '', '', '', '', true);\n\n $this->checkGetRequests($container, [\n '/v4/search',\n '/v4/search?templateId=testing123',\n '/v4/search?fromDts=2017-01-01',\n '/v4/search?toDts=2017-01-02',\n '/v4/search?fromDts=2017-01-01&toDts=2017-01-02',\n '/v4/search?firstName=Kyle',\n '/v4/search?lastName=Smith',\n '/v4/search?firstName=Kyle&lastName=Smith',\n '/v4/search?verified=true',\n '/v4/search?verified=false',\n '/v4/search',\n '/v4/search',\n '/v4/search?sort=asc',\n '/v4/search?tag=testing',\n '/v4/search?templateId=testing123&verified=true'\n ]);\n }", "public function testSearchDocument()\n {\n echo \"\\nTesting document search...\";\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?search=mouse\";\n $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context.\"/documents?search=mouse\";\n \n $response = $this->curl_get($url);\n //echo \"\\n-------Response:\".$response;\n $result = json_decode($response);\n $total = $result->hits->total;\n \n $this->assertTrue(($total > 0));\n }", "public function testInboundDocumentCreateDocument()\n {\n }", "function receiveAllDocuments() ;", "public function testListQrcodesPagination()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/qrcodes');\n $elements = $browser->elements('#list-qrcodes tbody tr');\n $this->assertCount(config('define.qrcodes.limit_rows'), $elements);\n $this->assertNotNull($browser->element('.pagination'));\n $paginate_element = $browser->elements('.pagination li');\n $number_page = count($paginate_element) - 2;\n $this->assertTrue($number_page == ceil((self::NUMBER_RECORD_CREATE + 1) / (config('define.qrcodes.limit_rows'))));\n });\n }", "function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitle, $nonetitle,\n\t$navcategories, $categoryid, $categoryqcount, $categorypathprefix, $feedpathprefix, $suggest,\n\t$pagelinkparams = null, $categoryparams = null, $dummy = null)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\trequire_once QA_INCLUDE_DIR . 'app/format.php';\n\trequire_once QA_INCLUDE_DIR . 'app/updates.php';\n\n\t$userid = qa_get_logged_in_userid();\n\n\n\t// Chop down to size, get user information for display\n\n\tif (isset($pagesize)) {\n\t\t$questions = array_slice($questions, 0, $pagesize);\n\t}\n\n\t$usershtml = qa_userids_handles_html(qa_any_get_userids_handles($questions));\n\n\n\t// Prepare content for theme\n\n\t$qa_content = qa_content_prepare(true, array_keys(qa_category_path($navcategories, $categoryid)));\n\n\t$qa_content['q_list']['form'] = array(\n\t\t'tags' => 'method=\"post\" action=\"' . qa_self_html() . '\"',\n\n\t\t'hidden' => array(\n\t\t\t'code' => qa_get_form_security_code('vote'),\n\t\t),\n\t);\n\n\t$qa_content['q_list']['qs'] = array();\n\n\tif (count($questions)) {\n\t\t$qa_content['title'] = $sometitle;\n\n\t\t$defaults = qa_post_html_defaults('Q');\n\t\tif (isset($categorypathprefix)) {\n\t\t\t$defaults['categorypathprefix'] = $categorypathprefix;\n\t\t}\n\n\t\tforeach ($questions as $question) {\n\t\t\t$fields = qa_any_to_q_html_fields($question, $userid, qa_cookie_get(), $usershtml, null, qa_post_html_options($question, $defaults));\n\n\t\t\tif (!empty($fields['raw']['closedbyid'])) {\n\t\t\t\t$fields['closed'] = array(\n\t\t\t\t\t'state' => qa_lang_html('main/closed'),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$qa_content['q_list']['qs'][] = $fields;\n\t\t}\n\t} else {\n\t\t$qa_content['title'] = $nonetitle;\n\t}\n\n\tif (isset($userid) && isset($categoryid)) {\n\t\t$favoritemap = qa_get_favorite_non_qs_map();\n\t\t$categoryisfavorite = @$favoritemap['category'][$navcategories[$categoryid]['backpath']];\n\n\t\t$qa_content['favorite'] = qa_favorite_form(QA_ENTITY_CATEGORY, $categoryid, $categoryisfavorite,\n\t\t\tqa_lang_sub($categoryisfavorite ? 'main/remove_x_favorites' : 'main/add_category_x_favorites', $navcategories[$categoryid]['title']));\n\t}\n\n\tif (isset($count) && isset($pagesize)) {\n\t\t$qa_content['page_links'] = qa_html_page_links(qa_request(), $start, $pagesize, $count, qa_opt('pages_prev_next'), $pagelinkparams);\n\t}\n\n\t$qa_content['canonical'] = qa_get_canonical();\n\n\tif (empty($qa_content['page_links'])) {\n\t\t$qa_content['suggest_next'] = $suggest;\n\t}\n\n\tif (qa_using_categories() && count($navcategories) && isset($categorypathprefix)) {\n\t\t$qa_content['navigation']['cat'] = qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams);\n\t}\n\n\t// set meta description on category pages\n\tif (!empty($navcategories[$categoryid]['content'])) {\n\t\t$qa_content['description'] = qa_html($navcategories[$categoryid]['content']);\n\t}\n\n\tif (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid))) {\n\t\t$qa_content['feed'] = array(\n\t\t\t'url' => qa_path_html(qa_feed_request($feedpathprefix . (isset($categoryid) ? ('/' . qa_category_path_request($navcategories, $categoryid)) : ''))),\n\t\t\t'label' => strip_tags($sometitle),\n\t\t);\n\t}\n\n\treturn $qa_content;\n}", "abstract protected function getResourceCollectionObject($count, $_links);", "public function testGetPagesAndCreatePaginator()\n {\n $i = 0;\n $pageFrom = 1;\n $perPage = 20;\n $totalItems = 400;\n\n $link = $this->createMock(HalLink::class);\n $link\n ->expects($this->once())\n ->method('get')\n ->willReturn($this->getPaginatedResource($i, $pageFrom, $perPage, $totalItems));\n\n $instance = new DomainResourceMock($link);\n\n $count = 0;\n $criterias = ['page' => $pageFrom, 'limit' => $perPage];\n foreach ($instance->getPages($criterias) as $collection) {\n $count++;\n $this->assertInstanceOf(PaginatedResourceCollection::class, $collection);\n }\n\n // NumberItem / ItemPerPage = NumberOfPages,\n // NumberOfPages - (PageToStartAt - 1) = AwaitedNumberOfPages (-1 because page 0 does no exists)\n $this->assertEquals(($totalItems / $perPage) - ($pageFrom - 1), $count);\n }", "function booksList($offset, $total_records_per_page, $order, $ascdesc)\n{\n $booksManager = new ListManager();\n\n\n\n if (isset($_GET['search']) && $_GET['search']!='') {\n $search = input(addcslashes($_GET['search'], '_'));\n $search=\"%\".$search.\"%\";\n $books = $booksManager->get_search($offset, $total_records_per_page, $order, $ascdesc, $search);\n } elseif (isset($_GET['cat']) && $_GET['cat']!='') {\n $cat = input($_GET['cat']);\n $books = $booksManager-> get_cat($offset, $total_records_per_page, $order, $ascdesc, $cat);\n } else {\n $books = $booksManager->selectAll($offset, $total_records_per_page, $order, $ascdesc); // Appel la fonction qui renvoie toutes les données sur les livres en bdd\n }\n // require('view/listView.php');\n return $books;\n echo selectAll();\n}", "public function testIndexActionHasExpectedData()\n {\n $this->dispatch('/index');\n $this->assertQueryContentContains('h1', 'My Albums');\n\n // At this point, i'd like to do a basic listing count of items.\n // However, we're not using a seperate test db with controlled seeds.\n // $this->assertQueryCount('table tr', 6);\n }", "public function testCreateDocument()\n {\n }", "public function test118DisplayPaginationLinksWhenTotalRecordsHigherThan10()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(11, date('Y-m-d'), 11);\n\n //$this->mockApi($data, 'empty_ok');\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n ];\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalRowsInList = substr_count($list, '<ul class=\"pagination\"');\n\n $this->assertEquals(1, $totalRowsInList);\n }", "public function public_documents_get($id = \"0\")\n {\n $cutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n \n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n \n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $search = $this->input->get('search', TRUE);\n \n \n $result = array();\n if(is_null($search))\n $result = $cutil->getPublicDocument($id);\n else\n $result = $cutil->searchPublicDocument ($search, $from, $size);\n \n $this->response($result);\n }", "static public function getForWithPagination(\n $args, $transform, int $pageNum,\n int $numShown = 4, string $pagingFor = '', \n string $listUrl = '', string $baseUrl = 'store', \n string $dir = 'asc', int $viewNumber = 0, \n bool $withTrashed = true, bool $useTitle = true, \n bool $fullUrl = false, int $version = 1, $default = [], \n bool $useBaseMaker = true\n ) {\n $totalNum = count($args);\n $pageIdx = self::genFirstAndLastItemsIdxes( \n $totalNum, $pageNum, $numShown\n );\n if ($totalNum <= $numShown) {\n $argTmp = $args;\n } else {\n $paging = Functions::genRange(\n $pageIdx['begin'], ($pageIdx['end'] - 1)\n );\n $argTmp = [];\n foreach ($paging as $idx) {\n $argTmp[] = $args[$idx];\n }\n }\n $tmp = self::getFor(\n $argTmp, $baseUrl, $transform, $useTitle, $version,\n $withTrashed, $fullUrl, $default, $useBaseMaker, \n $dir\n );\n if (Functions::testVar($tmp) && Functions::countHas($tmp)) {\n /* \n return self::getPaginatedItemsArray(\n $tmp, $pageNum, $numShown, \n $pagingFor, $listUrl, \n $viewNumber\n ); \n */\n $content = self::makeBasePaginatedItemsArray(\n $tmp,\n self::genPagination3(\n $pageIdx['begin'], $pageIdx['end'] - 1, $numShown,\n $totalNum, $pageNum, Functions::genRowsPerPage(\n $totalNum, $numShown\n ), 4, $viewNumber, $pagingFor, $baseUrl\n )\n );\n /* Log::info(\n 'dumping content from ' . __METHOD__ .' ..', \n [\n 'total' => $totalNum,\n 'useGenPaginator2' => $useGenPaginator2,\n 'content' => $content\n ]\n ); */\n return $content;\n } else {\n return $default;\n }\n }", "function paginateWithExtra($size = 15);", "public function testThatGetAllUsersWithPageIsFormattedProperly()\n {\n $api = new MockManagementApi( [\n new Response( 200, self::$headers ),\n new Response( 200, self::$headers ),\n ] );\n\n $api->call()->users()->getAll( [], [], null, 10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n\n $api->call()->users()->getAll( [], [], null, -10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n }", "public function testModSelectCountPages()\n {\n $this->todo('stub');\n }", "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function testIfPDFDocumentsListIncludesTranslation()\n {\n // Set up\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth(false);\n Shopware()->Plugins()->Backend()->Auth()->setNoAcl();\n\n // Login\n $this->Request()->setMethod('POST');\n $this->Request()->setPost([\n 'username' => 'demo',\n 'password' => 'demo',\n ]);\n $this->dispatch('backend/Login/login');\n\n $getParams = [\n '_repositoryClass' => 'document',\n '_dc' => '1234567890',\n 'page' => '1',\n 'start' => '0',\n 'limit' => '20',\n ];\n\n $this->reset();\n\n // Check if German values are still the same\n $this->Request()->setMethod('GET');\n $getString = http_build_query($getParams);\n $response = $this->dispatch('backend/Config/getList?' . $getString);\n\n $responseJSON = json_decode($response->getBody(), true);\n static::assertEquals(true, $responseJSON['success']);\n\n foreach ($responseJSON['data'] as $documentType) {\n static::assertEquals($documentType['name'], $documentType['description']);\n }\n\n $this->reset();\n Shopware()->Container()->reset('translation');\n\n // Check for English translations\n $user = Shopware()->Container()->get('auth')->getIdentity();\n $user->locale = Shopware()->Models()->getRepository(\n Locale::class\n )->find(2);\n\n $this->Request()->setMethod('GET');\n $getString = http_build_query($getParams);\n $response = $this->dispatch('backend/Config/getList?' . $getString);\n\n $responseJSON = json_decode($response->getBody(), true);\n static::assertEquals(true, $responseJSON['success']);\n\n foreach ($responseJSON['data'] as $documentType) {\n switch ($documentType['id']) {\n case 1:\n static::assertEquals('Invoice', $documentType['description']);\n break;\n case 2:\n static::assertEquals('Notice of delivery', $documentType['description']);\n break;\n case 3:\n static::assertEquals('Credit', $documentType['description']);\n break;\n case 4:\n static::assertEquals('Cancellation', $documentType['description']);\n break;\n }\n }\n }", "function fetchList($limit, $offset);", "public function testIndex()\n {\n if ($this->skipBaseTests) $this->markTestSkipped('Skipping Base Tests');\n\n $items = $this->model->factory(5)->create();\n\n // Check index :: Get the json response from index and check if the above factory is in it\n $response = $this->get($this->baseUrl, ['FORCE_CONTENT_TYPE'=>'json'])->assertStatus(200);\n $data = $response->json()['data']??[];\n\n\n // Check that the returned data from the index, has at least as many items created by the factory\n $this->assertGreaterThan(0, count($data));\n $this->assertGreaterThanOrEqual(count($data), count($items));\n\n }", "public function advanced_document_search_get($id=\"0\")\n {\n $sutil = new CILServiceUtil();\n $from = 0;\n $size = 10;\n\n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp))\n {\n $from = intval($temp);\n }\n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp))\n {\n $size = intval($temp);\n }\n $data = file_get_contents('php://input', 'r');\n \n //$url = $this->config->item('elasticsearchPrefix').\"/data/_search\".\"?q=CIL_CCDB.Status.Deleted:false&from=\".$from.\"&size=\".$size;\n $url = $this->config->item('elasticsearchPrefix').\"/data/_search?from=\".$from.\"&size=\".$size;\n $response = $sutil->just_curl_get_data($url,$data);\n $json = json_decode($response);\n \n //$this->response($data);\n $this->response($json);\n }", "public function testCreatePaginatedListEmptyList(): void\n {\n // given\n $page = 1;\n $expectedResultSize = 0;\n\n // when\n $result = $this->categoryService->createPaginatedList($page);\n\n // then\n $this->assertEquals($expectedResultSize, $result->count());\n }", "public function testIndex()\n {\n // full list\n $response = $this->get(url('api/genre?api_token=' . $this->api_token));\n $response->assertStatus(200);\n $response->assertSeeText('Thriller');\n $response->assertSeeText('Fantasy');\n $response->assertSeeText('Sci-Fi');\n }", "public function testList()\n {\n //Tests all invoices\n $this->clientAuthenticated->request('GET', '/invoice/list');\n $response = $this->clientAuthenticated->getResponse();\n $content = $this->assertJsonResponse($response, 200);\n $this->assertInternalType('array', $content);\n $first = $content[0];\n $this->assertArrayHasKey('invoiceId', $first);\n }", "function vcn_cma_documents_view() {\n$get_userid = explode('-',$_GET['userid']);\n$vars['user_id']=$get_userid[0];\n$valid['user_id']='valid';\n$documentinfo = vcn_get_data ($errors, $vars, $valid, 'cmasvc', 'cmauserdocument', 'list', $limit=false, $offset=false, $order='document_id', $direction='desc');\n\nforeach ($documentinfo->cma as $document) {\n\t//$shareynarray = array();\n\tif($document->shareyn == 'y' || $document->shareyn == 'Y'){\n\t\t$shareynarray = $document->shareyn;\n\t}\n}\n\n\tif (isset($shareynarray)) {\n\t\n\t\t$base_path = base_path();\n\t\t$o .= '<br />The following is a list of available documents:<br /><br />';\n/* \t\t$o .= '<div style=\"margin-left: 0px; margin-bottom: 3px;\">'.'<b>Document Title</b>'.'</div>';\n\t\t$o .= '<hr class=\"clear-both\">' . PHP_EOL; */\n foreach ($documentinfo->cma as $document) {\n\t\t\tif($document->shareyn == 'y' || $document->shareyn == 'Y'){\n\t\t\t\t$imagepath = $base_path . drupal_get_path('module', 'vcn_cma') . '/images';\n\t\t\t\tif($document->documenttypeid == 2) {$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/word.png'. '\" title=\"Word Document\" alt=\"Word Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 3){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/ppt.png'. '\" title=\"PowerPoint Document\" alt=\"PowerPoint Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 4){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/exel.png'. '\" title=\"Excel Document\" alt=\"Excel Document\" />';}\n\t\t\t\telseif($document->documenttypeid == 5){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/img.png'. '\" title=\"Image File\" alt=\"Image File\" />';}\n\t\t\t\telseif($document->documenttypeid == 6){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/txt.png'. '\" title=\"Text File\" alt=\"Text File\" />';}\n\t\t\t\telseif($document->documenttypeid == 7){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/zip.png'. '\" title=\"Zip File\" alt=\"Zip File\" />';} \n\t\t\t\telseif($document->documenttypeid == 8){$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/pdf.png'. '\" title=\"PDF File\" alt=\"PDF File\" />';}\n\t\t\t\telse{$img = '<img style=\"margin-left: 1px; margin-top: 1px;\" src=\"' . $imagepath.'/blank.png'. '\" title=\"Other\" alt=\"Other\" />';}\n\n\t\t\t\t$onlydate = explode(' ', $document->documentuploaddate);\n\t\t\t\t$datediv = '<div style=\"margin-left: 747px; margin-top: -12px;\">'.$onlydate[0].'</div>';\n\t\t\t\t$o .= '\t<div id=\"documentid-' . $document->documentid . '\" class=\"cma-documents\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t<div class=\"cma-documents-inner\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t\t<div class=\"cma-documents-body\">' . PHP_EOL;\n\n\t\t\t\t$docidforcheck = $document->documentid;\n\t\t\t\t$docidforshareyn = \"'\".$document->shareyn.\"'\";\n\n\t\t\t\t$o .= ' <a style=\"text-decoration: none; margin-top:1px;\" href=\"/careerladder/getfile.php?docid='.$document->documentid.'\"> '.$img.'&nbsp;&nbsp;'.$document->documenttitle.' </a>'.PHP_EOL; //with image \n\n\t\t\t\t$o .= '\t\t\t</div><!-- /cma-notebook-documents-body -->' . PHP_EOL;\n\t\t\t\t//$o .= ' <hr class=\"clear-both\">' . PHP_EOL;\n\t\t\t\t$o .= '\t\t</div><!-- /cma-notebook-certificate-inner -->' . PHP_EOL;\n\t\t\t\t$o .= '\t</div><!-- /cma-notebook-program -->' . PHP_EOL;\n\t\t\t}\n }\n\n\t\t$datein = '<div style=\\\"margin-left: 746px; margin-top: -8px;\\\">'.date(\"Y-m-d\").'</div>';\n }else{\n \t$o .='<br /><br />';\n \t$o .='<div><b>The user do not have any Documents to share</b></div>'; \n }\n return $o; \n}", "public function testFindByQWithOffsetAndLimit()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $filters = ['q' => $all[0]['name'], 'offset' => 0, 'limit' => 1];\n $this->filterTest($filters, [$all[0]]);\n $filters = ['q' => 'desc', 'offset' => 1, 'limit' => 1];\n $this->filterTest($filters, [$all[1]]);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function page($from = null, $limit = null, array $parameters = [])\n {\n return $this->rest_list($from, $limit, $parameters);\n }", "function pagination(){}", "function listing() {\r\n\r\n }", "public function testCreateGetListGetDocumentAndDeleteDocumentInExistingCollection()\n {\n $collectionName = $this->TESTNAMES_PREFIX . 'CollectionTestSuite-Collection';\n $requestBody = ['name' => 'frank', '_key' => '1'];\n $document = new Document($this->client);\n\n /** @var HttpResponse $responseObject */\n $responseObject = $document->create($collectionName, $requestBody);\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n $this->assertEquals($collectionName . '/1', $decodedJsonBody['_id']);\n\n $responseObject = $document->getAll($collectionName);\n $responseBody = $responseObject->body;\n\n $this->markTestSkipped(\n 'The functionality needs to be implemented in the API first (simple queries API).'\n );\n\n// $this->assertArrayHasKey('documents', json_decode($responseBody, true));\n//\n// $decodedJsonBody = json_decode($responseBody, true);\n//\n// $this->assertEquals(\n// '/_api/document/ArangoDB-PHP-Core-CollectionTestSuite-Collection/1',\n// $decodedJsonBody['documents'][0]\n// );\n//\n// $responseObject = $document->delete($collectionName . '/1');\n// $responseBody = $responseObject->body;\n//\n// $decodedJsonBody = json_decode($responseBody, true);\n//\n// $this->assertArrayNotHasKey('error', $decodedJsonBody);\n\n // Try to delete a second time .. should throw an error\n $responseObject = $document->delete($collectionName . '/1');\n $responseBody = $responseObject->body;\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertArrayHasKey('error', $decodedJsonBody);\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $decodedJsonBody = json_decode($responseBody, true);\n\n $this->assertEquals(true, $decodedJsonBody['error']);\n\n $this->assertEquals(404, $decodedJsonBody['code']);\n\n $this->assertEquals(1202, $decodedJsonBody['errorNum']);\n }", "function queryListing($page_no, $items_per_page, $offset, $s_item_type, $search_vars_r) {\n\t\t// reference to site item unique ID.\n\t\tif (strlen($search_vars_r['iblist_id']) > 0) {\n\t\t\t$this->addListingRow(NULL, NULL, NULL, array('iblist_id' => $search_vars_r['iblist_id']));\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$search_clause = \"\";\n\t\tif (strlen($search_vars_r['author']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['author']);// . \"&author=on\";\n\t\telse if (strlen($search_vars_r['title']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['title']);// . \"&title=on\";\n\t\telse if (strlen($search_vars_r['isbn']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['isbn']);// . \"&isbn=on\";\n\t\telse if (strlen($search_vars_r['series']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['series']);// . \"&series=on\";\n\t\telse if (strlen($search_vars_r['description']) > 0)\n\t\t\t$search_clause = \"item=\" . urlencode($search_vars_r['description']);// . \"&description=on\";\n\n//\t\t$pageBuffer = $this->fetchURI(\"http://www.iblist.com/search/advanced_search.php?$search_clause&next=$offset\");\n\t\t$pageBuffer = $this->fetchURI(\"http://www.iblist.com/search/search.php?$search_clause&next=$offset\");\n\n\t\t// find out how many matches we have.\n//\t\tif (preg_match(\"!<b>\\[</b>([0-9]+) <b>-</b> ([0-9]+) <b>out of</b> ([0-9]+)<b>\\]</b>!i\", $pageBuffer, $matches)) {\n\t\tif (preg_match(\"!([0-9]+) - ([0-9]+) out of ([0-9]+)!i\", $pageBuffer, $matches)) {\n\t\t\t$this->setTotalCount($matches[3]);\n\n//\t\t\tif (preg_match_all(\"!<LI><A HREF=\\\"http://www.iblist.com/book([0-9]+).htm\\\">([^<]+)</A> by <A HREF=\\\"[^\\\"]+\\\">([^<]+)</A> </LI>!i\", $pageBuffer, $matches2)) {\n\t\t\tif (preg_match_all(\"!<LI><A HREF=\\\"http://www.iblist.com/book([0-9]+).htm\\\">([^<]+)</A> by <A HREF=\\\"[^\\\"]+\\\">([^<]+)</A></LI>!i\", $pageBuffer, $matches2)) {\n\t\t\t\tfor ($i = 0; $i < count($matches2[0]); $i++) {\n//\t\t\t\t\t$this->addListingRow($matches2[2][$i] . ' by ' . trim($matches2[3][$i]), \"http://www.iblist.com/images/covers/\" . $matches2[1][$i] . \".jpg\", NULL, array('iblist_id' => $matches2[1][$i]));\n// image id is wrong, so ignore the url\n\t\t\t\t\t$this->addListingRow($matches2[2][$i] . ' by ' . trim($matches2[3][$i]), '', NULL, array('iblist_id' => $matches2[1][$i]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function testListPastWebinarFiles()\n {\n }", "public function showList($offset, $limit, $fieldSort = null, $order = null);", "function get_objects($offset, $count, $order_property = null)\r\n {\r\n $order_property = $this->get_order_property($order_property);\r\n return $this->get_browser()->retrieve_photo_gallery_publications($this->get_condition(), $order_property, $offset, $count);\r\n }", "abstract protected function createPages($count = 10): array;", "public function testListStorePostsSucess() {\n $baseUrl = $this->getContainer()->getParameter('symfony_base_url');\n $acess_token = $this->getContainer()->getParameter('access_token');\n $serviceUrl = $baseUrl . 'api/liststoreposts?access_token='.$acess_token;\n $data = '{\"reqObj\":{\"store_id\":\"1495\",\"user_id\":1,\"limit_start\":0,\"limit_size\":10}}';\n $client = new CurlRequestService();\n $response = $client->send('POST', $serviceUrl, array(), $data)\n ->getResponse();\n $response = json_decode($response);\n $this->assertEquals(101, $response->code);\n }", "public function getPage(\\SetaPDF_Core_Document $document) {}", "function fullTextSearch($client, $html, $query)\n{\n if ($html) {echo \"<h2>Documents containing $query</h2>\\n\";}\n\n $feed = $client->getDocumentListFeed(\n 'https://docs.google.com/feeds/documents/private/full?q=' . $query);\n\n printDocumentsFeed($feed, $html);\n}", "public function getPageItems()\n {\n }", "public function testGetCollectionItems()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function results_are_paged()\n {\n }", "public function testIndexAssetPerPage()\n {\n // 1. Mock data\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.index', ['perPage' => 50]));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function testItemsPerPage()\n {\n $feed = $this->eventFeed;\n\n // Assert that the feed's itemsPerPage is correct\n $this->assertTrue($feed->getItemsPerPage() instanceof Zend_Gdata_Extension_OpenSearchItemsPerPage);\n $this->verifyProperty2($feed, \"itemsPerPage\", \"text\", \"25\");\n }", "public function index_client($perPage);", "public function take($size = 1, $from = 0);", "function absenrich_list(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\r\n\t\t$result=$this->m_absensi_enrichment->absenrich_list($query,$start,$end);\r\n\t\techo $result;\r\n\t}", "function issuu_api_folders_list(array $settings, $result_order = NULL, $start_index = NULL, $page_size = NULL, $sort_by = NULL, array $response_parameters = NULL) {\n try {\n // Construct request parameters.\n $parameters = issuu_api_create_request_parameters();\n $parameters->addEnumParam('resultOrder', $result_order, issuu_api_folder_result_orders());\n $parameters->addIntegerParam('startIndex', $start_index);\n $parameters->addIntegerParam('pageSize', $page_size);\n $parameters->addEnumParam('folderSortBy', $sort_by, issuu_api_folder_response_parameters());\n $parameters->addEnumListParam('responseParams', $response_parameters, issuu_api_folder_response_parameters());\n // Create client and perform action.\n return issuu_api_create_client(ISSUU_API_CLIENT_API, $settings)->issuu_folders_list($parameters);\n }\n catch (Exception $ex) {\n // Log exception to watchdog.\n watchdog_exception('issuu_api', $ex);\n // Return the error code.\n return $ex->getCode();\n }\n}", "abstract protected function grabReportListFromFile( $quantity );", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function test117NoDisplayPaginationLinksWhenTotalRecordsLessThan10()\n {\n $ssoData = $this->getSSOData();\n\n // current bookings\n $this->createBookings(9, date('Y-m-d'), 9);\n\n //$this->mockApi($data, 'empty_ok');\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n ];\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalRowsInList = substr_count($list, '<div class=\"contract_item\"');\n\n $this->assertLessThan(10, $totalRowsInList);\n }", "public function testFindPageReturnsDataForExistingItemNumber()\n\t{\n\t\t$this->getProviderMock('Item', 'search', JSON_WORKS);\n\t\t$json = $this->getJsonAction('ItemsController@show', '1');\n\t\t$this->assertEquals('works', $json->name);\n\t}", "public function testIfPdfPrinterListWillReturnData(): void\n {\n $response = new PdfPrinterMockResponse(200, [\n [\n 'file' => 'XXX.pdf',\n 'path' => 'test/XXX.pd',\n 'created_at' => '2020-06-27T22:27:09.876Z',\n 'updated_at' => '2020-06-27T22:27:09.876Z',\n ],\n ]);\n\n $pdfPrinter = $this->createApiMock([$response]);\n $result = $pdfPrinter->listFiles();\n\n $this->assertNotNull($result);\n $this->assertEquals(1, $result->count());\n }", "public function pagesize() { return 15; }", "function alat_list(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\r\n\t\t$result=$this->m_alat->alat_list($query,$start,$end);\r\n\t\techo $result;\r\n\t}" ]
[ "0.71769536", "0.68642807", "0.66656786", "0.6481461", "0.6258789", "0.5947674", "0.5771128", "0.57704264", "0.56990504", "0.5689262", "0.5676513", "0.56605285", "0.56581664", "0.5576548", "0.5574252", "0.55462795", "0.54961747", "0.5494453", "0.5439168", "0.5438068", "0.54307014", "0.54005426", "0.53992414", "0.5394465", "0.5387522", "0.5387352", "0.5387195", "0.5372961", "0.5372843", "0.536584", "0.53618467", "0.53494537", "0.53452635", "0.5342356", "0.5329462", "0.5326123", "0.52805865", "0.52695245", "0.52580833", "0.5243019", "0.5239751", "0.5233616", "0.5213094", "0.52019256", "0.5188364", "0.5186983", "0.5180759", "0.5175624", "0.51747704", "0.5173353", "0.51580346", "0.51467776", "0.51377", "0.5130402", "0.5124215", "0.5121729", "0.5120039", "0.5116526", "0.5108406", "0.51082975", "0.5105584", "0.51018214", "0.50876546", "0.50835705", "0.5083273", "0.5072322", "0.5071531", "0.5070386", "0.50688916", "0.5059938", "0.50544405", "0.5049611", "0.5047938", "0.5046593", "0.50371265", "0.50324976", "0.50274044", "0.50260097", "0.5016098", "0.5015598", "0.5011661", "0.50112987", "0.5010691", "0.5004268", "0.49882916", "0.49878573", "0.49857166", "0.4981502", "0.49779168", "0.4977507", "0.49742055", "0.4973811", "0.49717075", "0.4967572", "0.4965827", "0.4962139", "0.4961906", "0.495867", "0.49570885", "0.49454665" ]
0.69214356
1
Testing the user listing
public function testListUsers() { echo "\nTesting user listing..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/users"; $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context."/users"; $response = $this->curl_get($url); //echo "-------Response:".$response; $result = json_decode($response); $total = $result->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetUserList() {\n $i = new Instagram();\n $result = $i->userList('retrovertigo');\n $this->assertNotEmpty($result->posts);\n $this->assertNotEmpty($result->posts[0]->images);\n $this->assertEquals('retrovertigo', $result->posts[0]->userName);\n $this->assertEquals([], $i->getErrors());\n }", "function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "public function generate_users_list()\n {\n $this->get('/usuarios')->assertStatus(200)->assertSee('Pedro');\n }", "public function testListUserItems() {\n $createUser = PromisePay::User()->create($this->userData);\n \n // update itemData, so seller is just created user\n $this->itemData['seller_id'] = $createUser['id'];\n \n // Create an item\n $createItem = PromisePay::Item()->create($this->itemData);\n \n // Get the list\n $getListOfItems = PromisePay::User()->getListOfItems($createUser['id']);\n \n $this->assertEquals($this->itemData['name'], $getListOfItems[0]['name']);\n $this->assertEquals($this->itemData['description'], $getListOfItems[0]['description']);\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testListUserIdentities()\n {\n }", "public function testListUsersSuccess()\n {\n $mock = new MockHandler([\n new Response(200, [], '{\"users\": \"user\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(200)\n ->assertJson(['users' => 'user']);\n\n }", "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "function userListing()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n { \n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n $data['searchText'] = $searchText;\n \n $this->load->library('pagination');\n \n $count = $this->user_model->userListingCount($searchText);\n\n\t\t\t$returns = $this->paginationCompress ( \"userListing/\", $count, 5 );\n \n $data['userRecords'] = $this->user_model->userListing($searchText, $returns[\"page\"], $returns[\"segment\"]);\n \n $this->global['pageTitle'] = 'Garuda Informatics : User Listing';\n \n $this->loadViews($this->view.\"users\", $this->global, $data, NULL);\n }\n }", "public function testGetUsersPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@index');\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\t\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.index', $response->content->view);\n\t}", "public function test_rangLista()\n\t{\n\t\t$output = $this->request('GET', ['UserController','rangLista']);\n\t\t$this->assertContains('<h3 class=\"text-center text-dark\"><i>Običan korisnik -> Rang lista</i></h3>\t', $output);\n\t}", "public function testUserListForStandardUser()\n {\n $user = User::factory()->create([\n 'type' => 'user',\n ]);\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(403)\n ->assertJson([\n 'success' => false\n ]);\n }", "public function testListUserEnrollments()\n {\n }", "public function testCreateUserAndList(): void\n {\n User::factory()->count(1)->create();\n\n $users = User::all();\n self::assertCount(1, $users);\n $list = array_keys($users->first()->getAttributes());\n self::assertEqualsCanonicalizing(\n [\n 'id',\n 'name',\n 'email',\n 'cpf/cnpj',\n 'type_person',\n 'email_verified_at',\n 'password',\n 'remember_token',\n 'created_at',\n 'updated_at'\n ],\n $list\n );\n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }", "public function testUserIndex()\n {\n $response = $this->actingAs($this->user())->get(route('task_statuses.index'));\n $response->assertOk();\n }", "function userListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $searchText = $this->input->post('searchText');\n $searchStatus = $this->input->post('searchStatus');\n\n $this->load->library('pagination');\n\n $count = $this->user_model->userListingCount($this->global['level'], $searchText);\n\n $returns = $this->paginationCompress(\"userListing/\", $count, 5);\n\n $data['userRecords'] = $this->user_model\n ->userListing($this->global['level'], $searchText, $searchStatus, $returns[\"page\"], $returns[\"segment\"]);\n\n $this->global['pageTitle'] = '人员管理';\n $data['searchText'] = $searchText;\n $data['searchStatus'] = $searchStatus;\n\n $this->loadViews(\"systemusermanage\", $this->global, $data, NULL);\n }\n }", "public function testMeetupWillBeListedForPermittedUsers()\n {\n $data = array(\n 'permission' => 'custom',\n 'permittedUsers' => array('5003e8bc757df2020d000000'),\n );\n list($responseCode, $responseBody) = sendPutRequest($this->endpoint .'/5003e8bc757df2020d0f0033', $data, $this->user1Headers);\n\n list($responseCode, $responseBody2) = sendGetRequest($this->endpoint, array(), $this->user2Headers);\n $retrievedForUser2 = json_decode($responseBody2);\n\n list($responseCode, $responseBody3) = sendGetRequest($this->endpoint, array(), $this->user3Headers);\n $retrievedForUser3 = json_decode($responseBody3);\n\n $this->assertSame(2, count($retrievedForUser2));\n $this->assertSame(3, count($retrievedForUser3));\n }", "public function testShowUser()\n {\n $user = User::find(1);\n $this->browse(function (Browser $browser) use ($user) {\n $browser->visit('/users/' . $user->id)\n ->assertSee($user->id)\n ->assertSee($user->full_name)\n ->assertSee($user->email);\n });\n }", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function getUsersList()\n {\n }", "function loadUsersDetail()\n {\n $this->get('/usuarios/5')\n ->assertStatus(200)\n ->assertSee('Mostrando detalle del usuario: 5');\n }", "public function userListTemplate(): void\n {\n $page = get_query_var(self::CUSTOMPAGEVAR);\n if ($page === $this->customEndpoint()) {\n $data = self::FetchUsersData();\n $userListingTemplate = plugin_dir_path(dirname(__FILE__)) . \"views/listing-view/template-users-list.php\";\n $this->themeRedirect($userListingTemplate, true, $data);\n exit();\n }\n }", "public function index()\n {\n $this->user_list();\n }", "public function test_authenticated_users_can_see_detailed_customer_list()\n {\n $this->actingAs(factory(User::class)->create());\n\n // If the route customers/detailedlist can be visited(i.e get), assert \"true\"\n $response = $this->get('/customers/detailedlist')->assertOk();\n\n }", "public function testGetUsers()\n {\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "public function testUserIndex()\n {\n $user = factory('App\\User')->create();\n\n $this->get('/api/v1/users');\n\n $username = json_decode($this->response->getContent(), true)[0][\"username\"];\n\n $this->assertEquals(\n $user[\"username\"], $username);\n }", "public function testListPeople()\n {\n }", "public function index()\n {\n $this->userlist();\n }", "public function userList() {\n /** @var User[] $users */\n $users = $this->entityManager->getRepository(\"Entity\\\\User\")->findAll(); // Retrieve all User objects registered in database\n echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);\n }", "public function testUserApiReturnsUsers()\n {\n // @TODO - test the updated /users endpoint properly.\n return true;\n // $users = factory(User::class, 2)->create();\n\n // $this->json('GET', 'api/v1/users')\n // ->seeJsonStructure([\n // '*' => [\n // 'northstar_id', 'created_at', 'updated_at', 'role',\n // ]\n // ]);\n }", "public function testSuccessWithNoUsersToList()\n {\n $response = $this->getJson($this->endpoint(), $this->authenticationHeaders())->assertStatus(200);\n\n // Check the basic api endpoint structure.\n $this->assertEndpointBaseStructure($response);\n }", "public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}", "public function getTestUserList()\n\t{\n\t\treturn $this->test_user_list;\n\t}", "public function testIntegrationIndex()\n {\n $userFaker = factory(Model::class)->create([\n 'name' => 'Foo Bar'\n ]);\n $this->visit('user')\n ->see($userFaker->name);\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'name' => $userFaker->name,\n 'email' => $userFaker->email,\n ]);\n $this->assertViewHas('models');\n }", "public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}", "public function testIndex(): void\n {\n $response = $this\n ->actingAs($this->user)\n ->get('/');\n $response->assertViewIs('home');\n $response->assertSeeText('Сообщения от всех пользователей');\n }", "public function testGetUserAll()\n {\n $response = $this->request()->json('GET','/api/users');\n $response->assertStatus(200);\n }", "public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}", "public function testFindUsers()\n {\n\n }", "public function testListMemberAccounts()\n {\n }", "public function testInfoUser()\n {\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "public function test_get_users_in_context() {\n $component = 'core_tag';\n\n $user1 = $this->set_up_tags()[0];\n $systemcontext = context_system::instance();\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($systemcontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user1->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the a context other than system context should be empty.\n $usercontext1 = context_user::instance($user1->id);\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext1, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }", "public function test_it_returns_a_list_of_users()\n {\n User::insert([\n ['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook'],\n ['email' => '[email protected]', 'given_name' => 'Andy', 'family_name' => 'Hook'],\n ]);\n\n $response = $this->call('GET', '/users');\n\n $this->assertEquals(200, $response->status());\n $this->assertEquals(User::all()->toJson(), $response->getContent());\n }", "public function testAdminCanSeeUserIndex()\n {\n $this->actingAs($this->admin_user);\n\n $response = $this->get(route('admin.users.index'));\n\n $response->assertStatus(200);\n }", "public function lst(){\n\t\t$args = $this->getArgs();\n\t\t$uid = $_SESSION[\"user\"][\"uid\"];\n\t\t$base_url = substr($_SERVER[\"REQUEST_URI\"], 0, strrpos($_SERVER[\"REQUEST_URI\"], \"/\") + 1);\n\t\t$header = array(\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_ID)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_EMAIL)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_FNAME)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_LNAME)),\n\t\t\t\tsprintf(\"%s\", Translate::get(Translator::USER_LIST_HEADER_PHONE))\n\t\t);\n\t\t\n\t\t$config = array(\n\t\t\t\t\"config\" => array(\n\t\t\t\t\t\t\"page\" => (isset($args[\"GET\"][\"page\"]) ? $args[\"GET\"][\"page\"] : System::PAGE_ACTUAL_DEFAULT),\n\t\t\t\t\t\t\"column\" => (isset($args[\"GET\"][\"column\"]) ? $args[\"GET\"][\"column\"] : System::SORT_DEFAULT_COLUMN),\n\t\t\t\t\t\t\"direction\" => (isset($args[\"GET\"][\"direction\"]) ? $args[\"GET\"][\"direction\"] : System::SORT_DES),\n\t\t\t\t\t\t\"actual_pagesize\" => (isset($_SESSION[\"page_size\"]) ? $_SESSION[\"page_size\"] : System::PAGE_SIZE_DEFAULT),\n\t\t\t\t\t\t\"data_count\" => $this->getModel()->getCountUserList(),\n\t\t\t\t\t\t\"disable_menu\" => true,\n\t\t\t\t\t\t\"disable_select\" => true,\n\t\t\t\t\t\t\"disable_pagging\" => false,\n\t\t\t\t\t\t\"disable_set_pagesize\" => false\n\t\t\t\t),\n\t\t\t\t\"form_url\" => array(\n\t\t\t\t\t\t\"page\" => $base_url . \"-%d-%d-%s\",\n\t\t\t\t\t\t\"header_sort\" => $base_url . \"-%d-%d-%s\",\n\t\t\t\t\t\t\"form_action\" => $base_url\n\t\t\t\t),\n\t\t\t\t\"item_menu\" => array(),\n\t\t\t\t\"select_item_action\" => array(),\n\t\t\t\t\"style\" => array(\n\t\t\t\t\t\t\"marked_row_class\" => \"marked\",\n\t\t\t\t\t\t\"count_box_class\" => \"count_box\",\n\t\t\t\t\t\t\"pagging_box_class\" => \"pagging_box\",\n\t\t\t\t\t\t\"actual_page_class\" => \"actual_page\",\n\t\t\t\t\t\t\"table_header_class\" => \"head\",\n\t\t\t\t\t\t\"table_id\" => \"user_lst\",\n\t\t\t\t\t\t\"select_form_id\" => \"\",\n\t\t\t\t\t\t\"pagesize_form_id\" => \"pagesize_box\",\n\t\t\t\t\t\t\"list_footer_id\" => \"\"\n\t\t\t\t)\n\t\t);\n\t\t$data = $this->getModel()->getUserList($config[\"config\"][\"page\"], $config[\"config\"][\"actual_pagesize\"], $config[\"config\"][\"column\"], $config[\"config\"][\"direction\"], $config[\"config\"][\"disable_pagging\"]);\n\t\t$out = Paginator::generatePage($header, $data, $config);\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function admin_user_list() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('User.created' => 'desc' ),\n 'conditions' => array('User.status' => 1),\n );\n $data = $this->paginate('User');\n $this->set('user', $data);\n $this->render('/Users/user_list');\n }", "public function testThatGetAllUsersWithPageIsFormattedProperly()\n {\n $api = new MockManagementApi( [\n new Response( 200, self::$headers ),\n new Response( 200, self::$headers ),\n ] );\n\n $api->call()->users()->getAll( [], [], null, 10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n\n $api->call()->users()->getAll( [], [], null, -10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n }", "public function testThatGetAllUsersWithPerPageIsFormattedProperly()\n {\n $api = new MockManagementApi( [\n new Response( 200, self::$headers ),\n new Response( 200, self::$headers ),\n ] );\n\n $api->call()->users()->getAll( [], [], null, null, 10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=10', $query );\n\n $api->call()->users()->getAll( [], [], null, null, -10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=10', $query );\n }", "public function testGetSingleUserPage()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$response = $this->call('orchestra::users@view', array(1));\n\t\t\n\t\t$this->assertInstanceOf('Laravel\\Response', $response);\n\t\t$this->assertEquals(200, $response->foundation->getStatusCode());\n\t\t$this->assertEquals('orchestra::users.edit', $response->content->view);\n\t}", "public function testGetUserrecordings()\n {\n }", "public function testIndex(){\n\t\t\n\t\t$this->mock->shouldReceive('all')->once();\n\n\t\t$this->call('GET', 'users'); //get: Method , user: url\n\n\t\t$this->assertResponseOk();\n\t}", "public function testIndexStatus(){\n\n $user = factory(User::class)->create();\n\n $this->actingAs($user)->withSession(['foo' => 'bar'])->visit('admin/price/')->see(\"Price List\")\n ;\n\n }", "public function testItReturnsUsers()\n {\n $this->user->update([\"firstname\" => \"anthony\"]);\n $user1 = factory(User::class)->create([\n \"firstname\" => \"james\",\n \"tenant_id\" => $this->user->tenant_id,\n ]);\n $tenant2 = factory(Tenant::class)->create();\n $user2 = factory(User::class)->create([\n \"firstname\" => \"benjamin\",\n \"tenant_id\" => $tenant2->id,\n ]);\n\n $this->actingAs($this->user)\n ->getJson(\"api/v1/users\")\n ->assertOk()\n ->assertJson([\n \"data\" => [\n $this->user->only([\"id\", \"firstname\"]),\n $user2->only([\"id\", \"firstname\"]),\n $user1->only([\"id\", \"firstname\"]),\n ],\n ]);\n }", "public function testAdministrationUsers()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(new Login())\n ->loginAsUser('[email protected]', 'password');\n\n $browser->assertSee('Gérer les utilisateurs')\n ->clickLink('Gérer les utilisateurs')\n ->waitForText('[email protected]')\n ->assertSee('[email protected]')\n ->assertSee('[email protected]');\n });\n }", "public function testListMembers()\n {\n }", "function hc_users($args){\n\t\t$users = hc_get_users($args);\n\t\tif ( is_wp_error($users) ){\n\t\t\t\techo $users->get_error_message();\n\t\t\t\treturn false;\n\t\t}\n\t\tforeach ($users as $key => $user) {\n\t\t\techo '<ul class=\"hc_user_list\">';\n\t\t\techo '<li class=\"hc_user_name\">'.$user->display_name.'</li>';\n\t\t\techo '<li class=\"hc_user_gravatar\">'.$user->gravatar.'</li>';\n\t\t\techo '<ul class=\"hc_user_info\">';\n\t\t\t\tforeach ($user as $field => $value) {\n\t\t\t\t\tif (($field !=' display_name' && $field != 'gravatar') && $value != '') {\n\t\t\t\t\t\tif ($field == 'user_url') {\n\t\t\t\t\t\t\techo '<li><a href=\"'.$value.'\">'.$value.'</a></li>';\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\techo '<li>'.$value.'</li>';\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\techo '</ul>';\n\t\t\techo '</ul>';\n\t\t}\n\t}", "public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}", "public function testShow() {\n\t\t$expectedArray = $this->getFixture( 'current-user' );\n\n\t\t$api = $this->getApiMock();\n\t\t$api->expects( $this->once() )\n\t\t\t->method( 'get' )\n\t\t\t->with( '/users/me' )\n\t\t\t->will( $this->returnValue( $expectedArray ) );\n\n\t\t$this->assertEquals( $expectedArray, $api->show() );\n\t}", "public function testListSiteMemberships()\n {\n }", "public function testGetUser()\n {\n $response = $this->get('getuser');\n\n $response->assertStatus(200);\n }", "public function test_default_values_set() {\n $this->resetAfterTest();\n\n $u1 = $this->getDataGenerator()->create_user();\n $u2 = $this->getDataGenerator()->create_user();\n $u3 = $this->getDataGenerator()->create_user();\n $u4 = $this->getDataGenerator()->create_user();\n\n $context = \\context_system::instance();\n $component = 'core_privacy';\n\n $uut = new approved_userlist($context, $component, [$u1->id, $u2->id]);\n\n $this->assertEquals($context, $uut->get_context());\n $this->assertEquals($component, $uut->get_component());\n\n $expected = [\n $u1->id,\n $u2->id,\n ];\n sort($expected);\n\n $result = $uut->get_userids();\n sort($result);\n\n $this->assertEquals($expected, $result);\n }", "public function show(UserList $list)\n {\n \n }", "public function testShowUser()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/1');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n \"data\" => [\n \"id\",\n \"employee_code\",\n \"name\",\n \"email\",\n \"team\",\n \"role\",\n \"total_borrowed\",\n \"total_donated\"\n ]\n \n ])->assertStatus(Response::HTTP_OK);\n }", "public function testUserDetails() {\n\t\t// make new User and save it to the database\n\t\t$Role = Role::where('name', 'user')->first();\n\n\t\t// test home page 200 response code\n\t\t$this->visit('/home')\n\t\t\t->seePageIs('/home')\n\t\t\t->assertResponseOk();\n\n\t\t// check that User details are being displayed\n\t\t$this->visit('/home')->within('.body-content', function() use($Role) {\n\t\t\t$this->see($this->User->name)\n\t\t\t\t->see($this->User->email)\n\t\t\t\t->see(Language::trans('database.role-name-'.$Role->name));\n\t\t});\n\t}", "public function testRouteShowDetailUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(1)\n ->visit('/users')\n ->click('.table tbody tr:nth-child(1) td:nth-child(7) a:nth-child(1)')\n ->assertPathIs('/users/1')\n ->assertSee('DETAIL USER')\n ->assertSee('User Information');\n });\n }", "public function index()\n {\n // show list user\n }", "public function testUserMeGet()\n {\n }", "public function testTheWritingsPageLoadsSuccessfullyForRegularUsers()\n {\n $regularUser = factory(\\App\\User::class)->states('regularUser')->create();\n $this->actingAs($regularUser);\n\n $response = $this->get('writings');\n $response->assertStatus(200);\n }", "public function testSearchAdminsSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $this -> createUser($this -> userCredentials2);\n $this -> createUser($this -> userCredentials3);\n\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Search for users that exists\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJson([\n 'email' => $this ->userCredentials[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials2[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials3[\"email\"]\n ]);\n\n // Search for user that does not exist\n $this -> call('GET','api/classes/admins/search',['string' => '[email protected]']);\n $this -> seeJson([]);\n }", "public function test_get_users_in_context() {\n $this->resetAfterTest();\n\n $component = 'core_enrol';\n\n $user = $this->getDataGenerator()->create_user();\n $usercontext = context_user::instance($user->id);\n $course = $this->getDataGenerator()->create_course();\n $coursecontext = context_course::instance($course->id);\n\n $userlist1 = new \\core_privacy\\local\\request\\userlist($coursecontext, $component);\n provider::get_users_in_context($userlist1);\n $this->assertCount(0, $userlist1);\n\n // Enrol user into course.\n $this->getDataGenerator()->enrol_user($user->id, $course->id, null, 'manual');\n\n // The list of users within the course context should contain user.\n provider::get_users_in_context($userlist1);\n $this->assertCount(1, $userlist1);\n $expected = [$user->id];\n $actual = $userlist1->get_userids();\n $this->assertEquals($expected, $actual);\n\n // The list of users within the user context should be empty.\n $userlist2 = new \\core_privacy\\local\\request\\userlist($usercontext, $component);\n provider::get_users_in_context($userlist2);\n $this->assertCount(0, $userlist2);\n }", "public function test_can_view_profile_of_any_user()\n {\n // When i access his profile\n // Then i can see his name\n $user = create(User::class);\n\n $response = $this->get(\"/profiles/{$user->name}\");\n\n $response->assertStatus(200);\n $response->assertSeeText($user->name);\n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function testAdminUser()\n {\n //$user = Sentry::getUserProvider()->findByLogin('[email protected]');\n //$this->be($user);\n\n $response = $this->call('GET', 'admin/users');\n\n // Make sure we can't view the admin pages.\n $this->assertFalse($response->isNotFound());\n }", "public function getCompareUserList() {}", "public function testListActionWithoutLogin()\n {\n $client = static::createClient();\n $client->request('GET', '/tasks');\n static::assertSame(302, $client->getResponse()->getStatusCode());\n\n $crawler = $client->followRedirect();\n static::assertSame(200, $client->getResponse()->getStatusCode());\n \n // Test if login field exists\n static::assertSame(1, $crawler->filter('input[name=\"_username\"]')->count());\n static::assertSame(1, $crawler->filter('input[name=\"_password\"]')->count());\n }", "public function testVisitAdminUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin')\n ->clickLink('Users')\n ->assertPathIs('/admin/user')\n ->assertTitleContains('User')\n ->assertSee('List Users');\n });\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "public function testListUsersFailure()\n {\n $mock = new MockHandler([\n new Response(400, [], '{\"error\": \"list users failure\"}'),\n ]);\n\n $handler = HandlerStack::create($mock);\n $this->app->instance(Client::class, new Client(['handler' => $handler]));\n\n //login\n $this->get('api/user/list-users', $this->headers)\n ->assertStatus(400)\n ->assertSeeText('list users failure');\n\n }", "public function testList()\n {\n $this->visit('/admin/school')\n ->see(SchoolCrudController::SINGLE_NAME);\n }", "public function list ()\n {\n if (User::isLoggedIn() && User::getLoggedInUser()->is_admin === true) {\n\n // Alle User aus der DB laden\n $users = User::all();\n\n // Passenden View laden und User übergeben\n View::load('admin/users', [\n 'users' => $users\n ]);\n } else {\n \n // Wenn kein User eingeloggt ist, dann leider wir auf die Login Seite \n header(\"Location: login\");\n }\n }", "function users(){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\t$user_data = $this->model->getUsers();\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}", "public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }", "public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }", "public function test_get_users_in_context() {\n $dg = $this->getDataGenerator();\n $c1 = $dg->create_course();\n $component = 'mod_lesson';\n\n $u1 = $dg->create_user();\n $u2 = $dg->create_user();\n $u3 = $dg->create_user();\n $u4 = $dg->create_user();\n $u5 = $dg->create_user();\n $u6 = $dg->create_user();\n\n $cm1 = $dg->create_module('lesson', ['course' => $c1]);\n $cm2 = $dg->create_module('lesson', ['course' => $c1]);\n\n $cm1ctx = context_module::instance($cm1->cmid);\n $cm2ctx = context_module::instance($cm2->cmid);\n\n $this->create_attempt($cm1, $u1);\n $this->create_grade($cm1, $u2);\n $this->create_timer($cm1, $u3);\n $this->create_branch($cm1, $u4);\n $this->create_override($cm1, $u5);\n\n $this->create_attempt($cm2, $u6);\n $this->create_grade($cm2, $u6);\n $this->create_timer($cm2, $u6);\n $this->create_branch($cm2, $u6);\n $this->create_override($cm2, $u6);\n\n $context = context_module::instance($cm1->cmid);\n $userlist = new \\core_privacy\\local\\request\\userlist($context, $component);\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(5, $userids);\n $expected = [$u1->id, $u2->id, $u3->id, $u4->id, $u5->id];\n $actual = $userids;\n sort($expected);\n sort($actual);\n $this->assertEquals($expected, $actual);\n\n $context = context_module::instance($cm2->cmid);\n $userlist = new \\core_privacy\\local\\request\\userlist($context, $component);\n provider::get_users_in_context($userlist);\n $userids = $userlist->get_userids();\n\n $this->assertCount(1, $userids);\n $this->assertEquals([$u6->id], $userids);\n }", "function users($limit = 20) {\n $this->auth(SUPPORT_ADM_LEVEL);\n $this->load->view('admin/support/v_list_users');\n }", "public function test_show_user_as_user()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user)\n ->get(route('api.users.show', [$user->id]));\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n 'id',\n 'name',\n 'email',\n 'created_at',\n 'updated_at'\n ]\n ]);\n }", "public function invokeUsers()\r\n {\r\n if (!isset($_GET['users'])) {\r\n $users = $this->model->getUsers();\r\n include 'view/userslist.php';\r\n }\r\n }", "public function testCollectionUsersAll()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getList($user);", "public function testIndex()\n {\n $testingRoleName = 'user';\n\n /** @var User $user */\n $user = factory(User::class)->create();\n $user->attachRole($testingRoleName);\n\n $userResource = new UserResource($user);\n\n $userResponseJson = response()->json($userResource)->getData();\n\n $userRole = $userResponseJson->roles;\n\n $role = Role::findOrFail($userRole);\n\n $this->assertEquals($testingRoleName, $role->name);\n $this->assertEquals($user->id, $userResponseJson->id);\n $this->assertEquals($user->name, $userResponseJson->name);\n $this->assertEquals($user->email, $userResponseJson->email);\n $this->assertEquals($user->publish, $userResponseJson->publish);\n }", "public function test_admin_usecase_list()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Assignments', 'usecase_list']);\n $this->assertResponseCode(404);\n }", "public function testStateListProducts()\n {\n $user = User::find(1);\n $response = $this->actingAs($user, 'api')\n ->json('post', '/api/product/listProducts', [\n 'email' => '[email protected]',\n 'name' => 'test',\n 'password' => '123'\n ]);\n\n $response->assertStatus(200);\n }", "function user( $args )\n {\n // set the subview, all, category, and user should use the same\n $subview = array('browse_result');\n $this->view->add('subviews',$subview);\n \n // do some fancy pantsy switching to get the right args right\n $tmp = $args['page'];\n $args['page'] = $args['category'];\n $args['category'] = $tmp;\n \n \n // check if a user is provided\n if( $args['category'] == null ){\n // just use all because there is no user\n $this->all( $args );\n \n // do nothing else\n return;\n }\n\t\t$users_model = $this->app->model('users');\n\t\t$result = $users_model->user_exists($args['category']);\n //Check if id is valid\n if($result!=null){\n\t\t\t/* -------------------------------------------------------------\n\t\t\t * Distinguish these two variables from userid and username\n\t\t\t * which identify the logged in user while user_id and user_name\n\t\t\t * is for this searched user.\n\t\t\t */\n\t\t\t\n\t\t\t// user the user class to convert a name to an id, or just get\n\t\t\t// id if it is already a number, -1 on fail\n\t\t\t$user_id = $this->app->user->id_from_name($args['category']);\n\t\t\t\t\t\n\t\t\t// user the user class to convert a name to an id, or just get\n\t\t\t// id if it is already a number, -1 on fail\n\t\t\t$user_name = $this->app->user->name_from_id($user_id);\n\t\t\t\n\t\t\t// set page title\n\t\t\t$this->view->add('page_title','Listings by ' . $user_name);\n\t\t\t\n\t\t\t\n\t\t\t// get from settings, 10 as default\n\t\t\t$limit = $this->settings->get('per_page');\n\t\t\t$limit = ( $limit != null ) ? $limit : 10;\n\t\t\t\n\t\t\t// find if user has decided on some number already\n\t\t\tif( isset( $_SESSION['listings_per_page'] )){\n\t\t\t\t$limit = $_SESSION['listings_per_page'];\n\t\t\t}\n\t\t\t\n\t\t\t// init page number\n\t\t\t$page = 0;\n\t\t\t// find page\n\t\t\tif( $args['page'] != null && is_numeric($args['page']) ){\n\t\t\t\t$page = ((int) $args['page'])-1;\n\t\t\t}\n\t\t\t\n\t\t\t// initialize results\n\t\t\t$result = null;\n\t\t\t\n\t\t\t\n\t\t\t// initialize category name\n\t\t\t$user_name = 'Not found';\n\t\t\t\n\t\t\t\n\t\t\t/* ===============================\n\t\t\t * Get the listings model for this\n\t\t\t */\n\t\t\t\n\t\t\t$model = $this->app->model('listings');\n\t\t\t\n\t\t\t$result = $model->limit($limit)->page($page)->\n\t\t\t\tget_user( $user_id );\n\t\t\t\n\t\t\t\n\t\t\t$count = $model->count_user($user_id);\n\t\t\t\n\t\t\t// set up counts\n\t\t\t$paginate = array(\n\t\t\t\t'page_count' => ((int)ceil($count/$limit)),\n\t\t\t\t'this_page' => $page+1\n\t\t\t);\n\t\t\t\n\t\t\t// add page count\n\t\t\t$this->view->add('paginate',$paginate);\n\t\t\t\n\t\t\t// add teh page action to the view\n\t\t\t$this->view->add('page_action', $this->app->form_path(\n\t\t\t\t'browse/user/'.$user_id) \n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// add category name to the view\n\t\t\t$this->view->add('user_name', $user_name);\n\t\t\t\n\t\t\t// add user id to view\n\t\t\t$this->view->add('user_id', $user_id);\n\t\t\t\n\t\t\t// add results to the view\n\t\t\t$this->view->add('listing_results', $result);\n\t\t}else{\n\t\t\t$this->view->add('listing_results', null);\n\t\t}\n }", "public function testListIdentities()\n {\n }" ]
[ "0.76121455", "0.75014013", "0.72613174", "0.72612315", "0.72544307", "0.71739626", "0.7171931", "0.7126668", "0.69741875", "0.6951945", "0.68670785", "0.68536353", "0.6793329", "0.6778149", "0.6769308", "0.67619836", "0.6721301", "0.6710591", "0.6680318", "0.6651438", "0.6636298", "0.6609551", "0.66091144", "0.66083145", "0.6597341", "0.6593053", "0.6590242", "0.65681684", "0.65670735", "0.6565271", "0.6544862", "0.6541537", "0.6507088", "0.6504185", "0.64860517", "0.64527875", "0.6443268", "0.6442703", "0.64386106", "0.64156646", "0.63903826", "0.6390147", "0.63831335", "0.63786227", "0.6369014", "0.6362614", "0.6357487", "0.63533676", "0.63507456", "0.63465613", "0.6345675", "0.63352835", "0.63226986", "0.631742", "0.63088465", "0.6306056", "0.629898", "0.62942773", "0.6284915", "0.6283181", "0.6273607", "0.6266304", "0.625318", "0.623889", "0.6238699", "0.62375414", "0.6232122", "0.62320703", "0.6230285", "0.6228528", "0.62283146", "0.62226576", "0.6217044", "0.6212707", "0.6210476", "0.6210205", "0.6209023", "0.6204466", "0.61948216", "0.6175936", "0.6172008", "0.61580765", "0.6155471", "0.61471325", "0.61448985", "0.61442477", "0.61423063", "0.61414087", "0.61386186", "0.6137541", "0.61297154", "0.6125206", "0.61234754", "0.6122149", "0.6121845", "0.6120639", "0.61202776", "0.6120104", "0.61155796", "0.6115297" ]
0.7250959
5
Testing the user retreival by ID
public function testGetUsertByID() { echo "\nTesting the user retrieval by ID..."; $response = $this->getUser("44225"); //echo $response; $result = json_decode($response); $user = $result->User; $this->assertTrue((!is_null($user))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testItReturnsAUserByUserId()\n {\n $user1 = factory(User::class)->create([\n \"tenant_id\" => $this->user->tenant->id,\n ]);\n \n $this->actingAs($this->user)\n ->getJson(\"api/v1/users/{$user1->id}\")\n ->assertStatus(200)\n ->assertJson([\n \"id\" => $user1->id,\n \"firstname\" => $user1->firstname,\n ]);\n }", "public function getUser($id);", "public function getUserById($id) {\n\t\t\n\t}", "abstract public function fetchUserById($id);", "public function testGetById()\n {\n // Create and save a record to the DB\n $user = $this->userRepository->make([\n 'first_name' => 'test-first-name',\n 'last_name' => 'test-last-name',\n 'email' => '[email protected]',\n 'password' => '123123',\n ]);\n\n $user->save();\n\n // Get the user from DB with the getById method\n $userFromDb = $this->userRepository->getById($user->id);\n // Make sure the user the proper name and email\n $this->assertEquals('test-first-name', $userFromDb->first_name);\n $this->assertEquals('[email protected]', $userFromDb->email);\n }", "public function getUser($id = null);", "function user_get()\n {\n $id = $this->get('id');\n if ($id == '') {\n $user = $this->db->get('auth_user')->result();\n } else {\n $this->db->where('id', $id);\n $user = $this->db->get('auth_user')->result();\n }\n $this->response($user, 200);\n }", "public function testGetUserById()\n {\n // Insert a video into the DB, avoiding using the insert method as\n // its tests depends on us.\n $dbh = DB::getPDO();\n $stmt = $dbh->prepare(\n \"INSERT INTO user (email, name, password, type) \"\n . \"VALUES ('[email protected]', 'Some User', 'lmao', 'student');\"\n );\n $this->assertTrue($stmt->execute());\n\n // Get the inserted ID form the DB\n $this->id = $dbh->lastInsertId();\n\n $user = User::getById($this->id);\n\n $this->assertInstanceOf(User::class, $user);\n $this->assertEquals($this->id, $user->getId());\n\n $this->assertNull(User::getById(-1));\n }", "public function testGetUserById(){\n // Create a stub for the DataBaseManager class.\n $stub = $this->createMock(DataBaseManager::class);\n\n // Configure the stub.\n $response = [array(\n '0' => ['nombre' => 'Pepe Pecas']\n )];\n $stub->expects($this->once())\n ->method('realizeQuery')\n ->willReturn($response);\n\n //Asignamos el mock en el constructor de PuntajesManajer\n $puntajeManajer = UserManager::getInstance();\n $puntajeManajer->setDBManager($stub);\n\n //Creamos strings aleatorios\n $id = $this->generateNumber();\n\n //comparamos si la respuesta es vacía (devuelve \"\" en caso de ser boolean)\n $this->assertEquals(json_encode($response), $puntajeManajer->getUserById($id));\n }", "public static function get_user($user_id);", "public function user_get($id=0)\n\t{\n\n\t\t\t$data=$this->um->getData('users',$id);\n\t\t\tif (!empty($data)) {\n\t\t\t\t\n\t\t\t$this->response($data,RestController::HTTP_OK);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->response(['status'=>false,'message'=>'no data found'],RestController::HTTP_NOT_FOUND);\n\t\t\t}\n\t}", "function getUser($id){\n\t\t\tif($this->rest->getRequestMethod() != \"GET\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\t$user_data = $this->model->getUser('*',\"_id = \".\"'\".$id.\"'\");\n\t\t\t\tif(count($user_data)>0) {\n\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t$response_array['message']='Total '.count($user_data).' record(s) found.';\n\t\t\t\t\t$response_array['total_record']= count($user_data);\n\t\t\t\t\t$response_array['data']=$user_data;\n\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t} else {\n\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t$response_array['message']='Record not found.';\n\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t$this->rest->response($response_array, 204);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\n\t\t}", "function getUser($user, $id) {\n return $user->readByID($id);\n}", "public function testUserUserIDGet()\n {\n }", "public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>true,\n\t\t\t\t'message'=>'Id tidak ada'\n\t\t\t],200);\n\t\t}\n\n\t}", "function user() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id']; \n if ($id > 0) {\n $query = \"select * from users where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error . __LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('',406);\n }\n }", "function loaded_user(string $id): bool { return isset($this->users[$id]); }", "public function get_user($id) {\r\n $conn = $this->conn();\r\n $sql = \"SELECT * FROM register WHERE id = ?\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$id]);\r\n $user = $stmt->fetch();\r\n $result = $stmt->rowCount();\r\n\r\n if($result > 0 ){\r\n \r\n return $user;\r\n }\r\n\r\n \r\n }", "function getUserById( $user_id ) {\n global $mysqli;\n $select = \"SELECT * FROM `users` WHERE `id`=$user_id\";\n $results = $mysqli->query( $select );\n if( $results->num_rows === 1 ) {\n $user = $results->fetch_assoc();\n return $user;\n } else {\n return false;\n }\n}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "private function getUserById($id) {\n\t\t$em = $this->getDoctrine()->getManager()->getRepository('AppBundle\\Entity\\User');\n\n\t\t$user = $em->findOneById($id);\t\n\t\t\n\t\treturn $user;\n\t}", "public function check_id($id){\n $req = $this->pdo->prepare('SELECT * FROM users WHERE id = ?');\n $req->execute([$id]);\n $user = $req->fetch();\n return $user;\n }", "public function hasUser($id);", "public function testRefreshUserById_()\n {\n $user = $this->registerAndLoginTestingUser();\n\n $data = [\n 'user_id' => $user->id,\n ];\n\n // send the HTTP request\n $response = $this->apiCall($this->endpoint, 'post', $data);\n\n // assert response status is correct\n $this->assertEquals($response->getStatusCode(), '200');\n }", "function getUserID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from users where userid='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['userid'];\n\t}\n\n\t$crud->disconnect();\n}", "public function testCantGetUserById(){\n // Create a stub for the DataBaseManager class.\n $stub = $this->createMock(DataBaseManager::class);\n\n // Configure the stub.\n $response = null;\n $stub->expects($this->once())\n ->method('realizeQuery')\n ->willReturn($response);\n\n //Asignamos el mock en el constructor de PuntajesManajer\n $puntajeManajer = UserManager::getInstance();\n $puntajeManajer->setDBManager($stub);\n\n //Creamos strings aleatorios\n $id = $this->generateNumber();\n\n //comparamos si la respuesta es vacía (devuelve \"\" en caso de ser boolean)\n $this->assertEquals(\"Tabla usuario vacia\", $puntajeManajer->getUserById($id));\n }", "public static function getUserObjectFromId($id){\n $pdo = static::getDB();\n\n $sql = \"select * from users where user_id = :id\";\n\n $result = $pdo->prepare($sql);\n \n $result->execute([$id]);\n\n $user_array = $result->fetch(); \n\n if($user_array){\n if($user_array['USER_ROLE'] == Trader::ROLE_TRADER){\n return static::getTraderObjectFromEmail($user_array['EMAIL']);\n }\n return new User($user_array);\n }\n return false;\n }", "public function getUserId_always_returnCorrectly()\n {\n $this->assertEquals($this->user['user_id'], $this->entity->getUserId());\n }", "public static function getUserById($id)\n\t{\n\t\t$user = self::where('ID',$id)->first();\n\t\treturn $user;\n\t}", "public function testUserWithNoIDReturnsNull()\n {\n $id = '';\n $userService = new UserService($this->db);\n $returnedUser = $userService->retrieve($id);\n $this->assertNull($returnedUser, \"Did not return a null\");\n }", "function get_user_details($id)\n {\n $this->db->where('id', $id);\n\n $result = $this->db->get('member');\n\n if($result->num_rows() == 1){\n return $result->row(0);\n } else {\n return false;\n }\n }", "public function getUser($id) {\n foreach ($this->_users as $user) {\n if ($user->id == $id) return $user;\n }\n return false;\n }", "public function get_user($id) {\n $this->db->where('id', $id);\n $query = $this->db->get('users');\n \n return $query->row();\n }", "public function getUserIdWithUsername($id);", "public function getUser($userId);", "public function getUser($userId);", "function cicleinscription_get_user_by_id($userid){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('id'=>$userid));\n}", "public function testGetActiveUsersByUserId()\r\n {\r\n\t$activeUsersController = new ActiveUsersController();\r\n $activeJobs = $activeUsersController->GetActiveUserByUserId(38);\r\n \r\n require_once 'Model/UserModel.php';\r\n $userModel = new UserModel();\r\n $user = $userModel->GetUserById($activeJobs->userId);\r\n \r\n $this->assertEquals(\"a\",$user->username);\r\n }", "public function testGetInfoUser()\n {\n $id = 1;\n $this->json('GET', \"api/user/get-info/$id\", ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"data\" => [\n \"created_at\",\n \"email\",\n \"name\",\n \"id\",\n \"org_id\",\n \"updated_at\"\n ]\n ]);\n }", "public static function get($id){\n $result = mysqli_query(Connection::getConnection(), \"Select * from users where id = '{$id}'\");\n if(mysqli_num_rows($result) == 1) {\n $user = mysqli_fetch_assoc($result);\n return new User(\n $user['id'],\n $user['name'],\n $user['email'],\n $user['type'],\n $user['patchImage']);\n }\n return false;\n }", "function fetchUserAuthById($user_id){\n return fetchUserAuth('id', $user_id);\n}", "public function getUserByID()\n {\n $user = $this->usersController->getUserByID($_POST['id']);\n echo json_encode($user);\n return $user;\n }", "public function getEventOwnerUser($id)\n {\n $user = User::findOrFail($id);\n if(count($user) > 0){\n\n return $user;\n\n }else{\n\n return false;\n }\n\n }", "public function getUserInfo($id) \n { \n $q = $this->db->get_where('user', array('id_user' => $id), 1); \n if($this->db->affected_rows() > 0){ \n $row = $q->row(); \n return $row; \n }else{ \n error_log('no user found getUserInfo('.$id.')'); \n return false; \n } \n }", "public function getAllUserById($id);", "public function find($id)\n\t{\n // return $this->user->where('id', $id)->first();\n\t}", "protected function getUserId() {}", "protected function getUserId() {}", "public function testGetUserId()\n {\n $this->assertSame(1, $this->session->getUserId());\n }", "public function view_user($id)\n {\n\n\n }", "public function userShow($id){\n MyLogger::info(\"Entering RestController userShow()\");\n\n\n $user = $this->restService->getUser($id);\n $result = NULL;\n if ($user) {\n $result = new DTO(\"200\", \"User Found\", $user);\n } else {\n $result = new DTO(\"404\", \"No User Found\", NULL);\n }\n\n\n MyLogger::info(\"Exiting RestController userShow()\");\n\n return json_encode($result);\n }", "public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }", "function fetch_user_by_id($id) {\n if(!cache_isset('taxi_!uid_'.$id)) {\n if(cache_isset('taxi_uid_'.$id)) {\n return cache_get('taxi_uid_'.$id);\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['id'=>$id]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$id,$result);\n } else {\n cache_set('taxi_!uid_'.$id,true)\n }\n return $result;\n }\n }\n}", "abstract protected function getUserId() ;", "public function testFindUser()\n {\n $user = factory(User::class)->create();\n $found = User::query()->find($user->id);\n $this->assertNotEmpty($found);\n $this->assertEquals($user->id, $found->id);\n }", "public function getUserById($id){\n $query = $this->db->get_where('user', array('k_id_user' => $id));\n return $query->row();\n }", "function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n\n return $user;\n }", "public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\User\" );\n\t}", "public function get_user_by_id($user_id, $organization_id);", "function getUserById($id){\n\t\tglobal $db;\n\t\t$query = \"SELECT * FROM t_attendees WHERE id=\" . $id;\n\t\t$result = mysqli_query($db, $query);\n\t\t$user = mysqli_fetch_assoc($result);\n\t\treturn $user;\n\t}", "public function userbyid($id)\n {\n $sql=\"SELECT * FROM users where id='$id'\";\n\t $result = $this->db->query($sql);\n\t return $result->row();\n \n }", "public function GetById($id, $userId);", "public function get_user_id();", "public function findUser($userId);", "function find_user_by_id($id)\r\n{\r\n global $db;\r\n\r\n $q = $db->prepare('SELECT name, pseudo, email, city, country, twitter, github, \r\nfacebook, sex, available_for_hiring, bio FROM users WHERE id=?');\r\n $q->execute([$id]);\r\n\r\n $data = $q->fetch(PDO::FETCH_OBJ);\r\n\r\n $q->closeCursor();\r\n return $data;\r\n}", "public function findUserById()\n {\n $this->db->query('SELECT * FROM user WHERE id = :id');\n $this->db->bind(':id', $_SESSION['id']);\n \n $row = $this->db->single();\n \n return $row; \n }", "public function loadUserDetail($id) {\n \t$_user = new class_User();\n \n \t$user = $_user->getUserDetail($id);\n \n \treturn $user;\n }", "function getUserById($id) {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT * FROM users WHERE id = :id');\n // exécution\n $query -> execute(array(\n ':id' => $id\n ));\n // renvoie un tableau associatif\n return $query -> fetch();\n}", "public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}", "function get_user_by_ID($id){\n global $database;\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users WHERE ID = \" . $id;\n return $database->query( $query );\n}", "public function fetchUserByUserId($userId);", "public function findByID($id)\n {\n $i = $this->getInstance(); \n\n $result = $i->getSoapClient()\n ->setWsdl($i->getConfig('webservice.user.wsdl'))\n ->setLocation($i->getConfig('webservice.user.endpoint'))\n ->GetUser(array(\n 'UserId'=>array(\n 'Id'=>intval($id),\n 'Source'=>'Desire2Learn'\n )\n ));\n \n if ( $result instanceof stdClass && isset($result->User) && $result->User instanceof stdClass )\n {\n $User = new D2LWS_User_Model($result->User);\n return $User;\n }\n else\n {\n throw new D2LWS_User_Exception_NotFound('OrgDefinedId=' . $id);\n }\n }", "private function getUserFromId($userid)\n {\n $this->logger->info(\"\\Entering \" . substr(strrchr(__METHOD__, \"\\\\\"), 1));\n // Creates a user with the id\n $partialUser = new UserModel($userid, \"\", \"\", \"\", \"\", 0, 0);\n // Creates an account business service\n $bs = new AccountBusinessService();\n \n // Calls the bs getUser method\n // flag is either user or rows found\n $flag = $bs->getUser($partialUser);\n \n // If flag is an int, returns error page\n if (is_int($flag)) {\n $this->logger->info(\"/Exiting \" . substr(strrchr(__METHOD__, \"\\\\\"), 1) . \" to error view. Flag: \" . $flag);\n $data = [\n 'process' => \"Get User\",\n 'back' => \"home\"\n ];\n return view('error')->with($data);\n }\n \n $user = $flag;\n \n // Returns user\n $this->logger->info(\"/Exiting \" . substr(strrchr(__METHOD__, \"\\\\\"), 1) . \" with \" . $user);\n return $user;\n }", "public function show($id)\n {\n return user::find($id);\n }", "public function getItem( int $id ) {\n\t\treturn User::where( 'id', $id )->first();\n\t}", "function get_userdata($user_id)\n {\n }", "public function getUser($id) {\n $db = CTSQLite::connect();\n $results = $this->db->query('SELECT * FROM ic_user WHERE id=' . $id);\n if ($row = $results->fetchArray()) {\n return $row;\n } else {\n return false;\n }\n $db->close();\n unset($db);\n }", "function get_user_by_id($id) {\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"SELECT * FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $id\n ]);\n $user = $statement->fetch(PDO::FETCH_ASSOC);\n return $user;\n}", "public function byId($id)\n {\n $userClass = Config::get('jwt.user');\n $userAttribute = Config::get('jwt.identifier');\n $user = $userClass::where($userAttribute, $id)->first();\n if (!$user) {\n return false;\n }\n return $this->auth->setUser($user);\n }", "public function user_domain_get($id = 0)\n {\n //$this->verify_request(); \n if(!empty($id)){\n //$data = $this->db->get_where(\"offers\", ['id' => $id])->row_array();\n $data = $this->UserModel->getUserById($id);\n }else{\n //$data = $this->db->get(\"offers\")->result();\n $data = $this->UserModel->getUsers();\n }\n $status = parent::HTTP_OK;\n $response = ['status' => $status, 'data' => $data];\n $this->response($response, $status);\n }", "function getUserById($id) {\n\t$result = mysql_query(\"SELECT userId, email, password FROM users where userId = $id\");\n\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\n\tmysql_free_result($result);\n\treturn $row;\n}", "public function test_logged_in_user_show_info()\n {\n $user=User::factory()->create();\n //behavior as this created user\n $response=$this->actingAs($user)->get(route('auth.user'));\n\n $response->assertStatus(Response::HTTP_OK);\n }", "function getUserById(){\n\t \n\t $sql = \"SELECT * FROM users WHERE User_id=\" . $User_id;\n\t $req = Database::getBdd()->prepare($sql);\n\t \n\t return $req->execute($sql);\n}", "public function getUserById($id){\n // Query for the user.\n $this->db->query('SELECT * FROM users WHERE id = :id');\n // Bind the values.\n $this->db->bind(':id', $id);\n // Return the row. \n $row = $this->db->single();\n\n return $row;\n }", "function checkUserByUserID($user_id){\n\t\t$rec\t= $this->query(\"SELECT * from `users` where `id` = \".$user_id);\t\t\n\t\tif($rec && mysql_num_rows($rec) == 1){\n\t\t\t//if user with the user_name got found\n\t\t\treturn $rec;\n\t\t}else{\n\t\t\t//if user with the user_name got not found\n\t\t\treturn false;\n\t\t}\n\t}", "public function test_it_returns_a_single_user()\n {\n $user = User::create(['email' => '[email protected]', 'given_name' => 'Andrew', 'family_name' => 'Hook']);\n\n $response = $this->call('GET', '/users/1');\n\n $this->assertEquals(200, $response->status());\n $this->assertJsonStringEqualsJsonString($user->toJson(), $response->getContent());\n }", "static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}", "public function show($id)\n {\n return response()->responseUtil(User::where('id', $id)->with('authorities.types')->first(['id', 'name', 'realName', 'openId', 'nickName', 'avatarUrl', 'cellphone', 'officephone', 'regTime', 'email']));\n }", "private function _fetch_user($id = FALSE) {\n // fetch data of user\n $this->load->model('user_model');\n $user_id = $id === FALSE ? $this->session->userdata('user')['id'] : $id;\n $where = array('id' => $user_id);\n $user = $this->user_model->fetch($where);\n return $user ? $user[0] : FALSE;\n }", "public function getUserByID($id)\n {\n return $this->db->get_where('inm_user', array('id' => $id));\n }", "public function findById($idUser)\n {\n }", "public function user($id)\n {\n return $this->where('user_id', $id);\n }", "private function getUser($id)\n {\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/users/\".$id;\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/users/\".$id;\n \n $response = $this->curl_get($url);\n //echo \"\\n-------getProject Response:\".$response;\n //$result = json_decode($response);\n \n return $response;\n }", "function get_user_by_id($id) {\r\n\t\t$query = $this->db->query('SELECT user_fname, user_lname, user_email\r\n\t\t\t\t\t\t\t\t\tFROM user\r\n\t\t\t\t\t\t\t\t\tWHERE user_id = '.$id.'');\r\n\t\treturn $query->result();\r\n\t}", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "public function hasUserId(){\n return $this->_has(2);\n }", "function getUserById($id){\n\tglobal $conn;\n\t$query = \"SELECT * FROM users WHERE id=\" . $id;\n\t$temp_result = mysqli_query($conn, $query);\n\n\t$user = mysqli_fetch_assoc($temp_result);\n\treturn $user;\n}" ]
[ "0.7597465", "0.74565214", "0.72704464", "0.71516305", "0.7119315", "0.706494", "0.69770855", "0.69286966", "0.6892476", "0.6888279", "0.6878383", "0.6874488", "0.6857269", "0.6808128", "0.6787887", "0.6736203", "0.66571504", "0.65870255", "0.658698", "0.65866864", "0.65803856", "0.65596074", "0.6547087", "0.65402853", "0.6523421", "0.6520914", "0.6516027", "0.6515216", "0.65103275", "0.64965886", "0.6491362", "0.6472866", "0.64679706", "0.645862", "0.64416045", "0.64416045", "0.6440153", "0.64202493", "0.64185995", "0.64106166", "0.64098424", "0.6406971", "0.6404896", "0.63989556", "0.639889", "0.63925135", "0.6386553", "0.6386553", "0.63860095", "0.63849586", "0.638183", "0.63787174", "0.6368388", "0.6367222", "0.6364784", "0.6358251", "0.6353936", "0.635346", "0.63382256", "0.63365626", "0.6329582", "0.6327768", "0.6326027", "0.6323921", "0.63101053", "0.6306605", "0.63048816", "0.6304202", "0.63027316", "0.6300116", "0.6296175", "0.62952095", "0.6291914", "0.62874526", "0.6284475", "0.62835157", "0.62824214", "0.628178", "0.627555", "0.627511", "0.62725097", "0.62689006", "0.6267427", "0.6264976", "0.6263928", "0.6263286", "0.6258165", "0.62558925", "0.6253701", "0.62519145", "0.62499905", "0.6248572", "0.6247975", "0.6245528", "0.624478", "0.624478", "0.624478", "0.624478", "0.624478", "0.623996" ]
0.80939585
0
Testing the user search
public function testSearchUser() { echo "\nTesting user search..."; //$url = TestServiceAsReadOnly::$elasticsearchHost . "/CIL_RS/index.php/rest/users?search=Vicky"; $url = TestServiceAsReadOnly::$elasticsearchHost . $this->context."/users?search=Vicky"; $response = $this->curl_get($url); //echo "\n-------Response:".$response; $result = json_decode($response); $total = $result->hits->total; $this->assertTrue(($total > 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }", "public function search(){}", "public abstract function find_users($search);", "public function search();", "public function search();", "public function testSearchAndFilterUser()\n {\n $user = factory(User::class)->create([\n 'email' => 'test@test',\n 'type' => 1\n ]);\n Passport::actingAs($user);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertArraySubset([\n 'email' => 'test@test'\n ], $data[0]);\n\n $data = $this\n ->json(\n 'GET',\n 'api/users?term=test&filter[type]=2'\n )\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [],\n ])\n ->json('data');\n\n $this->assertTrue(empty($data));\n }", "public function testSearchAdminsSuccessful()\n {\n $this -> withoutMiddleware();\n\n // Create users\n $this -> createUser($this -> userCredentials);\n $this -> createUser($this -> userCredentials2);\n $this -> createUser($this -> userCredentials3);\n\n $user = User::where('email',$this -> userCredentials)->first();\n $token = JWTAuth::fromUser($user);\n JWTAuth::setToken($token);\n\n // Search for users that exists\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJson([\n 'email' => $this ->userCredentials[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials2[\"email\"]\n ]);\n $this -> dontSeeJson([\n 'email' => $this ->userCredentials3[\"email\"]\n ]);\n\n // Search for user that does not exist\n $this -> call('GET','api/classes/admins/search',['string' => '[email protected]']);\n $this -> seeJson([]);\n }", "function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }", "function test_field_specific_search_on_user_id_field() {\n\n\t\t// Username. Three matching entries should be found.\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. Three matching entries should be found.\n\t\t$search_string = '1';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. No matching entries should be found.\n\t\t$search_string = '7';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}", "public function search()\n\t{\n\t\t\n\t}", "public function testDatabaseSearch()\n {\n \t//finding Bowen in database (first seeded user)\n $this->seeInDatabase('users',['firstName'=>'Bowen','email'=>'[email protected]','admin'=>1]);\n\n //finding Hiroko in database (last seeded user)\n $this->seeInDatabase('users',['firstName'=>'Hiroko','email'=>'[email protected]','admin'=>1]);\n\n //check that dummy user is NOT in database\n $this->notSeeInDatabase('users',['firstName'=>'Jon Bon Jovi']);\n\n\t\t//find first Category in the database\n\t\t$this->seeInDatabase('Category',['name'=>'Physics']);\n\t\t\n //find last Category in the database\n $this->seeInDatabase('Category',['name'=>'Other']);\n\n }", "public function testSearchUsingGET()\n {\n\n }", "public function test_search()\n {\n Task::create([\n 'user_id' => 1,\n 'task' => 'Test Search',\n 'done' => true,\n ]);\n\n Livewire::test(Search::class)\n ->set('query', 'Test Search')\n ->assertSee('Test Search')\n ->set('query', '')\n ->assertDontSee('Test Search');\n }", "function test_general_entries_search_on_frm_items_user_id() {\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string );\n\t\t$msg = 'A general search for ' . $search_string . ' in entries table';\n\t\tself::run_entries_found_tests( $msg, $items, 4, array( 'steph_entry_key', 'steve_entry_key', 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\t}", "function search() {}", "public function search()\n {\n $user = User::search('');\n dd($user);\n dd(request('keyword'));\n return ResponseHelper::createSuccessResponse([], 'Operation Successful');\n }", "public function testSearchCanBeDone()\n {\n $this->visit('/')\n ->type('name', 'query')\n ->press('Go!')\n ->seePageIs('/search?query=name')\n ->see('Results');\n }", "function searchAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$inData = $this->getInputManager()->doFilter();\n\t\t$this->addInputToModel($inData, $this->getModel());\n\t\t$oView = new userView($this);\n\t\t$oView->showSearchLeaderboard();\n\t}", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "public function test_admin_search_keyword()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/SearchResult', 'index']);\n $this->assertResponseCode(404);\n }", "public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }", "public function search()\n {\n\n }", "public function search()\n {\n\n }", "public function userSearch()\n {\n $query = $this->input->post('query');\n $data['results'] = $this->admin_m->search($query);\n $data['query'] = $query;\n $data['content'] = 'admin/searchResults';\n $this->load->view('components/template', $data);\n }", "public function testSearch() {\n\t\t$operacionBusqueda = new Operacion;\n\t\t$operacionBusqueda->nombre = 'Radicado';\n\t\t$operacions = $operacionBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $operacions ), 1 );\n\t}", "public function searchUsers(){\n\t\t$validator = Validator::make(Request::all(), [\n 'accessToken' => 'required',\n 'userId' => 'required',\n 'searchUser' => 'required',\n 'searchOption' => 'required'\n ]);\n if ($validator->fails()) {\n #display error if validation fails \n $this->status = 'Validation fails';\n $this->message = 'arguments missing';\n } else {\n \t$siteUrl=URL::to('/');\n\t\t\t$result=Request::all();\n\t\t\t$accesstoken = Request::get('accessToken');\n\t $user_id = Request::get('userId');\n\t\t\t$user_info = User::find($user_id);\n\t\t\tif(isset($user_info)){\n\t\t\t\t$user_id = $user_info->id;\n\t\t\t\t$location = $user_info->location;\t\n\t\t\t}else{\n\t\t\t\t$user_id = 0;\n\t\t\t\t$location = '';\n\t\t\t}\n\t\t\t$searchresult = array();\n\t\t\t$start =0; $perpage=10;\n\t\t\tif(!empty($user_info)){\n\t\t\t\tif($accesstoken == $user_info->site_token){\n\t\t\t\tif(!empty($result)) \n\t\t\t\t{\n\t\t\t\t\t$search = Request::get('searchUser');\n\t\t \t$searchOption = Request::get('searchOption');\n\t\t\t\t\tif($searchOption == 'People'){\n\t\t\t\t\t $searchqueryResult =User::where('id','!=',$user_id)->where('fname', 'LIKE', '%'.$search.'%')->orWhere('lname','LIKE', '%'.$search.'%')->orWhere('location','LIKE', '%'.$search.'%')->orWhere('summary','LIKE', '%'.$search.'%')->orWhere('headline','LIKE', '%'.$search.'%')->where('userstatus','=','approved')->orderBy('karmascore','DESC')->get();\n\t\t\t\t\t\tif(!empty($searchqueryResult)){\n\t\t\t\t\t \t\tforeach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t\t$receiver=$value->id;\n\t\t\t\t\t \t\t\t$receiverDetail = User::find($receiver);\n\t\t\t\t\t \t\t\t$meetingRequestPending = $receiverDetail->Giver()->Where('status','=','pending')->count();\n\t\t\t\t\t \t\t\t$commonConnectionData=KarmaHelper::commonConnection($user_id,$value->id);\n\t\t\t\t\t \t\t\t$getCommonConnectionData=array_unique($commonConnectionData);\n\t\t\t\t\t \t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\t\t$searchquery[$key]['meetingRequestPending']=$meetingRequestPending;\n\t\t\t\t\t \t\t\t$searchquery[$key]['noofmeetingspm']=$value->noofmeetingspm;\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t}\n\t\t\t\t\t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t\t\t\t\t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}elseif($searchOption == 'Skills'){\n\t\t\t\t\t\t$skillTag = array(); \n\t\t \t \t$searchqueryResult = DB::table('tags')\n\t\t\t\t\t ->join('users_tags', 'tags.id', '=', 'users_tags.tag_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_tags.user_id')\n\t\t\t\t\t ->where('name', 'LIKE', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id', '!=', $user_id)\t\t\t \n\t\t\t\t\t ->groupBy('users_tags.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('tags.name', 'tags.id', 'users_tags.user_id', 'users.fname', 'users.lname','users.karmascore', 'users.email', 'users.piclink', 'users.linkedinid', 'users.linkedinurl', 'users.location', 'users.headline')\n\t\t\t\t\t //->skip($start)->take($perpage)\n\t\t\t\t\t ->get();\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t\t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['email']=$value->email;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t\t\t\t foreach ($searchquery as $key => $value) {\n\t\t\t\t\t\t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($value->user_id)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\t\t\t\n\t\t\t\t\t\t\t\tforeach ($tags as $skillkey => $skillvalue) {\n\t\t\t \t \t\t\t$skillTag[$skillkey]['name'] = $skillvalue->name;\n\t\t\t \t \t\t}\n\t\t\t\t\t\t\t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $skillTag;\n\t\t\t \t \t\t//echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \t\t}\t\n\t\t \t \t\t\n\t\t \t \t\t\n\t\t \t \t}\n\t\t \t}elseif($searchOption == 'Location'){\n\t\t\t\t\t\t$searchqueryResult = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`karmascore`, `users`.`headline`, `users`.`location`, `users`.`id` As user_id from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where location LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where location LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location limit 10 offset '.$start )); \t\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n\t\t\t\t\t \t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t\t\t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t if(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Groups'){\t\t\t\t\n\t\t\t\t\t\t$searchqueryResult = DB::table('groups')\n\t\t\t\t\t ->join('users_groups', 'groups.id', '=', 'users_groups.group_id')\n\t\t\t\t\t ->join('users', 'users.id', '=', 'users_groups.user_id')\n\t\t\t\t\t ->where('name', '=', $search)\n\t\t\t\t\t ->where('users.userstatus', '=', 'approved')\n\t\t\t\t\t ->where('users.id','<>',$user_id)\t\n\t\t\t\t\t ->groupBy('users_groups.user_id')\n\t\t\t\t\t ->orderBy('users.karmascore','DESC')\n\t\t\t\t\t ->select('groups.name', 'groups.id', 'users_groups.user_id', 'users.fname', 'users.lname', 'users.email', 'users.piclink', 'users.linkedinid', 'users.karmascore', 'users.location', 'users.headline')\n\t\t\t\t\t ->get();\n\t\t\t\t\t // print_r($searchqueryResult);die;\n\t\t\t\t\t foreach ($searchqueryResult as $key => $value) {\n \t\t\t\t\t\t$commonConnectionDataCount=KarmaHelper::commonConnection($user_id,$value->user_id);\n \t\t\t\t\t\t$getCommonConnectionData=array_unique($commonConnectionDataCount);\n \t\t\t\t\t\t$commonConnectionDataCount=count($getCommonConnectionData);\n\t\t\t\t\t \t$searchquery[$key]['name']=$value->name;\n\t\t\t\t\t \t$searchquery[$key]['id']=$value->id;\n\t\t\t\t\t \t\t$searchquery[$key]['user_id']=$value->user_id;\n\t\t\t\t\t \t\t$searchquery[$key]['fname']=$value->fname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['lname']=$value->lname;\n\t\t\t\t\t \t\t\t$searchquery[$key]['karmascore']=$value->karmascore;\n\t\t\t\t\t \t\t\t$searchquery[$key]['location']=$value->location;\n\t\t\t\t\t \t\t\t$searchquery[$key]['headline']=$value->headline;\n\t\t\t\t\t \t\t\t$searchquery[$key]['piclink']=$value->piclink;\n\t\t\t\t\t \t\t\t$searchquery[$key]['linkedinid']=$value->linkedinid;\n\t\t\t\t\t \t\t\t$dynamic_name=$value->fname.'-'.$value->lname.'/'.$value->user_id;\n\t\t\t\t\t\t\t\t$public_profile_url=$siteUrl.'/profile/'.$dynamic_name;\n\t\t\t\t\t \t\t\t$searchquery[$key]['publicUrl']=$public_profile_url;\n\t\t\t\t\t \t\t\t$searchquery[$key]['connectionCount']=$commonConnectionDataCount;\n\t\t\t\t\t \t\n\t\t\t\t\t }\n\t\t\t\t\t // echo \"<pre>\";print_r($searchquery);echo \"</pre>\";die;\n\t\t \t \tif(empty($searchquery)){\n\t\t\t\t\t \t\t$searchquery=array();\n\t\t\t\t\t \t}\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value['linkedinid'];\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}\n\t\t\t\t\telseif($searchOption == 'Tags'){\n\t\t\t\t\t\t$searchquery = DB::select(DB::raw( 'select * from (select `users`.`fname`, `users`.`lname`, `users`.`piclink`, `users`.`linkedinid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`linkedinurl`, `users`.`headline`, `users`.`location`, `users`.`id` from \n\t\t\t\t\t\t\t\t\t\t\t\t`users` where headline LIKE \"%'.$search.'%\" and `users`.`id` != '.$user_id.' and\n\t\t\t\t\t\t\t\t\t\t\t\t `users`.`userstatus` = \"approved\" union select `connections`.`fname`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`lname`, `connections`.`piclink`, `connections`.`networkid`,\n\t\t\t\t\t\t\t\t\t\t\t\t `connections`.`linkedinurl`, `connections`.`headline`, `connections`.`location`,\n\t\t\t\t\t\t\t\t\t\t\t\t `users_connections`.`connection_id` from `connections`\n\t\t\t\t\t\t\t\t\t\t\t\t inner join `users_connections` on `connections`.`id` = `users_connections`.`connection_id`\n\t\t\t\t\t\t\t\t\t\t\t\t where headline LIKE \"%'.$search.'%\" and `users_connections`.`user_id` = '.$user_id.') as \n\t\t\t\t\t\t\t\t\t\t\t\tresult group by result.linkedinid order by result.location = \"'.$location.'\" desc limit 10 offset'.$start )); \t\n\t\t\t\t\t //echo \"<pre>\";print_r($searchresult);echo \"</pre>\";die;\n\t\t \t \tforeach ($searchquery as $key => $value) {\n\t\t \t \t\t$linkedinid = $value->linkedinid;\n\t\t \t \t\t$linkedinUserData = DB::table('users')->where('linkedinid', '=', $linkedinid)->select('id','fname','lname','location','piclink','karmascore','headline','email')->first();\n\t\t \t \t\tif(!empty($linkedinUserData)){\n\t\t\t \t \t\t$tags = DB::select(DB::raw( \"select `name` from `tags` inner join `users_tags` on `tags`.`id` = `users_tags`.`tag_id` where `user_id` = $linkedinUserData->id order by `tags`.`name` = '$search' desc\" ));\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = array();\n\t\t\t \t \t\t$searchresult[$key]['Tags'] = array();\n\t\t\t \t \t\t$searchresult[$key]['UserData'] = $linkedinUserData;\n\t\t\t \t \t\t//$searchresult[$key]['Tags'] = $tags;\n\t\t \t \t\t}\t\n\t\t \t \t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Failure';\n\t\t\t\t\t\t$this->message='There is no such category';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message\n\t\t\t\t \t\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\tif(!empty($searchquery)){\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->status='Success';\n\t\t\t\t\t\t$this->message='There is no data available';\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t \t'status'=>$this->status,\n\t\t\t\t \t'message'=>$this->message,\n\t\t\t\t \t'searchresult'=>$searchquery\n\t\t\t\t \t));\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//return $searchresult;exit;\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->status = 'Failure';\n\t \t$this->message = 'You are not a login user.';\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->status = 'Failure';\n \t$this->message = 'You are not a current user.';\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn Response::json(array(\n\t\t\t \t'status'=>$this->status,\n\t\t\t \t'message'=>$this->message\n\t\t));\t\n\t\t\t\n\t}", "function search()\n\t{}", "function search()\n\t{}", "public function testSearchAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria 100 contatos\n $contacts = factory(Contact::class, 100)->make()->each(function ($contact) use ($user) {\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n });\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->get('/api/v1/contacts/search/a');\n\n $response->assertStatus(200);\n }", "function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}", "public function testSearch() {\n\t\t$temaBusqueda = new Tema;\n\t\t$temaBusqueda->nombre = 'Queja';\n\t\t$temas = $temaBusqueda->search();\n\t\t\n\t\t// valida si el resultado es mayor o igual a uno\n\t\t$this->assertGreaterThanOrEqual( count( $temas ), 1 );\n\t}", "public function testSearch()\n {\n $this->clientAuthenticated->request('GET', '/product/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "function testSearchByCustomField() {\n\t\t$this->setUrl('/search/advanced?r=per&q[per_900][op]=IS&q[per_900][value]=200');\n\t\t$this->app->go();\n\t\t$this->assertFalse(Flash::Instance()->hasErrors());\n\t\t$this->assertPattern('/id=\"qb_per_900\"/', $this->view->output);\n\t\t$this->assertPattern('/<th>Favourite Colour<\\/th>/', $this->view->output);\n\t\t$this->assertPattern('/<td>Green<\\/td>/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('David Edwards'));\n\t}", "public function post_search(){\n\n\t\t$income_data \t\t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$data \t\t\t\t= \tarray();\n\t\t$data[\"page\"] \t\t= \t'admin.users.search';\n\t\t$data[\"listing_columns\"] = static::$listing_fields;\n\t\t$data[\"users\"] \t\t= \tarray();\n\n\t\tif($income_data[\"value\"] && $income_data[\"field\"]){\n\n\t\t\t$type = (in_array($income_data[\"type\"], array('all', 'equal', 'like', 'soundex', 'similar'))) ? $income_data[\"type\"] : 'all';\n\t\t\t$type = ($type == 'equal') ? '=' : $type;\n\n\t\t\tif($type == 'all'){\n\t\t\t\t\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], 'like', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'soundex', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'similar', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], $type, $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t}\n\n\n\t\t\tif(Admin::check() != 777 && $data[\"users\"]){\n\t\t\t\t\n\t\t\t\tforeach($data[\"users\"] as $row => $column) {\n\n\t\t\t\t\tif(isset($column->email)){\n\n\t\t\t\t\t \tlist($uemail, $domen) \t\t\t= \texplode(\"@\", $column->email);\n\t\t\t\t\t\t$data[\"users\"][$row]->email \t= \t\"******@\".$domen;\n\t\t\t\t\t\t$data[\"users\"][$row]->name \t\t= \t\"***in\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!$data[\"users\"]){\n\n\t\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_result'));\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_request'));\n\t\t}\n\n\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('admin.assets.no_ajax', $data);\n\t}", "public function search($search);", "private function searchMembers() {\n $searchStr = $this->postVars['memberSearch'];\n $searchStrArr = array();\n if(preg_match('/\\s/',$searchStr)) {\n $searchStrArr = explode(\" \", $searchStr);\n }\n \n if(empty($searchStrArr)) {\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n WHERE u.user_email = '$searchStr'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id AND n.nhc_pin = '$searchStr'\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%$searchStr%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%$searchStr%'\";\n //JOIN {$this->db->prefix}usermeta um4 ON um4.user_id = u.id AND um4.meta_key = 'expiration_date' AND um4.meta_value = '$expireDate'\";\n }\n else { // looking specifically for a full name\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%{$searchStrArr[0]}%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%{$searchStrArr[1]}%'\";\n \n }\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n // filter through to weed out any duplicates\n $showArr = array();\n foreach($membersArr as $member) {\n if(!in_array($member['id'], $showArr)) {\n $showArr[] = $member['id'];\n }\n }\n $idStr = implode(\",\", $showArr);\n \n $query = \"SELECT DISTINCT u.id, n.nhc_pin, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email, um3.meta_value AS level\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um3 ON um3.user_id = u.id AND um3.meta_key = 'member_level'\n WHERE u.id IN ($idStr)\n ORDER BY n.nhc_pin\";\n \n $this->showResults($query, 'search', true);\n }", "public function getSearch();", "public function testFindUsers()\n {\n\n }", "public function searchReader()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t\t\t//$return = array();\n\t\t\t$book = D('User');\n\n\t\t\t$sql = \"SELECT * FROM lib_user\n\t\t\t\t\t where {$type} like '%{$text}%' ORDER BY register_time DESC;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No Result'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}", "public function testSearchBy(): void\n {\n// $model::query();\n }", "public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }", "public function actionSearch(){\n $q = htmlentities($_GET['q']);\n if(!empty($q)){\n $result = array();\n $users = Users::find()->where('display_name LIKE \"'.$q.'%\" AND active = 1 AND authKey IS NULL')->limit(5)->all();\n $ul = '<ul class=\"search-results-ul col-md-3\">';\n foreach ($users as $key => $value) {\n $ul .= '<li><a href=\"' . Url::to(['user/profile/'.$value->display_name]) . '\"><img src=\"' . \\Yii::getAlias('@web/images/users/'.$value->profilePic) . '\" height=\"30\" class=\"img-circle\" style=\"margin-right: 10px\"> '.$value->display_name.'</a></li>';\n }\n $ul .= '</ul>';\n echo $ul;\n }\n }", "function search() {\n // ...\n }", "public function search() {\n // without an entry we just redirect to the error page as we need the entry to find it in the database\n if (!isset($_POST['submit-search']))\n return call('pages', 'error');\n \n //try{\n // we use the given entry to get the correct post\n $userentry = filter_input(INPUT_POST,'search', FILTER_SANITIZE_SPECIAL_CHARS);\n $results = Search::find($_POST['search']);\n require_once('views/pages/SearchResults.php');\n //}\n //catch (Exception $ex){\n // $ex->getMessage();\n // return call('pages','error');\n }", "public function search($query);", "public function testFilters_noResults()\n {\n $users = $this->_mockUserAccess();\n $users->Auth\n ->staticExpects($this->at(1))\n ->method('user')\n ->with('group_id')\n ->will($this->returnValue(2));\n\n $users->Auth\n ->staticExpects($this->at(2))\n ->method('user')\n ->with('id')\n ->will($this->returnValue(2));\n $this->testAction(\"/users/index?filter_operator=all&filter_param%5B1%5D%5B1%5D=username&filter_param%5B1%5D%5B2%5D=start-with&filter_param%5B1%5D%5B3%5D=o\");\n $this->assertEquals($this->vars['users'], array());\n }", "public function testSearchRoles()\n {\n }", "public function test_searchName() {\n\t\t$this->testAction('/disease/search/Acute%20tubular%20necrosis', array('method' => 'get'));\n\t\t$returnedDisease = $this->vars['diseases']['Disease'];\n\n\t\t$this->assertEquals(1, count($this->vars['diseases']));\n\t}", "public function searchUser_post()\n\t{\n\t\t$tokenData = validateAuthorizationToken($this->input->get_request_header('Authorization'));\n\t\tif($tokenData[\"status\"]) {\n\t\t\t$userId = $tokenData[\"data\"][\"userId\"];\n\t\t\t$user = $this->UserModel->getUserById($userId); // i dati dell'utente.\n\t\t\tif(count($user) <= 0) // utente non trovato con questo id\n\t\t\t\treturn $this->response(buildServerResponse(false, \"Token di accesso non valido. #5\"), 200);\n\n\t\t\t$searchQuery = $this->input->post('query');\n\t\t\t$result = $this->UserModel->searchUser($searchQuery, $userId);\n\t\t\treturn $this->response(buildServerResponse(true, \"ok\", array(\"searchResult\" => $result)));\n\t\t}\n\t\treturn $this->response(buildServerResponse(false, \"Errore autorizzazione.\"), 200);\n\t}", "public function userSearch (Request $request)\n { $user = User::find(Auth::id());\n \n if($request->search != null){\n $search = family::ilike($request->search);\n \n return response()->json($search);\n }\n }", "function is_search()\n {\n }", "public function testSearch()\n {\n //Search on name\n $this->clientAuthenticated->request('GET', '/invoice/search/name');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Search with dateStart & dateEnd\n $this->clientAuthenticated->request('GET', '/invoice/search/2018-01-20/2018-01-21');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n }", "public function postSearchUsers()\n {\n \n \n $q = Input::get('q');\n $f = User::where( 'name' , 'LIKE' , '%'.$q.'%' )->get();\n \n return Response::json( $f );\n \n }", "public function is_search()\n {\n }", "public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }", "public function testSearchAdminWithoutToken()\n {\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }", "public function search_user(Request $request){\n $search = $request->input('term');\n $users = User::where('name', 'like' , \"%$search%\")\n ->orwhere('username', 'like', \"%$search%\")\n ->get();\n return response()->json($users, 200);\n }", "public function test_searchByPage() {\n\n }", "public function testSearchFindTitle()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->waitForText('Buscar:')\n ->keys(\"input[type='Search']\", 'super')\n ->waitForText('Exibindo 1 até 2 de 2 registros')\n ->assertSee('Batman vs Superman: A Origem da Justiça')\n ->assertSee('Dragon Ball Super: Broly');\n });\n }", "public function searchUser(){\n $this->validate(request(),[\n 'name' => 'required'\n ]);\n $users =User::where('name',request('name'))->orWhere('name', 'like', '%' . request('name') . '%')->get();\n return response()->json($users);\n }", "function testPartialSearch(): void\n {\n // Serpico\n // https://imdb.com/find?s=all&q=serpico\n\n $data = engineSearch('Serpico', 'imdb');\n // $this->printData($data);\n\n foreach ($data as $item) {\n $t = strip_tags($item['title']);\n $this->assertEquals($item['title'], $t);\n }\n }", "public function search()\n {\n if (!$this->current_user->has_permission('USER_LIST')) {\n return redirect();\n }\n\n $view_data = [\n 'menu_active' => 'li_user'\n ];\n\n $pagination = [\n 'page' => (int) $this->input->get_or_default('p', 1),\n 'limit' => (int) $this->input->get_or_default('limit', PAGINATION_DEFAULT_LIMIT)\n ];\n\n $pagination['offset'] = ($pagination['page'] - 1) * $pagination['limit'];\n\n // Get list users\n $users = $this->_api('user')->search_list(array_merge($this->input->get(), [\n 'limit' => $pagination['limit'],\n 'offset' => $pagination['offset'],\n 'sort_by' => 'id',\n 'sort_position' => 'desc'\n ]), [\n 'with_deleted' => TRUE,\n 'point_remain_admin' => TRUE\n ]);\n\n if (isset($users['result'])) {\n $view_data['users'] = $users['result']['items'];\n $pagination['total'] = $users['result']['total'];\n }\n\n $view_data['search'] = $pagination['search'] = $this->input->get();\n $view_data['pagination'] = $pagination;\n $view_data['csv_download_string'] = '/user/download_csv?' . http_build_query($this->input->get());\n\n $this->_breadcrumb = [\n [\n 'link' => '/user/search',\n 'name' => 'ユーザー検索'\n ]\n ];\n\n return $this->_render($view_data);\n }", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "public function action_search_member()\n\t{\n\t\tglobal $context;\n\n\t\t// @todo once Action.class is changed\n\t\t$_REQUEST['sa'] = 'query';\n\n\t\t// Set the query values\n\t\t$this->_req->post->sa = 'query';\n\t\t$this->_req->post->membername = un_htmlspecialchars($context['search_term']);\n\t\t$this->_req->post->types = '';\n\n\t\t$managemembers = new ManageMembers(new EventManager());\n\t\t$managemembers->setUser(User::$info);\n\t\t$managemembers->pre_dispatch();\n\t\t$managemembers->action_index();\n\t}", "public function testPostVoicemailSearch()\n {\n }", "public function testFindBy() {\n\t\t\tforeach($this->users as $user) {\n\t\t\t\t$_user = User::find_by(array('conditions' => \"name = '\" . $user . \"'\"));\n\t\t\t\t$lamda = call_user_func(strtolower($user));\n\t\t\t\t//lots of redudent checking here to make sure the lamda function is also returning the right data\n\t\t\t\t$this->assertEquals($lamda->name, $_user->name);\n\t\t\t\t$this->assertEquals($user, $lamda->name);\n\t\t\t\t$this->assertEquals($user, $_user->name);\n\t\t\t\t$this->assertEquals($lamda, $_user);\n\t\t\t}\n\t\t}", "public function testGetVoicemailSearch()\n {\n }", "public function searchQueryDataProvider() {}", "public function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t$data_rows=get_role_manage_table_data_rows($this->Role->search($search),$this);\n\t\techo $data_rows;\n\t}", "public function WP_User_Search($search_term = '', $page = '', $role = '')\n {\n }", "function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}", "private function getSearch() {\n\t\tif( $_SESSION['privilege'] != 'anon' ) {\n\n\t\t\t// If NOT anon then IS logged in so set userID to SESSION['id'] \n\t\t\t$userID = $_SESSION['id'];\n\n\t\t} else {\n\t\t\t\n\t\t\t// For this function default $userID to non-exitent user # 0 \n\t\t\t$userID = 0;\n\n\t\t}\n\n\t\t// Set search term per input OR blank\n\n\t\tif( !isset($_POST['search'])) {\n\t\t\t$_POST['search'] = \"\";\n\t\t}\n\t\t\n\t\tif(strlen($_POST['search']) === 0) {\n\t\t\t$searchTerm = \"\";\n\n\t\t} else {\n\t\t\t$result = $_POST['search'];\n\t\t\t$searchTerm = strtolower($result);\n\t\t}\n\n\t\t$this->data['searchTerm'] = $searchTerm;\n\n\t\t$sql = \"SELECT posts.id, title AS score_title, intro AS score_intro, article AS score_article\n\t\t\tFROM posts\n\t\t\tWHERE\n\t\t\t\t(title LIKE '%$searchTerm%' OR \n\t\t\t\tintro LIKE '%$searchTerm%' OR\n\t\t\t\tarticle LIKE '%$searchTerm%')\";\n\n\t\tif( $_SESSION['privilege'] != 'admin' ) {\n\n\t\t\t$sql .= \" AND (user_id = $userID\n\t\t\t\t\tOR status = 'Approved')\t\n\t\t\t\t\tORDER BY score_title ASC\";\n\t\t\n\t\t} else {\n\n\t\t\t$sql .= \" ORDER BY score_title ASC\";\t\n\n\t\t}\t\t\n\t\n\t\t$result = $this->dbc->query($sql);\n\n\t\tif( !$result || $result->num_rows == 0) {\n\t\t\t$this->data['searchResults'] = \"No results\";\n\t\t} else {\n\t\t\t$this->data['searchResults'] = $result->fetch_all(MYSQLI_ASSOC);\n\t\t}\n\t}", "public function search($q);", "function userSearch($query, $count = null) {\n\n \t$user_search_request_url = sprintf($this->api_urls['user_search'], $query, $this->access_token, $count);\n \t\n \treturn $this->__apiCall($user_search_request_url);\n \t\n }", "public function testSearchRolesWithUserCount()\n {\n }", "function testSearch2(): void\n {\n // Das Streben nach Glück | The Pursuit of Happyness\n // https://www.imdb.com/find?s=all&q=Das+Streben+nach+Gl%FCck\n\n Global $config;\n $config['http_header_accept_language'] = 'de-DE,en;q=0.6';\n\n $data = engineSearch('Das Streben nach Glück', 'imdb', false);\n $this->assertNotEmpty($data);\n\n $data = $data[0];\n // $this->printData($data);\n\n $this->assertEquals('imdb:0454921', $data['id']);\n $this->assertMatchesRegularExpression('/Das Streben nach Glück/', $data['title']);\n }", "public function testSearchDefault()\n {\n $guid = 'TestingGUID';\n $count = 105;\n $pageSize = 100;\n\n $apiResponse = APISuccessResponses::search($guid, $count, $pageSize);\n\n $container = [];\n $sw = $this->createMockedSmartwaiver($container, $apiResponse);\n\n $search = $sw->search();\n\n $this->assertEquals($guid, $search->guid);\n $this->assertEquals($count, $search->count);\n $this->assertEquals(2, $search->pages);\n $this->assertEquals(100, $search->pageSize);\n\n $this->checkGetRequests($container, ['/v4/search']);\n }", "public function searchUsersByQuery($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function search() {\n if (!Request::get('s')) {\n return view('home.layout');\n }\n\n SearchHistory::record_user_search(\n Request::get('s'),\n Auth::user() ? Auth::user()->id : -1\n );\n\n return view('search.layout', [\n 'results' => $this->get_search_results(\n Request::get('s')\n )\n ]);\n }", "function _admin_search_query()\n {\n }", "public function searchUsersByQueryString($request)\n {\n return $this->start()->uri(\"/api/user/search\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "public function testSearchFlight()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n $flight = $this->addFlight($this->user);\n\n // search specifically for a flight ID\n $query = 'flight_id='.$flight->id;\n $req = $this->get('/api/flights/search?'.$query);\n $req->assertStatus(200);\n }", "function search(){\n if ( $this->RequestHandler->isAjax() ) {\n Configure::write ( 'debug', 0 );\n $this->autoRender=false;\n $users=$this->User->find('all',array('conditions'=>array('User.name LIKE'=>'%'.$_GET['term'].'%')));\n $i=0;\n foreach($users as $user){\n $response[$i]['value']=$user['User']['name'];\n $response[$i]['label']=$user['User']['name'];\n $i++;\n }\n echo json_encode($response);\n }else{\n if (!empty($this->data)) {\n $this->set('users',$this->paginate(array('User.name LIKE'=>'%'.$this->data['User']['name'].'%')));\n }\n }\n }", "function index()\n\t{\n\t\t$this->form_validation->set_rules('search', 'search field', 'required');\n\t\tif ($this->form_validation->run() == true) {\n\t\t\t$search = $this->input->post('search');\n\t\t\tredirect('/user/search/' . urlencode($search));\n\t\t}\n\t\t$user = $this->auth->user();\n\t\tif($user) {\n\t\t\tredirect('/user/' . $user->id);\n\t\t} else {\n\t\t\tredirect('/user/register');\n\t\t}\n\t}", "public function searchByName($query);", "function testFindSearchcontentSco() {\n\t}", "protected function quicksearch()\n {\n $words = $this->getWords();\n $logged_in = APP_User::isBWLoggedIn('NeedMore,Pending');\n if (!$logged_in) {\n $request = PRequest::get()->request;\n if (!isset($request[0])) {\n $login_url = 'login';\n } else switch ($request[0]) {\n case 'login':\n case 'main':\n case 'start':\n $login_url = 'login';\n break;\n default:\n $login_url = 'login/'.htmlspecialchars(implode('/', $request), ENT_QUOTES);\n }\n } else {\n $username = isset($_SESSION['Username']) ? $_SESSION['Username'] : '';\n }\n\n if (class_exists('MOD_online')) {\n $who_is_online_count = MOD_online::get()->howManyMembersOnline();\n } else {\n // echo 'MOD_online not active';\n if (isset($_SESSION['WhoIsOnlineCount'])) {\n $who_is_online_count = $_SESSION['WhoIsOnlineCount']; // MOD_whoisonline::get()->whoIsOnlineCount();\n } else {\n $who_is_online_count = 0;\n }\n }\n PPostHandler::setCallback('quicksearch_callbackId', 'SearchmembersController', 'index');\n\n require TEMPLATE_DIR . 'shared/roxpage/quicksearch.php';\n }", "function search($string = false)\n\t{\n\t\t$string = urldecode($string);\n\t\t\n\t\t$this->form_validation->set_rules('search', 'search field', 'required');\n\t\tif ($this->form_validation->run() == true) {\n\t\t\tredirect('/user/search/' . urlencode($this->input->post('search')));\n\t\t} else {\n\t\t\t$data['search_form']['validation_message'] = validation_errors();\n\t\t}\n\t\t$data['search_form']['search'] = array(\n\t\t\t'name' => 'search',\n\t\t\t'type' => 'text',\n\t\t\t'placeholder' => 'Search...',\n\t\t\t'value' => $string\n\t\t);\n\t\t$data['search_form']['submit'] = array(\n\t\t\t'name' => 'submit',\n\t\t\t'value' => 'Search',\n\t\t);\n\n\t\t$data['users'] = $this->auth->users_like($string);\n\n\t\t$this->_render_page('user/list', $data);\n\t}", "public function testFilterSave()\n {\n $searchName = 'search' . uniqid();\n\n $this->visit('/')\n ->click('Login')\n ->seePageIs('/login')\n ->type('[email protected]', '#email')\n ->type('password123', '#password')\n ->click('#login-button');\n $this->visit('/properties')\n ->type('the', '#keywords')\n ->press('Update results')\n ->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->type($searchName, '#searchName')\n ->press('Save search');\n $this->visit('/properties/searches')\n ->see($searchName)\n ->press('#search-' . md5($searchName));\n $this->see('Shack in the desert')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n }", "public function search(Request $request){//+\n // Get the search value from the request\n $authid = Auth::user()->id;\n $search = $request->input('search');\n\n // Search in the title and body columns from the posts table\n $users = User::select('id','name', 'surname', 'email')->where(DB::raw('concat(name,\" \",surname)'), 'LIKE', \"%{$search}%\")\n ->whereNotIn('id', Auth::user()->notFriendSender->modelKeys())->whereNotIn('id', Auth::user()->notFriendReceiver->modelKeys())->get();\n\n // Return the search view with the resluts compacted\n return view('users.search', compact('users','authid'));\n }", "public function actionSearch($s) {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['site/index']);\n }\n $s = trim($s);\n if (preg_match(\"^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})$^\", $s)) {\n $squery = DvUsers::find()->where(['email' => $s, \"status\" => 1])->all();\n } else {\n $sq = explode(\" \", $s);\n $size = sizeof($sq);\n if ($size > 1) {\n $squery = DvUsers::find()->orWhere(['first_name' => $sq[0]])->orWhere(['first_name' => $sq[1]])->orWhere(['last_name' => $sq[0]])->orWhere(['last_name' => $sq[1]])->andWhere([\"status\" => 1])->all();\n } else {\n $squery = DvUsers::find()->orWhere(['first_name' => $s])->orWhere(['last_name' => $s])->andWhere([\"status\" => 1])->all();\n }\n }\n return $this->render('index', [ 'users' => $squery, 'total_records' => '1']);\n }", "public function anySearch()\n {\n return \"something\";\n }", "public function Search($criteria, $userId);", "public function test_search_item_result_with_keyword(){\n $this->browse(function (Browser $browser) {\n $browser->visit('/item-search')\n ->assertPathIs('/item-search')\n ->select('type', 1)\n ->value('#keyword', 'truck')\n ->value('#minprice', '10000')\n ->value('#maxprice', '20000')\n ->click('button[type=\"submit\"]')\n ->assertPathIs('/item-search-result')\n ->assertSee(\"Details\");\n });\n }", "public function testSearch()\n {\n $crawler = $this->client->request('GET', $this->router->generate('marquejogo_homepage'));\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Cidade\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Data\")')->count());\n $this->assertGreaterThan(0, $crawler->filter('html:contains(\"Hora\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => '',\n 'marcoshoya_marquejogobundle_search[date]' => '1111',\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $crawler = $this->client->submit($form);\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"Campo obrigatório\")')->count());\n // invalid date\n $this->assertGreaterThan(0, $crawler->filter('span:contains(\"This value is not valid.\")')->count());\n\n // Test form validate\n $form = $crawler->selectButton('Pesquisar')->form(array(\n 'marcoshoya_marquejogobundle_search[city]' => 'Curitiba, Paraná',\n 'marcoshoya_marquejogobundle_search[date]' => date('d-m-Y'),\n 'marcoshoya_marquejogobundle_search[hour]' => date('H'),\n ));\n\n $this->client->submit($form);\n $crawler = $this->client->followRedirect();\n\n $this->assertEquals(200, $this->client->getResponse()->getStatusCode());\n $this->assertGreaterThan(0, $crawler->filter('h1:contains(\"Resultados encontrados\")')->count());\n }", "private function searchUsers($userCollection, $filter)\t{\n trace('[CMD] '.__METHOD__);\n\n\t\t$filterlist = $filter->getDataArray();\n\t\t$searchlist = array();\n\t\t$exactMatch = false;\n\t\t$specified = false;\n\t\t$result = '';\n\t\tforeach ($filterlist as $key => $value) {\n\t\t\tif ($value == '') {\n\t\t\t\t// ignore empty search fields\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tswitch ($key) {\n\t\t\t\tcase 'gsa_kundnr':\n\t\t\t\t\t// special case; find gsauid by gsa_kundnr\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'exactMatch':\n\t\t\t\t\t// switch match mode\n\t\t\t\t\t$exactMatch = $value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t// copy field to searchlist\n\t\t\t\t\t$specified = true;\n\t\t\t\t\t$searchlist[$key] = $value;\n\t\t\t}\n\t\t}\n\t\tif (! $specified) {\n\t\t\t$result = $this->pi_getLL('msg_searchreq', '[msg_searchreq]');\n\t\t}\n\t\telse {\n\t\t\t$cnt = $userCollection->loadBySearchlist($searchlist, $exactMatch, self::MAX_SEARCHRESULTS);\n\t\t\tif ($cnt > self::MAX_SEARCHRESULTS) {\n\t\t\t\t// to many hits, complain\n\t\t\t\t$result = $this->pi_getLL('msg_toomany', '[msg_toomany]');\n\t\t\t}\n\t\t\telse if (! $cnt) {\n\t\t\t\t// nothing found, complain\n\t\t\t\t$result = $this->pi_getLL('msg_notfound', '[msg_notfound]');\n\t\t\t}\n\t\t}\n\t\ttrace($result);\n\t\treturn $result;\n\t}", "public function testSearchFieldConfig()\n {\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth();\n $this->checkTableListConfig('searchField');\n\n $this->reset();\n\n Shopware()->Plugins()->Backend()->Auth()->setNoAuth();\n $this->checkGetTableListConfigPagination('searchField');\n }", "public function searchAll($input)\n {\n \n }", "public function testIndexUser()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit(route('admin@getLogin'))\n ->type('email', '[email protected]')\n ->type('password', 'cowell@123')\n ->press('Login')\n ->visit(route('admin@user@user'))\n ->assertSee('FIRST NAME');\n });\n }" ]
[ "0.7333204", "0.71606", "0.7125123", "0.70354354", "0.70354354", "0.7013432", "0.70099324", "0.6999198", "0.69534355", "0.69092953", "0.68699336", "0.6855304", "0.68482375", "0.68351287", "0.683056", "0.6814859", "0.67792314", "0.6772843", "0.6724883", "0.6720761", "0.66741306", "0.66440266", "0.66440266", "0.66373914", "0.66153675", "0.66059047", "0.65829766", "0.65829766", "0.6578505", "0.6548292", "0.65082043", "0.64899296", "0.64878607", "0.6486401", "0.6446566", "0.6416301", "0.64116085", "0.6394815", "0.6381779", "0.63739204", "0.6367551", "0.6346464", "0.63460094", "0.6340594", "0.63303524", "0.63254946", "0.6319728", "0.63161105", "0.62956864", "0.6268408", "0.6264492", "0.6262796", "0.62513834", "0.623992", "0.6233641", "0.6207296", "0.6204567", "0.62028134", "0.61966413", "0.6186201", "0.617828", "0.61664784", "0.6165943", "0.6157305", "0.6157088", "0.61499804", "0.6149238", "0.61413413", "0.61344105", "0.6125952", "0.61231613", "0.61189425", "0.6115954", "0.61129445", "0.6110108", "0.60650015", "0.60600096", "0.6059508", "0.6054704", "0.60528445", "0.6050878", "0.60477513", "0.6036168", "0.6034611", "0.6030613", "0.6029435", "0.602824", "0.6022142", "0.6011108", "0.60074055", "0.60020053", "0.6001846", "0.6001529", "0.6000868", "0.6000644", "0.5987848", "0.59827787", "0.5981076", "0.59802246", "0.5969749" ]
0.7699641
0
/////////End testing ontology expansion/////////////////// ////////Testing the category name sorting////////////////
public function testCategoryNameSorting() { echo "\n testCategoryNameSorting..."; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/category/cell_process/Name/asc/0/10000"; $response = $this->curl_get($url); //echo $response; $result = json_decode($response); if(isset($result->error)) { echo "\nError in testCategoryNameSorting"; $this->assertTrue(false); } if(isset($result->hits->total) && $result->hits->total > 0) $this->assertTrue(true); else { $this->assertTrue(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "function _usort_terms_by_name($a, $b)\n {\n }", "public function convert_category_titles()\n\t{\n\t\t$category \t= $split_cat = ee()->TMPL->fetch_param('category');\n\n\t\tif (strtolower(substr($split_cat, 0, 3)) == 'not')\n\t\t{\n\t\t\t$split_cat = substr($split_cat, 3);\n\t\t}\n\n\t\t$categories = preg_split(\n\t\t\t'/' . preg_quote('&') . '|' . preg_quote('|') . '/',\n\t\t\t$split_cat,\n\t\t\t-1,\n\t\t\tPREG_SPLIT_NO_EMPTY\n\t\t);\n\n\t\t$to_fix = array();\n\n\t\tforeach ($categories as $cat)\n\t\t{\n\t\t\tif (preg_match('/\\w+/', trim($cat)))\n\t\t\t{\n\t\t\t\t$to_fix[trim($cat)] = 0;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty ($to_fix))\n\t\t{\n\t\t\t$cats = ee()->db->query(\n\t\t\t\t\"SELECT cat_id, cat_url_title\n\t\t\t\t FROM \texp_categories\n\t\t\t\t WHERE \tcat_url_title\n\t\t\t\t IN \t('\" . implode(\"','\", ee()->db->escape_str(array_keys($to_fix))) . \"')\"\n\t\t\t);\n\n\t\t\tforeach ($cats->result_array() as $row)\n\t\t\t{\n\t\t\t\t$to_fix[$row['cat_url_title']] = $row['cat_id'];\n\t\t\t}\n\n\t\t\tkrsort($to_fix);\n\n\t\t\tforeach ($to_fix as $cat => $id)\n\t\t\t{\n\t\t\t\tif ($id != 0)\n\t\t\t\t{\n\t\t\t\t\t$category = str_replace($cat, $id, $category);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->TMPL->tagparams['category'] = $category;\n\t\t}\n\t}", "public function testSortListCategories()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\");\n //Test list user Desc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayAsc[$i - 1]);\n }\n //Test list user Desc\n $browser->click(\"#category-sort-name a\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayDesc[$i - 1]);\n }\n });\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "function array_category($catalog, $category){\n // Declare an empty array to hold keys for given category\n $output = array();\n\n // Loop through the $catalog, adding item's ids to the array if they match the given category\n foreach ($catalog as $id => $item){\n // Checks to see if the passed in $category matches the category value for the current item from $catelog\n if ($category == null OR strtolower($category) == strtolower($item[\"category\"])) {\n // In order to sort items, a variable is created containing the current item's title\n $sort = $item[\"title\"];\n // ltrim is used to remove the,a or an from the start of any title where these words appear\n $sort = ltrim($sort,\"The \");\n $sort = ltrim($sort,\"A \");\n $sort = ltrim($sort,\"An \");\n // Title of current item is placed in $output array at the position $id\n $output[$id] = $sort;\n }\n }\n\n // asort is used to sort items in $output alphabetically\n asort($output);\n // return an array of the keys of the $output items\n return array_keys($output);\n}", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "public function testListCategories()\n {\n }", "function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "public function testCategorySearchByName()\n {\n echo \"\\n testCategorySearchByName...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category_search\";\n $query = \"{\\\"query\\\": { \".\n \"\\\"term\\\" : { \\\"Name\\\" : \\\"Cell Death\\\" } \". \n \"}}\";\n $response = $this->just_curl_get_data($url, $query);\n $response = $this->handleResponse($response);\n //echo \"\\n testCategorySearchByName response:\".$response.\"---\";\n if(is_null($response))\n {\n echo \"\\n testCategorySearchByName response is empty\";\n $this->assertTrue(false);\n }\n \n $result = json_decode($response);\n if(is_null($result))\n {\n echo \"\\n testCategorySearchByName json is invalid\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n $this->assertTrue(false);\n \n }", "public function getAllCategoryNames();", "function jigoshop_categories_ordering () {\n\n\tglobal $wpdb;\n\t\n\t$id = (int)$_POST['id'];\n\t$next_id = isset($_POST['nextid']) && (int) $_POST['nextid'] ? (int) $_POST['nextid'] : null;\n\t\n\tif( ! $id || ! $term = get_term_by('id', $id, 'product_cat') ) die(0);\n\t\n\tjigoshop_order_categories ( $term, $next_id);\n\t\n\t$children = get_terms('product_cat', \"child_of=$id&menu_order=ASC&hide_empty=0\");\n\tif( $term && sizeof($children) ) {\n\t\techo 'children';\n\t\tdie;\t\n\t}\n\t\n}", "public function testSortListCategoriesWhenPanigate()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n // Test list Asc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n $arraySortAsc = array_chunk($arrayAsc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortAsc[$i - 1]);\n }\n // Test list Desc\n $browser->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n $arraySortDesc = array_chunk($arrayDesc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortDesc[$i - 1]);\n }\n });\n }", "public function nfosorter($category = 0, $id = 0)\n\t{\n\t\t$idarr = ($id != 0 ? sprintf('AND r.id = %d', $id) : '');\n\t\t$cat = ($category = 0 ? sprintf('AND r.categoryid = %d', \\Category::CAT_MISC) : sprintf('AND r.categoryid = %d', $category));\n\n\t\t$res = $this->pdo->queryDirect(\n\t\t\t\t\t\tsprintf(\"\n\t\t\t\t\t\t\tSELECT UNCOMPRESS(rn.nfo) AS nfo,\n\t\t\t\t\t\t\t\tr.id, r.name, r.searchname\n\t\t\t\t\t\t\tFROM release_nfos rn\n\t\t\t\t\t\t\tINNER JOIN releases r ON rn.releaseid = r.id\n\t\t\t\t\t\t\tINNER JOIN groups g ON r.group_id = g.id\n\t\t\t\t\t\t\tWHERE rn.nfo IS NOT NULL\n\t\t\t\t\t\t\tAND r.proc_sorter = %d\n\t\t\t\t\t\t\tAND r.preid = 0 %s\",\n\t\t\t\t\t\t\tself::PROC_SORTER_NONE,\n\t\t\t\t\t\t\t($idarr = '' ? $cat : $idarr)\n\t\t\t\t\t\t)\n\t\t);\n\n\t\tif ($res !== false && $res instanceof \\Traversable) {\n\n\t\t\tforeach ($res as $row) {\n\n\t\t\t\tif (strlen($row['nfo']) > 100) {\n\n\t\t\t\t\t$nfo = utf8_decode($row['nfo']);\n\n\t\t\t\t\tunset($row['nfo']);\n\t\t\t\t\t$matches = $this->_sortTypeFromNFO($nfo);\n\n\t\t\t\t\tarray_shift($matches);\n\t\t\t\t\t$matches = $this->doarray($matches);\n\n\t\t\t\t\tforeach ($matches as $m) {\n\n\t\t\t\t\t\t$case = (isset($m) ? str_replace(' ', '', $m) : '');\n\n\t\t\t\t\t\tif (in_array($m, ['os', 'platform', 'console']) && preg_match('/(?:\\bos\\b(?: type)??|platform|console)[ \\.\\:\\}]+(\\w+?).??(\\w*?)/iU', $nfo, $set)) {\n\t\t\t\t\t\t\tif (is_array($set)) {\n\t\t\t\t\t\t\t\tif (isset($set[1])) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[1]);\n\t\t\t\t\t\t\t\t} else\tif (isset($set[2]) && strlen($set[2]) > 0 && (stripos($set[2], 'mac') !== false || stripos($set[2], 'osx') !== false)) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[2]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$case = str_replace(' ', '', $m);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pos = $this->nfopos($this->_cleanStrForPos($nfo), $this->_cleanStrForPos($m));\n\t\t\t\t\t\tif ($pos !== false && $pos > 0.55 && $case !== 'imdb') {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ($ret = $this->matchnfo($case, $nfo, $row)) {\n\t\t\t\t\t\t\treturn $ret;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->_setProcSorter(self::PROC_SORTER_DONE, $id);\n\t\techo \".\";\n\t\treturn false;\n\t}", "function sac_sort_terms_by_description($x,$y) {\n\t$desc_x = (int)$x->description;\n\t$desc_y = (int)$y->description;\n\t\n\treturn $desc_x - $desc_y;\n}", "public function testSortByTitle()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setTitle('B');\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setTitle('A');\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setTitle('C');\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_MANUFACTURE);\n\n $this->assertEquals($item2, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item3, $sorted[2]);\n }", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}", "function issuu_document_categories() {\n return array(\n '000000' => 'Unknown',\n '001000' => 'Auto & Vehicles',\n '002000' => 'Business & Marketing',\n '003000' => 'Creative',\n '004000' => 'Film & Music',\n '005000' => 'Fun & Entertainment',\n '006000' => 'Hobby & Home',\n '007000' => 'Knowledge & Resources',\n '008000' => 'Nature & Animals',\n '009000' => 'News & Politics',\n '010000' => 'Nonprofits & Activism',\n '011000' => 'Religon & Philosophy',\n '012000' => 'Sports',\n '013000' => 'Technology & Internet',\n '014000' => 'Travel & Events',\n '015000' => 'Weird & Bizarre',\n '016000' => 'Other'\n );\n}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function testGetCatTitle()\n {\n $sManufacturerId = $this->getTestConfig()->getShopEdition() == 'EE'? '88a996f859f94176da943f38ee067984' : 'fe07958b49de225bd1dbc7594fb9a6b0';\n $oManufacturer = oxNew('oxManufacturer');\n $oManufacturer->load($sManufacturerId);\n\n $oManufacturerList = $this->getProxyClass(\"Manufacturerlist\");\n $oManufacturerList->setManufacturerTree(oxNew('oxManufacturerList'));\n $oManufacturerList->setNonPublicVar(\"_oActManufacturer\", $oManufacturer);\n\n $this->assertEquals($oManufacturer->oxmanufacturers__oxtitle->value, $oManufacturerList->getTitle());\n }", "function _usort_terms_by_ID($a, $b)\n {\n }", "function _make_cat_compat(&$category)\n {\n }", "function sortRecipesAlphabetical($recipes)\n{\n\t$count = count($recipes);\n\t$indexes = array();\n\t\n\t//set default index ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\t$indexes[$i] = $i;\n\t}\n\t\n\t//sort indexes based on recipe name alphabetical ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\tfor ($j = 0; ($j < $count) && ($j != $i); $j++)\n\t\t{\n\t\t\t$index1 = $indexes[$i];\n\t\t\t$index2 = $indexes[$j];\n\t\t\t\n\t\t\tif (strcmp($recipes[$index1][\"name\"], $recipes[$index2][\"name\"]) < 0)\n\t\t\t{\n\t\t\t\t$indexes[$i] = $index2;\n\t\t\t\t$indexes[$j] = $index1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $indexes;\n}", "private function refine($category)\n {\n $category = trim(ucwords(strtolower($category)));\n if ($category == 'Lifestyle (sociology)') {\n return 'Lifestyle';\n }\n if ($category == 'Sports') {\n return 'Sport';\n }\n if ($category == 'Humor') {\n return 'Comedy';\n }\n if ($category == 'Humour') {\n return 'Comedy';\n }\n if ($category == 'Pet') {\n return 'Animals';\n }\n if ($category == 'Diy') {\n return 'DIY';\n }\n if ($category == 'Association Football') {\n return 'Soccer';\n }\n return $category;\n }", "public function findCategories();", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function troy_categories() {\n\t$file = file_get_contents(get_site_url().'/wp-content/plugins/knoppys-troy/uploads/PublishJobCategories.xml');\n\t\n\t//Create a new object\n\t$categoriesXML = new SimpleXMLElement($file);\n\n\t//Foreach of the categories in the XML file \n\tforeach ($categoriesXML->category as $category) {\n\n\t\t\t//Get the correct WP term name which has to be the actual name\n\t\t\tif ($category['description'] == 'Type Of Job') {\n\t\t\t\t$taxonomyName = 'job_type';\n\t\t\t} elseif ($category['description'] == 'Hours') {\n\t\t\t\t$taxonomyName = 'no_of_hours';\n\t\t\t} elseif ($category['description'] == 'Sector') {\n\t\t\t\t$taxonomyName = 'sector';\n\t\t\t}\n\n\t\t\t/*************\n\t\t\t* Check to see if the <job_category> exists. \n\t\t\t* Update or create it\n\t\t\t*************/\t\t\n\t\t\tforeach ($category->job_category as $job_category) {\t\t\t\t\t\n\t\t\t\tif(term_exists($job_category['code'],$taxonomyName)){\t\t\t\t\t\t\n\t\t\t\t\t$categoryName = get_term($job_category[0], $taxonomyName);\n\t\t\t\t\t$args = array('slug'=>$job_category[0],'description'=>$job_category[0]);\t\t\t\t\t\n\t\t\t\t\twp_update_term( $categoryName->ID, $taxonomyName, $args);\n\t\t\t\t\tupdate_term_meta($categoryName->ID,'code', $job_category['code']);\t\t\t\t\t\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\t$args = array('slug'=>$job_category[0],'description'=>$job_category[0]);\t\t\t\t\t\t\t\t\n\t\t\t\t\twp_insert_term( $job_category['code'], $taxonomyName, $args);\t\n\t\t\t\t\t$term = get_term($job_category[0]);\n\t\t\t\t\tupdate_term_meta($term->ID,'code', $job_category['code']);\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}\t\n}", "public function testCatalogGetCategories()\n {\n\n }", "public function test_sort_nodes2() {\n $category = new \\phpunit_fixture_myprofile_category('category', 'title', null);\n\n // Create nodes.\n $node1 = new \\core_user\\output\\myprofile\\node('category', 'node1', 'nodetitle', null, null, 'content');\n $node2 = new \\core_user\\output\\myprofile\\node('category', 'node2', 'nodetitle', 'node1', null, 'content');\n $node3 = new \\core_user\\output\\myprofile\\node('category', 'node3', 'nodetitle', null);\n $node4 = new \\core_user\\output\\myprofile\\node('category', 'node4', 'nodetitle', 'node3');\n $node5 = new \\core_user\\output\\myprofile\\node('category', 'node5', 'nodetitle', 'node3');\n $node6 = new \\core_user\\output\\myprofile\\node('category', 'node6', 'nodetitle', 'node1', null, 'content');\n\n // Add the nodes in random order.\n $category->add_node($node3);\n $category->add_node($node2);\n $category->add_node($node4);\n $category->add_node($node1);\n $category->add_node($node5);\n $category->add_node($node6);\n\n // After node 1 we should have node2 - node6 - node3 - node4 - node5.\n $category->sort_nodes();\n $nodes = $category->nodes;\n $this->assertCount(6, $nodes);\n $node = array_shift($nodes);\n $this->assertEquals($node1, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node2, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node6, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node3, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node4, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node5, $node);\n }", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "function tkno_get_top_category_slug( $return_slug=false, $cat_id=false ) {\n global $post;\n $curr_cat = ( $cat_id ) ? get_category_parents( $cat_id, false, '/', true ) : get_the_category_list( '/' , 'multiple', $post->ID );\n $valid_cats = ( is_outdoors() ) ? array( 'spring', 'summer', 'fall', 'winter', 'trips', 'outdoors' ) : array( 'music', 'food', 'drink', 'things-to-do', 'arts' );\n $curr_cat = explode( '/', $curr_cat );\n $return_cat = array();\n foreach ( $curr_cat as $current ) {\n $current = sanitize_title( strtolower( $current ) );\n if ( in_array( $current, $valid_cats ) ) {\n $return_cat['slug'] = $current;\n if ( $return_slug ) { \n return $current;\n }\n break;\n }\n }\n if ( ! empty( $return_cat['slug'] ) ) { \n $cat_for_name = get_category_by_slug( $return_cat['slug'] );\n $return_cat['cat_name'] = $cat_for_name->name;\n $return_cat['term_id'] = $cat_for_name->term_id;\n return (object) $return_cat;\n } else {\n return false;\n }\n}", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "function getCategories($object) { \n\n $R1 = new Category(); // R1 --\n $R11 = new Category(); // | | - R11 --\n $R111 = new Category(); // | | - R111\n $R112 = new Category(); // | | - R112\n $R11->addSubcategory($R111); // |\n $R11->addSubcategory($R112); // |\n $R1->addSubcategory($R11); // |\n $R2 = new Category(); // R2 --\n $R21 = new Category(); // | - R21 --\n $R211 = new Category(); // | | - R211\n $R22 = new Category(); // |\n $R221 = new Category(); // | - R22 --\n $R21->addSubcategory($R211); // | - R221\n $R22->addSubcategory($R221);\n $R2->addSubcategory($R21);\n $R2->addSubcategory($R22);\n\n $object->addCollectionEntry($R1); \n $object->addCollectionEntry($R2); \n}", "function businessNameSort ($x, $y) {\r\n return strcasecmp($x['businessName'], $y['businessName']);\r\n}", "private function getPostTitlesByCategory($category) {\n\n $categoryName = $category;\n $result_limit = 'max'; /* max=500 */\n\n $categoryNameForUrl = urlencode($categoryName);\n /*\n * Ordine di aggiunta alla categoria (dalla più recente alla meno recente)\n * https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=categorymembers&cmtitle=Category%3AMember_states_of_the_United_Nations&cmlimit=500&cmsort=timestamp&cmdir=desc&cmnamespace=0\n */\n $api_call = '?action=query&format=json&list=categorymembers&cmtitle=Category:' . $categoryNameForUrl . '&cmlimit=' . $result_limit . '&cmsort=timestamp&cmdir=newer&cmnamespace=0';\n\n $api = new API($this->baseUrl);\n $api_result = $api->getAPIResult($api_call);\n\n $items = $api_result['query']['categorymembers'];\n\n $articles_titles = array_column($items, 'title');\n\n for ($i = 0; $i < count($articles_titles); $i++) {\n if ($articles_titles[$i] === $categoryName || $articles_titles[$i] === 'Azerbaijan-United Nations relations') {\n unset($articles_titles[$i]);\n }\n }\n\n return $articles_titles;\n }", "function _arrangeCategory(&$document_category, $list, $depth)\n\t{\n\t\tif(!count($list)) return;\n\t\t$idx = 0;\n\t\t$list_order = array();\n\t\tforeach($list as $key => $val)\n\t\t{\n\t\t\t$obj = new stdClass;\n\t\t\t$obj->mid = $val['mid'];\n\t\t\t$obj->module_srl = $val['module_srl'];\n\t\t\t$obj->category_srl = $val['category_srl'];\n\t\t\t$obj->parent_srl = $val['parent_srl'];\n\t\t\t$obj->title = $obj->text = $val['text'];\n\t\t\t$obj->description = $val['description'];\n\t\t\t$obj->expand = $val['expand']=='Y'?true:false;\n\t\t\t$obj->color = $val['color'];\n\t\t\t$obj->document_count = $val['document_count'];\n\t\t\t$obj->depth = $depth;\n\t\t\t$obj->child_count = 0;\n\t\t\t$obj->childs = array();\n\t\t\t$obj->grant = $val['grant'];\n\n\t\t\tif(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true;\n\t\t\telse $selected = false;\n\n\t\t\t$obj->selected = $selected;\n\n\t\t\t$list_order[$idx++] = $obj->category_srl;\n\t\t\t// If you have a parent category of child nodes apply data\n\t\t\tif($obj->parent_srl)\n\t\t\t{\n\t\t\t\t$parent_srl = $obj->parent_srl;\n\t\t\t\t$document_count = $obj->document_count;\n\t\t\t\t$expand = $obj->expand;\n\t\t\t\tif($selected) $expand = true;\n\n\t\t\t\twhile($parent_srl)\n\t\t\t\t{\n\t\t\t\t\t$document_category[$parent_srl]->document_count += $document_count;\n\t\t\t\t\t$document_category[$parent_srl]->childs[] = $obj->category_srl;\n\t\t\t\t\t$document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs);\n\t\t\t\t\tif($expand) $document_category[$parent_srl]->expand = $expand;\n\n\t\t\t\t\t$parent_srl = $document_category[$parent_srl]->parent_srl;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$document_category[$key] = $obj;\n\n\t\t\tif(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1);\n\t\t}\n\t\t$document_category[$list_order[0]]->first = true;\n\t\t$document_category[$list_order[count($list_order)-1]]->last = true;\n\t}", "private function _sortBySourceAndCategory($a, $b) {\n // Compare sources\n $sourceCmp = strcmp($a->source, $b->source);\n if ($sourceCmp != 0) {\n return $sourceCmp;\n }\n // Sources same, compare category names\n return strcmp($a->name, $b->name);\n }", "function get_categoriaslist(){\r\n $args = array(\r\n 'orderby' => 'name',\r\n 'order' => 'ASC'\r\n );\r\n $categories = get_categories($args);\r\n ?><ul><?php \r\n foreach($categories as $category) { \r\n ?><li><a href=\"<?php echo get_category_link( $category->term_id ); ?>\"><?php echo $category->name;?></a></li><?php \r\n }\r\n ?></ul><?php \r\n}", "function getCategoryTree($db) {\n // Make Category Tree\n $query = \"SELECT `COMPLAINT_TYPE`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $category['name'] = trim($row[\"COMPLAINT_TYPE\"], ' /');\n $category['COMPLAINT_TYPE'] = $row[\"COMPLAINT_TYPE\"];\n $category['slug'] = slugify($category['name']);\n $category['count'] = $row[\"COUNT(*)\"];\n if( $category['slug'] != 'n-a' && $category['slug'] != 'select-one' && $category['slug'] != 'other' ){\n $topCategories[$category['slug']]=$category;\n }\n }\n\n $query = \"SELECT `COMPLAINT_TYPE`, `DESCRIPTOR`, COUNT(*) FROM `cases` WHERE `BOROUGH` != '' GROUP BY `COMPLAINT_TYPE`, `DESCRIPTOR` ORDER BY COUNT(*) DESC\";\n foreach( $db->query($query) as $row ) {\n $subCategory['name'] = trim($row[\"DESCRIPTOR\"], ' /');\n $subCategory['DESCRIPTOR'] = $row[\"DESCRIPTOR\"];\n $subCategory['slug'] = slugify($subCategory['name']);\n $subCategory['count'] = $row[\"COUNT(*)\"];\n if(\n trim($row['COMPLAINT_TYPE']) != ''\n && $subCategory['slug'] != 'n-a'\n && $subCategory['slug'] != 'select'\n ){\n $topCategories[slugify($row['COMPLAINT_TYPE'])]['subCategories'][$subCategory['slug']]=$subCategory;\n }\n }\n\n return $topCategories;\n}", "function get_catname($cat_id)\n {\n }", "function getCatTitleSort( &$categories, $level = 0, $parent = 0, $out = false, $log = false, $bread_crumbs = false )\n\t{\n\t\tforeach ($categories as $index => $category)\n\t\t{\n\t\t\tif ( $category['Parent_ID'] == $parent )\n\t\t\t{\n\t\t\t\t$bread_crumbs[$category['ID']] = $category['Parent_ID'];\n\t\t\t\t$tmp[$category['ID']] = $category;\n\t\t\t\t$tmp[$category['ID']]['pName'] = 'categories+name+'. $category['Key'];\n\t\t\t\t$tmp[$category['ID']]['margin'] = $category['Level'] * 10 + 5;\n\t\t\t\t$log[$category['Level']][$category['ID']] = $category['ID'];\n\t\t\t\tunset($categories[$index]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this -> rlArraySort($tmp, 'name');\n\t\t\n\t\tforeach ( $tmp as $t_item )\n\t\t{\n\t\t\t$ttmp[$t_item['ID']] = $t_item;\n\t\t}\n\t\t$tmp = $ttmp;\n\t\tunset($ttmp);\n\t\t\n\t\t$next_parent = array_shift($log[$level]);\n\n\t\tif ( empty($out) )\n\t\t{\n\t\t\t$out = $tmp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( $tmp )\n\t\t\t{\n\t\t\t\t$relations = $this -> getCatTitleBC($bread_crumbs, $parent);\n\t\t\t\teval('$out'. $relations .' = $tmp;');\n\t\t\t}\n\t\t}\n\t\tunset($tmp, $relations);\n\t\t\n\t\tif ( empty($log[$level]) )\n\t\t{\n\t\t\tunset($log[$level]);\n\t\t\t$level++;\n\t\t}\n\t\t\n\t\t//if ( !empty($log) && !empty($categories) )\n\t\tif ( $next_parent && !empty($categories) )\n\t\t{\n\t\t\treturn $this -> getCatTitleSort($categories, $level, $next_parent, $out, $log, $bread_crumbs);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $out;\n\t\t}\n\t}", "function cat_id_to_name($id) {\r\n\tforeach((array)(get_categories()) as $category) {\r\n \tif ($id == $category->cat_ID) { return $category->cat_name; break; }\r\n\t}\r\n}", "function load_categories($category_table='',$order_by='ORDER BY bias',$sort_by=null){\n\t\t$categories=array();\n\t\t$s=query(\"SELECT * FROM \".$category_table.\" \".$order_by);\n\t\twhile($one=fetch_object($s)){\n\t\t\tif(!empty($one->cat_id)){ $id=$one->cat_id; $id_name='cat_id'; }else{ $id=$one->page_id; $id_name='page_id'; }\n\t\t\tif($one->bias==0){ query(\"update \".$category_table.\" set bias=\".$id.\" where \".$id_name.\"=\".$id); }\n\t\t\t$one->name\t\t\t=htmlspecialchars($one->name);\n\t\t\t$one->description\t=$one->description;\n\t\t\t$one->url_name\t\t=$this->make_clean_url($one->name);\n\t\t\t$categories[$id]=$one;\n\t\t}\n\t\tif($sort_by){\n\t\t\t$categories_sorted=array(); foreach($categories as $id=>$cat){ $categories_sorted[$id]=$cat->name; }\n\t\t\tarray_multisort( \n\t\t\t\t$categories_sorted, $sort_by,\n\t\t\t\t$categories\n\t\t\t);\n\t\t}\n\t\treturn $categories;\n\t}", "function get_cat_name($cat_id)\n {\n }", "function es_change_default_category_orderby( $order_by ) {\n\tglobal $wp_query;\n\t$cat_id = $wp_query->get_queried_object()->term_id;\n\n\t// Category id E-learning Subscriptions is 190\n\tif ( $cat_id == 190 )\n\t\treturn 'price';\n\telse\n\t\treturn $order_by;\n}", "public function testGetProductCategories() {\n \n }", "function get_all_comic_categories() {\n global $comiccat, $category_tree, $non_comic_categories;\n\n $categories_by_id = get_all_category_objects_by_id();\n\n foreach (array_keys($categories_by_id) as $category_id) {\n $category_tree[] = $categories_by_id[$category_id]->parent . '/' . $category_id;\n }\n\n do {\n $all_ok = true;\n for ($i = 0; $i < count($category_tree); ++$i) {\n $current_parts = explode(\"/\", $category_tree[$i]);\n if (reset($current_parts) != 0) {\n\n $all_ok = false;\n for ($j = 0; $j < count($category_tree); ++$j) {\n $j_parts = explode(\"/\", $category_tree[$j]);\n\n if (end($j_parts) == reset($current_parts)) {\n $category_tree[$i] = implode(\"/\", array_merge($j_parts, array_slice($current_parts, 1)));\n break;\n }\n }\n }\n }\n } while (!$all_ok);\n\n $non_comic_tree = array();\n\n if (get_option('comicpress-enable-storyline-support') == 1) {\n $result = get_option(\"comicpress-storyline-category-order\");\n if (!empty($result)) {\n $category_tree = explode(\",\", $result);\n }\n $non_comic_tree = array_keys($categories_by_id);\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n $category_id = end($parts);\n if ($parts[1] == $comiccat) {\n if (($index = array_search($category_id, $non_comic_tree)) !== false) {\n array_splice($non_comic_tree, $index, 1);\n }\n }\n }\n } else {\n $new_category_tree = array();\n foreach ($category_tree as $node) {\n $parts = explode(\"/\", $node);\n if ($parts[1] == $comiccat) {\n $new_category_tree[] = $node;\n } else {\n $non_comic_tree[] = end($parts);\n }\n }\n $category_tree = $new_category_tree;\n }\n\n $non_comic_categories = implode(\" and \", $non_comic_tree);\n}", "private function parseCategoryUrl() {\n $sql = \"SELECT\n id,\n name\n FROM\n categories\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $name);\n while($stmt->fetch()) {\n $name = lowerCat($name);\n if($this->cat == $name) {\n $this->catId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->catId !== -1) {\n $this->parsedUrl = '/'.$this->catId.'/'.$this->cat;\n }\n }", "public function getCategoriesByInitialLetter() {\n\t\tglobal $db;\n\t\t$res = $db->query(\"SELECT category, used FROM `categories` ORDER BY category\");\n\n\t\t$initials = [];\n\t\tforeach ($res as $r) {\n\t\t\t$firstChar = mb_substr($r->category, 0, 1);\n\t\t\tif(is_numeric($firstChar)) $firstChar = \"#\";\n\t\t\t$initials[$firstChar][] = [$r->category, $r->used];\n\t\t}\n\n\t\treturn $initials;\n\t}", "function _sortbyName($a, $b) \n {\n return(strcasecmp($a[\"name\"], $b[\"name\"]));\n }", "function getCategories(){\n\t$storeId = Mage::app()->getStore()->getId(); \n\n\t$collection = Mage::getModel('catalog/category')->getCollection()\n\t\t->setStoreId($storeId)\n\t\t->addAttributeToSelect(\"name\");\n\t$catIds = $collection->getAllIds();\n\n\t$cat = Mage::getModel('catalog/category');\n\n\t$max_level = 0;\n\n\tforeach ($catIds as $catId) {\n\t\t$cat_single = $cat->load($catId);\n\t\t$level = $cat_single->getLevel();\n\t\tif ($level > $max_level) {\n\t\t\t$max_level = $level;\n\t\t}\n\n\t\t$CAT_TMP[$level][$catId]['name'] = $cat_single->getName();\n\t\t$CAT_TMP[$level][$catId]['childrens'] = $cat_single->getChildren();\n\t}\n\n\t$CAT = array();\n\t\n\tfor ($k = 0; $k <= $max_level; $k++) {\n\t\tif (is_array($CAT_TMP[$k])) {\n\t\t\tforeach ($CAT_TMP[$k] as $i=>$v) {\n\t\t\t\tif (isset($CAT[$i]['name']) && ($CAT[$i]['name'] != \"\")) {\t\t\t\t\t\n\t\t\t\t\t/////Berry add/////\n\t\t\t\t\tif($k == 2)\n\t\t\t\t\t\t$CAT[$i]['name'] .= $v['name'];\n\t\t\t\t\telse\n\t\t\t\t\t\t$CAT[$i]['name'] .= \"\";\n\t\t\t\t\t\t\n\t\t\t\t\t//$CAT[$i]['name'] .= \" > \" . $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$CAT[$i]['name'] = $v['name'];\n\t\t\t\t\t$CAT[$i]['level'] = $k;\n\t\t\t\t}\n\n\t\t\t\tif (($v['name'] != \"\") && ($v['childrens'] != \"\")) {\n\t\t\t\t\tif (strpos($v['childrens'], \",\")) {\n\t\t\t\t\t\t$children_ids = explode(\",\", $v['childrens']);\n\t\t\t\t\t\tforeach ($children_ids as $children) {\n\t\t\t\t\t\t\tif (isset($CAT[$children]['name']) && ($CAT[$children]['name'] != \"\")) {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$CAT[$children]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (isset($CAT[$v['childrens']]['name']) && ($CAT[$v['childrens']]['name'] != \"\")) {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$CAT[$v['childrens']]['name'] = $CAT[$i]['name'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tunset($collection);\n\tunset($CAT_TMP);\n\treturn $CAT;\n}", "public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }", "abstract protected function &__xhpCategoryDeclaration()/*: array*/;", "function process_categories() {\n\t\t$this->categories = apply_filters( 'wp_import_categories', $this->categories );\n\n\t\tif ( empty( $this->categories ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->categories as $cat ) {\n\t\t\t// if the category already exists leave it alone\n\t\t\t$term_id = term_exists( $cat['category_nicename'], 'category' );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$category_parent = empty( $cat['category_parent'] ) ? 0 : category_exists( $cat['category_parent'] );\n\t\t\t$category_description = isset( $cat['category_description'] ) ? $cat['category_description'] : '';\n\t\t\t$catarr = array(\n\t\t\t\t'category_nicename' => $cat['category_nicename'],\n\t\t\t\t'category_parent' => $category_parent,\n\t\t\t\t'cat_name' => $cat['cat_name'],\n\t\t\t\t'category_description' => $category_description\n\t\t\t);\n\n\t\t\t$id = wp_insert_category( $catarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($cat['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($cat['term_id'])] = $id;\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import category %s', esc_html($cat['category_nicename']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->categories );\n\t}", "private static function _getSelectCategories()\n {\n $categories = Blog::category()->orderBy('name')->all();\n $sortedCategories = array();\n\n foreach($categories as $c)\n $sortedCategories[$c->id] = $c->name;\n\n return $sortedCategories;\n }", "private function getClassCategory($root) {\n\t\treturn \"Science\";\n\t}", "function showCategoryNames(){\n $this->load->model('pagesortingmodel');\n $data['groups'] = $this->pagesortingmodel->getAllCategories();\n $this->load->view('admin/create_categories',$data);\n }", "function cmpByName($a, $b)\n{\n $an = utf8_strtolower($a);\n $bn = utf8_strtolower($b);\n if ($an == $bn) {\n return 0;\n }\n return($an < $bn) ? -1 : 1;\n}", "public function testInvalidCategoryname(){\n\t\t\t$categoryVars = [\n\t\t\t\t'name' => '',\n\t\t\t\t\n\t\t\t];\n\t\t\t$properTest= saveFuncCategory($categoryVars);\n\t\t\t$this->assertFalse($properTest);\n\t\t}", "function getCatTitleBuild( &$categories )\n\t{\n\t\tforeach ($categories as $index => $category)\n\t\t{\n\t\t\tunset($category['Sub_cats']);\n\t\t\t$out[] = $category;\n\t\t\tif ( !empty($categories[$index]['Sub_cats']) )\n\t\t\t{\n\t\t\t\t$out = array_merge($out, $this -> getCatTitleBuild($categories[$index]['Sub_cats']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $out;\n\t}", "function my_separate_category() {\n return 1;\n }", "public function testGetItemSubCategoryTags()\n {\n }", "private function buildCategoryViewTitle()\n {\n $title_chunks = array();\n if ($this->params->get('category_name_order', 0) != 0) {\n if (($this->params->get('category_metatitle', 0) != 0) && ($metatitle = $this->virtuemartHelper->getCategoryMetaTitle())) {\n $title_chunks[$this->params->get('category_name_order')] = $metatitle;\n } else {\n $title_chunks[$this->params->get('category_name_order')] = $this->virtuemartHelper->getCategoryName();\n }\n }\n if ($this->params->get('category_sitename_order', 0) != 0) {\n $title_chunks[$this->params->get('category_sitename_order')] = $this->getSiteName();\n }\n if ($this->params->get('category_customtext_order', 0) != 0) {\n $title_chunks[$this->params->get('category_customtext_order')] = $this->params->get('category_customtext', '');\n }\n ksort($title_chunks);\n\n return (join(' ', $title_chunks));\n }", "public function testSortByName()\n {\n $result=$this->sort->sortByName();\n $result = $this->hotelMapperService->serialize($result);\n $this->assertInternalType('array',$result);\n foreach ($result as $i => $hotel) {\n $this->assertGreaterThan($result[$i+1]['name'],$hotel['name']);\n $this->assertArrayHasKey('name', $hotel);\n $this->assertArrayHasKey('price', $hotel);\n $this->assertArrayHasKey('city', $hotel);\n $this->assertArrayHasKey('availability', $hotel);\n }\n }", "function _wp_object_name_sort_cb($a, $b)\n {\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "function _ficalink_taxonomy_default_vocabularies() {\n $items = array(\n array(\n 'name' => 'Authors',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'authors',\n ),\n array(\n 'name' => 'Characters',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'characters',\n ),\n array(\n 'name' => 'Genres',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'genres',\n ),\n array(\n 'name' => 'Series',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '1',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'series',\n ),\n array(\n 'name' => 'Tags',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'tags',\n ),\n array(\n 'name' => 'Warnings',\n 'description' => '',\n 'help' => '',\n 'relations' => '1',\n 'hierarchy' => '0',\n 'multiple' => '0',\n 'required' => '0',\n 'tags' => '0',\n 'module' => 'taxonomy',\n 'weight' => '0',\n 'nodes' => array(),\n 'machine' => 'warnings',\n ),\n );\n return $items;\n}", "public function categoryName() {\n $categories = array(\n 'Fantasy',\n 'Technology',\n 'Thriller',\n 'Documentation',\n );\n\n return $categories[array_rand($categories)];\n }", "public function getStoriesByCategory($category_name){\n\n\n }", "function GetCategories(){\n\t\t\tglobal $wpdb;\n\n\t\t\t$categories = get_all_category_ids();\n\t\t\t$separator = '|';\n\t\t\t$output = array();\n\t\t\tif($categories){\n\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t$temp_catname = get_cat_name($category);\n\t\t\t\t\tif ($temp_catname !== \"Uncategorized\"){\n\t\t\t\t\t\t$output[$category] = $temp_catname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$output = 'test';\n\t\t\t}\n\t\t\treturn $output;\n\t\t}", "function opdsByAuthorNamesForInitial($initial)\n{\n global $app;\n\n // parameter checking\n if (!(ctype_upper($initial))) {\n $app->getLog()->warn('opdsByAuthorNamesForInitial: invalid initial ' . $initial);\n $app->halt(400, \"Bad parameter\");\n }\n\n $authors = $app->calibre->authorsNamesForInitial($initial);\n $gen = mkOpdsGenerator($app);\n $cat = $gen->authorsNamesForInitialCatalog(null, $authors, $initial);\n mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_NAV);\n}", "public function testGetItemSubCategoryByFilter()\n {\n }", "function _titlesort($a,$b){\n $ta = $this->_meta($a,'title');\n $tb = $this->_meta($b,'title');\n return strcmp($ta,$tb);\n }", "public function testCategoriesAreFilteredByName()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.name]='.$visibleCategory->name)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function testGetAll() {\n // Create\n $this->phactory->create('kb_category');\n\n // Get\n $categories = $this->kb_category->get_all();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "public function testAutoComplete() {\n $account = $this->drupalCreateUser(array('administer monitoring'));\n $this->drupalLogin($account);\n\n // Test with \"C\", which matches Content and Cron.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'C')));\n $this->assertEqual(count($categories), 2, '2 autocomplete suggestions.');\n $this->assertEqual('Content', $categories[0]['label']);\n $this->assertEqual('Cron', $categories[1]['label']);\n\n // Check that a non-matching prefix returns no suggestions.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'non_existing_category')));\n $this->assertTrue(empty($categories), 'No autocomplete suggestions for non-existing query string.');\n }", "public function testGetCategory()\n {\n $category = Category::first();\n\n $response = $this->get(\"/api/categories/+&= %20\");\n $response->assertResponseStatus(400);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/123456789\");\n $response->assertResponseStatus(404);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/\" . $category->slug);\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "public function HM_CategoCuentas()\n {\n }", "public function testThatWeCanGetTheCategories()\n {\n $ads = new Cities;\n \n $ads->setCities('Waterloo');\n\n $this->assertEquals(1 , preg_match( '/^[a-zA-Z]{3,30}$/', $ads->getCities() ), $ads->getCities() . ' is less 3 or more 31' );\n\n\n }", "public function filterSpecificCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"world news\" || $cat == \"football\"/* ||$cat == \"fashion\" || $cat == \"technology\"*/){\n //test fashion whs technology $numb raus? film und politics guuut 0.8\n $newArray[$key] = $value;\n }\n\n /* if($cat == \"sport\"|| $cat == \"football\" || $cat == \"culture\" || $cat == \"art and design\"){\n $newArray[$key] = $value;\n }*/\n\n /*if( $cat == \"sport\" || $cat == \"uk news\" || $cat == \"opinion\" || $cat == \"society\" || $cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" || $cat == \"life and style\" || $cat == \"environment\" || $cat == \"technology\"\n ||$cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" || $cat == \"film\" || $cat == \"books\"\n ||$cat == \"us news\" || $cat == \"football\" || $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"/*){ //20 categories\n $newArray[$key] = $value;\n }*/\n\n /* if( $cat == \"us news\" || $cat == \"technology\" || $cat == \"science\" || $cat == \"sport\" || $cat == \"opinion\" ||\n $cat == \"world news\" || $cat == \"football\" || $cat == \"politics\" || $cat == \"fashion\" || $cat == \"television & radio\"\n ||$cat == \"culture\" || $cat == \"environment\" || $cat == \"art and design\" || $cat == \"life and style\" || $cat == \"travel\"/*\n || $cat == \"books\" || $cat == \"uk news\" || $cat == \"business\" || $cat == \"film\" || $cat == \"society\"){ //20 categories\n $newArray[$key] = $value;\n }\n */\n\n }\n\n\n return $newArray;\n }", "private function getCategoryNames()\n {\n $categoryData = array();\n $this->_connection = $this->_resourceConnection->getConnection();\n $table = $this->_connection->getTableName('catalog_category_entity_varchar');\n $query = \"\n SELECT *\n FROM `{$table}`\n WHERE attribute_id = '{$this->nameAttributeId}'\n \";\n\n $result = $this->_connection->fetchAll($query);\n\n if (count($result) > 0) {\n foreach ($result as $category) {\n if (isset($category['entity_id'])) {\n $categoryData[$category['entity_id']][$category['store_id']] = $category['value'];\n } else {\n $categoryData[$category['row_id']][$category['store_id']] = $category['value'];\n }\n }\n }\n\n return $categoryData;\n }", "function the_category_head($before = '', $after = '')\n {\n }", "function rename_categories() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['category']->labels;\n $labels->name = 'Groups';\n $labels->singular_name = 'Group';\n $labels->add_new = 'Add Group';\n $labels->add_new_item = 'Add Group';\n $labels->edit_item = 'Edit Group';\n $labels->new_item = 'Group';\n $labels->view_item = 'View Group';\n $labels->search_items = 'Search Groups';\n $labels->not_found = 'No Groups found';\n $labels->not_found_in_trash = 'No Groups found in Trash';\n $labels->all_items = 'All Groups';\n $labels->menu_name = 'Groups';\n $labels->name_admin_bar = 'Groups';\n}", "public function testAll()\n\t\t{\n\t\t\tlist ($categoriesBefore) = $this->category->all(array ('nameContains' => 'Top Category'));\n\t\t\tforeach ($categoriesBefore as $categoryBefore) {\n\t\t\t\t$categoryBefore->delete();\n\t\t\t}\n\t\t\t\n\t\t\tfor ($i = 1; $i <= 3; $i++) {\n\t\t\t\t$this->category->create(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'categoryName' => array ('en' => \"Top Category $i\"),\n\t\t\t\t\t\t'categoryImage' => \"topcategory$i.jpg\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tlist ($categories, $count) = $this->category->all(array (\n\t\t\t\t'nameContains' => 'Top Category',\n\t\t\t\t'limit' => 2,\n\t\t\t\t'offset' => 1,\n\t\t\t\t'fields' => 'categoryId,categoryName'\n\t\t\t));\n\t\t\t\n\t\t\t$this->assertEquals(3, $count);\n\t\t\t$this->assertEquals(2, count($categories));\n\t\t\t\n\t\t\tfor ($j = 1; $j <= 2; $j++) {\n\t\t\t\t$this->assertEquals('Top Category '.($j + 1), $categories[$j - 1]->name->EN);\n\t\t\t\t$this->assertTrue(!isset($categories[$j - 1]->image));\n\t\t\t}\n\t\t}", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "function sortByTerm($a, $b) \n{\n\t$aStats = explode ( \":\", $a );\n\t$bStats = explode ( \":\", $b );\n\t\n return strcmp( $aStats[2],$bStats[2] );\n}", "function jigoshop_categories_scripts () {\n\t\n\tif( !isset($_GET['taxonomy']) || $_GET['taxonomy'] !== 'product_cat') return;\n\t\n\twp_register_script('jigoshop-categories-ordering', jigoshop::plugin_url() . '/assets/js/categories-ordering.js', array('jquery-ui-sortable'));\n\twp_print_scripts('jigoshop-categories-ordering');\n\t\n}", "public function getCategory() {}", "function opdsByTagNamesForInitial($initial)\n{\n global $app;\n\n // parameter checking\n if (!(ctype_upper($initial))) {\n $app->getLog()->warn('opdsByTagNamesForInitial: invalid initial ' . $initial);\n $app->halt(400, \"Bad parameter\");\n }\n\n $tags = $app->calibre->tagsNamesForInitial($initial);\n $gen = mkOpdsGenerator($app);\n $cat = $gen->tagsNamesForInitialCatalog(null, $tags, $initial);\n mkOpdsResponse($app, $cat, OpdsGenerator::OPDS_MIME_NAV);\n}", "function convertorderbyin($orderby)\n{\n $orderby = ((isset($orderby)) && ('' != trim($orderby))) ? trim($orderby) : '';\n switch ( $orderby )\n {\n case \"titleA\":\n $orderby = \"title ASC\";\n break;\n case \"hitsA\":\n $orderby = \"hits ASC\";\n break;\n case \"ratingA\":\n $orderby = \"rating ASC\";\n break;\n case \"dateA\":\n $orderby = \"date ASC\";\n break;\n case \"titleD\":\n $orderby = \"title DESC\";\n break;\n case \"hitsD\":\n $orderby = \"hits DESC\";\n break;\n case \"ratingD\":\n $orderby = \"rating DESC\";\n break;\n case\"dateD\":\n default:\n $orderby = \"date DESC\";\n break;\n }\n return $orderby;\n}", "public function getCategory($name);" ]
[ "0.65544987", "0.6477886", "0.6400164", "0.6170126", "0.60505277", "0.6037744", "0.5952182", "0.591921", "0.58667964", "0.58416694", "0.57932484", "0.57478005", "0.5731951", "0.57305545", "0.5715328", "0.5697726", "0.56946456", "0.56941956", "0.56895113", "0.56313586", "0.56209", "0.5567842", "0.55432355", "0.55336356", "0.5528681", "0.54951453", "0.5471833", "0.5471664", "0.5465631", "0.54547745", "0.5422219", "0.5405968", "0.54032254", "0.5378574", "0.5353239", "0.5341088", "0.53321636", "0.53272134", "0.5326092", "0.5313213", "0.5298456", "0.5298205", "0.5295545", "0.5285655", "0.5279131", "0.52653", "0.5255374", "0.52495843", "0.5238391", "0.5237185", "0.5236896", "0.5236476", "0.5232515", "0.5229678", "0.5221626", "0.52145725", "0.5210886", "0.51912004", "0.5189898", "0.51842356", "0.5182948", "0.5179895", "0.51757884", "0.51695955", "0.5168773", "0.5168296", "0.5161205", "0.5160671", "0.5160671", "0.5153094", "0.51489484", "0.51467144", "0.51411355", "0.5140457", "0.51374614", "0.51352346", "0.513302", "0.5128809", "0.5127084", "0.5121868", "0.5116983", "0.51155335", "0.511448", "0.51124036", "0.5108725", "0.5106393", "0.51030046", "0.5100013", "0.5095894", "0.5095894", "0.5095894", "0.50932974", "0.5093124", "0.50915194", "0.50760627", "0.5073636", "0.5073062", "0.50726414", "0.5066861", "0.5066429" ]
0.7210004
0
///////End testing the category name sorting//////////////// ///////Testing the category search//////////////////////////
public function testCategorySearchByName() { echo "\n testCategorySearchByName..."; $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context."/category_search"; $query = "{\"query\": { ". "\"term\" : { \"Name\" : \"Cell Death\" } ". "}}"; $response = $this->just_curl_get_data($url, $query); $response = $this->handleResponse($response); //echo "\n testCategorySearchByName response:".$response."---"; if(is_null($response)) { echo "\n testCategorySearchByName response is empty"; $this->assertTrue(false); } $result = json_decode($response); if(is_null($result)) { echo "\n testCategorySearchByName json is invalid"; $this->assertTrue(false); } if(isset($result->hits->total) && $result->hits->total > 0) $this->assertTrue(true); else $this->assertTrue(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCategoryNameSorting()\n {\n echo \"\\n testCategoryNameSorting...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category/cell_process/Name/asc/0/10000\";\n $response = $this->curl_get($url);\n //echo $response;\n $result = json_decode($response);\n if(isset($result->error))\n {\n echo \"\\nError in testCategoryNameSorting\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n {\n $this->assertTrue(false);\n }\n }", "public function testSortListCategories()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\");\n //Test list user Desc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayAsc[$i - 1]);\n }\n //Test list user Desc\n $browser->click(\"#category-sort-name a\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n for ($i = 1; $i <= 15; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arrayDesc[$i - 1]);\n }\n });\n }", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function testListCategories()\n {\n }", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "public function testSortListCategoriesWhenPanigate()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/categories')\n ->resize(1200, 1600)\n ->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n // Test list Asc\n $arrayAsc = Category::orderBy('name', 'asc')->pluck('name')->toArray();\n $arraySortAsc = array_chunk($arrayAsc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortAsc[$i - 1]);\n }\n // Test list Desc\n $browser->click(\"#category-sort-name a\")\n ->clickLink(\"2\");\n $arrayDesc = Category::orderBy('name', 'desc')->pluck('name')->toArray();\n $arraySortDesc = array_chunk($arrayDesc, 15)[1];\n for ($i = 1; $i <= 2; $i++) {\n $selector = \".table tbody tr:nth-child($i) td:first-child\";\n $this->assertEquals($browser->text($selector), $arraySortDesc[$i - 1]);\n }\n });\n }", "function array_category($catalog, $category){\n // Declare an empty array to hold keys for given category\n $output = array();\n\n // Loop through the $catalog, adding item's ids to the array if they match the given category\n foreach ($catalog as $id => $item){\n // Checks to see if the passed in $category matches the category value for the current item from $catelog\n if ($category == null OR strtolower($category) == strtolower($item[\"category\"])) {\n // In order to sort items, a variable is created containing the current item's title\n $sort = $item[\"title\"];\n // ltrim is used to remove the,a or an from the start of any title where these words appear\n $sort = ltrim($sort,\"The \");\n $sort = ltrim($sort,\"A \");\n $sort = ltrim($sort,\"An \");\n // Title of current item is placed in $output array at the position $id\n $output[$id] = $sort;\n }\n }\n\n // asort is used to sort items in $output alphabetically\n asort($output);\n // return an array of the keys of the $output items\n return array_keys($output);\n}", "public function convert_category_titles()\n\t{\n\t\t$category \t= $split_cat = ee()->TMPL->fetch_param('category');\n\n\t\tif (strtolower(substr($split_cat, 0, 3)) == 'not')\n\t\t{\n\t\t\t$split_cat = substr($split_cat, 3);\n\t\t}\n\n\t\t$categories = preg_split(\n\t\t\t'/' . preg_quote('&') . '|' . preg_quote('|') . '/',\n\t\t\t$split_cat,\n\t\t\t-1,\n\t\t\tPREG_SPLIT_NO_EMPTY\n\t\t);\n\n\t\t$to_fix = array();\n\n\t\tforeach ($categories as $cat)\n\t\t{\n\t\t\tif (preg_match('/\\w+/', trim($cat)))\n\t\t\t{\n\t\t\t\t$to_fix[trim($cat)] = 0;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty ($to_fix))\n\t\t{\n\t\t\t$cats = ee()->db->query(\n\t\t\t\t\"SELECT cat_id, cat_url_title\n\t\t\t\t FROM \texp_categories\n\t\t\t\t WHERE \tcat_url_title\n\t\t\t\t IN \t('\" . implode(\"','\", ee()->db->escape_str(array_keys($to_fix))) . \"')\"\n\t\t\t);\n\n\t\t\tforeach ($cats->result_array() as $row)\n\t\t\t{\n\t\t\t\t$to_fix[$row['cat_url_title']] = $row['cat_id'];\n\t\t\t}\n\n\t\t\tkrsort($to_fix);\n\n\t\t\tforeach ($to_fix as $cat => $id)\n\t\t\t{\n\t\t\t\tif ($id != 0)\n\t\t\t\t{\n\t\t\t\t\t$category = str_replace($cat, $id, $category);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->TMPL->tagparams['category'] = $category;\n\t\t}\n\t}", "public function testSortByHierarchy() {\n // Create\n $this->phactory->create('kb_category');\n\n // Sort them\n $categories = $this->kb_category->sort_by_hierarchy();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertNotNull( $category->depth );\n }", "function category($categoryName, $categoryId, $page)\n {\n $sort = Input::get('sortOrder') == null ? \"BestMatch\" : Input::get('sortOrder');\n $checkedInput = $this->checkedChecked(Input::get());\n $breadCramb = $this->model->getBreadCramb($categoryId);\n\n $filterUrl = $this->generateFilterUrl(Input::get());\n $ebayData = $this->model->getProductsByCategory(\n $categoryId, 42, $page, Input::get(), $sort\n );\n $similarCategories = $this->model->getSimilarCategory($categoryId);\n $filterData = $this->model->getFiltersForCategory($categoryId);\n\n $resultsAmount = $ebayData->totalEntries;\n if ($ebayData->totalPages > 100) {\n $totalPages = 100;\n } else {\n $totalPages = $ebayData->totalPages;\n }\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $categoryName, $page, $this->siteslug, $filterUrl, $categoryId);\n $filtersForTitle = $this->model->getFiltersForTitle($checkedInput);\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n $categoryData['page'] = $page;\n $categoryData['id'] = $categoryId;\n $categoryData['title'] = $categoryName;\n $categoryData['totalResults'] = $resultsAmount;\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n// $this->title = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . 'צי\\'פי קניות ברשת';\n /*if (is_null($sort)) {\n $sortForTitle = '';\n } else {\n $sortForTitle = '-' . $sort;\n }*/\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.amazon');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'amazon';\n };\n //dd($filtersForTitle);\n $this->title = $categoryData['title'] . ' - ' . $breadCramb['category'] . $filtersForTitle . ' - ' . $categoryData['page'] . ' - ' . $this->shopName;\n $this->description = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n //dd($categoryData);\n $productBaseRoute = \"/{$this->siteslug}/product\";\n return view(\"ebay.category\", [\n 'pagination' => $pages,\n 'pageNext' => $pageNext,\n 'categoryData' => $categoryData,\n 'categories' => $this->categories,\n 'productBase' => $productBaseRoute,\n 'siteslug' => $this->siteslug,\n 'ebayData' => $ebayData->products,\n 'filterData' => $filterData,\n 'checkedInput' => $checkedInput,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "private function getPostTitlesByCategory($category) {\n\n $categoryName = $category;\n $result_limit = 'max'; /* max=500 */\n\n $categoryNameForUrl = urlencode($categoryName);\n /*\n * Ordine di aggiunta alla categoria (dalla più recente alla meno recente)\n * https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=categorymembers&cmtitle=Category%3AMember_states_of_the_United_Nations&cmlimit=500&cmsort=timestamp&cmdir=desc&cmnamespace=0\n */\n $api_call = '?action=query&format=json&list=categorymembers&cmtitle=Category:' . $categoryNameForUrl . '&cmlimit=' . $result_limit . '&cmsort=timestamp&cmdir=newer&cmnamespace=0';\n\n $api = new API($this->baseUrl);\n $api_result = $api->getAPIResult($api_call);\n\n $items = $api_result['query']['categorymembers'];\n\n $articles_titles = array_column($items, 'title');\n\n for ($i = 0; $i < count($articles_titles); $i++) {\n if ($articles_titles[$i] === $categoryName || $articles_titles[$i] === 'Azerbaijan-United Nations relations') {\n unset($articles_titles[$i]);\n }\n }\n\n return $articles_titles;\n }", "public function testCategoriesAreFilteredByName()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.name]='.$visibleCategory->name)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "function get_foods_of_category($search_key) {\n if ((!$search_key) || ($search_key == '')) {\n return false;\n }\n \n $conn = db_connect();\n $query = \"select * from food where catogery_name = '\".$search_key.\"'\";\n \n $result = @$conn->query($query);\n if (!$result) {\n return false;\n }\n \n $num_books = @$result->num_rows;\n if ($num_books == 0) {\n return false;\n } \n $result = db_result_to_array($result);\n return $result;\n}", "public function findCategories();", "public function getAllCategoryNames();", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function testCatalogGetCategories()\n {\n\n }", "function showCategoryNames(){\n $this->load->model('pagesortingmodel');\n $data['groups'] = $this->pagesortingmodel->getAllCategories();\n $this->load->view('admin/create_categories',$data);\n }", "public function testGetCatTitle()\n {\n $sManufacturerId = $this->getTestConfig()->getShopEdition() == 'EE'? '88a996f859f94176da943f38ee067984' : 'fe07958b49de225bd1dbc7594fb9a6b0';\n $oManufacturer = oxNew('oxManufacturer');\n $oManufacturer->load($sManufacturerId);\n\n $oManufacturerList = $this->getProxyClass(\"Manufacturerlist\");\n $oManufacturerList->setManufacturerTree(oxNew('oxManufacturerList'));\n $oManufacturerList->setNonPublicVar(\"_oActManufacturer\", $oManufacturer);\n\n $this->assertEquals($oManufacturer->oxmanufacturers__oxtitle->value, $oManufacturerList->getTitle());\n }", "public function getStoriesByCategory($category_name){\n\n\n }", "function _usort_terms_by_name($a, $b)\n {\n }", "public function test_getItemCategoryByFilter() {\n\n }", "function findCategories($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $cat[$x] = new Categorie();\r\n $cat[$x]->setCat_id($row['cat_id']);\r\n $cat[$x]->setCat_title($row['cat_title']);\r\n $cat[$x]->setCat_despription($row['cat_despription']);\r\n \r\n \t}\r\n return $cat; \r\n }", "public function testSortByTitle()\n {\n $item1 = new \\Saitow\\Model\\Tire('sql', 1);\n $item1->setTitle('B');\n\n $item2 = new Saitow\\Model\\Tire('xml', 50);\n $item2->setTitle('A');\n\n $item3 = new \\Saitow\\Model\\Tire('other', 22);\n $item3->setTitle('C');\n\n $items = [$item1, $item2, $item3];\n\n $sorted = TiresCollectionSorter::sort($items, \\Saitow\\Library\\TiresDataSource::ORDERBY_MANUFACTURE);\n\n $this->assertEquals($item2, $sorted[0]);\n $this->assertEquals($item1, $sorted[1]);\n $this->assertEquals($item3, $sorted[2]);\n }", "private function parseCategoryUrl() {\n $sql = \"SELECT\n id,\n name\n FROM\n categories\";\n if(!$stmt = $this->db->prepare($sql)){return $this->db->error;}\n if(!$stmt->execute()) {return $result->error;}\n $stmt->bind_result($id, $name);\n while($stmt->fetch()) {\n $name = lowerCat($name);\n if($this->cat == $name) {\n $this->catId = $id;\n break;\n }\n }\n $stmt->close();\n if($this->catId !== -1) {\n $this->parsedUrl = '/'.$this->catId.'/'.$this->cat;\n }\n }", "function deeez_cats2($category){\n$space_holder = \"\";\n$cat_string = \"\";\n\tforeach ($category as $categorysingle) {\n\t$cat_string .= $space_holder . $categorysingle->name;\n\t$space_holder = \"_\";\n\t}\n\treturn $cat_string;\n}", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "public function testGetItemSubCategoryByFilter()\n {\n }", "public function testAutoComplete() {\n $account = $this->drupalCreateUser(array('administer monitoring'));\n $this->drupalLogin($account);\n\n // Test with \"C\", which matches Content and Cron.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'C')));\n $this->assertEqual(count($categories), 2, '2 autocomplete suggestions.');\n $this->assertEqual('Content', $categories[0]['label']);\n $this->assertEqual('Cron', $categories[1]['label']);\n\n // Check that a non-matching prefix returns no suggestions.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'non_existing_category')));\n $this->assertTrue(empty($categories), 'No autocomplete suggestions for non-existing query string.');\n }", "function ciniki_tenants_searchCategory($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'start_needle'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Search'), \n 'limit'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Limit'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, 0, 'ciniki.tenants.searchCategory'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Search for categories\n //\n $strsql = \"SELECT DISTINCT category AS name \"\n . \"FROM ciniki_tenants \"\n . \"WHERE category like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"AND category <> '' \"\n . \"ORDER BY category COLLATE latin1_general_cs \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'results', 'fname'=>'name', 'name'=>'result', 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['results']) || !is_array($rc['results']) ) {\n return array('stat'=>'ok', 'results'=>array());\n }\n return array('stat'=>'ok', 'results'=>$rc['results']);\n}", "public function testGetCategory()\n {\n $category = Category::first();\n\n $response = $this->get(\"/api/categories/+&= %20\");\n $response->assertResponseStatus(400);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/123456789\");\n $response->assertResponseStatus(404);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/\" . $category->slug);\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "public function testGetProductCategories() {\n \n }", "function findProducts ($text, $category, $limit) {\r\n $sql = \"SELECT * FROM stockitems\";\r\n\r\n //checks if the item is in the requested categories\r\n if (isset($category) && $category != 'all') {\r\n $category = (int)$category;\r\n $sql = $sql . \" WHERE StockItemID IN (SELECT StockItemID FROM stockitemstockgroups WHERE StockGroupID = $category )\";\r\n if (isset($text) && $text != '') {\r\n //adds the text search if needed\r\n $sql = $sql . \"AND StockItemName LIKE '%$text%'\";\r\n }\r\n } else {\r\n //adds the text search if needed\r\n if (isset($text) && $text != '' ) {\r\n $sql = $sql . \" WHERE StockItemName LIKE '%$text%'\";\r\n }\r\n }\r\n\r\n if (isset($limit)) {\r\n $sql = $sql . \" LIMIT $limit\";\r\n }\r\n\r\n return runQuery($sql);\r\n}", "public function testCategoryField()\n {\n\n $field = $this->_field('slug');\n\n // Should just return the slug.\n $this->assertEquals('slug', $field->facetKey());\n\n }", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function getItemsByCategory($name)\n {\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $items = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $escaped = $db->quote(\"%zzz\".$name.\"zzz%\");\n $results = $db->query(\"SELECT itemrevision_id FROM metadatavalue WHERE value LIKE $escaped AND metadata_id='\".$metadataDao->getKey().\"'\")\n ->fetchAll();\n \n foreach($results as $result)\n {\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"'\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $revision = MidasLoader::loadModel(\"ItemRevision\")->load($result['itemrevision_id']);\n if($revision)\n {\n $items[] = $revision->getItem()->getKey();\n }\n } \n }\n return $items;\n }", "public function filterSpecificCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"world news\" || $cat == \"football\"/* ||$cat == \"fashion\" || $cat == \"technology\"*/){\n //test fashion whs technology $numb raus? film und politics guuut 0.8\n $newArray[$key] = $value;\n }\n\n /* if($cat == \"sport\"|| $cat == \"football\" || $cat == \"culture\" || $cat == \"art and design\"){\n $newArray[$key] = $value;\n }*/\n\n /*if( $cat == \"sport\" || $cat == \"uk news\" || $cat == \"opinion\" || $cat == \"society\" || $cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" || $cat == \"life and style\" || $cat == \"environment\" || $cat == \"technology\"\n ||$cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" || $cat == \"film\" || $cat == \"books\"\n ||$cat == \"us news\" || $cat == \"football\" || $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"/*){ //20 categories\n $newArray[$key] = $value;\n }*/\n\n /* if( $cat == \"us news\" || $cat == \"technology\" || $cat == \"science\" || $cat == \"sport\" || $cat == \"opinion\" ||\n $cat == \"world news\" || $cat == \"football\" || $cat == \"politics\" || $cat == \"fashion\" || $cat == \"television & radio\"\n ||$cat == \"culture\" || $cat == \"environment\" || $cat == \"art and design\" || $cat == \"life and style\" || $cat == \"travel\"/*\n || $cat == \"books\" || $cat == \"uk news\" || $cat == \"business\" || $cat == \"film\" || $cat == \"society\"){ //20 categories\n $newArray[$key] = $value;\n }\n */\n\n }\n\n\n return $newArray;\n }", "public function nfosorter($category = 0, $id = 0)\n\t{\n\t\t$idarr = ($id != 0 ? sprintf('AND r.id = %d', $id) : '');\n\t\t$cat = ($category = 0 ? sprintf('AND r.categoryid = %d', \\Category::CAT_MISC) : sprintf('AND r.categoryid = %d', $category));\n\n\t\t$res = $this->pdo->queryDirect(\n\t\t\t\t\t\tsprintf(\"\n\t\t\t\t\t\t\tSELECT UNCOMPRESS(rn.nfo) AS nfo,\n\t\t\t\t\t\t\t\tr.id, r.name, r.searchname\n\t\t\t\t\t\t\tFROM release_nfos rn\n\t\t\t\t\t\t\tINNER JOIN releases r ON rn.releaseid = r.id\n\t\t\t\t\t\t\tINNER JOIN groups g ON r.group_id = g.id\n\t\t\t\t\t\t\tWHERE rn.nfo IS NOT NULL\n\t\t\t\t\t\t\tAND r.proc_sorter = %d\n\t\t\t\t\t\t\tAND r.preid = 0 %s\",\n\t\t\t\t\t\t\tself::PROC_SORTER_NONE,\n\t\t\t\t\t\t\t($idarr = '' ? $cat : $idarr)\n\t\t\t\t\t\t)\n\t\t);\n\n\t\tif ($res !== false && $res instanceof \\Traversable) {\n\n\t\t\tforeach ($res as $row) {\n\n\t\t\t\tif (strlen($row['nfo']) > 100) {\n\n\t\t\t\t\t$nfo = utf8_decode($row['nfo']);\n\n\t\t\t\t\tunset($row['nfo']);\n\t\t\t\t\t$matches = $this->_sortTypeFromNFO($nfo);\n\n\t\t\t\t\tarray_shift($matches);\n\t\t\t\t\t$matches = $this->doarray($matches);\n\n\t\t\t\t\tforeach ($matches as $m) {\n\n\t\t\t\t\t\t$case = (isset($m) ? str_replace(' ', '', $m) : '');\n\n\t\t\t\t\t\tif (in_array($m, ['os', 'platform', 'console']) && preg_match('/(?:\\bos\\b(?: type)??|platform|console)[ \\.\\:\\}]+(\\w+?).??(\\w*?)/iU', $nfo, $set)) {\n\t\t\t\t\t\t\tif (is_array($set)) {\n\t\t\t\t\t\t\t\tif (isset($set[1])) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[1]);\n\t\t\t\t\t\t\t\t} else\tif (isset($set[2]) && strlen($set[2]) > 0 && (stripos($set[2], 'mac') !== false || stripos($set[2], 'osx') !== false)) {\n\t\t\t\t\t\t\t\t\t$case = strtolower($set[2]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$case = str_replace(' ', '', $m);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$pos = $this->nfopos($this->_cleanStrForPos($nfo), $this->_cleanStrForPos($m));\n\t\t\t\t\t\tif ($pos !== false && $pos > 0.55 && $case !== 'imdb') {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if ($ret = $this->matchnfo($case, $nfo, $row)) {\n\t\t\t\t\t\t\treturn $ret;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->_setProcSorter(self::PROC_SORTER_DONE, $id);\n\t\techo \".\";\n\t\treturn false;\n\t}", "function searchCoursesByCategory($categoryId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE CategoryId='\" . $categoryId . \"' ORDER BY popularity\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function testThatWeCanGetTheCategories()\n {\n $ads = new Cities;\n \n $ads->setCities('Waterloo');\n\n $this->assertEquals(1 , preg_match( '/^[a-zA-Z]{3,30}$/', $ads->getCities() ), $ads->getCities() . ' is less 3 or more 31' );\n\n\n }", "public function testSortByName()\n {\n $result=$this->sort->sortByName();\n $result = $this->hotelMapperService->serialize($result);\n $this->assertInternalType('array',$result);\n foreach ($result as $i => $hotel) {\n $this->assertGreaterThan($result[$i+1]['name'],$hotel['name']);\n $this->assertArrayHasKey('name', $hotel);\n $this->assertArrayHasKey('price', $hotel);\n $this->assertArrayHasKey('city', $hotel);\n $this->assertArrayHasKey('availability', $hotel);\n }\n }", "function searchCoursesByQueryAndCategory($searchQuery, $categoryId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE CategoryId='\" . $categoryId . \"' AND (name LIKE '%\" . $searchQuery . \"%' OR description LIKE '%\" . $searchQuery . \"%' OR author LIKE '%\" . $searchQuery . \"%') ORDER BY creationDate\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "function getContentByCategory($category, $sortBy, $sortDir){\n $categoryFilter = \"WHERE (title<>'' AND description<>'' AND cover<>'' AND visible=1)\";\n if($category != \"all\"){\n $categoryFilter .= \" AND (find_in_set('\". $category .\"',category) <> 0)\";\n }\n\n $this->db->query(\"SET NAMES utf8\");\n\n // get all documentaries in table and sorted\n return $this->query(\"SELECT * FROM docs \". $categoryFilter .\" ORDER BY \". $sortBy .\" \". $sortDir);\n }", "function get_catname($cat_id)\n {\n }", "function load_categories($category_table='',$order_by='ORDER BY bias',$sort_by=null){\n\t\t$categories=array();\n\t\t$s=query(\"SELECT * FROM \".$category_table.\" \".$order_by);\n\t\twhile($one=fetch_object($s)){\n\t\t\tif(!empty($one->cat_id)){ $id=$one->cat_id; $id_name='cat_id'; }else{ $id=$one->page_id; $id_name='page_id'; }\n\t\t\tif($one->bias==0){ query(\"update \".$category_table.\" set bias=\".$id.\" where \".$id_name.\"=\".$id); }\n\t\t\t$one->name\t\t\t=htmlspecialchars($one->name);\n\t\t\t$one->description\t=$one->description;\n\t\t\t$one->url_name\t\t=$this->make_clean_url($one->name);\n\t\t\t$categories[$id]=$one;\n\t\t}\n\t\tif($sort_by){\n\t\t\t$categories_sorted=array(); foreach($categories as $id=>$cat){ $categories_sorted[$id]=$cat->name; }\n\t\t\tarray_multisort( \n\t\t\t\t$categories_sorted, $sort_by,\n\t\t\t\t$categories\n\t\t\t);\n\t\t}\n\t\treturn $categories;\n\t}", "function findByName($name) {\n \t$str_len = strlen($name);\n \ttrim($name);\n \t$name = str_replace('category', '', strtolower($name));\n \t\n\t\t$conn = Doctrine_Manager::connection();\n\t\t// query for check if location exists\n\t\t$unique_query = \"SELECT id FROM commoditycategory WHERE LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') OR LOWER(name) LIKE LOWER('%\".$name.\"%') \";\n\t\t$result = $conn->fetchOne($unique_query);\n\t\t// debugMessage($unique_query);\n\t\t// debugMessage($result);\n\t\treturn $result; \n\t}", "public function test_getItemCategoryTags() {\n\n }", "public function testGetItemSubCategoryTags()\n {\n }", "public function testAll()\n\t\t{\n\t\t\tlist ($categoriesBefore) = $this->category->all(array ('nameContains' => 'Top Category'));\n\t\t\tforeach ($categoriesBefore as $categoryBefore) {\n\t\t\t\t$categoryBefore->delete();\n\t\t\t}\n\t\t\t\n\t\t\tfor ($i = 1; $i <= 3; $i++) {\n\t\t\t\t$this->category->create(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'categoryName' => array ('en' => \"Top Category $i\"),\n\t\t\t\t\t\t'categoryImage' => \"topcategory$i.jpg\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tlist ($categories, $count) = $this->category->all(array (\n\t\t\t\t'nameContains' => 'Top Category',\n\t\t\t\t'limit' => 2,\n\t\t\t\t'offset' => 1,\n\t\t\t\t'fields' => 'categoryId,categoryName'\n\t\t\t));\n\t\t\t\n\t\t\t$this->assertEquals(3, $count);\n\t\t\t$this->assertEquals(2, count($categories));\n\t\t\t\n\t\t\tfor ($j = 1; $j <= 2; $j++) {\n\t\t\t\t$this->assertEquals('Top Category '.($j + 1), $categories[$j - 1]->name->EN);\n\t\t\t\t$this->assertTrue(!isset($categories[$j - 1]->image));\n\t\t\t}\n\t\t}", "private function filterCategory()\n {\n if(empty($this->category) || $this->category === static::FILTER_CATEGORY_NONE) {\n return;\n }\n\n if($this->category === static::FILTER_CATEGORY_OTHER) {\n $this->query->andWhere(['LIKE', 'category', 'yii\\\\']);\n return;\n }\n\n $this->query->andWhere(['category' => $this->category]);\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function testGETCategory()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/category/1',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Found\",\"data\":{\"totalCount\":1,\"category\":{\"id\":\"1\",\"name\":\"cat1\",\"posts\":[{\"id\":\"1\",\"title\":\"title1\",\"content\":\"content1\",\"create_time\":\"2013-08-07 10:09:41\",\"author_id\":\"1\"}]}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function testGetCategoriesUsingGET()\n {\n }", "function parse_categories($html)\r\n {\r\n // truncate the html string for easier processing\r\n $html_start = '<ul class=\"org-cats-2\">';\r\n $html_start_pos = strpos($html, $html_start) + strlen($html_start);\r\n $html_end = '</ul>';\r\n $html = substr($html, $html_start_pos , strpos($html, $html_end, $html_start_pos) - $html_start_pos);\r\n \r\n // pull OSL category and the ID they assign to later add to tag table\r\n preg_match_all('#value=\"(\\d*?)\".*?>\\s*(.*?)\\s<#si', $html, $categories_all, PREG_SET_ORDER); \r\n foreach ($categories_all as $index => $tag)\r\n {\r\n $categories_all[$index][2] = substr($tag[2],0,-12);\r\n }\r\n return $categories_all; \r\n }", "function cmpByName($a, $b)\n{\n $an = utf8_strtolower($a);\n $bn = utf8_strtolower($b);\n if ($an == $bn) {\n return 0;\n }\n return($an < $bn) ? -1 : 1;\n}", "function getCatTitleSort( &$categories, $level = 0, $parent = 0, $out = false, $log = false, $bread_crumbs = false )\n\t{\n\t\tforeach ($categories as $index => $category)\n\t\t{\n\t\t\tif ( $category['Parent_ID'] == $parent )\n\t\t\t{\n\t\t\t\t$bread_crumbs[$category['ID']] = $category['Parent_ID'];\n\t\t\t\t$tmp[$category['ID']] = $category;\n\t\t\t\t$tmp[$category['ID']]['pName'] = 'categories+name+'. $category['Key'];\n\t\t\t\t$tmp[$category['ID']]['margin'] = $category['Level'] * 10 + 5;\n\t\t\t\t$log[$category['Level']][$category['ID']] = $category['ID'];\n\t\t\t\tunset($categories[$index]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this -> rlArraySort($tmp, 'name');\n\t\t\n\t\tforeach ( $tmp as $t_item )\n\t\t{\n\t\t\t$ttmp[$t_item['ID']] = $t_item;\n\t\t}\n\t\t$tmp = $ttmp;\n\t\tunset($ttmp);\n\t\t\n\t\t$next_parent = array_shift($log[$level]);\n\n\t\tif ( empty($out) )\n\t\t{\n\t\t\t$out = $tmp;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( $tmp )\n\t\t\t{\n\t\t\t\t$relations = $this -> getCatTitleBC($bread_crumbs, $parent);\n\t\t\t\teval('$out'. $relations .' = $tmp;');\n\t\t\t}\n\t\t}\n\t\tunset($tmp, $relations);\n\t\t\n\t\tif ( empty($log[$level]) )\n\t\t{\n\t\t\tunset($log[$level]);\n\t\t\t$level++;\n\t\t}\n\t\t\n\t\t//if ( !empty($log) && !empty($categories) )\n\t\tif ( $next_parent && !empty($categories) )\n\t\t{\n\t\t\treturn $this -> getCatTitleSort($categories, $level, $next_parent, $out, $log, $bread_crumbs);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $out;\n\t\t}\n\t}", "function get_cat_name($cat_id)\n {\n }", "public function testInvalidCategoryname(){\n\t\t\t$categoryVars = [\n\t\t\t\t'name' => '',\n\t\t\t\t\n\t\t\t];\n\t\t\t$properTest= saveFuncCategory($categoryVars);\n\t\t\t$this->assertFalse($properTest);\n\t\t}", "public function get_categories($category = '')\n {\n /** @var \\tacitus89\\homepage\\entity\\category[] $entities */\n $entities = array();\n\n\t\t//it show all categories\n if($category == ''){\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1, '. FORUMS_TABLE .' f2\n\t\t\tWHERE (f2.hp_show = 1 AND f2.parent_id = 0\n\t\t\t AND (f1.hp_special = 0 AND f1.hp_show = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id)) )\n\t\t\t\tOR (f1.forum_id = 543 AND f2.forum_id = 543)\n\t\t\t\tOR (f2.hp_show = 1 AND f1.hp_special = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id))\n\t\t\tORDER BY f1.hp_special, f1.left_id ASC';\n }\n\t\t//Special url\n\t\t//display all modding forums\n elseif ($category == 'modding') {\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tWHERE f1.hp_show = 1 AND f1.hp_special = 1\n\t\t\tORDER BY f1.left_id ASC';\n }\n\t\t//display all forums of category\n\t\telse {\n\t\t\t$sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tRIGHT JOIN '. FORUMS_TABLE .' f2 ON (f2.left_id < f1.left_id AND f2.right_id > f1.right_id)\n\t\t\tWHERE f1.hp_show = 1 AND f2.hp_show = 1 \n\t\t\t\tAND f1.hp_special = 0 AND f2.hp_special = 0\n\t\t\t AND f2.hp_url = \"'. $category .'\"\n\t\t\tORDER BY f1.left_id ASC';\n\t\t}\n // Load all page data from the database\n $result = $this->db->sql_query($sql);\n\n while ($row = $this->db->sql_fetchrow($result))\n {\n\t\t\t//adding to pseudo-Category\n\t\t\tif($row['hp_special'] == 1)\n\t\t\t{\n\t\t\t\t$row['parent_id'] = 543;\n\t\t\t}\n\t\t\t//pseudo-Category\n\t\t\tif($row['forum_id'] == 543)\n\t\t\t{\n\t\t\t\t$row['forum_name'] = 'Modding';\n\t\t\t\t$row['hp_url'] = 'modding';\n\t\t\t}\n\t\t\t\n $category = $this->container->get('tacitus89.homepage.category')->import($row);\n if(isset($entities[$row['parent_id']]) && $row['parent_id'] > 0)\n {\n\t\t\t\t$entities[$row['parent_id']]->add_forum($category);\n }\n else\n {\n // Import each page row into an entity\n $entities[$row['forum_id']] = $category;\n }\n }\n $this->db->sql_freeresult($result);\n\n // Return all page entities\n return $entities;\n }", "function filter($_search, $_category, $_sort){\n\t\tinclude('mysql_r_db_connect.php');\n\t\t\n\t\t//Create dynamically OREDER BY\n\t\tswitch ($_sort){\n\t\t\tcase 1:\n\t\t\t\t$_sort = 'ORDER BY fldIdProduct DESC';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$_sort = 'ORDER BY fldPrice ASC';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$_sort = 'ORDER BY fldPrice DESC';\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$_search = '%' . $_search . '%';\n\t\t\n\t\t//Check if such product exists \n\t\t$sql = \"SELECT COUNT(fldIdProduct) FROM tblProducts WHERE fldProduct LIKE '$_search'\";\n\t\t$quantity = $handle -> prepare($sql);\n\t\t$quantity->execute();\n\t\t$row = $quantity->fetchColumn();\n\t\t\n\t\tif ($row != 0){\n\t\t\t\n\t\t\t//Check if to search in specific category or in all\n\t\t\t$sql = \"SELECT COUNT(fldIdCategory) FROM tblCategorys WHERE fldCategoryShort LIKE '$_category'\";\n\t\t\t$quantity = $handle -> prepare($sql);\n\t\t\t$quantity->execute();\n\t\t\t$row = $quantity->fetchColumn();\n\t\t\t\n\t\t\tif ($row == 0){\n\t\t\t\n\t\t\t\t//SQL query to show the wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldEnabled <> false $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\t\n\t\t\t\techo '\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t';\n\t\t\t\t\n\t\t\t//SQL query to create modal for shown Products\n\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldEnabled <> false $_sort\";\n\t\t\t$stmt = $handle->query($sql);\n\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t//SQL query to get seller\n\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of modal-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//Search for entries in specific category\n\t\t\t\t$sql_cat = \"SELECT fldIdCategory FROM tblCategorys WHERE fldCategoryShort LIKE '$_category'\";\n\t\t\t\t$stmt_cat = $handle->query($sql_cat);\n\t\t\t\t$row_cat = $stmt_cat->fetchObject();\n\t\t\t\t\n\t\t\t\t//SQL query to show wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldProduct LIKE '$_search' AND fldFkCategory LIKE '$row_cat->fldIdCategory' AND fldEnabled <> false $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\techo '\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t';\t\n\t\t\t\t//SQL query to create modal for shown Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldProduct LIKE '$_search' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//SQL query to get seller\n\t\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of modal-->\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//Search for tags with the same words like the user input\n\t\t\t$sql = \"SELECT COUNT(fldIdTag) FROM tblTags WHERE fldTag LIKE '$_search'\";\n\t\t\t$quantity = $handle -> prepare($sql);\n\t\t\t$quantity->execute();\n\t\t\t$row = $quantity->fetchColumn();\n\t\t\t\n\t\t\tif ($row != 0){\n\t\t\t\t//Get ID of Tag\n\t\t\t\t$sql_tag = \"SELECT fldIdTag FROM tblTags WHERE fldTag LIKE '$_search'\";\n\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t$row_tag = $stmt_tag->fetchObject();\t\n\t\t\t\t\n\t\t\t\t//Get FK of Tag from in between table\n\t\t\t\t$sql_pro = \"SELECT fldFkProduct FROM tblProductsToTags WHERE fldFkTag LIKE '$row_tag->fldIdTag'\";\n\t\t\t\t$stmt_pro = $handle->query($sql_pro);\n\t\t\t\t$row_pro = $stmt_pro->fetchObject();\n\t\t\t\t\n\t\t\t\t//SQL query to show the wanted Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldPrice, fldImage FROM tblProducts WHERE fldIdProduct LIKE '$row_pro->fldFkProduct' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\techo '\n\t\t\t\t\t\t<!-- Begin of product content-->\n\t\t\t\t\t\t<div class=\"col m6\">\n\t\t\t\t\t\t\t<!-- Beginn of product-->\n\t\t\t\t\t\t\t<div class=\"card\">\n\t\t\t\t\t\t\t\t<div class=\"card-image\">\n\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\">\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<a class=\"btn-floating halfway-fab waves-effect waves-light red modal-trigger\" href=\"#' . $row->fldIdProduct . '\"><i class=\"material-icons\">add</i></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"card-content center\">\n\t\t\t\t\t\t\t\t\t<p>' . $row->fldProduct . '</p>\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldPrice . ' CHF</h4>\n\t\t\t\t\t\t\t\t\t<br/>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//SQL query to get FK of Tag\n\t\t\t\t\t\t\t\t\t$sql_fk_tag = \"SELECT fldFkTag FROM tblProductsToTags WHERE fldFkProduct LIKE '$row->fldIdProduct'\";\n\t\t\t\t\t\t\t\t\t$stmt_fk_tag = $handle->query($sql_fk_tag);\n\t\t\t\t\t\t\t\t\twhile($row_fk_tag = $stmt_fk_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t//SQL query to get Tag\n\t\t\t\t\t\t\t\t\t\t$sql_tag = \"SELECT fldTag FROM tblTags WHERE fldIdTag LIKE '$row_fk_tag->fldFkTag'\";\n\t\t\t\t\t\t\t\t\t\t$stmt_tag = $handle->query($sql_tag);\n\t\t\t\t\t\t\t\t\t\twhile($row_tag = $stmt_tag->fetchObject()){\n\t\t\t\t\t\t\t\t\t\t\techo '<div class=\"chip\"><a href=\"filter.php?search='.$row_tag->fldTag.'&category=All&sort=1&start_search=Suchen\">' . $row_tag->fldTag . '</a></div>';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of product-->\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<!-- End of product content-->\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//SQL query to create modal for shown Products\n\t\t\t\t$sql = \"SELECT fldIdProduct, fldProduct, fldDescription, fldPrice, fldImage, fldFkSoldBy FROM tblProducts WHERE fldIdProduct LIKE '$row_pro->fldFkProduct' $_sort\";\n\t\t\t\t$stmt = $handle->query($sql);\n\t\t\t\twhile($row = $stmt->fetchObject()){\n\t\t\t\t\t//SQL query to get seller\n\t\t\t\t\t$sql_seller = \"SELECT fldUsername FROM tblUsers WHERE fldIdUser LIKE '$row->fldFkSoldBy'\";\n\t\t\t\t\t$stmt_seller = $handle->query($sql_seller);\n\t\t\t\t\twhile($row_seller = $stmt_seller->fetchObject()){\n\t\t\t\t\t\t//Auto generated HTML for display Products\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t\t<div id=\"' . $row->fldIdProduct . '\" class=\"modal\">\n\t\t\t\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t\t\t\t\t<h4>' . $row->fldProduct . '</h4>\n\t\t\t\t\t\t\t\t\t<div class=\"clearfix float-my-children\">\n\t\t\t\t\t\t\t\t\t\t<img src=\"img/products/' . $row->fldImage . '\" class=\"imagepadding\">\n\t\t\t\t\t\t\t\t\t\t<!-- Modal details container-->\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescTitle\">Produkt Beschreibung:</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"Description\">' . $row->fldDescription . '</p>\n\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescPrice\">\n\t\t\t\t\t\t\t\t\t\t\tPreis: ' . $row->fldPrice . ' CHF\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<!-- Buy informations button/link-->\n\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"buy.php?product=' . $row->fldIdProduct . '\" class=\"waves-effect waves-light btn\">Jetzt Kaufen</a>\n\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"DescVerkaufer\">Verkaufer: <a href=\"userprof.php?user=' . $row->fldFkSoldBy . '\">' . $row_seller->fldUsername . '</a></p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<!-- End of buy informations-->\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<!-- End of details container-->\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<!-- Modal bottom button-->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t\t\t\t<a class=\"modal-action modal-close waves-effect waves-teal lighten-2 btn-flat\">Schliessen</a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<!-- End of bottom button-->\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<!-- End of modal-->\n\t\t\t\t\t\t';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\techo '</div></div>';\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\techo 'Es tut uns leid, aber es konnten keine Produkte mit diesen Suchkriterien gefunden werden</div></div>';\n\t\t\t}\n\t\t}\n\t}", "function matchFirstCategory( $menuname, $categories ) {\n # First load and parse the template page \n $content = loadTemplate( $menuname );\n \n # Navigation list\n $breadcrumb = '';\n preg_match_all( \"`<li>\\s*?(.*?)\\s*</li>`\", $content, $matches, PREG_PATTERN_ORDER );\n \n # Look for the first matching category or a default string\n foreach ( $matches[1] as $nav ) {\n $pos = strpos( $nav, DELIM ); // End of category\n if ( $pos !== false ) {\n $cat = trim( substr($nav, 0, $pos) );\n $crumb = trim( substr($nav, $pos + 1) );\n // Is there a match for any of our page's categories? \n if ( $cat == 'default' ) {\n $breadcrumb = $crumb;\n }\n else if ( in_array( $cat, $categories ) ) {\n $breadcrumb = $crumb;\n break;\n }\n }\n }\n \n return normalizeParameters( $breadcrumb, DELIM, 3 );\n}", "public function testAddItemSubCategoryTag()\n {\n }", "private function searchByCategory($category){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($category)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n foreach($item->categories as $category_tmp)\n if($category == $category_tmp){\n $searchResults[] = $item;\n } \n }\n return $searchResults;\n }", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "function sortRecipesAlphabetical($recipes)\n{\n\t$count = count($recipes);\n\t$indexes = array();\n\t\n\t//set default index ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\t$indexes[$i] = $i;\n\t}\n\t\n\t//sort indexes based on recipe name alphabetical ordering \n\tfor ($i = 0; $i < $count; $i++)\n\t{\n\t\tfor ($j = 0; ($j < $count) && ($j != $i); $j++)\n\t\t{\n\t\t\t$index1 = $indexes[$i];\n\t\t\t$index2 = $indexes[$j];\n\t\t\t\n\t\t\tif (strcmp($recipes[$index1][\"name\"], $recipes[$index2][\"name\"]) < 0)\n\t\t\t{\n\t\t\t\t$indexes[$i] = $index2;\n\t\t\t\t$indexes[$j] = $index1;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $indexes;\n}", "function categories($prefix_subcategories = true)\n{\n $temp = [];\n $temp['01-00'] = 'Arts';\n $temp['01-01'] = 'Design';\n $temp['01-02'] = 'Fashion & Beauty';\n $temp['01-03'] = 'Food';\n $temp['01-04'] = 'Books';\n $temp['01-05'] = 'Performing Arts';\n $temp['01-06'] = 'Visual Arts';\n\n $temp['02-00'] = 'Business';\n $temp['02-02'] = 'Careers';\n $temp['02-03'] = 'Investing';\n $temp['02-04'] = 'Management';\n $temp['02-06'] = 'Entrepreneurship';\n $temp['02-07'] = 'Marketing';\n $temp['02-08'] = 'Non-Profit';\n\n $temp['03-00'] = 'Comedy';\n $temp['03-01'] = 'Comedy Interviews';\n $temp['03-02'] = 'Improv';\n $temp['03-03'] = 'Stand-Up';\n\n $temp['04-00'] = 'Education';\n $temp['04-04'] = 'Language Learning';\n $temp['04-05'] = 'Courses';\n $temp['04-06'] = 'How To';\n $temp['04-07'] = 'Self-Improvement';\n\n $temp['20-00'] = 'Fiction';\n $temp['20-01'] = 'Comedy Fiction';\n $temp['20-02'] = 'Drama';\n $temp['20-03'] = 'Science Fiction';\n\n $temp['06-00'] = 'Government';\n\n $temp['30-00'] = 'History';\n\n $temp['07-00'] = 'Health & Fitness';\n $temp['07-01'] = 'Alternative Health';\n $temp['07-02'] = 'Fitness';\n // $temp['07-03'] = 'Self-Help';\n $temp['07-04'] = 'Sexuality';\n $temp['07-05'] = 'Medicine';\n $temp['07-06'] = 'Mental Health';\n $temp['07-07'] = 'Nutrition';\n\n $temp['08-00'] = 'Kids & Family';\n $temp['08-01'] = 'Education for Kids';\n $temp['08-02'] = 'Parenting';\n $temp['08-03'] = 'Pets & Animals';\n $temp['08-04'] = 'Stories for Kids';\n\n $temp['40-00'] = 'Leisure';\n $temp['40-01'] = 'Animation & Manga';\n $temp['40-02'] = 'Automotive';\n $temp['40-03'] = 'Aviation';\n $temp['40-04'] = 'Crafts';\n $temp['40-05'] = 'Games';\n $temp['40-06'] = 'Hobbies';\n $temp['40-07'] = 'Home & Garden';\n $temp['40-08'] = 'Video Games';\n\n $temp['09-00'] = 'Music';\n $temp['09-01'] = 'Music Commentary';\n $temp['09-02'] = 'Music History';\n $temp['09-03'] = 'Music Interviews';\n\n $temp['10-00'] = 'News';\n $temp['10-01'] = 'Business News';\n $temp['10-02'] = 'Daily News';\n $temp['10-03'] = 'Entertainment News';\n $temp['10-04'] = 'News Commentary';\n $temp['10-05'] = 'Politics';\n $temp['10-06'] = 'Sports News';\n $temp['10-07'] = 'Tech News';\n\n $temp['11-00'] = 'Religion & Spirituality';\n $temp['11-01'] = 'Buddhism';\n $temp['11-02'] = 'Christianity';\n $temp['11-03'] = 'Hinduism';\n $temp['11-04'] = 'Islam';\n $temp['11-05'] = 'Judaism';\n $temp['11-06'] = 'Religion';\n $temp['11-07'] = 'Spirituality';\n\n $temp['12-00'] = 'Science';\n $temp['12-01'] = 'Medicine';\n $temp['12-02'] = 'Natural Sciences';\n $temp['12-03'] = 'Social Sciences';\n $temp['12-04'] = 'Astronomy';\n $temp['12-05'] = 'Chemistry';\n $temp['12-06'] = 'Earth Sciences';\n $temp['12-07'] = 'Life Sciences';\n $temp['12-08'] = 'Mathematics';\n $temp['12-09'] = 'Nature';\n $temp['12-10'] = 'Physics';\n\n $temp['13-00'] = 'Society & Culture';\n // $temp['13-01'] = 'History';\n $temp['13-02'] = 'Personal Journals';\n $temp['13-03'] = 'Philosophy';\n $temp['13-04'] = 'Places & Travel';\n $temp['13-05'] = 'Relationships';\n $temp['13-06'] = 'Documentary';\n\n $temp['14-00'] = 'Sports';\n $temp['14-05'] = 'Baseball';\n $temp['14-06'] = 'Basketball';\n $temp['14-07'] = 'Cricket';\n $temp['14-08'] = 'Fantasy Sports';\n $temp['14-09'] = 'Football';\n $temp['14-10'] = 'Golf';\n $temp['14-11'] = 'Hockey';\n $temp['14-12'] = 'Rugby';\n $temp['14-13'] = 'Running';\n $temp['14-14'] = 'Soccer';\n $temp['14-15'] = 'Swimming';\n $temp['14-16'] = 'Tennis';\n $temp['14-17'] = 'Volleyball';\n $temp['14-18'] = 'Wilderness';\n $temp['14-19'] = 'Wrestling';\n\n $temp['15-00'] = 'Technology';\n\n $temp['50-00'] = 'True Crime';\n\n $temp['16-00'] = 'TV & Film';\n $temp['16-01'] = 'After Shows';\n $temp['16-02'] = 'Film History';\n $temp['16-03'] = 'Film Interviews';\n $temp['16-04'] = 'Film Reviews';\n $temp['16-05'] = 'TV Reviews';\n\n if ($prefix_subcategories) {\n foreach ($temp as $key => $val) {\n $parts = explode('-', $key);\n $cat = $parts[0];\n $subcat = $parts[1];\n\n if ($subcat != '00') {\n $temp[$key] = $temp[$cat.'-00'].' > '.$val;\n }\n }\n }\n\n return $temp;\n}", "function rule_names($category, $offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/rule_names');\n\t\tlog_message('debug', '_setting/rule_names:: [1] category='.$category.' offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['category_condition'] = !empty($category)? \" AND category ='\".$category.\"' \": '';\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND display LIKE '%\".htmlentities($phrase, ENT_QUOTES).\"%'\": '';\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_rule_name_list', 'variables'=>$values));\n\t\tlog_message('debug', '_setting/rule_names:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n\t}", "function detect_category_name($name){\n \tglobal $db;\n \t$query = \n ' SELECT cat_categoryName \n FROM categories \n WHERE cat_categoryName = :name'; \t\n $statement = $db->prepare($query);\n $statement->bindValue(':name', $name);\n \t$statement->execute();\n $testValue = $statement->fetch();\n $statement->closeCursor();\n return $testValue;\n}", "function businessNameSort ($x, $y) {\r\n return strcasecmp($x['businessName'], $y['businessName']);\r\n}", "public function getCategoryName() {\n try {\n // connect to db\n $pdo = $this->_db->connect();\n\n // set up SQL\n $sql = \"SELECT categoryName FROM category WHERE categoryId = \" . $_GET[\"categoryId\"];\n $stmt = $pdo->prepare($sql);\n\n // execuet SQL\n $rows = $this->_db->executeSQL($stmt);\n\n return $rows;\n } catch (PDOException $e) {\n throw $e;\n }\n }", "public function testGetAll() {\n // Create\n $this->phactory->create('kb_category');\n\n // Get\n $categories = $this->kb_category->get_all();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "function TestCase_lookup_category_name_by_id($category_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.lookup_category_name_by_id', array(new xmlrpcval($category_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "function getCategoryNameById($cat_id) {\n $ci = & get_instance();\n $category = $ci->crud->get(ES_PRODUCT_CATEGORIES, array('id' => $cat_id));\n if (count($category) > 0) {\n return $category['name'];\n } else {\n return \"Not available\";\n }\n}", "public function listCategory()\n {\n if (isset($_GET['search'])) $data['search'] = $_GET['search'];\n $data['categorys_list'] = Category::OrderBy('title', 'asc');\n if (!empty($data['search'])) {\n $search_token = explode(' ', $data['search']);\n foreach ($search_token as $search) {\n $data['categorys_list'] = $data['categorys_list']->where(function ($query) use ($search) {\n $query->where('title', 'LIKE', '%' . $search . '%');\n });\n }\n }\n\n $data['categorys_list'] = $data['categorys_list']->paginate(PAGINATE_SMALL, ['*'], 'p');\n return view('category.list', $data);\n }", "function tkno_get_top_category_slug( $return_slug=false, $cat_id=false ) {\n global $post;\n $curr_cat = ( $cat_id ) ? get_category_parents( $cat_id, false, '/', true ) : get_the_category_list( '/' , 'multiple', $post->ID );\n $valid_cats = ( is_outdoors() ) ? array( 'spring', 'summer', 'fall', 'winter', 'trips', 'outdoors' ) : array( 'music', 'food', 'drink', 'things-to-do', 'arts' );\n $curr_cat = explode( '/', $curr_cat );\n $return_cat = array();\n foreach ( $curr_cat as $current ) {\n $current = sanitize_title( strtolower( $current ) );\n if ( in_array( $current, $valid_cats ) ) {\n $return_cat['slug'] = $current;\n if ( $return_slug ) { \n return $current;\n }\n break;\n }\n }\n if ( ! empty( $return_cat['slug'] ) ) { \n $cat_for_name = get_category_by_slug( $return_cat['slug'] );\n $return_cat['cat_name'] = $cat_for_name->name;\n $return_cat['term_id'] = $cat_for_name->term_id;\n return (object) $return_cat;\n } else {\n return false;\n }\n}", "function showParentCategoriesForSearch( )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories WHERE status = 1 AND category_type = 0 order by \tcategory_title asc \";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "function getProductByCategorySearch($category_id, $keyword){\r\n\t\t$unix_product = array();\r\n\t\t//$has_printed = false;\r\n\t\t$total_product_1 = 0;\r\n\t\t$total_product_2 = 0;\r\n\t\t$keyword=strtolower($keyword);\r\n\t\t\r\n\t\tif($category_id!=0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category WHERE parent_id=\".$category_id);\t\r\n\t\t}\r\n\t\telseif($category_id==0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category\");\t\r\n\t\t}\r\n\t\twhile($rc=mysql_fetch_array($q_category)){\r\n\t\t\t$cat_id = $rc['category_id'];\r\n\t\t\t//if($category_id!=0){\r\n\t\t\t$q_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$cat_id.\" AND lower(D.name) LIKE '%$keyword%'\");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$total_product_1 = mysql_num_rows($q_product_id);\t\t\t\t\t\t\t\t\t\r\n\t\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t\t$product = new product($product_id);\r\n\t\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\t\techo '<div class=\"item\">';\r\n\t\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'_'.$total_product_1.'</div>';\r\n\t\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\t\techo '</a>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t}\r\n\t\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Search Child Category\r\n\t\t$q_child_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$category_id.\" AND lower(D.name) LIKE '%$keyword%'\");\r\n\t\t$total_product_2 = mysql_num_rows($q_child_product_id);\r\n\t\twhile($rp=mysql_fetch_array($q_child_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().$total_product_2.'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t\t}\r\n\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t}\r\n\t\t//Info if Search No Result \r\n\t\t/*\r\n\t\tif($total_product_1==0 && $total_product_2==0){\r\n\t\t\techo '<div class=\"no_item\" style=\"height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;\">';\r\n\t\t\t\techo 'No Result! RUn'.$total_product_1.'_'.$total_product_2;\r\n\t\t\t\t//echo ':)'.$rLanguage->text(\"Logout\");\t\r\n\t\t\techo '</div>';\r\n\t\t}\r\n\t\t*/\r\n\t}", "public function testGetCategories()\n {\n $response = $this->get(\"/api/categories\");\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "public function get_paged_categories($limit, $offset = 0, $filter = array())\n {\n $result = array();\n $result['result'] = false;\n $result['count'] = 0;\n\n if (is_array($filter) && count($filter) > 0) {\n foreach($filter as $key => $value) {\n if ($key == 'category') {\n $this->db->or_where(\"(cat_name LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(dbo.get_user_login_name_by_id(created_by) LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(created_at LIKE '%\". $value['value'] .\"%')\", '', false);\n } else {\n //$this->db->where($filter[$key]['field'], $filter[$key]['value']);\n }\n }\n }\n\n $this->db->order_by('cat_name','ASC');\n $query = $this->db->get($this->table_name, $limit, $offset);\n\n if ($query->num_rows() > 0) {\n\n $result['result'] = $query->result();\n\n // record count\n if (is_array($filter) && count($filter) > 0) {\n foreach($filter as $key => $value) {\n if ($key == 'category') {\n $this->db->or_where(\"(cat_name LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(dbo.get_user_login_name_by_id(created_by) LIKE '%\". $value['value'] .\"%')\", '', false);\n $this->db->or_where(\"(created_at LIKE '%\". $value['value'] .\"%')\", '', false);\n } else {\n //$this->db->where($filter[$key]['field'], $filter[$key]['value']);\n }\n }\n }\n\n $this->db->from($this->table_name);\n $result['count'] = $this->db->count_all_results();\n }\n\n //echo 1; die();\n\n return $result;\n }", "public function testAddItemSubCategory()\n {\n }", "public function getCategory($name);", "public function getAllCategory($ssField='',$ssSort='',$ssSearchWord='')\n {\n $oQuery = Doctrine_Query::create()\n ->select(\"MC.*\")\n ->from(\"Model_Category MC\")\n ->orderBy('MC.'.$ssField.\" \".$ssSort);\n if($ssSearchWord != '')\n $oQuery->where(\"MC.category_name LIKE '%\".$ssSearchWord.\"%'\");\n //->andWhere($this->oRequest->getParameter('ssSearchOption').\" LIKE '%\".trim(addslashes($this->oRequest->getParameter('ssSearchWord'))).\"%'\");\n return $oQuery->fetchArray();\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "private function buildCategoryViewTitle()\n {\n $title_chunks = array();\n if ($this->params->get('category_name_order', 0) != 0) {\n if (($this->params->get('category_metatitle', 0) != 0) && ($metatitle = $this->virtuemartHelper->getCategoryMetaTitle())) {\n $title_chunks[$this->params->get('category_name_order')] = $metatitle;\n } else {\n $title_chunks[$this->params->get('category_name_order')] = $this->virtuemartHelper->getCategoryName();\n }\n }\n if ($this->params->get('category_sitename_order', 0) != 0) {\n $title_chunks[$this->params->get('category_sitename_order')] = $this->getSiteName();\n }\n if ($this->params->get('category_customtext_order', 0) != 0) {\n $title_chunks[$this->params->get('category_customtext_order')] = $this->params->get('category_customtext', '');\n }\n ksort($title_chunks);\n\n return (join(' ', $title_chunks));\n }", "private static function _getSelectCategories()\n {\n $categories = Blog::category()->orderBy('name')->all();\n $sortedCategories = array();\n\n foreach($categories as $c)\n $sortedCategories[$c->id] = $c->name;\n\n return $sortedCategories;\n }", "private function getCategoryNames()\n {\n $categoryData = array();\n $this->_connection = $this->_resourceConnection->getConnection();\n $table = $this->_connection->getTableName('catalog_category_entity_varchar');\n $query = \"\n SELECT *\n FROM `{$table}`\n WHERE attribute_id = '{$this->nameAttributeId}'\n \";\n\n $result = $this->_connection->fetchAll($query);\n\n if (count($result) > 0) {\n foreach ($result as $category) {\n if (isset($category['entity_id'])) {\n $categoryData[$category['entity_id']][$category['store_id']] = $category['value'];\n } else {\n $categoryData[$category['row_id']][$category['store_id']] = $category['value'];\n }\n }\n }\n\n return $categoryData;\n }", "public function autocomplete()\n {\n $items = Category::orderBy('parent_id', 'ASC');\n\n $items->whereHas('translation', function ($query) {\n if (Request::filled('keyword')) {\n $query->where('title', 'LIKE', '%' . Request::input('keyword') . '%');\n } else {\n $query->where('parent_id', 0);\n }\n });\n\n\n /**\n * Content type filter\n */\n if (Request::filled('content_type_id')) {\n $items->where('content_type_id', (int) Request::input('content_type_id'));\n }\n\n\n /**\n * Query\n */\n $items = $items->paginate(5);\n\n\n /**\n * Response structure\n */\n return CategoryAutocompleteResource::collection($items);\n }", "public function test_products_can_be_filtered_by_category()\n {\n $products = factory(Product::class, 2)->create();\n \n // and the first proudct has a category\n $products->first()->categories()->save($category = factory(Category::class)->create());\n\n // if we hit our endpoint querying for that category, the product with that category will be returned\n // but the other product will not be present\n $this->json('get', route('products.index', ['category' => $category->slug]))\n ->assertJsonFragment(['slug' => $products->first()->slug])\n ->assertJsonMissing(['name' => $products->last()->name]);\n }", "function _make_cat_compat(&$category)\n {\n }", "function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "function suggest_category() {\n $suggestions = $this->ticket->get_category_suggestions($this->input->get('term'));\n echo json_encode($suggestions);\n }", "public function get_categories() {\n\t error_log(\"get_categories - category id: \" . $category_id,0);\n\n\t$query = \"SELECT * FROM category ORDER BY category_name ASC\";\n\n\t error_log(\"get_categories - query: \" . $query,0);\n\n \t $result = mysql_query($query);\n\n if ($result) {\n return $result;\n } else {\n\terror_log(\"did not get categories\",0);\n $error = mysql_errno();\n return -$error;\n }\n\n }", "function _sortbyName($a, $b) \n {\n return(strcasecmp($a[\"name\"], $b[\"name\"]));\n }", "function searchRecipes($search_term, $category='all')\r\n {\r\n //add wildcards to search\r\n $search_term = '%' . $search_term . '%';\r\n //search all categories\r\n if($category == 'all') {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n //search category supplied\r\n else {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (category = :category)\r\n AND (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameters\r\n $statement->bindParam(':category', $category, PDO::PARAM_STR);\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "private function refine($category)\n {\n $category = trim(ucwords(strtolower($category)));\n if ($category == 'Lifestyle (sociology)') {\n return 'Lifestyle';\n }\n if ($category == 'Sports') {\n return 'Sport';\n }\n if ($category == 'Humor') {\n return 'Comedy';\n }\n if ($category == 'Humour') {\n return 'Comedy';\n }\n if ($category == 'Pet') {\n return 'Animals';\n }\n if ($category == 'Diy') {\n return 'DIY';\n }\n if ($category == 'Association Football') {\n return 'Soccer';\n }\n return $category;\n }", "public function afterGetName(\\Magento\\Catalog\\Model\\Category $subject, $result)\n {\n if(!in_array(\\PiotrJaworski\\SEOTitleBooster\\Model\\Config\\Target::TARGET_CATEGORY_TITLE, explode(',',$this->scopeConfig->getValue(self::MODULE_CONFIG_NAME, \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE)))){\n return $result;\n }\n return $this->titleReplacer->replace($subject) ? $this->titleReplacer->replace($subject) : $result;\n }", "function GetCategories(){\n\t\t\tglobal $wpdb;\n\n\t\t\t$categories = get_all_category_ids();\n\t\t\t$separator = '|';\n\t\t\t$output = array();\n\t\t\tif($categories){\n\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t$temp_catname = get_cat_name($category);\n\t\t\t\t\tif ($temp_catname !== \"Uncategorized\"){\n\t\t\t\t\t\t$output[$category] = $temp_catname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$output = 'test';\n\t\t\t}\n\t\t\treturn $output;\n\t\t}" ]
[ "0.7837572", "0.67320997", "0.6671251", "0.664897", "0.6454262", "0.63216525", "0.63210285", "0.6294507", "0.6244495", "0.6167877", "0.61539227", "0.61234945", "0.60509074", "0.600865", "0.60016245", "0.5999827", "0.5997029", "0.5987787", "0.5983255", "0.59633327", "0.59314305", "0.5925702", "0.5895962", "0.58779657", "0.5863728", "0.58554983", "0.58339775", "0.58280987", "0.5821719", "0.58114094", "0.5805803", "0.58016723", "0.5791484", "0.57876426", "0.57300854", "0.57257926", "0.57099926", "0.5700124", "0.5700035", "0.56944156", "0.56907564", "0.5684425", "0.56749463", "0.5669625", "0.5668931", "0.56682336", "0.56651664", "0.56607294", "0.5656741", "0.5654649", "0.56468505", "0.56419766", "0.56399304", "0.5636793", "0.56322604", "0.5620723", "0.56067705", "0.5602005", "0.55980694", "0.55881757", "0.55819386", "0.5577473", "0.5575056", "0.5572088", "0.557142", "0.5567485", "0.55644906", "0.55586886", "0.55586666", "0.554826", "0.554739", "0.55344796", "0.55282456", "0.552003", "0.55100214", "0.5504216", "0.5501032", "0.54959905", "0.5494307", "0.54941654", "0.54860103", "0.5467451", "0.5465954", "0.54659045", "0.5465724", "0.5465115", "0.5459488", "0.5453614", "0.54508793", "0.5445518", "0.54449934", "0.5442814", "0.54422873", "0.54349744", "0.54312617", "0.5431198", "0.54302734", "0.5429303", "0.5428694", "0.54204077" ]
0.69372815
1
///////End testing the category search//////////////////////////
public function testTrackDownloads() { echo "\ntestTrackDownloads"; $json_str = "{\"Ip_address\":\"::1\",\"ID\":\"13007\",\"URL\":\"https://cildata.crbs.ucsd.edu/media/images/13007/13007.tif\",\"Size\":\"4400000\"}"; $url = TestServiceAsReadOnly::$elasticsearchHost."/rest/download_statistics"; $response = $this->curl_post($url, $json_str); //echo "\n-------testTrackDownloads Response:".trim($response)."------"; $json = json_decode($response); $this->assertTrue(!$json->success); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testListCategories()\n {\n }", "public function testCategorySearchByName()\n {\n echo \"\\n testCategorySearchByName...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category_search\";\n $query = \"{\\\"query\\\": { \".\n \"\\\"term\\\" : { \\\"Name\\\" : \\\"Cell Death\\\" } \". \n \"}}\";\n $response = $this->just_curl_get_data($url, $query);\n $response = $this->handleResponse($response);\n //echo \"\\n testCategorySearchByName response:\".$response.\"---\";\n if(is_null($response))\n {\n echo \"\\n testCategorySearchByName response is empty\";\n $this->assertTrue(false);\n }\n \n $result = json_decode($response);\n if(is_null($result))\n {\n echo \"\\n testCategorySearchByName json is invalid\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n $this->assertTrue(false);\n \n }", "public function testCatalogGetCategories()\n {\n\n }", "public function testGetProductCategories() {\n \n }", "public function testGetCategoriesUsingGET()\n {\n }", "public function test_getItemCategoryByFilter() {\n\n }", "public function testGetCategory()\n {\n $category = Category::first();\n\n $response = $this->get(\"/api/categories/+&= %20\");\n $response->assertResponseStatus(400);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/123456789\");\n $response->assertResponseStatus(404);\n $response->seeJson([\"success\" => false]);\n\n $response = $this->get(\"/api/categories/\" . $category->slug);\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "public function testGetItemSubCategoryByFilter()\n {\n }", "public function findCategories();", "public function test_list_category()\n\t{\n\t\t$output = $this->request('GET', 'add_callable_pre_constructor/list_category');\n\t\t$this->assertContains(\n\t\t\t\"Book\\nCD\\nDVD\\n\", $output\n\t\t);\n\t}", "function get_foods_of_category($search_key) {\n if ((!$search_key) || ($search_key == '')) {\n return false;\n }\n \n $conn = db_connect();\n $query = \"select * from food where catogery_name = '\".$search_key.\"'\";\n \n $result = @$conn->query($query);\n if (!$result) {\n return false;\n }\n \n $num_books = @$result->num_rows;\n if ($num_books == 0) {\n return false;\n } \n $result = db_result_to_array($result);\n return $result;\n}", "public function testGetCategories()\n {\n $response = $this->get(\"/api/categories\");\n $response->assertResponseStatus(200);\n $response->seeJson([\"success\" => true]);\n }", "public function testGETCategory()\n\t{\n\t\t$request = new ERestTestRequestHelper();\n\n\t\t$request['config'] = [\n\t\t\t'url'\t\t\t=> 'http://api/category/1',\n\t\t\t'type'\t\t=> 'GET',\n\t\t\t'data'\t\t=> null,\n\t\t\t'headers' => [\n\t\t\t\t'X_REST_USERNAME' => 'admin@restuser',\n\t\t\t\t'X_REST_PASSWORD' => 'admin@Access',\n\t\t\t],\n\t\t];\n\n\t\t$request_response = $request->send();\n\t\t$expected_response = '{\"success\":true,\"message\":\"Record Found\",\"data\":{\"totalCount\":1,\"category\":{\"id\":\"1\",\"name\":\"cat1\",\"posts\":[{\"id\":\"1\",\"title\":\"title1\",\"content\":\"content1\",\"create_time\":\"2013-08-07 10:09:41\",\"author_id\":\"1\"}]}}}';\n\t\t$this->assertJsonStringEqualsJsonString($request_response, $expected_response);\n\t}", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function test_getItemCategoryTags() {\n\n }", "public function test_products_can_be_filtered_by_category()\n {\n $products = factory(Product::class, 2)->create();\n \n // and the first proudct has a category\n $products->first()->categories()->save($category = factory(Category::class)->create());\n\n // if we hit our endpoint querying for that category, the product with that category will be returned\n // but the other product will not be present\n $this->json('get', route('products.index', ['category' => $category->slug]))\n ->assertJsonFragment(['slug' => $products->first()->slug])\n ->assertJsonMissing(['name' => $products->last()->name]);\n }", "public function testGetItemSubCategoryTags()\n {\n }", "public function testAddItemSubCategoryTag()\n {\n }", "public function testCategoryNameSorting()\n {\n echo \"\\n testCategoryNameSorting...\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.$this->context.\"/category/cell_process/Name/asc/0/10000\";\n $response = $this->curl_get($url);\n //echo $response;\n $result = json_decode($response);\n if(isset($result->error))\n {\n echo \"\\nError in testCategoryNameSorting\";\n $this->assertTrue(false);\n }\n \n if(isset($result->hits->total) && $result->hits->total > 0)\n $this->assertTrue(true);\n else \n {\n $this->assertTrue(false);\n }\n }", "function ciniki_tenants_searchCategory($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'start_needle'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Search'), \n 'limit'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Limit'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $rc = ciniki_tenants_checkAccess($ciniki, 0, 'ciniki.tenants.searchCategory'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Search for categories\n //\n $strsql = \"SELECT DISTINCT category AS name \"\n . \"FROM ciniki_tenants \"\n . \"WHERE category like '\" . ciniki_core_dbQuote($ciniki, $args['start_needle']) . \"%' \"\n . \"AND category <> '' \"\n . \"ORDER BY category COLLATE latin1_general_cs \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'results', 'fname'=>'name', 'name'=>'result', 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['results']) || !is_array($rc['results']) ) {\n return array('stat'=>'ok', 'results'=>array());\n }\n return array('stat'=>'ok', 'results'=>$rc['results']);\n}", "public function testAddItemSubCategory()\n {\n }", "public function testGetAll() {\n // Create\n $this->phactory->create('kb_category');\n\n // Get\n $categories = $this->kb_category->get_all();\n $category = current( $categories );\n\n // Assert\n $this->assertContainsOnlyInstancesOf( 'KnowledgeBaseCategory', $categories );\n $this->assertEquals( self::NAME, $category->name );\n }", "public function testRetrieveTheCategoryList(): void\n {\n $response = $this->request('GET', '/api/categories');\n $json = json_decode($response->getContent(), true);\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('application/json; charset=utf-8', $response->headers->get('Content-Type'));\n\n $this->assertCount(5, $json);\n\n foreach ($json as $key => $value) {\n $this->assertArrayHasKey('id', $json[$key]);\n $this->assertArrayHasKey('name', $json[$key]);\n $this->assertArrayHasKey('createdAt', $json[$key]); \n } \n }", "function findCategories($key){\r\n // echo \"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\";\r\n $result = $this->connector->query(\"SELECT * FROM categorie WHERE cat_title LIKE '%$key%'\");\r\n $x = 0;\r\n while ($row = $this->connector->fetchArray($result)) {\r\n $x++;\r\n $cat[$x] = new Categorie();\r\n $cat[$x]->setCat_id($row['cat_id']);\r\n $cat[$x]->setCat_title($row['cat_title']);\r\n $cat[$x]->setCat_despription($row['cat_despription']);\r\n \r\n \t}\r\n return $cat; \r\n }", "public function getStoriesByCategory($category_name){\n\n\n }", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "public function search()\n\t{\n\t\t$this->form_validation->set_rules('category_id', 'Category Name', 'required');\n\t\t$this->form_validation->set_rules('search', 'Search for store', 'required');\n\n\t\tif ($this->form_validation->run() === FALSE) {\n\t\t\t$this->view($page = 'home');\n\t\t\t// redirect('pages/view');\n\t\t} else {\n\n\t\t$category_id = $this->input->post('category_id');\n\t\t$keyword = $this->input->post('search');\n\n\t\t$data['categories'] = $this->Category_model->get_categories();\n\t\t$data['title'] = $this->Category_model->get_category($category_id)->c_name;\n\t\t$data['result'] = $this->Home_model->search_post($category_id,$keyword);\n\t\t// $data['count_ads'] = $this->Home_model->categories_ads_count();\n\t\t$data['search'] = TRUE;\n\n\t\t$this->load->view('templates/header');\n\t\t$this->load->view('templates/navigation');\n\t\t$this->load->view('categories/search',$data);\n\t\t$this->load->view('categories/index', $data);\n\t\t$this->load->view('templates/footer');\n\n\t\t}\n\t}", "public function testCategoryField()\n {\n\n $field = $this->_field('slug');\n\n // Should just return the slug.\n $this->assertEquals('slug', $field->facetKey());\n\n }", "public function test_getItemCategoryById() {\n\n }", "function searchCoursesByQueryAndCategory($searchQuery, $categoryId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE CategoryId='\" . $categoryId . \"' AND (name LIKE '%\" . $searchQuery . \"%' OR description LIKE '%\" . $searchQuery . \"%' OR author LIKE '%\" . $searchQuery . \"%') ORDER BY creationDate\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function testGetItemSubCategoryById()\n {\n }", "function category($categoryName, $categoryId, $page)\n {\n $sort = Input::get('sortOrder') == null ? \"BestMatch\" : Input::get('sortOrder');\n $checkedInput = $this->checkedChecked(Input::get());\n $breadCramb = $this->model->getBreadCramb($categoryId);\n\n $filterUrl = $this->generateFilterUrl(Input::get());\n $ebayData = $this->model->getProductsByCategory(\n $categoryId, 42, $page, Input::get(), $sort\n );\n $similarCategories = $this->model->getSimilarCategory($categoryId);\n $filterData = $this->model->getFiltersForCategory($categoryId);\n\n $resultsAmount = $ebayData->totalEntries;\n if ($ebayData->totalPages > 100) {\n $totalPages = 100;\n } else {\n $totalPages = $ebayData->totalPages;\n }\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $categoryName, $page, $this->siteslug, $filterUrl, $categoryId);\n $filtersForTitle = $this->model->getFiltersForTitle($checkedInput);\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n $categoryData['page'] = $page;\n $categoryData['id'] = $categoryId;\n $categoryData['title'] = $categoryName;\n $categoryData['totalResults'] = $resultsAmount;\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n// $this->title = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . 'צי\\'פי קניות ברשת';\n /*if (is_null($sort)) {\n $sortForTitle = '';\n } else {\n $sortForTitle = '-' . $sort;\n }*/\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.amazon');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'amazon';\n };\n //dd($filtersForTitle);\n $this->title = $categoryData['title'] . ' - ' . $breadCramb['category'] . $filtersForTitle . ' - ' . $categoryData['page'] . ' - ' . $this->shopName;\n $this->description = $categoryData['title'] . ' ' . $filtersForTitle . $pageForTitle . '- ' . \"אמזון בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n //dd($categoryData);\n $productBaseRoute = \"/{$this->siteslug}/product\";\n return view(\"ebay.category\", [\n 'pagination' => $pages,\n 'pageNext' => $pageNext,\n 'categoryData' => $categoryData,\n 'categories' => $this->categories,\n 'productBase' => $productBaseRoute,\n 'siteslug' => $this->siteslug,\n 'ebayData' => $ebayData->products,\n 'filterData' => $filterData,\n 'checkedInput' => $checkedInput,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "public function testGetCategories()\n {\n $category = $this->resourceAPI->getCategories();\n\n $this->assertInstanceOf(InlineResponse2001::class, $category);\n }", "public function testSeeAllCategoriesTest()\n {\n $response = $this->get('/categories');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testReadCategory()\n {\n $response = $this->get(action('\\Gdevilbat\\SpardaCMS\\Modules\\Ecommerce\\Http\\Controllers\\CategoryController@index'));\n\n $response->assertStatus(302)\n ->assertRedirect(action('\\Gdevilbat\\SpardaCMS\\Modules\\Core\\Http\\Controllers\\Auth\\LoginController@showLoginForm')); // Return Not Valid, User Not Login\n\n $user = \\App\\Models\\User::find(1);\n\n $response = $this->actingAs($user)\n ->from(action('\\Gdevilbat\\SpardaCMS\\Modules\\Ecommerce\\Http\\Controllers\\CategoryController@index'))\n ->json('GET',action('\\Gdevilbat\\SpardaCMS\\Modules\\Ecommerce\\Http\\Controllers\\CategoryController@serviceMaster'))\n ->assertSuccessful()\n ->assertJsonStructure(['data', 'draw', 'recordsTotal', 'recordsFiltered']); // Return Valid user Login\n }", "public function test_addItemCategoryTag() {\n\n }", "public function testInsertCategoryUsingPOST()\n {\n }", "function findProducts ($text, $category, $limit) {\r\n $sql = \"SELECT * FROM stockitems\";\r\n\r\n //checks if the item is in the requested categories\r\n if (isset($category) && $category != 'all') {\r\n $category = (int)$category;\r\n $sql = $sql . \" WHERE StockItemID IN (SELECT StockItemID FROM stockitemstockgroups WHERE StockGroupID = $category )\";\r\n if (isset($text) && $text != '') {\r\n //adds the text search if needed\r\n $sql = $sql . \"AND StockItemName LIKE '%$text%'\";\r\n }\r\n } else {\r\n //adds the text search if needed\r\n if (isset($text) && $text != '' ) {\r\n $sql = $sql . \" WHERE StockItemName LIKE '%$text%'\";\r\n }\r\n }\r\n\r\n if (isset($limit)) {\r\n $sql = $sql . \" LIMIT $limit\";\r\n }\r\n\r\n return runQuery($sql);\r\n}", "public function testExample()\n {\n $model = new Category();\n\n $data = $model->getCategoriesList();\n $this->assertIsArray($data);\n $this->assertNotEmpty($data);\n foreach ($data as $item) {\n $this->assertIsString($item);\n }\n\n }", "public function test_addItemCategory() {\n\n }", "public function testCategoryData(){\n\n $count = Category::all()->count();\n $this->assertEquals($count, 3);\n $this->assertDatabaseHas('categories', ['titulo' => 'Minería Windows']);\n $this->assertDatabaseHas('categories', ['titulo' => 'Minería Linux']);\n $this->assertDatabaseHas('categories', ['titulo' => 'Minería IOS']);\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function testRequest() {\n $params = array('type'=>'categorie-name',\n 'search'=>'android');\n $this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, $this->object->request('get-product-categories', $params));\n }", "public function testAll()\n\t\t{\n\t\t\tlist ($categoriesBefore) = $this->category->all(array ('nameContains' => 'Top Category'));\n\t\t\tforeach ($categoriesBefore as $categoryBefore) {\n\t\t\t\t$categoryBefore->delete();\n\t\t\t}\n\t\t\t\n\t\t\tfor ($i = 1; $i <= 3; $i++) {\n\t\t\t\t$this->category->create(\n\t\t\t\t\tarray (\n\t\t\t\t\t\t'categoryName' => array ('en' => \"Top Category $i\"),\n\t\t\t\t\t\t'categoryImage' => \"topcategory$i.jpg\"\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\tlist ($categories, $count) = $this->category->all(array (\n\t\t\t\t'nameContains' => 'Top Category',\n\t\t\t\t'limit' => 2,\n\t\t\t\t'offset' => 1,\n\t\t\t\t'fields' => 'categoryId,categoryName'\n\t\t\t));\n\t\t\t\n\t\t\t$this->assertEquals(3, $count);\n\t\t\t$this->assertEquals(2, count($categories));\n\t\t\t\n\t\t\tfor ($j = 1; $j <= 2; $j++) {\n\t\t\t\t$this->assertEquals('Top Category '.($j + 1), $categories[$j - 1]->name->EN);\n\t\t\t\t$this->assertTrue(!isset($categories[$j - 1]->image));\n\t\t\t}\n\t\t}", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public function testThatWeCanGetTheCategories()\n {\n $ads = new Cities;\n \n $ads->setCities('Waterloo');\n\n $this->assertEquals(1 , preg_match( '/^[a-zA-Z]{3,30}$/', $ads->getCities() ), $ads->getCities() . ' is less 3 or more 31' );\n\n\n }", "public function testSearchBlankKeyword() {\n $aCategory = factory(App\\Category::class)->create();\n $aLocation = factory(App\\Location::class)->create();\n\n $expectedPost = factory(App\\Post::class)->create([\n 'title' => 'harambe',\n 'category_id' => $aCategory->id,\n 'location_id' => $aLocation->id\n ]);\n\n $acutalPost = $this->call('GET', 'posts/search')->original->getData()['posts']->first();\n\n $this->assertEquals($expectedPost->id, $acutalPost->id);\n $this->assertEquals($expectedPost->title, $acutalPost->title);\n }", "public function searchCategory(Request $request){\n $categories=Category::where('title','LIKE','%'.$request->keyword.'%')->orWhere('description','LIKE','%'.$request->keyword.'%')->get();\n if(count($categories)==0){\n return Response::json(['message'=>'No category match found !']);\n }else{\n return Response::json($categories);\n }\n }", "public function test_registerCategory()\n {\n $ODOO_ID = 21;\n $MAGE_ID = 43;\n /** === Setup Mocks === */\n // $this->_registerMageIdForOdooId(EntityCategory::ENTITY_NAME, $mageId, $odooId);\n // $this->_repoBasic->addEntity($entityName, $bind);\n $this->mRepoGeneric\n ->shouldReceive('addEntity')->once();\n /** === Call and asserts === */\n $res = $this->obj->registerCategory($MAGE_ID, $ODOO_ID);\n }", "public function testGetAllCategories()\n {\n $company1= factory(\\App\\Src\\Company\\Company::class, 1)->create(['name_en'=>uniqid()]);\n $company2= factory(\\App\\Src\\Company\\Company::class, 1)->create(['name_en'=>uniqid()]);\n\n $category1 = factory(\\App\\Src\\Category\\Category::class, 1)->create(['name_en'=>uniqid()]);\n $category1->companies()->sync([$company1->id]);\n\n $category2 = factory(App\\Src\\Category\\Category::class,1)->create(['name_en'=>uniqid()]);\n\n $this->get('/api/v1/categories')\n ->seeJsonContains(['name_en'=>$category1->name,'name_en'=>$category2->name,'name_en'=>$company1->name])\n ->dontSeeJson(['name_en'=>$company2->name])\n ;\n\n }", "public function getSearchData($parentCategory = 2);", "private function filterCategory()\n {\n if(empty($this->category) || $this->category === static::FILTER_CATEGORY_NONE) {\n return;\n }\n\n if($this->category === static::FILTER_CATEGORY_OTHER) {\n $this->query->andWhere(['LIKE', 'category', 'yii\\\\']);\n return;\n }\n\n $this->query->andWhere(['category' => $this->category]);\n }", "function get_website_search_results_category_list($keyword) {\n try {\n libraries_load('elasticsearch-php');\n $elasticsearch_host = variable_get('elasticsearch_host');\n $client = Elasticsearch\\ClientBuilder::create()\n ->setHosts([$elasticsearch_host])\n ->build();\n } catch (\\Exception $e) {\n\n }\n\n // Get all node types from node table.\n $node_types = db_query(\"SELECT DISTINCT(type) FROM {node}\")->fetchCol('type');\n // Save search results count to an associative array with node types as keys.\n $search_website_count_by_category = [];\n foreach ($node_types as $node_type) {\n // Build search params.\n $params = build_website_search_params($search_content = _remove_special_chars($keyword), $node_type = $node_type);\n // To get a total number of all search results, we need to unset 'from' and 'size' from $params.\n unset($params['from']);\n unset($params['size']);\n try {\n $count = $client->count($params)['count'];\n if ($count != 0) {\n $search_website_count_by_category[$node_type] = $count;\n }\n } catch (\\Exception $e) {\n\n }\n }\n\n // Add total count to the $search_website_count_by_category array.\n $total_count = ['all categories' => array_sum($search_website_count_by_category)];\n $search_website_count_by_category = $total_count + $search_website_count_by_category;\n $website_search_by_node_type = [\n 'keyword' => $keyword,\n 'count' => $search_website_count_by_category,\n ];\n\n $all_categories_text = 'All categories (' . $website_search_by_node_type['count']['all categories'] . ')';\n $all_categories_link = 'tripal_elasticsearch/search_website/' . $website_search_by_node_type['keyword'];\n $output = l($all_categories_text, $all_categories_link);\n unset($website_search_by_node_type['count']['all categories']);\n\n $items = [];\n foreach ($website_search_by_node_type['count'] as $category => $count) {\n $text = $category . ' (' . $count . ')';\n $url = 'tripal_elasticsearch/search_website/' . $category . '/' . $website_search_by_node_type['keyword'];\n $items[] = l($text, $url);\n }\n\n $output .= theme('item_list', ['items' => $items]);\n return $output;\n}", "public function test_getDuplicateItemCategoryById() {\n\n }", "private function searchByCategory($category){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($category)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n foreach($item->categories as $category_tmp)\n if($category == $category_tmp){\n $searchResults[] = $item;\n } \n }\n return $searchResults;\n }", "public function test_get_items_list_by_category_id()\n {\n $response = $this->get('/api/items/list/1');\n\n $response->assertStatus(200);\n\n $response->assertSee('items');\n }", "function searchCoursesByCategory($categoryId){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course WHERE CategoryId='\" . $categoryId . \"' ORDER BY popularity\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}", "public function testGetAllCategories()\n\t{\n\t $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n\t\t$number_of_categories = 10;\n\t\t$categories = factory(Category::class, $number_of_categories)->create([\n\t\t 'user_id' => $user->id\n ]);\n\n\t\t$response = $this->get('api/categories');\n\t\t$response->assertStatus(200);\n\t\t$this->assertTrue(count($categories) == $number_of_categories );\n\t}", "public function testListCategoriesWithoutPagination()\n {\n $this->makeDataOfListCategories(8);\n $user = $this->makeAdminToLogin();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user)\n ->visit('/admin/categories')\n ->resize(900, 1600)\n ->assertSee('List Categories');\n $elements = $browser->elements('#table-categories tbody tr');\n $this->assertCount(8, $elements);\n });\n }", "function Show_Search_Category($search_sql,$tot_cnt)\n\t\t{\n\t\t \tglobal $ecom_siteid,$db,$ecom_hostname,$Settings_arr,$ecom_themeid,$default_layout,$Captions_arr,$search_prodperpage,$quick_search,$head_keywords,$row_desc,$inlineSiteComponents;\n\t\t\tif(in_array('mod_catimage',$inlineSiteComponents))\n\t\t\t{\n\t\t\t\t$img_support = true;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$img_support = false;\n\t\t\t\n\t\t\t$Captions_arr['SEARCH'] \t= getCaptions('SEARCH');\n\t\t\t//Default settings for the search\n\t\t\t$catsort_by\t\t\t\t\t= ($_REQUEST['searchcat_sortby'])?$_REQUEST['searchcat_sortby']:'category_name';\n\t\t \t$catperpage\t\t\t\t\t= ($_REQUEST['searchcat_perpage'])?$_REQUEST['searchcat_perpage']:$Settings_arr['product_maxcntperpage_search'];// product per page\n\t\t\t$catsort_order\t\t\t\t= ($_REQUEST['searchcat_sortorder'])?$_REQUEST['searchcat_sortorder']:$Settings_arr['product_orderby_search'];\n\t\t\t\n\t\t\t $query_string = \"&\";\n\t\t $search_fields = array('quick_search');\n\t\t\t\tforeach($search_fields as $v) {\n\t\t\t\t\t$query_string .= \"$v=\".$_REQUEST[$v].\"&\";#For passing searh terms to javascript for passing to different pages.\n\t\t\t\t}\n\t\t\t$first_querystring=$query_string; //Assigning the initial string to the variable.\n\t\t\t\t\t\t$pg_variable\t= 'search_pg';\n\t\t\t\t\t\tif($_REQUEST['top_submit_Page'] || $_REQUEST['bottom_submit_Page'] )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t $_REQUEST[$pg_variable] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t if ($_REQUEST['req']!='')// LIMIT for products is applied only if not displayed in home page\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$start_var \t\t= prepare_paging($_REQUEST[$pg_variable],$catperpage,$tot_cnt);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$Limit = '';\n\t\t\t\t\t\t\t$querystring = \"\"; // if any additional query string required specify it over here\n\t\t\t\t\t\t\t$Limit\t\t\t= \" ORDER BY $catsort_by $catsort_order LIMIT \".$start_var['startrec'].\", \".$catperpage;\n\t\t\t\t\t\t\t//echo $search_sql.$Limit;\n\t\t\t\t\t\t\t$ret_search = $db->query($search_sql.$Limit);\n\t\t\t\t\t\t\tif ($db->num_rows($ret_search))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t ?>\n\t\t\t\t\t\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"shelfBtable\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" class=\"treemenu\" align=\"left\"><a href=\"<? url_link('');?>\"><?=$Captions_arr['COMMON']['TREE_MENU_HOME_LINK'];?></a><? if($_REQUEST['quick_search']!=\"\"){?> >> <? echo $_REQUEST['quick_search']; } ?> </td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" align=\"left\" valign=\"top\" class=\"shelfAheader_A\">\n\t\t\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"productpagenavtable\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"63%\" height=\"30\" align=\"right\" valign=\"middle\" class=\"productpagenavtext\" colspan=\"2\"><?php echo $Captions_arr['SEARCH']['SEARCH_SORT']?>\n\t\t\t\t\t\t\t\t\t\t\t\t <select name=\"searchcat_sortbytop\" id=\"searchcat_sortbytop\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"category_name\" <?php echo ($catsort_by=='category_name')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_CAT_NAME']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t </select>\n\t\t\t\t\t\t\t\t\t\t\t\t <select name=\"searchcat_sortordertop\" id=\"searchcat_sortordertop\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"ASC\" <?php echo ($catsort_order=='ASC')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_LOW2HIGH']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"DESC\" <?php echo ($catsort_order=='DESC')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_HIGH2LOW']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t </select></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"37%\" align=\"right\" valign=\"middle\" class=\"productpagenavtext\"><?php echo $Captions_arr['SEARCH']['SEARCH_ITEMS'] ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<select name=\"searchcat_prodperpagetop\" id=\"searchcat_prodperpagetop\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($ii=$Settings_arr[\"productlist_interval\"];$ii<=$Settings_arr[\"productlist_maxval\"];$ii+=$Settings_arr[\"productlist_interval\"])\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $ii?>\" <?php echo ($catperpage==$ii)?'selected=\"selected\"':''?>><?php echo $ii?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"top_submit_Page\" value=\"<?php echo $Captions_arr['SEARCH']['SEARCH_GO'];?>\" class=\"buttonred\" onclick=\"handle_searchcatdropdownval_sel('<?php echo $ecom_hostname?>','searchcat_sortbytop','searchcat_sortordertop','searchcat_prodperpagetop')\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\tif($cur_title)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" class=\"shelfAheader\" align=\"left\"><?php echo $cur_title?></td>\n\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif ($tot_cnt>0 and ($_REQUEST['req']!=''))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tif($_REQUEST['search_prodperpage']!=9999)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" class=\"pagingcontainertd\" align=\"center\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t$query_string =$first_querystring;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$path = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$query_string .= \"searchcat_sortby=\".$catsort_by.\"&searchcat_sortorder=\".$catsort_order.\"&searchcat_perpage=\".$catperpage.\"&pos=top&rdo_mainoption=cat&cbo_keyword_look_option=\".$_REQUEST['cbo_keyword_look_option'].'&rdo_suboption='.$_REQUEST['rdo_suboption'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaging_footer($path,$query_string,$tot_cnt,$start_var['pg'],$start_var['pages'],'',$pg_variable,'Categories',$pageclass_arr); \t\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$pass_type = 'image_iconpath';\n\t\t\t\t\t\t\t\t\t\t\twhile ($row_search = $db->fetch_array($ret_search))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr onmouseover=\"this.className='normalshelf_hover'\" onmouseout=\"this.className='shelfBtabletd'\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td align=\"left\" valign=\"middle\" class=\"shelfBtabletd\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($row_search['category_showimagetype']!='None' && ($img_support)) // ** Show sub category image only if catimage module is there for the site subcategoreynamelink\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php url_category($row_search['category_id'],$row_search['category_name'],-1)?>\" title=\"<?php echo stripslashes($row_search['category_name'])?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($row_search['category_showimageofproduct']==0) // Case to check for images directly assigned to category\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('prodcat',$row_search['category_id'],$pass_type,0,0,1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_search['category_name'],$row_search['category_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$show_noimage = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$show_noimage = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse // Case of check for the first available image of any of the products under this category\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the id of products under current category with image assigned to it\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$cur_prodid = find_AnyProductWithImageUnderCategory($row_search['category_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($cur_prodid)// case if any product with image assigned to it under current category exists\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Calling the function to get the image to be shown\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$img_arr = get_imagelist('prod',$cur_prodid,$pass_type,0,0,1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(count($img_arr))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshow_image(url_root_image($img_arr[0][$pass_type],1),$row_search['category_name'],$row_search['category_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$show_noimage = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$show_noimage = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse// case if no products exists under current category with image assigned to it\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$show_noimage = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ** Following section makes the decision whether the no image is to be displayed\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($show_noimage)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// calling the function to get the default no image \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$no_img = get_noimage('prodcat',$pass_type); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($no_img)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tshow_image($no_img,$row_search['category_name'],$row_search['category_name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"shelfBprodname\"><a href=\"<?php url_category($row_search['category_id'],$row_search['category_name'],-1)?>\" title=\"<?php echo stripslashes($row_search['category_name'])?>\"><?php echo stripslashes($row_search['category_name'])?></a></span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t <td colspan=\"2\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t <h6 class=\"shelfBproddes\"><?php echo stripslashes($row_search['category_shortdescription'])?></h6>\n\t\t\t\t\t\t\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif ($tot_cnt>0 and ($_REQUEST['req']!=''))\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" class=\"pagingcontainertd\" align=\"center\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<?php \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$path = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t $query_string =$first_querystring;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$query_string .= \"searchcat_sortby=\".$catsort_by.\"&searchcat_sortorder=\".$catsort_order.\"&searchcat_perpage=\".$catperpage.\"&pos=top&rdo_mainoption=cat&cbo_keyword_look_option=\".$_REQUEST['cbo_keyword_look_option'].'&rdo_suboption='.$_REQUEST['rdo_suboption'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaging_footer($path,$query_string,$tot_cnt,$start_var['pg'],$start_var['pages'],'',$pg_variable,'Categories',$pageclass_arr); \t\n\t\t\t\t\t\t\t\t\t\t\t\t\t?>\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t?>\t\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td colspan=\"3\" align=\"left\" valign=\"top\" class=\"shelfAheader_A\">\n\t\t\t\t\t\t\t\t\t\t<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"productpagenavtable\">\n\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"63%\" height=\"30\" align=\"right\" valign=\"middle\" class=\"productpagenavtext\" colspan=\"2\"><?php echo $Captions_arr['SEARCH']['SEARCH_SORT']?>\n\t\t\t\t\t\t\t\t\t\t\t\t <select name=\"searchcat_sortbybottom\" id=\"searchcat_sortbybottom\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"category_name\" <?php echo ($catsort_by=='category_name')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_CAT_NAME']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t </select>\n\t\t\t\t\t\t\t\t\t\t\t\t <select name=\"searchcat_sortorderbottom\" id=\"searchcat_sortorderbottom\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"ASC\" <?php echo ($catsort_order=='ASC')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_LOW2HIGH']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"DESC\" <?php echo ($catsort_order=='DESC')?'selected=\"selected\"':''?>><?php echo $Captions_arr['SEARCH']['SEARCH_HIGH2LOW']?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t </select></td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td width=\"37%\" align=\"right\" valign=\"middle\" class=\"productpagenavtext\"><?php echo $Captions_arr['SEARCH']['SEARCH_ITEMS'] ?>\n\t\t\t\t\t\t\t\t\t\t\t\t<select name=\"searchcat_prodperpagebottom\" id=\"searchcat_prodperpagebottom\">\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor ($ii=$Settings_arr[\"productlist_interval\"];$ii<=$Settings_arr[\"productlist_maxval\"];$ii+=$Settings_arr[\"productlist_interval\"])\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"<?php echo $ii?>\" <?php echo ($catperpage==$ii)?'selected=\"selected\"':''?>><?php echo $ii?></option>\n\t\t\t\t\t\t\t\t\t\t\t\t<?php\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t<input type=\"button\" name=\"bottom_submit_Page\" value=\"<?php echo $Captions_arr['SEARCH']['SEARCH_GO']?>\" class=\"buttonred\" onclick=\"handle_searchcatdropdownval_sel('<?php echo $ecom_hostname?>','searchcat_sortbybottom','searchcat_sortorderbottom','searchcat_prodperpagebottom')\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t<?\n\t\t\t\t\t\t\t}\n\t\t}", "public function testCategoriesAreFilteredByName()\n {\n $visibleCategory = factory(Category::class)->create();\n $notVisibleCategory = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories?filter[categories.name]='.$visibleCategory->name)\n ->assertSuccessful()\n ->assertSee(route('categories.edit', $visibleCategory))\n ->assertDontSee(route('categories.edit', $notVisibleCategory));\n }", "public function search() {\n\n if ($this->request->is('post')) {\n\n // Lay du lieu tu form\n\n $listCat = $_REQUEST['listCat'];\n\n $this->Session->write('catId', $listCat);\n\n\n\n // Get keyword\n\n $keyword = $_REQUEST['keyword'];\n\n $this->Session->write('keyword', $keyword);\n\n } else {\n\n $listCat = $this->Session->read('catId');\n\n $keyword = $this->Session->read('keyword');\n\n }\n\n\n\n // setup condition to search\n\n $condition = array();\n\n if (!empty($keyword)) {\n\n $condition[] = array(\n\n 'Product.name LIKE' => '%' . $keyword . '%'\n\n );\n\n }\n\n\n\n if ($listCat > 0) {\n\n $condition[] = array(\n\n 'Product.cat_id' => $listCat\n\n );\n\n }\n\n\n\n // Lưu đường dẫn để quay lại nếu update, edit, dellete\n\n $urlTmp = DOMAINAD . $this->request->url;\n\n $this->Session->write('pageproduct', $urlTmp);\n\n\n\n // Sau khi lay het dieu kien sap xep vao 1 array\n\n $conditions = array();\n\n foreach ($condition as $values) {\n\n foreach ($values as $key => $cond) {\n\n $conditions[$key] = $cond;\n\n }\n\n }\n\n\n\n // Tang so thu tu * limit (example : 10)\n\n $urlTmp = DOMAINAD . $this->request->url;\n\n $urlTmp = explode(\":\", $urlTmp);\n\n if (isset($urlTmp[2])) {\n\n $startPage = ($urlTmp[2] - 1) * 10 + 1;\n\n } else {\n\n $startPage = 1;\n\n }\n\n $this->set('startPage', $startPage);\n\n\n\n // Simple to call data\n\n $this->paginate = array(\n\n 'conditions' => $condition,\n\n 'order' => 'Product.id DESC',\n\n 'limit' => '10'\n\n );\n\n $product = $this->paginate('Product');\n\n $this->set('product', $product);\n\n\n\n // Load model\n\n $this->loadModel(\"Catproduct\");\n\n $list_cat = $this->Catproduct->generateTreeList(null, null, null, '-- ');\n\n $this->set(compact('list_cat'));\n\n }", "public function testBuildURL(){\n $this->assertEquals($this->object\n ->buildURL('get-product-categories',\n array(\n 'type'=>'categorie-name',\n 'search'=>'android'\n )),'http://api.kactoos.com/br/api/products/get-product-categories/format/xml/appname/jaydson/apikey/8f14e45fceea167a5a36dedd4bea2543/type/categorie-name/search/android');\n }", "public function test_index_return_view()\n {\n $this->categoryRepositoryMock->shouldReceive('getAllCategory', 'findExceptCategory');\n $controller = new CategoryController($this->categoryRepositoryMock);\n $request = new CategoryRequest();\n $view = $controller->index($request);\n\n $this->assertEquals('admin.pages.category.list', $view->getName());\n $this->assertArrayHasKey('categories', $view->getData());\n }", "function filter_categories ( $page) {\n global $db;\n return find_by_sql(\"SELECT * FROM categorias where idpagina =\".$db->escape($page).\" ORDER BY name\");\n \n}", "public function search($category)\n {\n // but if the criteria title is specified, we use it\n \n $boolQuery = new \\Elastica\\Query\\Bool();\n /*Fetch only VALIDATED place*/\n $queryStatus = new \\Elastica\\Query\\Match();\n $queryStatus->setFieldQuery('event.status', StatusType::VALIDATED);\n $boolQuery->addMust($queryStatus);\n \n if($category !== null){\n $queryCategory = new \\Elastica\\Query\\Match();\n $queryCategory->setFieldQuery('event.categories.slug', $category);\n $boolQuery->addMust($queryCategory);\n } \n \n// if($placeSearch->getBirthdayDiscount() != null && $placeSearch->getBirthdayDiscount() > 0 ){\n// $queryRange = new \\Elastica\\Query\\Range();\n// $queryRange->setParam('place.birthdayDiscount', ['gte' => 1]);\n// $boolQuery->addMust($queryRange);\n// }\n// \n// if(($placeSearch->getName() != null || $placeSearch->getCategories() != null ) && $placeSearch != null){\n// \n// if($placeSearch->getName() != null){\n// $query = new \\Elastica\\Query\\Match();\n// $query->setFieldQuery('place.name', $placeSearch->getName());\n// $query->setFieldFuzziness('place.name', 1);\n// $query->setFieldMinimumShouldMatch('place.name', '10%');\n// $boolQuery->addMust($query);\n// }\n// \n// if($placeSearch->getCategories() != null){ \n// foreach ($placeSearch->getCategories() as $cat){ \n// $categories[] = $cat->getName(); \n// }\n// $queryCategories = new \\Elastica\\Query\\Terms();\n// $queryCategories->setTerms('place.categories', $categories);\n// $boolQuery->addShould($queryCategories);\n// }\n// \n //} \n else {\n $query = new \\Elastica\\Query\\MatchAll();\n }\n $baseQuery = $boolQuery; \n\n // then we create filters depending on the chosen criterias\n $boolFilter = new \\Elastica\\Filter\\Bool();\n\n /*\n Dates filter\n We add this filter only the getIspublished filter is not at \"false\"\n */\n// if(\"false\" != $articleSearch->getIsPublished()\n// && null !== $articleSearch->getDateFrom()\n// && null !== $articleSearch->getDateTo())\n// {\n// $boolFilter->addMust(new \\Elastica\\Filter\\Range('publishedAt',\n// array(\n// 'gte' => \\Elastica\\Util::convertDate($articleSearch->getDateFrom()->getTimestamp()),\n// 'lte' => \\Elastica\\Util::convertDate($articleSearch->getDateTo()->getTimestamp())\n// )\n// ));\n// }\n//\n // Published or not filter\n// if($placeSearch->getIs24h() !== null && $placeSearch->getIs24h()){\n// //var_dump($placeSearch->getIs24h());die();\n// $boolFilter->addMust(\n// new \\Elastica\\Filter\\Term(['is24h' => $placeSearch->getIs24h()])\n// //new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// ); \n// \n// //$boolFilter->addMust('is24h', $placeSearch->getIs24h());\n// }\n// \n// if($placeSearch->getIsWifi() !== null && $placeSearch->getIsWifi()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isWifi' => $placeSearch->getIsWifi()]) \n// );\n// }\n// \n// if($placeSearch->getIsDelivery() !== null && $placeSearch->getIsDelivery()){\n// $boolFilter->addMust( \n// new \\Elastica\\Filter\\Term(['isDelivery' => $placeSearch->getIsDelivery()]) \n// );\n// } \n\n $filtered = new \\Elastica\\Query\\Filtered($baseQuery, $boolFilter);\n\n $query = \\Elastica\\Query::create($filtered);\n\n return $this->find($query);\n }", "public function testSearch()\n\t{\n\t\t$this->call('GET', '/api/posts/search');\n\t}", "function searchRecipes($search_term, $category='all')\r\n {\r\n //add wildcards to search\r\n $search_term = '%' . $search_term . '%';\r\n //search all categories\r\n if($category == 'all') {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameter\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n //search category supplied\r\n else {\r\n //define query\r\n $query = \"SELECT * FROM recipe\r\n WHERE (category = :category)\r\n AND (title LIKE :search\r\n OR description LIKE :search\r\n OR ingredients LIKE :search\r\n OR instructions LIKE :search\r\n OR time LIKE :search)\r\n ORDER BY date_created DESC\";\r\n\r\n //prepare statement\r\n $statement = $this->_db->prepare($query);\r\n\r\n //bind parameters\r\n $statement->bindParam(':category', $category, PDO::PARAM_STR);\r\n $statement->bindParam(':search', $search_term, PDO::PARAM_STR);\r\n }\r\n\r\n //execute\r\n $statement->execute();\r\n\r\n //get result\r\n $result = $statement->fetchAll(PDO::FETCH_ASSOC);\r\n return $result;\r\n }", "public function autocomplete()\n {\n $items = Category::orderBy('parent_id', 'ASC');\n\n $items->whereHas('translation', function ($query) {\n if (Request::filled('keyword')) {\n $query->where('title', 'LIKE', '%' . Request::input('keyword') . '%');\n } else {\n $query->where('parent_id', 0);\n }\n });\n\n\n /**\n * Content type filter\n */\n if (Request::filled('content_type_id')) {\n $items->where('content_type_id', (int) Request::input('content_type_id'));\n }\n\n\n /**\n * Query\n */\n $items = $items->paginate(5);\n\n\n /**\n * Response structure\n */\n return CategoryAutocompleteResource::collection($items);\n }", "public function testGetProductsListByCategory()\n\t{\n\t\t/**\n\t\t * @var shopModel $shopModel\n\t\t */\n\t\t$shopModel = getModel('shop');\n\n\t\t$product_repository = $shopModel->getProductRepository();\n\n\t\t$args = new stdClass();\n\t\t$args->module_srl = 104;\n\t\t$args->category_srls = array(self::CATEGORY_TSHIRTS);\n\t\t$output = $product_repository->getProductList($args);\n\n\t\t$products = $output->products;\n\t\t$this->assertEquals(1, count($products));\n\n\t\tforeach($products as $product)\n\t\t{\n\t\t\t$this->assertNull($product->parent_product_srl);\n\n\t\t\t$this->assertTrue($product->isConfigurable());\n\t\t\t$this->assertTrue(is_a($product, 'ConfigurableProduct'));\n\n\t\t\t$this->assertEquals(6, count($product->associated_products));\n\n\t\t\tforeach($product->associated_products as $associated_product)\n\t\t\t{\n\t\t\t\t$this->assertTrue(is_a($associated_product, 'SimpleProduct'));\n\t\t\t}\n\t\t}\n\n\t}", "public function testListCategoriesWithPagination()\n {\n $this->makeDataOfListCategories(25);\n $user = $this->makeAdminToLogin();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user)\n ->visit('/admin/categories')\n ->resize(900, 1600)\n ->assertSee('List Categories');\n $elements = $browser->elements('.pagination li');\n $numberPage = count($elements) - 2;\n $this->assertTrue($numberPage == ceil(25 / (config('define.page_length'))));\n });\n }", "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "public function test_new_category_registration()\n {\n $this->visit('/olify_category')\n ->type('Vegetables', 'category_name')\n ->select('category_status')\n ->type('description')\n ->press('Add')\n ->seePageIs('dashboard');\n }", "public function search($search_term, $category = 0){\n\t\t\t$this->search_type = self::get_search_type($search_term);\n\t\t\t\n\t\t\t$long = 0;\n\t\t\t$lat = 0;\t\t\t\n\n\t\t\t//postcode?\n\t\t\tif($this->search_type == 'postcode'){\n\n\t\t\t\t//if its a partial postcode, padd it\n\t\t\t\t$clean_postcode = clean_postcode($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'UK');\n\n\t\t\t\tif($longlat != false){\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.ukpostcode\");\n\t\t\t}\n\t\t\t\n\t\t\t//zipcode?\n\t\t\tif($this->search_type == 'zipcode'){\n\t\t\t\t$clean_postcode = trim($search_term);\n\t\t\t\t$longlat = get_postcode_location($clean_postcode, 'US');\n\t\t\t\tif($longlat == false){\n\t\t\t\t\tarray_push($this->warnings, \"A error occured when trying to find that zip code\");\n\t\t\t\t\ttrigger_error(\"Unable to get location for zipcode: \" . $search_term);\n\t\t\t\t}else{\n\t\t\t\t\t$long = $longlat[0];\n\t\t\t\t\t$lat = $longlat[1];\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.zipcode\");\t\t\t\t\n\t\t\t}\n\t\t\t//long lat?\n\t\t\tif($this->search_type == 'longlat'){\n\n\t\t\t\t$split = split(\",\", trim($search_term));\n\t\t\t\t$long = $split[0];\n\t\t\t\t$lat = $split[1];\n\n\n\t\t\t\t//Update the stats table\n\t\t\t\ttableclass_stat::increment_stat(\"search.type.longlat\");\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Do the search for groups directly covering this location\n\t\t\t$search = factory::create('search');\n\t\t\t$groups = $search->search('group', $this->add_category(array(\n\t\t\t\tarray('long_bottom_left', '<', $long),\n\t\t\t\tarray('long_top_right', '>', $long),\n\t\t\t\tarray('lat_bottom_left', '<', $lat),\n\t\t\t\tarray('lat_top_right', '>', $lat),\n\t\t\t\tarray('confirmed', '=', 1)\t\t\n\t\t\t\t), $category),\n\t\t\t\t'AND'\n\t\t\t);\n\t\t\t\n\t\t\t//Do another search with buffeering based on population density \n\t\t\t$gaze = factory::create('gaze');\n\t\t\t$radius_km = $gaze->get_radius_containing_population($long, $lat, POPULATION_THRESHOLD, MAX_KM_DISTANCE_BUFFER);\n\t\t\t\n\t\t\t//if that worked, do the other search\n\t\t\tif ($radius_km && $gaze->status !='service unavaliable' && !get_http_var('pointonly')) {\n\t\t\t\n\t\t\t\t//work out the buffered long / lat values\n\t\t\t\t$buffered_long = distance_to_longitude($radius_km);\n\t\t\t\t$buffered_lat = distance_to_latitude($radius_km);\n\n\t\t\t\t//make the bounding box\n\t\t\t\t$buffered_bottom_left_long = $long - $buffered_long;\n\t\t\t\t$buffered_bottom_left_lat = $lat - $buffered_lat;\n\t\t\t\t$buffered_top_right_long = $long + $buffered_long;\n\t\t\t\t$buffered_top_right_lat = $lat + $buffered_lat;\n\n\t\t\t\t//do the buffered searches (THIS IS REALY INEFFICANT BUT PEAR DATA OBJECTS DONT DO MIXED AND/OR SEARCHES)\n\t\t\t\t$groups_buffered = array();\n\t\t\t\t$groups_buffered1 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered1);\n\t\t\t\t\n\t\t\t\t$groups_buffered2 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('long_top_right', '>', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered2);\n\t\t\t\t\n\t\t\t\t$groups_buffered3 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_bottom_left', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_bottom_left', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_top_right', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_top_right', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered3);\n\t\t\t\t\n\t\t\t\t$groups_buffered4 = $search->search('group', $this->add_category(array(\n\t\t\t\t\tarray('long_top_right', '>', $buffered_bottom_left_long),\n\t\t\t\t\tarray('long_top_right', '<', $buffered_top_right_long),\n\t\t\t\t\tarray('lat_bottom_left', '>', $buffered_bottom_left_lat),\n\t\t\t\t\tarray('lat_bottom_left', '<', $buffered_top_right_lat),\n\t\t\t\t\tarray('confirmed', '=', 1)\t\t\t\t\n\t\t\t\t\t), $category),\n\t\t\t\t\t'AND'\n\t\t\t\t);\n\t\t\t\t$groups_buffered = array_merge($groups_buffered, $groups_buffered4);\n\n\t\t\t\t//if we have any buffered groups, add them in\n\t\t\t\tif($groups_buffered){\n\t\t\t\t\t$groups = array_merge($groups, $groups_buffered);\n\t\t\t\t\t\n\t\t\t\t\t//remove any duplicates (again should really be in the database call)\n\t\t\t\t\t$cleaned_groups = array();\n\t\t\t\t\tforeach ($groups as $group){\n\t\t\t\t\t\tif (!isset($cleaned_groups[$group->group_id]))\n\t\t\t\t\t\t\t$cleaned_groups[$group->group_id] = $group;\n\t\t\t\t\t}\n\t\t\t\t\t$groups = array_values($cleaned_groups);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tusort($groups, create_function('$a,$b',\n\t\t\t\t'\n\t\t\t\tif ($a->{category_id} < $b->{category_id}) return -1;\n\t\t\t\tif ($a->{category_id} > $b->{category_id}) return 1;\n\t\t\t\tif ($a->{zoom_level} < $b->{zoom_level}) return 1;\n\t\t\t\tif ($a->{zoom_level} > $b->{zoom_level}) return -1;\n\t\t\t\treturn 0;\n\t\t\t\t'\n\t\t\t));\n\n\t\t\t//Update the stats table\n\t\t\ttableclass_stat::increment_stat(\"search.count\");\n\t\t\t\n\t\t\t//Return search result\n\t\t\treturn array($groups, $long, $lat);\n\t\t\t\n\t\t}", "function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "public function testCreateAndFindCategory()\n\t{\n $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n\t\t$array_category = array(\n\t\t 'user_id' => $user->id,\n\t\t\t'name' => 'Temporal'\n\t\t);\n\n\t\t$category = factory(Category::class)->create($array_category);\n\n\t\t$response = $this->get('api/categories/' . $category->id);\n\n\t\t$response->assertStatus(200);\n\t\t$this->assertDatabaseHas('categories', $array_category);\n\t}", "public function filterSpecificCategories($array){\n\n $newArray = [];\n\n foreach($array as $key => $value){\n $cat = trim(strtolower(strstr($value->getArticleID()->getCategory(), ' ')));\n if($cat == \"world news\" || $cat == \"football\"/* ||$cat == \"fashion\" || $cat == \"technology\"*/){\n //test fashion whs technology $numb raus? film und politics guuut 0.8\n $newArray[$key] = $value;\n }\n\n /* if($cat == \"sport\"|| $cat == \"football\" || $cat == \"culture\" || $cat == \"art and design\"){\n $newArray[$key] = $value;\n }*/\n\n /*if( $cat == \"sport\" || $cat == \"uk news\" || $cat == \"opinion\" || $cat == \"society\" || $cat == \"business\" ||\n $cat == \"politics\" || $cat == \"world news\" || $cat == \"life and style\" || $cat == \"environment\" || $cat == \"technology\"\n ||$cat == \"television & radio\" || $cat == \"culture\" || $cat == \"art and design\" || $cat == \"film\" || $cat == \"books\"\n ||$cat == \"us news\" || $cat == \"football\" || $cat == \"fashion\" || $cat == \"travel\" || $cat == \"science\"/*){ //20 categories\n $newArray[$key] = $value;\n }*/\n\n /* if( $cat == \"us news\" || $cat == \"technology\" || $cat == \"science\" || $cat == \"sport\" || $cat == \"opinion\" ||\n $cat == \"world news\" || $cat == \"football\" || $cat == \"politics\" || $cat == \"fashion\" || $cat == \"television & radio\"\n ||$cat == \"culture\" || $cat == \"environment\" || $cat == \"art and design\" || $cat == \"life and style\" || $cat == \"travel\"/*\n || $cat == \"books\" || $cat == \"uk news\" || $cat == \"business\" || $cat == \"film\" || $cat == \"society\"){ //20 categories\n $newArray[$key] = $value;\n }\n */\n\n }\n\n\n return $newArray;\n }", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "function count_category_by($conds = array()){\n\t\t$this->custom_conds();\n\t\t//where clause\n\t\t\n\t\t$this->db->select('rt_categories.*, count(rt_touches.type_id) as t_count'); \n \t\t$this->db->from('rt_categories');\n \t\t$this->db->join('rt_touches', 'rt_categories.id = rt_touches.type_id');\n \t\t$this->db->where('rt_touches.type_name','category');\n \t\t$this->db->where('rt_categories.status',1);\n \t\t$this->db->where('rt_touches.shop_id',$conds['shop_id']);\n\n \t\t\n\n\t\tif ( isset( $conds['search_term'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where( 'rt_touches.added_date >=', $mindate );\n \t\t\t\t\t$this->db->where( 'rt_touches.added_date <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where( 'rt_touches.added_date >=', $mindate );\n \t\t\t\t\t$this->db->where( 'rt_touches.added_date <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t\t\n\t\t\t}\n\t\t\t \n\t }\n\t\t\n\n \t\t$this->db->group_by('rt_touches.type_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n\n\n \t\treturn $this->db->count_all_results();\n\t}", "public function testListCategoriesHavePagination()\n {\n $this->makeDataOfListCategories(15);\n $user = $this->makeAdminToLogin();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user)\n ->visit('/admin/categories')\n ->resize(900, 1600)\n ->assertSee('List Categories')\n ->click('.pagination li:nth-child(3) a');\n $elements = $browser->elements('#table-categories tbody tr');\n $this->assertCount(5, $elements);\n $browser->assertQueryStringHas('page', 2);\n $this->assertNotNull($browser->element('.pagination'));\n });\n }", "public function testCategoryPageLoads() {\n\t\t$articleCountLocator = $this->locatorObj->readConfigData ( \"articleCounter\" );\n\t\t$this->currentWindow ()->maximize ();\n\t\t$this->url ( \"/\" );\n\t\t$this->logger->info ( \"*************** start of CategoryPageLoads testcase*********** \" );\n\t\t$this->applicationFunctionObj->navigateToMainPage ( $this );\n\t\t$this->applicationFunctionObj->waitUntilElementIsVisible ( $this, $articleCountLocator,\"xpath\");\n\t\t$catCountString = $this->byXPath ( $articleCountLocator )->text ();\n\t\t$this->logger->info ( \"Category page is loaded successfully\" );\n\t\t$parts = explode ( ' ', $catCountString );\n\t\t$count = ( int ) array_values ( $parts ) [0];\n\t\techo $count;\n\t\tif ($count > 2000) {\n\t\t\t$this->logger->info ( \"Category page is loaded successfully Category count is greater than 2000\" );\n\t\t} else {\n\t\t\t$this->fail ( \"Category page is not fully loaded\" );\n\t\t}\n\t\t$this->logger->info ( \"*************** end of CategoryPageLoads testcase********** \" );\n\t}", "function getTestCasesInsideACategory($testCategoryID, $theSubjectID, $roundID, $clientID) {\n global $definitions;\n\n $categoriesItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['testcasescategory'], $clientID);\n $categoryParentPropertyID = getClientPropertyID_RelatedWith_byName($definitions['testcasescategoryParentID'], $clientID);\n $testCasesArray = array();\n\n //First, get the internal structure of testCategories\n $tcatTree = getItemsTree($categoriesItemTypeID, $clientID, $categoryParentPropertyID, $testCategoryID);\n\n $idsToRetrieve = array();\n\n //Store all testCategories ids found in a plain array\n foreach ($tcatTree as $tc) {\n for ($j = 0; $j < count($tc); $j++) {\n if (!(in_array($tc[$j]['parent'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['parent'];\n }\n if (!(in_array($tc[$j]['ID'], $idsToRetrieve))) {\n $idsToRetrieve[] = $tc[$j]['ID'];\n }\n }\n }\n\n //Get the relations item\n $relations = getRelations($roundID, $theSubjectID, $clientID);\n\n if ((count($relations) - 1) == 0) {\n //Get the test cases ids inside an array\n $idsToSearch = explode(',', $relations[0]['testCasesIDs']);\n for ($i = 0; $i < count($idsToRetrieve); $i++) {\n //Get the test cases and filter\n $availableTestCases = array();\n $availableTestCases = getFilteredTestCasesInsideCategory($idsToRetrieve[$i], $idsToSearch, $clientID);\n //And add to results\n for ($j = 0; $j < count($availableTestCases); $j++) {\n $partRes = array();\n $partRes['ID'] = $availableTestCases[$j]['ID'];\n $testCasesArray[] = $partRes;\n }\n }\n }\n\n return $testCasesArray;\n}", "public function testLayoutListCategories()\n {\n $user = $this->makeAdminToLogin();\n $this->browse(function (Browser $browser) use ($user) {\n $browser->loginAs($user)\n ->visit('/admin/categories')\n ->assertSee('List Categories')\n ->assertSeeLink('Admin')\n ->assertSee('ID')\n ->assertSee('Name')\n ->assertSee('Number of Books');\n });\n }", "public function get_categories($category = '')\n {\n /** @var \\tacitus89\\homepage\\entity\\category[] $entities */\n $entities = array();\n\n\t\t//it show all categories\n if($category == ''){\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1, '. FORUMS_TABLE .' f2\n\t\t\tWHERE (f2.hp_show = 1 AND f2.parent_id = 0\n\t\t\t AND (f1.hp_special = 0 AND f1.hp_show = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id)) )\n\t\t\t\tOR (f1.forum_id = 543 AND f2.forum_id = 543)\n\t\t\t\tOR (f2.hp_show = 1 AND f1.hp_special = 1 AND (f1.parent_id = 0 OR f1.parent_id = f2.forum_id))\n\t\t\tORDER BY f1.hp_special, f1.left_id ASC';\n }\n\t\t//Special url\n\t\t//display all modding forums\n elseif ($category == 'modding') {\n $sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tWHERE f1.hp_show = 1 AND f1.hp_special = 1\n\t\t\tORDER BY f1.left_id ASC';\n }\n\t\t//display all forums of category\n\t\telse {\n\t\t\t$sql = 'SELECT f1.forum_id, f1.parent_id, f1.forum_name, f1.forum_desc, f1.forum_image, f1.hp_url, f1.hp_desc, f1.hp_special\n\t\t\tFROM ' . FORUMS_TABLE . ' f1\n\t\t\tRIGHT JOIN '. FORUMS_TABLE .' f2 ON (f2.left_id < f1.left_id AND f2.right_id > f1.right_id)\n\t\t\tWHERE f1.hp_show = 1 AND f2.hp_show = 1 \n\t\t\t\tAND f1.hp_special = 0 AND f2.hp_special = 0\n\t\t\t AND f2.hp_url = \"'. $category .'\"\n\t\t\tORDER BY f1.left_id ASC';\n\t\t}\n // Load all page data from the database\n $result = $this->db->sql_query($sql);\n\n while ($row = $this->db->sql_fetchrow($result))\n {\n\t\t\t//adding to pseudo-Category\n\t\t\tif($row['hp_special'] == 1)\n\t\t\t{\n\t\t\t\t$row['parent_id'] = 543;\n\t\t\t}\n\t\t\t//pseudo-Category\n\t\t\tif($row['forum_id'] == 543)\n\t\t\t{\n\t\t\t\t$row['forum_name'] = 'Modding';\n\t\t\t\t$row['hp_url'] = 'modding';\n\t\t\t}\n\t\t\t\n $category = $this->container->get('tacitus89.homepage.category')->import($row);\n if(isset($entities[$row['parent_id']]) && $row['parent_id'] > 0)\n {\n\t\t\t\t$entities[$row['parent_id']]->add_forum($category);\n }\n else\n {\n // Import each page row into an entity\n $entities[$row['forum_id']] = $category;\n }\n }\n $this->db->sql_freeresult($result);\n\n // Return all page entities\n return $entities;\n }", "function count_purchased_category_by( $conds = array() ) {\n\n\t\t$this->db->select('rt_categories.*, count(rt_transactions_counts.cat_id) as t_count'); \n\t\t$this->db->from('rt_categories');\n\t\t$this->db->join('rt_transactions_counts', 'rt_categories.id = rt_transactions_counts.cat_id');\n\t\t$this->db->where('rt_categories.status',1);\n\t\t$this->db->where('rt_transactions_counts.shop_id',$conds['shop_id']);\n\n\n\n \t\tif ( isset( $conds['search_term'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where( 'rt_transactions_counts.added_date >=', $mindate );\n \t\t\t\t\t$this->db->where( 'rt_transactions_counts.added_date <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_transactions_counts.added_date BETWEEN DATE('\".$mindate.\"' - INTERVAL 1 DAY) AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\t\t\t\t\t$this->db->where( 'rt_transactions_counts.added_date >=', $mindate );\n \t\t\t\t\t$this->db->where( 'rt_transactions_counts.added_date <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t}\n\t\t\t \n\t }\n\t\t\n\n \t\t$this->db->group_by('rt_transactions_counts.cat_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n\n \t\treturn $this->db->count_all_results();\n}", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function testCategoriesAreListed()\n {\n $category = factory(Category::class)->create();\n\n $this->actingAs(factory(User::class)->states('admin')->create())\n ->get('categories')\n ->assertSuccessful()\n ->assertSee($category->name);\n }", "function getProductByCategorySearch($category_id, $keyword){\r\n\t\t$unix_product = array();\r\n\t\t//$has_printed = false;\r\n\t\t$total_product_1 = 0;\r\n\t\t$total_product_2 = 0;\r\n\t\t$keyword=strtolower($keyword);\r\n\t\t\r\n\t\tif($category_id!=0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category WHERE parent_id=\".$category_id);\t\r\n\t\t}\r\n\t\telseif($category_id==0){\r\n\t\t\t$q_category = getResultSet(\"SELECT DISTINCT(category_id) FROM \".DB_PREFIX.\"category\");\t\r\n\t\t}\r\n\t\twhile($rc=mysql_fetch_array($q_category)){\r\n\t\t\t$cat_id = $rc['category_id'];\r\n\t\t\t//if($category_id!=0){\r\n\t\t\t$q_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$cat_id.\" AND lower(D.name) LIKE '%$keyword%'\");\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t$total_product_1 = mysql_num_rows($q_product_id);\t\t\t\t\t\t\t\t\t\r\n\t\t\twhile($rp=mysql_fetch_array($q_product_id)){\r\n\t\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t\t$product = new product($product_id);\r\n\t\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\t\techo '<div class=\"item\">';\r\n\t\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().'_'.$total_product_1.'</div>';\r\n\t\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\t\techo '</div>';\r\n\t\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\t\techo '</a>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\t}\r\n\t\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Search Child Category\r\n\t\t$q_child_product_id=getResultSet(\"SELECT DISTINCT(C.product_id) FROM \".DB_PREFIX.\"product_to_category AS C\r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN \".DB_PREFIX.\"product_description AS D ON C.product_id = D.product_id \r\n\t\t\t\t\t\t\t\t\t\tWHERE C.category_id=\".$category_id.\" AND lower(D.name) LIKE '%$keyword%'\");\r\n\t\t$total_product_2 = mysql_num_rows($q_child_product_id);\r\n\t\twhile($rp=mysql_fetch_array($q_child_product_id)){\r\n\t\t\t$product_id = $rp['product_id'];\r\n\t\t\t$product = new product($product_id);\r\n\t\t\tif(!in_array($product_id, $unix_product)){\r\n\t\t\techo '<div class=\"item\">';\r\n\t\t\t\techo '<div class=\"desc\">';\r\n\t\t\t\t\techo '<div class=\"item_name\" >'.$product->getProductName().$total_product_2.'</div>';\r\n\t\t\t\t\techo '<div class=\"shop_name\"><span style=\"padding: 5px 20px 5px 20px; background-image: url('.HTTP_DOMAIN.'store/image/icon/store.png);background-repeat: no-repeat;background-position: 0px center;\">'.$product->getShopName().'</span></div>';\r\n\t\t\t\t\techo '<div class=\"price\" >$'.$product->getProductPrice().'</div>';\r\n\t\t\t\techo '</div>';\r\n\t\t\t\techo '<a href=\"?page=productdetail&product='.$product_id.'\">';\r\n\t\t\t\techo '<img src=\"'.$product->getProductImage().'\">';\r\n\t\t\t\techo '</a>';\r\n\t\t\techo '</div>';\r\n\t\t\t}\r\n\t\t\t$unix_product[] = $rp['product_id'];\r\n\t\t\t$unix_product = array_unique($unix_product);\r\n\t\t}\r\n\t\t//Info if Search No Result \r\n\t\t/*\r\n\t\tif($total_product_1==0 && $total_product_2==0){\r\n\t\t\techo '<div class=\"no_item\" style=\"height:200px;padding: 10px 10px 10px 20px; color: #CCC; font-size: 20px;\">';\r\n\t\t\t\techo 'No Result! RUn'.$total_product_1.'_'.$total_product_2;\r\n\t\t\t\t//echo ':)'.$rLanguage->text(\"Logout\");\t\r\n\t\t\techo '</div>';\r\n\t\t}\r\n\t\t*/\r\n\t}", "function ciniki_recipes_web_categories($ciniki, $settings, $tnid) {\n\n $strsql = \"SELECT DISTINCT category AS name \"\n . \"FROM ciniki_recipes \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"AND category <> '' \"\n . \"ORDER BY category \"\n . \"\";\n \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.recipes', array(\n array('container'=>'categories', 'fname'=>'name', 'name'=>'category',\n 'fields'=>array('name')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok');\n }\n $categories = $rc['categories'];\n\n //\n // Load highlight images\n //\n foreach($categories as $cnum => $cat) {\n //\n // Look for the highlight image, or the most recently added image\n //\n $strsql = \"SELECT ciniki_recipes.primary_image_id, ciniki_images.image \"\n . \"FROM ciniki_recipes, ciniki_images \"\n . \"WHERE ciniki_recipes.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND category = '\" . ciniki_core_dbQuote($ciniki, $cat['category']['name']) . \"' \"\n . \"AND ciniki_recipes.primary_image_id = ciniki_images.id \"\n . \"AND (ciniki_recipes.webflags&0x01) = 1 \"\n . \"ORDER BY (ciniki_recipes.webflags&0x10) DESC, \"\n . \"ciniki_recipes.date_added DESC \"\n . \"LIMIT 1\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'image');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['image']) ) {\n $categories[$cnum]['category']['image_id'] = $rc['image']['primary_image_id'];\n } else {\n $categories[$cnum]['category']['image_id'] = 0;\n }\n }\n\n return array('stat'=>'ok', 'categories'=>$categories); \n}", "public function getAllWithCategory();", "public function category_search_get($category_name=\"cell_process\")\n {\n $sutil = new CILServiceUtil();\n $query = file_get_contents('php://input', 'r');\n $json = $sutil->searchCategory($category_name, $query);\n $this->response($json);\n }", "function rule_categories($offset, $limit, $phrase)\n\t{\n\t\tlog_message('debug', '_setting/rule_categories');\n\t\tlog_message('debug', '_setting/rule_categories:: [1] offset='.$offset.' limit='.$limit.' phrase='.$phrase);\n\n\t\t$values['phrase_condition'] = !empty($phrase)? \" AND A.category_display LIKE '%\".htmlentities($phrase, ENT_QUOTES).\"%'\": '';\n\t\t$values['limit_text'] = \" LIMIT \".$offset.\",\".$limit.\" \";\n\n\t\t$result = server_curl(IAM_SERVER_URL, array('__action'=>'get_list', 'query'=>'get_rule_category_list', 'variables'=>$values));\n\t\tlog_message('debug', '_setting/permission_group_details:: [2] result='.json_encode($result));\n\n\t\treturn $result;\n //return $values;\n\t}", "public function getCategory() {}", "public function testDeleteCategoryUsingDELETE()\n {\n }", "public function testAutoComplete() {\n $account = $this->drupalCreateUser(array('administer monitoring'));\n $this->drupalLogin($account);\n\n // Test with \"C\", which matches Content and Cron.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'C')));\n $this->assertEqual(count($categories), 2, '2 autocomplete suggestions.');\n $this->assertEqual('Content', $categories[0]['label']);\n $this->assertEqual('Cron', $categories[1]['label']);\n\n // Check that a non-matching prefix returns no suggestions.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'non_existing_category')));\n $this->assertTrue(empty($categories), 'No autocomplete suggestions for non-existing query string.');\n }", "function get_category_by ( $conds = array(), $limit = false, $offset = false ){\n\n\t\t//$this->custom_conds();\n\t\t//where clause\n\t\t$this->db->select('rt_categories.*, count(rt_touches.type_id) as t_count'); \n \t\t$this->db->from('rt_categories');\n \t\t$this->db->join('rt_touches', 'rt_categories.id = rt_touches.type_id');\n \t\t$this->db->where('rt_touches.type_name','category');\n \t\t$this->db->where('rt_categories.status',1);\n \t\t$this->db->where('rt_touches.shop_id',$conds['shop_id']);\n\n \t\tif ( isset( $conds['search_term'] )) {\n\t\t\t$dates = $conds['date'];\n\n\t\t\tif ($dates != \"\") {\n\t\t\t\t$vardate = explode('-',$dates,2);\n\n\t\t\t\t$temp_mindate = $vardate[0];\n\t\t\t\t$temp_maxdate = $vardate[1];\t\t\n\n\t\t\t\t$temp_startdate = new DateTime($temp_mindate);\n\t\t\t\t$mindate = $temp_startdate->format('Y-m-d');\n\n\t\t\t\t$temp_enddate = new DateTime($temp_maxdate);\n\t\t\t\t$maxdate = $temp_enddate->format('Y-m-d');\n\t\t\t} else {\n\t\t\t\t$mindate = \"\";\n\t\t\t \t$maxdate = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($conds['search_term'] == \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->like( '(name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name)', $conds['search_term'] );\n\t\t\t} else if ($conds['search_term'] != \"\" && $mindate != \"\" && $maxdate != \"\") {\n\t\t\t\t//got name and 2dates\n\t\t\t\tif ($mindate == $maxdate ) {\n\n\t\t\t\t\t$this->db->where(\"rt_touches.added_date BETWEEN DATE('\".$mindate.\"') AND DATE('\". $maxdate.\"' + INTERVAL 1 DAY)\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$today_date = date('Y-m-d');\n\t\t\t\t\tif($today_date == $maxdate) {\n\t\t\t\t\t\t$current_time = date('H:i:s');\n\t\t\t\t\t\t$maxdate = $maxdate . \" \". $current_time;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) >=', $mindate );\n \t\t\t\t\t$this->db->where( 'date(rt_touches.added_date) <=', $maxdate );\n\n\t\t\t\t}\n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t} else {\n\t\t\t\t//only name \n\t\t\t\t$this->db->group_start();\n\t\t\t\t$this->db->like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->or_like( 'name', $conds['search_term'] );\n\t\t\t\t$this->db->group_end();\n\t\t\t}\n\t\t\t \n\t }\n\n\t\t\n \t\t$this->db->group_by('rt_touches.type_id');\n \t\t$this->db->order_by('t_count', \"DESC\");\n \t\t$this->db->order_by( 'rt_touches.added_date', \"desc\" );\n \t\t\n\n \t\tif ( $limit ) {\n\t\t// if there is limit, set the limit\n\t\t\t\n\t\t\t$this->db->limit($limit);\n\t\t}\n\t\t\n\t\tif ( $offset ) {\n\t\t// if there is offset, set the offset,\n\t\t\t\n\t\t\t$this->db->offset($offset);\n\t\t}\n\n \t\treturn $this->db->get();\n\n\t}", "public function test_Category_Tree(){\n\n\t\t$exp_total\t= Good::all()->count();\n\n\t\t$get\t= [\n\t\t\t'draw'\t=> '12'\n\t\t];\n\t\t$res\t= Good::getTableData( $get );\n\n\t\t$this->assertEquals( 12, $res['draw'], \"\\n*** Assert 1 ***\\nWrong 'draw' value\\n\" );\n\t\t$this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 2 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t\t$new_item\t= [\n\t\t\t'name'\t=> ''\n\t\t\t,'article'=> ''\n\t\t\t,'rprice'\t=> 5.567\n\t\t\t,'wprice'\t=> 4.444\n\t\t\t,'inpack'\t=> 24\n\t\t\t,'packs'\t=> 13\n\t\t\t,'assort'\t=> 17\n\t\t];\n\n\n\n\t\t$this->db['Good']\t= [];\n\t\t$items\t= &$this->db['Good'];\n\n\t for( $i=0; $i<3; $i++ ){\n\t \t$item\t= $new_item;\n\t \t$item['name']\t= self::_ut_name.'_'.$i;\n\t \t$item['article']\t= self::_ut_name.'_'.$i;\n\t\t\t$item_obj\t= new Good();\n\t \t$item_obj\t= $item_obj->fill( $item );\n\t\t $res \t= $item_obj->save();\n\n\t\t $ids[]\t=\n\t\t $item['id']\t= $item_obj->id;;\n\n\t\t\t$items[]\t= $item;\n\n\t\t $item_obj\t= NULL;\n\t }\n\n\n// print_r( $ids);\n\n// \t $ut_item_id\t= $item_obj->id;\n\n\n\t $exp_total\t= Good::all()->count();\n\t $res\t= Good::getTableData( $get );\n// \t $item_obj->delete();\n\n// \t\tGood::whereIn('id');\n\n\n\t $this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 3 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t}", "public function testCatalogGetRandomProducts()\n {\n\n }", "public function test_getAllCategories_ifAnyCategoryExists_returnsAllCategories()\n {\n $collection = collect([new Category(), new Category()]);\n\n $this->_categoryRepositoryStub\n ->method('all')\n ->willReturn($collection);\n\n $categoryService = new CategoryService($this->_categoryRepositoryStub);\n $this->assertCount(2, $categoryService->getAllCategories());\n }", "public function testAddItemSubCategoryFileByURL()\n {\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\t\t//$condition = \"t.type != 'list'\";\n //$criteria->condition=$condition;\n if($this->key != ''){\n $criteriaKey=new CDbCriteria;\n //$this->key = iconv(\"UTF-8\", \"gbk\" ,$this->key);\n\t\t\t$criteriaKey->compare('t.id',$this->key,true, 'OR');\n $criteriaKey->compare('t.title',$this->key,true, 'OR');\n $criteria->mergeWith($criteriaKey, TRUE);\n }\n\t\t$criteria->compare('t.id',$this->id);\n\t\t$criteria->compare('t.title',$this->title,true);\n $criteria->compare('t.gid',$this->gid,true);\n $criteria->compare('t.type',$this->type);\n\t\treturn new CActiveDataProvider('Tb_category', array(\n\t\t\t'criteria'=>$criteria,\n\t\t 'pagination'=>array(\n 'pageSize'=>Yii::app()->user->getState('pageSize',Yii::app()->params['perPage']),\n ),\n 'sort'=>array(\n 'defaultOrder'=>'t.ID DESC',\n )\n\t\t));\n\t}" ]
[ "0.7567752", "0.73989975", "0.7242503", "0.71562", "0.7139698", "0.7115986", "0.70067894", "0.6880919", "0.6847107", "0.67653394", "0.6761281", "0.6755253", "0.6744826", "0.67350686", "0.67222136", "0.65815806", "0.6573648", "0.6540283", "0.6520912", "0.6503756", "0.64849675", "0.64053524", "0.639016", "0.6381228", "0.6358962", "0.6313437", "0.6309399", "0.63070726", "0.6299582", "0.62797034", "0.6279663", "0.62748486", "0.62737525", "0.6263656", "0.62300646", "0.6222079", "0.62212104", "0.6220674", "0.6214581", "0.62102944", "0.6190708", "0.618224", "0.6173857", "0.6164968", "0.6158244", "0.6148841", "0.61457056", "0.6142452", "0.6130318", "0.61300004", "0.6124843", "0.611658", "0.60943675", "0.60829663", "0.606162", "0.60543215", "0.6049953", "0.60484904", "0.60466087", "0.6040264", "0.6039548", "0.6027001", "0.6005675", "0.6004314", "0.6001539", "0.60012704", "0.59984976", "0.59982884", "0.5996525", "0.59787095", "0.59731823", "0.59693694", "0.59642833", "0.5961613", "0.59529525", "0.5952591", "0.5951101", "0.5947178", "0.5936933", "0.5934506", "0.5931106", "0.5916541", "0.59145343", "0.59108496", "0.59070385", "0.5905997", "0.58971655", "0.5891064", "0.58844244", "0.5882105", "0.5865919", "0.5865777", "0.5863034", "0.5861958", "0.58516103", "0.5849123", "0.5847592", "0.58471173", "0.5846002", "0.58415663", "0.58393526" ]
0.0
-1
///////Testing download statistics//////////////////////////// ///////End testing download statistics//////////////////////////// //////Helper functions/////////////////////////////////////
private function handleResponse($response) { if(is_null($response)) return null; $response = trim($response); if(strlen($response) == 0) return null; return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTrackDownloads()\n {\n echo \"\\ntestTrackDownloads\";\n $json_str = \"{\\\"Ip_address\\\":\\\"::1\\\",\\\"ID\\\":\\\"13007\\\",\\\"URL\\\":\\\"https://cildata.crbs.ucsd.edu/media/images/13007/13007.tif\\\",\\\"Size\\\":\\\"4400000\\\"}\";\n $url = TestServiceAsReadOnly::$elasticsearchHost.\"/rest/download_statistics\";\n $response = $this->curl_post($url, $json_str);\n //echo \"\\n-------testTrackDownloads Response:\".trim($response).\"------\";\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n }", "public function getDownloadcounter() {}", "public function getAlldownloadcounter() {}", "function edd_count_total_file_downloads() {\n global $edd_logs;\n return $edd_logs->get_log_count( null, 'file_download' );\n}", "public function downloadsize() {\n return $this->info['size_download'];\n }", "public function testFullFileDownload()\n {\n\n // dd($command);\n }", "function get_download_stats($requestid, $fileid)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('lic_file_downloads');\n\t\t$this->db->where('fileid', $fileid);\n\t\t$this->db->where('requestid', $requestid);\n\t\t$query = $this->db->get()->row_array();\n\n\t\tif (count($query)>0)\n\t\t{\t\t\n\t\t\treturn $query;\n\t\t}\n\t\treturn false;\t\t\t\n\t}", "function test_deferred_download() {\n\t\t$dowload = $this->api->deferred_download( 12345 );\n\t\t$this->assertContains( 'deferred_download=1', $dowload );\n\t\t$this->assertContains( 'item_id=12345', $dowload );\n\t}", "public function test_it_downloads_files()\n {\n // using a real url I suppose, so I'm just going to\n // make sure it constructs for now\n // @todo see if there is a better test for this\n $FileDownloader = new FileDownloader;\n }", "function update_download_stats($file_id,$request_id,$user)\n\t{\n\t\t$data=array(\n\t\t\t\t'fileid'=>$file_id,\n\t\t\t\t'requestid'=>$request_id,\n\t\t\t\t'lastdownloaded'=>date(\"U\")\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\t//log download\n\t\t$this->update_file_log($request_id,$file_id,$user);\n\t\t\n\t\t//check if tracking info already exists\n\t\t$exists=$this->get_download_stats($request_id, $file_id);\n\n\t\tif ($exists===FALSE)\n\t\t{\n\t\t\t//set default options\n\t\t\t$data['downloads']=1;\n\t\t\t$data['download_limit']=3;\n\t\t\t\t\n\t\t\t//insert\n\t\t\t$result=$this->db->insert('lic_file_downloads', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['downloads']=$exists['downloads']+1;\n\t\t\t\n\t\t\t//update\n\t\t\t$this->db->where('id', $exists['id']);\n\t\t\t$result=$this->db->update('lic_file_downloads', $data); \t\t\t\n\t\t}\n\t\t\n\t\treturn $result;\t\n\t}", "function retrieve_remote_file_size_type($url,$token=NULL){\n $ch = curl_init($url);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_HEADER, TRUE);\n curl_setopt($ch, CURLOPT_NOBODY, TRUE);\n if(!empty($token)){\n curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: Bearer '.$token));\n }\n\n $data = curl_exec($ch);\n $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\n\t $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n\n curl_close($ch);\n\n\t $result =array(\"size\"=>$size,\"type\"=>$type);\n return $result;\n}", "function getSize($url){\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url);\r\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_HEADER, true);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_exec($ch);\r\n $size = curl_getinfo($ch, CURLINFO_CONTENT_LENGTH_DOWNLOAD);\r\n return intval($size);\r\n }", "function showProgress($downloaded_size, $download_size, $cli_size=30) {\n \n if($downloaded_size > $download_size){\n \treturn;\n }\n\n //avoid division by 0\n if($download_size == 0){\n \treturn;\n }\n\n static $start_time;\n\n if(!isset($start_time) || empty($start_time)){\n \t$start_time = time();\n }\n\n $current_time = time();\n\n $percentage = (double) ($downloaded_size / $download_size);\n\n $bar = floor($percentage * $cli_size);\n\n $status_bar_str = \"\\r[\";\n $status_bar_str .= str_repeat(\"=\", $bar);\n\n if($bar < $cli_size){\n $status_bar_str .= \">\";\n $repeat = $cli_size - $bar;\n $status_bar_str .= str_repeat(\" \", $repeat);\n } else {\n $status_bar_str .= \"=\";\n }\n\n $disp = number_format($percentage * 100, 0);\n\n $status_bar_str .=\"] $disp% \".$downloaded_size.\"/\".$download_size;\n\n if($downloaded_size == 0){\n \t$download_rate = 0;\n }\n else{\n \t$download_rate = ($current_time - $start_time) / $downloaded_size;\n\t}\n $left = $download_size - $downloaded_size;\n \n $estimated = round($download_rate * $left, 2);\n $elapsed = $current_time - $start_time;\n\n $status_bar_str .= \" remaining: \".number_format($estimated).\" sec. elapsed: \".number_format($elapsed).\" sec.\";\n\n echo \"$status_bar_str \";\n\n flush();\n\n if($downloaded_size == $download_size) {\n echo \"\\n\";\n }\n}", "function fox_files_stats($atts) {\n extract(lAtts(array(\n 'downloaded' => '0',\n 'category' => '',\n 'format' => 'M',\n 'size' => '0',\n 'children' => '1'\n ), $atts));\n\n if ($size=='1') {\n if ($downloaded ==' 0')\n $things = 'sum(size)';\n else\n $things = 'sum(downloads*size)';\n } else {\n if ($downloaded == '0')\n $things = 'count(*)';\n else\n $things = 'sum(downloads)';\n }\n \n if ($category!='') {\n if ($children == '1') {\n $c = safe_row('lft, rgt', 'txp_category', \"`type`='file' AND name='\".mysql_escape_string($category).\"'\");\n $where = \"category IN (SELECT name FROM txp_category WHERE type='file' AND lft >= \". $c['lft'] . \" AND rgt <= \" . $c['rgt'] . \")\";\n } else {\n $where = 'category=\\''.mysql_escape_string($category).'\\'';\n }\n } else {\n $where = '1';\n }\n\n $stats = safe_row(\"$things as s\", 'txp_file', $where);\n $stats = $stats['s'];\n\n if ($size=='1')\n switch (strtoupper($format)) {\n case 'G':\n $stats /= 1024;\n case 'M':\n $stats /= 1024;\n case 'K':\n $stats /= 1024;\n default:\n $stats = round($stats,2);\n }\n\n if ($format_number == '1') {\n $localeconv = localeconv();\n $dec_point = isset($localeconv['decimal_point']) ? $localeconv['decimal_point'] : '.';\n $thousands_sep = isset($localeconv['thousands_sep']) ? $localeconv['thousands_sep'] : ',';\n $stats = number_format($stats, $size=='1' ? 2 : 0, $dec_point, $thousands_sep);\n }\n \n return $stats;\n}", "public function downloadlength() {\n return $this->info['download_content_length'];\n }", "function tdc_get_count($filenode){\n return $filenode->downloadcount[0]; \n}", "function performanceCheck($url) {\n\n\t//Getting HTML from URL\n\t$ch = curl_init($url);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);\n\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n\tcurl_setopt($ch, CURLOPT_COOKIESESSION, true);\n\t\n\t$content = curl_exec($ch);\n\t\t\n\treturn array(\n\t\tURL => $url, \n\t\tTOTAL_TIME => curl_getinfo($ch, CURLINFO_TOTAL_TIME), // Total transaction time in seconds for last transfer\n\t\t//NAMELOOKUP_TIME => curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME), //Time in seconds until name resolving was complete\n\t\t//PRETRANSFER_TIME => curl_getinfo($ch, CURLINFO_PRETRANSFER_TIME), //Time in seconds from start until just before file transfer begins\n\t\tHTTP_CODE => curl_getinfo($ch, CURLINFO_HTTP_CODE) );\n\n\tcurl_close($ch);\n\n}", "public function testDownloadSuccess()\n {\n $mock_response = new MockHttpResponse(\n 200,\n json_encode([\n 'filename' => 'somefilename.jpg',\n 'size' => '1000',\n 'type' => 'image/jpg',\n 'url' => 'https://cdn.filestack.com/somefilehandle',\n ]),\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $destination = __DIR__ . '/testfiles/my-custom-filename.jpg';\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $result = $client->download($this->test_file_url, $destination);\n\n $this->assertTrue($result);\n\n // test downloading to directory\n $destination = __DIR__ . '/testfiles/';\n $result2 = $client->download($this->test_file_url, $destination);\n\n $this->assertTrue($result2);\n }", "public function getExternalDocumentsStatistic() {}", "function torrent_scrape_url($scrape, $hash) {\t\r\n\tif (function_exists(\"curl_exec\")) {\t\t\r\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt ($ch, CURLOPT_URL, $scrape.'?info_hash='.escape_url($hash));\r\n\t\tcurl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\r\n\t\t$fp = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t} else {\r\n\t\tini_set('default_socket_timeout',10);\r\n\t\t$fp = @file_get_contents($scrape.'?info_hash='.escape_url($hash));\t\r\n\t}\r\n\t$ret = array();\t\r\n\tif ($fp) {\r\n\t\trequire_once(WP_TRADER_ABSPATH . '/includes/BDecode.php');\r\n\t\t$stats = BDecode($fp);\r\n\t\t$binhash = pack(\"H*\", $hash);\r\n\t\t$seeds = $stats['files'][$binhash]['complete'];\r\n\t\t$peers = $stats['files'][$binhash]['incomplete'];\r\n\t\t$downloaded = $stats['files'][$binhash]['downloaded'];\r\n\t\t$ret['seeds'] = $seeds;\r\n\t\t$ret['peers'] = $peers;\r\n\t\t$ret['downloaded'] = $downloaded;\r\n\t}\r\n\tif ($ret['seeds'] === null) {\r\n\t\t$ret['seeds'] = -1;\r\n\t\t$ret['peers'] = -1;\r\n\t\t$ret['downloaded'] = -1;\r\n\t}\t\r\n\treturn $ret;\r\n}", "function aggregateStats($pageid, $firstUrl, $firstHtmlUrl, $statusInfo) {\n\tglobal $gPagesTable, $gRequestsTable, $gUrlsTable;\n\t$link = getDBConnection();\n\n\t// CVSNO - move this error checking to the point before this function is called\n\tif ( ! $firstUrl ) {\n\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): no first URL found.\");\n\t\treturn false;\n\t}\n\tif ( ! $firstHtmlUrl ) {\n\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): no first HTML URL found.\");\n\t\treturn false;\n\t}\n\n\t// initialize variables for counting the page's stats\n\t$bytesTotal = 0;\n\t$reqTotal = 0;\n\t$hSize = array();\n\t$hCount = array();\n\t// This is a list of all mime types AND file formats that we care about.\n\tforeach(array(\"css\", \"image\", \"script\", \"html\", \"font\", \"other\", \"audio\", \"video\", \"text\", \"xml\", \"gif\", \"jpg\", \"png\", \"webp\", \"svg\", \"ico\", \"flash\", \"swf\", \"mp4\", \"flv\", \"f4v\") as $type) {\n\t\t// initialize the hashes\n\t\t$hSize[$type] = 0;\n\t\t$hCount[$type] = 0;\n\t}\n\t$hDomains = array();\n\t$maxageNull = $maxage0 = $maxage1 = $maxage30 = $maxage365 = $maxageMore = 0;\n\t$bytesHtmlDoc = $numRedirects = $numErrors = $numGlibs = $numHttps = $numCompressed = $maxDomainReqs = 0;\n\n\t$result = doQuery(\"select type, format, urlShort, resp_content_type, respSize, expAge, firstHtml, status, resp_content_encoding, req_host from $gRequestsTable where pageid = $pageid;\");\n\twhile ($row = mysqli_fetch_assoc($result)) {\n\t\t$url = $row['urlShort'];\n\t\t$prettyType = $row['type'];\n\t\t$respSize = intval($row['respSize']);\n\t\t$reqTotal++;\n\t\t$bytesTotal += $respSize;\n\t\t$hCount[$prettyType]++;\n\t\t$hSize[$prettyType] += $respSize;\n\n\t\t$format = $row['format'];\n\t\tif ( $format && (\"image\" === $prettyType || \"video\" === $prettyType) ) {\n\t\t\t$hCount[$format]++;\n\t\t\t$hSize[$format] += $respSize;\n\t\t}\n\n\t\t// count unique domains (really hostnames)\n\t\t$aMatches = array();\n\t\tif ( $url && preg_match('/http[s]*:\\/\\/([^\\/]*)/', $url, $aMatches) ) {\n\t\t\t$hostname = $aMatches[1];\n\t\t\tif ( ! array_key_exists($hostname, $hDomains) ) {\n\t\t\t\t$hDomains[$hostname] = 0;\n\t\t\t}\n\t\t\t$hDomains[$hostname]++; // count hostnames\n\t\t}\n\t\telse {\n\t\t\tdprint(\"ERROR($gPagesTable pageid: $pageid): No hostname found in URL: $url\");\n\t\t}\n\n\t\t// count expiration windows\n\t\t$expAge = $row['expAge'];\n\t\t$daySecs = 24*60*60;\n\t\tif ( NULL === $expAge ) {\n\t\t\t$maxageNull++;\n\t\t}\n\t\telse if ( 0 === intval($expAge) ) {\n\t\t\t$maxage0++;\n\t\t}\n\t\telse if ( $expAge <= (1 * $daySecs) ) {\n\t\t\t$maxage1++;\n\t\t}\n\t\telse if ( $expAge <= (30 * $daySecs) ) {\n\t\t\t$maxage30++;\n\t\t}\n\t\telse if ( $expAge <= (365 * $daySecs) ) {\n\t\t\t$maxage365++;\n\t\t}\n\t\telse {\n\t\t\t$maxageMore++;\n\t\t}\n\n\t\tif ( $row['firstHtml'] ) {\n\t\t\t$bytesHtmlDoc = $respSize; // CVSNO - can we get this UNgzipped?!\n\t\t}\n\n\t\t$status = $row['status'];\n\t\tif ( 300 <= $status && $status < 400 && 304 != $status ) {\n\t\t\t$numRedirects++;\n\t\t}\n\t\telse if ( 400 <= $status && $status < 600 ) {\n\t\t\t$numErrors++;\n\t\t}\n\n\t\tif ( 0 === stripos($url, \"https://\") ) {\n\t\t\t$numHttps++;\n\t\t}\n\n\t\tif ( FALSE !== stripos($row['req_host'], \"googleapis.com\") ) {\n\t\t\t$numGlibs++;\n\t\t}\n\n\t\tif ( \"gzip\" == $row['resp_content_encoding'] || \"deflate\" == $row['resp_content_encoding'] ) {\n\t\t\t$numCompressed++;\n\t\t}\n\t}\n\tmysqli_free_result($result);\n\t$numDomains = count(array_keys($hDomains));\n\tforeach (array_keys($hDomains) as $domain) {\n\t\t$maxDomainReqs = max($maxDomainReqs, $hDomains[$domain]);\n\t}\n\n\t$cmd = \"UPDATE $gPagesTable SET reqTotal = $reqTotal, bytesTotal = $bytesTotal\" .\n\t\t\", reqHtml = \" . $hCount['html'] . \", bytesHtml = \" . $hSize['html'] .\n\t\t\", reqJS = \" . $hCount['script'] . \", bytesJS = \" . $hSize['script'] .\n\t\t\", reqCSS = \" . $hCount['css'] . \", bytesCSS = \" . $hSize['css'] .\n\t\t\", reqImg = \" . $hCount['image'] . \", bytesImg = \" . $hSize['image'] .\n\t\t\", reqGif = \" . $hCount['gif'] . \", bytesGif = \" . $hSize['gif'] .\n\t\t\", reqJpg = \" . $hCount['jpg'] . \", bytesJpg = \" . $hSize['jpg'] .\n\t\t\", reqPng = \" . $hCount['png'] . \", bytesPng = \" . $hSize['png'] .\n\t\t\", reqFlash = \" . $hCount['flash'] . \", bytesFlash = \" . $hSize['flash'] .\n\t\t\", reqFont = \" . $hCount['font'] . \", bytesFont = \" . $hSize['font'] .\n\t\t\", reqOther = \" . $hCount['other'] . \", bytesOther = \" . $hSize['other'] .\n\t\t\", reqAudio = \" . $hCount['audio'] . \", bytesAudio = \" . $hSize['audio'] .\n\t\t\", reqVideo = \" . $hCount['video'] . \", bytesVideo = \" . $hSize['video'] .\n\t\t\", reqText = \" . $hCount['text'] . \", bytesText = \" . $hSize['text'] .\n\t\t\", reqXml = \" . $hCount['xml'] . \", bytesXml = \" . $hSize['xml'] .\n\t\t\", reqWebp = \" . $hCount['webp'] . \", bytesWebp = \" . $hSize['webp'] .\n\t\t\", reqSvg = \" . $hCount['svg'] . \", bytesSvg = \" . $hSize['svg'] .\n\t\t\", numDomains = $numDomains\" .\n\t\t\", maxageNull = $maxageNull\" .\n\t\t\", maxage0 = $maxage0\" .\n\t\t\", maxage1 = $maxage1\" .\n\t\t\", maxage30 = $maxage30\" .\n\t\t\", maxage365 = $maxage365\" .\n\t\t\", maxageMore = $maxageMore\" .\n\t\t( $bytesHtmlDoc ? \", bytesHtmlDoc = $bytesHtmlDoc\" : \"\" ) .\n\t\t\", numRedirects = $numRedirects\" .\n\t\t\", numErrors = $numErrors\" .\n\t\t\", numGlibs = $numGlibs\" .\n\t\t\", numHttps = $numHttps\" .\n\t\t\", numCompressed = $numCompressed\" .\n\t\t\", maxDomainReqs = $maxDomainReqs\" .\n\t\t\", wptid = \" . \"'\" . mysqli_real_escape_string($link, $statusInfo['wptid']) . \"'\" . \n\t\t\", wptrun = \" . $statusInfo['medianRun'] . \n\t\t( $statusInfo['rank'] ? \", rank = \" . $statusInfo['rank'] : \"\" ) .\n\t\t\" where pageid = $pageid;\";\n\tdoSimpleCommand($cmd);\n\n\treturn true;\n}", "public function downloadspeed() {\n return $this->info['speed_download'];\n }", "function check_url_exists($url, $test_freq_secs)\n{\n $test1 = $GLOBALS['SITE_DB']->query_select('urls_checked', array('url_check_time', 'url_exists'), array('url' => $url), 'ORDER BY url_check_time DESC', 1);\n\n if ((!isset($test1[0])) || ($test1[0]['url_check_time'] < time() - $test_freq_secs)) {\n $test2 = http_download_file($url, 0, false);\n if (($test2 === null) && (($GLOBALS['HTTP_MESSAGE'] == '401') || ($GLOBALS['HTTP_MESSAGE'] == '403') || ($GLOBALS['HTTP_MESSAGE'] == '405') || ($GLOBALS['HTTP_MESSAGE'] == '416') || ($GLOBALS['HTTP_MESSAGE'] == '500') || ($GLOBALS['HTTP_MESSAGE'] == '503') || ($GLOBALS['HTTP_MESSAGE'] == '520'))) {\n $test2 = http_download_file($url, 1, false); // Try without HEAD, sometimes it's not liked\n }\n $exists = (($test2 === null) && ($GLOBALS['HTTP_MESSAGE'] != 401)) ? 0 : 1;\n\n if (isset($test1[0])) {\n $GLOBALS['SITE_DB']->query_delete('urls_checked', array(\n 'url' => $url,\n ));\n }\n\n $GLOBALS['SITE_DB']->query_insert('urls_checked', array(\n 'url' => $url,\n 'url_exists' => $exists,\n 'url_check_time' => time(),\n ));\n } else {\n $exists = $test1[0]['url_exists'];\n }\n\n return ($exists == 1);\n}", "public function testCheckDownloads()\n\t{\n\t\t$student1 = $this->students('student1');\n\t\t$student2 = $this->students('student2');\n\t\t$student3 = $this->students('student3');\n\n\t\t$badge = $this->badges('badge3');\n\n\t\t$handler = new CounterEventHandler();\n\t\t$this->assertTrue($handler->checkDownloads($student3, array('badge'=>$badge, 'count'=>2)));\n\t\t$this->assertFalse($handler->checkDownloads($student1, array('badge'=>$badge, 'count'=>2)));\n\t\t$this->assertFalse($handler->checkDownloads($student2, array('badge'=>$badge, 'count'=>0)));\n\t}", "public function testDownloadCertificateImage()\n {\n }", "function curl_get_file_size( $url ) {\n // Assume failure.\n $result = -1;\n\n $ch = curl_init( $url );\n\n // Issue a HEAD request and follow any redirects.\n curl_setopt( $ch, CURLOPT_NOBODY, true );\n curl_setopt( $ch, CURLOPT_HEADER, true );\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n //curl_setopt( $ch, CURLOPT_USERAGENT, get_user_agent_string() );\n\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt ($ch, CURLOPT_MAXREDIRS, 5);\n\tcurl_setopt ($ch, CURLOPT_REFERER, false);\n\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, true);\n\tcurl_setopt ($ch, CURLOPT_COOKIE, $cookie_string); \n\tcurl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); \n\tcurl_setopt ($ch, CURLOPT_USERAGENT, $useragent); \n $data = curl_exec( $ch );\n curl_close( $ch );\n\n if( $data ) {\n $content_length = \"unknown\";\n $status = \"unknown\";\n\n if( preg_match( \"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches ) ) {\n $status = (int)$matches[1];\n }\n\n if( preg_match( \"/Content-Length: (\\d+)/\", $data, $matches ) ) {\n $content_length = (int)$matches[1];\n }\n\n // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n if( $status == 200 || ($status > 300 && $status <= 308) ) {\n $result = $content_length;\n }\n }\n\n return $result;\n}", "public function stream_stat() {}", "protected function checkDownloadsPossible() {}", "public function testCompanyManagementBackupsCountGet()\n {\n\n }", "function get_downloads_histogram($guid = 0, $days = 30) {\n\t$start_date = time() - $days * 3600 * 24;\n\tif ($days == 0) {\n\t\t$start_date = 0;\n\t}\n\n\t$downloads = elgg_get_annotations(array(\n\t\t'guid' => $guid,\n\t\t'limit' => 0,\n\t\t'order_by' => 'time_created asc',\n\t\t'annotation_name' => 'download',\n\t\t'annotation_created_time_lower' => $start_date,\n\t));\n\n\t// if queried for all downloads, need to set epoch based on first download\n\t$first_time = $downloads[0]->time_created;\n\t$num_actual_days = (int)(time() - $first_time) / (3600 * 24) + 1;\n\tif ($start_date == 0) {\n\t\t$start_date = $first_time;\n\t\t$days = max($days, $num_actual_days);\n\t}\n\n\t// compute histogram of downloads\n\t$histogram = array_fill(0, $days, 0);\n\tforeach ($downloads as $download) {\n\t\t$day = (int)floor(($download->time_created - $start_date) / (3600 * 24));\n\t\t$histogram[$day]++;\n\t}\n\n\treturn $histogram;\n}", "public function testDatasetReturnsData()\n {\n $size = 100;\n\n $response = $this->get('/api/dataset?size={$size}');\n\n $response->assertStatus(200);\n $response->assertJsonCount($size, \"\");\n }", "function get_file_size($filename) {\n\t$domain = $_SERVER['HTTP_HOST'];\n\t$script = $_SERVER['SCRIPT_NAME'];\n\t$currentfile = basename($script);\n\t$fullurl = \"http://$domain\".str_replace($currentfile, '', $script).$filename;\n\t\n\t// Context for file_get_contents HEAD request\n\t$context = stream_context_create(array('http'=>array('method'=>'HEAD')));\n\t\n\t// file_get_contents HEAD request\n\t$request = file_get_contents($fullurl, false, $context);\n\t\n\t// Go through each response header and search for Content-Length\n\tforeach($http_response_header as $hrh) {\n\t\tif(strpos($hrh, 'Content-Length') !== false) {\n\t\t\t$size = str_replace('Content-Length:', '', $hrh);\n\t\t\t$size = trim($size);\n\t\t}\n\t}\n\treturn $size;\n}", "function getThumbProgress()\n {\n // release the locks, session not needed\n $session = \\cmsSession::getInstance();\n $session->releaseLocks();\n session_write_close();\n \n $key = isset($_GET['key']) ? $_GET['key'] : '';\n $processFile = $session->getTempPath() .'/progress' . $key . '.txt';\n \n $process = 0;\n if (file_exists($processFile)) {\n $process = file_get_contents($processFile);\n if ($process == 100) {\n \\Cx\\Lib\\FileSystem\\FileSystem::delete_file($processFile);\n }\n }\n \n echo $process;\n die;\n }", "public function testStatus(){\n $model = new PersistenceManager();\n $stats = $model->getStatus();\n\n $this->assertEquals(\n intval($stats[0]['total']),\n intval($stats[0]['used'])+intval($stats[0]['not_used'])\n );\n }", "public function test_download_files()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->press('Export Data to CSV with Author and Title')\n ->press('Export Data to XML with Author and Title')\n ->assertPathIs('/');\n });\n }", "public function testReportsSummaryGet()\n {\n }", "function getDownloads($downloads,$lowFlag=false) {\n\t$downloadCount = array(\"10000000000\",\"5000000000\",\"1000000000\",\"500000000\",\"100000000\",\"50000000\",\"25000000\",\"10000000\",\"5000000\",\"2500000\",\"1000000\",\"500000\",\"250000\",\"100000\",\"50000\",\"25000\",\"10000\",\"5000\",\"1000\",\"500\",\"100\");\n\tforeach ($downloadCount as $downloadtmp) {\n\t\tif ($downloads > $downloadtmp) {\n\t\t\treturn \"More than \".number_format($downloadtmp);\n\t\t}\n\t}\n\treturn ($lowFlag) ? $downloads : \"\";\n}", "public function testReportsLinktrackingsExportGet()\n {\n }", "function get_first_n_bytes($url, $nbytes)\n{\n $headers = array(\n \"Range: bytes=0-$nbytes\"\n );\n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_BUFFERSIZE, $nbytes);\n curl_setopt($curl, CURLOPT_NOPROGRESS, false);\n curl_setopt($curl, CURLOPT_PROGRESSFUNCTION, function(\n $DownloadSize, $Downloaded, $UploadSize, $Uploaded\n ){\n // If $Downloaded exceeds $nbytes + change, return non-0\n // to break the connection\n return ($Downloaded > (2 * $nbytes)) ? 1 : 0;\n });\n $data = curl_exec($curl);\n curl_close($curl);\n return $data;\n}", "public function testGetBatchStatistics()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function epfl_stats_media_size_and_count($used_bytes, $quota_bytes, $nb_files)\n{\n /* If we are in CLI mode, it's useless to update in APC because it's the APC for mgmt container and not httpd\n container */\n if(php_sapi_name()=='cli') return;\n\n global $wp;\n\n $adapter = new Prometheus\\Storage\\APC();\n\n $registry = new CollectorRegistry($adapter);\n\n /* Size information */\n $size_gauge = $registry->registerGauge('wp',\n 'epfl_media_size_bytes',\n 'Used (and max) space for medias',\n ['site', 'type']);\n\n $size_gauge->set($used_bytes, [home_url( $wp->request ), \"used\"]);\n $size_gauge->set($quota_bytes, [home_url( $wp->request ), \"quota\"]);\n\n\n /* Media count */\n $count_gauge = $registry->registerGauge('wp',\n 'epfl_media_nb_files',\n 'Media count on website',\n ['site', 'type']);\n\n $count_gauge->set($nb_files, [home_url( $wp->request ), \"used\"]);\n}", "public function GetDownloadInfo() \n { \n $ret = false;\n \n //verifie le type de compte\n $this->ACCOUNT_TYPE = $this->Verify(false);\n \n //Recupere l'id, s'il nest pas bon, renvoie NON PRIS EN CHARGE\n $GetFILEIDRet = $this->GetFILEID($this->Url);\n if ($GetFILEIDRet == false)\n {\n $ret[DOWNLOAD_ERROR] = ERR_NOT_SUPPORT_TYPE;\n }else\n {\n //Créé l'url en fonction du type de compte\n $this->MakeUrl();\n \n /*verifie si le lien est valide, si c'est le cas \n le nom du fichier est récupéré, sinon c'est false \n */\n $LinkInfo = $this->CheckLink($this->ORIGINAL_URL);\n \n //Renvoie que le fichier n'existe pas si le lien est obsolète\n if($LinkInfo == false)\n {\n $ret[DOWNLOAD_ERROR] = ERR_FILE_NO_EXIST;\n }else\n {\n //en fonction du type de compte, lance la fonction correspondante\n if($this->ACCOUNT_TYPE == USER_IS_PREMIUM)\n {\n $ret = $this->DownloadPremium();\n }else\n {\n $ret = $this->DownloadWaiting();\n }\n \n /*Si les fonctions précedente on retourné un tableau avec des informations,\n on y ajoute le nom du fichier aisi que les INFO_NAME (permet de mettre play/pause).\n si aucun info n'a été retourné on renvoie fichier inexistant\n */\n if($ret != false)\n {\n $ret[DOWNLOAD_FILENAME] = $LinkInfo;\n $ret[INFO_NAME] = trim($this->HostInfo[INFO_NAME]);\n }else\n {\n $ret[DOWNLOAD_ERROR] = ERR_FILE_NO_EXIST;\n }\n }\n }\n return $ret; \n }", "public function getDownloadCount()\n\t{\n\t\treturn $this->downloads;\n\t}", "function getProgress() ;", "function curl_get_file_size( $url ) {\n // Assume failure.\n $result = -1;\n $curl = curl_init( $url );\n\n // Issue a HEAD request and follow any redirects.\n curl_setopt( $curl, CURLOPT_NOBODY, true );\n curl_setopt( $curl, CURLOPT_HEADER, true );\n curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $data = curl_exec( $curl );\n curl_close( $curl );\n\n if( $data ) {\n $content_length = \"unknown\";\n $status = \"unknown\";\n\n if( preg_match( \"/^HTTP\\/1\\.[01] (\\d\\d\\d)/\", $data, $matches ) ) {\n $status = (int)$matches[1];\n }\n\n if( preg_match( \"/Content-Length: (\\d+)/\", $data, $matches ) ) {\n $content_length = (int)$matches[1];\n }\n\n // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes\n if( $status == 200 || ($status > 300 && $status <= 308) ) {\n $result = $content_length;\n }\n }\n\n return $result;\n}", "public function testAddLowStockFileByURL()\n {\n }", "function tpc_get_stats() {\n\ttry {\n\t\tglobal $ydb;\n\n\t\t//Process `url` or `shorturl` parameter\n\t\tif(!isset($_REQUEST[\"url\"]) && !isset($_REQUEST[\"shorturl\"])) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 400,\n\t\t\t\t\"message\" => \"error: Missing 'url' or 'shorturl' parameter.\",\n\t\t\t);\t\n\t\t}\n\n\t\tif(isset($_REQUEST[\"url\"])) {\n\t\t\t$keywords = tpc_get_url_keywords($_REQUEST[\"url\"]);\n\t\t} else {\n\t\t\t$pos = strrpos($_REQUEST[\"shorturl\"], \"/\");\n\t\t\t//Accept \"http://sho.rt/abc\"\n\t\t\tif($pos !== false) {\n\t\t\t\t$keywords = array(substr($_REQUEST[\"shorturl\"], $pos + 1));\n\t\t\t//Accept \"abc\"\n\t\t\t} else {\n\t\t\t\t$keywords = array($_REQUEST[\"shorturl\"]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(empty($keywords[0]) || !yourls_is_shorturl($keywords[0])) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 404,\n\t\t\t\t\"message\" => \"error: not found\",\n\t\t\t);\t\n\t\t}\n\t\t\n\t\t//Process `since` and `until` parameters.\n\t\tif(isset($_REQUEST[\"since\"])) {\n\t\t\t$since = intval($_REQUEST[\"since\"]);\n\t\t} else {\n\t\t\t$since = 0; //Default to the Unix Epoch\n\t\t}\n\n\t\tif(isset($_REQUEST[\"until\"])) {\n\t\t\t$until = intval($_REQUEST[\"until\"]);\n\t\t} else {\n\t\t\t$until = time(); //Default to now\n\t\t}\n\n\t\tif($since >= $until) {\n\t\t\treturn array(\n\t\t\t\t\"errorCode\" => 400,\n\t\t\t\t\"message\" => \"error: The 'since' value ($since) must be smaller than the 'until' value ($until).\",\n\t\t\t);\n\t\t}\n\t\t\n\t\t$params = array(\n\t\t\t\"shorturls\" => $keywords,\n\t\t\t\"since\" => date(\"Y-m-d H:i:s\", $since),\n\t\t\t\"until\" => date(\"Y-m-d H:i:s\", $until),\n\t\t);\n\t\n\t $sql = \"SELECT COUNT(*)\n\t FROM \" . YOURLS_DB_TABLE_LOG . \"\n\t WHERE\n\t\t\t\t\tshorturl IN (:shorturls) AND\n\t\t\t\t\tclick_time > :since AND\n\t\t\t\t\tclick_time <= :until\";\n\n\t\t$result = $ydb->fetchValue($sql, $params);\n\n\t\treturn array(\n\t\t\t\"statusCode\" => 200,\n\t\t\t\"message\" => \"success\",\n\t\t\t\"url-stats-period\" => array(\n\t\t\t\t\"clicks\" => $result\n\t\t\t)\n\t\t);\n\t} catch (Exception $e) {\n\t\treturn array(\n\t\t\t\"errorCode\" => 500,\n\t\t\t\"message\" => \"error: \" . $e->getMessage(),\n\t\t);\n\t}\n}", "public function testGetMetaDataSuccess()\n {\n $mock_response = new MockHttpResponse(\n 200,\n '{\"filename\": \"somefilename.jpg\"}'\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $result_json = $client->getMetaData($this->test_file_url);\n $this->assertEquals($result_json['filename'], 'somefilename.jpg');\n }", "function downloadUrl($url)\r\n{\r\n\r\n $ch = curl_init ($url);\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_BINARYTRANSFER,0);\r\n\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);\r\n\r\n\t$rawdata=curl_exec($ch);\r\n\tcurl_close ($ch);\r\n /*$LogHandler->addRecord(\r\n Logger::NOTICE,\r\n \"Finished downloading \".$url,\r\n array('url' => $url)\r\n );\r\n*/\r\n\treturn $rawdata;\r\n}", "public function download() {\t\t}", "function getKb($link) {\r\n if (file_exists($link))\r\n {\r\n $wsize = round (filesize($link)/1024);\r\n }\r\n else\r\n {\r\n $wsize=0;\r\n }\r\n return $wsize;\r\n}", "public function testGetLeftDownloadCount()\n {\n $oOrderFileNew = oxNew('oxOrderFile');\n $oOrderFileNew->oxorderfiles__oxmaxdownloadcount = new oxField(10);\n $oOrderFileNew->oxorderfiles__oxdownloadcount = new oxField(7);\n $oOrderFileNew->save();\n\n $id = $oOrderFileNew->getId();\n\n $oOrderFile = oxNew('oxOrderFile');\n $oOrderFile->load($id);\n\n $this->assertEquals(3, $oOrderFile->getLeftDownloadCount());\n }", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function testGetLowStockFiles()\n {\n }", "public function downloadFile();", "public function isDownloadLimitReached() {\r\n\t\treturn ($limit = $this->get('download_limit')) && $this->get('hits', 0) >= $limit;\r\n\t}", "public function getDetails() {\r\n \r\n $mckey = sprintf(\"%s;details\", $this->mckey); \r\n \r\n if (!$data = $this->Memcached->fetch($mckey)) {\r\n if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {\r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $this->mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $this->filepath);\r\n }\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n $data = array(\r\n \"type\" => ucwords($mime[0]),\r\n \"size\" => $this->filesize,\r\n \"downloads\" => $this->hits,\r\n \"added\" => array(\r\n \"absolute\" => $this->Date->format(\"Y-m-d g:i:s a\"),\r\n \"relative\" => time2str($this->Date->getTimestamp())\r\n ),\r\n \"thumbnail\" => $this->getThumbnail(),\r\n \"video\" => $this->getHTML5Video()\r\n );\r\n \r\n $this->Memcached->save($mckey, $data, strtotime(\"+12 hours\"));\r\n }\r\n \r\n return $data;\r\n }", "public function test110DownloadVoucher()\n {\n $this->markTestSkipped('Mark skip test to find solution');\n }", "private function findResponseParams()\n {\t\t\n \t$this->client->isLazy(); \t\t\n \t$time = time();\n \t$request = $this->client->getMessageFactory()->createRequest($this->url, 'GET');\n \t$request->addHeader('cookie',$this->strCookie);\n \t$request->setTimeout(3000000);\n \t$response = $this->client->getMessageFactory()->createResponse();\n \t$this->client->send($request, $response);\t\t\n \tif($response->getStatus() === 200) {\t\t\t\n \t\t$responseTime = time();\n \t\t$pageLoadTime = $responseTime-$time;\n \t\t$responseLength = strlen($response->getContent());\n \t\t$data = ['fullLoadedTime' => $pageLoadTime,'responseLength' => $responseLength,'progress' => 2];\n \t\t$this->updateLocalFile($data);\t\t\t\n \t\treturn true;\n \t}\n }", "public function getNoOfDownloads()\n {\n return $this->noOfDownloads;\n }", "public function test_percent_storage_used_OK($conn_args) {\n\t\t$this->assertCommand($conn_args, \"-i / -w50 -c75 -m %\", array(\n\t\t), array(\n\t\t\t\"OK: 1/1 OK (/: 44.46% used of 22.79GiB)\",\n\t\t\t\"|'/_used'=10879410176B;0:12236290048;0:18354435072;0;24472580096\",\n\t\t), 0);\n\t}", "function computeProgress($docno, $_ACT_FROM_UM, $_ACT_FROM_READER, $_ACT_FROM_OLDREADER){\n \n $confidence = 0.0;\n $totalhits = 0;\n $coverage = 0.0;\n $clicks = 0;\n $annotations = 0;\n $distinct = 0;\n $npages = 1;\n \n if (isset($_ACT_FROM_UM[$docno])) {\n $totalhits += intval($_ACT_FROM_UM[$docno][\"hits\"]);\n $npages = intval($_ACT_FROM_UM[$docno][\"npages\"]);\n $distinct = 1;\n }\n if (isset($_ACT_FROM_READER[$docno])) {\n $totalhits += $_ACT_FROM_READER[$docno][\"pageloads\"];\n $distinct = $_ACT_FROM_READER[$docno][\"distinctpages\"];\n $npages = $_ACT_FROM_READER[$docno][\"npages\"];\n $clicks = $_ACT_FROM_READER[$docno][\"clicks\"];\n $annotations = $_ACT_FROM_READER[$docno][\"annotations\"];\n \n }\n \n if (isset($_ACT_FROM_OLDREADER[$docno])) {\n $npages = $_ACT_FROM_OLDREADER[$docno][\"npages\"];\n $clicks += $_ACT_FROM_OLDREADER[$docno][\"clicks\"];\n $annotations += $_ACT_FROM_OLDREADER[$docno][\"annotations\"]; \n } \n \n $coverage = 1.0 * $distinct / $npages;//modified by jbarriapineda in 11-28\n \n $loadrate = $totalhits / $npages;\n $actionrate = ($clicks + $annotations) / $npages;\n \n $loadconf = 0.0;\n $actionconf = 0.0;\n \n if ($loadrate > 0) $loadconf = 0.1;\n if ($loadrate > 0.5) $loadconf = 0.25;\n if ($loadrate > 1) $loadconf = 0.5;\n if ($loadrate > 2) $loadconf = 1;\n\n if ($actionrate > 0) $actionconf = 0.1;\n if ($actionrate > 0.5) $actionconf = 0.25;\n if ($actionrate > 1) $actionconf = 0.5;\n if ($actionrate > 2) $actionconf = 1;\n \n $confidence = ($loadconf + $actionconf) / 2;\n if ($coverage>1.0) $coverage = 1.0;\n $coverage=$coverage-0.25;//added by jbarraipineda in 11-28\n if($coverage<0.0) $coverage=0.0;//added by jbarraipineda in 11-28\n return array($coverage,$confidence);\n\n}", "function urlfilesize($url) {\n if (substr($url,0,4)=='http' || substr($url,0,3)=='ftp') {\n // for php 4 users\n if (!function_exists('get_headers')) {\n function get_headers($url, $format=0) {\n $headers = array();\n $url = parse_url($url);\n $host = isset($url['host']) ? $url['host'] : '';\n $port = isset($url['port']) ? $url['port'] : 80;\n $path = (isset($url['path']) ? $url['path'] : '/') . (isset($url['query']) ? '?' . $url['query'] : '');\n $fp = fsockopen($host, $port, $errno, $errstr, 3);\n if ($fp) {\n $hdr = \"GET $path HTTP/1.1\\r\\n\";\n $hdr .= \"Host: $host \\r\\n\";\n $hdr .= \"Connection: Close\\r\\n\\r\\n\";\n fwrite($fp, $hdr);\n while (!feof($fp) && $line = trim(fgets($fp, 1024))) {\n if ($line == \"\\r\\n\") break;\n list($key, $val) = explode(': ', $line, 2);\n if ($format)\n if ($val) $headers[$key] = $val;\n else $headers[] = $key;\n else $headers[] = $line;\n }\n fclose($fp);\n return $headers;\n }\n return false;\n }\n }\n $size = array_change_key_case(get_headers($url, 1),CASE_LOWER);\n $size = $size['content-length'];\n if (is_array($size)) { $size = $size[1]; }\n } else {\n $size = @filesize($url); \n }\n $a = array(\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\");\n\n $pos = 0;\n while ($size >= 1024) {\n $size /= 1024;\n $pos++;\n }\n return round($size,2).\" \".$a[$pos]; \n}", "protected function extractUrls($data){\n\t\tif(isset($data['body']) && isset($data['body']['status']) && $data['body']['status'] == 'available'){\n\t\t\t// fetch source resolution\n\t\t\t$sourceMeasures = array();\n\t\t\t$biggestWidth = 0;\n\t\t\t$biggestHeight = 0;\n\t\t\tforeach($data['body']['download'] as $dl){\n\t\t\t\tif($biggestWidth < $dl['width']) $biggestWidth = $dl['width'];\n\t\t\t\tif($biggestHeight < $dl['height']) $biggestHeight = $dl['height'];\n\t\t\t\t\n\t\t\t\t// check if source is still existent\n\t\t\t\tif(isset($dl['type']) && $dl['type'] == 'source'){\n\t\t\t\t\t$sourceMeasures['width'] = $dl['width'];\n\t\t\t\t\t$sourceMeasures['height'] = $dl['height'];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!(isset($sourceMeasures['width']) && isset($sourceMeasures['height']))){\n\t\t\t\t$sourceMeasures['width'] = $biggestWidth;\n\t\t\t\t$sourceMeasures['height'] = $biggestHeight;\n\t\t\t}\n\t\t\t\n\t\t\t// fetch available resolution\n\t\t\t$availRes = array();\n\t\t\tforeach($data['body']['files'] as $f){\n\t\t\t\tif(isset($f['quality']) && isset($f['width']) && isset($f['height']) && isset($f['link']) && isset($f['link_secure'])){\n\t\t\t\t\tif($f['quality'] == 'sd' && $f['height'] == 360){\n\t\t\t\t\t\t$availRes['mobile'] = $f['link'];\n\t\t\t\t\t\t$availRes['mobile_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'sd' && $f['height'] == 540){\n\t\t\t\t\t\t$availRes['hd'] = $f['link'];\n\t\t\t\t\t\t$availRes['hd_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'hd' && $f['height'] == 720){\n\t\t\t\t\t\t$availRes['hd'] = $f['link'];\n\t\t\t\t\t\t$availRes['hd_secure'] = $f['link_secure'];\n\t\t\t\t\t}else if($f['quality'] == 'hd' && $f['height'] == 1080){\n\t\t\t\t\t\t$availRes['fullhd'] = $f['link'];\n\t\t\t\t\t\t$availRes['fullhd_secure'] = $f['link_secure'];\n\t\t\t\t\t}\n\t\t\t\t}else if(isset($f['quality']) && $f['quality'] == 'hls' && isset($f['link']) && isset($f['link_secure'])){\n\t\t\t\t\t$availRes['hls'] = str_replace('https', 'http', $f['link']);\n\t\t\t\t\t$availRes['hls_secure'] = $f['link_secure'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($sourceMeasures['width']) && isset($sourceMeasures['height'])){\n\t\t\t\t// source file and measurements found\n\t\t\t\t// check for highest resolution\n\t\t\t\tif($sourceMeasures['width'] >= 1920 && $sourceMeasures['height'] >= 1080){\n\t\t\t\t\t// Video is full HD, so Full HD should be availalbe\n\t\t\t\t\tif(isset($availRes['fullhd']) && isset($availRes['hd']) && isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = $availRes['fullhd'];\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = $availRes['fullhd_secure'];\n\t\t\t\t\t\t$this->VimeoHDUrl = $availRes['hd'];\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = $availRes['hd_secure'];\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else if($sourceMeasures['width'] >= 1280 && $sourceMeasures['height'] >= 720){\n\t\t\t\t\t// Video is HD, so at least HD schould be available\n\t\t\t\t\tif(isset($availRes['hd']) && isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = null;\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoHDUrl = $availRes['hd'];\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = $availRes['hd_secure'];\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t// Video is SD, so at least SD schould be available\n\t\t\t\t\tif(isset($availRes['sd'])){\n\t\t\t\t\t\t$this->VimeoFullHDUrl = null;\n\t\t\t\t\t\t$this->VimeoFullHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoHDUrl = null;\n\t\t\t\t\t\t$this->VimeoHDUrlSecure = null;\n\t\t\t\t\t\t$this->VimeoSDUrl = $availRes['sd'];\n\t\t\t\t\t\t$this->VimeoSDUrlSecure = $availRes['sd_secure'];\n\t\t\t\t\t\t$this->VimeoMobileUrl = $availRes['mobile'];\n\t\t\t\t\t\t$this->VimeoMobileUrlSecure = $availRes['mobile_secure'];\n\t\t\t\t\t\t$this->VimeoPicturesURI = $data['body']['pictures']['uri'];\n\t\t\t\t\t\tif(isset($availRes['hls'])){\n\t\t\t\t\t\t\t$this->VimeoHLSUrl = $availRes['hls'];\n\t\t\t\t\t\t\t$this->VimeoHLSUrlSecure = $availRes['hls_secure'];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->VimeoProcessingStatus = 'finished';\n\t\t\t\t\t\t$this->write();\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}else if(isset($data['body']) && isset($data['body']['status']) && ($data['body']['status'] == 'quota_exceeded' || $data['body']['status'] == 'uploading_error' || $data['body']['status'] == 'transcoding_error')){\n\t\t\t$this->VimeoProcessingStatus = 'processingerror';\n\t\t\t$this->write();\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function xtorrent_GetDownloadTime($size = 0, $gmodem = 1, $gisdn = 1, $gdsl = 1, $gslan = 0, $gflan = 0)\r\n{\r\n $aflag = [];\r\n $amtime = [];\r\n $artime = [];\r\n $ahtime = [];\r\n $asout = [];\r\n $aflag = [\r\n $gmodem,\r\n $gisdn,\r\n $gdsl,\r\n $gslan,\r\n $gflan\r\n ];\r\n $amtime = [\r\n $size / 6300 / 60,\r\n $size / 7200 / 60,\r\n $size / 86400 / 60,\r\n $size / 1125000 / 60,\r\n $size / 11250000 / 60\r\n ];\r\n $amname = [\r\n 'Modem(56k)',\r\n 'ISDN(64k)',\r\n 'DSL(768k)',\r\n 'LAN(10M)',\r\n 'LAN(100M)'\r\n ];\r\n for($i = 0;$i < 5;$i++)\r\n { \r\n $artime[$i] = ($amtime[$i] % 60);\r\n } \r\n for($i = 0;$i < 5;$i++)\r\n {\r\n $ahtime[$i] = sprintf(' %2.0f', $amtime[$i] / 60);\r\n } \r\n if ($size <= 0)\r\n {\r\n $dltime = 'N/A';\r\n }\r\n else\r\n {\r\n for($i = 0; $i < 5; $i++)\r\n {\r\n if (!$aflag[$i]) $asout[$i] = '';\r\n else\r\n {\r\n if (($amtime[$i] * 60) < 1)\r\n {\r\n $asout[$i] = sprintf(' : %4.2fs', $amtime[$i] * 60);\r\n }\r\n else\r\n {\r\n if ($amtime[$i] < 1)\r\n {\r\n $asout[$i] = sprintf(' : %2.0fs', round($amtime[$i] * 60));\r\n }\r\n else\r\n {\r\n if (0 == $ahtime[$i])\r\n {\r\n $asout[$i] = sprintf(' : %5.1fmin', $amtime[$i]);\r\n }\r\n else\r\n {\r\n $asout[$i] = sprintf(' : %2.0fh%2.0fmin', $ahtime[$i], $artime[$i]);\r\n }\r\n } \r\n } \r\n $asout[$i] = '<b>' . $amname[$i] . '</b>' . $asout[$i];\r\n if ($i < 4)\r\n {\r\n $asout[$i] = $asout[$i] . ' | ';\r\n }\r\n } \r\n } \r\n $dltime = '';\r\n for($i = 0; $i < 5; $i++)\r\n {\r\n $dltime = $dltime . $asout[$i];\r\n } \r\n } \r\n return $dltime;\r\n}", "public function download_statistics_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $input = file_get_contents('php://input', 'r');\n $dbutil = new DBUtil();\n $json = json_decode($input);\n if(is_null($json))\n {\n $array = array();\n $array[$this->success] = false;\n $array[$this->error_type] = \"input\";\n $array[$this->error_message] = \"Invalid input\";\n $this->response($array);\n }\n $array = $dbutil->insertDownloadStatistics($json);\n $this->response($array);\n }", "function get_all_download_count() {\n\t// the cached count is maintained in PluginProject::updateDownloadCount\n\treturn (int)elgg_get_plugin_setting('site_plugins_downloads', 'community_plugins');\n}", "public function timeTransfer($verbose = false)\n {\n try\n {\n $ch = curl_init($this->getUrl());\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_TIMEOUT, 15);\n \n $start = microtime(true);\n $doc = curl_exec($ch);\n $stop = microtime(true);\n curl_close($ch);\n\n if($verbose){ echo \"Bytes: \" . strlen($doc) . \"\\n\"; }\n if(strlen($doc) < 1){ return null; }\n\n return $stop - $start;\n }\n catch(Exception $ex)\n {\n echo $ex->getMessage() . \"\\n\";\n return null;\n }\n }", "public function testGetUserrecordingsSummary()\n {\n }", "public function test18EnableLinkVoucherDownload()\n {\n $ssoData = $this->getSSOData();\n\n $data = [\n 'booking_id' => 'VELTRA-3N0RHQ74',\n 'activity_id' => 'VELTRA-100010613',\n 'plan_id' => 'VELTRA-108951-0',\n ];\n \n $this->createBookingByDateAndParams(date('Y-m-d'), $data);\n\n //$this->mockApi($data);\n\n $voucherUrlMockApi = \"https://storage.googleapis.com/dev-voucher.vds-connect.com/vouchers/1598181/aa17921456fcaf3c.pdf\";\n $link = '<a href=\"'.$voucherUrlMockApi.'\"';\n\n $params = [\n 'page' => 1,\n 'per_page' => 10,\n 'type' => 'current'\n ];\n\n $response = $this->ajax($this->getUrlByParams($params))->json();\n\n $this->assertTrue(is_array($response));\n $this->assertArrayHasKey('current_list', $response);\n\n $list = $response['current_list'];\n $totalVoucherUrl = substr_count($list, $link);\n\n $this->assertEquals(1, $totalVoucherUrl);\n }", "function cc_progress_total() {\n $campaign_total = file_get_contents(__DIR__ . '/../../../includes/total.txt');\n\n print $campaign_total;\n}", "function count_access($base_path, $name) {\r\n $filename = $base_path . DIRECTORY_SEPARATOR . \"stats.json\";\r\n $stats = json_decode(file_get_contents($filename), true);\r\n $stats[$name][mktime(0, 0, 0)] += 1;\r\n file_put_contents($filename, json_encode($stats, JSON_PRETTY_PRINT));\r\n}", "function fiftyone_degrees_get_bandwidth_data() {\n $bandwidth = NULL;\n $result = NULL;\n\n // Check that session and the bandwidth cookie are available.\n if (isset($_SESSION) && isset($_COOKIE['51D_Bandwidth'])) {\n $values = explode('|', $_COOKIE['51D_Bandwidth']);\n\n if (count($values) == 5) {\n $stats = fiftyone_degrees_get_bandwidth_stats();\n if ($stats != NULL) {\n $last_load_time = $stats['LastLoadTime'];\n }\n\n $load_start_time = floatval($values[1]);\n $current_time = floatval($values[2]);\n $load_complete_time = floatval($values[3]);\n $page_length = floatval($values[4]);\n\n $response_time = $load_complete_time - $load_start_time;\n if ($response_time == 0) {\n $page_bandwidth = PHP_INT_MAX;\n }\n else {\n $page_bandwidth = $page_length / $response_time;\n }\n\n if ($stats != NULL) {\n $stats['LastResponseTime'] = $response_time;\n $stats['last_completion_time'] = $load_complete_time - $last_load_time;\n if (isset($stats['average_completion_time']))\n $stats['average_completion_time']\n = fiftyone_degrees_get_rolling_average(\n $stats['average_completion_time'],\n $response_time,\n $stats['Requests']);\n else\n $stats['average_completion_time'] = $stats['last_completion_time'];\n\n $stats['AverageResponseTime']\n = fiftyone_degrees_get_rolling_average(\n $stats['AverageResponseTime'],\n $response_time,\n $stats['Requests']);\n\n $page_bandwidth = fiftyone_degrees_get_rolling_average(\n $stats['AverageBandwidth'],\n $response_time,\n $stats['Requests']);\n\n $stats['AverageBandwidth'] = $page_bandwidth;\n $stats['LastLoadTime'] = $current_time;\n $stats['Requests']++;\n }\n else {\n $stats = array(\n 'LastResponseTime' => $response_time,\n 'AverageResponseTime' => $response_time,\n 'AverageBandwidth' => $page_bandwidth,\n 'LastLoadTime' => $current_time,\n 'Requests' => 1,\n );\n }\n $stats['page_length'] = $page_length;\n fiftyone_degrees_set_bandwidth_stats($stats);\n\n if ($stats['Requests'] >= 3)\n $result = $stats;\n }\n }\n\n setcookie('51D_Bandwidth', microtime(TRUE));\n\n return $result;\n}", "public function testGetBatchStatisticsCount()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function testReportsEmailcreditsHistoryGet()\n {\n }", "function download_url($url,$fichier_destination)\n{\n\tglobal $conf;\n\t\n//Pause\n\t$pause = 5;//En seconde\n\t\n//log file\n\t$fp_ok = fopen($conf['log_file_recuperation_ok'],\"a\");\n\t$fp_ko = fopen($conf['log_file_recuperation_ko'],\"a\");\n\t$fp_0_octet = fopen($conf['log_file_recuperation_0_octet'],\"a\");\t\t\t\t\t\n\t\n//Media Recovery\n\t$status = \"\";\n\tif(!copy($url,$fichier_destination))\n\t{\n\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 1/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\tsleep($pause);\n\t\tif(!copy($url,$fichier_destination))\n\t\t{\n\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 2/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\tsleep($pause);\n\t\t\tif(!copy($url,$fichier_destination))\n\t\t\t{\n\t\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 3/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\t\tsleep($pause);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t\t$status = \"ok\";\t\t\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t$status = \"ok\";\t\t\n\t\t}\t\t\t\t\t\t\n\t}\n\telse\n\t{\n\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t$status = \"ok\";\t\t\n\t}\t\n\n//Closing Log Files\n\tfclose($fp_ok);\n\tfclose($fp_ko);\n\tfclose($fp_0_octet);\n\t\n\tif($status==\"\")\n\t\t$status=\"ko\";\n\t\t\t\t\n\treturn $status;\t\t\t\t\n}", "function tdc_get_fileinfo($file_name){\n $link = TDC_PLUGIN_URL.\"download.php?file_name=\".$file_name;\n $label = $file_name;\n\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n $count = tdc_get_count($filenode);\n $size = tdc_get_filesize($filenode);\n\n return array($link, $label, $size, $count);\n}", "public function send_cached_file($video)\n {\n $id=$video[\"id\"];\n\n //\n // Open cache file.\n //\n bench(\"start\");\n if (($fp = fopen($this->cache_filename, 'rb')) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot open cache file: [{$this->cache_filename}]\");\n return FALSE;\n }\n // Log it.\n $this->log(1,__FUNCTION__,\"Cache file opened for reading\");\n // Insert visit into db.\n $this->add_visit($id,filesize($this->cache_filename));\n $this->file_access_time=bench();\n \n //\n // Read headers using fgets\n //\n $hs=unserialize($video[\"reply_headers\"]);\n/*\n $hs = array();\n while (!feof($fp)) {\n if (($ln = fgets($fp)) === FALSE)\n $this->logdie(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n else if (($ln = rtrim($ln)) == '')\n break;\n else if (!preg_match('/^([^:]+): *(.*)$/', $ln, $mo))\n $this->logdie(2,__FUNCTION__,\"Invalid cached header in [{$this->cache_filename}]: [{$ln}]\");\n else\n $hs[$mo[1]] = $mo[2];\n }\n*/\n // Range request\n if (isset($this->client_request_headers['Range'])) {\n $range = $this->client_request_headers['Range'];\n if (!preg_match('/bytes[=\\s]+([0-9]+)/', $range, $mo))\n $this->log(2,__FUNCTION__,\"Unsupported Range header value: [{$range}]\");\n else {\n $firstbyte = $mo[1];\n $size = $hs['Content-Length'];\n $lastbyte = $size - $firstbyte - 1;\n $hs['Content-Range'] = \"bytes $firstbyte-$lastbyte/$size\";\n $hs['Content-Length'] -= $firstbyte;\n header('HTTP/1.0 206 Partial Content');\n if (fseek($fp, $firstbyte, SEEK_CUR))\n $this->log(2,__FUNCTION__,\"Cannot seek to position $firstbyte: [{$this->cache_filename}]\");\n }\n } // range\n // Set headers\n foreach ($hs as $n => $v) {\n header(\"$n: $v\");\n $this->log(0,__FUNCTION__,\"Cached header > client: [$n: $v]\");\n }\n $this->send_dynamic_headers_to_client();\n\n //\n // Send content.\n //\n // 'fpassthru($fp)' seems to attempt to mmap the file, and hits the PHP memory limit.\n // As a workaround, use a 'feof / fread / echo' loop.\n //\n\n $transferred=0;$tcount=0;\n bench(\"start\");\n while (!feof($fp)) {\n if (($data = fread($fp, $this->chunksize)) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot read cache file: [{$this->cache_filename}]\");\n fclose($fp);\n return FALSE;\n } else {\n $transferred+=strlen($data);$tcount++;\n if ($tcount==1) //first packet\n if (substr($data,0,4)==chr(0x12).chr(00).chr(03).chr(0x4b)) //header missing, try to fix it\n $data=\"FLV\".chr(0x01).chr(0x05).chr(00).chr(00).chr(00).chr(0x09).chr(00).chr(00).chr(00).chr(00).$data;\n echo $data;\n }\n }\n fclose($fp);\n $transfer_time=bench();\n if ($transfer_time<1) $transfer_time=1;\n $bytes_per_sec=ROUND($transferred/ROUND($transfer_time/1000));\n $this->troughput_local=$bytes_per_sec;\n $this->log(1,__FUNCTION__,\"Served request {$this->cache_request} from cache, {$transferred} bytes transferred\");\n return true;\n }", "public function testGetStreamsSummary()\n {\n $kraken = new Kraken(self::$tokenProvider);\n\n $streamStats = $kraken->streams->summary();\n $this->assertNotNull($streamStats);\n $this->assertObjectHasAttribute('channels', $streamStats);\n $this->assertObjectHasAttribute('viewers', $streamStats);\n\n $this->markTestIncomplete(\"Stream summary for games doesn't work anymore on twitch, but still documented.\");\n\n // Using Fortnite as there always should be someone streaming that game\n $gameStreamStats = $kraken->streams->summary('Fortnite');\n $this->assertNotNull($gameStreamStats);\n $this->assertNotEquals(false, $gameStreamStats);\n $this->assertNotEquals($streamStats->channels, $gameStreamStats->channels);\n $this->assertNotEquals($streamStats->viewers, $gameStreamStats->viewers);\n }", "public function testRetrieveChunkedHttpResponse()\n {\n $client = new HttpClient();\n $response = $client->send(\n HttpRequestMethod::GET,\n 'https://postman-echo.com/stream/5'\n );\n\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertEquals('OK', $response->getReasonPhrase());\n $this->assertNotEmpty($response->getBody());\n $this->assertNotEmpty($response->getHeaders());\n }", "public function testVerifiedDownload(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n $updater = $this->getSystemInTest($fixturesSet);\n\n $testFilePath = static::getFixturesRealPath($fixturesSet, 'tufrepo/targets/testtarget.txt', false);\n $testFileContents = file_get_contents($testFilePath);\n $this->testRepo->repoFilesContents['testtarget.txt'] = $testFileContents;\n $this->assertSame($testFileContents, $updater->download('testtarget.txt')->wait()->getContents());\n\n // If the file fetcher returns a file stream, the updater should NOT try\n // to read the contents of the stream into memory.\n $stream = $this->prophesize('\\Psr\\Http\\Message\\StreamInterface');\n $stream->getMetadata('uri')->willReturn($testFilePath);\n $stream->getContents()->shouldNotBeCalled();\n $stream->rewind()->shouldNotBeCalled();\n $stream->getSize()->willReturn(strlen($testFileContents));\n $this->testRepo->repoFilesContents['testtarget.txt'] = new FulfilledPromise($stream->reveal());\n $updater->download('testtarget.txt')->wait();\n\n // If the target isn't known, we should get a rejected promise.\n $promise = $updater->download('void.txt');\n $this->assertInstanceOf(RejectedPromise::class, $promise);\n\n $stream = Utils::streamFor('invalid data');\n $this->testRepo->repoFilesContents['testtarget.txt'] = new FulfilledPromise($stream);\n try {\n $updater->download('testtarget.txt')->wait();\n $this->fail('Expected InvalidHashException to be thrown, but it was not.');\n } catch (InvalidHashException $e) {\n $this->assertSame(\"Invalid sha256 hash for testtarget.txt\", $e->getMessage());\n $this->assertSame($stream, $e->getStream());\n }\n\n // If the stream is longer than expected, we should get an exception,\n // whether or not the stream's length is known.\n $stream = $stream = $this->prophesize('\\Psr\\Http\\Message\\StreamInterface');\n $stream->getSize()->willReturn(1024);\n $this->testRepo->repoFilesContents['testtarget.txt'] = new FulfilledPromise($stream->reveal());\n try {\n $updater->download('testtarget.txt')->wait();\n $this->fail('Expected DownloadSizeException to be thrown, but it was not.');\n } catch (DownloadSizeException $e) {\n $this->assertSame(\"testtarget.txt exceeded 24 bytes\", $e->getMessage());\n }\n\n $stream = $stream = $this->prophesize('\\Psr\\Http\\Message\\StreamInterface');\n $stream->getSize()->willReturn(null);\n $stream->rewind()->shouldBeCalledOnce();\n $stream->read(24)->willReturn('A nice, long string that is certainly longer than 24 bytes.');\n $stream->eof()->willReturn(false);\n $this->testRepo->repoFilesContents['testtarget.txt'] = new FulfilledPromise($stream->reveal());\n try {\n $updater->download('testtarget.txt')->wait();\n $this->fail('Expected DownloadSizeException to be thrown, but it was not.');\n } catch (DownloadSizeException $e) {\n $this->assertSame(\"testtarget.txt exceeded 24 bytes\", $e->getMessage());\n }\n }", "function epfl_stats_webservice_call_duration($url, $duration, $in_local_cache=false)\n{\n /* If we are in CLI mode, it's useless to update in APC because it's the APC for mgmt container and not httpd\n container */\n if(php_sapi_name()=='cli') return;\n\n global $wp;\n\n $url_details = parse_url($url);\n\n /* Building target host name with scheme */\n $target_host = $url_details['scheme'].\"://\".$url_details['host'];\n if(array_key_exists('port', $url_details) && $url_details['port'] != \"\") $target_host .= \":\".$url_details['port'];\n\n /* Generating date/time in correct format: yyyy-MM-dd'T'HH:mm:ss.SSSZZ (ex: 2019-03-27T12:46:14.078Z ) */\n $log_array = array(\"@timegenerated\" => date(\"Y-m-d\\TH:i:s.v\\Z\"),\n \"priority\" => \"INFO\",\n \"verb\" => \"GET\",\n \"code\" => \"200\",\n \"localcache\" => ($in_local_cache) ? \"hit\" : \"miss\",\n \"src\" => home_url( $wp->request ),\n \"targethost\" => $target_host,\n \"targetpath\" => $url_details['path'],\n \"targetquery\" => (array_key_exists('query', $url_details)) ? $url_details['query'] : \"\",\n \"responsetime\" => ($in_local_cache) ? 0 : floor($duration*1000));\n\n $log_file = '/call_logs/ws_call_log.'.gethostname().'.log';\n /* We write in file only if we can open it */\n if(($h = fopen($log_file, 'a'))!==false)\n {\n fwrite($h, json_encode($log_array).\"\\n\");\n fclose($h);\n }\n\n}", "function test(){\n\t\t// See http://www.atk14.net/api/en/file_uploads/create_new/\n\n\t\t$adf = new ApiDataFetcher(\"http://www.atk14.net/api/\",array(\n\t\t\t\"logger\" => new Logger()\n\t\t));\n\t\t$data = $adf->postFile(\"file_uploads/create_new\",\"sandokan.jpg\");\n\n\t\t$this->assertEquals(201,$adf->getStatusCode());\n\t\t$this->assertEquals(\"POST\",$adf->getMethod());\n\t\t$this->assertEquals(\"http://www.atk14.net/api/en/file_uploads/create_new/?format=json\",$adf->getUrl());\n\t\t$this->assertEquals(\"sandokan.jpg\",$data[\"filename\"]);\n\t\t$this->assertEquals(\"image/jpeg\",$data[\"mime_type\"]);\n\t\t$this->assertEquals(\"d5d4599e3586064e0524d18e8ee8bce5\",$data[\"md5sum\"]);\n\t}", "function tdc_do_download($file_name){\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n\n if($filenode != null){\n $file_path = TDC_DOC_ROOT . tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n if(tdc_send_file($file_path, $file_name)){\n tdc_update_count($database, $filenode, TDC_DATABASE_FILE);\n }\n }\n}", "public function testGetLeftDownloadCountNegative()\n {\n $oOrderFileNew = oxNew('oxOrderFile');\n $oOrderFileNew->oxorderfiles__oxmaxdownloadcount = new oxField(7);\n $oOrderFileNew->oxorderfiles__oxdownloadcount = new oxField(10);\n $oOrderFileNew->save();\n\n $id = $oOrderFileNew->getId();\n\n $oOrderFile = oxNew('oxOrderFile');\n $oOrderFile->load($id);\n\n $this->assertEquals(0, $oOrderFile->getLeftDownloadCount());\n }", "function retrieve_client_statistics(){\n\t\t\n\t}", "function countUsage_FcFileBtn_DownloadLinks(&$rows)\n\t{\n\t\tif ( !count($rows) ) return;\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$file_id_arr[] = $row->id;\n\t\t}\n\t\t$query\t= 'SELECT a.id as file_id, COUNT(a.id) as count'\n\t\t\t\t. ' FROM #__flexicontent_files AS a'\n\t\t\t\t. ' JOIN #__flexicontent_file_usage AS u ON u.file_id = a.id'\n\t\t\t\t. ' WHERE a.id IN (' . implode(',', $file_id_arr) . ')'\n\t\t\t\t. ' GROUP BY a.id'\n\t\t\t\t;\n\t\t$assigned_data = $this->_db->setQuery($query)->loadObjectList('file_id');\n\n\t\tforeach ($rows as $row)\n\t\t{\n\t\t\t$row->total_usage = isset($row->total_usage) ? $row->total_usage : 0;\n\t\t\t$download_links_count = isset($assigned_data[$row->id]) ? (int) $assigned_data[$row->id]->count : 0;\n\t\t\t$row->total_usage += $download_links_count;\n\t\t}\n\t}", "public function index()\n {\n // case 1\n $data = array (\n 'name' => 'download (1).jpg',\n 'fileId' => 'o_1b3p9v0unjfn18771n8m100k1d68',\n 'saveto' => 'album',\n 'file' => array (\n 'name' => 'download (1).jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => 'C:\\xampp\\tmp\\phpFC70.tmp',\n 'error' => 0,\n 'size' => 9514\n ),\n );\n $this->post($this->testUrl, $data);\n $this->assertResponseCode(200);\n\n // case 2\n $data = array (\n 'name' => 'download (1).jpg',\n 'fileId' => 'o_1b3p9v0unjfn18771n8m100k1d68',\n 'saveto' => 'mb',\n 'file' => array (\n 'name' => 'download (1).jpg',\n 'type' => 'image/jpeg',\n 'tmp_name' => 'C:\\xampp\\tmp\\phpFC70.tmp',\n 'error' => 0,\n 'size' => 9514\n ),\n );\n $this->post($this->testUrl, $data);\n $this->assertResponseCode(200);\n }", "public function testDownloadDocument() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $this->assertEquals($this->doc1, $obj->downloadDocument($this->doc1));\n\n $res = $obj->downloadDocument($this->dir1);\n $this->assertNotNull($res->getId());\n $this->assertEquals(\"zip\", $res->getExtension());\n $this->assertEquals(\"application/zip\", $res->getMimeType());\n $this->assertContains(\"phpunit-\", $res->getName());\n $this->assertEquals(Document::TYPE_DOCUMENT, $res->getType());\n }", "function driver_stats($option = array()) {\n $res = array(\n \"info\" => \"\",\n \"size\" => \"\",\n \"data\" => \"\",\n );\n\n $path = $this->getPath();\n $dir = @opendir($path);\n if(!$dir) {\n throw new Exception(\"Can't read PATH:\".$path,94);\n }\n\n $total = 0;\n $removed = 0;\n while($file=readdir($dir)) {\n if($file!=\".\" && $file!=\"..\" && is_dir($path.DIRECTORY_SEPARATOR.$file)) {\n // read sub dir\n $subdir = @opendir($path.DIRECTORY_SEPARATOR.$file);\n if(!$subdir) {\n throw new Exception(\"Can't read path:\".$path.DIRECTORY_SEPARATOR.$file,93);\n }\n\n while($f = readdir($subdir)) {\n if($f!=\".\" && $f!=\"..\") {\n $file_path = $path.DIRECTORY_SEPARATOR.$file.DIRECTORY_SEPARATOR.$f;\n $size = filesize($file_path);\n $object = $this->decode($this->readfile($file_path));\n if($this->isExpired($object)&&file_exists($file_path)) {\n @unlink($file_path);\n clearstatcache(TRUE, $file_path);\n $removed = $removed + $size;\n }\n $total = $total + $size;\n }\n } // end read subdir\n } // end if\n } // end while\n\n $res['size'] = $total - $removed;\n $res['info'] = array(\n \"Total\" => $total,\n \"Removed\" => $removed,\n \"Current\" => $res['size'],\n );\n return $res;\n }", "function getDownloadURLS($page_content){\n\t//var_dump($page_content);\n\tif(preg_match(\"/ytplayer\\.config\\s*=\\s*\\\\{(.*?)\\\\};/s\", $page_content, $match)){\n\t\t$unformatted = $match[1];\n\t\t$unformatted = str_replace(\"\\u0026\", '&', $unformatted);\n\t\t\n\t\tif(preg_match('/\"fmt_url_map\":\\s*\"(.*?)\"/s', $unformatted, $match)){\n\t\t\t//$type = \"fmt_url_map\";\n\t\t\t$urls_map = $match[1];\n\t\t}\n\t\telse if(preg_match('/\"fmt_stream_map\":\\s*\"(.*?)\"/s', $unformatted, $match)){\n\t\t\t//$type = \"fmt_stream_map\";\n\t\t\t$url_maps = $match[1];\n\t\t}\n\t\telse if(preg_match('/\"url_encoded_fmt_stream_map\":\\s*\"(.*?)\"/s', $unformatted, $match)){\n\t\t\t//$type = \"url_encoded_fmt_stream_map\";\n\t\t\t$url_maps = $match[1];\n \t\t}\n\n \t\tif(preg_match('/\"adaptive_fmts\":\\s*\"(.*?)\"/s', $unformatted, $match)){\n \t\t\t$url_maps2 = $match[1];\n \t\t}\n\n \t\tif(!isset($url_maps)){\n \t\t\tif(stripos($page_content, \"This video has been age-restricted\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: the video has been age-restricted and currently unsupported\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"large volume of requests\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: large volume of requests, please visit youtube to solve the captcha\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"is not available\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: the video is not available0\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"Content Warning\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: content warning\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"removed by the user\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: the video was removed by the user\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"copyright claim\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: copyright claim\", true);\n \t\t\t}\n \t\t\telse if(stripos($page_content, \"in your country\") !== false){\n \t\t\t\t_log(\"getDownloadURLS: the video is not available in your country\", true);\n \t\t\t}\n \t\t\telse{\n \t\t\t\t_log(\"getDownloadURLS: no links are found for this video\", true);\n \t\t\t}\n \t\t}\n\n \t\t$url_maps .= \",\".$url_maps2;\n\n \t\treturn parseURLMAP($url_maps);\n\t}\n\n\t_log(\"getDownloadURLS: no links are found for this video\", true);\n\n\treturn false;\n}", "function syncData(array $needtype = ['movie', 'documovie']) {\n @mkdir(OUTDIR . DIRECTORY_SEPARATOR . ACTION, 0777, true);\n\n $c = new client(ACCESS_TOKEN);\n $bookmarks = $c->url('/v1/bookmarks');\n if (!isset($bookmarks->items)) {\n return;\n }\n\n #$nn = 0;\n foreach ($bookmarks->items as $b) {\n $end = false;\n $items = [];\n for ($i = 1; $i < PHP_INT_MAX; $i++) {\n usleep(500000);\n #for ($i = 1; $i < 2; $i++) {\n $itemsRaw = $c->url('v1/bookmarks/' . $b->id . '?page=' . $i);\n if ($itemsRaw) {\n $items = array_merge($items, $itemsRaw->items);\n if ($itemsRaw->pagination->current == $itemsRaw->pagination->total) {\n break;\n }\n } else {\n echo \"Failed ... continuing \\n\";\n continue;\n }\n }\n $data = [];\n $sdata = [];\n $xid = 0;\n foreach ($items as $i) {\n $xml = null;\n if (in_array($i->type, $needtype) && ($i->type === 'movie' || $i->type === 'documovie')) {\n $movie = $c->url('v1/items/' . $i->id);\n if (!$movie) {\n echo \"Failed... continuing \\n\";\n continue;\n }\n $itemData = $movie->item;\n\n $src = null;\n $quality = null;\n $poster = (isset($itemData->posters->big)) ? $itemData->posters->big : $itemData->posters->small;\n\n foreach ($itemData->videos as $v) {\n foreach ($v->files as $f) {\n if ($f->url->http && (in_array($f->quality, explode(',', QUALITY)))) {\n $src = normalizeKinoUrl($f->url->http);\n $quality = $f->quality;\n break 2;\n }\n }\n }\n\n if (is_string($src)) {\n #$id, string $src, string $filename, string $description\n $filename = str_replace(['/', ':'. '\\''],\n ['', '', ''],\n $itemData->title . '.' . $itemData->year . '.' . $quality . '.' . $i->id);\n\n $filename = preg_replace(\"/[^[:alnum:][:space:].!]/u\", '', $filename);\n $filename = trim(preg_replace(\"/\\s{2,}/\", ' ', $filename));\n $filename = mb_convert_encoding(trim($filename), 'UTF-8');\n\n echo 'Processing ' . $filename . \"\\n\";\n\n $xid++;\n #$data[] = client::itemToXml($xid, $src, $filename . '.mp4', $itemData->plot, '\\\\' . ACTION . '\\\\');\n $data[] = client::itemToXml($xid, $src, $filename . '.mp4', $itemData->plot);\n $nfo = client::itemToNFO($itemData, $filename . '.jpg');\n\n $thumb = OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $filename . '.jpg';\n if (!is_readable($thumb) && $poster) {\n $jpgfile = OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $filename . '.jpg';\n $jpgfile = \\Normalizer::normalize($jpgfile, Normalizer::FORM_C);\n file_put_contents($jpgfile,\n file_get_contents($poster));\n }\n file_put_contents(OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $filename . '.nfo',\n mb_convert_encoding($nfo, 'UTF-8'));\n } else {\n echo \"NO SRC found for \" . $itemData->title . ' [' . $i->id . '] ' . json_encode($itemData, JSON_UNESCAPED_UNICODE) . \"\\n\";\n }\n\n } elseif (in_array($i->type, $needtype) && $i->type === 'serial') {\n #if ($nn > 1) {\n # break;\n #}\n #$nn++;\n $serie = $c->url('v1/items/' . $i->id);\n $serieData = $serie->item;\n $seriename = str_replace(['/', ':'. '\\''],\n ['', '', ''],\n $serieData->title . '.' . $serieData->year . '.' . $i->id);\n\n $seriename = preg_replace(\"/[^[:alnum:][:space:].!]/u\", '', $seriename);\n $seriename = trim(preg_replace(\"/\\s{2,}/\", ' ', $seriename));\n $seriename = mb_convert_encoding(trim($seriename), 'UTF-8');\n\n $serieDir = $seriename;\n\n $seriePath = OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $serieDir;\n @mkdir($seriePath, 0777, true);\n\n echo 'Processing ' . $seriename . \"\\n\";\n foreach ($serieData->seasons as $season) {\n foreach ($season->episodes as $episode) {\n\n $src = null;\n $quality = null;\n $poster = $episode->thumbnail;\n\n foreach ($episode->files as $f) {\n if ($f->url->http && (in_array($f->quality, explode(',', QUALITY)))) {\n $src = normalizeKinoUrl($f->url->http);\n $quality = $f->quality;\n break;\n }\n }\n if (!$src) {\n echo 'Failed to find SRC for ' . $seriename . ' episode ' . $episode->title;\n continue;\n }\n\n #$id, string $src, string $filename, string $description\n $filename = str_replace(['/', ':'. '\\''],\n ['', '', ''],\n $episode->title . '.' . $serieData->year . '.' . $quality . '.' . $i->id . '.' . $episode->id);\n\n $filename = preg_replace(\"/[^[:alnum:][:space:].!]/u\", '', $filename);\n $filename = trim(preg_replace(\"/\\s{2,}/\", ' ', $filename));\n\n $filePrefix = 'S' . str_pad((string) $season->number, 3, '0', STR_PAD_LEFT) .\n 'E' . str_pad((string) $episode->number, 3, '0', STR_PAD_LEFT);\n $filename = $filePrefix . ($filename ? (' ' . $filename) : '');\n echo 'Processing ' . $filename . \"\\n\";\n\n $filename = mb_convert_encoding(trim($filename), 'UTF-8');\n\n $xid++;\n #$sdata[] = client::itemToXml($xid, $src, $filename . '.mp4', $serieData->plot, ACTION . '\\\\' . $serieDir . '\\\\');\n $sdata[] = client::itemToXml($xid, $src, $filename . '.mp4', $serieData->plot);\n\n $thumb = $seriePath . DIRECTORY_SEPARATOR . $filename . '.jpg';\n $posterPath = $filename . '.jpg';\n if (!is_readable($thumb) && $poster) {\n $posterData = @file_get_contents($poster);\n if ($posterData) {\n file_put_contents($thumb, $posterData);\n } else {\n $thumb = null;\n $posterPath = null;\n }\n }\n\n $nfo = client::itemToNFO($serieData, $posterPath, ' ' . $filePrefix . ' ' . $episode->title);\n file_put_contents($seriePath . DIRECTORY_SEPARATOR . $filename . '.nfo', mb_convert_encoding($nfo, 'UTF-8'));\n }\n }\n } else {\n echo \"Skipping \" . $i->type . ' ' . $i->title . ' [' . $i->id . '] ' . \"\\n\";\n }\n }\n\n /**\n * Save as Download master joblist\n */\n if (count($data)) {\n $xml = client::itemsXml(implode(\"\\n\", $data));\n file_put_contents(OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $b->id . '-' . ACTION . '.xml',\n mb_convert_encoding($xml, 'UTF-8'));\n }\n\n if (count($sdata)) {\n $xml = client::itemsXml(implode(\"\\n\", $sdata));\n file_put_contents(OUTDIR . DIRECTORY_SEPARATOR . ACTION . DIRECTORY_SEPARATOR . $b->id . '-' . ACTION . '.xml',\n mb_convert_encoding($xml, 'UTF-8'));\n }\n }\n}", "public function GetDownloadInfo()\n {\n if (strlen(trim($this->url)) === 0) {\n $this->logger->log('URL is empty');\n return false;\n }\n\n $mediathek = $this->findSupportingMediathek();\n if ($mediathek === null) {\n $this->logger->log('Failed to find mediathek for ' . $this->url);\n return false;\n }\n\n return $this->toDownloadInfo($mediathek->getDownloadInfo(\n $this->url,\n $this->username,\n $this->password\n ));\n }", "public function url_stat()\r\n {\r\n return $this->_stat;\r\n }", "public function onDownloaded()\n {\n }", "public function onDownloaded()\n {\n }", "function stats_display_alt($what,$count,$url,$total) {\n\n $epsilon = 0.0001; // To avoid having division by zero\n if (empty($total) || !isset($total) || $total == 0) {$total=1; $count=0;}\n if (empty($count) || !isset($count)) {$count=0;}\n\n\t\t\t// To avoid that by 100% the graph is too big\n if (($count/($total + $epsilon)) >= 0.95) {\n $total_normalize = 1.1 * ($total+ $epsilon);\n } else {\n $total_normalize = $total + $epsilon;\n }\n\n echo \"<tr><td width=246>&nbsp;\";\n if (strcmp($url,\"0\")) echo \"<a href=\\\"\".$url.\"\\\">\";\n echo $what;\n\t if (strcmp($url,\"0\")) echo \"</A>:</td>\\n\";\n echo \"<td width=6>&nbsp;</td>\\n\";\n echo \"</td width=42><td>&nbsp; $count</td>\\n\";\n\n echo \"<td><table width=264><TR><td><img src=\\\"images/leftbar.gif\\\" height=14 width=7 Alt=\\\"$what\\\"><img src=\\\"images/mainbar.gif\\\" Alt=\\\"$what\\\" height=14 width=\", $count * 240 / $total_normalize, \"><img src=\\\"images/rightbar.gif\\\" height=14 width=7 Alt=\\\"$what\\\"></td></tr></table>\\n\";\n\n echo \"</td><td width=42>&nbsp;\".(Ceil(($count*100 /($total+$epsilon))*10)/10).\"%</td></tr>\\n\";\n}", "protected function getProgressHelper() {}", "public function testInboundDocumentCount()\n {\n }", "public function getStats() {}", "public function testClickDownloadFail()\n {\n $this->makeData(self::NUMBER_RECORD_CREATE);\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('admin/qrcodes')\n ->assertSee('Download')\n ->press('Download')\n ->pause(4000)\n ->press('Download')\n ->assertSee('Data Empty');\n });\n }" ]
[ "0.68925345", "0.65333015", "0.64043474", "0.6208448", "0.6128119", "0.60995406", "0.6094395", "0.60865885", "0.59261143", "0.5919282", "0.5905546", "0.59014887", "0.5856576", "0.58380985", "0.58300525", "0.5750855", "0.57133067", "0.5689354", "0.5654278", "0.56460893", "0.5627374", "0.5626207", "0.56171334", "0.5614993", "0.5600304", "0.5597095", "0.5593584", "0.55636835", "0.5561101", "0.55461884", "0.5542906", "0.55377173", "0.5537002", "0.5531971", "0.5531619", "0.5521227", "0.55047655", "0.5485146", "0.5461093", "0.5458244", "0.54484445", "0.54439414", "0.54367167", "0.54246235", "0.5415577", "0.5408965", "0.54050124", "0.5379416", "0.53675795", "0.534695", "0.5336259", "0.53276706", "0.53238726", "0.53216934", "0.53195244", "0.53156203", "0.52907085", "0.52715683", "0.52712584", "0.5265616", "0.52545744", "0.5253819", "0.525366", "0.52509457", "0.52491164", "0.5242053", "0.52230036", "0.52055174", "0.5200633", "0.5181982", "0.5176784", "0.5165999", "0.51643586", "0.51621634", "0.514671", "0.5125245", "0.51206756", "0.5120293", "0.51198256", "0.51165634", "0.51114917", "0.5105518", "0.5097586", "0.50940204", "0.50876176", "0.5086774", "0.508509", "0.5083342", "0.50768167", "0.5076668", "0.5073311", "0.5070129", "0.5068903", "0.5068552", "0.50627613", "0.50627613", "0.50613487", "0.50598", "0.50559986", "0.50489736", "0.5041811" ]
0.0
-1
hammerOID_debug("ss_hammerOID.pollers.php Getting list of indexes");
function ss_hammerOID_pollers_indexes() { $return_arr = array(); $rows = db_fetch_assoc("SELECT id FROM poller"); for ($i=0;($i<sizeof($rows));$i++) { $return_arr[$i] = $rows[$i]['id']; } return $return_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_index()\r\n\t{\r\n\r\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function _INDEX()\n\t{\n\t\t\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "function getElasticSearchIndexes() {\n\n return 'pdb'.',' . 'geo'.',' . 'dbgap' .','. 'lincs' .','. 'arrayexpress'.','. 'gemma'.',' . 'sra'.','.'bioproject' .','.'clinicaltrials'.',' . 'dryad' .','\n .'cvrg'.','.'dataverse' .','.'neuromorpho'.','.'peptideatlas'.','.'ctn'.','.'cia'.','.'mpd'.','.'niddkcr'.','.'physiobank'.','.'proteomexchange'.','.'openfmri'.','.'nursadatasets'.','\n .'yped'.','.'cil'.','.'icpsr'.','.'gdc'.','.'bmrb'.','.'swissprot'.','.'clinvar'.','.'retina'.','.'emdb'.','.'epigenomics'.','.'nitrcir'.','.'neurovaultatlases'.','.'neurovaultcols'.','\n .'neurovaultnidm'.','.'rgd'.','.'datacitebgi'.','.'datacitemorphobank'.','.'vectorbase'.','.'datacitegnd'.','.'datacitepeerj'.','.'datacitezenodo'.','.'omicsdi'.','.'datacitesbgrid'\n .','.'simtk'.','.'datacitecxidb'.','.'datacitebils'.','.'dataciteada'.','.'dataciteukda'.','.'dataciteadaptive'.','.'datacitemit'.','.'datacitectsi'.','.'datacitefdz'\n .','.'datacitembf'.','.'datacitenimh'.','.'datacitejhu'.','.'datacitecandi'.','.'datacitelshtm'.','.'datacitedatabrary'.','.'immport'.','.'datacitesdscsg'.','.'datacitecrcns'\n .','.'nsrr'.','.'lsdb'.','.'naturedata'.','.'genenetwork'.','.'ndarpapers'.','.'datacitethieme'.','.'datacitefigshare'.','.'dataciteccdc'.','.'wormbase'.','.'gtexldacc'.','.'metabolomics';\n\n}", "public function getHitsList(){\n return $this->_get(3);\n }", "function &getIndexes(){\n\t\treturn array();\n\t}", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function setIndexList () {\n // $db_connect_manager -> getTestPool(\"testy_udt\");\n $pool = GeneratorTestsPool::generate(5, 1, 22);\n sort($pool);\n $select = \"SELECT q_podesty_ruchome_przejezdne.question, a_podesty_ruchome_przejezdne.answers, a_podesty_ruchome_przejezdne.`values` \n FROM q_podesty_ruchome_przejezdne INNER JOIN a_podesty_ruchome_przejezdne \n ON q_podesty_ruchome_przejezdne.id = a_podesty_ruchome_przejezdne.id_questions WHERE q_podesty_ruchome_przejezdne.id IN (\".implode(', ', $pool).\")\";\n echo $select;\n\n }", "public function zmysqlindex()\n {\n $this->display();\n }", "function get_index_params()\n {\n return array();\n }", "function getIndexes($table) {\n return mysql_query(sprintf('SHOW INDEX FROM %s', $table));\n }", "public function getIndexInfo()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "function getIndex() ;", "function index() {\n\t}", "function indexInfo( $table, $index, $fname = __METHOD__ );", "function &getTableIndexList($moduleID)\n{\n $mdb2 =& GetMDB2();\n $mdb2->loadModule('Manager');\n $mdb2->loadModule('Reverse', null, true);\n\n //get both table constraints and indexes\n static $indexes = array();\n\n if(!isset($indexes[$moduleID])){\n //unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableConstraints($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n $temp_indexes = array();\n foreach($temp_raw_indexes as $index_name){\n //if('PRIMARY' != $index_name){\n $temp_indexes[$index_name] = true;\n //}\n }\n\n //non-unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableIndexes($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n foreach($temp_raw_indexes as $index_name){\n $temp_indexes[$index_name] = false;\n }\n\n $indexes[$moduleID] = $temp_indexes;\n }\n\n return $indexes[$moduleID];\n}", "function index() {\n }", "protected function _getIndexer()\n {\n return Mage::getSingleton('algoliasearch/algolia');\n }", "function index() {\n \n }", "function sportal_index()\n{\n\tglobal $smcFunc, $context, $scripturl, $modSettings, $txt;\n\n\t$context['sub_template'] = 'portal_index';\n\n\tif (empty($modSettings['sp_articles_index']))\n\t\treturn;\n\n\t$request = $smcFunc['db_query']('','\n\t\tSELECT COUNT(*)\n\t\tFROM {db_prefix}sp_articles AS spa\n\t\t\tINNER JOIN {db_prefix}sp_categories AS spc ON (spc.id_category = spa.id_category)\n\t\tWHERE spa.status = {int:article_status}\n\t\t\tAND spc.status = {int:category_status}\n\t\t\tAND {raw:article_permissions}\n\t\t\tAND {raw:category_permissions}\n\t\tLIMIT {int:limit}',\n\t\tarray(\n\t\t\t'article_status' => 1,\n\t\t\t'category_status' => 1,\n\t\t\t'article_permissions' => sprintf($context['SPortal']['permissions']['query'], 'spa.permissions'),\n\t\t\t'category_permissions' => sprintf($context['SPortal']['permissions']['query'], 'spc.permissions'),\n\t\t\t'limit' => 1,\n\t\t)\n\t);\n\tlist ($total_articles) = $smcFunc['db_fetch_row']($request);\n\t$smcFunc['db_free_result']($request);\n\n\t$total = min($total_articles, !empty($modSettings['sp_articles_index_total']) ? $modSettings['sp_articles_index_total'] : 20);\n\t$per_page = min($total, !empty($modSettings['sp_articles_index_per_page']) ? $modSettings['sp_articles_index_per_page'] : 5);\n\t$start = !empty($_REQUEST['articles']) ? (int) $_REQUEST['articles'] : 0;\n\t$total_pages = $per_page > 0 ? ceil($total / $per_page) : 0;\n\t$current_page = $per_page > 0 ? ceil($start / $per_page) : 0;\n\n\tif ($total > $per_page)\n\t{\n\t\t$context['page_index'] = constructPageIndex($context['portal_url'] . '?articles=%1$d', $start, $total, $per_page, true);\n\n\t\tif ($current_page > 0)\n\t\t\t$context['previous_start'] = ($current_page - 1) * $per_page;\n\t\tif ($current_page < $total_pages - 1)\n\t\t\t$context['next_start'] = ($current_page + 1) * $per_page;\n\t}\n\n\t$context['articles'] = sportal_get_articles(0, true, true, 'spa.id_article DESC', 0, $per_page, $start);\n\n\tforeach ($context['articles'] as $article)\n\t{\n\t\tif (($cutoff = $smcFunc['strpos']($article['body'], '[cutoff]')) !== false)\n\t\t\t$article['body'] = $smcFunc['substr']($article['body'], 0, $cutoff);\n\n\t\t$context['articles'][$article['id']]['preview'] = parse_bbc($article['body']);\n\t\t$context['articles'][$article['id']]['date'] = timeformat($article['date']);\n\t}\n}", "function apachesolr_index_status($env_id) {\n $remaining = 0;\n $total = 0;\n\n foreach (entity_get_info() as $entity_type => $info) {\n $bundles = apachesolr_get_index_bundles($env_id, $entity_type);\n if (empty($bundles)) {\n continue;\n }\n\n $table = apachesolr_get_indexer_table($entity_type);\n $query = db_select($table, 'aie')\n ->condition('aie.status', 1)\n ->condition('aie.bundle', $bundles)\n ->addTag('apachesolr_index_' . $entity_type);\n\n $total += $query->countQuery()->execute()->fetchField();\n\n $query = _apachesolr_index_get_next_set_query($env_id, $entity_type);\n $remaining += $query->countQuery()->execute()->fetchField();\n }\n return array('remaining' => $remaining, 'total' => $total);\n}", "public function defineIndexes()\n\t{\n\t\treturn array();\n\t}", "function index()\n {\n }", "function index()\n {\n }", "function index()\n {\n }", "private function getDbIndexes()\n\t{\n\t\t$r = $this->source->query(\"SHOW INDEXES FROM `{$this->table}`\");\n\t\treturn $r;\n\t}", "public function getIndexes()\n {\n\treturn $this->indexes;\n }", "public function hook_before_index(&$result) {\n \n }", "function create_index()\n\t{\n\t\tinclude_once(dirname(__FILE__) . '/../../include/class/adodb/adodb.inc.php');\n\t\t$conn = &ADONewConnection($_SESSION['db_type']);\n\t\t$conn->PConnect($_SESSION['db_server'], $_SESSION['db_user'], $_SESSION['db_password'], $_SESSION['db_database']);\n\t\t$config['table_prefix'] = $_SESSION['table_prefix'] . $_SESSION['or_install_lang'] . '_';\n\t\t$config['table_prefix_no_lang'] = $_SESSION['table_prefix'];\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_name ON \" . $config['table_prefix'] . \"userdb (userdb_user_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_active ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_active);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_user ON \" . $config['table_prefix'] . \"listingsdb (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_name ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name);\";\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_value ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_listing_id ON \" . $config['table_prefix'] . \"listingsimages (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_searchable ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_searchable);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_mlsexport ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_mlsexport);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listing_id ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_type ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_type);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_browse ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_display_on_browse);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_field_name ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_search_rank ON \" . $config['table_prefix'] . \"listingsformelements (listingsformelements_search_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_images_rank ON \" . $config['table_prefix'] . \"listingsimages (listingsimages_rank);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_forgot_email ON \" . $config['table_prefix_no_lang'] . \"forgot (forgot_email);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_class_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classformelements_listingsformelements_id ON \" . $config['table_prefix_no_lang'] . \"classformelements (listingsformelements_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_class_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (class_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classlistingsdb_listingsdb_id ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id);\";\n\n\t\t$sql_insert[] = \"CREATE INDEX idx_class_rank ON \" . $config['table_prefix'] . \"class (class_rank);\";\n\t\t//Add indexes for userdbelements tables\n\t\t// CHANGED: blob or text fields can only index a max of 255 (mysql) and you have to specify\n\t\tif ($_SESSION['db_type'] == 'mysql') {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value(255));\";\n\t\t}else {\n\t\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_value ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_value);\";\n\t\t}\n\t\t$sql_insert[] = \"CREATE INDEX idx_user_field_name ON \" . $config['table_prefix'] . \"userdbelements (userdbelements_field_name);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_userdb_userid ON \" . $config['table_prefix'] . \"userdbelements (userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_listfieldmashup ON \" . $config['table_prefix'] . \"listingsdb (listingsdb_id ,listingsdb_active,userdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_fieldmashup ON \" . $config['table_prefix'] . \"listingsdbelements (listingsdbelements_field_name,listingsdb_id);\";\n\t\t$sql_insert[] = \"CREATE INDEX idx_classfieldmashup ON \" . $config['table_prefix_no_lang'] . \"classlistingsdb (listingsdb_id ,class_id);\";\n\t\t// ADDED foreach to run through array with errorchecking to see if something went wrong\n\t\twhile (list($elementIndexValue, $elementContents) = each($sql_insert)) {\n\t\t\t$recordSet = $conn->Execute($elementContents);\n\t\t\tif ($recordSet === false) {\n\t\t\t\tif ($_SESSION['devel_mode'] == 'no') {\n\t\t\t\t\tdie (\"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\");\n\t\t\t\t}else {\n\t\t\t\t\techo \"<strong><span style=\\\"red\\\">ERROR - $elementContents</span></strong><br />\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo 'Indexes Created<br />';\n\t}", "public function testOrgApacheJackrabbitOakPluginsIndexSolrOsgiSolrQueryIndexProvid()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.jackrabbit.oak.plugins.index.solr.osgi.SolrQueryIndexProviderService';\n\n $crawler = $client->request('POST', $path);\n }", "function index()\r\n\t{\r\n\t}", "function index()\r\n\t{\r\n\t}", "function getOverview() ;", "function _loadIndex () \n {\n $this->_enterSection('_loadIndex');\n \n $index = array();\n \n $a = strcspn ($this->_options['dsn'], ':');\n $proto = substr ($this->_options['dsn'], 0, $a);\n $path = substr ($this->_options['dsn'], $a + 3);\n\n switch ($proto) {\n case 'file' : \n $f = sprintf($path, $this->_indexName);\n $data = '';\n if ($fp = @fopen ($f,'r')) {\n $this->_enterSection('_loadIndex (acquiring read lock)');\n flock($fp, LOCK_SH);\n $this->_leaveSection('_loadIndex (acquiring read lock)');\n $this->_enterSection('_loadIndex (reading data)');\n while (!feof($fp)) {\n $data .= fread ($fp, 0xFFFF);\n }\n fclose ($fp);\n $this->_leaveSection('_loadIndex (reading data)');\n }\n \n $this->_enterSection('_loadIndex (unserializing/uncompressing)');\n if ($data) {\n if ($this->_options['gz_level']) {\n $index = unserialize(gzuncompress($data));\n } else {\n $index = unserialize($data);\n }\n }\n $this->_leaveSection('_loadIndex (unserializing/uncompressing)');\n break;\n }\n $this->_index = $index;\n \n $this->_leaveSection('_loadIndex');\n }", "function index()\n{\n\t$index=Page::get(array(\"pg_type\" => \"index\"));\n\tif(isset($index))\n\t{\n\t\t$GLOBALS['GCMS']\n\t\t\t\t->assign('gcms_page_title',\n\t\t\t\t\t\t$GLOBALS['GCMS_SETTING']['seo']['title'].\" | \".$index->pg_title);\n\t\t$GLOBALS['GCMS']\n\t\t\t\t->assign('boxes',\n\t\t\t\t\t\tBox::get(array(\"parent_id\" => $index->id, \"box_status\" => \"publish\"), true,\n\t\t\t\t\t\t\t\tarray(\"by\" => \"id\")));\n\t\t$GLOBALS['GCMS']->assign('show_index', $index);\n\t}\n\telse\n\t\theader(\"location: /error404?error=page&reason=page_not_exist\");\n}", "function get_alloptions_110()\n {\n }", "public function getIndexList() {\n return self::$indexes;\n }", "function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}", "public function checkTableIndex(){\n\t\t$db = $this->db;\n\t\t\n\t\t$sql = \"SELECT * FROM dataset WHERE table_num <= 1\";\n\t\t\n\t\t$result = $db->fetchAll($sql, 2);\n\t\t\n\t\tforeach($result AS $row){\n\t\t\t$cacheID = $row[\"cache_id\"];\n\t\t\t$tableId = OpenContext_TableOutput::tableID_toURL($cacheID);\n\t\t\t$noid = $row[\"noid\"];\n\t\t\t$created = $row[\"created_on\"];\n\t\t\t\n\t\t\tif(!stristr($tableId, \"http://\")){\n\t\t\t\t$host = OpenContext_OCConfig::get_host_config();\n\t\t\t\t$tableId = $host.\"/tables/\".$tableId;\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"SELECT * FROM noid_bindings WHERE itemUUID = '$cacheID' LIMIT 1\";\n\t\t\t$resultB = $db->fetchAll($sql, 2);\n\t\t\t\n\t\t\tif(!$resultB){\n\t\t\t\t$data = array(\"noid\" => $noid,\n\t\t\t\t\t\t\t \"itemType\" => \"table\",\n\t\t\t\t\t\t\t \"itemUUID\" => $cacheID,\n\t\t\t\t\t\t\t \"itemURI\" => $tableId,\n\t\t\t\t\t\t\t \"public\" => 0,\n\t\t\t\t\t\t\t \"solr_indexed\" => 0\n\t\t\t\t\t\t\t );\n\t\t\t\t$db->insert(\"noid_bindings\", $data);\n\t\t\t}\n\t\t\t\n\t\t}//end loop\n\t\n\t}", "public function getIndexes()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW INDEX FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "function index()\n\t{\n\t}", "public function index() {\r\n return phpsaaswrapper()->index();\r\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "function index()\n {\n\n }", "function index() {\n\n }", "public function index()\r\n {\r\n \treturn $this->class->index(1);\r\n }", "function index() \n\t{\n\t\t/* TODO: This logic can be optimized more */\n\t\t\n\t\t$datevalue2 = $this->_date;\n\t\t\t\t\n\t\tif($_GET['log_file'])\n\t\t\tdefine(\"log_file\", $_GET['log_file']);\n\t\t\n\t\tif($_GET['DEBUG'])\n\t\t\tdefine(\"DEBUG\", $_GET['DEBUG']);\n\t\t\n\t\t$this->log_info(log_file, \"CA [delist live index] process started\");\n\n\t\t$final_array = array ();\n\n\t\t/* Fetch the list of indexes with delist security request pending for today */\n\t\t$indxxs = $this->db->getResult ( \"select id,indxx_id from tbl_replace_runnindex_req where startdate='\" . $datevalue2 . \"' and adminapprove='1' and dbapprove='1'\", true );\n\t\t\n\t\tif (! empty ( $indxxs )) \n\t\t{\n\t\t\tforeach ( $indxxs as $indxx ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$indxx_data = $this->db->getResult ( \"select * from tbl_indxx where id='\" . $indxx ['indxx_id'] . \"'\" );\n\t\t\t\tif (! empty ( $indxx_data ))\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['details'] = $indxx_data;\n\t\t\t\t\n\t\t\t\t$indxx_value = $this->db->getResult ( \"select * from tbl_indxx_value where indxx_id='\" . $indxx ['indxx_id'] . \"' order by date desc \", false, 1 );\n\t\t\t\tif (! empty ( $indxx_value )) \n\t\t\t\t{\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['index_value'] = $indxx_value;\n\t\t\t\t\t$datevalue = $indxx_value ['date'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log_error(log_file, \"datevalue not defined, next MYSQL query will fail\");\n\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$query = \"Select it.id, it.name, it.isin, it.ticker, it.curr, it.divcurr, it.sedol, it.cusip, it.countryname, \n\t\t\t\t\tfp.price as calcprice, fp.localprice, fp.currencyfactor, sh.share as calcshare from\n\t\t\t\t\ttbl_indxx_ticker it left join tbl_final_price fp on fp.isin=it.isin\n\t\t\t\t\tleft join tbl_share sh on sh.isin=it.isin where\n\t\t\t\t\tfp.date='\" .$datevalue. \"' and fp.indxx_id='\" .$indxx ['indxx_id'].\n\t\t\t\t\t\t\t\t\t\" and sh.indxx_id='\" .$indxx ['indxx_id']. \"and it.indxx_id='\" . $indxx ['indxx_id'];\n\t\t\t\t$indxxprices = $this->db->getResult ( $query, true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['olddata'] = $indxxprices;\n\t\t\t\t\n\t\t\t\t$oldsecurity = $this->db->getResult ( \"select security_id from tbl_replace_runnsecurity where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['replacesecurity'] = $oldsecurity;\n\n\t\t\t\t$newsecurities = $this->db->getResult ( \"select name, \tisin,ticker,curr,divcurr,sedol,cusip,countryname from tbl_runnsecurities_replaced where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\n\t\t\t\t\n\t\t\t\tif (! empty ( $newsecurities )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newsecurities as $key => $security ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$prices = $this->getSecurtyPrices ( $security ['isin'], $security ['curr'], $indxx_data ['curr'], $datevalue );\n\t\t\t\t\t\t$newsecurities [$key] ['calcprice'] = $prices ['calcprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['localprice'] = $prices ['localprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['currencyfactor'] = $prices ['currencyfactor'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['newsecurity'] = $newsecurities;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! empty ( $final_array )) \n\t\t{\n\t\t\tforeach ( $final_array as $id => $indxx_array ) \n\t\t\t{\n\t\t\t\t$countnewSeurities = count ( $indxx_array ['newsecurity'] );\n\n\t\t\t\tif ($countnewSeurities) \n\t\t\t\t{\n\t\t\t\t\tif (! empty ( $indxx_array ['replacesecurity'] )) \n\t\t\t\t\t{\n\t\t\t\t\t\t$tempmarketcap = 0;\n\t\t\t\t\t\t$TempWeight = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/* Replace securties */\n\t\t\t\t\t\tforeach ( $indxx_array ['replacesecurity'] as $replaceSecurity ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['olddata'] as $oldsecuritykey => $oldsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($oldsecurity ['id'] == $replaceSecurity ['security_id']) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tempmarketcap += $oldsecurity ['calcshare'] * $oldsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteSecurityQuery = 'Delete from tbl_indxx_ticker where id=\"' . $oldsecurity ['id'] . '\"';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteSecurityQuery );\n\n\t\t\t\t\t\t\t\t\t$deletepriceQuery = 'Delete from tbl_final_price where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" and date =\"' . $indxx_array ['index_value'] ['date'] . '\" ';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deletepriceQuery );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteshareQuery = 'Delete from tbl_share where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" ';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteshareQuery );\n\t\t\t\t\t\t\t\t\tunset ( $final_array [$id] ['olddata'] [$oldsecuritykey] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Calculate new index parameters with replaced securities */\n\t\t\t\t\t\tif ($tempmarketcap)\n\t\t\t\t\t\t\t$TempWeight = $tempmarketcap / $countnewSeurities;\n\t\t\t\n\t\t\t\t\t\tif (! empty ( $indxx_array ['newsecurity'] )) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['newsecurity'] as $newsecuritykey => $newsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$share = $TempWeight / $newsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t$final_array [$id] ['newsecurity'] [$newsecuritykey] ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t$newsecurity ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$final_array [$id] ['olddata'] [] = $newsecurity;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertTicker = 'Insert into tbl_indxx_ticker set name=\"' . $newsecurity ['name'] . '\", isin=\"' . $newsecurity ['isin'] . '\", ticker=\"' . $newsecurity ['ticker'] . '\", curr=\"' . $newsecurity ['curr'] . '\", divcurr=\"' . $newsecurity ['divcurr'] . '\",countryname=\"' . $newsecurity ['countryname'] . '\",cusip=\"' . $newsecurity ['cusip'] . '\",sedol=\"' . $newsecurity ['sedol'] . '\",indxx_id=\"' . $id . '\", status=\"1\",weight=\"0\"';\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertTicker );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertPrice = 'Insert into tbl_final_price set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", localprice=\"' . $newsecurity ['localprice'] . '\", price=\"' . $newsecurity ['calcprice'] . '\", currencyfactor=\"' . $newsecurity ['currencyfactor'] . '\",indxx_id=\"' . $id . '\"';\n\t\t\t\t\t\t\t\t$this->db->query ( $insertPrice );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertshare = 'Insert into tbl_share set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", share=\"' . $newsecurity ['calcshare'] . '\",indxx_id=\"' . $id . '\"';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertshare );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t$this->log_info(log_file, \"CA [replace live index] process finished\");\n\t\t\n\t\t//$this->saveProcess ( 1 );\n\t\t$this->Redirect(\"index.php?module=calccapub&DEBUG=\" .DEBUG. \"&date=\" .$datevalue2. \"&log_file=\" . basename(log_file), \"\", \"\" );\n\t}", "public function getIndex()\n {\n // add stuff here\n }", "public function index()\n {\n\n return \"Segment1: \" . print_r($this->segments[0],true);\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "function index(){\n $this->APICONTROLLERID = 8;\n $this->accessNumberID = 8;\n echo \"Asd\";\n $this->checkACL();\n }", "public function indexes()\r\n {\r\n return $this->indexes;\r\n }", "public function action_index()\n {\n\t\ttry\n\t\t{\n\t\t\t$this->rest_output( $this->_rest->getData($this->_params) );\n\t\t}\n\t\tcatch (Kohana_HTTP_Exception $khe)\n\t\t{\n\t\t\t$this->_error($khe);\n\t\t\treturn;\n\t\t}\n\t\tcatch (Kohana_Exception $e)\n\t\t{\n\t\t\t$this->_error('An internal error has occurred', 500);\n\t\t\tthrow $e;\n\t\t}\n \t\n }", "public function indexPerLevelAction() {\n\n }", "abstract function index();", "abstract function index();", "abstract function index();", "public function getIndexStart();", "function get_table_indexes($db, $table, $cnx='', $reload=false, $mode='mysql'){\n\tif($mode!=='mysql') exit('only mysql index mode developed');\n\tglobal $get_table_indexes, $dbTypeArray;\n\tif(!$cnx)$cnx=C_MASTER;\n\tif($get_table_indexes[$db][$table] && !$reload){\n\t\treturn $get_table_indexes[$db][$table];\n\t}else{\n\t\t$fl=__FILE__;\n\t\t$ln=__LINE__+1;\n\t\tob_start();\n\t\t$result=q(\"SHOW INDEXES FROM `$db`.`$table`\", $cnx, ERR_ECHO, O_DO_NOT_REMEDIATE);\n\t\t$err=ob_get_contents();\n\t\tob_end_clean();\n\t\tif($err)return false;\n\t\t\n\t\t$typeFlip = array_flip($dbTypeArray);\n\t\t$inCompound=false;\n\t\twhile($v=mysqli_fetch_array($result,MYSQLI_ASSOC)){\n\t\t\t$w++;\n\t\t\t@extract($v);\n\t\t\tif($buffer==$Key_name){\n\t\t\t\t//duplicate part of a key\n\t\t\t\tif(!$inCompound){\n\t\t\t\t\t$multiIdx[$Key_name][]=$singleIdx[count($singleIdx)-1];\n\t\t\t\t\tunset($singleIdx[count($singleIdx)-1]);\n\t\t\t\t\t//next two lines overcome \"bug\" in php: just cause I unset the highest element, this will not reset the next index assigned when I say $singleIdx[]=.. later on.\n\t\t\t\t\t$clr=$singleIdx;\n\t\t\t\t\t$singleIdx=$clr;\n\t\t\t\t}\n\t\t\t\t$multiIdx[$Key_name][]=$v;\n\t\t\t\t$inCompound=true;\n\t\t\t}else{\n\t\t\t\t$singleIdx[]=$v;\n\t\t\t\t$buffer=$Key_name;\n\t\t\t\t$inCompound=false;\n\t\t\t}\n\t\t}\n\t\t//set $singleIdx as assoc for reference\n\t\tif(count($singleIdx)){\n\t\t\tforeach($singleIdx as $v) $a[strtolower($v['Column_name'])]=$v;\n\t\t\t$singleIdx=$a;\n\t\t}\n\t\t//store compound keys as XML\n\t\tif($multiIdx){\n\t\t\t$compoundKey='';\n\t\t\tforeach($multiIdx as $n=>$v){\n\t\t\t\t$ci.='<compoundKey Key_name=\"'.$n.'\" Column_count=\"'.count($v).'\"';\n\t\t\t\t$i=0;\n\t\t\t\tforeach($v as $w){\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i==1)$ci.=' Non_unique=\"'.$w['Non_unique'].'\">'.\"\\n\";\n\t\t\t\t\t$ci.='<keyColumn Seq_in_index=\"'.$w['Seq_in_index'].'\" Column_name=\"'.$w['Column_name'].'\" Sub_part=\"'.$w['Sub_part'].'\" Comment=\"'.htmlentities($w['Comment']).'\">'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ci.='</compoundKey>';\n\t\t\t}\n\t\t}\n\t\t$get_table_indexes[$db][$table]=array('singleIdx'=>$singleIdx, 'multiIdx'=>$multiIdx, 'compoundXML'=>$ci);\n\t\treturn $get_table_indexes[$db][$table];\n\t}\n}", "function apc_cache_get_logindex($key) {\n\treturn APC_CACHE_LOG_INDEX . \"-\" . $key;\n}", "function retrieve_client_statistics(){\n\t\t\n\t}", "function mapit_admin_get_stats() {\n global $mapit_client;\n $params = func_get_args();\n $result = $mapit_client->call('MaPit.admin_get_stats', $params);\n return $result;\n}", "public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}", "public function actionIndex() {\n error_log(\"asdfasdfasdfa\");\n echo \"index\";\n }", "protected function getIndex()\n\t{ \n /*\n $sm = $this->account->getServiceManager();\n $dbh = $sm->get(\"Db\");\n $this->dbh = $dbh;\n\t\treturn new \\Netric\\EntityQuery\\Index\\Pgsql($this->account, $dbh);\n * \n */\n $this->dbh = $this->account->getServiceManager()->get(\"Db\");\n return new \\Netric\\EntityQuery\\Index\\Pgsql($this->account);\n\t}", "function _getNodeMappingAccessInfo($fqhostname)\n{\n\t// the NODE, NODE_MAPPING and OO_REMOTE_LOCATION table to \n\t// determine which CaaS HPSA nodes to use for access the CaaS node\n\t//\n\t// Input: $fqhostname - fully qualified hostname of node being monitored\n\t// Output: $hpsaNodes - array containing the following HPSA access info:\n\t//\t\t\t\t\t\t- PRIORITY_CD - priority for access. 1 = first, 2 = second\n\t//\t\t\t\t\t\t- SERVER_IP\t- HPSA server IP\n\t//\t\t\t\t\t\t- SERVER_PORT - HPSA server port\n\t//\t\t\t\t\t\t- USERNAME - username for HPSA connection\n\t//\t\t\t\t\t\t- PASSWORD - password for HPSA connection\n\t//\t\t\t\t\t\t- ROSH_USER\t- username for ogsh/rosh operations within HPSA\n\t//\n\t_log(\"getNodeMappingAccessInfo: Starting.\",\"info\");\n\t_log(\"getNodeMappingAccessInfo: Looking up HPSA server(s) for fqhostname = $fqhostname.\",\"info\");\n\tglobal $dwhDbConn, $caasnode;\n\t\t\n\t$sql = \"SELECT RA.PRIORITY_CD, RA.SERVER_IP, RA.SERVER_PORT, RA.USERNAME, RA.PASSWORD, NVL(NM.SA_USER_NAME, 'none') ROSH_USER \";\n\t$sql .= \"FROM TMSFPDW1.NODE N \";\n\t$sql .= \"JOIN TMSFPDW1.NODE_MAPPING NM on NM.NODE_ID = N.NODE_ID \";\n\t$sql .= \"JOIN TMSFPDW1.OO_REMOTE_ACCESS_LOCATION RA ON RA.MESH_ID = NM.MESH_ID \";\n\t$sql .= \"WHERE N.END_DATE IS NULL \";\n $sql .= \"AND RA.SERVER_PORT = '2222' \";\n\t$sql .= \"AND RA.PRIORITY_CD IS NOT NULL \";\n $sql .= \"AND N.NODE_NAME = '$fqhostname' \";\n\t$sql .= \"order by RA.priority_cd asc \";\n\n\t_log(\"getNodeMappingAccessInfo: sql: $sql\",\"info\");\n\t$stmt = oci_parse($dwhDbConn, $sql);\n\toci_execute($stmt);\n\t$hpsaNodes = array();\n\twhile ($r = oci_fetch_array($stmt, OCI_ASSOC+OCI_RETURN_LOBS))\n\t{\n\t array_push($hpsaNodes, $r);\n\t}\n\n\t_log(\"getNodeMappingAccessInfo: Exiting.\",\"info\");\n\treturn $hpsaNodes;\n}", "public function index()\n\t{\n\t\t/*\n\t\t|\tnot a logical function since GramStainResult\n\t\t|\tshould be specific to a particular result\n\t\t*/\n\t}", "public function buildMemberIndexes(){\n\t\t$paginator = $this->facadeUser->findAllUsers(array('unbanned'=>true));\t\r\n\t\t\\Zend_Search_Lucene_Analysis_Analyzer::setDefault(new \\Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8Num_CaseInsensitive ());\r\n\t\t$index = \\Zend_Search_Lucene::create(APPLICATION_PATH . '/indexes/members');\r\n\t\t\t\t\n\t\t// go through all members in the index file\r\n\t\tforeach ($paginator as $user){\n\t\t\t$this->addUserIndex($user); // add new index to the index\r\n\t\t}\n\t\t\r\n\t\t// optimize the index\r\n\t\t$index->optimize();\n\t\treturn $index->numDocs(); \n\t}", "function snmpget_entity_oids($oids, $index, $device, $array, $mib = NULL)\n{\n foreach ($oids as $oid)\n {\n $oid_string .= \" $oid.$index\";\n }\n\n return snmp_get_multi($device, $oids, \"-Ovq\", $mib, mib_dirs());\n}", "public function fullIndexAction() {}", "public function indexAction()\n {\n $versions = Mage::helper('iparcel')->gatherExtensionVersions();\n\n foreach ($versions as $key => $version) {\n print \"<b>$key</b>: $version<br />\";\n }\n }", "public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function admincp_index(){\n\t\tmodules::run('admincp/chk_perm',$this->session->userdata('ID_Module'),'r',0);\n\t\t$default_func = 'status';\n\t\t$default_sort = 'ASC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','index',$data);\n\t\t$this->template->render();\n\t}", "public function action_index()\n\t{\n\t}", "function awstats() {\n\t $this->awfile = paramload('SHELL','prpath') . \"awstats012005.example.com.txt\"; \n\t $this->aw = new awfile($this->awfile); \n }", "public function showList() {\n\t \treturn 0;\n\t }", "public function index()\n {\n return SOA_OVL::latest()->paginate(0);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "function getIndicesImpact($list_agence) {\n\n global $dbHandler,$global_id_agence;\n $db = $dbHandler->openConnection();\n $DATA['general']['nombre_moyen_gs']=0;\n $DATA['clients']['pp'] = 0;\n $DATA['clients']['homme'] = 0;\n $DATA['clients']['femme'] = 0;\n $DATA['clients']['pm'] = 0;\n $DATA['clients']['gi'] = 0;\n $DATA['clients']['gs'] = 0;\n $DATA['clients']['total']=0;\n $DATA['epargnants']['pp'] = 0;\n $DATA['epargnants']['homme'] = 0;\n $DATA['epargnants']['femme'] = 0;\n $DATA['epargnants']['pm'] = 0;\n $DATA['epargnants']['gi'] = 0;\n $DATA['epargnants']['gs'] = 0;\n $DATA['epargnants']['total']=0;\n $DATA['emprunteurs']['pp'] = 0;\n $DATA['emprunteurs']['homme'] = 0;\n $DATA['emprunteurs']['femme'] = 0;\n $DATA['emprunteurs']['pm'] = 0;\n $DATA['emprunteurs']['gi'] = 0;\n $DATA['emprunteurs']['gs'] = 0;\n $DATA['general']['total_membre_empr_gi'] = 0;\n $DATA['general']['total_membre_empr_gs'] = 0;\n $DATA['general']['nombre_moyen_gi'] =0;\n $DATA['general']['nombre_moyen_gs'] =0;\n $DATA['general']['gi_nbre_membre'] =0;\n $DATA['general']['gs_nbre_membre'] =0;\n $DATA['general']['gs_nbre_hommes'] =0;\n $DATA['general']['gs_nbre_femmes'] =0;\n $nb_agence=0;\n foreach($list_agence as $key_id_ag =>$value) {\n //Parcours des agences\n setGlobalIdAgence($key_id_ag);\n $nb_agence++;\n // Nombre de clients\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND etat = 2 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['clients']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['clients']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['clients']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['clients']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['clients']['femme'] += $row['count'];\n }\n }\n\n $DATA['clients']['pp'] += $DATA['clients']['homme'] + $DATA['clients']['femme'];\n $DATA['clients']['total'] += $DATA['clients']['pp'] + $DATA['clients']['pm'] + $DATA['clients']['gi'] + $DATA['clients']['gs'];\n\n if ($DATA['clients']['pp'] == 0) {\n $DATA['clients']['pourcentage_homme'] = 0;\n $DATA['clients']['pourcentage_femme'] = 0;\n } else {\n $DATA['clients']['pourcentage_homme'] = $DATA['clients']['homme'] / $DATA['clients']['pp'];\n $DATA['clients']['pourcentage_femme'] = $DATA['clients']['femme'] / $DATA['clients']['pp'];\n }\n\n // Nombre d'épargnants\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND (SELECT count(*) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_client = id_titulaire AND id_prod <> 2 AND id_prod <> 3 AND solde <> 0) > 0 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['epargnants']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['epargnants']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['epargnants']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['epargnants']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['epargnants']['femme'] += $row['count'];\n }\n }\n\n $DATA['epargnants']['pp'] += $DATA['epargnants']['homme'] + $DATA['epargnants']['femme'];\n $DATA['epargnants']['total'] += $DATA['epargnants']['pp'] + $DATA['epargnants']['pm'] + $DATA['epargnants']['gi'] + $DATA['epargnants']['gs'];\n\n if ($DATA['epargnants']['pp'] == 0) {\n $DATA['epargnants']['pourcentage_homme'] = 0;\n $DATA['epargnants']['pourcentage_femme'] = 0;\n } else {\n $DATA['epargnants']['pourcentage_homme'] = $DATA['epargnants']['homme'] / $DATA['epargnants']['pp'];\n $DATA['epargnants']['pourcentage_femme'] = $DATA['epargnants']['femme'] / $DATA['epargnants']['pp'];\n }\n\n\n // Nombre d'emprunteurs\n $sql = \"SELECT statut_juridique, pp_sexe, count(ad_cli.id_client) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['emprunteurs']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['emprunteurs']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['emprunteurs']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['emprunteurs']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['emprunteurs']['femme'] += $row['count'];\n }\n }\n\n $DATA['emprunteurs']['pp'] += $DATA['emprunteurs']['homme'] + $DATA['emprunteurs']['femme'];\n $DATA['emprunteurs']['total'] += $DATA['emprunteurs']['pp'] + $DATA['emprunteurs']['pm'] + $DATA['emprunteurs']['gi'] + $DATA['emprunteurs']['gs'];\n\n if ($DATA['emprunteurs']['pp'] == 0) {\n $DATA['emprunteurs']['pourcentage_homme'] = 0;\n $DATA['emprunteurs']['pourcentage_femme'] = 0;\n } else {\n $DATA['emprunteurs']['pourcentage_homme'] = $DATA['emprunteurs']['homme'] / $DATA['emprunteurs']['pp'];\n $DATA['emprunteurs']['pourcentage_femme'] = $DATA['emprunteurs']['femme'] / $DATA['emprunteurs']['pp'];\n }\n\n // Nombre total de membres emprunteurs par groupe informel\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gi'] += round($row[0]);\n\n // Nombre total de membres emprunteurs par groupe solidaire\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gs'] += round($row[0]);\n\n // Nombre total d'hommes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 1 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_homme_gs'] = round($row[0]);\n // Nombre total de femmes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 2 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_femme_gs'] = round($row[0]);\n\n // Nombre moyen de membres par groupe informel\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gi'] += round($row[0]);\n\n // Nombre moyen de membres par groupe solidaire\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gs'] += round($row[0]);\n }\n $DATA['general']['nombre_moyen_gi']=$DATA['general']['nombre_moyen_gi']/$nb_agence;\n $DATA['general']['nombre_moyen_gs']=$DATA['general']['nombre_moyen_gs']/$nb_agence;\n $dbHandler->closeConnection(true);\n return $DATA;\n}", "function asp_do_init_options() {\r\r\n global $wd_asp;\r\r\n\r\r\n $wd_asp->options = array();\r\r\n $options = &$wd_asp->options;\r\r\n $wd_asp->o = &$wd_asp->options;\r\r\n\r\r\n $options['asp_glob_d'] = array(\r\r\n 'additional_tag_posts' => array() // Store post IDs that have additional tags\r\r\n );\r\r\n\r\r\n /* Performance Tracking options */\r\r\n $options['asp_performance_def'] = array(\r\r\n 'enabled' => 1\r\r\n );\r\r\n\r\r\n /* Index table options */\r\r\n $options['asp_it_def'] = array(\r\r\n 'it_index_title' => 1,\r\r\n 'it_index_content' => 1,\r\r\n 'it_index_excerpt' => 1,\r\r\n 'it_post_types' => array('post', 'page'),\r\r\n 'it_index_tags' => 0,\r\r\n 'it_index_categories' => 0,\r\r\n 'it_index_taxonomies' => '',\r\r\n 'it_attachment_mime_types' => 'image/jpeg, image/gif, image/png',\r\r\n\r\r\n 'it_index_pdf_content' => 0,\r\r\n 'it_index_pdf_method' => 'auto',\r\r\n 'it_index_text_content' => 0,\r\r\n 'it_index_richtext_content' => 0,\r\r\n 'it_index_msword_content' => 0,\r\r\n 'it_index_msexcel_content' => 0,\r\r\n 'it_index_msppt_content' => 0,\r\r\n\r\r\n 'it_synonyms_as_keywords' => 0,\r\r\n\r\r\n 'it_index_permalinks' => 0,\r\r\n 'it_index_customfields' => '',\r\r\n 'it_post_statuses' => 'publish',\r\r\n 'it_index_author_name' => 0,\r\r\n 'it_index_author_bio' => 0,\r\r\n 'it_blog_ids' => '',\r\r\n 'it_limit' => 25,\r\r\n 'it_use_stopwords' => 0,\r\r\n 'it_stopwords' => @file_get_contents(ASP_PATH . '/stopwords.txt'),\r\r\n 'it_min_word_length' => 1,\r\r\n 'it_extract_iframes' => 0,\r\r\n 'it_extract_shortcodes' => 1,\r\r\n 'it_exclude_shortcodes' => 'wpdreams_rpl, wpdreams_rpp',\r\r\n 'it_index_on_save' => 1,\r\r\n 'it_cron_enable' => 0,\r\r\n 'it_cron_period' => \"asp_cr_five_minutes\",\r\r\n // performance\r\r\n 'it_pool_size_auto' => 1,\r\r\n 'it_pool_size_one' => 500,\r\r\n 'it_pool_size_two' => 800,\r\r\n 'it_pool_size_three' => 2000,\r\r\n 'it_pool_size_rest' => 2000\r\r\n );\r\r\n\r\r\n /* Analytics options */\r\r\n $options['asp_analytics_def'] = array(\r\r\n 'analytics' => 0,\r\r\n 'analytics_string' => \"?ajax_search={asp_term}\"\r\r\n );\r\r\n\r\r\n\r\r\n /* Default caching options */\r\r\n $options['asp_caching_def'] = array(\r\r\n 'caching' => 0,\r\r\n 'caching_method' => 'file', // file or db\r\r\n 'image_cropping' => 0,\r\r\n 'cachinginterval' => 1440\r\r\n );\r\r\n\r\r\n\r\r\n /* Compatibility Options */\r\r\n\r\r\n// CSS and JS\r\r\n $options['asp_compatibility_def'] = array(\r\r\n 'jsminified' => 1,\r\r\n 'js_source' => \"min\",\r\r\n 'js_source_def' => array(\r\r\n array('option' => 'Non minified', 'value' => 'nomin'),\r\r\n array('option' => 'Minified', 'value' => 'min'),\r\r\n array('option' => 'Non-minified scoped', 'value' => 'nomin-scoped'),\r\r\n array('option' => 'Minified scoped', 'value' => 'min-scoped'),\r\r\n ),\r\r\n 'js_init' => \"dynamic\",\r\r\n 'load_in_footer' => 1,\r\r\n 'detect_ajax' => 0,\r\r\n 'js_retain_popstate' => 0,\r\r\n 'js_fix_duplicates' => 1,\r\r\n 'css_compatibility_level' => \"medium\",\r\r\n 'forceinlinestyles' => 0,\r\r\n 'css_async_load' => 0,\r\r\n 'css_minify' => 0,\r\r\n 'usetimbthumb' => 1,\r\r\n 'usecustomajaxhandler' => 0,\r\r\n 'old_browser_compatibility' => 1,\r\r\n\r\r\n // JS and CSS load\r\r\n 'load_google_fonts' => 1,\r\r\n 'loadpolaroidjs' => 1,\r\r\n 'load_mcustom_js' => 'yes',\r\r\n 'load_isotope_js' => 1,\r\r\n 'load_datepicker_js' => 1,\r\r\n 'load_chosen_js' => 1,\r\r\n 'load_lazy_js' => 0,\r\r\n 'load_noui_js' => 1,\r\r\n 'selective_enabled' => 0,\r\r\n 'selective_front' => 1,\r\r\n 'selective_archive' => 1,\r\r\n 'selective_exin_logic' => 'exclude',\r\r\n 'selective_exin' => '',\r\r\n\r\r\n // Query options\r\r\n 'db_force_case_selects' => array(\r\r\n array('option' => 'None', 'value' => 'none'),\r\r\n array('option' => 'Sensitivity', 'value' => 'sensitivity'),\r\r\n array('option' => 'InSensitivity', 'value' => 'insensitivity')\r\r\n ),\r\r\n 'use_acf_getfield' => 1,\r\r\n 'db_force_case' => 'none',\r\r\n 'db_force_unicode' => 0,\r\r\n 'db_force_utf8_like' => 0,\r\r\n\r\r\n // Other options\r\r\n 'meta_box_post_types' => 'post|page|product'\r\r\n );\r\r\n\r\r\n // MISC\r\r\n $_frontend_fields = array(\r\r\n 'exact' => 'Exact matches only',\r\r\n 'title' => 'Search in title',\r\r\n 'content' => 'Search in content',\r\r\n 'excerpt' => 'Search in excerpt'\r\r\n );\r\r\n\r\r\n // Content type filter defaults\r\r\n $_content_type_filter = array(\r\r\n 'any' => 'Choose One/Select all',\r\r\n 'cpt' => 'Custom post types',\r\r\n 'comments' => 'Comments',\r\r\n 'taxonomies' => 'Taxonomy terms',\r\r\n 'users' => 'Users',\r\r\n 'blogs' => 'Multisite blogs',\r\r\n 'buddypress' => 'BuddyPress content',\r\r\n 'attachments' => 'Attachments'\r\r\n );\r\r\n\r\r\n\r\r\n /* Default new search options */\r\r\n $options['asp_defaults'] = array(\r\r\n// General options\r\r\n\r\r\n // Generic\r\r\n 'owner' => 0, // Ownership 0, aka any administrator\r\r\n\r\r\n // Behavior\r\r\n 'search_engine' => 'regular',\r\r\n 'trigger_on_facet' => 1,\r\r\n 'triggerontype' => 1,\r\r\n 'charcount' => 0,\r\r\n 'res_live_search' => 0,\r\r\n 'res_live_selector' => '#main',\r\r\n 'trigger_delay' => 300, // invisible\r\r\n 'autocomplete_trigger_delay' => 310, // invisible\r\r\n 'click_action' => 'ajax_search', // ajax_search, first_result, results_page, woo_results_page, custom_url\r\r\n 'return_action' => 'ajax_search', // ajax_search, first_result, results_page, woo_results_page, custom_url\r\r\n 'click_action_location' => 'same',\r\r\n 'return_action_location' => 'same',\r\r\n 'redirect_url' => '?s={phrase}',\r\r\n 'override_default_results' => 1,\r\r\n 'override_method' => 'get',\r\r\n\r\r\n // Mobile Behavior\r\r\n 'mob_display_search' => 1,\r\r\n 'desktop_display_search' => 1,\r\r\n 'mob_trigger_on_type' => 1,\r\r\n 'mob_click_action' => 'same', // ajax_search, first_result, results_page, woo_results_page, custom_url\r\r\n 'mob_return_action' => 'same', // ajax_search, first_result, results_page, woo_results_page, custom_url\r\r\n 'mob_click_action_location' => 'same',\r\r\n 'mob_return_action_location' => 'same',\r\r\n 'mob_redirect_url' => '?s={phrase}',\r\r\n 'mob_hide_keyboard' => 1,\r\r\n 'mob_force_res_hover' => 0,\r\r\n 'mob_force_sett_hover' => 0,\r\r\n 'mob_force_sett_state' => 'closed',\r\r\n\r\r\n 'customtypes' => array('post', 'page'),\r\r\n 'searchinproducts' => 1,\r\r\n 'searchintitle' => 1,\r\r\n 'searchincontent' => 1,\r\r\n 'searchincomments' => 0,\r\r\n 'searchinexcerpt' => 1,\r\r\n 'search_in_permalinks' => 0,\r\r\n 'search_in_ids' => 0,\r\r\n 'search_all_cf' => 0,\r\r\n 'customfields' => \"\",\r\r\n 'searchinbpusers' => 0,\r\r\n 'searchinbpgroups' => 0,\r\r\n 'searchinbpforums' => 0,\r\r\n 'post_status' => 'publish',\r\r\n 'exactonly' => 0,\r\r\n 'exact_m_secondary' => 0,\r\r\n 'exact_match_location' => 'anywhere',\r\r\n 'min_word_length' => 2,\r\r\n 'searchinterms' => 0,\r\r\n\r\r\n// General/Sources 2\r\r\n 'return_categories' => 0,\r\r\n 'return_tags' => 0,\r\r\n 'return_terms' => '',\r\r\n 'search_term_meta' => 0,\r\r\n 'search_term_titles' => 1,\r\r\n 'search_term_descriptions' => 1,\r\r\n 'display_number_posts_affected' => 0,\r\r\n 'return_terms_exclude_empty' => 0,\r\r\n 'return_terms_exclude' => '',\r\r\n\r\r\n// General / Attachments\r\r\n 'attachments_use_index' => 'regular',\r\r\n 'return_attachments' => 0,\r\r\n 'search_attachments_title' => 1,\r\r\n 'search_attachments_content' => 1,\r\r\n 'search_attachments_caption' => 1,\r\r\n 'search_attachments_terms' => 0,\r\r\n 'search_attachments_ids' => 1,\r\r\n 'search_attachments_cf_filters' => 0,\r\r\n// base64: image/jpeg, image/gif, image/png, image/tiff, image/x-icon\r\r\n 'attachment_mime_types' => 'aW1hZ2UvanBlZywgaW1hZ2UvZ2lmLCBpbWFnZS9wbmcsIGltYWdlL3RpZmYsIGltYWdlL3gtaWNvbg==',\r\r\n 'attachment_use_image' => 1,\r\r\n 'attachment_link_to' => 'page',\r\r\n 'attachment_link_to_secondary' => 'page',\r\r\n 'attachment_exclude' => \"\",\r\r\n\r\r\n// General / Ordering\r\r\n 'use_post_type_order' => 0,\r\r\n 'post_type_order' => get_post_types(array(\r\r\n \"public\" => true,\r\r\n \"_builtin\" => false\r\r\n ), \"names\", \"OR\"),\r\r\n 'results_order' => 'terms|blogs|bp_activities|comments|bp_groups|bp_users|post_page_cpt|attachments|peepso_groups|peepso_activities',\r\r\n\r\r\n// General / Grouping\r\r\n 'groupby_cpt_title' => 0,\r\r\n 'groupby_term_title' => 0,\r\r\n 'groupby_user_title' => 0,\r\r\n 'groupby_attachment_title' => 0,\r\r\n\r\r\n// General/Limits\r\r\n 'posts_limit' => 10,\r\r\n 'posts_limit_override' => 50,\r\r\n 'posts_limit_distribute' => 0,\r\r\n 'results_per_page' => 10,\r\r\n 'taxonomies_limit' => 10,\r\r\n 'taxonomies_limit_override' => 20,\r\r\n 'users_limit' => 10,\r\r\n 'users_limit_override' => 20,\r\r\n 'blogs_limit' => 10,\r\r\n 'blogs_limit_override' => 20,\r\r\n 'buddypress_limit' => 10,\r\r\n 'buddypress_limit_override' => 20,\r\r\n 'comments_limit' => 10,\r\r\n 'comments_limit_override' => 20,\r\r\n 'attachments_limit' => 10,\r\r\n 'attachments_limit_override' => 20,\r\r\n 'peepso_groups_limit' => 10,\r\r\n 'peepso_groups_limit_override' => 20,\r\r\n 'peepso_activities_limit' => 10,\r\r\n 'peepso_activities_limit_override' => 20,\r\r\n\r\r\n 'keyword_logic' => 'and',\r\r\n 'secondary_kw_logic' => 'none',\r\r\n\r\r\n 'orderby_primary' => 'relevance DESC',\r\r\n 'orderby' => 'post_date DESC',\r\r\n 'orderby_primary_cf' => '',\r\r\n 'orderby_secondary_cf' => '',\r\r\n 'orderby_primary_cf_type' => 'numeric',\r\r\n 'orderby_secondary_cf_type' => 'numeric',\r\r\n\r\r\n// General/Image\r\r\n 'show_images' => 1,\r\r\n 'image_transparency' => 1,\r\r\n 'image_bg_color' => \"#FFFFFF\",\r\r\n 'image_width' => 70,\r\r\n 'image_height' => 70,\r\r\n 'image_display_mode' => 'cover',\r\r\n 'image_apply_content_filter' => 0,\r\r\n\r\r\n 'image_sources' => array(\r\r\n array('option' => 'Featured image', 'value' => 'featured'),\r\r\n array('option' => 'Post Content', 'value' => 'content'),\r\r\n array('option' => 'Post Excerpt', 'value' => 'excerpt'),\r\r\n array('option' => 'Custom field', 'value' => 'custom'),\r\r\n array('option' => 'Page Screenshot', 'value' => 'screenshot'),\r\r\n array('option' => 'Default image', 'value' => 'default'),\r\r\n array('option' => 'Post format icon', 'value' => 'post_format'),\r\r\n array('option' => 'Disabled', 'value' => 'disabled')\r\r\n ),\r\r\n\r\r\n 'image_source1' => 'featured',\r\r\n 'image_source2' => 'content',\r\r\n 'image_source3' => 'excerpt',\r\r\n 'image_source4' => 'custom',\r\r\n 'image_source5' => 'default',\r\r\n\r\r\n 'image_source_featured' => 'original',\r\r\n\r\r\n 'image_default' => \"\",\r\r\n 'image_custom_field' => '',\r\r\n 'use_timthumb' => 1,\r\r\n\r\r\n /* BuddyPress Options */\r\r\n 'search_in_bp_activities' => 0,\r\r\n 'search_in_bp_groups' => 0,\r\r\n 'search_in_bp_groups_public' => 0,\r\r\n 'search_in_bp_groups_private' => 0,\r\r\n 'search_in_bp_groups_hidden' => 0,\r\r\n\r\r\n /* Peepso */\r\r\n 'peep_gs_public' => 0,\r\r\n 'peep_gs_closed' => 0,\r\r\n 'peep_gs_secret' => 0,\r\r\n 'peep_gs_title' => 1,\r\r\n 'peep_gs_content' => 1,\r\r\n 'peep_gs_categories' => 0,\r\r\n 'peep_gs_exclude' => '',\r\r\n 'peep_s_posts' => 0,\r\r\n 'peep_s_comments' => 0,\r\r\n 'peep_pc_follow' => 0,\r\r\n 'peep_pc_public' => 1,\r\r\n 'peep_pc_closed' => 0,\r\r\n 'peep_pc_secret' => 0,\r\r\n\r\r\n /* User Search Options */\r\r\n 'user_search' => 0,\r\r\n 'user_login_search' => 1,\r\r\n 'user_display_name_search' => 1,\r\r\n 'user_first_name_search' => 1,\r\r\n 'user_last_name_search' => 1,\r\r\n 'user_bio_search' => 1,\r\r\n 'user_email_search' => 0,\r\r\n 'user_orderby_primary' => 'relevance DESC',\r\r\n 'user_orderby_secondary' => 'date DESC',\r\r\n 'user_orderby_primary_cf' => '',\r\r\n 'user_orderby_secondary_cf' => '',\r\r\n 'user_orderby_primary_cf_type' => 'numeric',\r\r\n 'user_orderby_secondary_cf_type' => 'numeric',\r\r\n 'user_search_exclude_roles' => \"\",\r\r\n \"user_search_exclude_users\" => array(\r\r\n \"op_type\" => \"exclude\",\r\r\n \"users\" => array(),\r\r\n \"un_checked\" => array() // store unchecked instead of checked, less overhead\r\r\n ),\r\r\n 'user_search_display_images' => 1,\r\r\n 'user_search_image_source' => 'default',\r\r\n 'user_search_meta_fields' => array(),\r\r\n 'user_bp_fields' => \"\",\r\r\n 'user_search_title_field' => 'display_name',\r\r\n 'user_search_description_field' => 'bio',\r\r\n 'user_search_advanced_title_field' => '{titlefield}',\r\r\n 'user_search_advanced_description_field' => '{descriptionfield}',\r\r\n 'user_search_redirect_to_custom_url' => 0,\r\r\n 'user_search_url_source' => 'default',\r\r\n 'user_search_custom_url' => '?author={USER_ID}',\r\r\n\r\r\n\r\r\n /* Multisite Options */\r\r\n 'searchinblogtitles' => 0,\r\r\n 'blogresultstext' => \"Blogs\",\r\r\n 'blogs' => \"\",\r\r\n\r\r\n /* Frontend search settings Options */\r\r\n// suggestions\r\r\n 'frontend_show_suggestions' => 0,\r\r\n 'frontend_suggestions_text' => \"Try these:\",\r\r\n 'frontend_suggestions_text_color' => \"rgb(85, 85, 85)\",\r\r\n 'frontend_suggestions_keywords' => \"phrase 1, phrase 2, phrase 3\",\r\r\n 'frontend_suggestions_keywords_color' => \"rgb(255, 181, 86)\",\r\r\n\r\r\n // date\r\r\n 'date_filter_from' => 'disabled|2018-01-01|0,0,0',\r\r\n 'date_filter_from_t' => 'Content from',\r\r\n 'date_filter_from_placeholder' => 'Choose date',\r\r\n 'date_filter_from_format' => 'dd-mm-yy',\r\r\n 'date_filter_to' => 'disabled|2018-01-01|0,0,0',\r\r\n 'date_filter_to_t' => 'Content to',\r\r\n 'date_filter_to_placeholder' => 'Choose date',\r\r\n 'date_filter_to_format' => 'dd-mm-yy',\r\r\n\r\r\n// general\r\r\n 'show_frontend_search_settings' => 0,\r\r\n 'frontend_search_settings_visible' => 0,\r\r\n 'frontend_search_settings_position' => 'hover',\r\r\n 'fss_hide_on_results' => 0,\r\r\n\r\r\n 'fss_column_layout' => 'flex',\r\r\n\r\r\n 'fss_hover_columns' => 1,\r\r\n 'fss_block_columns' => \"auto\",\r\r\n 'fss_column_width' => 200,\r\r\n\r\r\n 'searchinbpuserstext' => \"Search in users\",\r\r\n 'searchinbpgroupstext' => \"Search in groups\",\r\r\n 'searchinbpforumstext' => \"Search in forums\",\r\r\n\r\r\n 'showcustomtypes' => '',\r\r\n 'custom_types_label' => 'Filter by Custom Post Type',\r\r\n 'cpt_display_mode' => 'checkboxes',\r\r\n 'cpt_filter_default' => 'post',\r\r\n 'cpt_cbx_show_select_all' => 0,\r\r\n 'cpt_cbx_show_select_all_text' => 'Select all',\r\r\n\r\r\n 'show_frontend_tags' => \"0|checkboxes|all|checked|||\",\r\r\n 'frontend_tags_placeholder' => 'Select tags',\r\r\n 'frontend_tags_header' => \"Filter by Tags\",\r\r\n 'frontend_tags_logic' => \"or\",\r\r\n 'frontend_tags_empty' => 0,\r\r\n\r\r\n 'display_all_tags_option' => 0,\r\r\n 'all_tags_opt_text' => 'All tags',\r\r\n 'display_all_tags_check_opt' => 0,\r\r\n 'all_tags_check_opt_state' => 'checked',\r\r\n 'all_tags_check_opt_text' => 'Check/uncheck all',\r\r\n\r\r\n 'settings_boxes_height' => \"220px\",\r\r\n 'showsearchintaxonomies' => 1,\r\r\n //'terms_display_mode' => \"checkboxes\",\r\r\n\r\r\n //'showterms' => \"\",\r\r\n 'generic_filter_label' => 'Generic filters',\r\r\n 'frontend_fields' => array(\r\r\n 'display_mode' => 'checkboxes', // checkboxes, dropdown, radio\r\r\n 'labels' => $_frontend_fields, // This is overwritten on save\r\r\n 'selected' => array('exact'),\r\r\n 'unselected' => array('title', 'content', 'excerpt'),\r\r\n 'checked' => array('title', 'content', 'excerpt')\r\r\n ),\r\r\n\r\r\n 'content_type_filter_label' => 'Filter by content type',\r\r\n 'content_type_filter' => array(\r\r\n 'display_mode' => 'checkboxes', // checkboxes, dropdown, radio\r\r\n 'labels' => $_content_type_filter, // This is overwritten on save\r\r\n 'selected' => array(),\r\r\n 'unselected' => array(),\r\r\n 'checked' => array()\r\r\n ),\r\r\n\r\r\n \"show_terms\" => array(\r\r\n \"op_type\" => \"include\",\r\r\n \"separate_filter_boxes\" => 1,\r\r\n \"display_mode\" => array(),\r\r\n \"terms\" => array(),\r\r\n \"un_checked\" => array() // store unchecked instead of checked, less overhead\r\r\n ),\r\r\n\r\r\n // Search button\r\r\n 'fe_search_button' => 0,\r\r\n 'fe_sb_action' => 'ajax_search',\r\r\n 'fe_sb_action_location' => 'same',\r\r\n 'fe_sb_redirect_url' => '?s={phrase}',\r\r\n 'fe_sb_text' => 'Search!',\r\r\n 'fe_sb_align' => 'center',\r\r\n 'fe_sb_padding' => '6px 14px 6px 14px',\r\r\n 'fe_sb_margin' => '4px 0 0 0',\r\r\n 'fe_sb_bg' => 'rgb(212, 58, 50)',\r\r\n 'fe_sb_border' => 'border:1px solid rgb(179, 51, 51);border-radius:3px 3px 3px 3px;',\r\r\n 'fe_sb_boxshadow' => 'box-shadow:0px 0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'fe_sb_font' => 'font-weight:normal;font-family:Open Sans;color:rgb(255, 255, 255);font-size:13px;line-height:16px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n\r\r\n // Reset button\r\r\n 'fe_reset_button' => 0,\r\r\n 'fe_rb_text' => 'Reset',\r\r\n 'fe_rb_action' => 'nothing',\r\r\n 'fe_rb_position' => 'before',\r\r\n 'fe_rb_align' => 'center',\r\r\n 'fe_rb_padding' => '6px 14px 6px 14px',\r\r\n 'fe_rb_margin' => '4px 0 0 0',\r\r\n 'fe_rb_bg' => 'rgb(255, 255, 255)',\r\r\n 'fe_rb_border' => 'border:1px solid rgb(179, 51, 51);border-radius:0px 0px 0px 0px;',\r\r\n 'fe_rb_boxshadow' => 'box-shadow:0px 0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'fe_rb_font' => 'font-weight:normal;font-family:Open Sans;color:rgb(179, 51, 51);font-size:13px;line-height:16px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n\r\r\n 'term_logic' => 'and',\r\r\n 'taxonomy_logic' => 'and',\r\r\n 'frontend_terms_empty' => 1,\r\r\n 'frontend_terms_ignore_empty' => 1,\r\r\n 'frontend_term_hierarchy' => 1,\r\r\n 'frontend_term_order' => 'name||ASC',\r\r\n 'custom_field_items' => '',\r\r\n 'cf_null_values' => 0,\r\r\n 'cf_logic' => 'AND',\r\r\n 'cf_allow_null' => 0,\r\r\n 'field_order' => 'general|custom_post_types|custom_fields|categories_terms|post_tags|date_filters|search_button',\r\r\n\r\r\n /* Layout Options */\r\r\n // Search box\r\r\n 'defaultsearchtext' => 'Search here...',\r\r\n 'box_alignment' => 'inherit',\r\r\n 'box_sett_hide_box' => 0,\r\r\n 'auto_populate' => 'disabled',\r\r\n 'auto_populate_phrase' => '',\r\r\n 'auto_populate_count' => 10,\r\r\n\r\r\n 'resultstype' => 'vertical',\r\r\n 'resultsposition' => 'hover',\r\r\n 'results_snap_to' => 'left',\r\r\n 'results_margin' => '12px 0 0 0',\r\r\n 'results_width' => 'auto',\r\r\n 'results_width_phone' => 'auto',\r\r\n 'results_width_tablet' => 'auto',\r\r\n\r\r\n 'results_top_box' => 0,\r\r\n 'results_top_box_text' => 'Results for <strong>{phrase}</strong> (<strong>{results_count}</strong> of <strong>{results_count_total}</strong>)',\r\r\n 'results_top_box_text_nophrase' => 'Displaying <strong>{results_count}</strong> results of <strong>{results_count_total}</strong>',\r\r\n\r\r\n 'showmoreresults' => 0,\r\r\n 'showmoreresultstext' => 'More results...',\r\r\n 'more_results_infinite' => 1,\r\r\n 'more_results_action' => 'ajax', // ajax, redirect, results_page, woo_results_page\r\r\n 'more_redirect_url' => '?s={phrase}',\r\r\n 'more_redirect_location' => 'same',\r\r\n 'showmorefont' => 'font-weight:normal;font-family:Open Sans;color:rgba(5, 94, 148, 1);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'showmorefont_bg' => '#FFFFFF',\r\r\n\r\r\n 'results_click_blank' => 0,\r\r\n 'scroll_to_results' => 0,\r\r\n 'resultareaclickable' => 1,\r\r\n 'close_on_document_click' => 1,\r\r\n 'show_close_icon' => 1,\r\r\n 'showauthor' => 0,\r\r\n 'author_field' => \"display_name\",\r\r\n 'showdate' => 0,\r\r\n 'custom_date' => 0,\r\r\n 'custom_date_format' => \"Y-m-d H:i:s\",\r\r\n 'showdescription' => 1,\r\r\n 'descriptionlength' => 130,\r\r\n 'description_context' => 0,\r\r\n 'description_context_depth' => 10000,\r\r\n 'noresultstext' => 'No results[ for \"{phrase}\"]!',\r\r\n 'didyoumeantext' => \"Did you mean:\",\r\r\n 'highlight' => 0,\r\r\n 'highlightwholewords' => 1,\r\r\n 'highlightcolor' => \"#d9312b\",\r\r\n 'highlightbgcolor' => \"#eee\",\r\r\n\r\r\n /* Layout Options / Compact Search Layout */\r\r\n 'box_compact_layout' => 0,\r\r\n 'box_compact_close_on_magn' => 1,\r\r\n 'box_compact_close_on_document' => 0,\r\r\n 'box_compact_width' => \"100%\",\r\r\n 'box_compact_width_tablet' => \"480px\",\r\r\n 'box_compact_width_phone' => \"320px\",\r\r\n 'box_compact_overlay' => 0,\r\r\n 'box_compact_overlay_color' => \"rgba(255, 255, 255, 0.5)\",\r\r\n 'box_compact_float' => \"inherit\",\r\r\n 'box_compact_position' => \"static\",\r\r\n 'box_compact_screen_position' => '||20%||auto||0px||auto||',\r\r\n 'box_compact_position_z' => '1000',\r\r\n\r\r\n /* Autocomplete & Keyword suggestion options */\r\r\n 'keywordsuggestions' => 1,\r\r\n 'keyword_suggestion_source' => 'google',\r\r\n 'kws_google_places_api' => '',\r\r\n 'keywordsuggestionslang' => \"en\",\r\r\n 'keyword_suggestion_count' => 10,\r\r\n 'keyword_suggestion_length' => 60,\r\r\n\r\r\n 'autocomplete' => 1,\r\r\n 'autocomplete_mode' => 'input',\r\r\n 'autocomplete_instant' => 'auto',\r\r\n 'autocomplete_instant_limit' => 1500,\r\r\n 'autocomplete_instant_status' => 0,\r\r\n 'autocomplete_instant_gen_config' => '',\r\r\n 'autocomplete_source' => 'google',\r\r\n 'autocompleteexceptions' => '',\r\r\n 'autoc_google_places_api' => '',\r\r\n 'autocomplete_length' => 60,\r\r\n 'autocomplete_google_lang' => \"en\",\r\r\n\r\r\n// Advanced Options - Content\r\r\n 'striptagsexclude' => '<abbr><b>',\r\r\n 'shortcode_op' => 'remove',\r\r\n\r\r\n 'primary_titlefield' => 0,\r\r\n 'primary_titlefield_cf' => '',\r\r\n 'secondary_titlefield' => -1,\r\r\n 'secondary_titlefield_cf' => '',\r\r\n\r\r\n 'primary_descriptionfield' => 1,\r\r\n 'primary_descriptionfield_cf' => '',\r\r\n 'secondary_descriptionfield' => 0,\r\r\n 'secondary_descriptionfield_cf' => '',\r\r\n\r\r\n 'advtitlefield' => '{titlefield}',\r\r\n 'advdescriptionfield' => '{descriptionfield}',\r\r\n\r\r\n \"exclude_content_by_users\" => array(\r\r\n \"op_type\" => \"exclude\",\r\r\n \"users\" => array(),\r\r\n \"un_checked\" => array() // store unchecked instead of checked, less overhead\r\r\n ),\r\r\n\r\r\n 'exclude_post_tags' => '',\r\r\n //'excludeterms' => '',\r\r\n 'exclude_by_terms' => array(\r\r\n \"op_type\" => \"exclude\",\r\r\n \"separate_filter_boxes\" => 0,\r\r\n \"display_mode\" => array(),\r\r\n \"terms\" => array(),\r\r\n \"un_checked\" => array()\r\r\n ),\r\r\n 'include_by_terms' => array(\r\r\n \"op_type\" => \"include\",\r\r\n \"separate_filter_boxes\" => 0,\r\r\n \"display_mode\" => array(),\r\r\n \"terms\" => array(),\r\r\n \"un_checked\" => array()\r\r\n ),\r\r\n 'excludeposts' => '',\r\r\n 'exclude_dates' => \"exclude|disabled|date|2000-01-01|2000-01-01|0,0,0|0,0,0\",\r\r\n 'exclude_dates_on' => 0,\r\r\n\r\r\n 'exclude_cpt' => array(\r\r\n 'ids' => array(),\r\r\n 'parent_ids' => array(),\r\r\n 'op_type' => 'exclude'\r\r\n ),\r\r\n\r\r\n// Advanced Options - Grouping\r\r\n 'group_by' => 'none',\r\r\n 'group_header_prefix' => 'Results from',\r\r\n 'group_header_suffix' => '',\r\r\n\r\r\n \"groupby_terms\" => array(\r\r\n \"op_type\" => \"include\",\r\r\n \"terms\" => array(),\r\r\n \"ex_terms\" => array(),\r\r\n \"un_checked\" => array() // store unchecked instead of checked, less overhead\r\r\n ),\r\r\n //\"selected-groupby_terms\" => array(),\r\r\n\r\r\n 'groupby_cpt' => array(),\r\r\n\r\r\n \"groupby_content_type\" => array(\r\r\n \"terms\" => \"Taxonomy Terms\",\r\r\n \"blogs\" => \"Blogs\",\r\r\n \"bp_activities\" => \"BuddyPress Activities\",\r\r\n \"comments\" => \"Comments\",\r\r\n \"bp_groups\" => \"BuddyPress groups\",\r\r\n \"users\" => \"Users\",\r\r\n \"post_page_cpt\" => \"Blog Content\",\r\r\n \"attachments\" => \"Attachments\",\r\r\n 'peepso_groups' => 'Peepso Groups',\r\r\n 'peepso_activities' => 'Peepso Activities'\r\r\n ),\r\r\n\r\r\n 'group_result_no_group' => 'display',\r\r\n 'group_other_location' => 'bottom',\r\r\n 'group_other_results_head' => 'Other results',\r\r\n 'group_exclude_duplicates' => 0,\r\r\n\r\r\n 'excludewoocommerceskus' => 0,\r\r\n 'group_result_count' => 1,\r\r\n 'group_show_empty' => 0,\r\r\n 'group_show_empty_position' => 'default', // default, bottom, top\r\r\n\r\r\n 'wpml_compatibility' => 1,\r\r\n 'polylang_compatibility' => 1,\r\r\n\r\r\n// Advanced Options - Visibility\r\r\n 'visual_detect_visbility' => 0,\r\r\n// Advanced Options - Other options\r\r\n 'jquery_chosen_nores' => 'No results match',\r\r\n// Advanced Options - Animations\r\r\n// Desktop\r\r\n 'sett_box_animation' => \"fadedrop\",\r\r\n 'sett_box_animation_duration' => 300,\r\r\n 'res_box_animation' => \"fadedrop\",\r\r\n 'res_box_animation_duration' => 300,\r\r\n 'res_items_animation' => \"fadeInDown\",\r\r\n// Mobile\r\r\n 'sett_box_animation_m' => \"fadedrop\",\r\r\n 'sett_box_animation_duration_m' => 300,\r\r\n 'res_box_animation_m' => \"fadedrop\",\r\r\n 'res_box_animation_duration_m' => 300,\r\r\n 'res_items_animation_m' => \"voidanim\",\r\r\n\r\r\n // Exceptions\r\r\n 'kw_exceptions' => \"\",\r\r\n 'kw_exceptions_e' => \"\",\r\r\n\r\r\n /* Theme options */\r\r\n 'themes' => 'Lite version - Simple red (default)',\r\r\n\r\r\n 'box_width' => '100%',\r\r\n 'box_width_tablet' => '100%',\r\r\n 'box_width_phone' => '100%',\r\r\n 'boxheight' => '34px',\r\r\n 'boxmargin' => '0px',\r\r\n 'boxbackground' => '0-60-rgb(225, 99, 92)-rgb(225, 99, 92)',\r\r\n 'boxborder' => 'border:0px none rgb(141, 213, 239);border-radius:0px 0px 0px 0px;',\r\r\n 'boxshadow' => 'box-shadow:0px 0px 0px 0px #000000 ;',\r\r\n\r\r\n 'inputbackground' => '0-60-rgb(225, 99, 92)-rgb(225, 99, 92)',\r\r\n 'inputborder' => 'border:0px solid rgb(104, 174, 199);border-radius:0px 0px 0px 0px;',\r\r\n 'inputshadow' => 'box-shadow:0px 0px 0px 0px rgb(181, 181, 181) inset;',\r\r\n 'inputfont' => 'font-weight:normal;font-family:Open Sans;color:rgb(255, 255, 255);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n\r\r\n 'settingsimagepos' => 'right',\r\r\n 'settingsimage' => 'ajax-search-pro/img/svg/control-panel/cp4.svg',\r\r\n 'settingsimage_color' => 'rgb(255, 255, 255)',\r\r\n 'settingsbackground' => '1-185-rgb(190, 76, 70)-rgb(190, 76, 70)',\r\r\n 'settingsbackgroundborder' => 'border:0px solid rgb(104, 174, 199);border-radius:0px 0px 0px 0px;',\r\r\n 'settingsboxshadow' => 'box-shadow:0px 0px 0px 0px rgba(255, 255, 255, 0.63) ;',\r\r\n\r\r\n 'settingsdropbackground' => '1-185-rgb(190, 76, 70)-rgb(190, 76, 70)',\r\r\n 'settingsdropboxshadow' => 'box-shadow:0px 0px 0px 0px rgb(0, 0, 0) ;',\r\r\n 'settingsdropfont' => 'font-weight:bold;font-family:Open Sans;color:rgb(255, 255, 255);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'exsearchincategoriestextfont' => 'font-weight:normal;font-family:Open Sans;color:rgb(31, 31, 31);font-size:13px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'settingsdroptickcolor' => 'rgb(255, 255, 255)',\r\r\n 'settingsdroptickbggradient' => '1-180-rgb(34, 34, 34)-rgb(69, 72, 77)',\r\r\n\r\r\n 'magnifier_position' => 'right',\r\r\n 'magnifierimage' => 'ajax-search-pro/img/svg/magnifiers/magn6.svg',\r\r\n 'magnifierimage_color' => 'rgb(255, 255, 255)',\r\r\n 'magnifierbackground' => '1-180-rgb(190, 76, 70)-rgb(190, 76, 70)',\r\r\n 'magnifierbackgroundborder' => 'border:0px solid rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',\r\r\n 'magnifierboxshadow' => 'box-shadow:0px 0px 0px 0px rgba(255, 255, 255, 0.61) ;',\r\r\n\r\r\n 'close_icon_background' => 'rgb(51, 51, 51)',\r\r\n 'close_icon_fill' => 'rgb(254, 254, 254)',\r\r\n 'close_icon_outline' => 'rgba(255, 255, 255, 0.9)',\r\r\n\r\r\n 'loader_display_location' => 'auto',\r\r\n 'loader_image' => 'simple-circle',\r\r\n 'loadingimage_color' => 'rgb(255, 255, 255)',\r\r\n\r\r\n// Theme options - Search Text Button\r\r\n 'display_search_text' => '0',\r\r\n 'hide_magnifier' => '0',\r\r\n 'search_text' => \"Search\",\r\r\n 'search_text_position' => 'right',\r\r\n 'search_text_font' => 'font-weight:normal;font-family:Open Sans;color:rgba(51, 51, 51, 1);font-size:15px;line-height:normal;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n\r\r\n// Theme options - Results Information Box\r\r\n 'ritb_font' => 'font-weight:normal;font-family:Open Sans;color:rgb(74, 74, 74);font-size:13px;line-height:16px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'ritb_padding' => '6px 12px 6px 12px',\r\r\n 'ritb_margin' => '0 0 4px 0',\r\r\n 'ritb_bg' => 'rgb(255, 255, 255)',\r\r\n 'ritb_border' => 'border:1px none rgb(81, 81, 81);border-radius:0px 0px 0px 0px;',\r\r\n\r\r\n 'vresultinanim' => 'rollIn',\r\r\n 'vresulthbg' => '0-60-rgb(245, 245, 245)-rgb(245, 245, 245)',\r\r\n 'resultsborder' => 'border:0px none #000000;border-radius:0px 0px 0px 0px;',\r\r\n 'resultshadow' => 'box-shadow:0px 0px 0px 0px #000000 ;',\r\r\n 'resultsbackground' => 'rgb(225, 99, 92)',\r\r\n 'resultscontainerbackground' => 'rgb(255, 255, 255)',\r\r\n 'resultscontentbackground' => '#ffffff',\r\r\n 'titlefont' => 'font-weight:bold;font-family:Open Sans;color:rgba(20, 84, 169, 1);font-size:14px;line-height:20px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'import-titlefont' => \"@import url(https://fonts.googleapis.com/css?family=Open+Sans:300|Open+Sans:400|Open+Sans:700);\",\r\r\n 'titlehoverfont' => 'font-weight:bold;font-family:Open Sans;color:rgb(46, 107, 188);font-size:14px;line-height:20px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'authorfont' => 'font-weight:bold;font-family:Open Sans;color:rgba(161, 161, 161, 1);font-size:12px;line-height:13px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'datefont' => 'font-weight:normal;font-family:Open Sans;color:rgba(173, 173, 173, 1);font-size:12px;line-height:15px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'descfont' => 'font-weight:normal;font-family:Open Sans;color:rgba(74, 74, 74, 1);font-size:13px;line-height:13px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'import-descfont' => \"@import url(https://fonts.googleapis.com/css?family=Lato:300|Lato:400|Lato:700);\",\r\r\n 'groupfont' => 'font-weight:normal;font-family:Open Sans;color:rgba(74, 74, 74, 1);font-size:13px;line-height:13px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'groupingbordercolor' => 'rgb(248, 248, 248)',\r\r\n 'spacercolor' => 'rgba(204, 204, 204, 1)',\r\r\n 'arrowcolor' => 'rgba(10, 63, 77, 1)',\r\r\n 'harrowcolor' => 'rgba(10, 63, 77, 1)',\r\r\n 'overflowcolor' => 'rgba(255, 255, 255, 1)',\r\r\n\r\r\n// Theme options - Vertical results\r\r\n 'resultitemheight' => \"auto\",\r\r\n 'itemscount' => 4,\r\r\n 'v_res_max_height' => 'none',\r\r\n\r\r\n// Theme options - Settings image\r\r\n 'settingsimage_custom' => \"\",\r\r\n 'magnifierimage_custom' => \"\",\r\r\n\r\r\n 'loadingimage' => \"/ajax-search-pro/img/svg/loading/loading-spin.svg\",\r\r\n 'loadingimage_custom' => \"\",\r\r\n\r\r\n 'groupbytextfont' => 'font-weight:bold;font-family:Open Sans;color:rgba(5, 94, 148, 1);font-size:11px;line-height:13px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'exsearchincategoriesboxcolor' => \"rgb(246, 246, 246)\",\r\r\n\r\r\n 'blogtitleorderby' => 'desc',\r\r\n\r\r\n 'hreswidth' => '150px',\r\r\n 'hor_img_height' => '150px',\r\r\n 'horizontal_res_height' => 'auto',\r\r\n 'hressidemargin' => '8px',\r\r\n 'hrespadding' => '7px',\r\r\n 'hresultinanim' => 'bounceIn',\r\r\n 'hboxbg' => '1-60-rgb(225, 99, 92)-rgb(225, 99, 92)',\r\r\n 'hboxborder' => 'border:0px solid rgb(219, 233, 238);border-radius:0px 0px 0px 0px;',\r\r\n 'hboxshadow' => 'box-shadow:0px 0px 4px -3px rgb(0, 0, 0) inset;',\r\r\n 'hresultbg' => '0-60-rgba(255, 255, 255, 1)-rgba(255, 255, 255, 1)',\r\r\n 'hresulthbg' => '0-60-rgba(255, 255, 255, 1)-rgba(255, 255, 255, 1)',\r\r\n 'hresultborder' => 'border:0px none rgb(250, 250, 250);border-radius:0px 0px 0px 0px;',\r\r\n 'hresultshadow' => 'box-shadow:0px 0px 6px -3px rgb(0, 0, 0);',\r\r\n 'hresultimageborder' => 'border:0px none rgb(250, 250, 250);border-radius:0px 0px 0px 0px;',\r\r\n 'hresultimageshadow' => 'box-shadow:0px 0px 9px -6px rgb(0, 0, 0) inset;',\r\r\n 'hhidedesc' => 0,\r\r\n 'hoverflowcolor' => \"rgb(250, 250, 250)\",\r\r\n\r\r\n//Isotopic Syle options\r\r\n 'i_ifnoimage' => \"description\",\r\r\n 'i_item_width' => '200px',\r\r\n 'i_item_width_tablet' => '200px',\r\r\n 'i_item_width_phone' => '200px',\r\r\n 'i_item_height' => '200px',\r\r\n 'i_item_height_tablet' => '200px',\r\r\n 'i_item_height_phone' => '200px',\r\r\n 'i_item_margin' => 5,\r\r\n 'i_res_item_background' => 'rgb(255, 255, 255);',\r\r\n 'i_res_item_content_background' => 'rgba(0, 0, 0, 0.28);',\r\r\n\r\r\n 'i_res_magnifierimage' => \"/ajax-search-pro/img/svg/magnifiers/magn4.svg\",\r\r\n 'i_res_custom_magnifierimage' => \"\",\r\r\n\r\r\n 'i_overlay' => 1,\r\r\n 'i_overlay_blur' => 1,\r\r\n 'i_hide_content' => 1,\r\r\n 'i_animation' => 'bounceIn',\r\r\n 'i_pagination' => 1,\r\r\n 'i_rows' => 2,\r\r\n 'i_res_container_bg' => 'rgba(255, 255, 255, 0);',\r\r\n\r\r\n 'i_pagination_position' => \"top\",\r\r\n 'i_pagination_background' => \"rgb(228, 228, 228);\",\r\r\n 'i_pagination_arrow' => \"/ajax-search-pro/img/svg/arrows/arrow1.svg\",\r\r\n 'i_pagination_arrow_background' => \"rgb(76, 76, 76);\",\r\r\n 'i_pagination_arrow_color' => \"rgb(255, 255, 255);\",\r\r\n 'i_pagination_page_background' => \"rgb(244, 244, 244);\",\r\r\n 'i_pagination_font_color' => \"rgb(126, 126, 126);\",\r\r\n\r\r\n\r\r\n//Polaroid Style options\r\r\n 'pifnoimage' => \"removeres\",\r\r\n 'pshowdesc' => 1,\r\r\n 'prescontainerheight' => '400px',\r\r\n 'preswidth' => '200px',\r\r\n 'presheight' => '300px',\r\r\n 'prespadding' => '25px',\r\r\n 'prestitlefont' => 'font-weight:normal;font-family:Open Sans;color:rgba(167, 160, 162, 1);font-size:16px;line-height:20px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'pressubtitlefont' => 'font-weight:normal;font-family:Open Sans;color:rgba(133, 133, 133, 1);font-size:13px;line-height:18px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'pshowsubtitle' => 0,\r\r\n\r\r\n 'presdescfont' => 'font-weight:normal;font-family:Open Sans;color:rgba(167, 160, 162, 1);font-size:14px;line-height:17px;text-shadow:0px 0px 0px rgba(255, 255, 255, 0);',\r\r\n 'prescontainerbg' => '0-60-rgba(221, 221, 221, 1)-rgba(221, 221, 221, 1)',\r\r\n 'pdotssmallcolor' => '0-60-rgba(170, 170, 170, 1)-rgba(170, 170, 170, 1)',\r\r\n 'pdotscurrentcolor' => '0-60-rgba(136, 136, 136, 1)-rgba(136, 136, 136, 1)',\r\r\n 'pdotsflippedcolor' => '0-60-rgba(85, 85, 85, 1)-rgba(85, 85, 85, 1)',\r\r\n\r\r\n// Custom CSS\r\r\n 'custom_css' => '',\r\r\n 'custom_css_h' => '',\r\r\n 'res_z_index' => 11000,\r\r\n 'sett_z_index' => 11001,\r\r\n\r\r\n//Relevance options\r\r\n 'userelevance' => 1,\r\r\n 'etitleweight' => 10,\r\r\n 'econtentweight' => 9,\r\r\n 'eexcerptweight' => 9,\r\r\n 'etermsweight' => 7,\r\r\n 'titleweight' => 3,\r\r\n 'contentweight' => 2,\r\r\n 'excerptweight' => 2,\r\r\n 'termsweight' => 2,\r\r\n\r\r\n 'it_title_weight' => 100,\r\r\n 'it_content_weight' => 20,\r\r\n 'it_excerpt_weight' => 10,\r\r\n 'it_terms_weight' => 10,\r\r\n 'it_cf_weight' => 8,\r\r\n 'it_author_weight' => 8\r\r\n );\r\r\n\r\r\n}", "public function indexAction()\n {\n\t\techo 'Module Admin IndexController indexAction';\n\t\t\n }", "public function index()\n\t{\n\t\treturn $this->trace->all();\n\t}", "public function index()\n {\n return ApertureLuoghiInteresse::get();\n }", "public function listing();", "function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }", "public function index()\n {\n // READ LISTE\n }", "public function buildIndex();", "function devlyQueries() {\n\t\n\techo 'ran ' . get_num_queries() . ' queries in ' . timer_stop(1) . ' seconds';\n\t\n}", "protected function getReferenceIndexStatus() {}", "public function _before_index(){\n// $ip = get_client_ip();\n// $res = $ip_class->getlocation('113.102.162.102');\n// print_r($res);\n \n \n }" ]
[ "0.6264189", "0.57497406", "0.572629", "0.57121843", "0.5634636", "0.55512", "0.5501181", "0.5459466", "0.544847", "0.544181", "0.541404", "0.5410366", "0.54073673", "0.5402675", "0.53820693", "0.5349936", "0.5331827", "0.53241795", "0.52990115", "0.5262652", "0.5258186", "0.52432084", "0.52386004", "0.52347475", "0.52347475", "0.52347475", "0.5217794", "0.5209989", "0.5204822", "0.5198727", "0.5188993", "0.51813155", "0.51813155", "0.5181215", "0.5177444", "0.51744735", "0.517062", "0.51665324", "0.5164999", "0.51608837", "0.5160434", "0.5155996", "0.5140538", "0.513695", "0.51157206", "0.51080376", "0.50819516", "0.5077176", "0.50744104", "0.5070694", "0.5059035", "0.5059035", "0.5059035", "0.50583947", "0.50583947", "0.50583947", "0.50571585", "0.50563633", "0.50563633", "0.5055793", "0.5054225", "0.5054109", "0.5051506", "0.5049622", "0.5049622", "0.5049622", "0.5048243", "0.5045028", "0.5043764", "0.5036571", "0.5035187", "0.50350577", "0.50271004", "0.5023935", "0.5017577", "0.501468", "0.5013881", "0.49992993", "0.4989735", "0.4979135", "0.49746892", "0.49738014", "0.49738014", "0.4963019", "0.4949551", "0.4947275", "0.49417078", "0.4939116", "0.49362263", "0.49329636", "0.49325585", "0.49296448", "0.49240223", "0.4918238", "0.49180904", "0.49167547", "0.49082434", "0.49028808", "0.48951665", "0.4891906" ]
0.66870064
0
Push a new job onto the queue.
public function push($job, $data = '', $queue = null) { $queue = $this->getQueue($queue); return $this->enqueueUsing( $job, $this->createPayload($job, $queue, $data), $queue, null, function ($payload, $queue) { return $this->pushRaw($payload, $queue); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute() {\n $this->getQueue()->push($this->getJob(), $this->getJobOptions());\n }", "public function pushOn($queue, $job, $data = '');", "abstract public function push($job, $queue = null);", "public function push($job, $data = '', $queue = null);", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "public function push($queue, $jobClass, array $arguments);", "public function queue(Queue $queue, self $messageJob): void\n {\n $queue->pushOn($this->queue, $messageJob);\n }", "public function queueJob(Job $job) {\n $jobKey = $job->getKey();\n\n // add job details to hash for easy lookup of submission time\n $this->client->hset($jobKey, \"submitted\", time());\n $this->client->hset($jobKey, \"submitterId\", $job->getSubmitterId());\n $this->client->hset($jobKey, \"command\", $job->getCommand());\n $this->client->hset($jobKey, \"priority\", $job->getPriority());\n \n // add jobkey to sorted set, which acts as the job queue\n $this->client->zincrby(\"jobqueue\", 1, $jobKey);\n }", "public static function push()\n {\n return <<<'LUA'\n-- Push the job onto the queue...\nredis.call('zadd', KEYS[1], 'NX', ARGV[1], ARGV[2])\n-- Push a notification onto the \"notify\" queue...\nredis.call('rpush', KEYS[2], 1)\nLUA;\n }", "public function push(Token $t)\n {\n if (!isset ($this->queue))\n return;\n \n array_push($this->queue, $t);\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function enqueue()\n {\n }", "public function push();", "public function push();", "public function getNextQueuedJob() {\n \t}", "public function enqueue($element) {\n $this->queue[] = $element;\n }", "public function push($job, $data = '', $queue = null)\n {\n $payload = $this->createPayload($job, $data);\n return $this->pushRaw($payload, $queue);\n }", "public function enqueue() {\n\t}", "public function queue(IElement $element): IJobQueue;", "public static function enqueue();", "public function add() {\n $this->out('CakePHP Queue Example task.');\n $this->hr();\n $this->out('This is a very simple example of a QueueTask.');\n $this->out('I will now add an example Job into the Queue.');\n $this->out('This job will only produce some console output on the worker that it runs on.');\n $this->out(' ');\n $this->out('To run a Worker use:');\n $this->out('\tbin/cake queue runworker');\n $this->out(' ');\n $this->out('You can find the sourcecode of this task in: ');\n $this->out(__FILE__);\n $this->out(' ');\n\n //$options = getopt('',['id:']);\n /*\n * Adding a task of type 'example' with no additionally passed data\n */\n //if ($this->QueuedJobs->createJob('RemittanceApi', ['id'=>4033, 'batch_id'=>'58e44de0f33a7'])) {\n if ($this->QueuedJobs->createJob('RemittanceApi', null)) {\n $this->out('OK, job created, now run the worker');\n } else {\n $this->err('Could not create Job');\n }\n }", "public function push($job, $data = '', $queue = null)\n {\n return $this->pushRaw($this->createPayload($job, $data, $queue), $queue);\n }", "public function push($job, $data = '', $queue = null)\n {\n return $this->pushToDatabase($queue, $this->createPayload(\n $job, $this->getQueue($queue), $data\n ));\n }", "public function enqueue($item)\n {\n array_push($this->array, $item);\n }", "public function push( callable$task ):void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tarray_push( $this->_queue, $task );\n\t\t\n\t\tif( $this->_status === self::STATUSES['DONE'] )\n\t\t\t$this->_status= self::STATUSES['PAUSED'];\n\t}", "public function addNewJobOpo()\n {\n }", "function push($x) {\n return array_push($this->queue,$x);\n }", "abstract public function enqueue($Job, $priority = null);", "public function testReserveQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n\n $this->queue->enqueue($queueJobTest1);\n $result = $this->queue->reserve();\n\n $this->assertInstanceOf(Job::class, $result);\n $this->assertTrue($result->isReserved(Queue::EXPIRATION_TIME));\n $this->assertCount(1, $this->queueStorage->queue);\n }", "public static function enqueueAt($at, $queue, $class, $args = array())\n\t{\n\t\tself::validateJob($class, $queue);\n\n\t\t$job = self::jobToHash($queue, $class, $args);\n\t\tself::delayedPush($at, $job);\n\t\t\n\t\tResque_Event::trigger('afterRepeatSchedule', array(\n\t\t\t'at' => $at,\n\t\t\t'queue' => $queue,\n\t\t\t'class' => $class,\n\t\t\t'args' => $args,\n\t\t));\n\t}", "public function withQueue()\n {\n // You can pass anything you need into the job so there is no worrying about losing\n // access to needed resources when the job is actually running, passing time in as an example\n // but you can pass models in or anything you want really.\n LongTask::dispatch(5);\n Session::flash('success', 'Successfully queued long running task');\n return redirect()->route('queueExample');\n }", "public function pushRecord()\r\n {\r\n\r\n }", "public function AddJobToQueue($url, $args = false, $conn_timeout=30, $rw_timeout=86400) {\n\t\t$index = count($this->_waiting_queue);\n\t\t$this->_waiting_queue[$index] = array('url'=>$url, 'args'=>$args, 'conn_timeout'=>$conn_timeout, 'rw_timeout' =>$rw_timeout);\n\t\t$this->_job_count++;\n\t\treturn $index;\n\t}", "function addNewMyQueue($myqueueName)\r\n {\r\n $time = time(); \r\n $q = \"INSERT INTO \".TBL_MYQUEUE.\" VALUES (NULL, '$myqueueName', $time )\";\r\n return mysql_query($q, $this->connection);\r\n }", "function queue_enqueue(&$queue, $value) { \n // We are just adding a value to the end of the array, so can use the \n // [] PHP Shortcut for this. It's faster than using array_push \n $queue[] = $value; \n}", "public function push($message);", "public function add($item)\n {\n $this->queueItems[] = $item;\n }", "public function push($item)\n {\n if ($this->getCount() == static::MAX_ITEMS) {\n\n throw new QueueException(\"Queue is full\");\n \n }\n \n $this->items[] = $item;\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function dispatchToQueue($command)\n\t{\n\t\t$queue = call_user_func($this->queueResolver);\n\n\t\tif ( ! $queue instanceof Queue)\n\t\t{\n\t\t\tthrow new \\RuntimeException(\"Queue resolver did not return a Queue implementation.\");\n\t\t}\n\n\t\t$queue->push($command);\n\t}", "public function push(callable $callback)\n {\n if ($callback instanceof self) {\n $this->queue = \\array_merge($this->queue, $callback->queue);\n return;\n }\n\n $this->queue[] = $callback;\n }", "function queue_push(JobInterface $job, int $delay = 0, string $key = 'default'): bool\n {\n $driver = di()->get(DriverFactory::class)->get($key);\n return $driver->push($job, $delay);\n }", "public static function pushJob(JobInterface $queue, $content = null): bool {\n $workerJob = new TaskJob();\n\n $beforeSendCallback = $queue->getBeforeSendCallback();\n self::_performCallback($beforeSendCallback, $queue);\n\n if ($queue->getLocale() !== null) {\n I18n::setLocale($queue->getLocale());\n } else {\n I18n::setLocale(Configure::read('Queue.defaultLocale'));\n }\n\n /**\n * @TODO \n * Save in the database\n * and return true or false \n * if is saved \n */\n //$queue->schedule($content);\n echo \"saving job in the database\" . PHP_EOL;\n\n $afterSendCallback = $queue->getAfterSendCallback();\n self::_performCallback($afterSendCallback);\n\n return true;\n }", "public function createQueue();", "public function enqueue($type, $payload = null)\n {\n $job = Job::create($type, $payload);\n\n if ($this->logger) {\n $this->logger->debug(\n 'jobqueue.queue enqueue successful: {job}',\n [\n 'job' => $job,\n ]\n );\n }\n\n $this->send($job);\n }", "public function addJobPosting(JobModel $newJob)\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->addJob($newJob, $userID);\n }", "public function queue(Command $command, $handler = null);", "private function performQueueOperations()\n\t{\n\t\t//$this->queue_manager = high_risk\n\t\t$application_id = $this->application->getModel()->application_id;\n\t\t$qi = $this->queue_manager->getQueue(\"high_risk\")->getNewQueueItem($application_id);\n\t\t$this->queue_manager->moveToQueue($qi, \"high_risk\");\t\t\n\t}", "function enqueue(){\n\t\t}", "public function laterOn($queue, $delay, $job, $data = '');", "function queue() {\n\n\t\t$date = false;\n\t\t$queue = new Queued_Event();\n\t\t$queue->set_workflow_id( $this->get_id() );\n\n\t\tswitch( $this->get_timing_type() ) {\n\n\t\t\tcase 'delayed':\n\t\t\t\t$date = new DateTime();\n\t\t\t\t$date->setTimestamp( time() + $this->get_timing_delay() );\n\t\t\t\tbreak;\n\n\t\t\tcase 'scheduled':\n\t\t\t\t$date = $this->calculate_scheduled_datetime();\n\t\t\t\tbreak;\n\n\t\t\tcase 'fixed':\n\t\t\t\t$date = $this->get_fixed_time();\n\t\t\t\tbreak;\n\n\t\t\tcase 'datetime':\n\t\t\t\t$date = $this->get_variable_time();\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$date = apply_filters( 'automatewoo/workflow/queue_date', $date, $this );\n\n\t\tif ( ! $date ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$queue->set_date_due( $date );\n\t\t$queue->save();\n\n\t\t$queue->store_data_layer( $this->data_layer() ); // add meta data after saved\n\n\t\treturn $queue;\n\t}", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "public function pushToQueue($queue, $message) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('pushToQueue', func_get_args()));\n }", "protected function addJob($command, $commandArgs = array())\n {\n $currJob = $this->em\n ->createQuery(\"SELECT j FROM JMSJobQueueBundle:Job j WHERE j.command = :command AND j.state <> :state\")\n ->setParameter('command', $command)\n ->setParameter('state', Job::STATE_FINISHED)\n ->getOneOrNullResult();\n\n if (!$currJob) {\n $job = new Job($command, $commandArgs);\n $this->insertJob($job);\n }\n\n return $currJob ? $currJob : $job;\n }", "public function StartQueue() {\n\t\t$timestart = microtime(true);\n\t\t$current_job_pointer = 0;\n\t\techo \"Job count is \" .$this->_job_count.\"<br/>\";\n\t\tif ($this->_slots > $this->_job_count) $this->_slots = $this->_job_count;\n\t\tfor ($slotcount=0; $slotcount < $this->_slots + 1; $slotcount++) {\n\t\t\techo \"Finished count is \" . $this->_finished_count . \"<br/>\";\n\t\t\techo \"Slots are \" .$this->_slots . \" <br/>\";\n\t\t\t$this->AddJobs();\n\t\t}\n\n\t\t$loop = 0;\n\t\twhile($this->_finished_count < $this->_job_count) {\n\t\t\techo \"<br/>Loop is $loop<br/>\";\n\t\t\tsleep(1);\n\t\t\t$this->PollJobs();\n\t\t\techo \"Finished count is \" . $this->_finished_count . \"<br/>\";\n\t\t\techo \"Slots are \" .$this->_slots . \"<br/>\";\n\t\t\twhile($this->_slots > 0) {\n\t\t\t\t$this->LogEntry($this->_slots . \" slots left and \".count($this->_waiting_queue).\" jobs waiting. <br/>\");\n\t\t\t\t$this->AddJobs();\n\t\t\t}\n\n\t\t\tif ($this->_vars['timeout'] !== 0) {\n\t\t\t\tif (round(microtime(true) - $timestart) > $this->_vars['timeout']) {\n\t\t\t\t\t$this->LogEntry(\"Timeout reached.\\n\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$loop++;\n\n\t\t}\n\n\t\t$execution = round(microtime(true) - $timestart, 2);\n\t\t$this->LogEntry(\"Finished after $execution seconds. \". $this->_finished_count .\" jobs completed.\\n\");\n\t\treturn $this->_log;\n\t}", "public function testEnqueueQueueJobs()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n $queueJobTest2 = new TestQueueJob('product', 'ShopwareProductExport');\n\n $result = $this->queue->enqueue($queueJobTest1);\n $this->assertTrue($result);\n\n $result = $this->queue->enqueue($queueJobTest2);\n $this->assertTrue($result);\n\n $this->assertCount(2, $this->queueStorage->queue);\n }", "public function enqueue($item)\n {\n $this->items[] = $item;\n }", "public function addJob(JobInterface $job): void\n {\n $this->storage->addJob($job);\n }", "public function addQueue(QueueInterface $queue);", "public function testReservingReservedQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n $queueJobTest2 = new TestQueueJob('product', 'ShopwareProductExport');\n\n $this->queue->enqueue($queueJobTest1);\n $this->queue->enqueue($queueJobTest2);\n $this->queue->reserve();\n $result = $this->queue->reserve();\n\n $this->assertNull($result);\n $this->assertCount(2, $this->queueStorage->queue);\n }", "protected function push(Command $command)\n {\n /** @var CommandDispatcher $dispatcher */\n $dispatcher = $this->getService(CommandDispatcher::class);\n $dispatcher->push($command);\n }", "public function queue_req($req)\n {\n \\Mutex::lock($this->thread_mutex);\n $this->req_queue[] = $req;\n \\Cond::signal($this->thread_cond); \n \\Mutex::unlock($this->thread_mutex);\n }", "public function setQueue()\n {\n throw new \\RuntimeException('It is not possible to set job queue, you must create a new job');\n }", "function queue ($elemento)\n\t\t\t\t{\n\t\t\t\t\tarray_push($this->arreglo, $elemento);\n\t\t\t\t}", "public function processed($job)\n {\n $this->client->queue($this->queueName)->processed($job);\n }", "public function executeJob()\n {\n // Fetch a job\n echo \"_\";\n $job = $this->queue\n ->watch('testtube')\n ->ignore('default')\n ->reserve();\n // Ensure we got a job.\n if ($job !== false) {\n // Extract job data.\n $jobData = json_decode($job->getData());\n \n switch ($jobData->Name) {\n case 'Wait':\n $result = $this->wait($jobData->Time);\n break;\n \n default:\n // Job definition unknown.\n break;\n }\n \n if (isset($result) && $result === true) {\n // Job succeeded. Remove it.\n $this->queue->delete($job);\n } else {\n // Job Failed. Bury it. \n $this->queue->bury($job);\n }\n }\n }", "public function testAddToQueue()\n {\n $this->setUpDB(['email']);\n \n $Email = new \\EmailTemplate('test');\n \n // Add the message to queue\n $r = $Email->queue('[email protected]', 'test', 'test');\n \n // get data from DB\n $EmailQueue = new \\EmailQueue();\n $filter = ['too' => '[email protected]'];\n $Collection = $EmailQueue->Get($filter, []);\n \n // asserts\n $this->assertEquals(1, $r);\n $this->assertInstanceOf(\\Collection::class, $Collection);\n $this->assertCount(1, $Collection);\n $Item = $Collection->getItem();\n $this->assertInstanceOf(\\SetterGetter::class, $Item);\n $this->assertEquals('test', $Item->getSubject());\n $this->assertEquals('test', $Item->getBody());\n }", "public static function queue($event)\n {\n }", "public function AddJobsToLineup()\n {\n $TITLE = br.'Adding Jobs to Lineup...'.br;\n require_once DIR.'QueueFiller/JobCreate.class.php';\n $this->JC = new JobCreate($this->EmptyQueues,$this->DB);\n $ALERTS = empty($this->JC->ALERTS)?'No Alerts...':implode(white.\"\\n\",$this->JC->ALERTS).white;\n return LF.$TITLE.$ALERTS.br;\n }", "public function work() {\n $this->model = ModelManager::getInstance()->getModel(QueueModel::NAME);\n\n do {\n $data = $this->model->popJobFromQueue($this->name);\n if ($data) {\n echo $this->name . ': Invoking job #' . $data->id . ' ... ';\n $dateReschedule = $this->invokeJob($data);\n\n if ($dateReschedule == -1) {\n echo \"error\\n\";\n } else {\n echo \"done\\n\";\n\n if (is_numeric($dateReschedule) && $dateReschedule > time()) {\n echo $this->name . ': Rescheduling job #' . $data->id . ' from ' . date('Y-m-d H:i:s', $dateReschedule) . \"\\n\";\n $queueModel->pushJobToQueue($data->job, $dateReschedule);\n }\n }\n } elseif (!$this->sleepTime) {\n echo $this->name . \": Nothing to be done and no sleep time. Exiting ...\\n\";\n break;\n }\n\n if ($this->sleepTime) {\n echo $this->name . ': Sleeping ' . $this->sleepTime . \" second(s)...\\n\";\n sleep($this->sleepTime);\n }\n } while (true);\n }", "public function addQueue(MailInterface $mail);", "public function startNextJob()\n {\n $jobModel = Mage::getModel('mailup/job');\n /* @var $jobModel MailUp_MailUpSync_Model_Job */\n foreach($jobModel->fetchQueuedJobsCollection() as $job) {\n /* @var $job MailUp_MailUpSync_Model_Job */\n \n /**\n * Try and Start it... if it fails, we can try the next one!\n */\n }\n }", "public function push($name);", "public function queue($key, $task, $params, $freshFor, $force = false, $tags = array(), $priority = 50, $delay = 0, $channel = 1);", "public function add($name, EventInterface $event)\n {\n $eventClass = get_class($event);\n if (!isset($this->jobs[$eventClass])) {\n throw new InvalidArgumentException(\"Don't know what job to use for event {$eventClass}\");\n }\n $class = $this->jobs[$eventClass];\n $job = $class::getInstance($name, $event);\n $this->client->queue($this->queueName)->push($job);\n }", "public function run()\n {\n $this->setStatus(Job::STATUS_RUNNING);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'running'), time(), $this->payload);\n Stats::incr('running', 1);\n Stats::incr('running', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_RUNNING, $this);\n }", "public function QueueAdd($queue, $interface, $penalty);", "public function runQueue();", "public function push($string) {\n\t\tif (!empty($string)) {\n\t\t\tif(!$this->duplicates && $this->objectExists($string)) return false;\n\t\t\tarray_unshift($this->objects, $string . \"\\n\"); \n\t\t\t\n\t\t\tif (count($this->objects) > $this->queueLimit && $this->queueLimit > 0) {\n\t\t\t\t$this->dequeue();\n\t\t\t}\n\t\t\tif($this->autosave) $this->save();\n\t\t}\n\t}", "public function pushToFareye() {\r\n Mage::getModel('marketplace/fareyedataqueue')->pushToFareye();\r\n }", "public function addJob($job = '') \n {\n if ($this->doesJobExist($job)) \n {\n return 0;\n }\n \n $jobs = $this->getJobs();\n $jobs[] = $job;\n return $this->saveJobs($jobs);\n }", "private function send(Job $job)\n {\n $request = $this\n ->serialization\n ->serializeJob($job);\n\n $exchange = $this\n ->declarationManager\n ->exchange();\n\n $this\n ->declarationManager\n ->jobQueue($job->type());\n\n $this\n ->channel\n ->basic_publish(\n new AMQPMessage($request),\n $exchange,\n $job->type()\n );\n }", "public function push($key, $data);", "public function add($id) \n {\n $log = FezLog::get();\n if (!array_key_exists($id,$this->_ids) || !$this->_ids[$id]) {\n $this->_ids[$id] = self::ACTION_ADD;\n $log->debug(\"Added $id to queue\");\n }\n }", "public function getQueueJob(array $data);", "public function enqueue($message = array()) {\n $this->_events->enqueue($message);\n }", "public function addJob($job)\n\t{\n\t\t$this->entityManager->persist($job);\n\t\t$this->entityManager->flush();\n\t}", "public function testReleaseQueueJob()\n {\n $queueJobTest1 = new TestQueueJob('price', 'ShopwarePriceImport');\n\n $this->queue->enqueue($queueJobTest1);\n $this->queue->reserve();\n $result = $this->queue->release();\n\n $queueTop = $this->queueStorage->peek($this->queue->getName());\n $this->assertTrue($result);\n $this->assertCount(1, $this->queueStorage->queue);\n $this->assertNull($queueTop->getReservationTime());\n $this->assertEquals(1, $queueTop->getAttempts());\n }", "public function queue()\n {\n $em = $this->getEntityManager();\n\n $task = new EventConsequenceTask();\n $task->setConsequence($this->entity);\n\n $em->persist($task);\n $em->flush();\n }", "protected function marshalPushedJob()\n {\n $r = $this->request;\n\n $body = $this->parseJobBody($r->input(self::PAYLOAD_REQ_PARAM_NAME));\n\n return (object) array(\n 'id' => $r->header('X-AppEngine-TaskName'), 'body' => $body, 'pushed' => true,\n );\n }", "public function addShareJob()\n {\n if ($this->status != self::STATUS_PUBLISHED || $this->published_to_twitter) {\n return false;\n }\n\n Yii::$app->queue->push(new ProjectShareJob([\n 'projectId' => $this->id,\n ]));\n\n return true;\n }", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function queueReplace($search, $replace)\n {\n\t\t$this->queuedChanges[] = array($search, $replace);\n\t}", "public function scheduleDelayedJob(array $data) {\n\t\t$this->redis->zAdd('lolli:gaw:mainQueue', $data['time'], json_encode($data));\n\t}", "public function publishCommand(Command $command)\n {\n if (!$this->tasksQueue) {\n $this->initializeTasksQueue();\n }\n \n $this->tasksQueue->pushMessage($this->message->setBody(serialize($command->getMemo())));\n $this->logActivity('Command published: '.$command->getName());\n }", "public function fire($job, $data)\n {\n\n // Test this script anywhere (but here) by calling the following:\n // Queue::push('QueueTest', array('string' => 'Hey everyone! It is now '.date(\"Y-m-d H:i:s\")));\n\n\n File::append(storage_path('logs/queue.txt'), $data['string'].PHP_EOL);\n\n // Deletes the job from the iron.io queue\n $job->delete();\n }" ]
[ "0.74417937", "0.71824455", "0.69923055", "0.6967664", "0.6833489", "0.6540442", "0.6458968", "0.6291997", "0.6267786", "0.6215984", "0.6165691", "0.6165691", "0.6165691", "0.6165691", "0.6165691", "0.6165691", "0.61603326", "0.61603326", "0.60888577", "0.6076971", "0.60519356", "0.60258335", "0.6014636", "0.59945583", "0.59841704", "0.59541404", "0.59369266", "0.5934444", "0.591365", "0.5889845", "0.5836003", "0.5781363", "0.5779903", "0.5766584", "0.5716656", "0.57042813", "0.5695769", "0.56952184", "0.5678571", "0.5631867", "0.56247586", "0.5619614", "0.560051", "0.55974907", "0.55835265", "0.5556334", "0.55455065", "0.5519674", "0.5497365", "0.54801", "0.5478296", "0.5447678", "0.5434143", "0.5420809", "0.5411256", "0.5407031", "0.5407031", "0.5406878", "0.5404299", "0.5372502", "0.536597", "0.5342438", "0.5333986", "0.5321848", "0.5310705", "0.5309296", "0.53018653", "0.5274226", "0.52623975", "0.52615964", "0.52503973", "0.52406734", "0.52327466", "0.5220538", "0.52146256", "0.519946", "0.5197762", "0.5194498", "0.51935434", "0.5184049", "0.51836514", "0.51825166", "0.51797575", "0.5157018", "0.51570016", "0.5148591", "0.5147146", "0.51403713", "0.5134966", "0.51345044", "0.5134269", "0.5132624", "0.51248485", "0.51224446", "0.51220584", "0.51201606", "0.51077265", "0.5103576", "0.50943756", "0.509255" ]
0.602317
22
/ $this>connection>channel()>exchange_declare( $this>config['exchange'], $this>config['exchange_type'], $this>config['exchange_passive'], $this>config['exchange_durable'], $this>config['exchange_auto_delete'], $this>config['exchange_internal'], $this>config['exchange_nowait'] );
private function declareQueue($name) { $this->connection->channel()->queue_declare( $this->config['exchange'], $this->config['passive'] ?? false, $this->config['durable'] ?? false, $this->config['exclusive'] ?? false, $this->config['nowait'] ?? false ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function declareExchange($exchange, $type, $passive = null, $durable = null, $auto_delete = null, $internal = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('declareExchange', func_get_args()));\n }", "public function declareExchange($exchange, $type, $passive = null, $durable = null, $auto_delete = null, $internal = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('declareExchange', func_get_args()));\n }", "public function declareExchange(\n $exchange,\n $type,\n $passive = false,\n $durable = false,\n $auto_delete = true,\n $internal = false,\n $nowait = false,\n $arguments = null,\n $ticket = null\n ) {\n return $this->getChannel()->exchange_declare(\n $exchange,\n $type,\n $passive,\n $durable,\n $auto_delete,\n $internal,\n $nowait,\n $arguments,\n $ticket\n );\n }", "public function declareExchange($name, $type = 'fanout', $passive = false, $durable = true, $auto_delete = false)\n {\n\n return $this->getChanel()->exchange_declare($name, $type, $passive, $durable, $auto_delete);\n }", "public function declareExchange(Exchange $exchange): self\n {\n $this->getChannel()->exchange_declare(\n $exchange->getExchangeName(),\n AMQPExchangeType::FANOUT,\n false, // passive : Whether exchange should be created if does not exists or raise an error instead\n $this->durable,\n false, // auto-delete : Delete exchange when all consumers have finished using it\n );\n\n return $this;\n }", "protected function queueDeclare()\n {\n if ($this->queueOptions['declare']) {\n list($queueName,,) = $this->getChannel()->queue_declare(\n $this->queueOptions['name'],\n $this->queueOptions['passive'],\n $this->queueOptions['durable'],\n $this->queueOptions['exclusive'],\n $this->queueOptions['auto_delete'],\n $this->queueOptions['nowait'],\n $this->queueOptions['arguments'],\n $this->queueOptions['ticket']\n );\n if (isset($this->queueOptions['routing_keys']) && count($this->queueOptions['routing_keys']) > 0) {\n foreach ($this->queueOptions['routing_keys'] as $routingKey) {\n $this->queueBind($queueName, $this->exchangeOptions['name'], $routingKey);\n }\n } else {\n $this->queueBind($queueName, $this->exchangeOptions['name'], $this->routingKey);\n }\n $this->queueDeclared = true;\n }\n }", "public function init()\n {\n if ($this->getIsInitialized())\n return;\n $client = $this->getClient();\n $client->getChannel()->exchange_declare(\n $this->name,\n $this->type,\n $this->isPassive,\n $this->isDurable,\n $this->autoDelete\n );\n \n if ($this->routingKey === null)\n $this->routingKey = $this->name;\n \n \n $this->getQueue()->bind($this, $this->routingKey);\n $this->setIsInitialized(true);\n }", "static function init($exchange, $queue)\n\t{\n\t\t$config = ApplicationConfig::getInstance();\n\n\t\tif (empty(self::$connection))\n\t\t{\n\t\t\tself::$connection = new AMQPConnection(\n\t\t\t\t$config->rabbitHost, $config->rabbitPort,\n\t\t\t\t$config->rabbitUser, $config->rabbitPass,\n\t\t\t\t$config->rabbitVhost\n\t\t\t);\n\t\t}\n\n\t\tif (empty(self::$channel))\n\t\t{\n\t\t\tself::$channel = self::$connection->channel();\n\n\t\t\t/*\n\t\t\t\tname: $queue\n\t\t\t\tpassive: false\n\t\t\t\tdurable: true // the queue will survive server restarts\n\t\t\t\texclusive: false // the queue can be accessed in other channels\n\t\t\t\tauto_delete: false //the queue won't be deleted once the channel is closed.\n\t\t\t*/\n\t\t\tself::$channel->queue_declare($queue, false, true, false, false);\n\n\t\t\t/*\n\t\t\t\tname: $exchange\n\t\t\t\ttype: direct\n\t\t\t\tpassive: false\n\t\t\t\tdurable: true // the exchange will survive server restarts\n\t\t\t\tauto_delete: false //the exchange won't be deleted once the channel is closed.\n\t\t\t*/\n\t\t\tself::$channel->exchange_declare($exchange, 'direct', false, true, false);\n\n\t\t\tself::$channel->queue_bind($queue, $exchange);\n\n\t\t\tself::$queue = $queue;\n\t\t\tself::$exchange = $exchange;\n\t\t}\n\n\t}", "public function createExchange($name, $type = AMQP_EX_TYPE_DIRECT, $flags = AMQP_DURABLE){\n\t\t$ch = new AMQPChannel($this->connection);\n\t\t$ex = new AMQPExchange($ch);\n\t\t$ex->setName($name);\n\t\t$ex->setType($type);\n\t\t$ex->setFlags($flags);\n\t\t$ex->declare();\n\t\treturn $ex;\n\t}", "public function declareQueue($queue = null, $passive = null, $durable = null, $exclusive = null, $auto_delete = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('declareQueue', func_get_args()));\n }", "public function declareQueue($queue = null, $passive = null, $durable = null, $exclusive = null, $auto_delete = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('declareQueue', func_get_args()));\n }", "public function create(): ExchangeInterface;", "public function declareQueue(\n $queue = '',\n $passive = false,\n $durable = false,\n $exclusive = false,\n $auto_delete = true,\n $nowait = false,\n $arguments = null,\n $ticket = null\n ) {\n return $this->getChannel()->queue_declare(\n $queue,\n $passive,\n $durable,\n $exclusive,\n $auto_delete,\n $nowait,\n $arguments,\n $ticket\n );\n }", "public function declareAndBindQueue($exchange, $queueName, $routingKey = '');", "protected function createExchange(string $exchangeName, $options = [])\n {\n // Determine the options for this exchange\n $type = array_key_exists('type', $options) ? (string)$options['type'] : 'direct';\n $passive = array_key_exists('passive', $options) ? (bool)$options['passive'] : false;\n $durable = array_key_exists('durable', $options) ? (bool)$options['durable'] : true;\n $auto_delete = array_key_exists('auto_delete', $options) ? (bool)$options['auto_delete'] : false;\n $internal = array_key_exists('internal', $options) ? (bool)$options['internal'] : false;\n $nowait = array_key_exists('nowait', $options) ? (bool)$options['nowait'] : false;\n\n $rcm = RabbitConnectionManager::getInstance();\n if (!$rcm->checkConnection($this->connectionName)) {\n throw new RuntimeException(\"Rabbit connection not set\");\n }\n $channel = $rcm->getChannel($this->connectionName);\n\n // Create the exchange\n $channel->exchange_declare($exchangeName, $type, $passive, $durable, $auto_delete, $internal, $nowait);\n }", "public function created(Exchange $exchange)\n {\n //\n }", "public function declareQueue($name, $passive = false, $durable = true, $exclusive = false, $auto_delete = false)\n {\n return $this->getChanel()->queue_declare($name, $passive, $durable, $exclusive, $auto_delete);\n }", "public function setup() {\n echo \"\\n\\nDeclaring Exchanges\\n\";\n foreach ($this->config['exchanges'] as $name => $config) {\n $exchange = $this->getExchange($name);\n $response = null;\n if (!$exchange->getManaged()) {\n echo \"Skipped : \";\n } else {\n $exchange->declareExchange();\n echo \"Declared: \";\n }\n echo $exchange->getName() . \"\\n\" ;\n }\n\n echo \"\\n\\nDeclaring Queues\\n\";\n foreach ($this->config['queues'] as $name => $config) {\n $queue = $this->getQueue($name);\n $response = null;\n if (!$queue->getManaged()) {\n echo \"Skipped : \";\n } else {\n $queue->declareQueue();\n echo \"Declared: \";\n }\n echo $queue->getName() . \"\\n\" ;\n }\n }", "static function newChannel($exchange, $queue)\n\t{\n\t\tif (!empty(self::$channel))\n\t\t{\n\t\t\tself::$channel->close();\n\t\t}\n\t\tself::init($exchange, $queue);\n\t}", "public function actionSingle() {\n// $conn = $amqp->Connection();\n// $channel = $amqp->Channel($conn);\n// $amqp->Exchange($conn, $channel);\n// $amqp->Queue($channel);\n }", "public function testShouldAnnounceExchange($exchangeName)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'declareExchange',\n $this->returnValue(true)\n )\n )\n );\n\n $deleted = $service->announce($exchangeName);\n\n $this->assertTrue($deleted);\n $this->assertCount(0, $service->getErrorList());\n }", "protected function open()\n {\n if ($this->_channel) return;\n $this->_connection = new AMQPStreamConnection($this->host, $this->port, $this->user, $this->password);\n $this->_channel = $this->_connection->channel();\n $this->_channel->queue_declare($this->queueName);\n $this->_channel->exchange_declare($this->exchangeName, $this->exchangeType, false, true, false);\n $this->_channel->queue_bind($this->queueName, $this->exchangeName);\n }", "public function createQueue(string $name): void\r\n {\r\n $this->queue = $name;\r\n if ($this->connect) {\r\n $this->channel = $this->connect->channel();\r\n $this->channel->queue_declare($this->queue, false, true, false, false);\r\n } else {\r\n throw new \\Exception('Not found RabbitMQ connection');\r\n }\r\n }", "public function setExchangeRate($exchangeRate);", "public function declareSimpleQueue($queueName = '', $type = self::QUEUE_DURABLE);", "protected function declareQueues()\n {\n $queues = static::getConfigurations()['queues'];\n\n if (! is_array($queues)) {\n $errorMessage = 'argument queues must be array, not %s';\n\n throw new InvalidArgumentException(sprintf($errorMessage, gettype($queues)));\n }\n\n if (! count($queues)) {\n $errorMessage = 'argument queues can not be empty or Null';\n\n throw new Exception($errorMessage);\n }\n\n foreach ($queues as $queueName => $details) {\n $arguments = [];\n\n // handle DLX (dead letter exchange).\n if (\n count($details) &&\n count($exchange = $details['dead_letter_exchange'])\n ) {\n $arguments['x-dead-letter-exchange'] = $exchange['name'];\n\n // Set routing key for exchanges if declared.\n if (! empty($exchange['routing_key'])) {\n $arguments['x-dead-letter-routing-key'] = $exchange['routing_key'];\n }\n }\n\n $this->node->queue_declare(\n $queueName,\n false,\n true,\n false,\n false,\n false,\n new AMQPTable($arguments)\n );\n }\n }", "public function publish($exchangeName, Message $message);", "public function aim_chat_create($name, $exchange = 4)\r\n\t{\r\n\t\t$this->core->aim_send_raw(sprintf('toc_chat_join %d \"%s\"', $exchange, $name));\r\n\t}", "public function testShouldThrowExceptionOnAnnounceExchange($exchangeName)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'declareExchange',\n $this->throwException(new \\AMQPExchangeException(\"PreCondition Failed\"))\n )\n )\n );\n\n $deleted = $service->announce($exchangeName);\n\n $this->assertFalse($deleted);\n $this->assertContains(\"PreCondition Failed\", $service->getErrorList());\n }", "public function handle()\r\n {\r\n $ex_name = 'ex.zdjz.news';\r\n $quene_name = 'quene.zdjz.news';\r\n $bind_key = 'xian.zdjz.news';\r\n $connection = new \\AMQPConnection(array('host'=>'127.0.0.1','port'=>'5672','vhost'=>'/zdjz','login'=>'guest','password'=>'guest'));\r\n if(!$connection->connect()) {\r\n echo \"链接失败\";\r\n }\r\n $chann = new \\AMQPChannel($connection);\r\n\r\n //创建一个fonmant交换器\r\n $ex = new \\AMQPExchange($chann);\r\n $ex->setName($ex_name);//交换器名称\r\n $ex->setType(AMQP_EX_TYPE_FANOUT);//交换器类型\r\n $ex->setFlags(AMQP_DURABLE);//是否持久化\r\n $ex->setFlags(AMQP_AUTODELETE);//是否自动删除 当所有队列和交换机器绑定到当前交换器上不在使用时,是否自动删除交换器 true:删除false:不删除\r\n\r\n $quene = new \\AMQPQueue($chann);\r\n $quene->setName($quene_name);\r\n $quene->setFlags(AMQP_AUTODELETE);//是否自动删除 当前队列上没有订阅的消费者时 自动删除\r\n $quene->setFlags(AMQP_DURABLE);//是否持久化\r\n $quene->bind($ex_name,$bind_key);\r\n $message = $quene->get();\r\n $body = $message->getBody();\r\n var_dump($message);\r\n if($message['body']){\r\n //确认消息\r\n echo $message['body'].'';\r\n $quene->ack($message['delivery_tag']);\r\n }\r\n\r\n\r\n $chann->close();\r\n $connection->close();\r\n }", "public function testEnqueue()\n {\n $topicName = 'topic.name';\n $exchangeName = 'exchangeName';\n $envelopeBody = 'envelopeBody';\n $envelopeProperties = ['property_key_1' => 'property_value_1'];\n $topicData = [\n \\Magento\\Framework\\Communication\\ConfigInterface::TOPIC_IS_SYNCHRONOUS => false\n ];\n $this->communicationConfig->expects($this->once())\n ->method('getTopic')->with($topicName)->willReturn($topicData);\n $channel = $this->getMockBuilder(\\AMQPChannel::class)\n ->setMethods(['batch_basic_publish', 'publish_batch'])\n ->disableOriginalConstructor()->getMock();\n $this->amqpConfig->expects($this->once())->method('getChannel')->willReturn($channel);\n $publisher = $this\n ->getMockBuilder(\\Magento\\Framework\\MessageQueue\\Publisher\\Config\\PublisherConfigItemInterface::class)\n ->disableOriginalConstructor()->getMock();\n $this->publisherConfig->expects($this->once())\n ->method('getPublisher')->with($topicName)->willReturn($publisher);\n $connection = $this\n ->getMockBuilder(\\Magento\\Framework\\MessageQueue\\Publisher\\Config\\PublisherConnectionInterface::class)\n ->disableOriginalConstructor()->getMock();\n $publisher->expects($this->once())->method('getConnection')->with()->willReturn($connection);\n $connection->expects($this->once())->method('getExchange')->with()->willReturn($exchangeName);\n $envelope = $this\n ->getMockBuilder(\\Magento\\Framework\\MessageQueue\\EnvelopeInterface::class)\n ->disableOriginalConstructor()->getMock();\n $envelope->expects($this->once())->method('getBody')->willReturn($envelopeBody);\n $envelope->expects($this->once())->method('getProperties')->willReturn($envelopeProperties);\n $channel->expects($this->once())->method('batch_basic_publish')\n ->with($this->isInstanceOf(\\PhpAmqpLib\\Message\\AMQPMessage::class), $exchangeName, $topicName);\n $channel->expects($this->once())->method('publish_batch');\n $this->assertNull($this->bulkExchange->enqueue($topicName, [$envelope]));\n }", "public function __construct($exchangeName, $exchangetype, $message)\n {\n $this->exchangeName = $exchangeName;\n $this->exchangetype = $exchangetype;\n $this->message = $message;\n }", "public function createExchange(string $name): Exchange\n {\n return new Exchange($name);\n }", "public static function _init()\n {\n \\Package::load('exchange');\n }", "public function bindQueue($exchange, $queueName, $routingKey = '');", "public function setExchangeRate(string $exchangeRate)\n\t{\n\t\t$this->exchangeRate=$exchangeRate; \n\t\t$this->keyModified['exchange_rate'] = 1; \n\n\t}", "public function init(string $queueName, string $exchangeName, string $bindingKey);", "public function forceDeleted(Exchange $exchange)\n {\n //\n }", "public function declareQueue(Queue $queue): self\n {\n $this->getChannel()->queue_declare(\n $queue->getQueueName(),\n false, // passive : Whether queue should be created if does not exists or raise an error instead\n $this->durable,\n false, // exclusive : Whether access should only be allowed by current connection and delete queue when that connection closes\n false, // auto-delete : Delete queue when all consumers have finished using it\n false, // nowait\n new AMQPTable([\n \"x-queue-mode\" => \"lazy\"\n ])\n );\n\n return $this;\n }", "public function getExchange(): ActiveQuery\n {\n return $this->hasOne(RabbitMQExchange::class, ['id' => 'exchange_id']);\n }", "public function testShouldNotAnnounceExchange($exchangeName)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'declareExchange',\n $this->returnValue(false)\n )\n )\n );\n\n $deleted = $service->announce($exchangeName);\n\n $this->assertFalse($deleted);\n $this->assertCount(0, $service->getErrorList());\n }", "function __construct($tick,$name,$exchange) {\n\t\t\t$this->tick = $tick;\n\t\t\t$this->name = $name;\n\t\t\t$this->exchange = $exchange;\n\t\t\t}", "public function bindQueueToExchange($queue, $exchange, $routing_key = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('bindQueueToExchange', func_get_args()));\n }", "public function bindQueueToExchange($queue, $exchange, $routing_key = null, $nowait = null, $arguments = null, $ticket = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('bindQueueToExchange', func_get_args()));\n }", "public function run()\n {\n// TODO activate one exchange\n foreach (Exchange::$exchanges as $exchange) {\n $className = '\\ccxt\\\\' . $exchange;\n $class = new $className;\n $describe = $class->describe();\n \n $url = serialize($describe['urls']['www']);\n $api = serialize($describe['urls']['api']);\n $docs = serialize($describe['urls']['doc']);\n\n $addExchange = new Exchanges();\n $addExchange->exchange = $describe['name'];\n $addExchange->slug = $describe['id'];\n $addExchange->ccxt = true;\n $addExchange->url = $url;\n $addExchange->url_api = $api;\n $addExchange->url_doc = $docs;\n $addExchange->version = isset($describe['version']) ? $describe['version'] : NULL;\n $addExchange->has_ticker = isset($describe['has']['fetchTickers']) ? true : false;\n $addExchange->has_ohlcv = isset($describe['has']['fetchOHLCV']) ? true : false;\n $addExchange->save();\n } // foreach\n }", "public function deleted(Exchange $exchange)\n {\n //\n }", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function testShouldAnnounceExchangeList($exchangeList)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'declareExchange',\n $this->returnValue(true)\n )\n )\n );\n\n $service->announceList($exchangeList);\n\n $this->assertCount(0, $service->getErrorList());\n }", "public function declare()\n {\n // ...\n }", "public function testExample()\n {\n\n \n\n $exchangeName = \"kk.test.service\";\n $queueid = \"kk.test.q1\";\n $mq = new RabbitMQ();\n $result = $mq -> regPublisher($exchangeName);\n dump(\"reg result \".$result);\n \n $mq->subScribe($exchangeName, $queueid);\n $mq ->broadcastToQueue(\n $exchangeName, array(\n \"id\"=>1,\n \"msg\"=>\"hello world\"\n )\n );\n /* \n dump(config(\"rabbitmq.host\"));\n $connection = new AMQPStreamConnection(\n config(\"rabbitmq.host\"),\n config(\"rabbitmq.port\"),\n config(\"rabbitmq.user\"),\n config(\"rabbitmq.pwd\"),\n config(\"rabbitmq.hostname\")\n );\n \n $channel = $connection->channel();\n \n $channel->exchange_declare('test-exchanges', 'fanout', true, true, false);\n \n $msg = new AMQPMessage(json_encode('this is test!'), array('de\n livery_mode' => 2));\n $channel->basic_publish($msg, 'test-exchanges', '');\n \n $channel->close();\n $connection->close();*/\n\n //$this->AddEvent('Recharge_Check',229,'CR2017041216291858748');\n //$this->RaisEvent();\n $this->assertTrue(true);\n }", "public function getExchange()\n {\n return $this->exchange;\n }", "public function getExchange()\n {\n return $this->exchange;\n }", "public function createQueue();", "public function declareTopic(string $topic): void;", "protected function build()\n {\n // Grab some files from the config settings\n $exchange = $this->exchange;\n $queue = $this->queue;\n $routingKey = $this->routingKey;\n\n\n // Determine the DLX queue info\n $dlxQueue = is_null($this->dlxQueue) ? $queue . '.dlx' : $this->dlxQueue;\n $dlxRoutingKey = is_null($this->dlxRoutingKey) ? 'dlx' : $this->dlxRoutingKey;\n\n // Build the Exchange\n $this->createExchange($exchange);\n\n // Build the Queues\n $this->createQueue($dlxQueue);\n $this->createQueue($queue, [\n 'x-dead-letter-exchange' => $exchange,\n 'x-dead-letter-routing-key' => $dlxRoutingKey,\n ]);\n\n // Bind the Queues to the Exchange\n $this->bind($dlxQueue, $exchange, $dlxRoutingKey);\n $this->bind($queue, $exchange, $routingKey);\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$validation = Validator::make($input, Exchange::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$this->exchange->create($input);\n\n\t\t\treturn Redirect::route('exchanges.index');\n\t\t}\n\n\t\treturn Redirect::route('exchanges.create')\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function default(): AmqpContext;", "function addExchange($account_receiver, $amount, $purposes, $account_sender = array())\n {\n if (empty($account_receiver['additional_name'])) {\n $account_receiver['additional_name'] = \"\";\n }\n if (empty($account_sender['name'])) {\n $account_sender['name'] = $this->account_file_sender['name'];\n }\n if (empty($account_sender['bank_code'])) {\n $account_sender['bank_code'] = $this->account_file_sender['bank_code'];\n }\n if (empty($account_sender['account_number'])) {\n $account_sender['account_number'] =\n $this->account_file_sender['account_number'];\n }\n if (empty($account_sender['additional_name'])) {\n $account_sender['additional_name'] =\n $this->account_file_sender['additional_name'];\n }\n\n $account_receiver['account_number'] =\n strval($account_receiver['account_number']);\n $account_receiver['bank_code'] =\n strval($account_receiver['bank_code']);\n $account_sender['account_number'] =\n strval($account_sender['account_number']);\n $account_sender['bank_code'] =\n strval($account_sender['bank_code']);\n\n $cents = (int)(round($amount * 100));\n if (strlen($account_sender['name']) > 0\n && strlen($account_sender['bank_code']) > 0\n && strlen($account_sender['bank_code']) <= 8\n && ctype_digit($account_sender['bank_code'])\n && strlen($account_sender['account_number']) > 0\n && strlen($account_sender['account_number']) <= 10\n && ctype_digit($account_sender['account_number'])\n && strlen($account_receiver['name']) > 0\n && strlen($account_receiver['bank_code']) <= 8\n && ctype_digit($account_receiver['bank_code'])\n && strlen($account_receiver['account_number']) <= 10\n && ctype_digit($account_receiver['account_number'])\n && is_numeric($amount)\n && $cents > 0\n && $cents <= PHP_INT_MAX\n && $this->sum_amounts <= (PHP_INT_MAX - $cents)\n && ( (is_string($purposes)\n && strlen($purposes) > 0)\n || (is_array($purposes)\n && count($purposes) >= 1\n && count($purposes) <= 14)\n )) {\n\n $this->sum_amounts += $cents;\n $this->sum_bankcodes += $account_receiver['bank_code'];\n $this->sum_accounts += $account_receiver['account_number'];\n\n if (is_string($purposes)) {\n $filtered_purposes = str_split($this->makeValidString($purposes), 27);\n $filtered_purposes = array_slice($filtered_purposes, 0, 14);\n } else {\n $filtered_purposes = array();\n foreach ($purposes as $purposeline) {\n $filtered_purposes[] = substr($this->makeValidString($purposeline), 0, 27);\n }\n }\n\n $this->exchanges[] = array(\n \"sender_name\" => substr($this->makeValidString($account_sender['name']), 0, 27),\n \"sender_bank_code\" => $account_sender['bank_code'],\n \"sender_account_number\" => $account_sender['account_number'],\n \"sender_additional_name\" => substr($this->makeValidString($account_sender['additional_name']), 0, 27),\n \"receiver_name\" => substr($this->makeValidString($account_receiver['name']), 0, 27),\n \"receiver_bank_code\" => $account_receiver['bank_code'],\n \"receiver_account_number\" => $account_receiver['account_number'],\n \"receiver_additional_name\" => substr($this->makeValidString($account_receiver['additional_name']), 0, 27),\n \"amount\" => $cents,\n \"purposes\" => $filtered_purposes\n );\n\n $result = true;\n } else {\n $result = false;\n }\n\n return $result;\n }", "public function updated(Exchange $exchange)\n {\n //\n }", "public function __construct($config = 'amqp://')\n {\n if (empty($config) || 'amqp://' === $config) {\n $config = [];\n } elseif (is_string($config)) {\n $config = $this->parseDsn($config);\n } elseif (is_array($config)) {\n } else {\n throw new \\LogicException('The config must be either an array of options, a DSN string or null');\n }\n\n $this->config = array_replace($this->defaultConfig(), $config);\n\n $supportedMethods = ['basic_get', 'basic_consume'];\n if (false == in_array($this->config['receive_method'], $supportedMethods, true)) {\n throw new \\LogicException(sprintf(\n 'Invalid \"receive_method\" option value \"%s\". It could be only \"%s\"',\n $this->config['receive_method'],\n implode('\", \"', $supportedMethods)\n ));\n }\n\n if ('basic_consume' == $this->config['receive_method']) {\n if (false == (version_compare(phpversion('amqp'), '1.9.1', '>=') || phpversion('amqp') == '1.9.1-dev')) {\n // @see https://github.com/php-enqueue/enqueue-dev/issues/110 and https://github.com/pdezwart/php-amqp/issues/281\n throw new \\LogicException('The \"basic_consume\" method does not work on amqp extension prior 1.9.1 version.');\n }\n }\n }", "public function setExchangeBindings(array $exchangeBindings = array())\n {\n $this->exchangeBindings = $exchangeBindings;\n }", "public function restored(Exchange $exchange)\n {\n //\n }", "protected function bindExchangesAndQueues()\n {\n $exchanges = static::getConfigurations()['exchanges'];\n\n if (count($exchanges)) {\n\n foreach ($exchanges as $exchangeName => $details) {\n\n foreach ($details['queues'] as $queueName => $routingKeys) {\n\n // bind with routing key.\n if (count($routingKeys)) {\n\n foreach ($routingKeys as $routingKey) {\n $this->node->queue_bind($queueName, $exchangeName, $routingKey);\n }\n\n continue;\n }\n\n // Bind without routing key.\n $this->node->queue_bind($queueName, $exchangeName);\n }\n }\n }\n }", "public function listen()\n {\n $this->log->addInfo('Begin listen routine');\n \n $connection = new AMQPConnection('localhost', 5672, 'guest', 'guest');\n $channel = $connection->channel();\n \n $channel->queue_declare(\n 'invoice_queue', #queue\n false, #passive\n true, #durable, make sure that RabbitMQ will never lose our queue if a crash occurs\n false, #exclusive - queues may only be accessed by the current connection\n false #auto delete - the queue is deleted when all consumers have finished using it\n );\n \n /**\n * don't dispatch a new message to a worker until it has processed and \n * acknowledged the previous one. Instead, it will dispatch it to the \n * next worker that is not still busy.\n */\n $channel->basic_qos(\n null, #prefetch size - prefetch window size in octets, null meaning \"no specific limit\"\n 1, #prefetch count - prefetch window in terms of whole messages\n null #global - global=null to mean that the QoS settings should apply per-consumer, global=true to mean that the QoS settings should apply per-channel\n );\n \n /**\n * indicate interest in consuming messages from a particular queue. When they do \n * so, we say that they register a consumer or, simply put, subscribe to a queue.\n * Each consumer (subscription) has an identifier called a consumer tag\n */ \n $channel->basic_consume(\n 'invoice_queue', #queue\n '', #consumer tag - Identifier for the consumer, valid within the current channel. just string\n false, #no local - TRUE: the server will not send messages to the connection that published them\n false, #no ack, false - acks turned on, true - off. send a proper acknowledgment from the worker, once we're done with a task\n false, #exclusive - queues may only be accessed by the current connection\n false, #no wait - TRUE: the server will not respond to the method. The client should not wait for a reply method\n array($this, 'process') #callback\n );\n \n $this->log->addInfo('Consuming from queue');\n \n while(count($channel->callbacks)) {\n $this->log->addInfo('Waiting for incoming messages');\n $channel->wait();\n }\n \n $channel->close();\n $connection->close();\n }", "public function bindQueueToExchange(\n $queue,\n $exchange,\n $routing_key = '',\n $nowait = false,\n $arguments = null,\n $ticket = null\n ) {\n return $this->getChannel()->queue_bind(\n $queue,\n $exchange,\n $routing_key,\n $nowait,\n $arguments,\n $ticket\n );\n }", "public function test_createQueue() {\n\n }", "public function testConsumesUpdateQueues()\n {\n $rabbit = $this->getModelMock('messenger/transport_rabbitmq', array('_getChannel', '_close'));\n $channel = $this->_getChannelMock();\n $rabbit->expects($this->any())->method('_getChannel')->will($this->returnValue($channel));\n $rabbit->setConsumeQueues(array('test'));\n\n $channel->expects($this->once())->method('queue_declare')->with($this->equalTo('test'));\n $channel->expects($this->once())->method('basic_consume')->with($this->equalTo('test'));\n $this->_startReceiving($rabbit);\n }", "public function testChannelsArchive()\n {\n }", "public function __construct(\n\t\tprivate readonly \\WeakReference $protocol,\n\t\tprivate readonly int $channelId,\n\t\tpublic readonly string $name,\n\t\tpublic readonly Type $type,\n\t\tpublic readonly bool $passive,\n\t\tpublic readonly bool $durable,\n\t\tpublic readonly bool $autoDelete,\n\t\tpublic readonly bool $internal,\n\t\tpublic readonly bool $noWait,\n\t\tpublic readonly array $arguments,\n\t) {\n\t}", "public function exchange()\n {\n return $this->message->delivery_info['exchange'];\n }", "public function setExchangeRate($exchange_rate)\n {\n $this->exchange_rate = $exchange_rate;\n return $this;\n }", "private static function getChannel(){\n\t\t\tif(!self::$_activeChannel){\n\t\t\t\tif(self::tryConnection(1)){\n\t\t\t\t\tlist(self::$_activeQueue, ,) = self::$_activeChannel->queue_declare(\"\",false,false,true,false);\n\t\t\t\t}\n\n\t\t\t\tself::$_callbacks = array();\n\t\t\t}\n\n\t\t\treturn self::$_activeChannel;\n\t\t}", "public function setIdExchange($id_exchange)\n {\n $this->id_exchange = $id_exchange;\n\n return $this;\n }", "public function __construct()\n {\n $this->queue = new Pheanstalk('localhost', '11300', null, true);\n }", "public function handle()\n {\n //\n// echo PHP_EOL . 'Demo' . PHP_EOL;\n $rabbit = new RabbitMQ();\n\n $message = 'test queue : ' . date('Y-m-d H:i:s');\n $queue = 'demo';\n $rabbit->publishMessage($message, $queue);\n\n// $msg = $rabbit->getMessage($queue);\n// echo PHP_EOL;\n// var_dump($msg);\n// echo PHP_EOL;\n\n\n }", "public function testShouldThrowExceptionOnDeleteExchange($exchangeName)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'delete',\n $this->throwException(new \\AMQPExchangeException(\"Non Existent Queue\"))\n )\n )\n );\n\n $deleted = $service->delete($exchangeName);\n\n $this->assertFalse($deleted);\n $this->assertContains(\"Non Existent Queue\", $service->getErrorList());\n }", "function install() {\n\t\techo \"\\nModule xlyre will be installed.\\n\";\n \t$this->loadConstructorSQL(\"xlyre.constructor.sql\");\n\t\t/*$name = \"xlyre\";\n $extension = \"xml\";\n $complexName = sprintf(\"%s.%s\", $name, $extension);\n $description = \"OpenData channel\";\n $renderMode = \"ximdex\";\n\n $nodeType = new NodeType();\n $nodeType->SetByName('Channel');\n\n\t\t$node = new Node();\n\t\t$idNode = $node->CreateNode($complexName, 9,$nodeType->GetID(), NULL);\n\n\t\t$ch=new Channel($idNode);\n\t\t$result=$ch->CreateNewChannel($name, $extension, NULL, $description, $idNode, NULL, $renderMode);\n if ($result > 0) {\n echo \"Channel has been succesfully created\\n\";\n }\n\t\telse{\n\t\t\techo \"There was a problem creating the xlyre channel\\n\";\n\t\t}*/\n\n parent::install();\n\t}", "private function executeFireAndForgetStrategy(Exchange $mainExchange, string $uri)\n {\n $exchange = new Exchange();\n\n // Set Itinerary\n $version = $mainExchange->getIn()->getContext()->get(Context::FLOWS_VERSION);\n\n $itineraryParams = $this->itineraryResolver->getItineraryParams($uri, $version);\n $itinerary = $itineraryParams[InternalRouter::KEY_ITINERARY];\n\n $exchange->getItinerary()->prepend($itinerary);\n $exchange->getItinerary()->setName('Recipient list from \"'.$mainExchange->getItinerary()->getName().'\"');\n\n // Set Headers\n $headers = $mainExchange->getHeaders();\n if (!empty($headers)) {\n $exchange->setHeaders($headers);\n }\n\n $exchange->setHeader(Exchange::HEADER_PARENT_EXCHANGE, $mainExchange->getId());\n\n $headersToPropagate = $this->itineraryResolver->filterItineraryParamsToPropagate($itineraryParams);\n\n foreach ($headersToPropagate as $key => $value) {\n $exchange->setHeader($key, $value);\n }\n\n // Set Message\n $msgCopy = \\unserialize(\\serialize($mainExchange->getIn()));\n $exchange->setIn($msgCopy);\n\n $event = new NewExchangeEvent($exchange);\n $event->setTimestampToCurrent();\n $this->eventDispatcher->dispatch(NewExchangeEvent::TYPE_NEW_EXCHANGE_EVENT, $event);\n }", "function channelCreate(ChannelInterface $channel);", "public function testShouldDeleteExchange($exchangeName)\n {\n $service = new ExchangeService();\n\n $service->setContainer(\n $this->createContainerMock(\n $this->createAmqpExchangeMock(\n 'delete',\n $this->returnValue(true)\n )\n )\n );\n\n $deleted = $service->delete($exchangeName);\n\n $this->assertTrue($deleted);\n $this->assertCount(0, $service->getErrorList());\n }", "public function queue($name = null);", "public function handle()\n {\n Amqp::publish('test', 'hello from laravel' , ['queue' => 'test']);\n\n }", "public function ZapTransfer($zapChannel);", "public function __construct()\n {\n $this->queue = 'mail';\n }", "public function addExchange($db){\r\n\t\t$title = $this->title;\r\n\t\t$type = $this->type;\r\n\t\t$mark = $this->mark;\r\n\t\t$lender = $this->lender;\r\n\t\t$borrower = $this->borrower;\r\n\t\t$date = date(\"Y-m-d\");\r\n\t\t\r\n\t\t$query = \"insert into Exchanges (Title, Type, mark, Lender, Borrower, ExchangeDate)\r\n\t\t\t\tvalues('$title', '$type', '$mark', '$lender','$borrower', '$date');\";\r\n $result = $db->query($query);\r\n\t\tif (!$result || $db->affected_rows == 0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\t\r\n }", "public function open()\n {\n if ($this->ch || $this->conn) {\n throw new \\UnexpectedValueException(\"Connection is already open\");\n }\n try {\n $this->conn = new AMQPConnection($this->url['host'], $this->url['port'], $this->url['user'], $this->url['pass'], $this->url['path']);\n $this->ch = $this->conn->channel();\n\n $this->declareExchange(\n $this->opts['build-models.request.queue'],\n $this->opts['build-models.request.exchange'],\n $this->opts['build-models.response.queue']);\n\n $this->declareExchange(\n $this->opts['predict-models.request.queue'],\n $this->opts['predict-models.request.exchange'],\n $this->opts['predict-models.response.queue']);\n\n $this->declareExchange(\n $this->opts['fake.request.queue'],\n $this->opts['fake.request.exchange'],\n $this->opts['fake.response.queue']);\n } catch (AMQPExceptionInterface $e) {\n throw $e;\n throw new IchnaeaConnectionException($e->getMessage());\n }\n }", "public function listen()\n {\n $this->open();\n $callback = function(AMQPMessage $message) {\n $job = $this->unserialize($message->body);\n if ($this->getQueue()->run($job)) {\n $message->delivery_info['channel']->basic_ack($message->delivery_info['delivery_tag']);\n }\n };\n $this->_channel->basic_qos(null, 1, null);\n $this->_channel->basic_consume($this->queueName, '', false, false, false, false, $callback);\n while(count($this->_channel->callbacks)) {\n $this->_channel->wait();\n }\n }", "public function setExchangeRate($exchangeRate)\n {\n $this->exchangeRate = $exchangeRate;\n return $this;\n }", "public function handle()\n {\n //\n $connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest', '/');\n\n $channel = $connection->channel();\n\n $channel->exchange_declare('ex1', 'direct', false, true, false, false, false);\n\n $channel->queue_declare('queue1', false, true, false, false);\n\n $channel->queue_bind('queue1', 'ex1', 'routingkey1');\n\n $msg = new AMQPMessage('Hello World!', ['delivery_mode' => AMQPMessage::DELIVERY_MODE_PERSISTENT, 'content_type' => 'text/plain']);\n\n $wait = true;\n $returnListener = function (\n $replyCode,\n $replyText,\n $exchange,\n $routingKey,\n $message\n ) use ($wait) {\n $GLOBALS['wait'] = false;\n echo \"return: \",\n $replyCode, \"\\n\",\n $replyText, \"\\n\",\n $exchange, \"\\n\",\n $routingKey, \"\\n\",\n $message->body, \"\\n\";\n };\n\n // 监听没有成功路由到队列的消息\n $channel->set_return_listener($returnListener);\n\n $channel->basic_publish($msg, 'ex1', 'routingkey123', true, false);\n\n while ($wait) {\n $channel->wait();\n }\n\n $channel->close();\n\n $connection->close();\n }", "public function channel()\n {\n }", "public function __invoke(Broker $broker);", "public function connect(array $config)\n\t{\n\t\t// create connection with AMQP\n\t\t$connection = new AMQPConnection($config['host'], $config['port'], $config['login'], $config['password'], $config['vhost']);\n\n\t\treturn new RabbitMQQueue(\n\t\t\t$connection,\n\t\t\t$config\n\t\t);\n\t}", "public function connect($queue) {\n $this->_queue = msg_get_queue(sprintf(\"%u\", crc32($queue)));\n }", "protected function createQueue(string $queueName, $options = [])\n {\n // Determine the options for this queue\n $passive = array_key_exists('passive', $options) ? (bool)$options['passive'] : false;\n $durable = array_key_exists('durable', $options) ? (bool)$options['durable'] : true;\n $exclusive = array_key_exists('exclusive', $options) ? (bool)$options['exclusive'] : false;\n $auto_delete = array_key_exists('auto_delete', $options) ? (bool)$options['auto_delete'] : false;\n $nowait = array_key_exists('nowait', $options) ? (bool)$options['nowait'] : false;\n\n // Build the additional arguments\n $arguments = $this->filterArguments($options, [\n 'x-message-ttl',\n 'x-expires',\n 'x-max-length',\n 'x-max-length-bytes',\n 'x-dead-letter-exchange',\n 'x-dead-letter-routing-key',\n 'x-max-priority',\n ]);\n\n $rcm = RabbitConnectionManager::getInstance();\n if (!$rcm->checkConnection($this->connectionName)) {\n throw new RuntimeException(\"Rabbit connection not set\");\n }\n $channel = $rcm->getChannel($this->connectionName);\n\n // Create the queue\n return $channel->queue_declare($queueName, $passive, $durable, $exclusive, $auto_delete, $nowait, $arguments);\n }", "protected function _getChannelMock()\n {\n return $this->getMockBuilder('\\PhpAmqpLib\\Channel\\AMQPChannel')\n ->setMethods(array(\n 'queue_declare', 'basic_qos', 'basic_consume',\n 'basic_ack', 'basic_publish', 'basic_cancel'\n ))\n ->disableOriginalConstructor()->getMock();\n }", "public function startDownload()\n {\n // use RabbitMQ for send queue.\n $this->channel->queue_declare('downloader', 'fanout', false, false, false);\n\n $callback = function($msg) {\n echo \" [x] Received \", $msg->body, \"\\n\";\n sleep(1);\n\n // print_r($msg::get_properties());\n\n\n $id = new ImageDownloader($msg);\n try\n {\n $queue = $id->download();\n }\n catch (\\Exception $e)\n {\n $queue = new Queue($msg->body);\n $queue->setStatus(Queue::FAILED);\n }\n\n\n // exchange w messenger for save status.\n $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']);\n };\n\n $this->channel->basic_qos(null, 1, null);\n $this->channel->basic_consume('downloader', '', false, true, false, false, $callback);\n\n while(count($this->channel->callbacks)) {\n $this->channel->wait();\n }\n\n // return $queue;\n }", "function rabbitMqNotify(){\n $ini_file = parse_ini_file(\"/etc/airtime/airtime.conf\", true);\n $url = \"http://localhost/api/rabbitmq-do-push/format/json/api_key/\".$ini_file[\"general\"][\"api_key\"];\n\n echo \"Contacting $url\".PHP_EOL;\n $ch = curl_init($url);\n curl_exec($ch);\n curl_close($ch); \n}", "public function testChannelsSetTopic()\n {\n }", "private function initializeTransport() {}", "public function initialize()\n {\n parent::initialize();\n\n $this->setQueueOption('name', 'extract.targz');\n $this->enableDeadLettering();\n\n $this->setRouting('extract.targz');\n }" ]
[ "0.7575692", "0.7575692", "0.74529195", "0.7123474", "0.6875922", "0.68557775", "0.6830728", "0.6128487", "0.6049985", "0.59988195", "0.59988195", "0.5895419", "0.57978666", "0.5792032", "0.57797843", "0.5723695", "0.5673405", "0.5615131", "0.55901915", "0.55552036", "0.5502961", "0.5453305", "0.5416988", "0.5383199", "0.5348642", "0.5270653", "0.5181793", "0.5147573", "0.51250154", "0.49711317", "0.49607587", "0.4941249", "0.49232513", "0.48976934", "0.48610154", "0.48501503", "0.48175955", "0.48170507", "0.48084587", "0.48016834", "0.4801226", "0.4794442", "0.4714875", "0.4714875", "0.46935132", "0.46315235", "0.460252", "0.4584621", "0.45656526", "0.4557327", "0.45482665", "0.45482665", "0.45408455", "0.4512019", "0.44809937", "0.4471752", "0.4462735", "0.4408586", "0.4401044", "0.43987966", "0.4397556", "0.43654788", "0.4357047", "0.43552676", "0.43535033", "0.4347862", "0.4343416", "0.43271086", "0.43247914", "0.43211114", "0.43092707", "0.43051326", "0.42627895", "0.42436886", "0.42366886", "0.423567", "0.4229883", "0.42296413", "0.42125595", "0.4196115", "0.4192185", "0.41812253", "0.41621435", "0.4161271", "0.41612145", "0.415994", "0.41574314", "0.41456392", "0.41444632", "0.41179532", "0.40988278", "0.40956652", "0.40940037", "0.40740243", "0.4049266", "0.4035364", "0.40306017", "0.40258506", "0.40251365", "0.40217885" ]
0.6433663
7
Removes html tags from the text and slices it if its longer that the specified length
public function stripAndSlice($text, $maxLength, $addEllipsis = true) { if (empty($text)) { return ''; } // add a space when there are two adjacent tags $text = preg_replace('/(<\/[^>]+?>)(<[^>\/][^>]*?>)/', '$1 $2', $text); $text = trim(strip_tags($text)); if (strlen($text) > $maxLength) { $text = $addEllipsis ? substr($text, 0, $maxLength-3) . '...' : substr($text, 0, $maxLength); } return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function truncate($text, $length = 200)\n {\n $ending = '...';\n if(mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length)\n {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach($tags as $tag)\n {\n if(!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2]))\n {\n if(preg_match('/<[\\w]+[^>]*>/s', $tag[0]))\n {\n array_unshift($openTags, $tag[2]);\n }\n else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag))\n {\n $pos = array_search($closeTag[1], $openTags);\n if($pos !== false)\n {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if($contentLength + $totalLength > $length)\n {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if(preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE))\n {\n foreach($entities[0] as $entity)\n {\n if($entity[1] + 1 - $entitiesLength <= $left)\n {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n }\n else\n {\n break;\n }\n }\n }\n\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n }\n else\n {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if($totalLength >= $length)\n {\n break;\n }\n }\n\n $truncate .= $ending;\n\n foreach($openTags as $tag)\n {\n $truncate .= '</'.$tag.'>';\n }\n return $truncate;\n }", "function truncate ($text, $length = 100, $options = array()) {\n $default = array(\n 'ending' => '...', 'exact' => true, 'html' => false\n );\n $options = array_merge($default, $options);\n extract($options);\n if ($html) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($html) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n $truncate .= $ending;\n if ($html) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n return $truncate;\n}", "function truncate ($text, $length = 100, $options = array()) {\n $default = array(\n 'ending' => '...', 'exact' => true, 'html' => false\n );\n $options = array_merge($default, $options);\n extract($options);\n if ($html) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen(strip_tags($ending));\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($html) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n $truncate .= $ending;\n if ($html) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n return $truncate;\n}", "static function limit_content($str, $length)\n {\n $str = strip_tags($str);\n $str = str_replace('[/', '[', $str);\n $str = strip_shortcodes($str);\n $str = explode(\" \", $str);\n return implode(\" \", array_slice($str, 0, $length));\n }", "function fa_truncate_html( $string, $length = 80, $ending = '...' ){\n\tif( $length == 0 ){\n\t\treturn '';\n\t}\n\t\n\t$str_length = function_exists('mb_strlen') ? mb_strlen( preg_replace('/<.*?>/', '', $string )) : strlen( preg_replace('/<.*?>/', '', $string ) );\t\n\t// if text without HTML is smaller than length, return the whole text\n\tif ( $str_length <= $length ) {\n\t\treturn $string;\n\t}\n\t\n\t$truncated \t\t= '';\n\t$total_length \t= 0;\n\t$opened \t\t= array();\n\t$auto_closed \t= array('img','br','input','hr','area','base','basefont','col','frame','isindex','link','meta','param');\n\t\n\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $string, $tags, PREG_SET_ORDER);\n\t\n\tforeach( $tags as $tag ){\n\t\t$tag_name = strtolower( $tag[2] );\n\t\tif( !in_array( $tag_name, $auto_closed ) ){\n\t\t\tif ( preg_match('/<[\\w]+[^>]*>/s', $tag[0] ) ){\n\t\t\t\tarray_unshift( $opened, $tag[2] );\n\t\t\t} else if ( preg_match( '/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag ) ){\n\t\t\t\t$pos = array_search( $closeTag[1], $opened );\n\t\t\t\tif ( $pos !== false ) {\n\t\t\t\t\tarray_splice( $opened, $pos, 1 );\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}\n\t\t// if empty, it's plain text\n\t\tif( !empty( $tag[2] ) ){\n\t\t\t$truncated .= $tag[1];\n\t\t}\t\n\t\t// calculate string length\n\t\t$string_length = function_exists( 'mb_strlen' ) ? mb_strlen( $tag[3] ) : strlen( $tag[3] );\n\t\tif( $total_length + $string_length <= $length ){\n\t\t\t$truncated .= $tag[3];\n\t\t\t$total_length += $string_length;\n\t\t}else{\n\t\t\tif( $total_length == 0 ){\n\t\t\t\t$truncated .= function_exists( 'mb_substr' ) ? mb_substr( $tag[3], 0, $length ) . $ending : substr( $tag[3], 0, $length ) . $ending;\n\t\t\t\tbreak;\t\n\t\t\t}\n\t\t\t$diff = $length - $total_length;\n\t\t\t$truncated .= function_exists( 'mb_substr' ) ? mb_substr( $tag[3], 0, $diff ) . $ending : substr( $tag[3], 0, $diff ) . $ending;\n\t\t\tbreak;\n\t\t}\t\t\n\t}\n\t// close all opened tags\n\tforeach ( $opened as $tag ) {\n\t\t$truncated .= '</'.$tag.'>';\n\t}\n\treturn $truncated;\n}", "function getSubString($string, $length=NULL){\n if ($length == NULL)\n $length = 50;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n}", "function shorten( $text, $length ) {\n $text = strip_tags( $text );\n\n $length = abs( (int)$length );\n if ( strlen( $text ) > $length ) $text = preg_replace( \"/^(.{1,$length})(\\s.*|$)/s\", '\\\\1...', $text );\n return ( $text );\n }", "public static function getSubString($string, $length=NULL)\n{\n if ($length == NULL)\n $length = 50;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n}", "function me_trim_by_characters_with_html( $text, $length = 45, $append = '&hellip;', $allowable_tags = '<b><em><a>' ) {\n $length = (int) $length;\n $text = trim( strip_tags( $text, $allowable_tags ) );\n // if the length without tags is less than our target we are done\n if ( strlen( strip_tags( $text ) ) < $length )\n return $text;\n // count forward to find the $length character in unstripped $text not counting tags\n for ($i = 0, $j = 0, $l = strlen( $text ), $in_tag = false; $i < $l && ( $in_tag || $j < $length ); $i++) :\n switch ( $text[$i] ) :\n case '<': $in_tag = true; break;\n case '>': $in_tag = false; break;\n default :\n if ( ! $in_tag ) $j++;\n endswitch;\n endfor;\n // Step forward one and check for whitespace. If none, go back and find the last place we ended a word or html tag\n if ( isset( $text[$i++] ) )\n while ( ' ' != $text[$i] && '&nbsp;' != $text[$i] && '>' != $text[$i - 1] ) $i--;\n\n return balanceTags( substr( $text, 0, $i ), true ) . $append;\n}", "function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {\r\n if ($considerHtml) {\r\n // if the plain text is shorter than the maximum length, return the whole text\r\n if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\r\n return $text;\r\n }\r\n // splits all html-tags to scanable lines\r\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\r\n $total_length = strlen($ending);\r\n $open_tags = array();\r\n $truncate = '';\r\n foreach ($lines as $line_matchings) {\r\n // if there is any html-tag in this line, handle it and add it (uncounted) to the output\r\n if (!empty($line_matchings[1])) {\r\n // if it's an \"empty element\" with or without xhtml-conform closing slash\r\n if (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\r\n // do nothing\r\n // if tag is a closing tag\r\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\r\n // delete tag from $open_tags list\r\n $pos = array_search($tag_matchings[1], $open_tags);\r\n if ($pos !== false) {\r\n unset($open_tags[$pos]);\r\n }\r\n // if tag is an opening tag\r\n } else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\r\n // add tag to the beginning of $open_tags list\r\n array_unshift($open_tags, strtolower($tag_matchings[1]));\r\n }\r\n // add html-tag to $truncate'd text\r\n $truncate .= $line_matchings[1];\r\n }\r\n // calculate the length of the plain text part of the line; handle entities as one character\r\n $content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\r\n if ($total_length+$content_length> $length) {\r\n // the number of characters which are left\r\n $left = $length - $total_length;\r\n $entities_length = 0;\r\n // search for html entities\r\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\r\n // calculate the real length of all entities in the legal range\r\n foreach ($entities[0] as $entity) {\r\n if ($entity[1]+1-$entities_length <= $left) {\r\n $left--;\r\n $entities_length += strlen($entity[0]);\r\n } else {\r\n // no more characters left\r\n break;\r\n }\r\n }\r\n }\r\n $truncate .= substr($line_matchings[2], 0, $left+$entities_length);\r\n // maximum lenght is reached, so get off the loop\r\n break;\r\n } else {\r\n $truncate .= $line_matchings[2];\r\n $total_length += $content_length;\r\n }\r\n // if the maximum length is reached, get off the loop\r\n if($total_length>= $length) {\r\n break;\r\n }\r\n }\r\n } else {\r\n if (strlen($text) <= $length) {\r\n return $text;\r\n } else {\r\n $truncate = substr($text, 0, $length - strlen($ending));\r\n }\r\n }\r\n // if the words shouldn't be cut in the middle...\r\n if (!$exact) {\r\n // ...search the last occurance of a space...\r\n $spacepos = strrpos($truncate, ' ');\r\n if (isset($spacepos)) {\r\n // ...and cut the text in this position\r\n $truncate = substr($truncate, 0, $spacepos);\r\n }\r\n }\r\n // add the defined ending to the text\r\n $truncate .= $ending;\r\n if($considerHtml) {\r\n // close all unclosed html-tags\r\n foreach ($open_tags as $tag) {\r\n $truncate .= '</' . $tag . '>';\r\n }\r\n }\r\n return $truncate;\r\n}", "function truncate_it($length, $string)\n{\n if (strlen(strip_tags($string)) < $length) {\n return strip_tags($string);\n }\n return substr(strip_tags($string), 0, $length) . '...';\n}", "function publisher_truncateTagSafe($string, $length = 80, $etc = '...', $break_words = false)\r\n{\r\n if ($length == 0) return '';\r\n\r\n if (strlen($string) > $length) {\r\n $length -= strlen($etc);\r\n if (!$break_words) {\r\n $string = preg_replace('/\\s+?(\\S+)?$/', '', substr($string, 0, $length + 1));\r\n $string = preg_replace('/<[^>]*$/', '', $string);\r\n $string = publisher_closeTags($string);\r\n }\r\n return $string . $etc;\r\n } else {\r\n return $string;\r\n }\r\n}", "function getSubString($string, $length=NULL) {\n if ($length == NULL)\n $length = 45;\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n }", "public function excerpt($length)\n {\n return \\Str::limit(strip_tags($this->bodyHtml()), $length, '...');\n }", "function wp_article_truncate($text, $length = 100, $options = array()) {\r\n\t$default = array(\r\n\t\t'ellipsis' => '...', 'exact' => true, 'html' => false\r\n\t);\r\n\tif (isset($options['ending'])) {\r\n\t\t$default['ellipsis'] = $options['ending'];\r\n\t} elseif (!empty($options['html']) && Configure::read('App.encoding') == 'UTF-8') {\r\n\t\t$default['ellipsis'] = \"\\xe2\\x80\\xa6\";\r\n\t}\r\n\t$options = array_merge($default, $options);\r\n\textract($options);\r\n\r\n\tif (!function_exists('mb_strlen')) {\r\n\t\tclass_exists('Multibyte');\r\n\t}\r\n\r\n\tif ($html) {\r\n\t\tif (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t\t$totalLength = mb_strlen(strip_tags($ellipsis));\r\n\t\t$openTags = array();\r\n\t\t$truncate = '';\r\n\r\n\t\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\r\n\t\tforeach ($tags as $tag) {\r\n\t\t\tif (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\r\n\t\t\t\tif (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\r\n\t\t\t\t\tarray_unshift($openTags, $tag[2]);\r\n\t\t\t\t} elseif (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\r\n\t\t\t\t\t$pos = array_search($closeTag[1], $openTags);\r\n\t\t\t\t\tif ($pos !== false) {\r\n\t\t\t\t\t\tarray_splice($openTags, $pos, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$truncate .= $tag[1];\r\n\r\n\t\t\t$contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\r\n\t\t\tif ($contentLength + $totalLength > $length) {\r\n\t\t\t\t$left = $length - $totalLength;\r\n\t\t\t\t$entitiesLength = 0;\r\n\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\r\n\t\t\t\t\tforeach ($entities[0] as $entity) {\r\n\t\t\t\t\t\tif ($entity[1] + 1 - $entitiesLength <= $left) {\r\n\t\t\t\t\t\t\t$left--;\r\n\t\t\t\t\t\t\t$entitiesLength += mb_strlen($entity[0]);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\t$truncate .= $tag[3];\r\n\t\t\t\t$totalLength += $contentLength;\r\n\t\t\t}\r\n\t\t\tif ($totalLength >= $length) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tif (mb_strlen($text) <= $length) {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t\t$truncate = mb_substr($text, 0, $length - mb_strlen($ellipsis));\r\n\t}\r\n\tif (!$exact) {\r\n\t\t$spacepos = mb_strrpos($truncate, ' ');\r\n\t\tif ($html) {\r\n\t\t\t$truncateCheck = mb_substr($truncate, 0, $spacepos);\r\n\t\t\t$lastOpenTag = mb_strrpos($truncateCheck, '<');\r\n\t\t\t$lastCloseTag = mb_strrpos($truncateCheck, '>');\r\n\t\t\tif ($lastOpenTag > $lastCloseTag) {\r\n\t\t\t\tpreg_match_all('/<[\\w]+[^>]*>/s', $truncate, $lastTagMatches);\r\n\t\t\t\t$lastTag = array_pop($lastTagMatches[0]);\r\n\t\t\t\t$spacepos = mb_strrpos($truncate, $lastTag) + mb_strlen($lastTag);\r\n\t\t\t}\r\n\t\t\t$bits = mb_substr($truncate, $spacepos);\r\n\t\t\tpreg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\r\n\t\t\tif (!empty($droppedTags)) {\r\n\t\t\t\tif (!empty($openTags)) {\r\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\r\n\t\t\t\t\t\tif (!in_array($closingTag[1], $openTags)) {\r\n\t\t\t\t\t\t\tarray_unshift($openTags, $closingTag[1]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\r\n\t\t\t\t\t\t$openTags[] = $closingTag[1];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$truncate = mb_substr($truncate, 0, $spacepos);\r\n\t}\r\n\t$truncate .= $ellipsis;\r\n\r\n\tif ($html) {\r\n\t\tforeach ($openTags as $tag) {\r\n\t\t\t$truncate .= '</' . $tag . '>';\r\n\t\t}\r\n\t}\r\n\r\n\treturn $truncate;\r\n}", "public function truncate($text, $length = 150, $ending = '...', $exact = false, $considerHtml = true)\r\n {\r\n if ($considerHtml) {\r\n if (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\r\n return $text;\r\n }\r\n\r\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\r\n\r\n $total_length = strlen($ending);\r\n $open_tags = array();\r\n $truncate = '';\r\n\r\n foreach ($lines as $line_matchings) {\r\n if (!empty($line_matchings[1])) {\r\n if (preg_match(\r\n '/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\r\n\r\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\r\n $pos = array_search($tag_matchings[1], $open_tags);\r\n if ($pos !== false) {\r\n unset($open_tags[$pos]);\r\n }\r\n } else if (preg_match('/^<s*([^s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\r\n array_unshift($open_tags, strtolower($tag_matchings[1]));\r\n }\r\n $truncate .= $line_matchings[1];\r\n }\r\n $content_length = strlen(\r\n preg_replace(\r\n '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\r\n if ($total_length + $content_length > $length) {\r\n $left = $length - $total_length;\r\n $entities_length = 0;\r\n if (preg_match_all(\r\n '/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\r\n foreach ($entities[0] as $entity) {\r\n if ($entity[1] + 1 - $entities_length <= $left) {\r\n $left--;\r\n $entities_length += strlen($entity[0]);\r\n } else {\r\n break;\r\n }\r\n }\r\n }\r\n $truncate .= substr($line_matchings[2], 0, $left + $entities_length);\r\n break;\r\n } else {\r\n $truncate .= $line_matchings[2];\r\n $total_length += $content_length;\r\n }\r\n if ($total_length >= $length) {\r\n break;\r\n }\r\n }\r\n } else {\r\n if (strlen($text) <= $length) {\r\n return $text;\r\n } else {\r\n $truncate = substr($text, 0, $length - strlen($ending));\r\n }\r\n }\r\n\r\n if (!$exact) {\r\n $spacepos = strrpos($truncate, ' ');\r\n if (isset($spacepos)) {\r\n $truncate = substr($truncate, 0, $spacepos);\r\n }\r\n }\r\n $truncate .= $ending;\r\n\r\n if ($considerHtml) {\r\n foreach ($open_tags as $tag) {\r\n $truncate .= '</' . $tag . '>';\r\n }\r\n }\r\n\r\n return $truncate;\r\n }", "function cmshowcase_truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false) {\n if (is_array($ending)) {\n extract($ending);\n }\n if ($considerHtml) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen($ending);\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - strlen($ending));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($considerHtml) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n\n $truncate .= $ending;\n\n if ($considerHtml) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n\n return $truncate;\n }", "function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) {\n\t\t\tif ($considerHtml) {\n\t\t\t\t// if the plain text is shorter than the maximum length, return the whole text\n\t\t\t\tif (strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n\t\t\t\t\treturn $text;\n\t\t\t\t}\n\t\t\t\t// splits all html-tags to scanable lines\n\t\t\t\tpreg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\n\t\t\t\t$total_length = strlen($ending);\n\t\t\t\t$open_tags = array();\n\t\t\t\t$truncate = '';\n\t\t\t\tforeach ($lines as $line_matchings) {\n\t\t\t\t\t// if there is any html-tag in this line, handle it and add it (uncounted) to the output\n\t\t\t\t\tif (!empty($line_matchings[1])) {\n\t\t\t\t\t\t// if it's an \"empty element\" with or without xhtml-conform closing slash\n\t\t\t\t\t\tif (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\n\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t// if tag is a closing tag\n\t\t\t\t\t\t} else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\n\t\t\t\t\t\t\t// delete tag from $open_tags list\n\t\t\t\t\t\t\t$pos = array_search($tag_matchings[1], $open_tags);\n\t\t\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\t\tunset($open_tags[$pos]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t// if tag is an opening tag\n\t\t\t\t\t\t} else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\n\t\t\t\t\t\t\t// add tag to the beginning of $open_tags list\n\t\t\t\t\t\t\tarray_unshift($open_tags, strtolower($tag_matchings[1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// add html-tag to $truncate'd text\n\t\t\t\t\t\t$truncate .= $line_matchings[1];\n\t\t\t\t\t}\n\t\t\t\t\t// calculate the length of the plain text part of the line; handle entities as one character\n\t\t\t\t\t$content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\n\t\t\t\t\tif ($total_length+$content_length> $length) {\n\t\t\t\t\t\t// the number of characters which are left\n\t\t\t\t\t\t$left = $length - $total_length;\n\t\t\t\t\t\t$entities_length = 0;\n\t\t\t\t\t\t// search for html entities\n\t\t\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t\t\t\t// calculate the real length of all entities in the legal range\n\t\t\t\t\t\t\tforeach ($entities[0] as $entity) {\n\t\t\t\t\t\t\t\tif ($entity[1]+1-$entities_length <= $left) {\n\t\t\t\t\t\t\t\t\t$left--;\n\t\t\t\t\t\t\t\t\t$entities_length += strlen($entity[0]);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// no more characters left\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$truncate .= substr($line_matchings[2], 0, $left+$entities_length);\n\t\t\t\t\t\t// maximum lenght is reached, so get off the loop\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$truncate .= $line_matchings[2];\n\t\t\t\t\t\t$total_length += $content_length;\n\t\t\t\t\t}\n\t\t\t\t\t// if the maximum length is reached, get off the loop\n\t\t\t\t\tif($total_length>= $length) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (strlen($text) <= $length) {\n\t\t\t\t\treturn $text;\n\t\t\t\t} else {\n\t\t\t\t\t$truncate = substr($text, 0, $length - strlen($ending));\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if the words shouldn't be cut in the middle...\n\t\t\tif (!$exact) {\n\t\t\t\t// ...search the last occurance of a space...\n\t\t\t\t$spacepos = strrpos($truncate, ' ');\n\t\t\t\tif (isset($spacepos)) {\n\t\t\t\t\t// ...and cut the text in this position\n\t\t\t\t\t$truncate = substr($truncate, 0, $spacepos);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// add the defined ending to the text\n\t\t\t$truncate .= $ending;\n\t\t\tif($considerHtml) {\n\t\t\t\t// close all unclosed html-tags\n\t\t\t\tforeach ($open_tags as $tag) {\n\t\t\t\t\t$truncate .= '</' . $tag . '>';\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $truncate;\n\t\t}", "function truncate($text, $length) {\r\n $length = abs((int)$length);\r\n \r\n if(strlen($text) > $length) {\r\n $text = preg_replace(\"/^(.{1,$length})(\\s.*|$)/s\", '\\\\1...', $text);\r\n }\r\n \r\n return($text); \r\n}", "function truncate_html_str ($s, $MAX_LENGTH, &$trunc_str_len) {\n\n\t$trunc_str_len=0;\n\n\tif (func_num_args()>3) {\n\t\t$add_ellipsis = func_get_arg(3);\n\n\t} else {\n\t\t$add_ellipsis = true;\n\t}\n\n\tif (func_num_args()>4) {\n\t\t$with_tags = func_get_arg(4);\n\n\t} else {\n\t\t$with_tags = false;\n\t}\n\n\tif ($with_tags){\n\t\t$tag_expr = \"|<[^>]+>\";\n\n\t}\n\n\t$offset = 0; $character_count=0;\n\t# match a character, or characters encoded as html entity\n\t# treat each match as a single character\n\t#\n\twhile ((preg_match ('/(&#?[0-9A-z]+;'.$tag_expr.'|.|\\n)/', $s, $maches, PREG_OFFSET_CAPTURE, $offset) && ($character_count < $MAX_LENGTH))) {\n\t\t$offset += strlen($maches[0][0]);\n\t\t$character_count++;\n\t\t$str .= $maches[0][0];\n\t\t\n\t\n\t}\n\tif (($character_count == $MAX_LENGTH)&&($add_ellipsis)) {\n\t\t$str = $str.\"...\";\n\t}\n\t$trunc_str_len = $character_count;\n\treturn $str;\n\n \n}", "static function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false)\n {\n if ($considerHtml) {\n // if the plain text is shorter than the maximum length, return the whole text\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n\n // splits all html-tags to scanable lines\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\n\n $total_length = mb_strlen($ending);\n $open_tags = array();\n $truncate = '';\n\n foreach ($lines as $line_matchings) {\n // if there is any html-tag in this line, handle it and add it (uncounted) to the output\n if (!empty($line_matchings[1])) {\n // if it's an \"empty element\" with or without xhtml-conform closing slash (f.e. <br/>)\n if (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\n // do nothing\n // if tag is a closing tag (f.e. </b>)\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\n // delete tag from $open_tags list\n $pos = array_search($tag_matchings[1], $open_tags);\n if ($pos !== false) {\n unset($open_tags[$pos]);\n }\n // if tag is an opening tag (f.e. <b>)\n } else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\n // add tag to the beginning of $open_tags list\n array_unshift($open_tags, strtolower($tag_matchings[1]));\n }\n // add html-tag to $truncate'd text\n $truncate .= $line_matchings[1];\n }\n\n // calculate the length of the plain text part of the line; handle entities as one character\n $content_length = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\n if ($total_length + $content_length > $length) {\n // the number of characters which are left\n $left = $length - $total_length;\n $entities_length = 0;\n // search for html entities\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\n // calculate the real length of all entities in the legal range\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entities_length <= $left) {\n $left--;\n $entities_length += strlen($entity[0]);\n } else {\n // no more characters left\n break;\n }\n }\n }\n $truncate .= mb_substr($line_matchings[2], 0, $left + $entities_length);\n // maximum lenght is reached, so get off the loop\n break;\n } else {\n $truncate .= $line_matchings[2];\n $total_length += $content_length;\n }\n\n // if the maximum length is reached, get off the loop\n if ($total_length >= $length) {\n break;\n }\n }\n } else {\n $text = strip_tags($text);\n if (strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - strlen($ending));\n }\n }\n\n // if the words shouldn't be cut in the middle...\n if (!$exact) {\n // ...search the last occurance of a space...\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n // ...and cut the text in this position\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n\n // add the defined ending to the text\n $truncate .= $ending;\n\n if ($considerHtml) {\n // close all unclosed html-tags\n foreach ($open_tags as $tag) {\n $truncate .= '</' . $tag . '>';\n }\n }\n\n return $truncate;\n }", "public function excerpt($length = 300);", "public static function truncate($html, $maxLength = 0)\n\t{\n\t\t$baseLength = strlen($html);\n\n\t\t// First get the plain text string. This is the rendered text we want to end up with.\n\t\t$ptString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = false);\n\n\t\tfor ($maxLength; $maxLength < $baseLength;)\n\t\t{\n\t\t\t// Now get the string if we allow html.\n\t\t\t$htmlString = JHtml::_('string.truncate', $html, $maxLength, $noSplit = true, $allowHtml = true);\n\n\t\t\t// Now get the plain text from the html string.\n\t\t\t$htmlStringToPtString = JHtml::_('string.truncate', $htmlString, $maxLength, $noSplit = true, $allowHtml = false);\n\n\t\t\t// If the new plain text string matches the original plain text string we are done.\n\t\t\tif ($ptString == $htmlStringToPtString)\n\t\t\t{\n\t\t\t\treturn $htmlString;\n\t\t\t}\n\n\t\t\t// Get the number of html tag characters in the first $maxlength characters\n\t\t\t$diffLength = strlen($ptString) - strlen($htmlStringToPtString);\n\n\t\t\t// Set new $maxlength that adjusts for the html tags\n\t\t\t$maxLength += $diffLength;\n\n\t\t\tif ($baseLength <= $maxLength || $diffLength <= 0)\n\t\t\t{\n\t\t\t\treturn $htmlString;\n\t\t\t}\n\t\t}\n\n\t\treturn $html;\n\t}", "function string_cut_string($str, $length)\r\n\t{\r\n\t\t$str = strip_tags($str);\r\n\t\t/*\r\n\t\tif(strpos($str, \" \") === false) {\r\n\t\t\t$str = wordwrap($str, 25, \"<br />\\n\", true);\r\n\t\t}\r\n\t\t*/\r\n\t\tif (strlen($str) > $length)\r\n\t\t{\r\n\t\t\t$str = substr($str, 0, $length);\r\n\t\t\t$last_space = strrpos($str, \" \");\r\n\t\t\t$str = substr($str, 0, $last_space).\"...\";\r\n\t\t} \r\n\r\n\t\treturn $str;\r\n\t}", "public function getSubString($string, $length = 30) {\n //Primero eliminamos las etiquetas html y luego cortamos el string\n $stringDisplay = substr(strip_tags($string), 0, $length);\n //Si el texto es mayor que la longitud se agrega puntos suspensivos\n if (strlen(strip_tags($string)) > $length)\n $stringDisplay .= ' ...';\n return $stringDisplay;\n }", "function string_truncate_string($str, $length = 100, $ending = '...', $exact = false, $considerHtml = true)\r\n\t{\r\n\t\tif ($considerHtml)\r\n\t\t{\r\n\t\t\t// if the plain text is shorter than the maximum length, return the whole text\r\n\t\t\tif (strlen(preg_replace('/<.*?>/', '', $str)) <= $length)\r\n\t\t\t{\r\n\t\t\t\treturn $str;\r\n\t\t\t}\r\n\t\t\t// splits all html-tags to scanable lines\r\n\t\t\tpreg_match_all('/(<.+?>)?([^<>]*)/s', $str, $lines, PREG_SET_ORDER);\r\n\t\t\t$total_length = strlen($ending);\r\n\t\t\t$open_tags = array();\r\n\t\t\t$truncate = '';\r\n\t\t\tforeach ($lines as $line_matchings)\r\n\t\t\t{\r\n\t\t\t\t// if there is any html-tag in this line, handle it and add it (uncounted) to the output\r\n\t\t\t\tif (!empty($line_matchings[1]))\r\n\t\t\t\t{\r\n\t\t\t\t\t// if it's an \"empty element\" with or without xhtml-conform closing slash (f.e. <br/>)\r\n\t\t\t\t\tif (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// do nothing\r\n\t\t\t\t\t// if tag is a closing tag (f.e. </b>)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// delete tag from $open_tags list\r\n\t\t\t\t\t\t$pos = array_search($tag_matchings[1], $open_tags);\r\n\t\t\t\t\t\tif ($pos !== false) {\r\n\t\t\t\t\t\t\tunset($open_tags[$pos]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t// if tag is an opening tag (f.e. <b>)\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// add tag to the beginning of $open_tags list\r\n\t\t\t\t\t\tarray_unshift($open_tags, strtolower($tag_matchings[1]));\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// add html-tag to $truncate'd text\r\n\t\t\t\t\t$truncate .= $line_matchings[1];\r\n\t\t\t\t}\r\n\t\t\t\t// calculate the length of the plain text part of the line; handle entities as one character\r\n\t\t\t\t$content_length = strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\r\n\t\t\t\tif ($total_length+$content_length> $length)\r\n\t\t\t\t{\r\n\t\t\t\t\t// the number of characters which are left\r\n\t\t\t\t\t$left = $length - $total_length;\r\n\t\t\t\t\t$entities_length = 0;\r\n\t\t\t\t\t// search for html entities\r\n\t\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// calculate the real length of all entities in the legal range\r\n\t\t\t\t\t\tforeach ($entities[0] as $entity)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif ($entity[1]+1-$entities_length <= $left)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$left--;\r\n\t\t\t\t\t\t\t\t$entities_length += strlen($entity[0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// no more characters left\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$truncate .= substr($line_matchings[2], 0, $left+$entities_length);\r\n\t\t\t\t\t// maximum lenght is reached, so get off the loop\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$truncate .= $line_matchings[2];\r\n\t\t\t\t\t$total_length += $content_length;\r\n\t\t\t\t}\r\n\t\t\t\t// if the maximum length is reached, get off the loop\r\n\t\t\t\tif ($total_length>= $length)\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (strlen(strip_tags($str)) <= $length)\r\n\t\t\t{\r\n\t\t\t\treturn strip_tags($str);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$truncate = substr(strip_tags($str), 0, $length - strlen($ending));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// if the words shouldn't be cut in the middle...\r\n\t\tif (!$exact)\r\n\t\t{\r\n\t\t\t// ...search the last occurance of a space...\r\n\t\t\t$spacepos = strrpos($truncate, ' ');\r\n\t\t\tif (isset($spacepos))\r\n\t\t\t{\r\n\t\t\t\t// ...and cut the text in this position\r\n\t\t\t\t$truncate = substr($truncate, 0, $spacepos);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add the defined ending to the text\r\n\t\t$truncate .= $ending;\r\n\t\tif ($considerHtml)\r\n\t\t{\r\n\t\t\t// close all unclosed html-tags\r\n\t\t\tforeach ($open_tags as $tag)\r\n\t\t\t{\r\n\t\t\t\t$truncate .= '</' . $tag . '>';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $truncate;\r\n\t}", "function smarty_modifier_html_truncate($string, $length = 80, $etc = '...', $break_words = false, $middle = false)\n{\n require_once SMARTY_PLUGINS_DIR.'modifier.truncate.php';\n\n if ($length == 0) {\n return '';\n }\n\n // strlen > $length\n if (!isset($string[$length])) {\n return $string;\n }\n\n // use original modifier when possible\n if (strpos($string, '<') === false) {\n return smarty_modifier_truncate($string, $length, $etc, $break_words, $middle);\n }\n\n // would it be short enough if we drop the tags from count?\n if (!isset(strip_tags($string)[$length])) {\n return $string;\n }\n\n // calculate the position to calculate the length and truncate using original function\n $parts = preg_split('#(<[^>]+>)#', $string, -1, PREG_SPLIT_OFFSET_CAPTURE | PREG_SPLIT_DELIM_CAPTURE);\n $reallength = 0;\n $taglength = 0;\n $lastpos = 0;\n foreach ($parts as $part) {\n $len = $part[1] - $lastpos;\n if (strpos($part[0], '<') === 0) {\n $reallength += $len;\n } else {\n $taglength += $len;\n }\n $lastpos = $part[1];\n\n if ($reallength >= $length) {\n $string = smarty_modifier_truncate($string, $length+$taglength, $etc, $break_words, $middle);\n break;\n }\n }\n\n // get all opening tags\n preg_match_all('#<([^/][^>]*)>#i', $string, $start_tags);\n $start_tags = $start_tags[1];\n\n // get all closing tags\n preg_match_all('#</([a-z]+)>#i', $string, $end_tags);\n $end_tags = $end_tags[1];\n\n // gather tags that need to be closed\n $need_close = [];\n foreach ($start_tags as $tag) {\n $pos = array_search($tag, $end_tags);\n if ($pos !== false) {\n unset($end_tags[$pos]);\n } else {\n $need_close[] = $tag;\n }\n } // foreach\n\n // close all remaining open tags in reverse order\n $need_close = array_reverse($need_close);\n foreach ($need_close as $tag) {\n $string .= '</'.$tag.'>';\n }\n\n return $string;\n}", "public function excerpt($length = 600): string\n {\n return str_limit(strip_tags($this->description), $length);\n }", "function maat_variable_length_excerpt($text, $length, $finish_sentence = 1)\n{\n\n $tokens = array();\n $out = '';\n $word = 0;\n\n //Divide the string into tokens; HTML tags, or words, followed by any whitespace.\n $regex = '/(<[^>]+>|[^<>\\s]+)\\s*/u';\n preg_match_all($regex, $text, $tokens);\n foreach ($tokens[0] as $t) {\n //Parse each token\n if ($word >= $length && !$finish_sentence) {\n //Limit reached\n break;\n }\n if ($t[0] != '<') {\n //Token is not a tag.\n //Regular expression that checks for the end of the sentence: '.', '?' or '!'\n $regex1 = '/[\\?\\.\\!]\\s*$/uS';\n if ($word >= $length && $finish_sentence && preg_match($regex1, $t) == 1) {\n //Limit reached, continue until ? . or ! occur to reach the end of the sentence.\n $out .= trim($t);\n break;\n }\n $word++;\n }\n //Append what's left of the token.\n $out .= $t;\n }\n //Add the excerpt ending as a link.\n $excerpt_end = '';\n\n //Add the excerpt ending as a non-linked ellipsis with brackets.\n //$excerpt_end = ' [&hellip;]';\n\n //Append the excerpt ending to the token.\n $out .= $excerpt_end;\n\n return trim(force_balance_tags($out));\n}", "function clean($str, $length) {\n return Str::limit(trim(preg_replace('/\\s\\s+/', ' ', strip_tags(preg_replace('/<br(\\s+)?\\/?>/i', \" \", $str)), $length)));\n }", "function trim_text($input, $length, $ellipses = true, $strip_html = true) {\r\n if ($strip_html) {\r\n $input = strip_tags($input);\r\n }\r\n\r\n //no need to trim, already shorter than trim length\r\n if (strlen($input) <= $length) {\r\n return $input;\r\n }\r\n\r\n //find last space within length\r\n $last_space = strrpos(substr($input, 0, $length), ' ');\r\n $trimmed_text = substr($input, 0, $last_space);\r\n\r\n //add ellipses (...)\r\n if ($ellipses) {\r\n $trimmed_text .= '...';\r\n }\r\n\r\n return $trimmed_text;\r\n}", "function trim_text($input, $length = 100, $ellipses = true, $strip_html = true)\n{\n //strip tags, if desired\n if ($strip_html) {\n $input = strip_tags($input);\n }\n\n //no need to trim, already shorter than trim length\n if (strlen($input) <= $length) {\n return $input;\n }\n\n //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\n //add ellipses (...)\n if ($ellipses) {\n $trimmed_text .= '...';\n }\n\n return $trimmed_text;\n}", "public function limit($text, $length = 100, $end = '…', $exact = true) {\n\t\tif (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n\t\t\treturn $text;\n\t\t}\n\t\t$totalLength = mb_strlen(strip_tags($end));\n\t\t$openTags = [];\n\t\t$truncate = '';\n\n\t\tpreg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n\t\tforeach ($tags as $tag) {\n\t\t\tif (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n\t\t\t\tif (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n\t\t\t\t\tarray_unshift($openTags, $tag[2]);\n\t\t\t\t} elseif (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n\t\t\t\t\t$pos = array_search($closeTag[1], $openTags);\n\t\t\t\t\tif ($pos !== false) {\n\t\t\t\t\t\tarray_splice($openTags, $pos, 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$truncate .= $tag[1];\n\n\t\t\t$contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n\t\t\tif ($contentLength + $totalLength > $length) {\n\t\t\t\t$left = $length - $totalLength;\n\t\t\t\t$entitiesLength = 0;\n\t\t\t\tif (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n\t\t\t\t\tforeach ($entities[0] as $entity) {\n\t\t\t\t\t\tif ($entity[1] + 1 - $entitiesLength <= $left) {\n\t\t\t\t\t\t\t$left--;\n\t\t\t\t\t\t\t$entitiesLength += mb_strlen($entity[0]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$truncate .= $tag[3];\n\t\t\t\t$totalLength += $contentLength;\n\t\t\t}\n\t\t\tif ($totalLength >= $length) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!$exact) {\n\t\t\t$spacepos = mb_strrpos($truncate, ' ');\n\t\t\t$truncateCheck = mb_substr($truncate, 0, $spacepos);\n\t\t\t$lastOpenTag = mb_strrpos($truncateCheck, '<');\n\t\t\t$lastCloseTag = mb_strrpos($truncateCheck, '>');\n\n\t\t\tif ($lastOpenTag > $lastCloseTag) {\n\t\t\t\tpreg_match_all('/<[\\w]+[^>]*>/s', $truncate, $lastTagMatches);\n\t\t\t\t$lastTag = array_pop($lastTagMatches[0]);\n\t\t\t\t$spacepos = mb_strrpos($truncate, $lastTag) + mb_strlen($lastTag);\n\t\t\t}\n\t\t\t$bits = mb_substr($truncate, $spacepos);\n\t\t\tpreg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n\n\t\t\tif (!empty($droppedTags)) {\n\t\t\t\tif (!empty($openTags)) {\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\tif (!in_array($closingTag[1], $openTags)) {\n\t\t\t\t\t\t\tarray_unshift($openTags, $closingTag[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tforeach ($droppedTags as $closingTag) {\n\t\t\t\t\t\tarray_push($openTags, $closingTag[1]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$truncate = mb_substr($truncate, 0, $spacepos);\n\t\t}\n\t\t$truncate .= $end;\n\n\t\tforeach ($openTags as $tag) {\n\t\t\t$truncate .= '</' . $tag . '>';\n\t\t}\n\t\treturn $truncate;\n\t}", "function snip(\n\tstring $text = '',\n\tint $length = 50,\n\tstring $length_type = 'words',\n\tstring $finish = 'word'\n): string {\n\t$ellipsis = '&hellip;';\n\t$tokens = [];\n\t$allowed_tags = [\n\t'abbr', 'acronym', 'address', 'cite', 'code', 'del', 'ins',\n\t'q', 's', 'strike', 'sub', 'sup', 'time'\n\t];\n\t$tag_string = [];\n\t$out = '';\n\t$w = 0;\n\t$shortened = false;\n\n // From the default wp_trim_excerpt():\n // No shortcodes!\n\t$text = strip_shortcodes($text);\n\n // From the default wp_trim_excerpt():\n // Some kind of precaution against malformed CDATA in RSS feeds I suppose\n\t$text = str_replace(']]>', ']]&gt;', $text);\n\n // Make array of allowed tags\n\t$tag_string = '<' . implode('><', $allowed_tags) . '>';\n\n // Remove all but the allowed tags\n\t$text = wp_strip_all_tags($text, $tag_string);\n\n // Divide the string into tokens; HTML tags, or words, followed by any whitespace\n // (<[^>]+>|[^<>\\s]+\\s*)\n\tpreg_match_all('/(<[^>]+>|[^<>\\s]+)\\s*/u', $text, $tokens);\n\tforeach ($tokens[0] as $t) { // Parse each token\n\t\tif ($w >= $length && 'sentence' != $finish) { // Limit reached\n\t\t\tbreak;\n\t\t}\n\t\tif ($t[0] != '<') { // Token is not a tag\n\t\t\tif (\n\t\t\t\t$w >= $length && 'sentence' == $finish\n\t\t\t\t&& preg_match('/[\\?\\.\\!]\\s*$/uS', $t) == 1\n\t\t\t) { // Limit reached, continue until ? . or ! occur at the end\n\t\t\t\t$out .= trim($t);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ('words' == $length_type) { // Count words\n\t\t\t\t$w++;\n\t\t\t} else { // Count/trim characters\n\t\t\t\t$chars = trim($t); // Remove surrounding space\n\t\t\t\t$c = strlen($chars);\n\t\t\t\tif ($c + $w > $length && 'sentence' != $finish) { // Token is too long\n\t\t\t\t\t$c = ( 'word' == $finish ) ? $c : $length - $w; // Keep token to finish word\n\t\t\t\t\t$t = substr($t, 0, $c);\n\t\t\t\t}\n\t\t\t\t$w += $c;\n\t\t\t}\n\t\t}\n\t // Append what's left of the token\n\t\t$out .= $t;\n\t}\n\n // Check to see if any trimming took place\n\tif (strlen($out) < strlen($text)) {\n\t\t$shortened = true;\n\t}\n\n // Trim whitespace\n\t$out = trim(force_balance_tags($out));\n\n // Add the ellipsis if text has been shortened\n\tif ($shortened) {\n\t\t$out .= $ellipsis;\n\t}\n\n\treturn $out;\n}", "function truncate($length,$options = array()){\n\t\t$options += array(\n\t\t\t\"omission\" => \"...\",\n\t\t\t\"separator\" => \"\",\n\t\t);\n\n\t\t$text = $this->_copy();\n\t\t$omission = new self($options[\"omission\"]);\n\n\t\t$length_with_room_for_omission = $length - $omission->length();\n\n\t\t$stop = $length_with_room_for_omission;\n\n\t\tif($text->length()>$length){\n\t\t\t$text = $text->substr(0,$stop);\n\t\t\tif($options[\"separator\"]){\n\t\t\t\t$_text = $text->copy();\n\t\t\t\twhile($_text->length()>0){\n\t\t\t\t\t$ch = $_text->at($_text->length() - 1);\n\t\t\t\t\t$_text = $_text->substr(0,$_text->length() - 1);\n\t\t\t\t\tif((string)$ch==(string)$options[\"separator\"]){ break; }\n\t\t\t\t}\n\t\t\t\tif($_text->length()>0){ $text = $_text; }\n\t\t\t}\n\t\t\t$text->append($omission);\n\t\t}\n\n\t\treturn $text;\n\t}", "function str_limit_html($value, $limit = 200){\n \n if (mb_strwidth($value, 'UTF-8') <= $limit) {\n return $value;\n }\n \n // Strip text with HTML tags, sum html len tags too.\n // Is there another way to do it?\n do {\n $len = mb_strwidth( $value, 'UTF-8' );\n $len_stripped = mb_strwidth( strip_tags($value), 'UTF-8' );\n $len_tags = $len - $len_stripped;\n \n $value = mb_strimwidth($value, 0, $limit+$len_tags, '', 'UTF-8');\n } while( $len_stripped > $limit);\n \n // Load as HTML ignoring errors\n $dom = new DOMDocument();\n @$dom->loadHTML('<?xml encoding=\"utf-8\" ?>' . $value, LIBXML_HTML_NODEFDTD); \n\n // Fix the html errors\n $value = $dom->saveHtml($dom->getElementsByTagName('body')->item(0));\n \n // Remove body tag\n $value = mb_strimwidth($value, 6, mb_strwidth($value, 'UTF-8') - 13, '', 'UTF-8'); // <body> and </body>\n // Remove empty tags\n return preg_replace('/<(\\w+)\\b(?:\\s+[\\w\\-.:]+(?:\\s*=\\s*(?:\"[^\"]*\"|\"[^\"]*\"|[\\w\\-.:]+))?)*\\s*\\/?>\\s*<\\/\\1\\s*>/', '', $value);\n }", "function trim_text($input, $length, $ellipses = true, $strip_html = true) {\n\t\tif ($strip_html) {\n\t\t $input = strip_tags($input);\n\t\t}\n\t \n\t\t//no need to trim, already shorter than trim length\n\t\tif (strlen($input) <= $length) {\n\t\t return $input;\n\t\t}\n\t \n\t\t//find last space within length\n\t\t$last_space = strrpos(substr($input, 0, $length), ' ');\n\t\t$trimmed_text = substr($input, 0, $last_space);\n\t \n\t\t//add ellipses (...)\n\t\tif ($ellipses) {\n\t\t $trimmed_text .= '...';\n\t\t}\n\t \n\t\treturn $trimmed_text;\n\t}", "public static function crop_text($length, $excerpt) {\n $excerpt = preg_replace(\" (\\[.*?\\])\", '', $excerpt);\n $excerpt = strip_shortcodes($excerpt);\n $excerpt = strip_tags($excerpt);\n $excerpt = substr($excerpt, 0, $length);\n $excerpt = substr($excerpt, 0, strripos($excerpt, \" \"));\n $excerpt = trim(preg_replace('/\\s+/', ' ', $excerpt));\n\n return $excerpt;\n }", "function trim_text($input, $length, $newsID,$ellipses = true, $strip_html = true) {\n if ($strip_html) {$input = strip_tags($input);}\n\t//no need to trim, already shorter than trim length\n if (strlen($input) <= $length) { return $input; }\n\t //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\t //add ellipses (...)\n if ($ellipses) {$trimmed_text .= '.... <br/><a href=\"page-news.php?newsID='.$newsID.'\" class=\"btn\">...LANJUT</a>';}\n return $trimmed_text;}", "public function exceptDescription($length = 50): string\n\t{\n\t\treturn str_limit(strip_tags($this->description), $length);\n\t}", "function limit_content($content_length = 250, $allowtags = true, $allowedtags = '') {\nglobal $post;\n$content = $post->post_content;\n\n//since version 2.6.5 development 7, remove shortcodes from content.\n$content = strip_shortcodes($content);\n\n$content = apply_filters('the_content', $content);\nif (!$allowtags){\n\t$allowedtags .= '<style>';\n\t$content = strip_tags($content, $allowedtags);\n}\n$wordarray = explode(' ', $content, $content_length + 1);\nif(count($wordarray) > $content_length) :\n\tarray_pop($wordarray);\n\tarray_push($wordarray, '...');\n\t$content = implode(' ', $wordarray);\n\t$content = force_balance_tags($content);\nendif;\n\necho $content;\n}", "function trim_text($input, $length, $ellipses = true, $strip_html = true)\n {\n if ($strip_html) {\n $input = strip_tags($input);\n }\n\n //no need to trim, already shorter than trim length\n if (strlen($input) <= $length) {\n return $input;\n }\n\n //find last space within length\n $last_space = strrpos(substr($input, 0, $length), ' ');\n $trimmed_text = substr($input, 0, $last_space);\n\n //add ellipses (...)\n if ($ellipses) {\n $trimmed_text .= '...';\n }\n\n return $trimmed_text;\n }", "public static function cutWysiwygStringForPreview($text, $length = 0)\n {\n $mainTextStripped = strip_tags($text);\n if ($length) {\n $result = Util::cutStringRespectingWhitespace($mainTextStripped, $length);\n } else {\n $result = $mainTextStripped;\n }\n return $result;\n }", "function mb_substrws( $text, $len=180 ) {\n\t\n\t if( (mb_strlen($text) > $len) ) {\n\t\n\t $whitespaceposition = mb_strpos($text,\" \",$len)-1;\n\t\n\t if( $whitespaceposition > 0 ) {\n\t $chars = count_chars(mb_substr($text, 0, ($whitespaceposition+1)), 1);\n\t if (array_key_exists(ord('<'), $chars) && array_key_exists(ord('>'), $chars) && $chars[ord('<')] > $chars[ord('>')])\n\t $whitespaceposition = mb_strpos($text,\">\",$whitespaceposition)-1;\n\t $text = mb_substr($text, 0, ($whitespaceposition+1));\n\t }\n\t\n\t // close unclosed html tags\n\t if( preg_match_all(\"|<([a-zA-Z]+)|\",$text,$aBuffer) ) {\n\t\n\t if( !empty($aBuffer[1]) ) {\n\t\n\t preg_match_all(\"|</([a-zA-Z]+)>|\",$text,$aBuffer2);\n\t\n\t if( count($aBuffer[1]) != count($aBuffer2[1]) ) {\n\t\n\t foreach( $aBuffer[1] as $index => $tag ) {\n\t\n\t if( empty($aBuffer2[1][$index]) || $aBuffer2[1][$index] != $tag)\n\t $text .= '</'.$tag.'>';\n\t }\n\t }\n\t }\n\t }\n\t }\n\t return $text;\n\t}", "function cut_carac($texte, $max){\n\t$texte = strip_shortcodes(strip_tags($texte));\n\tif(strlen($texte)>=$max){\n\t$texte = substr($texte,0,$max);\n\t$espace = strrpos($texte,\" \");\n\tif($espace)\n\t$texte = substr($texte,0,$espace);\n\t$texte = $texte.\"...\";\n\t}\n\t$texte = trim(str_replace(\"&nbsp;\", ' ', $texte));\n\treturn $texte;\n}", "function truncate($string,$length=35,$append=\"&hellip;\") {\n $string = trim($string);\n\n if(strlen($string) > $length) {\n $string = wordwrap($string, $length);\n $string = explode(\"\\n\", $string, 2);\n $string = $string[0] . $append;\n }\n\n return $string;\n }", "function trim_characters ($text, $start, $length) {\n\t// Pass it a string, a numeric start position and a numeric length.\n\t// If the start position is > 0, the string will be trimmed to start at the\n\t// nearest word boundary after (or at) that position.\n\t// If the string is then longer than $length, it will be trimmed to the nearest\n\t// word boundary below (or at) that length.\n\t// If either end is trimmed, ellipses will be added.\n\t// The modified string is then returned - its *maximum* length is $length.\n\t// HTML is always stripped (must be for trimming to prevent broken tags).\n\n\t$text = strip_tags($text);\n\n\t// Trim start.\n\tif ($start > 0) {\n\t\t$text = substr($text, $start);\n\t\t\n\t\t// Word boundary. \n\t\tif (preg_match (\"/.+?\\b(.*)/\", $text, $matches)) {\n\t\t\t$text = $matches[1];\n\t\t\t// Strip spare space at the start.\n\t\t\t$text = preg_replace (\"/^\\s/\", '', $text);\n\t\t}\n\t\t$text = '...' . $text;\n\t}\n\t\n\t// Trim end.\n\tif (strlen($text) > $length) {\n\n\t\t// Allow space for ellipsis.\n\t\t$text = substr($text, 0, $length - 3); \n\n\t\t// Word boundary. \n\t\tif (preg_match (\"/(.*)\\b.+/\", $text, $matches)) {\n\t\t\t$text = $matches[1];\n\t\t\t// Strip spare space at the end.\n\t\t\t$text = preg_replace (\"/\\s$/\", '', $text);\n\t\t}\n\t\t// We don't want to use the HTML entity for an ellipsis (&#8230;), because then \n\t\t// it screws up when we subsequently use htmlentities() to print the returned\n\t\t// string!\n\t\t$text .= '...'; \n\t}\n\t\n\treturn $text;\n}", "function acf_get_truncated($text, $length = 64)\n{\n}", "public function truncate($text, $length = 100, $ending = '...', $exact = true, $considerHtml = false)\n {\n if (!$this instanceof self) {\n return self::callInstanceMethod(FormatInterface::class, __FUNCTION__, func_get_args());\n }\n\n // Set default encoding\n mb_internal_encoding('UTF-8');\n\n if ($considerHtml) {\n // if the plain text is shorter than the maximum length, return the whole text\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n // splits all html-tags to scanable lines\n preg_match_all('/(<.+?>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);\n $total_length = mb_strlen($ending);\n $open_tags = array();\n $truncate = '';\n foreach ($lines as $line_matchings) {\n // if there is any html-tag in this line, handle it and add it (uncounted) to the output\n if (!empty($line_matchings[1])) {\n // if it's an \"empty element\" with or without xhtml-conform closing slash (f.e. <br/>)\n if (preg_match('/^<(\\s*.+?\\/\\s*|\\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\\s.+?)?)>$/is', $line_matchings[1])) {\n // do nothing\n // if tag is a closing tag (f.e. </b>)\n } else if (preg_match('/^<\\s*\\/([^\\s]+?)\\s*>$/s', $line_matchings[1], $tag_matchings)) {\n // delete tag from $open_tags list\n $pos = array_search($tag_matchings[1], $open_tags);\n if ($pos !== false) {\n unset($open_tags[$pos]);\n }\n // if tag is an opening tag (f.e. <b>)\n } else if (preg_match('/^<\\s*([^\\s>!]+).*?>$/s', $line_matchings[1], $tag_matchings)) {\n // add tag to the beginning of $open_tags list\n array_unshift($open_tags, mb_strtolower($tag_matchings[1]));\n }\n // add html-tag to $truncate'd text\n $truncate .= $line_matchings[1];\n }\n // calculate the length of the plain text part of the line; handle entities as one character\n $content_length = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $line_matchings[2]));\n if ($total_length+$content_length > $length) {\n // the number of characters which are left\n $left = $length - $total_length;\n $entities_length = 0;\n // search for html entities\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $line_matchings[2], $entities, PREG_OFFSET_CAPTURE)) {\n // calculate the real length of all entities in the legal range\n foreach ($entities[0] as $entity) {\n if ($entity[1]+1-$entities_length <= $left) {\n $left--;\n $entities_length += mb_strlen($entity[0]);\n } else {\n // no more characters left\n break;\n }\n }\n }\n $truncate .= mb_substr($line_matchings[2], 0, $left+$entities_length);\n // maximum lenght is reached, so get off the loop\n break;\n } else {\n $truncate .= $line_matchings[2];\n $total_length += $content_length;\n }\n // if the maximum length is reached, get off the loop\n if ($total_length >= $length) {\n break;\n }\n }\n } else {\n $text = $this->stripTags($text);\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - mb_strlen($ending));\n }\n }\n // if the words shouldn't be cut in the middle...\n if (!$exact) {\n // ...search the last occurance of a space...\n $spacepos = mb_strrpos($truncate, ' ');\n $brpos = mb_strrpos($truncate, '>')+1;\n if (isset($spacepos) || isset($brpos)) {\n // ...and cut the text in this position\n $trpos = ($spacepos > $brpos) ? $spacepos : $brpos;\n $truncate = mb_substr($truncate, 0, $trpos);\n }\n }\n if ($considerHtml) {\n // close all unclosed html-tags\n foreach ($open_tags as $tag) {\n $truncate .= '</' . $tag . '>';\n }\n }\n // add the defined ending to the text\n $truncate .= $ending;\n return $truncate;\n }", "function staff_bio_excerpt($text, $excerpt_length) {\n\t\t\tglobal $post;\n\t\t\tif (!$excerpt_length || !is_int($excerpt_length))$excerpt_length = 20;\n\t\t\tif ( '' != $text ) {\n\t\t\t\t$text = strip_shortcodes( $text );\n\t\t\t\t$text = apply_filters('the_content', $text);\n\t\t\t\t$text = str_replace(']]>', ']]>', $text);\n\t\t\t\t$excerpt_more = \" ...\";\n\t\t\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\t\t\t}\n\t\t\treturn apply_filters('the_excerpt', $text);\n\t\t}", "function truncate($string,$length=500,$append=\"&hellip;\") {\n $string = trim($string);\n\n if(strlen($string) > $length) {\n $string = wordwrap($string, $length);\n $string = explode(\"\\n\", $string, 2);\n $string = $string[0] . $append;\n }\n\n return $string;\n}", "public static function substring($text, $length = 100, $replacer = '...', $isStrips = true, $stringtags = '') {\n\n\t\t$string = $isStrips ? strip_tags($text, $stringtags) : $text;\n\t\tif (mb_strlen($string) < $length)\n\t\t\treturn $string;\n\t\t$string = mb_substr($string, 0, $length);\n\t\treturn $string . $replacer;\n\t}", "function truncate_text($text, $max_chars = 70) {\n if (strlen($text) > $max_chars) {\n return explode( \"\\n\", wordwrap( $text, $max_chars))[0] . '…';\n }\n return $text;\n}", "function rls_text_excerpt($length) {\n return 25;\n}", "function mt_filter_excerpt_length($length) {\n\treturn 20;\n }", "function subText($len,$str) {\n if (mb_strlen($str,'utf-8')>$len) {\n return mb_substr($str,0,$len,'utf-8').'...';\n } else {\n return $str;\n }\n}", "function st_get_substr($str,$n=150,$more='...')\r{\r $str = strip_tags($str);\r if(strlen($str)<$n) return $str;\r $html = substr($str,0,$n);\r $html = substr($html,0,strrpos($html,' '));\r return $html.$more;\r}", "public function uzunMein($string){\r\n$string = strip_tags($string);\r\nif (strlen($string) > 500) {\r\n\r\n // truncate string\r\n $stringCut = substr($string, 0, 500);\r\n $endPoint = strrpos($stringCut, ' ');\r\n\r\n //if the string doesn't contain any space then it will cut without word basis.\r\n $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);\r\n $string .= '... <a href=\"/this/story\">Read More</a>';\r\n}\r\nreturn $string;\r\n}", "private function limit_str($review, $length, $more_link_text='') {\n if (strlen($review['content']) > $length) {\n if (!$more_link_text) {\n $more_link_text = __('more');\n }\n\n return mb_substr($review['content'], 0, $length) . '...'\n . \" <a href=\\\"{$review['place']['main_url']}#{$review['id']}\\\">{$more_link_text}</a>\";\n }\n\n return $review['content'];\n }", "function limit_content($title,$len) {\n if (str_word_count($title) > $len) {\n $keys = array_keys(str_word_count($title, 2));\n $title = substr($title, 0, $keys[$len]);\n }\n return $title;\n}", "function truncateText($content, $max_length, $truncate_type, $finish_sentence, $add_final_dot)\n {\n $text_truncated=\"\";\n\n if (FILTER_VAR($max_length, FILTER_VALIDATE_INT)) //in case no limit is specified, don't truncate text\n {\n if ($truncate_type==\"symbols\") //truncate text by symbols\n {\n $current_length=strlen($content);\n if ($current_length>$max_length) //content length exceeded, truncate\n {\n $content=preg_replace(\"/\\s+?(\\S+)?$/\", \"\", substr($content, 0, $max_length));\n $text_truncated=1; //will be used when ... needs to be added at the end (so ... is not added to text which was not truncated)\n }\n }\n\n if ($truncate_type==\"words\") //truncate text by words\n {\n $content=preg_replace(\"/\\s\\s+/\", \" \", $content); //replace new lines and excess whitespace with single whitespace\n $words_array=explode(\" \", $content); //make an array of individual words\n\n if (count($words_array)>$max_length) //content length exceeded, truncate\n {\n $words_array=array_slice($words_array, 0, $max_length);\n\n $content=implode(\" \", $words_array);\n $text_truncated=1; //will be used when ... needs to be added at the end (so ... is not added to text which was not truncated)\n }\n }\n\n $content=trim($content);\n }\n\n $end_symbols_array=array(\".\", \"?\", \"!\"); //an array with symbols that can be used at the end of text\n $last_symbol=substr($content, -1); //get the last symbol of current content\n\n if ($finish_sentence==1) //truncate content at the end of sentence, so it doesn't look like \"this is some...\"\n {\n while (!in_array($last_symbol, $end_symbols_array)) //truncate text just when one of end symbols is detected\n {\n $content=substr($content, 0, -1);\n $last_symbol=substr($content, -1);\n }\n }\n\n if ($add_final_dot==1 && !in_array($last_symbol, $end_symbols_array)) //add . to the end if needed\n {\n $content.=\".\";\n }\n\n if ($add_final_dot==2 && $text_truncated==1 && !in_array($last_symbol, $end_symbols_array)) //add ... to the end if needed\n {\n $content.=\"...\";\n }\n\n return $content;\n }", "function truncate($string)\n {\n $string = strip_tags($string);\n if (strlen($string) > 50) {\n\n // truncate string\n $stringCut = substr($string, 0, 500);\n $endPoint = strrpos($stringCut, ' ');\n\n //if the string doesn't contain any space then it will cut without word basis.\n $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);\n }\n return $string;\n }", "function ilc_truncate($str, $len=200, $trail='', $word_wrap=true){\r\n\t$str = strip_tags($str);\r\n\t// Strip Shortcodes\r\n\t$str = strip_shortcodes($str);\r\n\t// And the boundary spaces\r\n\t$str = trim($str);\r\n\t// No need to trancate if string length is lesser\r\n\tif( strlen( $str) < $len){\r\n\t\treturn $str;\r\n\t}\r\n\t// Do the truncate magic\r\n\tif($word_wrap)\r\n\t\t$str = substr($str, 0, strrpos(substr($str, 0, $len), ' '));\r\n\telse\r\n\t\t$str = substr($str, 0, $len);\r\n\t\r\n\treturn $str . $trail;\r\n}", "function trimText($input, $length) {\n // If the text is already shorter than the max length, then just return unedited text.\n if (strlen($input) <= $length) {\n return $input;\n }\n // Find the last space (between words we're assuming) after the max length.\n $last_space = strrpos(substr($input, 0, $length), ' ');\n // Trim\n $trimmedText = substr($input, 0, $last_space);\n // Add ellipsis.\n $trimmedText .= '...';\n return $trimmedText;\n}", "function make_excerpt($excerpt, $length = 200)\n{\n $excerpt = trim(preg_replace('/\\r\\n|\\r|\\n+/', ' ', strip_tags($excerpt)));\n return str_limit($excerpt, $length);\n}", "function alaya_truncate($full_str,$max_length) {\n\tif (mb_strlen($full_str,'utf-8') > $max_length ) {\n\t $full_str = mb_substr($full_str,0,$max_length,'utf-8').'...';\n\t}\n\t$full_str = apply_filters('alaya_truncate', $full_str);\nreturn $full_str;\n}", "function lightboxgallery_resize_text($text, $length) {\n $textlib = new textlib();\n return ($textlib->strlen($text) > $length ? $textlib->substr($text, 0, $length) . '...' : $text);\n}", "function wordlimit($string, $length = 50, $ellipsis = \"...\") {\n $words = explode(' ', strip_tags($string));\n if (count($words) > $length)\n return implode(' ', array_slice($words, 0, $length)) . $ellipsis;\n else\n return $string;\n}", "function paragraph_trim($content, $limit = 500, $schr=\"\\n\", $scnt=2)\n{\n $post = 0;\n $trimmed = false;\n for($i = 1; $i <= $scnt; $i++) {\n\n if($tmp = strpos($content, $schr, $post+1)) {\n $post = $tmp;\n $trimmed = true;\n } else {\n $post = strlen($content) - 1;\n $trimmed = false;\n break;\n }\n\n }\n\n $content = substr($content, 0, $post);\n\n if(strlen($content) > $limit) {\n $content = substr($content, 0, $limit);\n $content = substr($content, 0, strrpos($content,' '));\n $trimmed = true;\n }\n\n if($trimmed) $content .= '...';\n\n return $content;\n\n}", "function readMoreHelper($story_desc, $chars = 35) {\n $string = strip_tags($story_desc);\n if (strlen($string) > $chars) {\n\n // truncate string\n $stringCut = substr($string, 0, $chars);\n $endPoint = strrpos($stringCut, ' ');\n\n //if the string doesn't contain any space then it will cut without word basis.\n $string = $endPoint? substr($stringCut, 0, $endPoint) : substr($stringCut, 0);\n $string .= '...';\n }\n return $string;\n}", "function funcs_cutLength($string, $length, $word_length = null,$act_length = null){\n\t$string = (!is_null($string))?trim($string):'';\n\t//do not check the size of the string if we already know it\n\tif (is_null($act_length))$act_length=strlen($string);\n\tif (!is_null($word_length) && !empty($string)){\n\t\t//in the future use this instead of calling this whole function\n\t\t$string = wordwrap($string,$word_length,\"\\n\",1);\n\t}\n\tif (!is_null($length) && $act_length>$length && $length>4){\n\t\t$string = substr($string,0,$length-3).'...';\n\t}\n\treturn $string;\n}", "public static function trimText($str, $desiredLength, $nbsp = false, $hellip = true, $striptags = true)\n {\n if ($hellip) {\n $ellipseStr = '…';\n } else {\n $ellipseStr = '';\n }\n\n return self::trimToHTML($str, $desiredLength, $ellipseStr, $striptags, $nbsp);\n }", "public static function truncate($html, $count, $suffix, $encoding = false)\n {\n $config = static::createConfig();\n\n $lexer = \\HTMLPurifier_Lexer::create($config);\n $tokens = $lexer->tokenizeHTML($html, $config, new \\HTMLPurifier_Context());\n $openTokens = [];\n $totalCount = 0;\n $depth = 0;\n $truncated = [];\n foreach ($tokens as $token) {\n if ($token instanceof \\HTMLPurifier_Token_Start) { //Tag begins\n $openTokens[$depth] = $token->name;\n $truncated[] = $token;\n ++$depth;\n } elseif ($token instanceof \\HTMLPurifier_Token_Text && $totalCount <= $count) { //Text\n if ($encoding === false) {\n preg_match('/^(\\s*)/um', $token->data, $prefixSpace) ?: $prefixSpace = ['', ''];\n $token->data = $prefixSpace[1] . StringHelper::truncateWords(ltrim($token->data), $count - $totalCount, '');\n $currentCount = StringHelper::countWords($token->data);\n } else {\n $token->data = StringHelper::truncate($token->data, $count - $totalCount, '', $encoding);\n $currentCount = mb_strlen($token->data, $encoding);\n }\n $totalCount += $currentCount;\n $truncated[] = $token;\n } elseif ($token instanceof \\HTMLPurifier_Token_End) { //Tag ends\n if ($token->name === $openTokens[$depth - 1]) {\n --$depth;\n unset($openTokens[$depth]);\n $truncated[] = $token;\n }\n } elseif ($token instanceof \\HTMLPurifier_Token_Empty) { //Self contained tags, i.e. <img/> etc.\n $truncated[] = $token;\n }\n if ($totalCount >= $count) {\n if (0 < count($openTokens)) {\n krsort($openTokens);\n foreach ($openTokens as $name) {\n $truncated[] = new \\HTMLPurifier_Token_End($name);\n }\n }\n break;\n }\n }\n $context = new \\HTMLPurifier_Context();\n $generator = new \\HTMLPurifier_Generator($config, $context);\n\n return $generator->generateFromTokens($truncated) . ($totalCount >= $count ? $suffix : '');\n }", "function cs_textcut($text, $maxlength, $subst = '...', $subtract = 3)\r\n{\r\n\t/* prevent some stupid stuff */\r\n\tif ($maxlength < 1)\r\n\t\treturn $text;\r\n\tif ($maxlength < $subtract)\r\n\t\treturn $text;\r\n\t/* check for multi-byte support */\r\n\tif (function_exists('mb_strlen'))\r\n\t{\r\n\t\tglobal $cs_main;\r\n\t\t/* prevent any &xxx; being stripped in half */\r\n\t\t$realtext = html_entity_decode($text, ENT_QUOTES, $cs_main['charset']);\r\n\t\tif (mb_strlen($realtext, $cs_main['charset']) > $maxlength)\r\n\t\t{\r\n\t\t\t$text = mb_substr($realtext, 0, $maxlength - $subtract, $cs_main['charset']).$subst;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (strlen($text) > $maxlength)\r\n\t\t{\r\n\t\t\t$text = substr($text, 0, $maxlength - $subtract).$subst;\r\n\t\t}\r\n\t}\r\n\treturn $text;\r\n}", "function truncate($string, $length, $stopanywhere=false)\n{\n if (strlen($string) > $length)\n {\n //limit hit!\n $string = substr($string, 0, ($length - 3));\n if ($stopanywhere)\n {\n //stop anywhere\n $string .= '...';\n } else\n {\n //stop on a word.\n $string = substr($string, 0, strrpos($string, ' ')) . '...';\n }\n }\n return $string;\n}", "public function truncation($string) {\n $length = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitepagevideo.truncation.limit', 13);\n $string = strip_tags($string);\n return Engine_String::strlen($string) > $length ? Engine_String::substr($string, 0, ($length - 3)) . '...' : $string;\n }", "function tptn_excerpt($content,$excerpt_length){\r\n\t$out = strip_tags($content);\r\n\t$blah = explode(' ',$out);\r\n\tif (!$excerpt_length) $excerpt_length = 10;\r\n\tif(count($blah) > $excerpt_length){\r\n\t\t$k = $excerpt_length;\r\n\t\t$use_dotdotdot = 1;\r\n\t}else{\r\n\t\t$k = count($blah);\r\n\t\t$use_dotdotdot = 0;\r\n\t}\r\n\t$excerpt = '';\r\n\tfor($i=0; $i<$k; $i++){\r\n\t\t$excerpt .= $blah[$i].' ';\r\n\t}\r\n\t$excerpt .= ($use_dotdotdot) ? '...' : '';\r\n\t$out = $excerpt;\r\n\treturn $out;\r\n}", "function the_excerpt_max_charlength($charlength) {\n $excerpt = get_the_excerpt();\n $charlength++;\n if(strlen($excerpt)>$charlength) {\n $subex = substr($excerpt,0,$charlength-5);\n $exwords = explode(\" \",$subex);\n $excut = -(strlen($exwords[count($exwords)-1]));\n if($excut<0) {\n echo substr($subex,0,$excut);\n } else {\n \t echo $subex;\n }\n echo ' <a href=\"'.get_permalink().'\"> Read more ...</a>';\n } else {\n\t echo $excerpt;\n }\n}", "function truncarLinhas($sText,$iTamanho) {\n \t\n \t$sRetorno = \"\";\n \t$aLinhas = explode(\"\\n\",$sText);\n \tforeach ($aLinhas as $sLinha) {\n \t\tif (strlen($sLinha) > $iTamanho) {\n \t\t\t$sRetorno .= \"\\n\".substr($sLinha,0,$iTamanho);\n \t\t}else{\n \t\t\t$sRetorno .= \"\\n\".$sLinha;\n \t\t}\n \t}\n \treturn $sRetorno;\n }", "public static function truncate($text, $length = 100, $dot = '...', $exact = true, $considerHtml = false) {\n\n if ($considerHtml) {\n if (mb_strlen(preg_replace('/<.*?>/', '', $text)) <= $length) {\n return $text;\n }\n $totalLength = mb_strlen($dot);\n $openTags = array();\n $truncate = '';\n preg_match_all('/(<\\/?([\\w+]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER);\n foreach ($tags as $tag) {\n if (!preg_match('/img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param/s', $tag[2])) {\n if (preg_match('/<[\\w]+[^>]*>/s', $tag[0])) {\n array_unshift($openTags, $tag[2]);\n } else if (preg_match('/<\\/([\\w]+)[^>]*>/s', $tag[0], $closeTag)) {\n $pos = array_search($closeTag[1], $openTags);\n if ($pos !== false) {\n array_splice($openTags, $pos, 1);\n }\n }\n }\n $truncate .= $tag[1];\n\n $contentLength = mb_strlen(preg_replace('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', ' ', $tag[3]));\n if ($contentLength + $totalLength > $length) {\n $left = $length - $totalLength;\n $entitiesLength = 0;\n if (preg_match_all('/&[0-9a-z]{2,8};|&#[0-9]{1,7};|&#x[0-9a-f]{1,6};/i', $tag[3], $entities, PREG_OFFSET_CAPTURE)) {\n foreach ($entities[0] as $entity) {\n if ($entity[1] + 1 - $entitiesLength <= $left) {\n $left--;\n $entitiesLength += mb_strlen($entity[0]);\n } else {\n break;\n }\n }\n }\n\n $truncate .= mb_substr($tag[3], 0 , $left + $entitiesLength);\n break;\n } else {\n $truncate .= $tag[3];\n $totalLength += $contentLength;\n }\n if ($totalLength >= $length) {\n break;\n }\n }\n\n } else {\n if (mb_strlen($text) <= $length) {\n return $text;\n } else {\n $truncate = mb_substr($text, 0, $length - strlen($dot));\n }\n }\n if (!$exact) {\n $spacepos = mb_strrpos($truncate, ' ');\n if (isset($spacepos)) {\n if ($considerHtml) {\n $bits = mb_substr($truncate, $spacepos);\n preg_match_all('/<\\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER);\n if (!empty($droppedTags)) {\n foreach ($droppedTags as $closingTag) {\n if (!in_array($closingTag[1], $openTags)) {\n array_unshift($openTags, $closingTag[1]);\n }\n }\n }\n }\n $truncate = mb_substr($truncate, 0, $spacepos);\n }\n }\n\n $truncate .= $dot;\n\n if ($considerHtml) {\n foreach ($openTags as $tag) {\n $truncate .= '</'.$tag.'>';\n }\n }\n return $truncate;\n }", "function trim_excerpt_length ($length) {\n return 20;\n}", "function dynamic_excerpt($length) { // Variable excerpt length. Length is set in characters\n\t global $post;\n\t $text = $post->post_excerpt;\n\t if ( '' == $text ) {\n\t $text = get_the_content('');\n\t $text = apply_filters('the_content', $text);\n\t $text = str_replace(']]>', ']]>', $text);\n\t }\n\t $text = strip_shortcodes($text); // optional, recommended\n\t $text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' if you want to keep some tags\n\t $text = mb_substr($text,0,$length).'';\n\t echo $text;\n\t}", "function the_excerpt_dynamic($length) { // Outputs an excerpt of variable length (in characters)\n\tglobal $post;\n\t$text = $post->post_exerpt;\n\tif ( '' == $text ) {\n\t\t$text = get_the_content('');\n\t\t$text = apply_filters('the_content', $text);\n\t\t$text = str_replace(']]>', ']]>', $text);\n\t}\n\t\t$text = strip_shortcodes( $text ); // optional, recommended\n\t\t$text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' to keep some formats; optional\n\n\t\t$output = strlen($text);\n\t\tif($output <= $length ) {\n\t\t\t$text = substr($text,0,$length).'';\n\t\t}else {\n\t\t\t$text = substr($text,0,$length).'...';\n\t\t}\n\n\techo apply_filters('the_excerpt',$text);\n}", "function transform_HTML($string, $length = null) {\n // Remove dead space.\n $string = trim($string);\n // Prevent potential Unicode codec problems.\n $string = utf8_decode($string);\n // HTMLize HTML-specific characters.\n $string = htmlentities($string, ENT_NOQUOTES);\n $string = str_replace(\"#\", \"#\", $string);\n $string = str_replace(\"%\", \"%\", $string);\n $length = intval($length);\n if ($length > 0) {\n $string = substr($string, 0, $length);\n }\n return $string;\n}", "public function cropHtmlWorksWithLinebreaks() {}", "public function textShorten($text, $limit = 350){\n $text = substr($text,0,$limit);\n //$text = substr($text,0, strrpos($text, ' '));\n $text = strip_tags($text);\n //list($text) = explode(\"\\n\",wordwrap(strip_tags($text), 500),1);\n //$text = substr($text, 0, strrpos($text, ' ')).'... <a href=\"/this/story\">Read More></a>';\n \n $text = substr($text, 0, strrpos($text, ' ')).'......';\n return $text;\n }", "public function mz_page_excerpts($content, $length = 300) {\r\n $tempStr = substr($content, 0, $length);\r\n return substr($tempStr, 0, strripos($tempStr, \" \"));\r\n }", "function gallo_excerpt( $length ) {\n\treturn 30;\n}", "function truncate($text, $limit = 40)\n{\n if (str_word_count($text, 0) > $limit) {\n $words = str_word_count($text, 2);\n $pos = array_keys($words);\n $text = mb_substr($text, 0, $pos[$limit], 'UTF-8') . '...';\n }\n\n return $text;\n}", "public function getExcerpt($string, $length=50) {\n if (is_string($string)) { \n $excerpt = '';\n $string = strip_tags($string);\n if (strlen($string)>$length) {\n $excerpt = substr($string, 0, $length);\n $excerpt = substr($excerpt, 0, strrpos($excerpt,' '));\n $excerpt .= ' ...'; \n }\n else $excerpt = $string;\n\n // return\n return $excerpt; \n }\n else return false;\n }", "public static function substr(string $html, int $offset = 0, int $length = null): string {\n\t\t$matches = false;\n\t\tif (!preg_match_all('/(<[A-Za-z0-9:_]+\\s*[^>]*>|<\\/[A-Za-z0-9:_]+>)/', $html, $matches, PREG_OFFSET_CAPTURE)) {\n\t\t\t$length = $length === null ? strlen($html) : $length;\n\t\t\treturn substr($html, $offset, $length);\n\t\t}\n\t\t$stack = [];\n\t\t$text_offset = 0;\n\t\t$html_offset = 0;\n\t\t$result = '';\n\t\tforeach ($matches[0] as $match) {\n\t\t\t[$tag, $tag_offset] = $match;\n\t\t\tif ($tag_offset > $html_offset) {\n\t\t\t\t$add_chars = $tag_offset - $html_offset;\n\t\t\t\tif ($text_offset + $add_chars > $length) {\n\t\t\t\t\t$add_chars = $length - $text_offset;\n\t\t\t\t\t$result .= substr($html, $html_offset, $add_chars);\n\t\t\t\t\t// $html_offset += $add_chars;\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t$result .= substr($html, $html_offset, $add_chars);\n\t\t\t\t\t$html_offset += $add_chars;\n\t\t\t\t\t$text_offset += $add_chars;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$html_offset += strlen($tag);\n\t\t\t$end_tag = self::isEndTag($tag);\n\t\t\tif ($end_tag) {\n\t\t\t\twhile (count($stack) > 0) {\n\t\t\t\t\t$stack_top = array_pop($stack);\n\t\t\t\t\tif ($stack_top === $end_tag) {\n\t\t\t\t\t\t$result .= $tag;\n\t\t\t\t\t\t$tag = false;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result .= \"<$end_tag><!-- Inserted missing start tag --></$end_tag>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($tag) {\n\t\t\t\t\t$result .= \"<$end_tag><!-- Inserted missing start tag --></$end_tag>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$result .= $tag;\n\t\t\t\t$tags = self::parseTags($tag);\n\t\t\t\tforeach (array_keys($tags) as $start_tag) {\n\t\t\t\t\t$stack[] = $start_tag;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twhile (count($stack) > 0) {\n\t\t\t$end_tag = array_pop($stack);\n\t\t\t$result .= \"</$end_tag>\";\n\t\t}\n\t\treturn $result;\n\t}", "function truncate($text)\n{\n $max_char=500;\n // Text length is over the limit\n if (strlen($text)>$max_char){\n // Define maximum char number\n $text = substr($text, 0, $max_char);\n // Get position of the last space\n $position_space = strrpos($text, \" \");\n $text = substr($text, 0, $max_char);\n // Add \"...\"\n $text = $text.\" ...\";\n }\n // Return the text\n return $text;\n}", "function rf_excerpt($content, $length)\n{\n $text = strip_shortcodes( $content );\n\n /** This filter is documented in wp-includes/post-template.php */\n $text = apply_filters( 'the_content', $text );\n $text = str_replace(']]>', ']]&gt;', $text);\n\n return wp_trim_words( $text, $length );\n}", "public function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)\n {\n $app = \\Slim\\Slim::getInstance();\n $Toolbox = $app->Toolbox;\n\n return $Toolbox::truncateHtmlText($text, $length, $ending, $exact, $considerHtml);\n }", "function rls_media_excerpt($length) {\n return 25;\n}", "function excerpt($str, $len, $end = '...')\n{\n\tif(strlen($str) > $len)\n\t{\n\t\t$str = mb_substr($str, 0, $len, 'UTF-8');\n\t\t$pos = max(strrpos($str, '.'), strrpos($str, ' '), strrpos($str, \"\\n\"));\n\t\tif($pos) $str = substr($str, 0, $pos);\n\t\t$str .= $end;\n\t}\n\treturn $str;\n}", "public function getExcerpt($maxLength = 255);", "function cheffism_custom_excerpt_length( $length ) {\n return 50;\n}", "function textpart($body, $search) {\n $length = 20;\n $text = substr($body, max(stripos($body,$search) - $length, 0), strripos($body,$search) - stripos($body,$search) + strlen($search) + 2 * $length);\n if (strripos($text, \" \") < strripos($text,$search)) {\n $text = $text . \" \";\n }\n if (stripos($text, \" \") != strripos($text, \" \")) {\n $text = substr($text, stripos($text, \" \"), strripos($text, \" \") - stripos($text, \" \"));\n }\n $temp = $text;\n $stop = substr($text, strripos($text, $search) + strlen($search));\n if (strlen($stop) > $length) {\n $stop = substr($text, strripos($text, $search) + strlen($search), $length);\n $stop = substr($stop, 0, strripos($stop, \" \"));\n }\n $text = \"... \";\n while (stripos($temp,$search)) {\n $temp = substr_replace($temp, \"<b>\", stripos($temp, $search), 0);\n $temp = substr_replace($temp, \"</b>\", stripos($temp, $search) + strlen($search), 0);\n $text = $text . substr($temp, 0, stripos($temp, \"</b>\") + 4);\n $temp = substr($temp, stripos($temp, \"</b>\") + 4);\n if(stripos($temp, $search) > (2 * $length)) {\n $text = $text . substr($temp, 0, $length);\n $text = substr($text, 0, strripos($text, \" \")) . \" ... \";\n $temp = substr($temp, stripos($temp, $search) - $length);\n $temp = substr($temp, stripos($temp, \" \"));\n }\n }\n $text = $text . $stop . \" ... \";\n echo $text; \n return;\n}", "function trim_excerpt( $text, $excerpt_length = null ) {\n\t\t$text = strip_shortcodes( $text );\n\t\t/** This filter is documented in wp-includes/post-template.php */\n\t\t$text = apply_filters( 'the_content', $text );\n\t\t$text = str_replace( ']]>', ']]&gt;', $text );\n\n\t\tif ( ! $excerpt_length ) {\n\t\t\t/**\n\t\t\t * Filters the number of words in an excerpt.\n\t\t\t *\n\t\t\t * @since 2.7.0\n\t\t\t *\n\t\t\t * @param int $number The number of words. Default 55.\n\t\t\t */\n\t\t\t$excerpt_length = apply_filters( 'excerpt_length', 55 );\n\t\t}\n\t\t$more_text = ' &hellip;';\n\t\t$excerpt_more = apply_filters( 'excerpt_more', $more_text );\n\n\t\t$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );\n\n\t\treturn $text;\n\t}" ]
[ "0.7953029", "0.7794227", "0.7794227", "0.7518003", "0.7404345", "0.73502", "0.7293797", "0.72623754", "0.72491944", "0.7178054", "0.7103808", "0.70197064", "0.69657576", "0.6945398", "0.68912536", "0.68815887", "0.68509144", "0.67961067", "0.6779655", "0.67399347", "0.6709573", "0.67024255", "0.6681092", "0.66729593", "0.6663333", "0.66579735", "0.6606128", "0.6573267", "0.65661424", "0.6549328", "0.65322137", "0.6501144", "0.64953196", "0.648944", "0.6485305", "0.6481006", "0.6460972", "0.6413693", "0.640787", "0.640033", "0.63851976", "0.6381921", "0.6378472", "0.6360141", "0.63457394", "0.6345349", "0.6324805", "0.6295414", "0.629456", "0.62903947", "0.6287635", "0.6287433", "0.6260508", "0.62575305", "0.6248238", "0.62217057", "0.62067443", "0.6205369", "0.6197917", "0.61927074", "0.6192496", "0.61861545", "0.61856204", "0.61742", "0.6163056", "0.61629254", "0.61410534", "0.61249924", "0.6115907", "0.6109383", "0.6094752", "0.60898626", "0.6082467", "0.6079962", "0.6079578", "0.60227036", "0.6019629", "0.60147846", "0.60085344", "0.6001613", "0.59917283", "0.5991612", "0.5979016", "0.5950824", "0.59425056", "0.5941732", "0.593175", "0.59195286", "0.58912927", "0.58887804", "0.58870345", "0.5882237", "0.58801574", "0.58735204", "0.58405644", "0.5837097", "0.58357453", "0.58344203", "0.5834358", "0.58330864" ]
0.6598923
27
/ FUNCTIONS Generates the url for the specified entity | routing string | page id
public function generateUrl($entity, $params = null) { if (gettype($entity) === 'string') { $entity = "AllegroSites_$entity"; } return $this->routingHelper->generateUrl($entity, $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function returnUrlForEntity(Entity $entity) {\n\t\treturn Router::url(\n\t\t\t[\n\t\t\t\t'plugin' => null,\n\t\t\t\t'prefix' => null,\n\t\t\t\t'controller' => $this->_table->alias(),\n\t\t\t\t'action' => 'view',\n\t\t\t\t$entity->{$this->_table->primaryKey()},\n\t\t\t],\n\t\t\ttrue\n\t\t);\n\t}", "function entity_url($hook, $type, $returnvalue, $params) {\n\t$url = elgg_normalize_url($returnvalue);\n\treturn handler_replace($url);\n}", "protected function getEntityUrl(EntityInterface $entity) {\n // For the default revision, the 'revision' link template falls back to\n // 'canonical'.\n // @see \\Drupal\\Core\\Entity\\Entity::toUrl()\n $rel = $entity->getEntityType()->hasLinkTemplate('revision') ? 'revision' : 'canonical';\n return $entity->toUrl($rel);\n }", "function url()\n\t{\n\t\t$id\t\t= $this->attribute('id');\n\t\t$page\t= $this->pyrocache->model('pages_m', 'get', array($id));\n\n\t\treturn site_url($page ? $page->uri : '');\n\t}", "public function generate_url()\n {\n }", "public function url()\n {\n return route('page-item', ['page' => $this->wrappedObject->slug]);\n }", "private function getUrl() {\r\n if(!$this->markActive)\r\n return '';\r\n $mid = Yii::$app->controller->module->id == Yii::$app->id ? '' : Yii::$app->controller->module->id;\r\n $cid = Yii::$app->controller->id;\r\n $aid = Yii::$app->controller->action->id;\r\n $id = isset($_GET['slug']) ? $_GET['slug'] : (isset($_GET['id']) ? $_GET['id'] : '');\r\n $rubric = isset($_GET['rubric']) ? $_GET['rubric'] : '';\r\n $tag = isset($_GET['tag']) ? $_GET['tag'] : '';\r\n return ($mid ? $mid. '/' : '') . \r\n $cid . '/' . \r\n ($aid == 'index' \r\n ? ($rubric \r\n ? 'rubric/' . $rubric . ($tag \r\n ? '/tag/' . $tag \r\n : '') \r\n : 'index') \r\n : ($aid == 'view' ? $id : $aid)\r\n );\r\n }", "public function buildFrontendUri() {}", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "function generate_entity_link($entity_type, $entity, $text = NULL, $graph_type = NULL, $escape = TRUE, $options = FALSE)\n{\n if (is_numeric($entity))\n {\n $entity = get_entity_by_id_cache($entity_type, $entity);\n }\n // Compat with old boolean $short option\n if (is_array($options))\n {\n $short = isset($options['short']) && $options['short'];\n $icon = isset($options['icon']) && $options['icon'];\n } else {\n $short = $options;\n $icon = FALSE;\n }\n if ($icon)\n {\n // Get entity icon and force do not escape\n $text = get_icon($GLOBALS['config']['entities'][$entity_type]['icon']);\n $escape = FALSE;\n }\n\n entity_rewrite($entity_type, $entity);\n\n switch($entity_type)\n {\n case \"device\":\n if ($icon)\n {\n $link = generate_device_link($entity, $text, [], FALSE);\n } else {\n $link = generate_device_link($entity, short_hostname($entity['hostname'], 16));\n }\n break;\n case \"mempool\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'mempool'));\n break;\n case \"processor\":\n //r($entity);\n if (isset($entity['id']) && is_array($entity['id']))\n {\n // Multi-processors list\n $ids = implode(',', $entity['id']);\n $entity['entity_id'] = $ids;\n } else {\n $ids = $entity['processor_id'];\n }\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'processor', 'processor_id' => $ids));\n break;\n case \"status\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'status', 'id' => $entity['status_id']));\n break;\n case \"sensor\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => $entity['sensor_class'], 'id' => $entity['sensor_id']));\n break;\n case \"counter\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'counter', 'id' => $entity['counter_id']));\n break;\n case \"printersupply\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'printing', 'supply' => $entity['supply_type']));\n break;\n case \"port\":\n if ($icon)\n {\n $link = generate_port_link($entity, $text, $graph_type, FALSE, FALSE);\n } else {\n $link = generate_port_link($entity, NULL, $graph_type, $escape, $short);\n }\n break;\n case \"storage\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'health', 'metric' => 'storage'));\n break;\n case \"bgp_peer\":\n $url = generate_url(array('page' => 'device', 'device' => ($entity['peer_device_id'] ? $entity['peer_device_id'] : $entity['device_id']), 'tab' => 'routing', 'proto' => 'bgp'));\n break;\n case \"netscalervsvr\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_vsvr', 'vsvr' => $entity['vsvr_id']));\n break;\n case \"netscalersvc\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_services', 'svc' => $entity['svc_id']));\n break;\n case \"netscalersvcgrpmem\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'loadbalancer', 'type' => 'netscaler_servicegroupmembers', 'svc' => $entity['svc_id']));\n break;\n case \"p2pradio\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'p2pradios'));\n break;\n case \"sla\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'slas', 'id' => $entity['sla_id']));\n break;\n case \"pseudowire\":\n $url = generate_url(array('page' => 'device', 'device' => $entity['device_id'], 'tab' => 'pseudowires', 'id' => $entity['pseudowire_id']));\n break;\n case \"maintenance\":\n $url = generate_url(array('page' => 'alert_maintenance', 'maintenance' => $entity['maint_id']));\n break;\n case \"group\":\n $url = generate_url(array('page' => 'group', 'group_id' => $entity['group_id']));\n break;\n case \"virtualmachine\":\n // If we know this device by its vm name in our system, create a link to it, else just print the name.\n if (get_device_id_by_hostname($entity['vm_name']))\n {\n $link = generate_device_link(device_by_name($entity['vm_name']));\n } else {\n // Hardcode $link to just show the name, no actual link\n $link = $entity['vm_name'];\n }\n break;\n default:\n $url = NULL;\n }\n\n if (isset($link))\n {\n return $link;\n }\n\n if (!isset($text))\n {\n if ($short && $entity['entity_shortname'])\n {\n $text = $entity['entity_shortname'];\n } else {\n $text = $entity['entity_name'];\n }\n }\n if ($escape) { $text = escape_html($text); }\n $link = '<a href=\"' . $url . '\" class=\"entity-popup ' . $entity['html_class'] . '\" data-eid=\"' . $entity['entity_id'] . '\" data-etype=\"' . $entity_type . '\">' . $text . '</a>';\n\n return($link);\n}", "function build_url($node)\n {\n \t// make sure we have the minimum properties of a node\n \t$node = array_merge($this->node, $node);\n\n \t// default to nada\n \t$url = '';\n\n \t// if we have a url override just use that\n \tif( $node['custom_url'] ) \n \t{\t\n \t\t// @todo - review this decision as people may want relatives\n \t\t// without the site index prepended.\n \t\t// does the custom url start with a '/', if so add site index\n \t\tif(isset($node['custom_url'][0]) && $node['custom_url'][0] == '/')\n \t\t{\n \t\t\t$node['custom_url'] = ee()->functions->fetch_site_index().$node['custom_url'];\n \t\t}\n\n \t\t$url = $node['custom_url'];\n\n \t}\n \t// associated with an entry or template?\n \telseif( $node['entry_id'] || $node['template_path'] ) \n \t{\n\n \t\t// does this have a pages/structure uri\n \t\t$pages_uri = $this->entry_id_to_page_uri( $node['entry_id'] );\n\n \t\tif($pages_uri)\n \t\t{\n \t\t\t$url = $pages_uri;\n \t\t}\n \t\telse\n \t\t{\n\n \t\t\tif($node['template_path'])\n\t \t\t{\n\t \t\t\t$templates = $this->get_templates();\n\t \t\t\t$url .= (isset($templates['by_id'][ $node['template_path'] ])) ? '/'.$templates['by_id'][ $node['template_path'] ] : '';\n\t \t\t}\n\n\t \t\tif($node['entry_id'])\n\t\t\t\t{\n\t\t\t\t\t$url .= '/'.$node['url_title'];\n\t\t\t\t}\n\n\t\t\t\tif($node['entry_id'] || $node['template_path'])\n\t\t\t\t{\n\t\t\t\t\t$url = ee()->functions->fetch_site_index().$url;\n\t\t\t\t}\n \t\t}\n\n \t}\n\n \tif($url && $url != '/')\n \t{\n \t\t// remove double slashes\n \t\t$url = preg_replace(\"#(^|[^:])//+#\", \"\\\\1/\", $url);\n\t\t\t// remove trailing slash\n\t\t\t$url = rtrim($url,\"/\");\n \t}\n\n \treturn $url;\n\n }", "public function url()\n\t{\n\t\treturn Url::to($this->id);\n\t}", "public function getPageUri($entryId);", "protected function getEntityUri($entity)\n {\n return $entity->url('canonical', array('absolute' => TRUE));\n }", "public function niceUrl()\n {\n return '/' . $this->recipe_id . '/' . $this->url;\n }", "public function getUrlDetail()\n {\n \treturn \"cob_actadocumentacion/ver/$this->id_actadocumentacion\";\n }", "public function url(): string\n {\n return '/user/article/' . $this->slug . '/view';\n }", "function url($id)\r\n\t{\r\n\t\treturn '';\r\n\t}", "protected function _getUrl() {\n\t\t\t$this->_url =\timplode('/', array(\n\t\t\t\t$this->_baseUrlSegment,\n\t\t\t\t$this->_apiSegment,\n\t\t\t\timplode('_', array(\n\t\t\t\t\t$this->_type,\n\t\t\t\t\t$this->_language,\n\t\t\t\t\t$this->_locale,\n\t\t\t\t)),\n\t\t\t\t$this->_apiVersionSegment,\n\t\t\t\t$this->controller,\n\t\t\t\t$this->function\t\n\t\t\t));\n\n\t\t\tempty($this->_getFields) ?: $this->_url .= '?' . http_build_query($this->_getFields);\n\t\t}", "public function getUrlId();", "function url($page='') {\n return $this->base_url . $page;\n }", "public function getEditLink($entity)\n {\n return '?action=load&sampleId=' . $entity->getSampleId();\n }", "protected function getEntityAddURL($entity_type, $bundle) {\n return \"$entity_type/add/$bundle\";\n }", "function constructURL($object);", "function model_set_url($hook, $type, $url, $params) {\n\t$entity = $params['entity'];\n\tif (elgg_instanceof($entity, 'object', 'model')) {\n\t\t$friendly_title = elgg_get_friendly_title($entity->title);\n\t\treturn \"model/view/{$entity->guid}/$friendly_title\";\n\t}\n}", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public function url()\n\t{\n\t\t\n\t\t$lang = Config::get('app.locale');\n\t\t$route_prefix = ($lang == \"ar\" ? \"ar/\" : \"\");\t\t\n\t\treturn Url::to($route_prefix .'page/' .$this->link);\n\t}", "protected function _getUrl()\n {\n return Router::url([\n '_name' => 'wikiPages',\n 'id' => $this->id,\n 'slug' => Inflector::slug($this->title)\n ]);\n }", "private static function getUrl($type,$id=\"\")\n\t{\n\t\t$link = self::base_url;\n\t\tswitch ($type) {\n\t\t\tcase 1:\n\t\t\t\t$link = $link.\"collections\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$link = $link.\"bills\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$link = $link.\"collections/\".$id;\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$link = $link.\"bills/\".$id;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $link;\n\t}", "function getUrl()\n {\n return partial_url($this->getNodeType(), $this->m_action, $this->m_partial, $this->m_params, $this->m_sessionStatus);\n }", "public function toUrl()\n {\n\n return '<a href=\"'.static::$toUrl.'&amp;objid='.$this->id.'\" >'.$this->text().'</a>';\n\n }", "function url_for_concurso($concurso, $from = null, $contribution = null) {\n if ($concurso->getEmpresaId()) {\n //return url\n $title = $concurso->getSlug();\n \n $param_array = array('company' => $concurso->getEmpresa()->getSlug(),\n /* 'location' => strtolower(str_replace(' ', '-', ($concurso->getCity() ? $concurso->getCity()->getName() : ''))),\n 'road' => strtolower(($concurso->getRoadType() ? $concurso->getRoadType()->getName() : '') . '-' . $concurso->getConcursoAddress() . '-' . $concurso->getConcursoNumero()),*/\n 'title' => $title,\n 'date' => date('d-m-Y', strtotime($concurso->getCreatedAt())));\n if ($from) {\n $param_array['from'] = $from;\n }\n if ($contribution) {\n \n $param_array['cnt'] = $contribution;\n }\n return url_for('company-contest-show', $param_array);\n }\n //url for product contest\n else {\n //get product model record\n $product_record = $concurso->getProducto();\n $title = $concurso->getSlug();\n \n //return url\n $param_array = array('product' => $product_record->getSlug(),\n /*'brand' => strtolower(str_replace(' ', '-', $product_record->getMarca() . ' ' . $product_record->getModelo())),*/\n 'title' => $title,\n 'date' => date('d-m-Y', strtotime($concurso->getCreatedAt()))\n );\n if ($from) {\n $param_array['from'] = $from;\n }\n if ($contribution) {\n $param_array['cnt'] = $contribution;\n }\n return url_for('product-contest-show', $param_array);\n }\n /* return url_for(array(\n 'module' => 'concurso',\n 'action' => 'urlaliasshow',\n 'nombre' => $concurso->getProducto_or_Empresa_NameSlug(),\n 'date' => $concurso->getDateTimeObject('created_at')->format('d-m-Y'),\n 'time' => $concurso->getDateTimeObject('created_at')->format('H-i-s'),\n 'slug' => $concurso->getSlug())); */\n}", "function workflow_card_url_handler($entity) {\n\t$title = elgg_get_friendly_title($entity->title);\n\t$container = get_entity($entity->container_guid);\n\tif (elgg_instanceof($container, 'user')) {\n\t\treturn \"workflow/owner/$container->title/card/$entity->guid/$title\";\n\t} elseif (elgg_instanceof($container, 'group')) {\n\t\treturn \"workflow/group/$container->guid/card/$entity->guid/$title\";\n\t}\n}", "public function url()\n {\n return backpack_url(\"/page/{$this->id}/edit\");\n }", "function url_for_concurso_incidencia($concurso) {\n if ($concurso->getEmpresaId()) {\n $contribution = $concurso->getContribuciones();\n //return url\n return url_for('company-contest-incident', array('company' => $concurso->getEmpresa()->getSlug(),\n /*'location' => strtolower(str_replace(' ', '-', is_object($concurso->getCity()) ? $concurso->getCity()->getName() : '')),\n 'road' => strtolower($concurso->getRoadType()->getName() . '-' . $concurso->getConcursoAddress() . '-' . $concurso->getConcursoNumero()),*/\n 'title' => $concurso->getSlug(),\n 'date' => date('d-m-Y', strtotime($concurso->getCreatedAt())),\n 'contribution' => $contribution[count($contribution) - 1]->getNumero()\n ));\n }\n //url for product contest\n else {\n //get product model record\n $product_record = $concurso->getProducto();\n $contribution = $concurso->getContribuciones();\n $title = $concurso->getSlug();\n \n //return url\n return url_for('product-contest-incident', array('product' => $product_record->getSlug(),\n 'brand' => strtolower(str_replace(' ', '-', $product_record->getMarca() . ' ' . $product_record->getModelo())),\n 'title' => $title,\n 'date' => date('d-m-Y', strtotime($concurso->getCreatedAt())),\n 'contribution' => $contribution[count($contribution) - 1]->getNumero()\n ));\n }\n /* return url_for(array(\n 'module' => 'concurso',\n 'action' => 'showIncidencia',\n 'nombre' => $concurso->getProducto_or_Empresa_NameSlug(),\n 'slug' => $concurso->getSlug(),\n 'date' => $concurso->getDateTimeObject('created_at')->format('d-m-Y'),\n 'time' => $concurso->getDateTimeObject('created_at')->format('H-i-s'),\n 'numero' => 1)); */\n}", "public function get_url();", "public function createUrl($manager, $route, $params)\n {\n $query = Request::find()\n ->where(['auth_item' => $route]);\n \n//echo $query->prepare(Yii::$app->db->queryBuilder)->createCommand()->rawSql;exit;\n $uriRoute = $query->one(); \n if(!empty($uriRoute->id)){\n return $uriRoute->uri;\n }\n return false;\n }", "abstract public function getControllerUrl();", "public function getUrl($page);", "public function toUrl()\n {\n $queryParams = '';\n\n $index = 0;\n\n foreach ($this->args as $key => $param) {\n $separator = '?';\n\n if ($index) {\n $separator = '&';\n }\n\n $queryParams .= \"{$separator}{$key}={$param}\";\n\n $index++;\n }\n\n return \"https://dev-ops.mee.ma/glenn/1/5/people.jpg{$queryParams}\";\n }", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function editUrl() {}", "function buildPath($entity, $options = array()) {\n return file_create_url($entity->uri);\n }", "public function provideUrl(): Generator\n {\n yield [''];\n yield ['/'];\n yield ['/products/123'];\n }", "public function renderUri();", "public function url();", "public function url();", "public function url();", "function entry_id_to_page_uri($entry_id, $site_id = '')\n\t{\n\t\t\n\t\t$site_id = ($site_id != '') ? $site_id : $this->site_id;\n\t\t\n\t\tif($site_id != $this->site_id)\n\t\t{\n\t\t\t$this->load_pages($site_id);\n\t\t}\n\t\t\n\t\t$site_pages = ee()->config->item('site_pages');\n\n\t\tif ($site_pages !== FALSE && isset($site_pages[$site_id]['uris'][$entry_id]))\n\t\t{\n\t\t\t$site_url = $site_pages[$site_id]['url'];\n\t\t\t$node_url = $site_url.$site_pages[$site_id]['uris'][$entry_id];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// not sure what else to do really?\n\t\t\t$node_url = NULL;\n\t\t}\n\t\t\n\t\treturn $node_url;\n\t\t\n\t}", "public function getUrl()\n\t{\n\t\t$url = strtolower($this->_name);\n\t\t$url = str_replace(' ', '-', $url);\n\t\t$url = str_replace('&-', '', $url);\n\n\t\t# retrieves a sanitized url from the project name :3\n\t\treturn $this->getId() . DIRECTORY_SEPARATOR . $url;\n\t}", "public function urlUret3(){\n //generateUrl de olan name php bin/console debug:router ile bulduk\n //page den sonra olan kisimlari ekleyerek ne aradimizi netlestirmis olduk\n // 3. parametre olarak \"UrlGeneratorInterface\" bize verecegi URL turunu belirleyebiliyoruz\n $url=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n ]);\n\n\n $fullurl=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n 'category'=>'health',\n 'age'=>25,\n 'height'=>170\n ],UrlGeneratorInterface::RELATIVE_PATH);\n\n\n return new JsonResponse([\"Generate URL\"=>$url , \"Full URL: \"=> $fullurl]);\n }", "public function getRowUrl($row) {\n return $this->getUrl ( '*/*/edit', array (\n \n 'id' => $row->getId () \n ) );\n }", "function subsite_manager_entities_get_url_hook($hook, $type, $returnvalue, $params){\n\t\t$result = $returnvalue;\n\n\t\tif(!empty($params) && is_array($params)){\n\t\t\t$entity = elgg_extract(\"entity\", $params);\n\n\t\t\tif(!empty($entity) && (elgg_instanceof($entity, \"group\", null, \"ElggGroup\")) || elgg_instanceof($entity, \"object\")){\n\t\t\t\t$site = elgg_get_site_entity();\n\n\t\t\t\tif($entity->site_guid != $site->getGUID()){\n\t\t\t\t\tif(($correct_site = elgg_get_site_entity($entity->site_guid))){\n\t\t\t\t\t\t// messages are special\n\t\t\t\t\t\tif(elgg_instanceof($entity, \"object\", \"messages\") && elgg_instanceof($correct_site, \"site\", Subsite::SUBTYPE, \"Subsite\")){\n\t\t\t\t\t\t\tif($user = elgg_get_logged_in_user_entity()){\n\t\t\t\t\t\t\t\tif(!$correct_site->isUser($user->getGUID())){\n\t\t\t\t\t\t\t\t\t$correct_site = elgg_get_site_entity($correct_site->getOwnerGUID());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// rewrite url\n\t\t\t\t\t\t$result = elgg_normalize_url($result);\n\t\t\t\t\t\t$result = str_ireplace($site->url, $correct_site->url, $result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "function url_for($to) {\n $args = func_get_args();\n\n # find params\n $params = array();\n if (is_array(end($args))) {\n $params = array_pop($args);\n }\n\n # urlencode all but the first argument\n $args = array_map('urlencode', $args);\n $args[0] = $to;\n\n return PluginEngine::getURL($this->dispatcher->plugin, $params, join('/', $args));\n }", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "function url_for($to)\n {\n $args = func_get_args();\n\n # find params\n $params = array();\n if (is_array(end($args))) {\n $params = array_pop($args);\n }\n\n # urlencode all but the first argument\n $args = array_map('urlencode', $args);\n $args[0] = $to;\n\n return PluginEngine::getURL($this->dispatcher->plugin, $params, join('/', $args));\n }", "protected function _getUrl(): string\n {\n property_exists_or_fail($this, ['id', 'album']);\n\n return Router::url(['_name' => 'photo', 'slug' => $this->get('album')->get('slug'), 'id' => (string)$this->get('id')], true);\n }", "function urlSeoGen($lang) {\n\t\t$sql = $this->sql(\"SELECT * FROM page_url WHERE page_id = \".$this.\" AND lang = \".D()->quote($lang));\n\t\t$row = D()->row($sql);\n\t\t$url = $row && $row['custom'] ? $row['url'] : $this->urlSeoGenerated($lang);\n\t\t$this->urlSet($lang, ['url'=>$url]);\n\t\tforeach ($this->Children(['type'=>'*']) as $C) {\n\t\t\t$C->urlSeoGen($lang);\n\t\t}\n\t\treturn $url;\n\t}", "function url_for($to)\n {\n $args = func_get_args();\n\n // find params\n $params = array();\n if (is_array(end($args))) {\n $params = array_pop($args);\n }\n\n // urlencode all but the first argument\n $args = array_map('urlencode', $args);\n $args[0] = $to;\n\n return PluginEngine::getURL($this->dispatcher->plugin, $params, join('/', $args));\n }", "abstract public function getUrl($controller, $action);", "public function getUrl()\n \t{\n \t\t$url=Yii::app()->createUrl(\"markingUpSkill/view\",array('id'=>$this->id));\n\t\treturn $url;\n \t}", "protected function getPageURL()\n {\n global $post_id;\n try {\n if (defined('TOPIC_ID')) {\n // this is a TOPICS page\n $SQL = \"SELECT `link` FROM `\".TABLE_PREFIX.\"mod_topics` WHERE `topic_id`='\".TOPIC_ID.\"'\";\n $link = $this->app['db']->fetchColumn($SQL);\n // include TOPICS settings\n global $topics_directory;\n include_once WB_PATH . '/modules/topics/module_settings.php';\n return WB_URL . $topics_directory . $link . PAGE_EXTENSION;\n }\n elseif (!is_null($post_id) || defined('POST_ID')) {\n // this is a NEWS page\n $id = (defined('POST_ID')) ? POST_ID : $post_id;\n $SQL = \"SELECT `link` FROM `\".TABLE_PREFIX.\"mod_news_posts` WHERE `post_id`='$id'\";\n $link = $this->app['db']->fetchColumn($SQL);\n return WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION;\n }\n else {\n $SQL = \"SELECT `link` FROM `\".TABLE_PREFIX.\"pages` WHERE `page_id`='\".PAGE_ID.\"'\";\n $link = $this->app['db']->fetchColumn($SQL);\n return WB_URL.PAGES_DIRECTORY.$link.PAGE_EXTENSION;\n }\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "public function getUrl($page): string;", "function getLink () {\n\t\t$baseLink = 'index.php';\n\t\tif ($this->getAction ()) {\n\t\t\treturn $baseLink .= '?action='.$this->getAction ();\n\t\t}\n\t\telseif ($this->isAdminPage ()) {\n\t\t\treturn $baseLink .= '?action=admin&pageID='.$this->getID ();\n\t\t} else {\n\t\t\treturn $baseLink .= '?action=viewPage&pageID='.$this->getID ();\n\t\t}\n\t}", "function url($route, $params=array ( ), $ampersand='&'){\n return Yii::app()->controller->createUrl($route, $params, $ampersand);\n}", "public static function notificationUrl($entityType, $entityId, $blogId) : string\n {\n switch_to_blog((int) $blogId);\n $entityTypes = \\NotificationCenter\\Helper\\EntityTypes::getEntityTypes();\n\n // Get URL depending on entity type, default is Post\n switch ($entityTypes[$entityType]['type']) {\n case 'comment':\n case 'comment_mention':\n $commentObj = get_comment($entityId);\n $postType = get_post_type($commentObj->comment_post_ID);\n // Parameter 'page_id' only works with Pages\n $param = $postType == 'page' ? 'page_id' : 'p';\n $url = add_query_arg( array(\n $param => $commentObj->comment_post_ID,\n 'post_type' => $postType\n ), home_url('/'));\n\n // Add comment/answer target\n $url = $commentObj->comment_parent > 0 ? $url . '#answer-' . $entityId : $url . '#comment-' . $entityId;\n\n break;\n\n default:\n $postType = get_post_type($entityId);\n $param = $postType == 'page' ? 'page_id' : 'p';\n $url = add_query_arg( array(\n $param => $entityId,\n 'post_type' => $postType\n ), home_url('/'));\n\n break;\n }\n\n restore_current_blog();\n return $url;\n }", "public abstract function getURL();", "function workflow_list_url_handler($entity) {\n\t$title = elgg_get_friendly_title($entity->title);\n\t$container = get_entity($entity->container_guid);\n\tif (elgg_instanceof($container, 'user')) {\n\t\treturn \"workflow/owner/$container->title/list/$entity->guid/$title\";\n\t} elseif (elgg_instanceof($container, 'group')) {\n\t\treturn \"workflow/group/$container->guid/list/$entity->guid/$title\";\n\t}\n}", "public function url()\n {\n return backpack_url(\"/page-template/{$this->id}/edit\");\n }", "private function _getURL()\n {\n\n $url = $this->_ect . '?';\n foreach ($this as $name => $var) {\n if ($name == 'ect') {\n continue;\n }\n $url .= \"$name=$var&\";\n }\n\n $this->url = $url;\n\n return $this->url;\n }", "function getUrl( $module, $controller, $function, $parametros=false, $pagina=false ){\n \n if($pagina==false){\n $pagina=\"index\";\n }\n \n $url = \"$pagina.php?module=$module&controller=$controller&function=$function\";//Recibe parametros por metodo GET\n \n //Se almacena en un array los parametros requeridos, por ejemplo departamento_id = 1 y ciudad_id = 2 etc...\n if ($parametros!=false) {\n foreach ($parametros as $key => $value) {\n $url.=\"&$key=$value\";\n }\n }\n\n return $url;\n}", "function get_generic_link() {\n\t\treturn $this->url;\n\t}", "function site_url ($page) {\n return \"/assignment/Student Companion/pages/\" . $page;\n }", "function get_linked_entity_name($entity) {\n\tif (elgg_instanceof($entity)) {\n\t\treturn elgg_view('output/url', array(\n\t\t\t'text' => $entity->getDisplayName(),\n\t\t\t'href' => $entity->getURL(),\n\t\t\t'is_trusted' => true,\n\t\t));\n\t}\n\treturn '';\n}", "function pinboards_url($hook, $type, $return, $params) {\n\tif (!elgg_instanceof($params['entity'], 'object', 'au_set')) {\n\t\treturn $return;\n\t}\n\t\n\tif (!$params['entity']->getOwnerEntity()) {\n\t\t// default to a standard view if no owner.\n\t\treturn $return;\n\t}\n\n\t$friendly_title = elgg_get_friendly_title($params['entity']->title);\n\n\treturn \"pinboards/view/{$params['entity']->guid}/$friendly_title\";\n}", "public function getCustomUrl() : string;", "private function getSelfUrl() : string\n {\n return \"/models/\" . $this->getId();\n }", "private function pageUrl($page_id) {\n\t\t$url = \"pages/\";\n\t\tif (is_string($page_id) && $page_id !== 'home') {\n\t\t\t$url .= '=';\n\t\t}\n\t\t$url .= $page_id;\n\t\treturn $url;\n\t}", "function generate_entity_icon_link($entity_type, $entity)\n{\n return generate_entity_link($entity_type, $entity, NULL, NULL, FALSE, ['icon' => TRUE]);\n}", "public function getRowUrl($row)\n {\n return '';//$this->getUrl('*/*/detail', array('id' => $row->getId()));\n }", "public function to_url() {\n $post_data = $this->to_postdata();\n $out = $this->get_normalized_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n return $out;\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "function href() {\n\t\t$usemodrewrite = polarbear_setting('usemodrewrite');\n\t\tif ($usemodrewrite) {\n\t\t\treturn $this->fullpath();\n\t\t} else {\n\t\t\treturn $this->templateToUse() . '?polarbear-page=' . $this->getId();\n\t\t}\n\t}", "function CreateUrl($module, $section = '', $category = '', $item = '', $comment = '', $page = '') {\n $url = MODULE.$module;\n if (!empty($section)) {\n $url = $url.SECTION.$section;\n if (!empty($category)) {\n $url = $url.CATEGORY.$category;\n if (!empty($item)) {\n $url = $url.ITEM.$item;\n if (!empty($comment)) {\n $url = $url.COMMENT.$comment;\n if (!empty($page)) {\n $url = $url.PAGE.$comment;\n }\n }\n }\n }\n }\n return $url;\n}", "public function getSelfSubUrl($entity = null)\n {\n return $this->_getCakeSubUrl($entity, $this->_view->viewVars['_absoluteLinks']) . '/' . $entity->id;\n }", "public function getUri(){\n\t\treturn preg_replace('/[^\\w-]*/', '', (strtolower(str_replace(' ', '-', $this->name)))).'-'.$this->id;\n\t}", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "public function getURL ();", "public function to_url()\n {\n $post_data = $this->to_postdata();\n $out = $this->get_http_url();\n if ($post_data) {\n $out .= '?'.$post_data;\n }\n\n return $out;\n }", "public function getDirectUrl(): string\n {\n return $this->directUrlBase . $this->templateId . '.png?' . http_build_query($this->buildQuery());\n }", "abstract public function url($manipulation_name = '');", "function getUrl($modulo, $controlador, $funcion, $parametros = false, $pagina = false){\n\n\t\tif($pagina == false){\n\t\t\t$pagina = \"index\";\n\t\t}\n\n\t\t$url = $pagina.\".php?modulo=$modulo&controlador=$controlador&funcion=$funcion\";\n\n\t\tif($parametros!=false){\n\t\t\tforeach ($parametros as $columna => $valor) {\n\n\t\t\t\t\t$url.=\"&\".$columna.\"=\".$valor.\"\";\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $url;\n\t}", "abstract protected function buildShowUri($object);", "public function url()\n {\n return '/recipe/' . $this->recipe->getKey();\n }", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "public static function url(string $id, array $args = [], int $type = self::ABSOLUTE_PATH): string\n {\n if ($type === self::RELATIVE_PATH) {\n Log::debug('Requested relative path which is not an absolute path... just saying...');\n }\n return self::$router->generate($id, $args, $type);\n }", "public function getPageUrl($number);", "public function __invoke() {\n\t\t\treturn \\uri\\generate::string($this->object);\n\t\t}", "public function getEditUrl() { }" ]
[ "0.69575846", "0.67800105", "0.651899", "0.6492901", "0.6464377", "0.64279646", "0.63752335", "0.6347413", "0.6296337", "0.62721276", "0.62549084", "0.624497", "0.62296355", "0.6176377", "0.61689", "0.61653763", "0.61525023", "0.6147345", "0.6120563", "0.6070356", "0.60581106", "0.6048637", "0.60342467", "0.6028408", "0.6006741", "0.5992687", "0.598655", "0.59852004", "0.59674543", "0.5956658", "0.59546477", "0.59519756", "0.5939642", "0.59331304", "0.5917045", "0.5912441", "0.5894985", "0.5876659", "0.5868013", "0.5860424", "0.5849769", "0.5848969", "0.5833308", "0.5823827", "0.5809795", "0.580584", "0.5800258", "0.5800258", "0.5800258", "0.5793522", "0.57870144", "0.57760984", "0.5770666", "0.5764482", "0.5755666", "0.57548255", "0.5747102", "0.57415843", "0.57397586", "0.5726906", "0.5719318", "0.5715053", "0.57146275", "0.5711739", "0.5703924", "0.5701659", "0.5701641", "0.5699808", "0.5694725", "0.5692757", "0.56838644", "0.56824166", "0.5681364", "0.5674462", "0.5672795", "0.5672765", "0.567113", "0.5666796", "0.5666584", "0.566549", "0.5663899", "0.56631505", "0.5662889", "0.56626797", "0.5661825", "0.56583273", "0.56457543", "0.5645057", "0.56390923", "0.5635921", "0.5634144", "0.56283545", "0.5627114", "0.5622772", "0.5621414", "0.5619712", "0.56191397", "0.56181616", "0.56170267", "0.56121236" ]
0.7027142
0
Finds the template corresponding checking first if there is a custom template for it. Custom templates are placed in same location as the default one and with the site slug prepended, e.g. startupdigital_layout.html.twig when overriding layout.html.twig
public function getTemplate($template) { $bundle = 'AllegroSitesBundle'; $baseDir = 'base'; $overrideDir = 'tpl_' . $this->session->get('site'); $ext = '.twig'; $templateName = (false === strpos($template, ':') ? ':' : '/') . $template; $template = "{$bundle}:{$overrideDir}{$templateName}{$ext}"; if (!$this->templating->exists($template)) { $template = "{$bundle}:{$baseDir}{$templateName}{$ext}"; } return $template; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function findTemplate(){\n if($this->hasErrors()) return false;\n $located = false;\n if(!$this->hasErrors()){\n $module_file = trailingslashit($this->location).$this->type.'.php';\n $file = trailingslashit($this->module).trailingslashit($this->location).$this->type.'.php';\n switch(true){\n //Check Stylesheet directory first (Child Theme)\n case file_exists(trailingslashit(get_stylesheet_directory()).trailingslashit(self::TEMPLATE_DIRECTORY).$file):\n $located = trailingslashit(get_stylesheet_directory()).trailingslashit(self::TEMPLATE_DIRECTORY).$file;\n break;\n //Check Template directory Second (Parent Theme)\n case file_exists(trailingslashit(get_template_directory()).trailingslashit(self::TEMPLATE_DIRECTORY).$file):\n $located = trailingslashit(get_template_directory()).trailingslashit(self::TEMPLATE_DIRECTORY).$file;\n break;\n //Check filtered custom template directory, if it's set.\n case (apply_filters($this->prefix('custom_template_directory_root'), '', $this) !== '' && file_exists(trailingslashit(apply_filters($this->prefix('custom_template_directory_root'), '', $this)).$file)):\n $located = trailingslashit($this->prefix('custom_template_directory_root')).$file;\n break;\n //If nothing else exists, go ahead and get the default\n default:\n $file = trailingslashit(ModuleLoader::getModuleDir($this->module)).$module_file;\n if($this->fileExists($file)) $located = $file;\n break;\n }\n }\n\n return $located;\n }", "function carton_locate_template( $template_name, $template_path = '', $default_path = '' ) {\n\tglobal $carton;\n\n\tif ( ! $template_path ) $template_path = $carton->template_url;\n\tif ( ! $default_path ) $default_path = $carton->plugin_path() . '/templates/';\n\n\t// Look within passed path within the theme - this is priority\n\t$template = locate_template(\n\t\tarray(\n\t\t\ttrailingslashit( $template_path ) . $template_name,\n\t\t\t$template_name\n\t\t)\n\t);\n\n\t// Get default template\n\tif ( ! $template )\n\t\t$template = $default_path . $template_name;\n\n\t// Return what we found\n\treturn apply_filters('carton_locate_template', $template, $template_name, $template_path);\n}", "function ffd_locate_template( $template_name, $template_path = '', $default_path = '' ) {\r\n\tif ( ! $template_path ) {\r\n\t\t$template_path = FFD()->template_path();\r\n\t}\r\n\r\n\tif ( ! $default_path ) {\r\n\t\t$default_path = FFD()->plugin_path() . '/templates/';\r\n\t}\r\n\r\n\t// Look within passed path within the theme - this is priority.\r\n\t$template = locate_template(\r\n\t\tarray(\r\n\t\t\ttrailingslashit( $template_path ) . $template_name,\r\n\t\t\t$template_name,\r\n\t\t)\r\n\t);\r\n\r\n\t// Get default template/.\r\n\tif ( ! $template || FFD_TEMPLATE_DEBUG_MODE ) {\r\n\t\t$template = $default_path . $template_name;\r\n\t}\r\n\r\n\t// Return what we found.\r\n\treturn apply_filters( 'ffd_locate_template', $template, $template_name, $template_path );\r\n}", "function wac_locate_template( $template_name, $template_path = '', $default_path = '' ) {\n\tglobal $woo_auction;\n\tif(!$template_path){\n\t\t$template_path = $woo_auction->theme_template_path();\n\t}\n\tif(!$default_path){\n\t\t$default_path = $woo_auction->plugin_path() . '/templates/';\n\t}\n\t\n\t// Look within passed path within the theme - this is priority.\n\t$template = locate_template(\n\t\tarray(\n\t\t\ttrailingslashit($template_path) . $template_name,\n\t\t\t$template_name,\n\t\t)\n\t);\n\t\n\t// Get default template/\n\tif (!$template){\n\t\t$template = $default_path . $template_name;\n\t}\n\n\t// Return what we found.\n\treturn apply_filters('wac_locate_template',$template,$template_name,$template_path );\n}", "function youpztStore_locate_template( $template_name, $template_path = '', $default_path = '' ) {\n if ( ! $template_path ) {\n $template_path =UPSTORE_TEMPLATE_DIR;\n }\n\n if ( ! $default_path ) {\n $default_path =UPSTORE_PLUGIN_DIR.'/templates/';\n }\n\n // Look within passed path within the theme - this is priority.\n $template = locate_template(\n array(\n trailingslashit( $template_path ) . $template_name,\n $template_name\n )\n );\n\n // Get default template/\n if ( ! $template) {\n $template = $default_path . $template_name;\n }\n\n // Return what we found.\n return $template;\n}", "function myplugin_woocommerce_locate_template( $template, $template_name, $templates_directory ) {\n\t$original_template = $template;\n\n\tif ( ! $templates_directory ) {\n\t\t$templates_directory = WC()->template_url;\n\t}\n\n // Plugin's custom templates/ directory\n\t$plugin_path = myplugin_get_plugin_path() . '/templates/';\n\n\t// Look within passed path within the theme - this is priority.\n\t$template = locate_template(\n\t\tarray(\n\t\t\t$templates_directory . $template_name,\n\t\t\t$template_name,\n\t\t)\n\t);\n\n\t// Get the template from this plugin under /templates/ directory, if it exists.\n\tif ( ! $template && file_exists( $plugin_path . $template_name ) ) {\n\t\t$template = $plugin_path . $template_name;\n\t}\n\n\t// Use default template if not found a suitable template under plugin's /templates/ directory.\n\tif ( ! $template ) {\n\t\t$template = $original_template;\n\t}\n\n\t// Return what we found.\n\treturn $template;\n}", "function ct_get_template_hierarchy( $template ) {\n \n // Get the template slug\n $template_slug = rtrim( $template, '.php' );//single\n $template = $template_slug . '.php'; //single.php\n\n //logit($template,'$template: ');\n //logit($template_slug,'$template_slug: ');\n\n //$locate = locate_template( array( 'plugin_templates/single.php' ) );\n //$locateString = 'plugin_template/' . $template;\n //logit($locateString,'$locateString: ');\n //logit($locate,'$locate: ');\n \n // Check if a custom template exists in the theme folder, if not, load the plugin template file\n if ( $theme_file = locate_template( array( 'cals_teams_templates/' . $template ) ) ) {\n $file = $theme_file;\n logit($file,'$file: ');\n\n }\n else {\n $file = CT_PLUGIN_BASE_DIR . '/includes/templates/' . $template;\n }\n \n //return apply_filters( 'rc_repl_template_' . $template, $file );\n return $file;\n}", "function bp_gtm_load_template_filter($found_template, $templates) {\n global $bp;\n\n if ($bp->current_action == $bp->gtm->slug || $bp->current_component == $bp->gtm->slug) {\n foreach ((array) $templates as $template) {\n $path = is_child_theme() ? TEMPLATEPATH : STYLESHEETPATH; // different path to themes files\n if (file_exists($path . '/' . $template)) {\n $filtered_templates[] = $path . '/' . $template;\n } else if (file_exists(STYLESHEETPATH . '/gtm/' . $template)) {\n $filtered_templates[] = STYLESHEETPATH . '/gtm/' . $template;\n } else {\n if (($position = strpos($template, '/')) !== false)\n $template = substr($template, $position + 1);\n $filtered_templates[] = plugin_dir_path(__FILE__) . 'templates/gtm/' . $template;\n }\n }\n $found_template = $filtered_templates[0];\n\n return apply_filters('bp_gtm_load_template_filter', $found_template);\n } else {\n return $found_template;\n }\n}", "public function intendedTemplate() {\n if(isset($this->cache['intendedTemplate'])) return $this->cache['intendedTemplate'];\n return $this->cache['intendedTemplate'] = $this->content()->exists() ? $this->content()->name() : 'default';\n }", "function rf_locate_template( $template_name, $template_path = '', $default_path = '' )\n{\n if ( ! $template_path ) {\n $template_path = RFFramework()->template_path();\n }\n\n if ( ! $default_path ) {\n $default_path = RFFramework()->path();\n }\n\n // Locate the template within the template structure\n $template = locate_template(\n array(\n trailingslashit( $template_path ) . $template_name\n )\n );\n\n if ( ! $template ) {\n $template = trailingslashit( $default_path ) . $template_name;\n }\n return $template;\n}", "function astra_addon_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\n\t\t$located = astra_addon_locate_template( $template_name, $template_path, $default_path );\n\n\t\tif ( ! file_exists( $located ) ) {\n\t\t\t/* translators: 1: file location */\n\t\t\t_doing_it_wrong( __FUNCTION__, esc_html( sprintf( __( '%s does not exist.', 'astra-addon' ), '<code>' . $located . '</code>' ) ), '1.0.0' );\n\t\t\treturn;\n\t\t}\n\n\t\t// Allow 3rd party plugin filter template file from their plugin.\n\t\t$located = apply_filters( 'astra_addon_get_template', $located, $template_name, $args, $template_path, $default_path );\n\n\t\tdo_action( 'astra_addon_before_template_part', $template_name, $template_path, $located, $args );\n\n\t\tinclude $located;\n\n\t\tdo_action( 'astra_addon_after_template_part', $template_name, $template_path, $located, $args );\n\t}", "function stage_get_fallback_template($chosen_key, $default_key = null, $data = array())\n{\n // Does the file exist -> return\n $path = Settings::getFallbackTemplatePath($chosen_key, $default_key);\n return stage_render_template($path, $data);\n}", "function emp_locate_template( $template_name, $load=false, $args = array() ) {\n\t//First we check if there are overriding tempates in the child or parent theme\n\t$located = locate_template(array('plugins/events-manager-pro/'.$template_name));\n\tif( !$located ){\n\t\t$dir_location = plugin_dir_path(__FILE__);\n\t\tif ( file_exists( $dir_location.'templates/'.$template_name) ) {\n\t\t\t$located = $dir_location.'templates/'.$template_name;\n\t\t}\n\t}\n\t$located = apply_filters('emp_locate_template', $located, $template_name, $load, $args);\n\tif( $located && $load ){\n\t\tif( is_array($args) ) extract($args);\n\t\tinclude($located);\n\t}\n\treturn $located;\n}", "abstract public function templateExists($name);", "function rc_tc_get_template_hierarchy( $template ) {\r\n \r\n echo ('<!-- Looking for Template ' . __( $template, 'nmmc' ) . '-->' );\r\n // Get the template slug\r\n $template_slug = rtrim( $template, '.php' );\r\n $template = $template_slug . '.php';\r\n echo ('<!-- Looking for Template ' . __( $template, 'nmmc' ) . '-->' );\r\n \r\n \r\n // Check if a custom template exists in the theme folder, if not, load the plugin template file\r\n if ( $theme_file = locate_template( array( 'plugin_template/' . $template ) ) ) {\r\n $file = $theme_file;\r\n }\r\n else {\r\n $file = RC_TC_BASE_DIR . '/templates/' . $template;\r\n }\r\n echo ('<!-- Use Template ' . __( $file, 'nmmc' ) . '-->' );\r\n return apply_filters( 'rc_repl_template_' . $template, $file );\r\n}", "function astra_addon_locate_template( $template_name, $template_path = '', $default_path = '' ) {\n\n\t\tif ( ! $template_path ) {\n\t\t\t$template_path = 'astra-addon/';\n\t\t}\n\n\t\tif ( ! $default_path ) {\n\t\t\t$default_path = ASTRA_EXT_DIR . 'addons/';\n\t\t}\n\n\t\t/**\n\t\t * Look within passed path within the theme - this is priority.\n\t\t *\n\t\t * Note: Avoided directories '/addons/' and '/template/'.\n\t\t *\n\t\t * E.g.\n\t\t *\n\t\t * 1) Override Footer Widgets - Template 1.\n\t\t * Addon: {astra-addon}/addons/advanced-footer/template/layout-1.php\n\t\t * Theme: {child-theme}/astra-addon/advanced-footer/layout-1.php\n\t\t *\n\t\t * 2) Override Blog Pro - Template 2.\n\t\t * Addon: {astra-addon}/addons/blog-pro/template/blog-layout-2.php\n\t\t * Theme: {child-theme}/astra-addon/blog-pro/blog-layout-2.php.\n\t\t */\n\t\t$theme_template_name = str_replace( 'template/', '', $template_name );\n\t\t$template = locate_template(\n\t\t\tarray(\n\t\t\t\ttrailingslashit( $template_path ) . $theme_template_name,\n\t\t\t\t$theme_template_name,\n\t\t\t)\n\t\t);\n\n\t\t// Get default template.\n\t\tif ( ! $template || ASTRA_EXT_TEMPLATE_DEBUG_MODE ) {\n\t\t\t$template = $default_path . $template_name;\n\t\t}\n\n\t\t// Return what we found.\n\t\treturn apply_filters( 'astra_addon_locate_template', $template, $template_name, $template_path );\n\t}", "function s2_get_template($rawTemplateId, $defaultPath = false)\n{\n global $request_uri;\n\n if ($defaultPath === false) {\n $defaultPath = S2_ROOT . '_include/templates/';\n }\n\n $path = false;\n $templateId = preg_replace('#[^0-9a-zA-Z\\._\\-]#', '', $rawTemplateId);\n\n $return = ($hook = s2_hook('fn_get_template_start')) ? eval($hook) : null;\n if ($return) {\n return $return;\n }\n\n if (!$path) {\n if (file_exists(S2_ROOT . '_styles/' . S2_STYLE . '/templates/' . $templateId)) {\n $path = S2_ROOT . '_styles/' . S2_STYLE . '/templates/' . $templateId;\n } elseif (file_exists($defaultPath . $templateId)) {\n $path = $defaultPath . $templateId;\n } else {\n throw new Exception(sprintf(Lang::get('Template not found'), $defaultPath . $templateId));\n }\n }\n\n ob_start();\n include $path;\n $template = ob_get_clean();\n\n $style_filename = '_styles/' . S2_STYLE . '/' . S2_STYLE . '.php';\n $assetPack = require S2_ROOT . $style_filename;\n\n if (!($assetPack instanceof \\S2\\Cms\\Asset\\AssetPack)) {\n throw new Exception(sprintf('File \"%s\" must return an AssetPack object.', $style_filename));\n }\n\n ($hook = s2_hook('fn_get_template_pre_includes_merge')) ? eval($hook) : null;\n\n $styles = $assetPack->getStyles(\n S2_PATH . '/_styles/' . S2_STYLE . '/',\n new \\S2\\Cms\\Asset\\AssetMerge(S2_CACHE_DIR, '/_cache/', S2_STYLE . '_styles.css', \\S2\\Cms\\Asset\\AssetMerge::FILTER_CSS, defined('S2_DEBUG'))\n );\n $scripts = $assetPack->getScripts(\n S2_PATH . '/_styles/' . S2_STYLE . '/',\n new \\S2\\Cms\\Asset\\AssetMerge(S2_CACHE_DIR, '/_cache/', S2_STYLE . '_scripts.js', \\S2\\Cms\\Asset\\AssetMerge::FILTER_JS, defined('S2_DEBUG'))\n );\n\n $template = str_replace(['<!-- s2_styles -->', '<!-- s2_scripts -->'], [$styles, $scripts], $template);\n\n if ((strpos($template, '</a>') !== false) && isset($request_uri)) {\n $template = preg_replace_callback('#<a href=\"([^\"]*)\">([^<]*)</a>#',\n static function ($matches) use ($request_uri) {\n $real_request_uri = s2_link($request_uri);\n\n [, $url, $text] = $matches;\n\n if ($url == $real_request_uri) {\n return '<span>' . $text . '</span>';\n }\n\n if ($url && strpos($real_request_uri, $url) === 0) {\n return '<a class=\"current\" href=\"' . $url . '\">' . $text . '</a>';\n }\n\n return '<a href=\"' . $url . '\">' . $text . '</a>';\n },\n $template\n );\n }\n\n ($hook = s2_hook('fn_get_template_end')) ? eval($hook) : null;\n return $template;\n}", "function ffd_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\r\n\tif ( ! empty( $args ) && is_array( $args ) ) {\r\n\t\textract( $args ); // @codingStandardsIgnoreLine\r\n\t}\r\n\r\n\t$located = ffd_locate_template( $template_name, $template_path, $default_path );\r\n\r\n\tif ( ! file_exists( $located ) ) {\r\n\t\t/* translators: %s template */\r\n\t\treturn;\r\n\t}\r\n\r\n\t// Allow 3rd party plugin filter template file from their plugin.\r\n\t$located = apply_filters( 'ffd_get_template', $located, $template_name, $args, $template_path, $default_path );\r\n\r\n\tdo_action( 'ffd_before_template_part', $template_name, $template_path, $located, $args );\r\n\r\n\tinclude $located;\r\n\r\n\tdo_action( 'ffd_after_template_part', $template_name, $template_path, $located, $args );\r\n}", "public function findTemplate() {\n\n\t\t$templatePath = $this->_template;\n\n\t\tif (empty($templatePath)) {\n\n\t\t\t$templateFolders = array();\n\n\t\t\tif (strlen($tmp = $this->_Model->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// bubble up for template path\n\t\t\telseif (strlen($tmp = $this->_Model->getBubbler()->templatePath)) {\n\t\t\t\t$templateFolders[] = \\Finder::joinPath(APP_ROOT, $tmp);\n\t\t\t}\n\t\t\t// I should add the root page model's template path if exists\n\t\t\t$templateFolders[] = NINJA_ROOT . '/src/ninja/Mod/' . $this->_Module->getModName() . '/template';\n\n\t\t\t$templateFolders = array_unique($templateFolders);\n\n\t\t\t$templateNames = array();\n\t\t\t// I respect what's set in the model, and it should not be invalid\n\t\t\tif (strlen($templateName = $this->_Model->template)) {\n\t\t\t\t$templateNames[]= $templateName;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$Module = $this->_Module;\n\t\t\t\t$modName = $Module->getModName();\n\n\t\t\t\t$a = $Module::moduleNameByClassname(get_class($this->_Model));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($a));\n\t\t\t\t$b = $Module::moduleNameByClassname(get_class($this->_Module));\n\t\t\t\t$templateNames[] = \\Finder::joinPath($modName, \\Finder::classToPath($b));\n\t\t\t}\n\n\t\t\t$extension = '.html.mustache';\n\n\t\t\t// for debug\n\t\t\t//echop($templateFolders); echop($templateNames); die;\n\n\t\t\t$templatePath = \\Finder::fileByFolders($templateFolders, $templateNames, $extension);\n\n\t\t}\n\n\t\treturn $templatePath;\n\n\t}", "function youpztStore_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n if ( $args && is_array( $args ) ) {\n extract( $args );\n }\n\n $located = youpztStore_locate_template( $template_name, $template_path, $default_path );\n\n if ( ! file_exists( $located ) ) {\n //_doing_it_wrong( __FUNCTION__, sprintf( '<code>%s</code> does not exist.', $located ), '2.1' );\n return;\n }\n\n // Allow 3rd party plugin filter template file from their plugin.\n $located = apply_filters('youpztStore_get_template', $located, $template_name, $args, $template_path, $default_path );\n\n include( $located );\n\n}", "public function view_project_template( $template ) {\n\n global $post;\n\n if ( !isset( $post ) ) return $template;\n\n if ( ! isset( $this->templates[ get_post_meta( $post->ID, '_wp_page_template', true ) ] ) ) {\n return $template;\n } // end if\n\n $template_loader = new Uou_Atmf_Load_Template();\n\n if( is_page_template( 'atmf-search.php' ) ){\n $file = $template_loader->locate_template( 'atmf-search.php' );\n }\n\n\n // $file = plugin_dir_path( __FILE__ ) . 'templates/' . get_post_meta( $post->ID, '_wp_page_template', true );\n\n if( file_exists( $file ) ) {\n return $file;\n } // end if\n\n return $template;\n\n }", "function locate_template( $template, $template_name, $template_path ){\r\n\r\n\t\tswitch( $template_name ){\r\n\r\n\t\t\tcase 'form-fields/term-checklist-field.php':\r\n\t\t\t\twp_enqueue_script( 'jmfe-term-checklist-field' );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tif( file_exists( WPJM_FIELD_EDITOR_PLUGIN_DIR . '/templates/' . $template_name ) ){\r\n\t\t\t\t\t$template = WPJM_FIELD_EDITOR_PLUGIN_DIR . '/templates/' . $template_name;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn $template;\r\n\t}", "function find_template (){\n $scriptbasename = basename ($_SERVER['PHP_SELF']);\n\n// Disable STS for popups: moved to sts_default module since v4.4\n\n // Check for module that will handle the template (for example module sts_index takes care of index.php templates)\n\t$check_file = 'sts_'.$scriptbasename;\n\t$modules_installed = explode (';', MODULE_STS_INSTALLED);\n\tif (!in_array($check_file, $modules_installed)) $check_file = 'sts_default.php';\n\n include_once (DIR_WS_MODULES.'sts/'.$check_file);\n\t$classname=substr($check_file,0,strlen($check_file)-4);\n\t$this->script=new $classname; // Create an object from the module\n\t\n// If module existes but is disabled, use the default module.\n\tif ($this->script->enabled==false) {\n\t unset ($this->script);\n include_once (DIR_WS_MODULES.'sts/sts_default.php');\n\t $this->script=new sts_default; // Create an object from the module\t \n\t}\n\t\n\t$this->template_file = $this->script->find_template($scriptbasename); // Retrieve the template to use, $scriptbasename added in v4.4\n\treturn $this->template_file ;\n }", "function rf_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n if ( ! empty( $args ) && is_array( $args ) ) {\n extract( $args );\n }\n\n $located = rf_locate_template( $template_name, $template_path, $default_path );\n\n if ( ! file_exists( $located ) ) {\n _doing_it_wrong( __FUNCTION__, sprintf( __( '%s does not exist.', 'woocommerce' ), '<code>' . $located . '</code>' ), '2.1' );\n return;\n }\n\n // Allow 3rd party plugin filter template file from their plugin.\n $located = apply_filters( 'rf_get_template', $located, $template_name, $args, $template_path, $default_path );\n include( $located );\n}", "protected function installDefaultPageTemplates($bundle)\n {\n // Configuration templates\n $dirPath = $this->container->getParameter('kernel.project_dir') . '/config/kunstmaancms/pagetemplates/';\n $skeletonDir = sprintf('%s/Resources/config/pagetemplates/', GeneratorUtils::getFullSkeletonPath('/common'));\n\n // Only copy templates over when the folder does not exist yet...\n if (!$this->filesystem->exists($dirPath)) {\n $files = [\n 'default-one-column.yml',\n 'default-two-column-left.yml',\n 'default-two-column-right.yml',\n 'default-three-column.yml',\n ];\n foreach ($files as $file) {\n $this->filesystem->copy($skeletonDir . $file, $dirPath . $file, false);\n GeneratorUtils::replace('~~~BUNDLE~~~', $bundle->getName(), $dirPath . $file);\n }\n }\n\n // Twig templates\n $dirPath = $this->getTemplateDir($bundle) . '/Pages/Common/';\n\n $skeletonDir = sprintf('%s/Resources/views/Pages/Common/', GeneratorUtils::getFullSkeletonPath('/common'));\n\n if (!$this->filesystem->exists($dirPath)) {\n $files = [\n 'one-column-pagetemplate.html.twig',\n 'two-column-left-pagetemplate.html.twig',\n 'two-column-right-pagetemplate.html.twig',\n 'three-column-pagetemplate.html.twig',\n ];\n foreach ($files as $file) {\n $this->filesystem->copy($skeletonDir . $file, $dirPath . $file, false);\n }\n $this->filesystem->copy($skeletonDir . 'view.html.twig', $dirPath . 'view.html.twig', false);\n }\n\n $contents = file_get_contents($dirPath . 'view.html.twig');\n\n $twigFile = \"{% extends 'Layout/layout.html.twig' %}\\n\";\n\n if (strpos($contents, '{% extends ') === false) {\n GeneratorUtils::prepend(\n $twigFile,\n $dirPath . 'view.html.twig'\n );\n }\n }", "function catch_plugin_template($template) {\n\t\n // If tp-file.php is the set template\n if( is_page_template('cg-search.php') )\n \t{\n // Update path(must be path, use WP_PLUGIN_DIR and not WP_PLUGIN_URL) \n $template = WP_PLUGIN_DIR . '/hyp3rl0cal-wordpress-plugin/cg-search.php';\n \t}\n \t\n // If tp-file.php is the set template\n if( is_page_template('cg-directory.php') )\n \t{\n // Update path(must be path, use WP_PLUGIN_DIR and not WP_PLUGIN_URL) \n $template = WP_PLUGIN_DIR . '/hyp3rl0cal-wordpress-plugin/cg-directory.php';\n \t} \t\n \n // Return\n return $template;\n}", "public function getTemplate(){\n\t\treturn $this->CustomTemplate ? $this->CustomTemplate : $this->config()->get('default_template');\n\t}", "private function cyl_locate_template($template_name, $template_path = '', $default_path = '')\n {\n if (!$template_path) :\n $template_path = 'templates/';\n endif;\n\n if (!$default_path) :\n $default_path = CYL_PLUGIN_PATH . 'templates/';\n endif;\n\n $template = locate_template(array(\n $template_path . $template_name,\n $template_name\n ));\n\n if (!$template) :\n $template = $default_path . $template_name;\n endif;\n\n return apply_filters('cyl_contact_form_locate_template',\n $template, $template_name, $template_path, $default_path);\n }", "function services_get_custom_post_type_template($single_template) {\n global $post;\n\n if ($post->post_type == 'gon_services_menu') {\n $single_template = dirname( __FILE__ ) . '/single-gon_services_menu.php';\n }\n return $single_template;\n}", "public function get_template( $located, $template_name, $args, $template_path, $default_path ) {\n $plugin_template_path = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/woocommerce/' . $template_name;\n \n if ( file_exists( $plugin_template_path ) ) {\n $located = $plugin_template_path;\n }\n return $located;\n }", "function carton_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\tglobal $carton;\n\n\tif ( $args && is_array($args) )\n\t\textract( $args );\n\n\t$located = carton_locate_template( $template_name, $template_path, $default_path );\n\n\tdo_action( 'carton_before_template_part', $template_name, $template_path, $located );\n\n\tinclude( $located );\n\n\tdo_action( 'carton_after_template_part', $template_name, $template_path, $located );\n}", "public function findTemplate($template_name) {\n $test_path = $this->wp_theme_root . 'templates/' . $template_name;\n if ( file_exists( $test_path ) ) {\n return $test_path;\n } else {\n $test_path = $this->path. 'templates/' . $template_name;\n if ( file_exists($test_path) ) {\n return $test_path;\n } else {\n throw new Exception( __('Core Template was not found: ') . ' ' . $template_name );\n }\n }\n }", "public function findTemplate($template_name) {\n $test_path = $this->wp_theme_root . 'templates/' . $template_name;\n if ( file_exists( $test_path ) ) {\n return $test_path;\n } else {\n $test_path = $this->path. 'templates/' . $template_name;\n if ( file_exists($test_path) ) {\n return $test_path;\n } else {\n throw new Exception( __('Core Template was not found: ') . ' ' . $template_name );\n }\n }\n }", "function hm_load_custom_templates( $template ) {\n\n\tglobal $wp_query, $hm_rewrite_rules, $hm_current_rewrite_rule;\n\n\t// Skip 404 template includes\n\tif ( is_404() && !isset( $hm_current_rewrite_rule[3]['post_query_properties']['is_404'] ) )\n\t\treturn;\n\n\t// Allow 404's to be overridden\n\tif ( is_404() && isset( $hm_current_rewrite_rule[3]['post_query_properties']['is_404'] ) && $hm_current_rewrite_rule[3]['post_query_properties']['is_404'] == false )\n\t\tstatus_header('200');\n\n\t// Show the correct template for the query\n\tif ( isset( $hm_current_rewrite_rule ) && $hm_current_rewrite_rule[4] === $wp_query->query ) {\n\n\t\t// Apply some post query stuff to wp_query\n\t\tif ( isset( $hm_current_rewrite_rule[3]['post_query_properties'] ) )\n\n\t\t\t// $post_query\n\t\t\tforeach( wp_parse_args( $hm_current_rewrite_rule[3]['post_query_properties'] ) as $property => $value )\n\t\t\t\t$wp_query->$property = $value;\n\n\t\tif ( !empty( $hm_current_rewrite_rule[2] ) ) {\n\n\t\t\tdo_action( 'hm_load_custom_template', $hm_current_rewrite_rule[2], $hm_current_rewrite_rule );\n\n\t\t\tif ( empty( $hm_current_rewrite_rule[3]['disable_canonical'] ) && $hm_current_rewrite_rule[1] )\n\t\t\t\tredirect_canonical();\n\n\t\t\tinclude( $hm_current_rewrite_rule[2] );\n\t\t\texit;\n\n\t\t// Allow redirect_canonical to be disabled\n\t\t} else if ( !empty( $hm_current_rewrite_rule[3]['disable_canonical'] ) ) {\n\t\t\tremove_action( 'template_redirect', 'redirect_canonical', 10 );\n\t\t}\n\n\t}\n\n\treturn $template;\n\n}", "function dg_choose_template( $template ) {\n\n\tif ( !is_admin() && is_home() ) {\n\t\t\n\t\t$new_template = locate_template( array( 'single.php' ) );\n\t\t\n\t\tif ( !empty( $new_template ) ) {\n\t\t\treturn $new_template;\n\t\t}\n\t}\n\n\treturn $template;\n}", "function my_single_template($single) {\n global $wp_query, $post;\n\n /**\n * Checks for single template by category\n * Check by category slug and ID\n */\n foreach((array)get_the_category() as $cat) :\n\n if(file_exists(TEMPLATEPATH . '/single-' . $cat->slug . '.php'))\n return TEMPLATEPATH . '/single-' . $cat->slug . '.php';\n\n endforeach;\n\n return $single;\n\n}", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "function yith_ywraq_locate_template( $path, $var = NULL ) {\n\n if ( function_exists( 'WC' ) ) {\n $woocommerce_base = WC()->template_path();\n }\n elseif ( defined( 'WC_TEMPLATE_PATH' ) ) {\n $woocommerce_base = WC_TEMPLATE_PATH;\n }\n else {\n $woocommerce_base = WC()->plugin_path() . '/templates/';\n }\n\n $template_woocommerce_path = $woocommerce_base . $path;\n $template_path = '/' . $path;\n $plugin_path = YITH_YWRAQ_DIR . 'templates/' . $path;\n\n $located = locate_template( array(\n $template_woocommerce_path, // Search in <theme>/woocommerce/\n $template_path, // Search in <theme>/\n $plugin_path // Search in <plugin>/templates/\n ) );\n\n if ( !$located && file_exists( $plugin_path ) ) {\n return apply_filters( 'yith_ywraq_locate_template', $plugin_path, $path );\n }\n\n return apply_filters( 'yith_ywraq_locate_template', $located, $path );\n }", "function templateToUse() {\n\t\t// loop until templateType = name | custom\n\t\t$templateType = $this->getTemplateType();\n\t\t$templateCustom = $this->getTemplateCustom();\n\t\t$templateName = $this->getTemplateName();\n\t\t$articleName = $this->getTitleArticle();\n\t\t$articleId = $this->getId();\n\t\t$parent = $this->parent();\n\t\t\n\t\t$i = 0;\n\t\twhile ($templateType != 'name' && $templateType != 'custom' && $parent !== null) {\n\t\t\t$templateType = $parent->getTemplateType();\n\t\t\t$templateCustom = $parent->getTemplateCustom();\n\t\t\t$templateName = $parent->getTemplateName();\n\t\t\t$articleName = $parent->getTitleArticle();\n\t\t\t$articleId = $parent->getId();\n\t\t\t$parent = $parent->parent();\n\t\t}\n\t\t\n\t\t/*\n\t\techo \"<br><br>templateType: \" . $templateType;\n\t\techo \"<br>templateCustom: \" . $templateCustom;\n\t\techo \"<br>templateName: \" . $templateName;\n\t\techo \"<br>articleName: \" . $articleName;\n\t\techo \"<br>articleID: $articleId\";\n\t\t// */\n\t\t\n\t\t$templates = polarbear_getTemplates();\n\t\t\n\t\tpb_pqp_log_speed(\"article templateToUse\");\n\t\t\n\t\tif ($templateType == 'custom') {\n\t\t\treturn $templateCustom;\n\t\t} else if (isset($templates[$templateName])) {\n\t\t\treturn $templates[$templateName]['file'];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t}", "function astra_locate_template( $template_name, $template_path = '', $default_path = '' ) { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_locate_template()' );\n\treturn astra_addon_locate_template( $template_name, $template_path = '', $default_path = '' );\n}", "function mm_template_chooser( $template ) {\n global $wp_query;\n $post_type = get_query_var('post_type');\n if ( $wp_query->is_search && $post_type == 'photos' ) {\n return locate_template('search-photos.php');\n } elseif ( is_tax( 'albums' ) || is_tax( 'keywords' ) ) {\n $template = get_query_template( 'archive-photos' );\n }\n return $template;\n}", "function fusion_wc_get_template( $slug, $name = '' ) {\n\t\tif ( function_exists( 'wc_get_template' ) ) {\n\t\t\twc_get_template( $slug, $name );\n\t\t} elseif ( function_exists( 'woocommerce_get_template' ) ) {\n\t\t\twoocommerce_get_template( $slug, $name );\n\t\t}\n\t}", "function single_template( $template, $type, $template_names ) {\n\t\t\tglobal $wp_query, $post;\n\n\t\t\t$paths = apply_filters( 'unity3_custom_template_path', array() );\n\t\t\tforeach ( $paths as $path ) {\n foreach ( (array) get_the_category() as $cat ) {\n if ( file_exists( $path . '/single-cat-' . $cat->slug . '.php' ) ) {\n return $path . '/single-cat-' . $cat->slug . '.php';\n } elseif ( file_exists( $path . '/single-cat-' . $cat->term_id . '.php' ) ) {\n return $path . '/single-cat-' . $cat->term_id . '.php';\n }\n }\n //\n //else search for standard templates in the custom directory path\n foreach ( (array) $template_names as $template_name ) {\n if (!$template_name) {\n continue;\n }\n if (file_exists($path . '/' . $template_name)) {\n return $path . '/' . $template_name;\n }\n }\n }\n\n\t\t\treturn $template;\n\t\t}", "protected function getDefaultTemplate()\n {\n return 'modules/XCExample/Recommendations/recommendation/body.twig';\n }", "public function locate_template( $template_name, $template_path = '', $default_path = '' ) {\n\t\tif ( ! $template_path ) {\n\t\t\t$template_path = Rivier_Scholarships()->template_directory();\n\t\t}\n\n\t\tif ( ! $default_path ) {\n\t\t\t$default_path = Rivier_Scholarships()->dir() . '/templates/';\n\t\t}\n\n\t\t// Look within passed path within the theme - this is priority\n\t\t$template = locate_template(\n\t\t\tarray(\n\t\t\t\ttrailingslashit( $template_path ) . $template_name,\n\t\t\t\t$template_name\n\t\t\t)\n\t\t);\n\n\t\t// Get default template\n\t\tif ( ! $template ) {\n\t\t\t$template = $default_path . $template_name;\n\t\t}\n\n\t\t// Return what we found\n\t\treturn apply_filters( 'rivier-scholarships-example_locate_template', $template, $template_name, $template_path );\n\t}", "public function loadTemplate()\n\t{\n\t\t$t_location = \\IPS\\Request::i()->t_location;\n\t\t$t_key = \\IPS\\Request::i()->t_key;\n\t\t\n\t\tif ( $t_location === 'block' and $t_key === '_default_' and isset( \\IPS\\Request::i()->block_key ) )\n\t\t{\n\t\t\t/* Find it from the normal template system */\n\t\t\tif ( isset( \\IPS\\Request::i()->block_app ) )\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Application::load( \\IPS\\Request::i()->block_app ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$plugin = \\IPS\\Widget::load( \\IPS\\Plugin::load( \\IPS\\Request::i()->block_plugin ), \\IPS\\Request::i()->block_key, mt_rand() );\n\t\t\t}\n\t\t\t\n\t\t\t$location = $plugin->getTemplateLocation();\n\t\t\t\n\t\t\t$templateBits = \\IPS\\Theme::master()->getRawTemplates( $location['app'], $location['location'], $location['group'], \\IPS\\Theme::RETURN_ALL );\n\t\t\t$templateBit = $templateBits[ $location['app'] ][ $location['location'] ][ $location['group'] ][ $location['name'] ];\n\t\t\t\n\t\t\tif ( ! isset( \\IPS\\Request::i()->noencode ) OR ! \\IPS\\Request::i()->noencode )\n\t\t\t{\n\t\t\t\t$templateBit['template_content'] = htmlentities( $templateBit['template_content'], ENT_DISALLOWED, 'UTF-8', TRUE );\n\t\t\t}\n\t\t\t\n\t\t\t$templateArray = array(\n\t\t\t\t'template_id' \t\t\t=> $templateBit['template_id'],\n\t\t\t\t'template_key' \t\t\t=> 'template_' . $templateBit['template_name'] . '.' . $templateBit['template_id'],\n\t\t\t\t'template_title'\t\t=> $templateBit['template_name'],\n\t\t\t\t'template_desc' \t\t=> null,\n\t\t\t\t'template_content' \t\t=> $templateBit['template_content'],\n\t\t\t\t'template_location' \t=> null,\n\t\t\t\t'template_group' \t\t=> null,\n\t\t\t\t'template_container' \t=> null,\n\t\t\t\t'template_rel_id' \t\t=> null,\n\t\t\t\t'template_user_created' => null,\n\t\t\t\t'template_user_edited' => null,\n\t\t\t\t'template_params' \t => $templateBit['template_data']\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif ( \\is_numeric( $t_key ) )\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key, 'template_id' );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$template = \\IPS\\cms\\Templates::load( $t_key );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\OutOfRangeException $ex )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->json( array( 'error' => true ) );\n\t\t\t}\n\n\t\t\tif ( $template !== null )\n\t\t\t{\n\t\t\t\t$templateArray = array(\n\t 'template_id' \t\t\t=> $template->id,\n\t 'template_key' \t\t\t=> $template->key,\n\t 'template_title'\t\t=> $template->title,\n\t 'template_desc' \t\t=> $template->desc,\n\t 'template_content' \t\t=> ( isset( \\IPS\\Request::i()->noencode ) AND \\IPS\\Request::i()->noencode ) ? $template->content : htmlentities( $template->content, ENT_DISALLOWED, 'UTF-8', TRUE ),\n\t 'template_location' \t=> $template->location,\n\t 'template_group' \t\t=> $template->group,\n\t 'template_container' \t=> $template->container,\n\t 'template_rel_id' \t\t=> $template->rel_id,\n\t 'template_user_created' => $template->user_created,\n\t 'template_user_edited' => $template->user_edited,\n\t 'template_params' \t => $template->params\n\t );\n\t\t\t}\n\t\t}\n\n\t\tif ( \\IPS\\Request::i()->show == 'json' )\n\t\t{\n\t\t\t\\IPS\\Output::i()->json( $templateArray );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\\IPS\\Output::i()->sendOutput( \\IPS\\Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( \\IPS\\Theme::i()->getTemplate( 'templates', 'cms', 'admin' )->viewTemplate( $templateArray ) ), 200, 'text/html', \\IPS\\Output::i()->httpHeaders );\n\t\t}\n\t}", "private function getTemplateForPage($page)\n {\n return (view()->exists($page->template)) ? $page->template : 'default';\n }", "function launchpad_determine_best_template_file($post, $prefix = '') {\n\t$content_type = get_post_type();\n\t$content_format = get_post_format();\n\t\n\t$file_prefix = 'content-';\n\tif($prefix) {\n\t\t$file_prefix .= 'main-';\n\t}\n\t\n\t// If the content is singular, such as a page or single post type, handle accordingly.\n\tif(is_singular()) {\n\t\t// First, see if there is a content-main-slug.php\n\t\tif(locate_template($file_prefix . $post->post_name . '.php')) {\n\t\t\t$content_type = $post->post_name;\n\t\t\t\n\t\t// Next, if this is a page, see if there is a content-main-page-slug.php.\n\t\t} else if(is_page() && locate_template($file_prefix . '-page-' . $post->post_name . '.php')) {\n\t\t\t$content_type = 'page-' . $post->post_name;\n\t\t\t\n\t\t// Next, if this is a single post type with a content format, see if there is a content-main-posttype-format.php\n\t\t} else if(is_single() && $content_format && locate_template($file_prefix . $content_type . '-' . $content_format . '.php')) {\n\t\t\t$content_type = $content_type . '-' . $content_format;\n\t\t\t\n\t\t// Next, if this is a single post type with a content format, try content-main-format.php.\n\t\t} else if(is_single() && $content_format && locate_template($file_prefix . $content_format . '.php')) {\n\t\t\t$content_type = $content_format;\n\t\t\n\t\t// Next, if this is a single post type, try content-main-single-posttype.php.\n\t\t} else if(is_single() && locate_template($file_prefix . 'single-' . $content_type . '.php')) {\n\t\t\t$content_type = 'single-' . $content_type;\n\t\t\n\t\t// Finally, try content-main-single.php.\n\t\t} else if(is_single() && locate_template($file_prefix . 'single.php')) {\n\t\t\t$content_type = 'single';\n\t\t}\n\t\n\t// If we're on an archive of blog listing page, handle accordingly.\n\t} else if(is_archive() || is_home()) {\n\t\t\n\t\t// Get the current queried object to help decide how to handle the template.\n\t\t$queried_object = get_queried_object();\n\t\t\n\t\t// If there is a queried object, get specific.\n\t\tif($queried_object) {\n\t\t\t\n\t\t\t// If this is a taxonomy page.\n\t\t\tif(isset($queried_object->taxonomy)) {\n\t\t\t\t// This is the taxonomy name, not the taxonomy rewrite slug!\n\t\t\t\t$queried_taxonomy = $queried_object->taxonomy;\n\t\t\t\t// This is the term's slug.\n\t\t\t\t$queried_term = $queried_object->slug;\n\t\t\t\t\n\t\t\t\t// First, try content-main-tax-termslug.php.\n\t\t\t\tif(locate_template($file_prefix . $queried_taxonomy . '-' . $queried_term . '.php')) {\n\t\t\t\t\t$content_type = $queried_taxonomy . '-' . $queried_term;\n\t\t\t\t\n\t\t\t\t// Next, try content-main-tax.php.\n\t\t\t\t} else if(locate_template($file_prefix . $queried_taxonomy . '.php')) {\n\t\t\t\t\t$content_type = $queried_taxonomy;\n\t\t\t\t\t\n\t\t\t\t// Next, try content-main-archive-posttype.php\n\t\t\t\t} else if(locate_template($file_prefix . 'archive-' . $content_type . '.php')) {\n\t\t\t\t\t$content_type = 'archive-' . $content_type;\n\t\t\t\t\n\t\t\t\t// Finally, try content-main-archive.php.\n\t\t\t\t} else if(locate_template($file_prefix . 'archive.php')) {\n\t\t\t\t\t$content_type = 'archive';\n\t\t\t\t}\n\t\t\t\n\t\t\t// If it isn't a taxonomy, look for content-main-archive-posttype.php.\n\t\t\t} else if(locate_template($file_prefix . 'archive-' . $content_type . '.php')) {\n\t\t\t\t$content_type = 'archive-' . $content_type;\n\t\t\t\n\t\t\t// Finally, try content-main-archive.php.\n\t\t\t} else if(locate_template($file_prefix . 'archive.php')) {\n\t\t\t\t$content_type = 'archive';\n\t\t\t}\n\t\t\n\t\t// If there is no queried object, look for content-main-archive-posttype.php.\n\t\t} else if(locate_template($file_prefix . 'archive-' . $content_type . '.php')) {\n\t\t\t$content_type = 'archive-' . $content_type;\n\t\t\n\t\t// Finally, try content-main-archive.php.\n\t\t} else if(locate_template($file_prefix . 'archive.php')) {\n\t\t\t$content_type = 'archive';\n\t\t}\n\t\n\t\n\t// Finally, if we're on a search page, use search as the second parameter.\n\t} else if(is_search()) {\n\t\t$content_type = 'search';\n\t}\n\t\n\t$content_type = apply_filters('launchpad_determine_best_template_file', $content_type, $post, $prefix);\n\t\n\treturn $content_type;\n}", "function load_newsletter_template($template) {\n global $post;\n\n // Is this a futurninews post?\n if ($post->post_type == \"futurninews\"){\n\n $plugin_path = plugin_dir_path( __FILE__ );\n\n $template_name = 'single-newsletter.php';\n\n // checks if there is a single template in themefolder, or it doesn't exist in the plugin\n if($template === get_stylesheet_directory() . '/' . $template_name\n || !file_exists($plugin_path . $template_name)) {\n\n // returns \"single.php\" or \"single-my-custom-post-type.php\" from theme directory.\n return $template;\n }\n\n // If not, return futurninews custom post type template.\n return $plugin_path . $template_name;\n }\n\n //This is not futurninews, do nothing with $template\n return $template;\n}", "function bp_tol_maybe_replace_template( $templates, $slug, $name ) {\n\n\t\t//handling slugs and loading our custom templates : \n\t\t//would check specific member also for custom templates for each member\n\n\t\tswitch ($slug) {\n\t\t\tcase 'members/single/home':\n\t\t\t\t$templates = array( 'members/single/index.php' );\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'members/index':\n\t\t\t\t$templates = array( 'members/index.php' );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$templates = array( 'members/single/index.php' );\n\t\t\t\tbreak;\n\t\t}\n\n\t return $templates;\n\t}", "function wac_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {\n\tif (!empty($args) && is_array($args)){\n\t\textract($args);\n\t}\n\n\t$located = wac_locate_template($template_name,$template_path,$default_path );\n\n\tif (!file_exists($located)){\n\t\twc_doing_it_wrong( __FUNCTION__, sprintf( __( '%s does not exist.','woo-auction' ), '<code>' . $located . '</code>' ), '2.1' );\n\t\treturn;\n\t}\n\n\t// Allow 3rd party plugin filter template file from their plugin.\n\t$located = apply_filters('wac_get_template',$located,$template_name,$args,$template_path,$default_path);\n\t\n\tinclude($located);\n}", "protected function getDefaultTemplate()\n {\n return 'modules/CDev/FileAttachments/product.twig';\n }", "function learn_press_pmpro_locate_template( $name ) {\n\t$file = learn_press_locate_template( $name, 'learnpress-paid-membership-pro', learn_press_template_path() . '/addons/paid-membership-pro/' );\n\t// If template does not exists then look in learnpress/addons/paid-membership-pro in the theme\n\tif ( ! file_exists( $file ) ) {\n\t$file = learn_press_locate_template( $name, learn_press_template_path() . '/addons/paid-membership-pro/', LP_ADDON_PMPRO_PATH . '/templates/' );\n\t}\n\treturn $file;\n}", "function cmdeals_get_template($template_name, $require_once = true) {\n\tglobal $cmdeals;\n\tif (file_exists( STYLESHEETPATH . '/' . WPDEALS_TEMPLATE_URL . $template_name )) load_template( STYLESHEETPATH . '/' . WPDEALS_TEMPLATE_URL . $template_name, $require_once ); \n\telseif (file_exists( STYLESHEETPATH . '/' . $template_name )) load_template( STYLESHEETPATH . '/' . $template_name , $require_once); \n\telse load_template( $cmdeals->plugin_path() . '/cmdeals-templates/' . $template_name , $require_once);\n}", "protected function _setPageViewTemplate()\n {\n\n $fishpigWordpressModuleVersion = Mage::getConfig()->getNode('modules/Fishpig_Wordpress/version');\n\n if ($fishpigWordpressModuleVersion > 4) {\n parent::_setPageViewTemplate();\n } else {\n $page = $this->_initPage();\n\n $template = $page->getMetaValue('_wp_page_template');\n\n // This is the folder in Magento template\n $path = 'page/';\n\n //preg_match('/([^\\/]*)\\.php$/', $template, $match);\n //$filename = $path . $match[1] . '.phtml';\n // The extension is replaced with .phtml,\n // meaning that the directory structure is preserved.\n // (page-templates/templ.php will become $path . page-templates/templ.phtml)\n $filename = $path . str_replace('.php', '.phtml', $template);\n\n // This is to use Magento fallback system\n $params = array('_relative' => false);\n $area = $this->getLayout()->getBlock('root')->getArea();\n\n if ($area) {\n $params['_area'] = $area;\n }\n\n $templateName = Mage::getDesign()->getTemplateFilename($filename, $params);\n\n // If no other matches are found, Magento will eventually give a path in base/default, even if that template doesn't exist\n if (file_exists($templateName)) {\n $this->getLayout()->getBlock('root')->setTemplate($filename);\n }\n\n return $this;\n }\n }", "public function locate_template( $template, $template_name, $template_path ) {\n\n\t\t// Only keep looking if no custom theme template was found or if\n \t\t// a default WooCommerce template was found.\n \t\tif ( ! $template || SV_WC_Helper::str_starts_with( $template, WC()->plugin_path() ) ) {\n\n \t\t\t// Set the path to our templates directory\n \t\t\t$plugin_path = wc_product_reviews_pro()->get_plugin_path() . '/templates/';\n\n \t\t\t// If a template is found, make it so\n \t\t\tif ( is_readable( $plugin_path . $template_name ) ) {\n \t\t\t\t$template = $plugin_path . $template_name;\n \t\t\t}\n \t\t}\n\n\t\treturn $template;\n\t}", "public static function view_project_template($template) {\n\n // Get global post\n global $post;\n // Return template if post is empty\n if (!$post) {\n return $template;\n }\n\n // Return default template if we don't have a custom one defined\n $templates = self::$theme_templates;\n if (!isset($templates[get_post_meta(\n $post->ID, '_wp_page_template', true\n )])) {\n return $template;\n }\n if (file_exists(get_template_directory() . get_post_meta($post->ID, '_wp_page_template', true))) {\n $file = get_template_directory() . get_post_meta($post->ID, '_wp_page_template', true);\n } else {\n $file = SB_THEME_TEMPLATES_PATH . get_post_meta(\n $post->ID, '_wp_page_template', true\n );\n }\n // Just to be safe, we check if the file exist first\n if (file_exists($file)) {\n return $file;\n } else {\n echo $file . 'included file not found';\n }\n // Return template\n return $template;\n }", "public static function switch_page_template() {\n\n global $post;\n\n $post_type = get_post_type($post->ID);\n\n if (is_page() or is_post_type_hierarchical($post_type)) {// Checks if current post type is a page, rather than a post\n $current_page_template = get_post_meta($post->ID, '_wp_page_template', true);\n $parent_page_template = get_post_meta($post->post_parent, '_wp_page_template', true);\n $parents = get_post_ancestors($post->ID);\n\n if ($parents) {\n update_post_meta($post->ID, '_wp_page_template', $parent_page_template, $current_page_template);\n }\n }// End check for page\n }", "function isCustomTemplate() {\n\t\treturn false;\n\t}", "function portfolio_page_template( $template ) {\n $post_id = get_the_ID();\n if ( get_post_type( $post_id ) == 'actividad' && is_single() ) {\n $new_template = dirname( __FILE__ ) . '/includes/templates/single.php';\n if ( $new_template != '' ) {\n return $new_template ;\n }\n }\n return $template;\n}", "private function locate_template( $name ) {\n\t\t$file = plugin_dir_path( $this->plugin->file ) . 'templates/' . $name . '.php';\n\n\t\tif ( is_readable( $file ) ) {\n\t\t\treturn $file;\n\t\t}\n\t}", "public function findFile($path)\n\t{\n\t $template = KFactory::get('lib.joomla.application')->getTemplate();\n $override = JPATH_THEMES.'/'.$template.'/html';\n\t $override .= str_replace(array(JPATH_BASE.'/components', '/views'), '', $path);\n\t \n\t //Try to load the template override\n\t $result = parent::findFile($override);\n\t \n\t if($result === false) \n\t {\n\t //If the path doesn't contain the /tmpl/ folder add it\n\t if(strpos($path, '/tmpl/') === false) {\n\t $path = dirname($path).'/tmpl/'.basename($path);\n\t }\n\t \n\t $result = parent::findFile($path);\n\t } \n\t \n\t return $result;\n\t}", "function get_clientpage_template( $template ) {\r\n global $post;\r\n\r\n/*\r\n\r\n if ( 'clientspage' == $post->post_type ) {\r\n $wpc_settings = get_option( 'wpc_settings' );\r\n if ( isset( $wpc_settings['pages']['portal_page_id'] ) && 0 < $wpc_settings['pages']['portal_page_id'] ) {\r\n $page_template = get_post_meta( $wpc_settings['pages']['portal_page_id'], '_wp_page_template', true );\r\n if ( $page_template ) {\r\n if ( file_exists( get_template_directory() . \"/{$page_template}\" ) )\r\n return get_template_directory() . \"/{$page_template}\";\r\n else\r\n return '';\r\n }\r\n } __use_same_as_portal_page\r\n } else */\r\n\r\n\r\n\r\n if ( 'clientspage' == $post->post_type ) {\r\n $page_template = get_post_meta( $post->ID, '_wp_page_template', true );\r\n\r\n if ( !$page_template || '__use_same_as_portal_page' == $page_template ) {\r\n $wpc_settings = get_option( 'wpc_settings' );\r\n if ( isset( $wpc_settings['pages']['portal_page_id'] ) && 0 < $wpc_settings['pages']['portal_page_id'] ) {\r\n $page_template = get_post_meta( $wpc_settings['pages']['portal_page_id'], '_wp_page_template', true );\r\n if ( $page_template ) {\r\n if ( file_exists( get_template_directory() . \"/{$page_template}\" ) )\r\n return get_template_directory() . \"/{$page_template}\";\r\n }\r\n }\r\n return '';\r\n } else {\r\n if ( file_exists( get_template_directory() . \"/{$page_template}\" ) )\r\n return get_template_directory() . \"/{$page_template}\";\r\n else\r\n return '';\r\n }\r\n }\r\n elseif ( 'hubpage' == $post->post_type ) {\r\n $wpc_settings = get_option( 'wpc_settings' );\r\n if ( isset( $wpc_settings['pages']['hub_page_id'] ) && 0 < $wpc_settings['pages']['hub_page_id'] ) {\r\n $page_template = get_post_meta( $wpc_settings['pages']['hub_page_id'], '_wp_page_template', true );\r\n if ( $page_template ) {\r\n if ( file_exists( get_template_directory() . \"/{$page_template}\" ) )\r\n return get_template_directory() . \"/{$page_template}\";\r\n else\r\n return '';\r\n }\r\n }\r\n }\r\n\r\n return $template;\r\n }", "function br_rc_single_content_template() {\n\n\t$single_content_template = plugin_dir_path( dirname( __FILE__ ) );\n\t$single_content_template .= 'templates/br-rc-content-single.php';\n\n\t// Filter the default path\n\t$single_content_template = apply_filters( 'br_rc_single_content_template_filter', \n\t\t\t\t\t\t\t\t\t\t\t $single_content_template );\n\n\t// Return the path\n\treturn $single_content_template;\n}", "function getDefault($url){\n \n\t \n\t \n\t $path = explode('/', $url);\n\t \t \n\t $temp = $path[$this -> getPos($url)];\n\t \n\t if($temp != ''){\n\t \n\t\t$file = DIR_TEMPLATE.'/'.$temp.'.php';\n\t\t\n\t if (is_readable($file)) {\n\n //include the alternative template\n\t\t $template = $file;\n\t\t\n\t\t}else{\n\t\t\n\t\t //include the default template\n\t\t $template = DIR_TEMPLATE.'/default.php';\n\t\t\n\t\t}\n }else{\n \n\t\t //include the default template\n\t\t $template = DIR_TEMPLATE.'/default.php';\n\n }\t \n \n return $template;\n \n }", "function sat_load_templates( $original_template ) \n{\n /*\n get_query_var( $var, $default )\n \n Retrieves public query variable in the WP_Query class of the global $wp_query object.\n\n $var (string) (required) The variable key to retrieve. Default: None\n \n $default (mixed) (optional) Value to return if the query variable is not set. \n Default: empty string\n\n returns $default if var is not set\n */\n //when a page loads, if it is not equal to 'task', return nothing and exits function immediatly.\n if ( get_query_var( 'post_type' ) !== 'task' ) \n {\n return;\n }\n\n /*\n is_search();\n\n This Conditional Tag checks if search result page archive is being displayed. This is a boolean function, meaning it returns either TRUE or FALSE.\n\n is_archive();\n\n This Conditional Tag checks if any type of Archive page is being displayed. An Archive is a Category, Tag, Author, Date, Custom Post Type or Custom Taxonomy based pages. This is a boolean function, meaning it returns either TRUE or FALSE\n\n is_archive() does not accept any parameters. If you want to check if this is the archive of a custom post type, use is_post_type_archive( $post_type )\n */\n //using Conditional Tags to trigger code if page is an archive or search page\n if ( is_archive() || is_search() ) \n {\n //If the user adds custom-archive page for 'task'-custom post-type to their site's current theme by adding archive-task.php to the root file of the theme, use it!\n if ( file_exists( get_stylesheet_directory(). '/archive-task.php' ) ) \n {\n return get_stylesheet_directory() . '/archive-task.php';\n }\n\n //If not use the archive-task.php file located within this plugin's file directory\n else \n {\n return plugin_dir_path( __FILE__ ) . 'templates/archive-task.php';\n }\n\n } \n\n /*\n is_singular( $post_types );\n\n This conditional tag checks if a singular post is being displayed, which is the case when one of the following returns true: is_single(), is_page() or is_attachment(). If the $post_types parameter is specified, the function will additionally check if the query is for one of the post types specified.\n\n $post_types (string/array) (optional) Post type or types to check in current query. Default: None\n */\n\n //using Conditional Tags to trigger code if page is a single post\n elseif(is_singular('task')) \n {\n //If the user adds custom-single post for 'task'-custom post-type to their site's current theme by adding archive-task.php to the root file of the theme, use it!\n if ( file_exists( get_stylesheet_directory(). '/single-task.php' ) ) \n {\n return get_stylesheet_directory() . '/single-task.php';\n } \n\n //If not use the single-task.php file located within this plugin's file directory\n else \n {\n return plugin_dir_path( __FILE__ ) . 'templates/single-task.php';\n }\n }\n\n else\n {\n \t\treturn get_page_template();\n }\n\n return $original_template;\n}", "public function locate($template, $type = NULL) {\n\n\t\t\t// Initialize variables\n\n\t\t\t$templates = array ();\n\n\t\t\tif (is_null($type)) {\n\t\t\t\t$type = $this->type;\n\t\t\t}\n\n\t\t\t// If this is the main template (e.g. single.php), note type for other templates\n\n\t\t\tif (did_action('template_redirect') == 1 && is_null($this->type)) {\n\n\t\t\t\t// Get list of bases to wrap this request in\n\n\t\t\t\t$templates = $this->get_bases($template);\n\n\t\t\t\t// Note the original template as the content template\n\n\t\t\t\t$this->main_template = $template;\n\n\t\t\t\t// Note the type for template parts\n\n\t\t\t\t$this->type = basename($template, '.php');\n\n\t\t\t} else {\n\n\t\t\t\t// This is a part template (e.g. templates/sidebar.php)\n\n\t\t\t\tarray_unshift($templates, $template); // Default to whatever template provided\n\n\t\t\t\t// If type is not the default (index), add a more specific template part\n\n\t\t\t\tif ($this->type !== 'index') {\n\t\t\t\t $str = substr($template, 0, -4);\n\t\t\t\t array_unshift($templates, sprintf($str . '-%s.php', $this->type));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Apply filters to templates\n\n\t\t\t$templates = apply_filters('sprout_locate', $templates);\n\t\t\t$templates = apply_filters('sprout_locate_' . $this->type, $templates);\n\n\t\t\t// Return first found template\n\n\t\t\treturn locate_template($templates);\n\t\t\t\n\t\t}", "function template_chooser($template) \n{ \n global $wp_query; \n $post_type = get_query_var('post_type'); \n if( $wp_query->is_search && $post_type == 'formation_post' ) \n {\n return locate_template('recherche-formation.php'); // redirect to recherche-formation.php\n } \n return $template; \n}", "public static function register_templates() {\n if (version_compare(floatval(get_bloginfo('version')), '4.7', '<')) {\n // 4.6 and older\n add_filter('page_attributes_dropdown_pages_args', array(get_called_class(), 'register_project_templates'));\n } else {\n // Add a filter to the wp 4.7 version attributes metabox\n add_filter('theme_page_templates', array(get_called_class(), 'add_new_template'));\n }\n // Add a filter to the save post to inject out template into the page cache\n add_filter('wp_insert_post_data', array(get_called_class(), 'register_project_templates'));\n // Add a filter to the template include to determine if the page has our \n // template assigned and return it's path\n add_filter('template_include', array(get_called_class(), 'view_project_template'));\n }", "function portal_template_hierarchy( $template ) {\n\n $template\t= ( substr( $template, -4, 4 ) == '.php' ? $template : $template . '.php' );\n $base_dir = ( $template == 'archive-portal_projects.php' ? 'projects/' : '' );\n\n if ( $theme_file = locate_template( array( 'yoop/' . $base_dir . $template ) ) ) {\n \t$file = $theme_file;\n } else {\n \t$file = portal_BASE_DIR . '/templates/' . $base_dir . $template;\n }\n\n return apply_filters( 'portal_standard_template_' . $template, $file );\n\n}", "function deals_get_template($template_name, $require_once = true) {\n\tif (file_exists( STYLESHEETPATH . '/' . DEALS_TEMPLATE . $template_name )) load_template( STYLESHEETPATH . '/' . DEALS_TEMPLATE . $template_name, $require_once ); \n\telseif (file_exists( STYLESHEETPATH . '/' . $template_name )) load_template( STYLESHEETPATH . '/' . $template_name , $require_once); \n\telse load_template( DEALS_TEMPLATE_DIR . $template_name , $require_once);\n}", "function get_current_template_name() {\n\tglobal $wp_query;\n \n // Page\n\n if(is_page()) {\n return basename(get_page_template(), \".php\");\n }\n\n // Single post\n\n elseif (is_single()) {\n $post_id = $wp_query->get_queried_object_id();\n\t\t$post = $wp_query->get_queried_object();\n\t\t$post_type = $post->post_type;\n\n if ( isset( $post->post_type ) ) {\n // If a regular/default post then assign the name as single.\n if($post->post_type === 'post') {\n return 'single';\n }\n // Else use the post type name.\n else {\n return 'single-' . sanitize_html_class( $post->post_type );\n }\n }\n }\n\n // Search\n\n elseif ( is_search() ) {\n\t\treturn 'search';\n\t}\n}", "function wp6tools_get_template_part( $slug, $name = '' ) {\n \n $tpl_path = SIXTOOLS_DIR . '/templates/wp6tools_' . $slug . '-' . $name . '.php';\n \n if(file_exists( $tpl_path ))\n load_template( $tpl_path );\n else\n get_template_part($slug);\n}", "function ffd_get_template_part( $slug, $name = '' ) {\r\n\t$template = '';\r\n\r\n\t// Look in yourtheme/slug-name.php and yourtheme/ffd-templates/slug-name.php.\r\n\tif ( $name && ! FFD_TEMPLATE_DEBUG_MODE ) {\r\n\t\t$template = locate_template( array( \"{$slug}-{$name}.php\", FFD()->template_path() . \"{$slug}-{$name}.php\" ) );\r\n\t}\r\n\r\n\t// Get default slug-name.php.\r\n\tif ( ! $template && $name && file_exists( FFD()->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) ) {\r\n\t\t$template = FFD()->plugin_path() . \"/templates/{$slug}-{$name}.php\";\r\n\t}\r\n\r\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/ffd-templates/slug.php.\r\n\tif ( ! $template && ! FFD_TEMPLATE_DEBUG_MODE ) {\r\n\t\t$template = locate_template( array( \"{$slug}.php\", FFD()->template_path() . \"{$slug}.php\" ) );\r\n\t}\r\n\r\n\t// Allow 3rd party plugins to filter template file from their plugin.\r\n\t$template = apply_filters( 'ffd_get_template_part', $template, $slug, $name );\r\n\r\n\tif ( $template ) {\r\n\t\tload_template( $template, false );\r\n\t}\r\n}", "function rc_tc_template_chooser( $template ) {\r\n \r\n // Post ID\r\n $post_id = get_the_ID();\r\n $post_type = get_post_type( $post_id );\r\n echo ('<!-- Have Post Type ' . __( $post_type, 'nmmc' ) . '-->' );\r\n // For all other CPT\r\n if ( $post_type != 'nsbr' && $post_type !='ydd' ) {\r\n echo ('<!-- Unknown Type returning ' . __( $template, 'nmmc' ) . '-->' );\r\n return $template;\r\n }\r\n \r\n // Else use custom template\r\n if ( is_single() ) {\r\n echo ('<!-- Is Single returning ' . __( 'single-'.$post_type, 'nmmc' ) . '-->' );\r\n return rc_tc_get_template_hierarchy( 'single-'.$post_type);\r\n }else{\r\n return rc_tc_get_template_hierarchy( 'category-'.$post_type);\r\n }\r\n echo ('<!-- Returning nothing -->' );\r\n return $template;\r\n}", "function getTemplateFile ()\n\t{\n\t\t//\n\t\t// Allow the template to override a specific file. If this file exist\n\t\t// (the file in the template directory), it will be loaded, otherwise\n\t\t// the default (in the plugin directory) will be loaded\n\t\t//\n\t\t$renderer = 'templates/'.$this->getTemplate ().'/'.$this->getRenderer ();\n\t\tif (!(file_exists ($renderer)))\n\t\t{\n\t\t\t$renderer = 'framework/view/'.$this->getRenderer ();\n\t\t}\n\t\treturn $renderer;\n\t}", "function bethel_custom_template() {\n global $post;\n if (is_page() && isset($post) && is_object($post)) {\n $post->page_template = get_post_meta( $post->ID, '_wp_page_template', true );\n }\n}", "function emscvupload_locate_template( $template_names, $load = false, $require_once = true, $atts=array() ) {\n\tglobal $emscvupload_template_folder;\n\n\t// No file found yet\n\t$located = false;\n\n\t// Try to find a template file\n\tforeach ( (array) $template_names as $template_name ) {\n\n\t\t// Continue if template is empty\n\t\tif ( empty( $template_name ) )\n\t\t\tcontinue;\n\n\t\t// Trim off any slashes from the template name\n\t\t$template_name = ltrim( $template_name, '/' );\n\n\t\t// Check child theme first\n\t\tif ( file_exists( trailingslashit( get_stylesheet_directory() ) . $emscvupload_template_folder . $template_name ) ) {\n\t\t\t$located = trailingslashit( get_stylesheet_directory() ) . $emscvupload_template_folder . $template_name;\n\t\t\tbreak;\n\n\t\t// Check parent theme next\n\t\t} elseif ( file_exists( trailingslashit( get_template_directory() ) . $emscvupload_template_folder . $template_name ) ) {\n\t\t\t$located = trailingslashit( get_template_directory() ) . $emscvupload_template_folder . $template_name;\n\t\t\tbreak;\n\n\t\t// Check theme compatibility last\n\t\t} elseif ( file_exists( trailingslashit( emscvupload_get_templates_dir() ) . $template_name ) ) {\n\t\t\t$located = trailingslashit( emscvupload_get_templates_dir() ) . $template_name;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif ( ( true == $load ) && ! empty( $located ) )\n\t\temscvupload_load_template( $located, $require_once, $atts );\n\n\treturn $located;\n}", "function defaultTemplate() {\n\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n\t\t$this->api->pathfinder->addLocation($addon_location,array(\n\t\t\t//'js'=>'templates/js',\n\t\t\t//'css'=>'templates/css',\n //'template'=>'templates',\n\t\t))->setParent($l);\n\n //return array('view/lister/tags');\n return parent::defaultTemplate();\n }", "function resolve_block_template($template_type, $template_hierarchy, $fallback_template)\n {\n }", "protected function getTemplate($name)\n {\n $format = '%s/%s.tpl';\n\n if (file_exists($template = sprintf($format, WORKSPACE . '/template', $name))) {\n return $template;\n } elseif (file_exists($template = sprintf($format, TEMPLATE, $name))) {\n return $template;\n } else {\n return false;\n }\n }", "function st_get_template($file,$data = array()){\r $file = ST_DIR.'/templates/'.$file;\r if(file_exists($file)){\r include($file); return true;\r }\r return false;\r}", "function get_custom_post_type_template($single_template) {\n global $post;\n\n if ($post->post_type == 'employee_news') {\n $single_template = get_template_directory() . '/single-templates/employee_news.php';\n }\n return $single_template;\n}", "public function get_default_template() {\n\t\t\t$file = file_get_contents( dirname( __FILE__ ).'/assets/template.html' );\n\t\t\treturn $file;\n\t\t}", "function LoadTemplate( $name )\n{\n if ( file_exists(\"$name.html\") ) return file_get_contents(\"$name.html\");\n if ( file_exists(\"templates/$name.html\") ) return file_get_contents(\"templates/$name.html\");\n if ( file_exists(\"../templates/$name.html\") ) return file_get_contents(\"../templates/$name.html\");\n}", "public function override_template( $located, $template_name, $args, $template_path, $default_path ) {\n\t\tif ( strpos( $located, 'checkout/form-checkout.php' ) !== false ) {\n\t\t\t$located = wc_locate_template(\n\t\t\t\t'checkout/swedbank-pay/form-checkout.php',\n\t\t\t\t$template_path,\n\t\t\t\tdirname( __FILE__ ) . '/../templates/'\n\t\t\t);\n\t\t}\n\n\t\treturn $located;\n\t}", "public function findTemplate($template) {\n if (isset($this->_cache[$template])) {\n return $this->_cache[$template];\n }\n\n $templatePath = '';\n\n try {\n $templatePath = $this->_finder->find($template, 'views');\n } catch (InvalidArgumentException $e) {\n // might be already a resolved path\n if (file_exists($template)) {\n $templatePath = $template;\n } else {\n throw $e;\n }\n } catch (ResourceNotFoundException $e) {\n try {\n $templatePath = parent::findTemplate($template);\n } catch(\\Twig_Error_Loader $twigError) {\n throw new ResourceNotFoundException('Could not find template \"'. $template .'\". (Twig: '. $twigError->getMessage() .')', 404, $e);\n }\n }\n\n $this->_cache[$template] = $templatePath;\n return $templatePath;\n }", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "protected function getTemplateScript(){\n \tif($this->_renderLayout == 1) {\n \t\treturn '/sitetemplate/_frontend.phtml';\n \t}elseif($this->_renderLayout == 2) {\n \t\treturn '/sitetemplate/_simple.phtml';\n \t}else {\n \t\treturn 'default';\n \t}\n }", "function deals_get_template_part( $slug, $name = '' ) {\n\tif ($name == 'deals') :\n\t\tif (!locate_template(array( $slug.'-'.$name.'.php', DEALS_TEMPLATE.$slug.'-'.$name.'.php' ))) :\n\t\t\tload_template( DEALS_TEMPLATE_DIR . $slug.'-'.$name.'.php',false );\n\t\t\treturn;\n\t\tendif;\n endif; \n get_template_part(DEALS_TEMPLATE. $slug, $name );\n}", "public function templateExists(string $template_name);", "function ydgdict_search_template( $template ) \n{\n if ( is_tax( 'word_type' ) )\n {\n return locate_template( \"taxonomy-word_type\" );\n }\n else if ( is_post_type_archive ( 'entry' ) ) \n {\n return locate_template( \"archive-entry\" );\n }\n\n return $template;\n}", "private function _load_template()\n\t\t{\n\t\t\t//check for a custom template\n\t\t\t$template_file = 'views/'.$this->template_file.'.tpl';\n\n\n\t\t\tif(file_exists($template_file) && is_readable($template_file))\n\t\t\t{\n\t\t\t\t$path = $template_file;\n\t\t\t}\n\t\t\telse if(file_exists($default_file = 'views/error/index.php') && is_readable($default_file))\n\t\t\t{\n\t\t\t\t$path = $default_file;\n\t\t\t}\n\n\t\t\t//If the default template is missing, throw an error\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"No default template found\");\n\t\t\t}\n\n\n\t\t\t//Load the contents of the file and return them\n\t\t\t$this->_template = file_get_contents($path);\n\n\t\t}", "function edd_pup_template(){\r\n\r\n\t$template = edd_get_option( 'edd_pup_template' );\r\n\r\n\tif ( ! isset( $template ) ) {\r\n\t\t$template = 'default';\r\n\t}\r\n\r\n\tif ( $template == 'inherit' ) {\r\n\t\treturn edd_get_option( 'email_template' );\r\n\t} else {\r\n\t\treturn $template;\r\n\t}\r\n}", "public function template_include() {\n\n\t\treturn locate_template( array( 'page.php', 'single.php', 'index.php' ) );\n\t}", "public function page( $template )\n {\n // Get the current post ID\n $post_id = get_the_ID();\n\n // Get the current post slug\n $slug = get_page_uri($post_id);\n\n // Check pages directory for page\n if( $found = locate_template('templates/page/' . $slug . '.php') )\n {\n return $found;\n }\n\n // Check for generic page template\n if( $found = locate_template('templates/page.php') )\n {\n return $found;\n }\n\n // Use wp default location\n return $template;\n\n }", "function load_templates( $template ) {\n\n if ( is_singular( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'single-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/single-units.php';\n\t\t\t }\n } elseif ( is_archive( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'archive-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/archive-units.php';\n\t\t\t }\n }\n load_template( $template );\n\t}", "function archive_template( $template ) {\n if ( is_post_type_archive('ccms-version') ) {\n $theme_files = array('archive-ccms-version.php');\n $exists_in_theme = locate_template($theme_files, false);\n if ( $exists_in_theme != '' ) {\n return $exists_in_theme;\n } else {\n return plugin_dir_path(__FILE__) . 'archive-ccms-version.php';\n }\n }\n return $template;\n }", "function carton_get_template_part( $slug, $name = '' ) {\n\tglobal $carton;\n\t$template = '';\n\n\t// Look in yourtheme/slug-name.php and yourtheme/carton/slug-name.php\n\tif ( $name )\n\t\t$template = locate_template( array ( \"{$slug}-{$name}.php\", \"{$carton->template_url}{$slug}-{$name}.php\" ) );\n\n\t// Get default slug-name.php\n\tif ( !$template && $name && file_exists( $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\" ) )\n\t\t$template = $carton->plugin_path() . \"/templates/{$slug}-{$name}.php\";\n\n\t// If template file doesn't exist, look in yourtheme/slug.php and yourtheme/carton/slug.php\n\tif ( !$template )\n\t\t$template = locate_template( array ( \"{$slug}.php\", \"{$carton->template_url}{$slug}.php\" ) );\n\n\tif ( $template )\n\t\tload_template( $template, false );\n}", "public function locate( $template, $type, $templates )\n {\n // Set template path\n $this->path = $template;\n\n // Set template type\n $this->type = $type;\n\n // Get the current post ID\n $post_id = get_the_ID();\n\n // Get the current post type\n $post_type = get_post_type($post_id);\n\n // Get the current post slug\n $post_slug = get_page_uri($post_id);\n\n\n switch($type)\n {\n case 'page':\n\n // Search for page slug template\n if( $found = $this->find('page/'.$post_slug) ) break;\n\n // Search for page template\n $found = $this->find('page');\n\n break;\n\n case 'frontpage':\n\n // Search for front template\n $found = $this->find('front');\n\n break;\n\n default:\n // Search for template by type\n $found = $this->find($type);\n break;\n }\n\n // Check if we found a template file\n if( ! empty($found) )\n {\n // Update template path\n $this->path = $found;\n\n return $found;\n }\n\n\n return $template;\n }" ]
[ "0.7524237", "0.6998959", "0.69469935", "0.6796758", "0.6778033", "0.6681815", "0.6668551", "0.6659393", "0.6644254", "0.65430677", "0.65393734", "0.65352833", "0.65066487", "0.64853287", "0.6476905", "0.6471629", "0.6467829", "0.6466507", "0.64636856", "0.64028096", "0.6396401", "0.63614786", "0.6353082", "0.6344277", "0.6323723", "0.6311309", "0.6307057", "0.6295768", "0.62907785", "0.62844753", "0.624849", "0.6244497", "0.6244497", "0.6240775", "0.6227203", "0.6217357", "0.621005", "0.62023425", "0.620012", "0.6181161", "0.6171179", "0.61443377", "0.61439633", "0.61423177", "0.6140336", "0.6140134", "0.6138092", "0.61339426", "0.61308396", "0.6126062", "0.6114347", "0.6112548", "0.6111453", "0.6103488", "0.60978454", "0.60798675", "0.60779184", "0.6074545", "0.60717946", "0.60405815", "0.60385764", "0.60366255", "0.6020257", "0.6017331", "0.6015061", "0.6008498", "0.60077584", "0.6004162", "0.59985274", "0.59844816", "0.596265", "0.5951194", "0.5950616", "0.5945384", "0.59421533", "0.5938907", "0.5937422", "0.59328634", "0.59148103", "0.5913321", "0.5904785", "0.5902703", "0.5897655", "0.5893996", "0.58883375", "0.5880836", "0.58775425", "0.5875035", "0.5869581", "0.58369815", "0.58328974", "0.58321816", "0.58294666", "0.5815788", "0.58116996", "0.5805259", "0.5797573", "0.57909495", "0.5788747", "0.5787118" ]
0.5823947
93
Load from the database.
public function find_by_id($id, $limit=null, $offset=0){ $query = $this->db->get_where($this::$table_name, array( $this::$table_pk => $id),$limit, $offset); return $query->row(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadFromDB()\n {\n }", "public function load()\n {\n $pdo = $this->getDbConnection();\n $query = \"SELECT * FROM {$this->dbTable}\";\n $data = $pdo->query($query)->fetchAll(\\PDO::FETCH_ASSOC);\n\n foreach ($data as ['key' => $key, 'value' => $value]) {\n $this->setData($key, $value);\n }\n }", "abstract protected function load(Connection $db);", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbmov.json\");\n $this->_db = json_decode($json_string, true);\n }", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "public function load()\n\t{\n\t\t$this->list_table->load();\n\t}", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "private function _load_db()\n {\n $json_string = file_get_contents(\"dbtv.json\");\n $this->_db = json_decode($json_string, true);\n $this->_ep_list = $this->_flatten_episodes();\n }", "protected function load()\n\t{\n\t\t//---------------------\n\t\t// Your code goes here\n\t\t// --------------------\n\t\t// rebuild the keys table\n\t\t$this->reindex();\n\t}", "public function load()\n {\n $data = $this->storage->load();\n $this->collection->load($data);\n\n $this->refresh();\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "protected function importDatabaseData() {}", "public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "private function Load()\n\t{\n\t\t$sql = \"show tables\";\n\t\t$rs = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// first pass load all the tables. this will initialize each object. we have to\n\t\t// do this first so that we can correctly determine and store \"Set\" information\n\t\twhile ($row = $this->Server->Connection->Next($rs))\n\t\t{\n\t\t\t$this->Tables[$row[\"Tables_in_\" . $this->Name]] = new DBTable($this,$row);\n\t\t}\n\t\t\n\t\t// now load all the keys and constraints for each table\n\t\tforeach ($this->Tables as $table)\n\t\t{\n\t\t\t$table->LoadKeys();\n\t\t}\n\n\t\t$this->Server->Connection->Release($rs);\n\t\t\n\t\t$sql = \"show table status from `\" . $this->Name . \"`\";\n\t\t$rs2 = $this->Server->Connection->Select($sql);\n\t\t\n\t\t// load the extra data\n\t\twhile ($row = $this->Server->Connection->Next($rs2))\n\t\t{\n\t\t\t$this->Tables[$row[\"Name\"]]->Engine = $row[\"Engine\"]; \n\t\t\t$this->Tables[$row[\"Name\"]]->Comment = $row[\"Comment\"];\n\t\t}\n\t\t$this->Server->Connection->Release($rs2);\n\t}", "public function load() { }", "protected function loadRow() {}", "public function load() : Persistable;", "abstract public function load();", "abstract public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "abstract public function loadData();", "public abstract function load();", "public function load()\n {\n return $this->loadData();\n }", "public function load()\n {\n if (count($this->table)) {\n $this->value = array_pop($this->table);\n }\n }", "public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }", "public static function load_from_db() {\n // Sanitize $view;\n $view = isset($_GET['view']) ? (integer) $_GET['view'] : 0;\n $view = $view ? $view : false;\n System::$instances = db_get($view);\n }", "function load_from_database () : bool {\n $db = $this->getDatabase();\n\n $id = $db->escape($this->id);\n $sql = \"SELECT * FROM content_files WHERE content_id = '\" . $id . \"'\";\n if ( !($result = $db->query($sql)) ) {\n message_die(SQL_ERROR, \"Unable to query content\", '', __LINE__, __FILE__, $sql);\n }\n if (!$row = $db->fetchRow($result)) {\n $this->lastError = \"Content unknown: \" . $this->id;\n return false;\n }\n $this->load_from_row($row);\n return true;\n }", "public function load($data);", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "protected function load()\n {\n if($this->id == 0){\n return;\n }\n\n # Load the core application data using the parent class\n if(!parent::load()){\n return false;\n }\n\n # Load the application-specific data\n $db = new PHPWS_DB('hms_summer_application');\n\n if(PHPWS_Error::logIfError($db->loadObject($this))){\n $this->id = 0;\n return false;\n }\n\n return true;\n }", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function loadById($id);", "public function loadById($id);", "private function load() {\r\n\t\t$sql_statement = 'SELECT no.contract_id, no.termination_date FROM '. TBL_NOTICE .' AS no WHERE no.notice_id = '. (int) $this->notice_id;\r\n\t\t$query = db_query($sql_statement);\r\n\r\n\t\tif(db_num_results($query) == 1) {\r\n\t\t\t$data = db_fetch_array($query);\r\n\t\t\t\t\r\n\t\t\t$this->contract_id = $data['contract_id'];\r\n\t\t\t$this->termination_date = $data['termination_date'];\r\n\t\t}\r\n\t}", "public function loadDataFromId(){\r\n\t\t\t$this -> loadFromId();\r\n\t }", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "protected function load_database()\n\t{\n\t\t$this->db= load_class(\"DB\", 'database');\n\t}", "function loadFromDatabase() {\n\t # Paranoia\n\t $this->mId = intval( $this->mId );\n\t $this->mCedarId = intval( $this->mCedarId );\n\n\t /** Anonymous user */\n\t if( !$this->mId ) {\n\t\tif( !$this->mCedarId ) {\n\t\t if( $this->mName == '' ) {\n\t\t\t$this->loadDefaults();\n\t\t\treturn false;\n\t\t }\n\t\t}\n\t }\n\n\t $dbr =& wfGetDB( DB_MASTER );\n\t if( $this->mId ) {\n\t\t$s = $dbr->selectRow( 'cedar_user_info', '*', array( 'user_id' => $this->mId ), __METHOD__ );\n\t }\n\t else if( $this->mCedarId ) {\n\t\t$s = $dbr->selectRow( 'cedar_user_info', '*', array( 'user_info_id' => $this->mCedarId ), __METHOD__ );\n\t }\n\t else if( $this->mName != '' ) {\n\t\t$s = $dbr->selectRow( 'cedar_user_info', '*', array( 'user_name' => $this->mName ), __METHOD__ );\n\t }\n\n\t if ( $s !== false ) {\n\t\t # Initialise user table data\n\t\t $this->mCedarId = $s->user_info_id ;\n\t\t $this->mOrg = $s->organization ;\n\t\t $this->mAddress1 = $s->address1 ;\n\t\t $this->mAddress2 = $s->address2 ;\n\t\t $this->mCity = $s->city ;\n\t\t $this->mState = $s->state ;\n\t\t $this->mCountry = $s->country ;\n\t\t $this->mPostalCode = $s->postal_code ;\n\t\t $this->mPhone = $s->phone ;\n\t\t $this->mMobilePhone = $s->mobile_phone ;\n\t\t $this->mFax = $s->fax ;\n\t\t $this->mSupervisorName = $s->supervisor_name ;\n\t\t $this->mSupervisorEmail = $s->supervisor_email ;\n\t\t $this->mRegistrationDate = $s->registration_date ;\n\t\t return true;\n\t } else {\n\t\t # Invalid user_id\n\t\t $this->mId = 0;\n\t\t $this->loadDefaults();\n\t\t return false;\n\t }\n }", "protected function loadFromDatabase()\n\t{\n\t\t/** @global \\CUserTypeManager $USER_FIELD_MANAGER */\n\t\tglobal $USER_FIELD_MANAGER;\n\n\t\tif (!isset($this->fields) && $this->iblockId > 0)\n\t\t{\n\t\t\t$userFields = $USER_FIELD_MANAGER->getUserFields(\n\t\t\t\t\"IBLOCK_\".$this->iblockId.\"_SECTION\",\n\t\t\t\t$this->id\n\t\t\t);\n\t\t\tforeach ($userFields as $id => $uf)\n\t\t\t{\n\t\t\t\t$this->addField(substr($id, 3), $id, $uf[\"VALUE\"]);\n\t\t\t}\n\t\t}\n\t\treturn is_array($this->fields);\n\t}", "public function loadDatabase(){\n $table = new Table('Textarea_Widgets');\n $table->add_column('Title', 'text');\n $table->add_column('Content', 'text');\n $table->add_column('WidgetName', 'text');\n $table->create();\n }", "public function load()\n\t{\n\t\tif (!$infile = $this->arguments->getOpt(3))\n\t\t{\n\t\t\t$this->output->error('Please provide an input file');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!is_file($infile))\n\t\t\t{\n\t\t\t\t$this->output->error(\"'{$infile}' does not appear to be a valid file\");\n\t\t\t}\n\t\t}\n\n\t\t// First, set some things aside that we need to reapply after the update\n\t\t$params = [];\n\t\t$params['com_system'] = \\Component::params('com_system');\n\t\t$params['com_tools'] = \\Component::params('com_tools');\n\t\t$params['com_usage'] = \\Component::params('com_usage');\n\t\t$params['com_users'] = \\Component::params('com_users');\n\t\t$params['plg_projects_databases'] = \\Plugin::params('projects', 'databases');\n\n\t\t$tables = App::get('db')->getTableList();\n\n\t\t// See if we should drop all tables first\n\t\tif ($this->arguments->getOpt('drop-all-tables'))\n\t\t{\n\t\t\t$this->output->addLine('Dropping all tables...');\n\t\t\tforeach ($tables as $table)\n\t\t\t{\n\t\t\t\tApp::get('db')->dropTable($table);\n\t\t\t}\n\t\t}\n\n\t\t// Craft the command to be executed\n\t\t$infile = escapeshellarg($infile);\n\t\t$cmd = \"mysql -u \" . Config::get('user') . \" -p'\" . Config::get('password') . \"' -D \" . Config::get('db') . \" < {$infile}\";\n\n\t\t$this->output->addLine('Loading data from ' . $infile . '...');\n\n\t\t// Now push the big red button\n\t\texec($cmd);\n\n\t\t$migration = new Migration(App::get('db'));\n\n\t\t// Now load some things back up\n\t\tforeach ($params as $k => $v)\n\t\t{\n\t\t\tif (!empty($v))\n\t\t\t{\n\t\t\t\t$migration->saveParams($k, $v);\n\t\t\t}\n\t\t}\n\n\t\t$this->output->addLine('Load complete!', 'success');\n\t}", "public function load($id){\n\n /*\n * select from the database\n */\n $query = $this->db->get_where($this::DB_TABLE, array($this::DB_TABLE_PK => $id));\n\n /**\n * Populate to an object\n */\n if(!empty($query->row())){\n $this->populate($query->row());\n return true;\n } else {\n return false;\n }\n }", "abstract function loadDbData($compid);", "public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }", "public function load()\n {\n $raw = $this->_getBackend()->load($this->_id);\n return unserialize($raw);\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }", "public static function load(int $id);" ]
[ "0.7872855", "0.7772401", "0.7587108", "0.75665337", "0.7366457", "0.7264917", "0.7229564", "0.7217015", "0.7176778", "0.7109859", "0.7058646", "0.69265807", "0.6909785", "0.68407786", "0.6814382", "0.6749799", "0.6676008", "0.6675192", "0.6674759", "0.6674759", "0.6674759", "0.6667265", "0.666287", "0.6631149", "0.6620073", "0.66102093", "0.66102093", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.6591528", "0.65878445", "0.6584568", "0.65436935", "0.6500518", "0.64861155", "0.64666003", "0.64472437", "0.6424937", "0.64039755", "0.64039755", "0.64039755", "0.64039755", "0.64024264", "0.6361608", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63488424", "0.63357484", "0.6331922", "0.6331922", "0.6329924", "0.63278866", "0.6258818", "0.6250067", "0.6236066", "0.6233945", "0.6221578", "0.6219984", "0.6211508", "0.6209897", "0.6202606", "0.6198144", "0.6198101", "0.6198101", "0.6160733", "0.61209536" ]
0.0
-1
finds names of table columns
private function table_columns(){ $column = array(); $query = $this->db->select('column_name') ->from('information_schema.columns') ->where('table_name', $this::$table_name) ->get($this::$table_name)->result_array(); //return individual table column foreach($query as $column_array){ foreach($column_array as $column_name){ $column[] = $column_name; } } return $column; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getColNames();", "public function getColumnNames();", "function getColumns($table){\n $sql = 'SHOW COLUMNS FROM ' . $table;\n $names = array();\n $db = $this->prepare($sql);\n\n try {\n if($db->execute()){\n $raw_column_data = $db->fetchAll();\n\n foreach($raw_column_data as $outer_key => $array){\n foreach($array as $inner_key => $value){\n\n if ($inner_key === 'Field'){\n if (!(int)$inner_key){\n $names[] = $value;\n }\n }\n }\n }\n }\n return $names;\n } catch (Exception $e){\n return $e->getMessage(); //return exception\n }\n }", "public function getColumnNames()\n {\n return array_keys($this->columns);\n }", "public function get_column_names()\r\n {\r\n if (array_get(static::$tables, $this->from)) {\r\n return static::$tables[$this->from]['columns'];\r\n }\r\n\r\n $database = $this->db->get_connection()->get_database();\r\n\r\n $table = $this->from;\r\n\r\n $query = new Query();\r\n return $query->from('INFORMATION_SCHEMA.COLUMNS')\r\n ->where(array(\r\n 'table_schema' => $database,\r\n 'table_name' => $table\r\n ))\r\n ->pluck('column_name');\r\n }", "public abstract function get_columns($table);", "public function getAllColumnsNames()\n {\n switch (DB::connection()->getConfig('driver')) {\n case 'pgsql':\n $query = \"SELECT column_name FROM information_schema.columns WHERE table_name = '\".$this->table.\"'\";\n $column_name = 'column_name';\n $reverse = true;\n break;\n\n case 'mysql':\n $query = 'SHOW COLUMNS FROM '.$this->table;\n $column_name = 'Field';\n $reverse = false;\n break;\n\n case 'sqlsrv':\n $parts = explode('.', $this->table);\n $num = (count($parts) - 1);\n $table = $parts[$num];\n $query = \"SELECT column_name FROM \".DB::connection()->getConfig('database').\".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'\".$table.\"'\";\n $column_name = 'column_name';\n $reverse = false;\n break;\n\n default: \n $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');\n throw new Exception($error);\n break;\n }\n\n $columns = array();\n\n foreach(DB::select($query) as $column)\n {\n $columns[] = $column->$column_name;\n }\n\n if($reverse)\n {\n $columns = array_reverse($columns);\n }\n\n return $columns;\n }", "public function getTableColumns()\n\t{\n\t}", "function listColumns($tablename);", "public function columns($table_name);", "public function getColnames()\n {\n $res = [];\n foreach($this->columns as $colname => $col) $res[] = $colname;\n return $res;\n }", "function lookup_columns()\n {\n // Avoid doing multiple SHOW COLUMNS if we can help it\n $key = C_Photocrati_Transient_Manager::create_key('col_in_' . $this->get_table_name(), 'columns');\n $this->_table_columns = C_Photocrati_Transient_Manager::fetch($key, FALSE);\n if (!$this->_table_columns) {\n $this->object->update_columns_cache();\n }\n return $this->_table_columns;\n }", "public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}", "public function get_columns($table){\n return $this->query(\"SHOW COLUMNS FROM {$table}\")->results();\n }", "public function getAllColumnsNames()\n {\n switch (DB::connection()->getConfig('driver')) {\n case 'pgsql':\n $query = \"SELECT column_name FROM information_schema.columns WHERE table_name = '\".$this->getTable().\"'\";\n $column_name = 'column_name';\n $reverse = true;\n break;\n\n case 'mysql':\n $query = 'SHOW COLUMNS FROM '.$this->getTable();\n $column_name = 'Field';\n $reverse = false;\n break;\n\n case 'sqlsrv':\n $parts = explode('.', $this->getTable());\n $num = (count($parts) - 1);\n $table = $parts[$num];\n $query = \"SELECT column_name FROM \".DB::connection()->getConfig('database').\".INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'\".$table.\"'\";\n $column_name = 'column_name';\n $reverse = false;\n break;\n\n default:\n $error = 'Database driver not supported: '.DB::connection()->getConfig('driver');\n throw new \\Exception($error);\n break;\n }\n\n $columns = array();\n\n foreach(DB::select($query) as $column)\n {\n array_push($columns, $column->$column_name);\n }\n\n if($reverse)\n {\n $columns = array_reverse($columns);\n }\n\n return $columns;\n }", "protected function getColumns() {\n $driver = $this->connection->getAttribute(\\PDO::ATTR_DRIVER_NAME);\n\n // Calculate the driver class. Why don't they do this for us?\n $class = '\\\\Aura\\\\SqlSchema\\\\' . ucfirst($driver) . 'Schema';\n $schema = new $class($this->connection, new ColumnFactory());\n return array_keys($schema->fetchTableCols($this->table));\n }", "public function getColumnNames(): array\r\n {\r\n return array_keys($this->columns);\r\n }", "public function getColumnNames()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\treturn implode(\",\", $nameColumns);//Retornando uma lista de colunas separadas por vígula\r\n\t\t}", "abstract public function tableColumns();", "public function getColumnsFromTable()\n {\n return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);\n }", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "protected function get_table_columns($table) {\n\n\t\t$conn_str = 'pgsql:host='.$this->_database['host'];\n\t\t$conn_str.= ';dbname='.$this->_database['database'];\n\t\t$conn = new \\PDO($conn_str, $this->_database['username'], $this->_database['password']);\n\t\t$conn->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n\t\t$sql = \t\"SELECT column_name \n \t\t\t\tFROM information_schema.columns \n\t\t\t\t\tWHERE table_name = :table;\";\n\n $stmt = $conn->prepare($sql);\n $stmt->execute(array('table' => $table));\n\n $struttura = array();\n\n while($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n\t $struttura[] = $row['column_name'];\n\t }\n\n\t return $struttura;\n\t}", "public function getTableColumns() { return $this->table->getColumns(); }", "public function getColumns()\n\t{\n\t\t\n $result = $this->fetchingData(array(\n 'query' => \"SHOW FULL COLUMNS FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "public static function getColumnNames()\n {\n $class = new static([ ]);\n $result = database()->run('DESCRIBE ' . $class->table);\n\n $columns = [ ];\n foreach ($result->fetchAll(PDO::FETCH_COLUMN) as $column):\n if (in_array($column, $class->hidden)) continue;\n\n $columns[] = $column;\n endforeach;\n\n foreach ($class->functionsToShow as $function)\n $columns[] = $function;\n \n unset($class);\n return $columns;\n }", "function columns($table)\n{\n\treturn $this->drv->columns($table);\n}", "public function getTableColumns()\n {\n $tableColumns = $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n return $tableColumns;\n }", "public function getTableColumns() {\n return $this->getConnection()->getSchemaBuilder()->getColumnListing($this->getTable());\n }", "function getColumns($table) {\n return mysql_query(sprintf('SHOW COLUMNS FROM %s', $table), $this->db);\n }", "function sql_getTableColumnNames($tablename)\n {\n global $SQL_DBH;\n if (!$SQL_DBH) return array();\n\n $drivername = $SQL_DBH->getAttribute(PDO::ATTR_DRIVER_NAME);\n if ($drivername == 'sqlite')\n {\n $sql = sprintf('PRAGMA TABLE_INFO(`%s`)', $tablename);\n $target = 'name';\n }\n else\n {\n // mysql\n $sql = sprintf('SHOW COLUMNS FROM `%s` ', $tablename);\n $target = 'Field';\n }\n\n $items = array();\n $res = array();\n $stmt = $SQL_DBH->prepare($sql);\n if ( $stmt && $stmt->execute() )\n $res = $stmt->fetchAll();\n\n foreach($res as $row)\n if (isset($row[$target]))\n $items[] = $row[$target];\n if (count($items)>0)\n {\n sort($items);\n }\n return $items;\n }", "function get_columns_name($name_table){\n \t$sql=\" SHOW FULL COLUMNS FROM \" . $name_table . \";\";\n\t $query = $this->db->query($sql);\n\t $result = $query->num_rows() >= 1 ? $query->result() : false;\n\t return $result;\n }", "public function getColumns($table){\n\n\t\t$query = $this->db->prepare(\"DESCRIBE $table\");\n\t\t$query->execute();\n\n\t\t//Returns associative array of column names.\t\n\t\treturn $query->fetchAll(PDO::FETCH_COLUMN);\n\t}", "function getTableFields($table_name)\n\t{\n\t\t$query = \"SHOW COLUMNS FROM $table_name\";\n\t\t$rs = $this->db->query($query);\n\t\treturn $rs->result_array();\n\t}", "function getTableFields($table_name)\n\t{\n\t\t$query = \"SHOW COLUMNS FROM $table_name\";\n\t\t$rs = $this->db->query($query);\n\t\treturn $rs->result_array();\n\t}", "function get_movie_table_columns()\n{\n\t$db = open_database_connection();\n\t$stmt = $db->prepare(\"DESCRIBE movie\");\n\t$stmt->execute();\n\t$columns = $stmt->fetchAll(PDO::FETCH_COLUMN);\n close_database_connection($db);\n return $columns;\n}", "public static function getColumns($table){\n\t\t// get all the column into the table\n\t\t$query = DB::select('column_name')->from('information_schema.columns')->where_open()\n\t\t->where('table_schema', 'fuel_dev')\n\t\t->and_where('table_name', $table)\n\t\t->where_close()\n\t\t->execute()->as_array();\n\n\t\tforeach($query as $k=>$v)\n\t\t\t$columns[$k] = $v['column_name'];\n\t\treturn $columns;\n\t}", "public function getTableColumns(){\n\n $show_columns_statement = $this->grammer->compileShowColumns($this);\n return $this->connection->getTableColumns($show_columns_statement);\n\n }", "function show_columns ($table_name) {\n\tglobal $cxn;\n\t$columns_arr = NULL;\n\t\n\t$errArr=init_errArr(__FUNCTION__);\n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \"SHOW COLUMNS FROM \" . $cxn->real_escape_string($table_name) ;\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->execute();\n\t\t/* Bind results to variables */\n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$columns_arr[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception $err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error showing columns from table: \" . $table_name;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $columns_arr);\n}", "public function list_columns($table)\n\t{\n\t\t$columns = array();\n\t\tif ($this->db_type == 'mysql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"DESCRIBE `$table`\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->Field;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'pgsql')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"select column_name from information_schema.columns where table_name = '{$table}' and table_catalog=current_database();\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->column_name;\n\t\t\t}\n\t\t}\n\t\tif ($this->db_type == 'sqlite')\n\t\t{\n\t\t\t$table_desc = $this->execute(\"PRAGMA table_info('$table')\");\n\t\t\tforeach ($table_desc as $column)\n\t\t\t{\n\t\t\t\t$columns[] = $column->name;\n\t\t\t}\n\t\t}\n\t\treturn $columns;\n\t}", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'id' \t\t => '%d',\n\t\t\t'name' \t\t => '%s',\n\t\t\t'date_created' \t=> '%s',\n\t\t\t'date_modified' => '%s',\n\t\t\t'status'\t\t=> '%s',\n\t\t\t'ical_hash'\t\t=> '%s'\n\t\t);\n\n\t}", "public static function getColumnTitles()\n {\n return array_keys(self::$columns);\n }", "public function getColumns() {\n\t\treturn( $this->getTable()->getColumns() );\n\t}", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function get_columns()\n {\n }", "public function table_columns($table)\n\t{\n\t\tif ($table instanceof Database_Identifier)\n\t\t{\n\t\t\t$schema = $table->namespace;\n\t\t\t$table = $table->name;\n\t\t}\n\t\telseif (is_array($table))\n\t\t{\n\t\t\t$schema = $table;\n\t\t\t$table = array_pop($schema);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$schema = explode('.', $table);\n\t\t\t$table = array_pop($schema);\n\t\t}\n\n\t\tif (empty($schema))\n\t\t{\n\t\t\t$schema = $this->_config['connection']['database'];\n\t\t}\n\n\t\t$result =\n\t\t\t'SELECT column_name, ordinal_position, column_default, is_nullable, data_type, character_maximum_length, numeric_precision, numeric_scale, collation_name,'\n\t\t\t.' column_type, column_key, extra, privileges, column_comment'\n\t\t\t.' FROM information_schema.columns'\n\t\t\t.' WHERE table_schema = '.$this->quote_literal($schema).' AND table_name = '.$this->quote_literal($this->table_prefix().$table);\n\n\t\t$result = $this->execute_query($result)->as_array('column_name');\n\n\t\tforeach ($result as & $column)\n\t\t{\n\t\t\tif ($column['data_type'] === 'enum' OR $column['data_type'] === 'set')\n\t\t\t{\n\t\t\t\t$open = strpos($column['column_type'], '(');\n\t\t\t\t$close = strpos($column['column_type'], ')', $open);\n\n\t\t\t\t// Text between parentheses without single quotes\n\t\t\t\t$column['options'] = explode(\"','\", substr($column['column_type'], $open + 2, $close - 3 - $open));\n\t\t\t}\n\t\t\telseif (strlen($column['column_type']) > 8)\n\t\t\t{\n\t\t\t\t// Test for UNSIGNED or UNSIGNED ZEROFILL\n\t\t\t\tif (substr_compare($column['column_type'], 'unsigned', -8) === 0\n\t\t\t\t\tOR substr_compare($column['column_type'], 'unsigned', -17, 8) === 0)\n\t\t\t\t{\n\t\t\t\t\t$column['data_type'] .= ' unsigned';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public static function getColumns()\n {\n return array('libraryId', 'signature', 'summary', 'status', 'userId');\n }", "static function columns($instancia = null) {\n if ($instancia) {\n return fields_of($instancia->_tablename());\n } else {\n return fields_of(self::getInstance()->_tablename());\n }\n }", "public function getColumnNames() {\n $columns = array();\n\n foreach ($this->columnNames as $columnIndex => $columnName) {\n $columns[$columnName] = $columnName;\n }\n\n return $columns;\n }", "public function getColumnNames($table)\r\n\t\t{\r\n\t\t\t$colNames = array();\r\n\t\t\t$schemaArray = array();\r\n\r\n\t\t\t//let the server prepare, execute and check for errors\r\n\t\t\t$this->_query = $this->_prepare(\"SELECT * FROM `{$this->_prefix}{$table}`\");\r\n\t\t\t$this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\r\n\t\t\t$totalCols = $this->_query->columnCount();\r\n\t\t\tfor($n = 0; $n < $totalCols; $n++){\r\n\t\t\t\t$columnSchema = $this->_query->getColumnMeta($n);\r\n\t\t\t\t$colNames[] = $columnSchema['name'];\r\n\t\t\t}\r\n\t\t\t$this->close(false);\r\n\r\n\t\t\treturn $colNames;\r\n\t\t}", "public abstract function getColumns($table);", "public function fields_names(){\n $table_meta = array();\n // get fields in the database table\n\n foreach ($this->_meta() as $meta) {\n array_push($table_meta, $meta->name);\n }\n\n return $table_meta;\n }", "public function getColumns()\n\t\t{\n\t\t\tstatic $columns = array(\n\t\t\t\t'date_modified', 'date_created', 'cfe_event_id', 'name','short_name'\n\t\t\t);\n\t\t\treturn $columns;\n\t\t}", "function getAllColumns($table){\n\t\t$types=sqlite_fetch_column_types($table,$this->id,SQLITE_ASSOC);\n\t\t$columns=array();\n\t\tforeach($types as $column=>$type){\n\t\t\t$columns[$column]=array(\n\t\t\t\t\"name\"=>$column,\n\t\t\t\t\"key\"=>&$row['Key'],\n\t\t\t\t\"type\"=>&$types[$column],\n\t\t\t\t\"default\"=>&$row['Default'],\n\t\t\t\t\"comment\"=>&$row['Comment']\n\t\t\t\t);\n\t\t}\n\t\treturn $columns;\n\t}", "public function extractColumnNames ($table){\n $functions = get_class_methods($table);\n $columns = array();\n foreach ($functions as $function){\n if (\n strpos($function, \"get\") !== FALSE &&\n strpos($function, \"getEntity\") === FALSE &&\n $function != \"getDbTableName\"\n ){\n $key = strtolower (str_replace (\"get\", \"\", $function));\n array_push($columns, $key);\n }\n }\n \n return $columns;\n }", "private function getTableColumnNames($table)\n {\n global $wpdb;\n try {\n $result_array = $wpdb->get_results(\"SELECT `COLUMN_NAME` \" .\n \" FROM INFORMATION_SCHEMA.COLUMNS\" .\n \" WHERE `TABLE_SCHEMA`='\" . DB_NAME .\n \"' AND TABLE_NAME = '\" . $this->getTableName() . \"'\", ARRAY_A);\n $keys = array();\n foreach ($result_array as $idx => $row) {\n $keys[$idx] = $row['COLUMN_NAME'];\n }\n return $keys;\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n $this->last_error = $exc->getMessage();\n return false;\n }\n }", "private function show_columns() {\n\t\tglobal $wpdb, $utils;\n\t\t$domain = $utils->text_domain;\n\t\t$tables = $wpdb->tables('all');\n\t\tif (!isset($_POST['table'])) {\n\t\t\t$message = __('Table name is not selected.', $domain);\n\t\t\treturn $message;\n\t\t} elseif (!in_array($_POST['table'], $tables)) {\n\t\t\t$message = __('There\\'s no such table.', $domain);\n\t\t\treturn $message;\n\t\t}\telse {\n\t\t\t$table_name = $_POST['table'];\n\t\t\t$results = $wpdb->get_results(\"SHOW COLUMNS FROM $table_name\");\n\t\t\treturn $results;\n\t\t}\n\t}", "public function get_columns($table)\n\t{\n\t\treturn $this->driver_query($this->sql->column_list($this->prefix_table($table)), FALSE);\n\t}", "public function tableColumns($table,$column);", "function getcolumnNames($tableName) {\n\n //Gets column names from the database\n $conn = connect();\n $sql = \"SHOW COLUMNS FROM \" . $tableName;\n $result = $conn->query($sql);\n\n //Outputs data if information was found\n $colArray = array();\n if ($result->num_rows > 0) {\n $i = 0;\n\n //writes names 1 by 1 into the variable $colarray\n while($row = $result->fetch_assoc()) {\n $colArray[$i] = $row['Field'];\n $i++;\n }\n\n $conn->close();\n return $colArray;\n }\n}", "private function getTableColumns() : ?array {\n\t\t$query = 'SELECT column_name, data_type, column_type FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N\\'' . $this->tableNamePrefixed . '\\'';\n\t\t$columns = $this->database->query($query);\n\n\t\t$columnsArr = array();\n\t\tforeach ($columns as $column) {\n\t\t if (property_exists($column, 'COLUMN_NAME')) {\n $columnsArr[$column->COLUMN_NAME] = $column;\n }\n if (property_exists($column, 'column_name')) {\n $column->COLUMN_NAME = $column->column_name;\n $columnsArr[$column->COLUMN_NAME] = $column;\n }\n\t\t}\n\n\t\treturn !empty($columnsArr) ? $columnsArr : null;\n\t}", "public function getColumns ($table) {\n\n\t// get columns\n\t$sql = \"SHOW COLUMNS FROM \".mysql_real_escape_string($table).\";\";\n\t$result = $this->_sendQuery($sql);\n\tif (!$result) return false;\n\n\t// put return in array\n\t$columns = array();\n\twhile ($arr = mysql_fetch_assoc($result)) $columns[] = $arr['Field'];\n\n\treturn $columns;\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'id' => '%d',\n\t\t\t'user_id' => '%d',\n\t\t\t'username' => '%s',\n\t\t\t'name' => '%s',\n\t\t\t'email' => '%s',\n\t\t\t'product_count' => '%d',\n\t\t\t'sales_count'\t => '%d',\n\t\t\t'sales_value'\t => '%f',\n\t\t\t'status'\t\t => '%s',\n\t\t\t'notes' => '%s',\n\t\t\t'date_created' => '%s',\n\t\t);\n\t}", "static function tableColumns(string $table, ?string $schema=null): ?array {\n /*PhpDoc: methods\n name: tableColumns\n title: \"static function tableColumns(string $table, ?string $schema=null): ?array\"\n doc: |\n Retourne la liste des colonnes d'une table structuré comme:\n [ [\n 'ordinal_position'=> ordinal_position,\n 'column_name'=> column_name,\n 'data_type'=> data_type,\n 'character_maximum_length'=> character_maximum_length,\n 'udt_name'=> udt_name,\n 'constraint_name'=> constraint_name,\n ] ]\n Les 5 premiers champs proviennent de la table INFORMATION_SCHEMA.columns et le dernier d'une jointure gauche\n avec INFORMATION_SCHEMA.key_column_usage\n */\n $base = self::$database;\n if (!$schema)\n $schema = self::$schema;\n $sql = \"select c.ordinal_position, c.column_name, c.data_type, c.character_maximum_length, c.udt_name, \n k.constraint_name\n -- select c.*\n from INFORMATION_SCHEMA.columns c\n left join INFORMATION_SCHEMA.key_column_usage k\n on k.table_catalog=c.table_catalog and k.table_schema=c.table_schema\n and k.table_name=c.table_name and k.column_name=c.column_name\n where c.table_catalog='$base' and c.table_schema='$schema' and c.table_name='$table'\";\n $columns = [];\n foreach(PgSql::query($sql) as $tuple) {\n //print_r($tuple);\n $columns[$tuple['column_name']] = $tuple;\n }\n return $columns;\n }", "static public function getTableColumns($table='services') {\n return DB::getSchemaBuilder()->getColumnListing($table);\n }", "function _get_querable_table_columns()\n {\n return array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');\n }", "public function getColumns() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"columns\", []);\n\t}", "abstract protected function getCompositeColumnsNames();", "public function columns($table_name, $dbname = null)\n {\n $dbname = empty($dbname) ? $this->database :$dbname;\n return $this->query(\"SELECT column_name FROM INFORMATION_SCHEMA.columns WHERE table_schema = ? and table_name = ?\", array($dbname, $table_name))->fetchAll(PDO::FETCH_COLUMN);\n }", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "public function getColumns();", "private static function _getColumns()\n\t{\n\t\tstatic $arrColumns;\n\t\tif (!isset($arrColumns))\n\t\t{\n\t\t\t$arrTableDefine = DataAccess::getDataAccess()->FetchTableDefine(self::$_strStaticTableName);\n\t\t\t\n\t\t\tforeach ($arrTableDefine['Column'] as $strName=>$arrColumn)\n\t\t\t{\n\t\t\t\t$arrColumns[self::tidyName($strName)] = $strName;\n\t\t\t}\n\t\t\t$arrColumns[self::tidyName($arrTableDefine['Id'])] = $arrTableDefine['Id'];\n\t\t}\n\t\t\n\t\treturn $arrColumns;\n\t}", "public function getProductColumnNames() {\n\t\t$stmt = $this->pdo->prepare(\"DESCRIBE product\");\n\t\t$stmt->execute();\n\t\t$product_columns = $stmt->fetchAll(PDO::FETCH_COLUMN);\n\n\t\t$results['product_columns'] = $product_columns;\n\n\t\treturn $results; \n\t}", "abstract public function getColsFields();", "abstract protected function _getColumnNames($rs);", "function column_definitions($table) {\r\n\t\treturn $this->query_array(\"DESCRIBE `$table`\");\r\n\r\n\t}", "public function getColumns()\n {\n // code...\n return $this->__COLUMNS__ ?? [];\n }", "function getAllColumns()\n {\n $cols = $this->getTable()->getColumns();\n $rels = $this->getTable()->getRelations();\n $columns = array();\n foreach ($cols as $name => $col)\n {\n // we set out to replace the foreign key to their corresponding aliases\n $found = null;\n foreach ($rels as $alias => $rel)\n {\n $relType = $rel->getType();\n if ($rel->getLocal() == $name && $relType != Doctrine_Relation::MANY_AGGREGATE && $relType != Doctrine_Relation::MANY_COMPOSITE)\n {\n $found = $alias;\n }\n }\n\n if ($found)\n {\n $name = $found;\n }\n\n $columns[] = new sfDoctrineAdminColumn($name, $col);\n }\n\n return $columns;\n }", "public function getColumnDetails( $tablename, $columnname );", "public function getColumns()\n\t{\n\t\tstatic $columns = array(\n\t\t\t'stat_track_id',\n\t\t\t'application_id',\n\t\t\t'stat_name_id',\n\t\t\t'date_created',\n\t\t);\n\t\t\n\t\treturn $columns;\n\t}", "public static function getColumns($table)\n {\n $pdo = ConnMysql::getConn();\n \n $sth = $pdo->prepare(\"SHOW FULL COLUMNS FROM \" . $table);\n $sth->execute();\n /**\n * [x] => Array\n * [Field] => name\n [Type] => varchar | int | etc.\n [Collation] => utf8_general_ci\n [Null] => YES\n [Key] => PRIM ! MUL |\n [Default] => \n [Extra] => \n [Privileges] => select,insert,update,references\n [Comment] => \n */\n $columns = $sth->fetchAll(\\PDO::FETCH_ASSOC);\n foreach($columns as $k=>$field){\n $columns[$k]['Kind'] = $field['Type'];\n $columns[$k]['Size'] = 0;\n $type = $field['Type'];\n $columns[$k]['Key'] = $field['Key'];\n /*\n * Determine string for index Kind that resume Type literaly\n * (varchar, int, datetime)\n * Determine Size field\n */\n $limit = strstr($type, '(');\n if($limit != false){\n $columns[$k]['Kind'] = str_replace($limit, '', $field['Type']);\n $columns[$k]['Size'] = str_replace(['(',')'], '', $limit);\n } elseif ($field['Type'] == 'date' \n || $field['Type'] == 'time' \n || $field['Type'] == 'datetime' \n || $field['Type'] == 'year') {\n $columns[$k]['Kind'] = 'datetime';\n }\n \n }\n return $columns;\n }", "abstract public function listColumns();", "function get_columns_name($table) {\n $columns_name=null;\n $query = \"SHOW COLUMNS FROM $table\";\n $result = Database::getInstance()->getConnection()->query($query);\n if (!$result){\n $_SESSION['message'] = \"<br>Eroare la get_columns_name\".Database::getInstance()->getConnection()->error;\n $_SESSION['status'] = \"danger\";\n $_SESSION['icon'] = \"exclamation-sign\";\n echo status_baloon();\n die(\"mort!!\");\n }\n while ($row = $result->fetch_row()){\n $columns_name[] =$row[0];\n }\n $result->free_result();\n return $columns_name;\n}", "public function getFieldNames( $table );", "public static function getColumns()\n {\n $type = static::getType();\n return $type::getColumns();\n }", "public static function getColumns()\n {\n return array();\n }", "protected function getTableColumns()\n {\n if (!$this->model->getConnection()->isDoctrineAvailable()) {\n throw new \\Exception(\n 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. '\n );\n }\n\n $table = $this->model->getConnection()->getTablePrefix().$this->model->getTable();\n /** @var \\Doctrine\\DBAL\\Schema\\MySqlSchemaManager $schema */\n $schema = $this->model->getConnection()->getDoctrineSchemaManager($table);\n\n // custom mapping the types that doctrine/dbal does not support\n $databasePlatform = $schema->getDatabasePlatform();\n\n foreach ($this->doctrineTypeMapping as $doctrineType => $dbTypes) {\n foreach ($dbTypes as $dbType) {\n $databasePlatform->registerDoctrineTypeMapping($dbType, $doctrineType);\n }\n }\n\n $database = null;\n if (strpos($table, '.')) {\n list($database, $table) = explode('.', $table);\n }\n\n return $schema->listTableColumns($table, $database);\n }", "public function columns()\n\t{\n\t\treturn $this->columns;\n\t}", "public function columns()\n\t{\n\t\treturn $this->columns;\n\t}", "public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}", "public function getColumns()\n\t{\n\t\treturn $this->columns;\n\t}", "function get_columns( ) {\r\n\t\treturn self::mla_manage_columns_filter();\r\n\t}" ]
[ "0.8175776", "0.7956473", "0.7796653", "0.77554727", "0.7710515", "0.7678261", "0.7657542", "0.76451606", "0.7641939", "0.763568", "0.76214606", "0.7616284", "0.76003844", "0.7589586", "0.75733", "0.75619537", "0.7558532", "0.7549586", "0.75292593", "0.7513033", "0.75065845", "0.7480284", "0.7470196", "0.74505293", "0.7444138", "0.7429745", "0.7429711", "0.742861", "0.74168783", "0.7403604", "0.7366047", "0.7355345", "0.73471856", "0.73471856", "0.7324038", "0.7316037", "0.7306249", "0.7289784", "0.7281866", "0.72604394", "0.725123", "0.72408414", "0.7235896", "0.7235896", "0.7235896", "0.7235896", "0.7233438", "0.7233438", "0.7206192", "0.72052586", "0.7200341", "0.7181108", "0.7159315", "0.7147811", "0.71348774", "0.7124493", "0.71078336", "0.71017873", "0.7100648", "0.709197", "0.70840436", "0.7055633", "0.704893", "0.70264626", "0.7024482", "0.70161545", "0.70083004", "0.7008237", "0.700683", "0.6993501", "0.69742495", "0.69684285", "0.69669145", "0.69669145", "0.69669145", "0.69669145", "0.69669145", "0.69669145", "0.69669145", "0.69645566", "0.69614685", "0.69550633", "0.6954915", "0.6952164", "0.69521433", "0.695169", "0.69482386", "0.694534", "0.6931652", "0.69174737", "0.6916008", "0.6884318", "0.6882952", "0.6880196", "0.68757206", "0.6873684", "0.6873684", "0.68692094", "0.68692094", "0.6868133" ]
0.7805967
2
select items from database with indexes
public function find_by_index($indexed_id){ return $this->db->get_where($this::$table_name, array( $this::$table_index => $indexed_id,)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}", "public function getbyindex2($index){\n $condition['index'] = $index;\n $result = $this->where($condition) ->select();\n return $result;\n \n }", "public function setIndexList () {\n // $db_connect_manager -> getTestPool(\"testy_udt\");\n $pool = GeneratorTestsPool::generate(5, 1, 22);\n sort($pool);\n $select = \"SELECT q_podesty_ruchome_przejezdne.question, a_podesty_ruchome_przejezdne.answers, a_podesty_ruchome_przejezdne.`values` \n FROM q_podesty_ruchome_przejezdne INNER JOIN a_podesty_ruchome_przejezdne \n ON q_podesty_ruchome_przejezdne.id = a_podesty_ruchome_przejezdne.id_questions WHERE q_podesty_ruchome_przejezdne.id IN (\".implode(', ', $pool).\")\";\n echo $select;\n\n }", "function getSitesList(){\n $result = db_select('fossee_website_index','n')\n ->fields('n',array('site_code','site_name'))\n ->range(0,50)\n //->condition('n.uid',$uid,'=')\n ->execute();\n\n return $result;\n\n}", "private function getDbIndexes()\n\t{\n\t\t$r = $this->source->query(\"SHOW INDEXES FROM `{$this->table}`\");\n\t\treturn $r;\n\t}", "abstract public function doIndex($item);", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function fetch_all($index=null)\n {\n $host = preg_replace('/^([^\\s]+).*$/', '\\1', mysqli_get_host_info(self::$db));\n\n $sql = $this->rs_sql ? $this->rs_sql: $this->get_select();\n $md5 = md5($sql);\n\n if (!$this->rs)\n {\n $rows = null;\n if ($this->cache && isset(self::$_result_cache[$md5]))\n {\n $rows = unserialize(gzuncompress(self::$_result_cache[$md5]));\n }\n\n if (($data_obj = Cache::get($md5)) && is_array($data_obj))\n {\n $rows = $data_obj;\n }\n\n if ($rows)\n {\n if ($this->debug)\n error_log('cached ('.count($rows).'): '.$sql);\n foreach ($rows as $i => $row)\n $rows[$i] = dict($row);\n return $rows;\n }\n\n $this->execute($sql);\n }\n\n $rows = array();\n while ($this->rs && ($row = mysqli_fetch_array($this->rs, MYSQLI_NUM)) && $row)\n {\n $j = count($rows);\n $res = array();\n $pri = array();\n foreach ($row as $i => $value)\n {\n $field = $this->rs_fields[$i];\n $res[$field->name] = $value;\n\n // NOT_NULL_FLAG = 1\n // PRI_KEY_FLAG = 2\n // UNIQUE_KEY_FLAG = 4\n // BLOB_FLAG = 16\n // UNSIGNED_FLAG = 32\n // ZEROFILL_FLAG = 64\n // BINARY_FLAG = 128\n // ENUM_FLAG = 256\n // AUTO_INCREMENT_FLAG = 512\n // TIMESTAMP_FLAG = 1024\n // SET_FLAG = 2048\n // NUM_FLAG = 32768\n // PART_KEY_FLAG = 16384\n // GROUP_FLAG = 32768\n // UNIQUE_FLAG = 65536\n\n if (!is_null($value))\n {\n if ($field->flags & 32768)\n $res[$field->name] = intval($value);\n }\n\n if ($field->flags & 2)\n $pri[] = $value;\n }\n if ($pri) $j = join(':', $pri);\n $rows[$index && array_key_exists($index, $res) ? $res[$index]: $j] = $res;\n }\n\n $this->recache($rows);\n\n foreach ($rows as $i => $row)\n $rows[$i] = dict($row);\n\n return $rows;\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "function ss_hammerOID_pollers_indexes() {\n\n $return_arr = array();\n\t\t\n\t$rows = db_fetch_assoc(\"SELECT id FROM poller\");\n\n\n for ($i=0;($i<sizeof($rows));$i++) {\n $return_arr[$i] = $rows[$i]['id'];\n }\n\n return $return_arr;\n}", "protected function getIndex()\n\t{ \n /*\n $sm = $this->account->getServiceManager();\n $dbh = $sm->get(\"Db\");\n $this->dbh = $dbh;\n\t\treturn new \\Netric\\EntityQuery\\Index\\Pgsql($this->account, $dbh);\n * \n */\n $this->dbh = $this->account->getServiceManager()->get(\"Db\");\n return new \\Netric\\EntityQuery\\Index\\Pgsql($this->account);\n\t}", "public function findForIndex() {\n\t\treturn $this->findAll();\n\t}", "function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }", "function slaveAllIndexes() {\n $this->db_slave->executeSQL(\"SELECT \" . $this->idx_slave . \" from \" . $this->db_slave->database . \".\" . $this->table_slave);\n }", "public function _INDEX()\n\t{\n\t\t\n\t}", "function index($model) {\n\t\t$index = array();\n\t\t$table = $this->fullTableName($model);\n\t\tif ($table) {\n\t\t\t$indexes = $this->query('SHOW INDEX FROM ' . $table);\n\t\t\tif (isset($indexes[0]['STATISTICS'])) {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.STATISTICS');\n\t\t\t} else {\n\t\t\t\t$keys = Set::extract($indexes, '{n}.0');\n\t\t\t}\n\t\t\tforeach ($keys as $i => $key) {\n\t\t\t\tif (!isset($index[$key['Key_name']])) {\n\t\t\t\t\t$col = array();\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['unique'] = intval($key['Non_unique'] == 0);\n\t\t\t\t} else {\n\t\t\t\t\tif (!is_array($index[$key['Key_name']]['column'])) {\n\t\t\t\t\t\t$col[] = $index[$key['Key_name']]['column'];\n\t\t\t\t\t}\n\t\t\t\t\t$col[] = $key['Column_name'];\n\t\t\t\t\t$index[$key['Key_name']]['column'] = $col;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $index;\n\t}", "public function getIndexes()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW INDEX FROM `$this->table`\"\n ));\n\n return $result;\n\t}", "function get_table_indexes($db, $table, $cnx='', $reload=false, $mode='mysql'){\n\tif($mode!=='mysql') exit('only mysql index mode developed');\n\tglobal $get_table_indexes, $dbTypeArray;\n\tif(!$cnx)$cnx=C_MASTER;\n\tif($get_table_indexes[$db][$table] && !$reload){\n\t\treturn $get_table_indexes[$db][$table];\n\t}else{\n\t\t$fl=__FILE__;\n\t\t$ln=__LINE__+1;\n\t\tob_start();\n\t\t$result=q(\"SHOW INDEXES FROM `$db`.`$table`\", $cnx, ERR_ECHO, O_DO_NOT_REMEDIATE);\n\t\t$err=ob_get_contents();\n\t\tob_end_clean();\n\t\tif($err)return false;\n\t\t\n\t\t$typeFlip = array_flip($dbTypeArray);\n\t\t$inCompound=false;\n\t\twhile($v=mysqli_fetch_array($result,MYSQLI_ASSOC)){\n\t\t\t$w++;\n\t\t\t@extract($v);\n\t\t\tif($buffer==$Key_name){\n\t\t\t\t//duplicate part of a key\n\t\t\t\tif(!$inCompound){\n\t\t\t\t\t$multiIdx[$Key_name][]=$singleIdx[count($singleIdx)-1];\n\t\t\t\t\tunset($singleIdx[count($singleIdx)-1]);\n\t\t\t\t\t//next two lines overcome \"bug\" in php: just cause I unset the highest element, this will not reset the next index assigned when I say $singleIdx[]=.. later on.\n\t\t\t\t\t$clr=$singleIdx;\n\t\t\t\t\t$singleIdx=$clr;\n\t\t\t\t}\n\t\t\t\t$multiIdx[$Key_name][]=$v;\n\t\t\t\t$inCompound=true;\n\t\t\t}else{\n\t\t\t\t$singleIdx[]=$v;\n\t\t\t\t$buffer=$Key_name;\n\t\t\t\t$inCompound=false;\n\t\t\t}\n\t\t}\n\t\t//set $singleIdx as assoc for reference\n\t\tif(count($singleIdx)){\n\t\t\tforeach($singleIdx as $v) $a[strtolower($v['Column_name'])]=$v;\n\t\t\t$singleIdx=$a;\n\t\t}\n\t\t//store compound keys as XML\n\t\tif($multiIdx){\n\t\t\t$compoundKey='';\n\t\t\tforeach($multiIdx as $n=>$v){\n\t\t\t\t$ci.='<compoundKey Key_name=\"'.$n.'\" Column_count=\"'.count($v).'\"';\n\t\t\t\t$i=0;\n\t\t\t\tforeach($v as $w){\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i==1)$ci.=' Non_unique=\"'.$w['Non_unique'].'\">'.\"\\n\";\n\t\t\t\t\t$ci.='<keyColumn Seq_in_index=\"'.$w['Seq_in_index'].'\" Column_name=\"'.$w['Column_name'].'\" Sub_part=\"'.$w['Sub_part'].'\" Comment=\"'.htmlentities($w['Comment']).'\">'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ci.='</compoundKey>';\n\t\t\t}\n\t\t}\n\t\t$get_table_indexes[$db][$table]=array('singleIdx'=>$singleIdx, 'multiIdx'=>$multiIdx, 'compoundXML'=>$ci);\n\t\treturn $get_table_indexes[$db][$table];\n\t}\n}", "public function buildIndex();", "function indexes($table)\n{\n\treturn $this->drv->indexes($table);\n}", "public function fetchSearchIndexIds($offset, $full = false);", "abstract protected function getIndexTableFields();", "public function getModelIndexes($model)\n {\n\treturn $this->query('select [name] from [indexes] where [table] = %s', $model->getTableName() );\n }", "public function getSearchIndex();", "public function getIndexed($query) {\n\t\t$return = array();\n\t\t$result = $this->query($query);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$return[] = $row;\n\t\t}\n\t\t$result->free();\n\t\treturn $return;\n\t}", "public function getList($index = '')\n {\n \t// $result = Yii::$app->cache->get($key);\n \t// if (empty($result)) {\n \t// \t$result = $this->object->find()->asArray()->all();\n \t// \tYii::$app->cache->set($key, $result);\n \t// }\n if (empty($index)) {\n $result = $this->object->find()->asArray()->all();\n }else{\n $result = $this->object->find()->indexBy($index)->asArray()->all();\n }\n return $result;\n }", "function doIndex() {\n $ret = array();\n if( $this->statement->rowCount() > 0 ) {\n $data = $this->statement->fetchAll($this->fetch_style);\n } else {\n $data = array();\n }\n\n foreach( $data as $line ) {\n if( !isset($line[$this->index[0]]) ) {\n throw new Exception(\n \"Index '\" . $this->index[0] . \"' does not exist in data.\"\n );\n }\n $key = $line[$this->index[0]];\n\n if( count($this->index) == 1 ) {\n $ret[$key] = $line;\n } else {\n $key2 = $line[$this->index[1]];\n if( !isset($ret[$key]) ) $ret[$key] = array();\n $ret[$key][$key2] = $line;\n }\n }\n if( $this->sticky == false ) $this->setDefaults();\n return( $ret );\n }", "abstract protected function getIndex();", "public function getModelIndex();", "public function getAll(Index $index): iterable;", "public function indexBy($callback);", "function getIndex() ;", "public function fetchAllIndexed($sql, $bind = null)\r\n {\r\n return $this->selectPrepare($sql, $bind)->fetchAll(PDO::FETCH_UNIQUE | PDO::FETCH_ASSOC);\r\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function index()\n {\n return DB::table('Item')->get();\n }", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "private function query() {\n\t\t$indexables_to_create = [];\n\t\tif ( ! $this->indexable_repository->find_for_system_page( '404', false ) ) {\n\t\t\t$indexables_to_create['404'] = true;\n\t\t}\n\n\t\tif ( ! $this->indexable_repository->find_for_system_page( 'search-result', false ) ) {\n\t\t\t$indexables_to_create['search'] = true;\n\t\t}\n\n\t\tif ( ! $this->indexable_repository->find_for_date_archive( false ) ) {\n\t\t\t$indexables_to_create['date_archive'] = true;\n\t\t}\n\n\t\t$need_home_page_indexable = ( (int) \\get_option( 'page_on_front' ) === 0 && \\get_option( 'show_on_front' ) === 'posts' );\n\n\t\tif ( $need_home_page_indexable && ! $this->indexable_repository->find_for_home_page( false ) ) {\n\t\t\t$indexables_to_create['home_page'] = true;\n\t\t}\n\n\t\treturn $indexables_to_create;\n\t}", "private function _get_records($tag_ids, $page_size, $offset, $sort_field, $sort_direction, $search_type, $include_albums) {\n\n $items_model = ORM::factory(\"item\");\n if ($search_type == \"AND\") {\n // For some reason, if I do 'select(\"*\")' the item ids all have values that are 1000+\n // higher then they should be. So instead, I'm manually selecting each column that I need.\n $items_model->select(\"items.id\");\n $items_model->select(\"items.name\");\n $items_model->select(\"items.title\");\n $items_model->select(\"items.view_count\");\n $items_model->select(\"items.owner_id\");\n $items_model->select(\"items.rand_key\");\n $items_model->select(\"items.type\");\n $items_model->select(\"items.thumb_width\");\n $items_model->select(\"items.thumb_height\");\n $items_model->select(\"items.left_ptr\");\n $items_model->select(\"items.right_ptr\");\n $items_model->select(\"items.relative_path_cache\");\n $items_model->select(\"items.relative_url_cache\");\n $items_model->select('COUNT(\"*\") AS result_count');\n }\n $items_model->viewable();\n $items_model->join(\"items_tags\", \"items.id\", \"items_tags.item_id\");\t\t\n $items_model->open();\n $items_model->where(\"items_tags.tag_id\", \"=\", $tag_ids[0]);\n $counter = 1;\n while ($counter < count($tag_ids)) {\n $items_model->or_where(\"items_tags.tag_id\", \"=\", $tag_ids[$counter]);\n $counter++;\n }\n $items_model->close();\n if ($include_albums == false) {\n $items_model->and_where(\"items.type\", \"!=\", \"album\");\n }\n $items_model->order_by($sort_field, $sort_direction);\n $items_model->group_by(\"items.id\");\n if ($search_type == \"AND\") {\n $items_model->having(\"result_count\", \"=\", count($tag_ids));\n }\n\n return $items_model->find_all($page_size, $offset);\n }", "function mongo_lite_index($collection, $indexs)\n\t{\n\t\t$collection = mongo_lite($collection);\n\n\t\treturn $collection->index($indexs);\n\t}", "function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }", "public static function indexAll($options=array())\n {\n\n $solr = self::connect($options);\n\n $db = get_db();\n $table = $db->getTable('Item');\n $select = $table->getSelect();\n\n // Removed in order to index both public and private items\n // $table->filterByPublic($select, true);\n $table->applySorting($select, 'id', 'ASC');\n\n $excTable = $db->getTable('SolrSearchExclude');\n $excludes = array();\n foreach ($excTable->findAll() as $e) {\n $excludes[] = $e->collection_id;\n }\n if (!empty($excludes)) {\n $select->where(\n 'collection_id IS NULL OR collection_id NOT IN (?)',\n $excludes);\n }\n\n // First get the items.\n $pager = new SolrSearch_DbPager($db, $table, $select);\n while ($items = $pager->next()) {\n foreach ($items as $item) {\n $docs = array();\n $doc = self::itemToDocument($item);\n $docs[] = $doc;\n $solr->addDocuments($docs);\n }\n $solr->commit();\n }\n\n // Now the other addon stuff.\n $mgr = new SolrSearch_Addon_Manager($db);\n $docs = $mgr->reindexAddons();\n $solr->addDocuments($docs);\n $solr->commit();\n\n $solr->optimize();\n\n }", "function getIndexes($table) {\n return mysql_query(sprintf('SHOW INDEX FROM %s', $table));\n }", "public function testSelect()\n {\n $index = new Index();\n $query = new Query($index);\n $this->assertSame($query, $query->select(['a', 'b']));\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b'], $elasticQuery['_source']);\n\n $query->select(['c', 'd']);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['a', 'b', 'c', 'd'], $elasticQuery['_source']);\n\n $query->select(['e', 'f'], true);\n $elasticQuery = $query->compileQuery()->toArray();\n $this->assertEquals(['e', 'f'], $elasticQuery['_source']);\n }", "public function select();", "public function select();", "public function select();", "abstract public function index($item);", "public function getQueryBuilderForIndex(Request $Request, $context = null);", "private function __select() {\n $from_str = $this->getFromStr();\n $field = $this->field_str;\n if (empty($field)) {\n $field = '*';\n }\n $sql = \"SELECT {$field} FROM {$from_str}\";\n if (!empty($this->join_str_list)) {\n $temp = implode(' ', $this->join_str_list);\n $sql .= \" {$temp}\";\n }\n if (!empty($this->where_str)) {\n $sql .= \" WHERE {$this->where_str}\";\n }\n if (!empty($this->group_str)) {\n $sql .= \" GROUP BY {$this->group_str}\";\n }\n if (!empty($this->order_str)) {\n $sql .= \" ORDER BY {$this->order_str}\";\n }\n if (!empty($this->limit_str)) {\n $sql .= \" LIMIT {$this->limit_str}\";\n }\n $list = $this->query($sql);\n return $list;\n }", "function query() {\n \n $this->ensure_my_table();\n \n if ($this->options['operator'] == 'in') {\n $keys = array_keys($this->value);\n\n $this->query->add_where(0, $this->table_alias.'.id IN ('. implode(',', $keys).')' );\n }\n\n }", "function adv_select($table, array $where = null, array $fields = null, $order = '', $limit = null, $offset = null);", "public function testQueryAccessAll() {\n user_role_grant_permissions('anonymous', array('access content', 'access comments'));\n $this->index->reindex();\n $this->index->indexItems();\n $query = Utility::createQuery($this->index);\n $result = $query->execute();\n\n $this->assertResults($result, array('user' => array(0), 'comment' => array(0), 'node' => array(0, 1)));\n }", "public function readIndexes($tableName, $resource);", "public function isIndexed() {}", "public function isIndexed() {}", "public function isIndexed() {}", "public function select_admin_index($start = 0, $stop = 25)\n {\n $sql = \"SELECT *\n FROM\n (\n SELECT newsuser.news_id, news_name, news_slug, news_content, news_seo_title,\n news_seo_description, news_add_date, news_update_date, user_name, ntype_id\n FROM\n (\n SELECT news_id, news_name, news_slug, news_content, news_seo_title,\n news_seo_description, news_add_date, news_update_date, qhn_news.user_id, user_name\n FROM qhn_news\n LEFT JOIN qhn_users ON qhn_news.user_id = qhn_users.user_id\n ) as newsuser\n LEFT JOIN qhn_news_type_details\n ON qhn_news_type_details.news_id = newsuser.news_id\n UNION\n SELECT newsuser_1.news_id, news_name, news_slug, news_content, news_seo_title,\n news_seo_description, news_add_date, news_update_date, user_name, ntype_id\n FROM\n (\n SELECT news_id, news_name, news_slug, news_content, news_seo_title,\n news_seo_description, news_add_date, news_update_date, qhn_news.user_id, user_name\n FROM qhn_news\n LEFT JOIN qhn_users ON qhn_news.user_id = qhn_users.user_id\n ) as newsuser_1\n RIGHT JOIN qhn_news_type_details\n ON qhn_news_type_details.news_id = newsuser_1.news_id\n ) as newsusertypes\n LEFT JOIN qhn_news_type ON newsusertypes.ntype_id = qhn_news_type.ntype_id\n GROUP BY news_id\n ORDER BY newsusertypes.news_update_date DESC LIMIT {$start}, {$stop}\";\n $result = $this->query($sql);\n return $this->fetch_assoc_all($result);\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_hit';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public abstract function get($index);", "public function indexes()\n {\n return array_merge(parent::indexes(), array(\n 'userId' => array(\n 'key' => array(\n 'userId' => \\EMongoCriteria::SORT_ASC,\n ),\n 'unique' => true,\n ),\n ));\n }", "public function checkTableIndex(){\n\t\t$db = $this->db;\n\t\t\n\t\t$sql = \"SELECT * FROM dataset WHERE table_num <= 1\";\n\t\t\n\t\t$result = $db->fetchAll($sql, 2);\n\t\t\n\t\tforeach($result AS $row){\n\t\t\t$cacheID = $row[\"cache_id\"];\n\t\t\t$tableId = OpenContext_TableOutput::tableID_toURL($cacheID);\n\t\t\t$noid = $row[\"noid\"];\n\t\t\t$created = $row[\"created_on\"];\n\t\t\t\n\t\t\tif(!stristr($tableId, \"http://\")){\n\t\t\t\t$host = OpenContext_OCConfig::get_host_config();\n\t\t\t\t$tableId = $host.\"/tables/\".$tableId;\n\t\t\t}\n\t\t\t\n\t\t\t$sql = \"SELECT * FROM noid_bindings WHERE itemUUID = '$cacheID' LIMIT 1\";\n\t\t\t$resultB = $db->fetchAll($sql, 2);\n\t\t\t\n\t\t\tif(!$resultB){\n\t\t\t\t$data = array(\"noid\" => $noid,\n\t\t\t\t\t\t\t \"itemType\" => \"table\",\n\t\t\t\t\t\t\t \"itemUUID\" => $cacheID,\n\t\t\t\t\t\t\t \"itemURI\" => $tableId,\n\t\t\t\t\t\t\t \"public\" => 0,\n\t\t\t\t\t\t\t \"solr_indexed\" => 0\n\t\t\t\t\t\t\t );\n\t\t\t\t$db->insert(\"noid_bindings\", $data);\n\t\t\t}\n\t\t\t\n\t\t}//end loop\n\t\n\t}", "public function esIndex()\n {\n if ($this->isEmpty()) {\n return null;\n }\n\n $all = $this->all();\n $params = [];\n\n foreach ($all as $item) {\n $params['body'][] = [\n 'index' => [\n '_id' => $item->getEsId(),\n '_type' => $item->getEsTypeName(),\n '_index' => $item->getEsIndexName(),\n ],\n ];\n $params['body'][] = $item->getEsData();\n }\n\n return Search::bulk($params);\n }", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "function retrieveIdsBeginsWith($tableName, $idSearch, $startIndex, $maxItems);", "function getAllDistinctFileIndex() {\r\n\t\t\t$query = $this->pdo->prepare('select distinct file_index from document_details');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function isIndexed() ;" ]
[ "0.61994404", "0.61494905", "0.6054029", "0.6027736", "0.59952474", "0.5953651", "0.5892444", "0.5892444", "0.5892444", "0.5854872", "0.5841658", "0.5833369", "0.58298343", "0.58118033", "0.58089465", "0.5782999", "0.5778935", "0.576429", "0.5750929", "0.57421386", "0.57273215", "0.5670971", "0.5667522", "0.56101567", "0.560943", "0.56006515", "0.55892843", "0.5579953", "0.5547459", "0.55462664", "0.5532859", "0.5532201", "0.552307", "0.55141765", "0.5506298", "0.5505834", "0.55056345", "0.55056345", "0.55056345", "0.5504968", "0.5504785", "0.5504785", "0.5504785", "0.5504609", "0.5504609", "0.54847056", "0.5449931", "0.5444866", "0.5443558", "0.54413205", "0.5422824", "0.54174185", "0.5389827", "0.5389827", "0.5389827", "0.53896517", "0.5385746", "0.53788346", "0.5373502", "0.5372335", "0.5349159", "0.530344", "0.52859885", "0.5285935", "0.52857906", "0.5283289", "0.5276778", "0.52760583", "0.52746975", "0.5263041", "0.5255734", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5245262", "0.5230423", "0.5229697", "0.5228935", "0.52234685" ]
0.5499849
45
for hashing a password data
public function hash($password){ return password_hash($password, PASSWORD_DEFAULT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashPassword($data) { \r\n if (!$this->id && !isset($this->data[$this->name]['id'])) {\r\n if (!isset($this->data[$this->name]['FilterChar'])) {\r\n $this->data[$this->name]['FilterChar'] = self::createFilterChar();\r\n }\r\n if (isset($this->data[$this->name]['Username']) && isset($this->data[$this->name]['Password']) && isset($this->data[$this->name]['FilterChar'])) {\r\n\r\n $this->data[$this->name]['Password'] = sha1($this->data[$this->name]['Username'] . \"+\" . $this->data[$this->name]['Password'] . \"+\" . $this->data[$this->name]['FilterChar']);\r\n\r\n $this->data[$this->name]['FirstPass'] = $this->data[$this->name]['Password'];\r\n\r\n return $data;\r\n }\r\n }\r\n }", "function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}", "protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}", "function hashPassword($data, $enforce=false) {\n if($enforce && isset($this->data[$this->alias]['password']) && isset($this->data[$this->alias]['password']) ) {\n if(!empty($this->data[$this->alias]['password']) && !empty($this->data[$this->alias]['username']) ) {\n $stringToHash = $this->data[$this->alias]['username'].$this->data[$this->alias]['password'];\n $hasher = new SimplePasswordHasher(array('hashType' =>'sha1'));\n $this->data[$this->alias]['password'] = $hasher->hash($stringToHash);\n }\n }\n\n return $data;\n }", "public function passHash($data)\n {\n $pwdHasher = new PasswordHash(8, false);\n\n return $pwdHasher->HashPassword($data);\n }", "public function GetPasswordHash ();", "function hasher($raw_data, $hashed_data = false)\n{\n if ($hashed_data) {\n if (password_verify($raw_data, $hashed_data)) {\n return true;\n } else {\n return false;\n }\n } else {\n return password_hash($raw_data, PASSWORD_BCRYPT, ['cost' => 12]);\n }\n}", "function _hash_password($password)\n {\n //return altered pw\n\n }", "function hashPasswords($data, $enforce=false) {\n\t\tif($enforce && isset($this->data[$this->alias]['password'])) {\n\t\t\tif(!empty($this->data[$this->alias]['password'])) {\n\t\t\t\t$this->data[$this->alias]['password'] = Security::hash($this->data[$this->alias]['password'], null, true);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n }", "function getPasswordHash($password)\r\n {\r\n return ( hash( 'whirlpool', $password ) );\r\n }", "function get_password_hash( $password )\r\n\t\t{\r\n\t\t\treturn hash_hmac( 'sha256', $password, 'c#haRl891', false );\r\n\t\t\t\r\n\t\t}", "function hashPassword($password) {\n $cost = 10;\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt;\n return crypt($password, $salt);\n }", "function hash_password($password){\n\t// Hashing options\n\t$options = [\n 'cost' => 12,\t// Cost determines the work required to brute-force\n //'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n\t];\n\n\treturn password_hash($password, PASSWORD_BCRYPT, $options);\n}", "public static function chlogHashStatic($data) {\n return password_hash($data, PASSWORD_DEFAULT, ['salt' => Security::SALT]); \n }", "public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}", "function HashPassword($input)\n{\n//Credits: http://crackstation.net/hashing-security.html\n//This is secure hashing the consist of strong hash algorithm sha 256 and using highly random salt\n$salt = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)); \n$hash = hash(\"sha256\", $salt . $input); \n$final = $salt . $hash; \nreturn $final;\n}", "private function hashPassword($password)\n {\n return password_hash($password, PASSWORD_BCRYPT);\n\t}", "function _hashsaltpass($password)\n {\n $salted_hash = hash(\"sha512\", \"salted__#edsdfdwrsdse\". $password.\"salted__#ewr^&^$&e\");\n return $salted_hash;\n }", "public function generateHash (string $password): string;", "public function hashPassword($password)\n { \t\n \treturn md5($password);\n\t}", "function wp_hash_password( $password ) {\n\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\treturn password_hash( $password, PASSWORD_DEFAULT, [ 'cost' => $cost ] );\n\t}", "private function hashPass($password) {\n\t\t// Hash that password\n $hashed_password = password_hash(\"$password\", PASSWORD_DEFAULT);\n return $hashed_password;\n }", "private function Hasher($password) {\r\n return password_hash($password, PASSWORD_BCRYPT);\r\n }", "public function hash_user_pass($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n\n//PASSWORD_DEFAULT is a default function in PHP it contains BCRYPT algo at backend PHP is using BCRYPT currently\n//as it is most secure password hashing algorithm using today the term DEFAULT means that if another hashing algorithm is introduced in\n//future it will automatically updated to the library ny PHP so the developer has no need to update in the code.\n $hashing = password_hash($password.$salt, PASSWORD_DEFAULT);\n $hash = array(\"salt\" => $salt, \"hashing\" => $hashing);\n\n return $hash;\n\n}", "function hashPassword($password){\n$hash = hash('sha512', $password);\nreturn $hash;\n}", "function hash_passwd($password , $nonce) {\n\t\t$secureHash = hash_hmac('sha512', $password.$nonce, SITE_KEY) ;\n\t\treturn $secureHash ;\n\t}", "public static function chlogHash($data) {\n //keep regenerating hash until we get one without a period at the end\n do {\n $hash = password_hash($data, PASSWORD_DEFAULT);\n } while (substr($hash, -1)==\".\");\n \n return $hash; \n }", "public function hashPassword($p)\r\n {\r\n $r = sha1(Yii::$app->params['solt'].$p->password.$p->mail);\r\n return $r;\r\n }", "function gethashpass($password,$salt,$timestamp) {\n\t\t\t$ps = $password.$salt;\n\t\t\t$joinps = md5($ps);\n\t\t\t$timehash = md5($timestamp);\n\t\t\t$joinallstr = $joinps.$timehash;\n\t\t\t$hashpass = md5($joinallstr);\n\t\t\t$encodepass = substr(base64_encode($hashpass),0,32);\n\t\t\treturn $encodepass;\n\t\t}", "function hashPassword($password){\r\n\r\n\t$hash =password_hash($password,PASSWORD_DEFAULT);\r\n\treturn $hash;\r\n}", "function hash_password($username, $password) {\n\t\t//if there is no password, then the hash will be of the username\n\t\tif(!isset($password) || $password === '') {\n\t\t\treturn md5($username);\n\t\t}\n\t\t\n\t\t$hashed_user = md5($username);\n\t\t$hashed_pass = md5($password);\n\t\t$hash = \"\";\n\t\tfor ($i=0; $i < 32; ++$i) { \n\t\t\t$hash .= $hashed_user[$i] . $hashed_pass[$i];\n\t\t}\n\t\treturn md5($hash);\n\t}", "protected function hashPassword(array $data)\n {\n if (! isset($data['data']['password'])) {\n return $data;\n }\n $data['data']['password'] = password_hash($data['data']['password'], PASSWORD_DEFAULT);\n return $data;\n }", "public static function hash($password){\n\t\t\treturn password_hash($password, PASSWORD_DEFAULT, self::getCost());\n\t\t}", "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "function getPasswordHash($password,$salt){\n\t\treturn hash('sha256',$salt.$password);\n}", "function hashME($username, $password) {\n\treturn bin2hex(hash(\"sha512\", $password . strtolower($username), true) ^ hash(\"whirlpool\", strtolower($username) . $password, true));\n}", "public function calculateHash($password)\n\t{\n\t\treturn md5($password . str_repeat('*enter any random salt here*', 10));\n\t}", "function getPasswordHash($password){\n\t\t$salt = $this->getPasswordSalt();\n\t\treturn $salt . ( hash('sha256', $salt . $password ) );\n\t}", "public function hashPassword($password) \n {\n return CPasswordHelper::hashPassword($password);\n }", "public static function hashPassword($password){\n $config = App_DI_Container::get('ConfigObject');\n $module = strtolower(CURRENT_MODULE);\n return sha1($config->{$module}->security->passwordsalt . $password);\n //return sha1($password);\n }", "function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }", "function wp_hash_password($password)\n {\n }", "function password_update($password) {\n\t\t$hash = hash_password($password);\n\t\tlgi_mysql_query(\"UPDATE %t(users) SET `passwd_hash`='%%' WHERE `name`='%%'\",$hash, $this->userid);\n\t}", "protected function _computeHashR6($data, $inputPassword, $userKey = '') {}", "public function createHash($password){\r\n $options = [\r\n 'cost' => 10,\r\n ];\r\n $hash = password_hash($password, PASSWORD_DEFAULT, $options);\r\n return $hash;\r\n}", "function hashPass($pass, $salt){\n while(strlen($pass) > strlen($salt)){\n $salt = $salt.$salt;\n }\n while(strlen($salt) > strlen($pass)){\n $salt = substr($salt, 0, -1);\n }\n\n $hashable = saltPass($pass, $salt);\n\n //Hash the hashable string a couple of times\n $hashedData = $hashable;\n for($i = 0; $i < 10000; $i++){\n $hashedData = hash('sha512', $hashedData);\n }\n\n return $hashedData;\n}", "public static function EncodePasswordToHash ($password = '', $options = []);", "function\nauth_hash($password, $salt = \"\")\n{\n // The password hash is crypt(\"password\", \"sha512-salt\")\n if ($salt == \"\")\n $salt = \"\\$6\\$\" . bin2hex(openssl_random_pseudo_bytes(8));\n\n return (crypt($password, $salt));\n}", "public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }", "public static function hashPassword($username,$password)\n {\n \t$options = [\n 'cost' => 11,\n 'salt' => mcrypt_create_iv(22, MCRYPT_DEV_URANDOM),\n ];\n return password_hash($username.$password, PASSWORD_BCRYPT, $options);\n }", "function getHashedPass($password, $salt)\n{\n $saltedPass = $password . $salt;\n return hash('sha256', $saltedPass);\n}", "public function hash();", "protected function hashData($data)\r\n \t{\r\n\t\t\treturn hash_hmac('sha512', $data, $this->_siteKey);\r\n\t\t}", "function wp_hash($data, $scheme = 'auth')\n {\n }", "function external_hash_password($password)\n{\n $external_hasher = new PasswordHash(8, FALSE);\n\n return $external_hasher->HashPassword($password);\n}", "public function getPasswordHash($salt,$password)\r\n\t\t\t{\r\n\t\t\t\treturn hash('whirlpool',$salt.$password);\r\n\t\t\t}", "function lmhash($password = \"\") {\n $password = strtoupper($password);\n $password = substr($password, 0, 14);\n $password = str_pad($password, 14, chr(0));\n $p16 = $this->E_P16($password);\n for ($i = 0; $i < sizeof($p16); $i++) {\n $p16[$i] = sprintf(\"%02X\", $p16[$i]);\n }\n return join(\"\", $p16);\n }", "function my_password_hash($password)\n{\n $salt = createSalt();\n $hash = md5($salt.$password);\n return array(\"hash\" => $hash, \"salt\" => $salt);\n}", "function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\n}", "private function hashPw($salt, $password) {\n return md5($salt.$password);\n }", "protected function hashPassword($password = false) {\n\t if (!function_exists('__hash')) {\n\t\t\t$this->load->helper('auth');\n\t\t}\n\t\tif ($password === false) {\n\t return false;\n\t }\n\t\treturn __hash($password,$this->config->item('password_crypt'));\n\t}", "private function password_hash($password)\n {\n return password_hash($password, PASSWORD_DEFAULT);\n }", "private function passwordHash($password, $salt){\n return md5($password.$salt);\n }", "function hashPassword($password, $salt) {\n\t$result = password_hash($password . $salt, PASSWORD_DEFAULT);\n\treturn $result;\n}", "function cafet_generate_hashed_pwd(string $password): string\n {\n $salt = base64_encode(random_bytes(32));\n $algo = in_array(Config::hash_algo, hash_algos()) ? Config::hash_algo : 'sha256';\n \n return $algo . '.' . $salt . '.' . cafet_digest($algo, $salt, $password);\n }", "function hash_password($cleartext_password) {\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n return crypt($cleartext_password, \"$1$\" . \\melt\\string\\random_hex_str(8) . \"$\");\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n $salt = \\melt\\string\\random_hex_str(40);\n return $salt . sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n $salt = \\melt\\string\\random_hex_str(32);\n return $salt . \\md5($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}", "function password_is_hash($password)\r\n{\r\n $nfo = password_get_info($password);\r\n return $nfo['algo'] != 0;\r\n}", "function getHash($username, $password) {\n return sha1(strtolower($username).$password);\n }", "private static function _password($password, $hash)\n\t{\n\t\treturn md5(md5(md5($password)));\n\t}", "function password_hash($password, $algo, array $options = array()) {\r\n if (!function_exists('crypt')) {\r\n trigger_error(\"Crypt must be loaded for password_hash to function\", E_USER_WARNING);\r\n return null;\r\n }\r\n if (is_null($password) || is_int($password)) {\r\n $password = (string) $password;\r\n }\r\n if (!is_string($password)) {\r\n trigger_error(\"password_hash(): Password must be a string\", E_USER_WARNING);\r\n return null;\r\n }\r\n if (!is_int($algo)) {\r\n trigger_error(\"password_hash() expects parameter 2 to be long, \" . gettype($algo) . \" given\", E_USER_WARNING);\r\n return null;\r\n }\r\n $resultLength = 0;\r\n switch ($algo) {\r\n case PASSWORD_BCRYPT:\r\n $cost = PASSWORD_BCRYPT_DEFAULT_COST;\r\n if (isset($options['cost'])) {\r\n $cost = $options['cost'];\r\n if ($cost < 4 || $cost > 31) {\r\n trigger_error(sprintf(\"password_hash(): Invalid bcrypt cost parameter specified: %d\", $cost), E_USER_WARNING);\r\n return null;\r\n }\r\n }\r\n// The length of salt to generate\r\n $raw_salt_len = 16;\r\n// The length required in the final serialization\r\n $required_salt_len = 22;\r\n $hash_format = sprintf(\"$2y$%02d$\", $cost);\r\n// The expected length of the final crypt() output\r\n $resultLength = 60;\r\n break;\r\n default:\r\n trigger_error(sprintf(\"password_hash(): Unknown password hashing algorithm: %s\", $algo), E_USER_WARNING);\r\n return null;\r\n }\r\n $salt_req_encoding = false;\r\n if (isset($options['salt'])) {\r\n switch (gettype($options['salt'])) {\r\n case 'NULL':\r\n case 'boolean':\r\n case 'integer':\r\n case 'double':\r\n case 'string':\r\n $salt = (string) $options['salt'];\r\n break;\r\n case 'object':\r\n if (method_exists($options['salt'], '__tostring')) {\r\n $salt = (string) $options['salt'];\r\n break;\r\n }\r\n case 'array':\r\n case 'resource':\r\n default:\r\n trigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);\r\n return null;\r\n }\r\n if (_strlen($salt) < $required_salt_len) {\r\n trigger_error(sprintf(\"password_hash(): Provided salt is too short: %d expecting %d\", _strlen($salt), $required_salt_len), E_USER_WARNING);\r\n return null;\r\n } elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {\r\n $salt_req_encoding = true;\r\n }\r\n } else {\r\n $buffer = '';\r\n $buffer_valid = false;\r\n if (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\r\n $buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\r\n if ($buffer) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\r\n $buffer = openssl_random_pseudo_bytes($raw_salt_len);\r\n if ($buffer) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid && @is_readable('/dev/urandom')) {\r\n $file = fopen('/dev/urandom', 'r');\r\n $read = _strlen($buffer);\r\n while ($read < $raw_salt_len) {\r\n $buffer .= fread($file, $raw_salt_len - $read);\r\n $read = _strlen($buffer);\r\n }\r\n fclose($file);\r\n if ($read >= $raw_salt_len) {\r\n $buffer_valid = true;\r\n }\r\n }\r\n if (!$buffer_valid || _strlen($buffer) < $raw_salt_len) {\r\n $buffer_length = _strlen($buffer);\r\n for ($i = 0; $i < $raw_salt_len; $i++) {\r\n if ($i < $buffer_length) {\r\n $buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\r\n } else {\r\n $buffer .= chr(mt_rand(0, 255));\r\n }\r\n }\r\n }\r\n $salt = $buffer;\r\n $salt_req_encoding = true;\r\n }\r\n if ($salt_req_encoding) {\r\n// encode string with the Base64 variant used by crypt\r\n $base64_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\r\n $bcrypt64_digits = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r\n $base64_string = base64_encode($salt);\r\n $salt = strtr(rtrim($base64_string, '='), $base64_digits, $bcrypt64_digits);\r\n }\r\n $salt = _substr($salt, 0, $required_salt_len);\r\n $hash = $hash_format . $salt;\r\n $ret = crypt($password, $hash);\r\n if (!is_string($ret) || _strlen($ret) != $resultLength) {\r\n return false;\r\n }\r\n return $ret;\r\n }", "public function generatePasswordHash($password)\n {\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\n }", "function hash_clients_pass($pass){\n\t//Get pepper options\n\t// require_once 'api-config.php';\n\n\t// echo \"<br>SHIT<br> \". getPepper() . \"<br>\";\n\t// $pepper = getPepper() ;\n\n\t$config_options = getConfigOptions();\n\n\t$pepper = $config_options['pepper'];\n\t$cost = $config_options['peppercost'];\n\n\t$hashedPass = password_hash($pass.$pepper, PASSWORD_DEFAULT, $cost);\n\n\treturn $hashedPass;\n}", "function hashSSHA($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }", "public static function hash($password) {\r\n\t\treturn md5($password);\r\n\t}", "public function hash_password($password)\n {\n return password_hash($password, PASSWORD_BCRYPT, array('cost' => 13));\n }", "private function HashPassword(string $password)\n\t{\n\t\t/* Create a random salt */\n\t\t$salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.');\n\t\t\n\t\t/*\t\"$2a$\" means the Blowfish algorithm,\n\t\t *\tthe following two digits are the cost parameter.\n\t\t */\n\t\t$salt = sprintf(\"$2a$%02d$\", 10) . $salt;\n\t\t\n\t\treturn crypt($password, $salt);\n\t}", "public function hash($str)\n\t{\n\t\t// on some servers hash() can be disabled :( then password are not encrypted \n\t\tif (empty($this->config['hash_method']))\n\t\t\treturn $this->config['salt_prefix'].$str.$this->config['salt_suffix']; \n\t\telse\n\t\t\treturn hash($this->config['hash_method'], $this->config['salt_prefix'].$str.$this->config['salt_suffix']); \n\t}", "protected function _hash($password)\n\t{\n\t\t$salt = $this->CI->config->item('encryption_key');\n\t\treturn hash('sha512', $password . $salt);\n\t}", "private function hashPassword($password)\n {\n $salt = md5(BaseConfig::PASSWORD_SALT);\n return sha1($salt . $password);\n }", "private function hash_password($password, $salt)\r\n\t{\r\n\t\t//truncate the user's salt and the defined salt from the config file\r\n\t\t$salt_to_use = $salt . SALT;\r\n\t\t//Hash it with the sha512 algorithm.\r\n\t\t$hashed_pass = hash_hmac('sha512', $password, $salt_to_use);\r\n\r\n\t\treturn $hashed_pass;\r\n\t}", "function getHash( $password, $salt = '' )\r\n{\r\n\treturn hash( 'sha256', $password . $salt );\r\n}", "function hashSSHA($password) {\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n}", "public function validateHash($password, $hash);", "public function getPasswordHashOfUser($username,$password){\r\n\t$options = array('cost'=>12, 'salt'=>md5(strtolower($username)));\r\n\treturn password_hash($password, PASSWORD_DEFAULT, $options);\r\n}", "function pwHash($pword = \"\"){\n\n //currently only returns the password it was given\n \n return $pword;\n\n}", "function passwordHash($user, $pass) {\n\t\t$hash = getOption('extra_auth_hash_text');\n\t\t$md5 = md5($user . $pass . $hash);\n\t\tif (DEBUG_LOGIN) { debugLog(\"passwordHash($user, $pass)[$hash]:$md5\"); }\n\t\treturn $md5;\n\t}", "function CreateHash($password){\n\t$salt = date('U'); //creates different password each time\n\t$pass = crypt($password, $salt);\n\treturn $pass;\n}", "public static function hash($password): string\n {\n return md5($password);\n }", "public static function getHMACMD5Hash($password, $data)\n {\n $dataString = implode('', $data);\n\n return self::getHMACMD5HashString($password, $dataString);\n }", "public function hashPassword($password)\n {\n return sha1($password);\n }", "public function hashPassword($password)\n {\n return sha1($password);\n }", "function getHashedPassword($pass){\n\t\t$newhashed= password_hash($pass,PASSWORD_DEFAULT);\n\t\treturn $newhashed;\n\t}", "public function make($data, array $options = array()) {\n if(is_string($data)) {\n if (config('wow-auth.passport'))\n return md5($data);\n else\n throw new \\InvalidArgumentException(\"Cannot create password hash for WoW with only one argument.\");\n }\n if(is_array($data))\n {\n // cast $user Array to Object, no need to instantiate a Collection here.\n $data = (object)$data;\n }\n\n return SHA1(strtoupper($data->username.':'.$data->password));\n }", "public function hash_passwd() {\n $this->passwd = sha1($this->passwd);\n return $this;\n }", "public function hashPassword(UserInterface $user);", "public function encode($pswd){\r\n $hash = password_hash($pswd, PASSWORD_DEFAULT);\r\n return $hash;\r\n }", "function checkhashSSHA($salt, $password) {\n\n $hash = base64_encode(sha1($password . $salt, true) . $salt);\n\n return $hash;\n}", "public function password($password);", "function security($password){\n\t\t\t$options = [ 'cost' => 12, ];\n\t\t\t$pwd = password_hash($password, PASSWORD_BCRYPT, $options);\n\t\t\treturn $pwd;\n\t\t}", "function makeHash($password) {\r\n return crypt($password, makeSalt());\r\n}" ]
[ "0.83769125", "0.79260457", "0.7710804", "0.76851696", "0.7679719", "0.76446855", "0.7565288", "0.75630325", "0.7457576", "0.73932815", "0.7385873", "0.7364531", "0.7353031", "0.73056436", "0.73033196", "0.73014325", "0.7294092", "0.7288407", "0.7273401", "0.7269547", "0.7248", "0.7238039", "0.719368", "0.7183899", "0.71813303", "0.71618235", "0.7153619", "0.71472895", "0.7118168", "0.71145886", "0.7113324", "0.7075761", "0.70602024", "0.70594925", "0.70477366", "0.70338786", "0.702091", "0.70181197", "0.69934154", "0.6961085", "0.69488555", "0.6942395", "0.6934101", "0.6922025", "0.69174224", "0.69162804", "0.6913406", "0.6912307", "0.69052297", "0.6900809", "0.6890743", "0.68864864", "0.68745255", "0.6858418", "0.6851604", "0.6844294", "0.6836549", "0.68343663", "0.68329287", "0.68308157", "0.6830089", "0.6827106", "0.6826503", "0.6812738", "0.68107057", "0.6801181", "0.67983735", "0.6776656", "0.6770359", "0.6768943", "0.6764458", "0.67622167", "0.67586446", "0.67480063", "0.6738857", "0.6727141", "0.6726559", "0.6724394", "0.6713713", "0.67131984", "0.67069894", "0.6700277", "0.66972995", "0.6690334", "0.66886824", "0.6674647", "0.6657363", "0.6649016", "0.6648961", "0.66440237", "0.66440237", "0.66234994", "0.6617535", "0.6611709", "0.6606002", "0.66057277", "0.66047776", "0.6604652", "0.6604465", "0.6603686" ]
0.67083
80
for hashing a code sent to email
public function verification_hash($code){ return hash('sha512', $code . config_item('encryption_key')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}", "function phpbb_email_hash($email)\n{\n\treturn sprintf('%u', crc32(strtolower($email))) . strlen($email);\n}", "function generate_validation_code()\n {\r\n return hash_hmac($this->hash_function, $this->email,\r\n $this->created_at.hash($this->hash_function, $this->password));\r\n }", "private function _hashEmail($email)\n\t{\n\t\treturn Security::hash(strtolower($email), $this->_hashType);\n\t}", "public function hash(): string;", "public function hash();", "function microid_hash($email, $url)\n{\n\treturn sha1(sha1(\"mailto:\" . trim($email)) . sha1(trim($url)));\n}", "public function hashValidation(){\n\t\t$this->hash_validation = md5(uniqid(rand(), true).$this->email); \n\t\treturn $this->hash_validation;\n\t}", "public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }", "protected function generateHash() {\r\n\t\t$relevantData = array('company','country','firstname','lastname','jobstatus');\r\n\t\tforeach($relevantData as $relevantField) {\r\n\t\t\t$getterMethod = 'get_'. ucfirst($relevantField);\r\n\t\t\t$badgeDataString = '';\r\n\t\t\t\r\n\t\t\tif(method_exists($this, $getterMethod)) {\r\n\t\t\t\t$badgeDataString .= $this->$getterMethod();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn md5($badgeDataString);\r\n\t}", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "public function getHash(): string;", "function wp_hash($data, $scheme = 'auth')\n {\n }", "private function getConfirmCode()\n {\n return md5(bin2hex(time()) . time());\n }", "public function validationSha($code){\r\n\t\t//variables\r\n\t\t$error = '';\r\n\t\t$user_browser = $_SERVER['HTTP_USER_AGENT']; //navegador\r\n\t\t$ip = $_SERVER['REMOTE_ADDR']; //ip\r\n\t\r\n\t\t$this->where('macro_sha', $code);\r\n\t\tif($salida = $this->getOne('solicitudes_clave')){\r\n\t\t\t\r\n\t\t\tif($salida['navegador'] != $user_browser){\t$error = 'navegador no concide';\t}\r\n\t\t\tif($salida['ip'] != $ip){\t\t\t\t\t$error = 'remote ip no concide';\t}\r\n\t\t\t\r\n\t\t\tif($error != ''){\r\n\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\t$nuevo_sha = hash('sha512', $salida['email'].$user_browser.$salida['telefono'].$ip);\r\n\t\t\t\tif($nuevo_sha != $salida['macro_sha']){\r\n\t\t\t\t\t$error = 'Shas no coinciden';\r\n\t\t\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//succes!!\r\n\t\t\t\t\t$_SESSION['email_val'] = $salida['email'];\r\n\t\t\t\t\t$_SESSION['corrector'] = $salida['salt'];\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t}else{\r\n\t\t\t$error = 'no hubo conexion a db';\r\n\t\t\t$this->rewrite_attempt($ip, $error);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "protected function hashData($data)\r\n \t{\r\n\t\t\treturn hash_hmac('sha512', $data, $this->_siteKey);\r\n\t\t}", "function auth() {\r\n\t$code = \"\";\r\n\tfor ($i = 0; $i < 8; $i ++) {\r\n\t\t$code .= (rand(0, 1) ? chr(rand(65, 122)) : rand(0, 9));\r\n\t}\r\n\treturn sha1($code);\r\n}", "function generate_authcode_email($email,$code_type=0,$user_id=\"\",$user_type=Constant::USER_TYPE_TEACHER,$check=true)\n\t{\n\t\t$authcode=\"\";\n\t\tif($check) $errorcode=$this->check_authcode_email($email,$code_type,$user_id);\t\n\t\telse $errorcode=array('errorcode'=>false);\n\t\tif(!$errorcode['errorcode'])\n {\t\n $authcode=random_string('unique');\n $data=$this->bind_verify($user_id,$email,\"\",1,$code_type,$authcode,$user_type);\n\t\t\n\t\t\tif($this->_redis)\n {\n $errorcode=$this->cache->save($authcode,json_encode($data),Constant::AUTHCODE_REDIS_EXPIRE_EMAIL);\n\t\t\t\t$this->save_check('email',$email,$authcode,Constant::SEND_REDIS_AUTHCODE_INTERVAL_EMAIL);\n }\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->insert($this->_table,$data);\n \t\t$insert_id=$this->db->insert_id();\n \t\tif($insert_id>0) $errorcode=true;\n \t\telse $errorcode=false;\n\t\t\t}\n\t\t\tlog_message('trace_tizi','170018:Gen email auth code',array('email'=>$email));\n\t\t\tif(!$errorcode) log_message('error_tizi','17018:Gen email auth code failed',array('email'=>$email));\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errorcode=false;\n\t\t}\n\t\treturn array('authcode'=>$authcode,'errorcode'=>$errorcode);\n\t}", "public function passwordResetCode();", "public function getEmailHash()\n {\n return $this->getValue('nb_icontact_prospect_email_hash');\n }", "public function getHash() {}", "function send_auth_code_at_login($user)\n{\n\t$user_info = get_userdata($user);\n\t\n\t$user_login = $user_info->data->user_login;\n\n\t$user_email = $user_info->data->user_email;\t\n\n\t$user_name = $user_info->data->first_name;\t\n\n\t$user_phone = get_user_meta( $user, 'user_phone', true );\n\t//$user_phone = urldecode($u_phone);\n\n\t$user_fname = get_user_meta( $user, 'first_name', true );\n\n\t$code = get_user_meta( $user, 'has_to_be_activated', true );\n\n\t$subject = 'Your New Authentication Code';\n\n\n\t$message1 = \"<html><body style='background:#f3f3f3;padding:20px 0;'><table border='0' cellpadding='0' cellspacing='0' style='margin:auto; max-width: 520px;width:100%;font-family: Arial;padding:20px;background:#fff;'><tbody>\";\n\t$message1 .=\"<tr><td style='font-size: 16px;'>Hello \".ucfirst($user_fname).\",</td></tr><tr height=20></tr>\";\n\t$message1 .=\"<tr><td style='font-size: 16px; line-height: 20px;'>Welcome to Raise it Fast!</td></tr><tr height=30></tr>\";\n\t$message1 .=\"<tr><td style='font-size: 16px; line-height: 20px;'>Please use this code to authenticate your account with Raise it Fast. <span style='background: #aaaaaa none repeat scroll 0 0;height: 45px;text-align: center;width: 101px;'>\".$code.\"</span></td></tr><tr height=20></tr>\";\n\t$message1 .=\"<tr><td style='font-size: 16px; line-height: 20px;'>'If you have any questions or concerns don't hesitate to use our website chat function, call us, or email us by going to our help page at \".site_url('/contact-us/').\" Or, you can simply reply to this email. '</td></tr><tr height=30></tr>\"; \n\t$message1 .=\"<tr><td style='font-size: 16px; margin-top: 20px;'>Thanks for becoming a part of the Raise It Fast community! </td></tr></tbody></table><table border='0' cellpadding='0' cellspacing='0' style='margin:20px auto 0; max-width: 520px;width:100%;'>\"; \n\n\t$message1 .=\"<tr><td style='color: #999999; font-size: 12px; text-align: center;'>1401 Lavaca St #503, Austin, TX 78701</td></tr><tr height=20></tr>\"; \n\t$message1 .=\"<tr><td style='color: #999999; font-size: 12px; text-align: center;'><a href=\".site_url().\" style='text-decoration:none; color: #999999;'>The Raise it Fast Team</a></td></tr>\"; \n\t$message1 .=\"</table></body></html>\";\n\n\twp_mail($user_email, $subject, $message1);\n\n//=========Send Auth Code Via Text message ==================//\n\n\t$account_sid = get_option('twilio_account_sid'); \n\t$auth_token = get_option('twilio_auth_token'); \n //require('lib/twilio-php-latest/Services/Twilio.php');\n\t$client = new Services_Twilio($account_sid, $auth_token); \n //$from = '+12182265630'; \n\t$from = get_option('twilio_phone_no');\n\n\ttry\n\t{\n\t\t$client->account->messages->sendMessage( $from, $user_phone, \"Hello $user_fname, Your Authentication code is $code\");\n\t}\n\tcatch (Exception $e)\n\t{ \n\n\t\techo \"11-\";\n\t}\n}", "public function code() {\n\t\t// transform the secret key to binary data\n\t\t$secret = pack('H*', $this->secret());\n\t\t// compute the cycle number\n\t\t$time = (int) ($this->servertime() / $this->waitingtime());\n\t\t// convert the cycle to a 8 bytes unsigned long big endian order\n\t\t$cycle = pack('N*', 0, $time);\n\t\t// calculate HMAC-SHA1 from secret key and cycle\n\t\t$mac = hash_hmac('sha1', $cycle, $secret);\n\t\t// determine which 4 bytes of the MAC are taken as the current code\n\t\t// last 4 bit of the MAC points to the starting byte\n\t\t$start = hexdec($mac{39}) * 2;\n\t\t// select the byte at starting position and the following 3 bytes\n\t\t$mac_part = substr($mac, $start, 8);\n\t\t$code = hexdec($mac_part) & 0x7fffffff;\n\t\t// use the lowest 8 decimal digits from the selected integer as the\n\t\t// current authenticator code\n\t\treturn str_pad($code % 100000000, 8, '0', STR_PAD_LEFT);\n\t}", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "public function getHash() {\n return md5($this->email . $this->getSalt() . $this->getPassword());\n }", "public function makeHash(\\codename\\core\\credential $credential) : string;", "public static function hash(string $email) : string\n {\n return md5(strtolower($email));\n }", "function render_v_code($email=\"\"){\n $CI = & get_instance();\n $data = array();\n $CI->load->library('encryption');\n $code = bin2hex($CI->encryption->create_key(16));\n $data['v_code'] = array('code'=>$code,'email'=> $email);\n return $data;\n}", "public function generateCodeVerifier() \n {\n return rtrim(base64_encode(md5(microtime())), \"=\");\n }", "static function controlHash($mixed){\n\t\t$data = json_encode($mixed);\n\t\tif(json_last_error()!=JSON_ERROR_NONE) $data = $mixed;\n\t\treturn sha1(md5($data).APP_CONTROL_SECRET);\n\t}", "public function messageHash()\n {\n $customData = json_decode($this->body()[\"custom_data\"], true);\n return $customData[\"message_hash\"];\n }", "public function xss_hash() {\n\t\tif ($this->xss_hash == '') {\n\t\t\tif (phpversion() >= 4.2) mt_srand(); else\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "private function makeContentHash() {\r\n\t\tif (!$this->body) {\r\n\t\t\treturn '';\r\n\t\t} elseif (strlen($this->body) > $this->max_body) {\r\n\t\t\treturn $this->makeBase64Sha256(substr($this->body, 0, $this->max_body));\r\n\t\t} else {\r\n\t\t\treturn $this->makeBase64Sha256($this->body);\r\n\t\t}\r\n\t}", "function xss_hash()\n\t{\n\t\tif ($this->xss_hash == '')\n\t\t{\n\t\t\tif (phpversion() >= 4.2)\n\t\t\t\tmt_srand();\n\t\t\telse\n\t\t\t\tmt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);\n\n\t\t\t$this->xss_hash = md5(time() + mt_rand(0, 1999999999));\n\t\t}\n\n\t\treturn $this->xss_hash;\n\t}", "function onesignin_client_hash($data) {\n if (is_array($data)) {\n $data = implode(':', $data);\n }\n $hash = base64_encode(hash('sha512', $data, TRUE));\n return strtr($hash, array('+' => '-', '/' => '_', '=' => ''));\n}", "public function getHash();", "public function oauthGenerateVerificationCode()\n {\n return substr(md5(rand()), 0, 6);\n }", "public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}", "public function generate_password_activation_code($id,$email){\r\n \r\n \r\n $this->load->helper('string');\r\n \r\n $data = array(\r\n 'forgot_password_code' => random_string('unique'),\r\n 'forgot_password_code_expire' => date('Y-m-d H:i:s',strtotime(\"+24 hours\"))\r\n ); \r\n $this->db->update('members', $data, array('id' => $id,'aes_decrypt(email,salt)' => $email));\r\n $this->db->last_query();\r\n return $data['forgot_password_code'];\r\n }", "final public function getHash() {}", "public function _hash($str) {\n switch ($this->config['algoritmo_criptografia']) {\n case 'sha1':\n return ($str == '') ? '' : sha1($str);\n break;\n case 'crypt':\n return crypt($str);\n break;\n case 'base64':\n return base64_encode($str);\n break;\n case 'plain':\n return $str;\n break;\n case 'md5':\n default:\n return md5($str);\n break;\n }\n }", "public function hashCode() : string;", "function getRandomCode() {\n $code = md5($this->getid_recipient() . $this->getid_offer() . $this->getexpirationdate());\n return $code;\n }", "public static function _get_code($time, $email, $class) {\n $ubit = substr($email, 0, strpos($email, \"@\"));\n $message = $ubit.\"@\".$time.\"-\".$class;\n return openssl_encrypt($message, ConfirmationCode::$encrypt_method, ConfirmationCode::$key, 0, ConfirmationCode::$iv);\n }", "protected function _getEmailHash()\n {\n if (isset($this->_properties['email_hash'])) {\n return md5($this->_properties['email_hash']);\n }\n\n throw new \\Cake\\Error\\FatalErrorException(__d('elabs', 'You should have selected the email_hash field as email alias.'));\n }", "function authCode($r,$extra='')\t{\n\t\t$l=$this->codeLength;\n\t\tif ($this->conf['authcodeFields'])\t{\n\t\t\t$fieldArr = t3lib_div::trimExplode(',', $this->conf['authcodeFields'], 1);\n\t\t\t$value='';\n\t\t\twhile(list(,$field)=each($fieldArr))\t{\n\t\t\t\t$value.=$r[$field].'|';\n\t\t\t}\n\t\t\t$value.=$extra.'|'.$this->conf['authcodeFields.']['addKey'];\n\t\t\tif ($this->conf['authcodeFields.']['addDate'])\t{\n\t\t\t\t$value.='|'.date($this->conf['authcodeFields.']['addDate']);\n\t\t\t}\n\t\t\t$value.=$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];\n\t\t\treturn substr(md5($value), 0,$l);\n\t\t}\n\t}", "function salt_hmac($size1=4,$size2=6) {\n$hprand = rand(4,6); $i = 0; $hpass = \"\";\nwhile ($i < $hprand) {\n$hspsrand = rand(1,2);\nif($hspsrand!=1&&$hspsrand!=2) { $hspsrand=1; }\nif($hspsrand==1) { $hpass .= chr(rand(48,57)); }\nif($hspsrand==2) { $hpass .= chr(rand(65,70)); }\n++$i; } return $hpass; }", "function emailpasswordresetcode($username, $email){\n\t$to=$email;\n\t$errortype = 98;\n\t$errorcode = generateerrorcode($username,$email);\n\t$db=usedb();\n\t//make sure the user provided input is safe\n\t$username=mysqli_real_escape_string($db, $username);\n\t$email=mysqli_real_escape_string($db, $email);\n\t$errorcode=mysqli_real_escape_string($db, $errorcode);\n\t$sql=<<<SQL\n\t\tUPDATE users\n\t\tSET users.PassWord=MD5('$errorcode'), users.ErrorType=$errortype, users.ErrorCode='$errorcode'\n\t\tWHERE (users.UserName='$username' AND users.Email='$email')\nSQL;\n\tmysqli_query($db, $sql);\n\t$rows=mysqli_affected_rows($db);\n\tif(!$rows){\n\t\tmysqli_close($db);\n\t\treturn 0;\n\t}else{//the update was successful so we can try to get the display name and sent the email\n\t\t$sql=<<<SQL\n\t\t\tSELECT users.DisplayName\n\t\t\tFROM users\n\t\t\tWHERE (users.UserName = '$username')\nSQL;\n\t\t$result = mysqli_query($db, $sql);\n\t\t$rows = mysqli_num_rows($result);\n\t\tmysqli_close($db);\n\t\tif(!$rows){\n\t\t\treturn 0;\n\t\t}else{\t//if we have an author with that id\n\t\t\t//get the information in the result\n\t\t\t$assoc = mysqli_fetch_assoc($result);\n\t\t\t$displayname = $assoc['DisplayName'];\n\t\t\t//Send the email\n\t\t\t$subject=\"Collabor8r Password Reset\";\n\t\t\t$helpaddress=emailaddress(\"help\");\n\t\t\t$header=\"From: Collabor8r User Services <$helpaddress>\";\n\t\t\t$text = <<<TEXT\nDear $displayname,\nAs per your request, we have reset your password.\nTemporary Password: $errorcode\nUpon logging in with this password, you will need to change your password to regain access to all of our services.\nThank you for your continued patronage. If you ever have suggestions about our services, please don't hesitate to contact us.\nThe CollaboR8R Team.\nIf you did not request this email, please forward this it to [email protected].\nTEXT;\n\t\t\tmail($to,$subject,$text,$header);\n\t\t\treturn 1;\n\t\t}\n\t}\n\t//if we get past the point, the email didn't get sent so return 0\n\treturn 0;\n}", "public function send_sms_verification_code()\n\t{\n\t\t$user_id = Input::get('userId');\n\t\t$phone_number = Input::get('phoneNumber');\n\n\t\t// check if a verify record already exists\n\t\t$verify_record = $this->notifyRepo->smsVerificationCodeByUserId($user_id);\n\n\t\t// create the code, save it, send to user\n\t\t$verify_record = $this->notifyRepo->smsSendVerifyCode($user_id, $phone_number, $verify_record);\n\n\t\t$result = Twilio::message('+'.$phone_number, 'EriePaJobs - Your verification code is '.$verify_record->verification_code);\n\t}", "private function generateForgotPasswordCode($email)\n {\n try {\n $forgot_password_code = $this->generateRandomString(self::FORGOT_PASSWORD_CODE_LENGTH);\n $db_query = $this->db->prepare(\"UPDATE users SET forgot_password_code=:forgot_password_code \n WHERE email=:email AND verified=1 LIMIT 1\");\n $db_query->bindParam(':forgot_password_code', $forgot_password_code);\n $db_query->bindParam(':email', $email);\n $db_query->execute();\n if ($db_query->rowCount()) {\n return $forgot_password_code;\n }\n } catch (PDOException $e) {\n DBErrorLog::loggingErrors($e);\n return false;\n }\n }", "public function hash($value);", "public function generateHash($email)\n {\n return md5(strtolower(trim($email)));\n }", "public function GetPasswordHash ();", "public function xss_hash()\n {\n if ($this->_xss_hash == '')\n {\n mt_srand();\n $this->_xss_hash = md5(strval(time() + mt_rand(0, 1999999999)));\n }\n\n return $this->_xss_hash;\n }", "function verify_authcode_email($authcode)\n\t{\n\t\t$user_id=$email=$code_type=$user_type=0;\n\t\tif($this->_redis)\n\t\t{\n\t\t\t$data=$this->cache->get($authcode);\t\n\t\t\tif(!empty($data))\n\t\t\t{\n\t\t\t\t$data=json_decode($data);\n\t\t\t\t$user_id=$data->user_id;\n\t\t\t\t$email=$data->email;\n\t\t\t\t$code_type=$data->code_type;\n\t\t\t\t$user_type=$data->user_type;\t\n\t\t\t\t$this->cache->delete($authcode);\n\t\t\t\t$errorcode=true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$errorcode=false;\n\t\t\t\tlog_message('error_tizi','17052:email verify code failed',array('authcode'=>$authcode));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n \t$this->db->select(\"id,user_id,email,code_type,user_type,generate_time\");\n \t$this->db->from($this->_table);\n \t $this->db->where(\"authcode\",$authcode);\n \t$this->db->where(\"has_verified\",0);\n\t\t\t$this->db->where(\"type\",Constant::VERIFY_TYPE_EMAIL);\n \t$query=$this->db->get();\n \t$total=$query->num_rows();\n \t$gen_time=$query->row()->generate_time;\n\t\t\tif($total==1&&date(\"Y-m-d H:i:s\",strtotime($gen_time.\" + \".Constant::AUTHCODE_EXPIRE_EMAIL))>date(\"Y-m-d H:i:s\"))\n \t{\n \t$id=$query->row()->id;\n \t$user_id=$query->row()->user_id;\n \t$email=$query->row()->email;\n\t\t\t\t$code_type=$query->row()->code_type;\n\t\t\t\t$user_type=$query->row()->user_type;\n \t$this->db->where('id',$id);\n \t$this->db->update($this->_table,array('has_verified'=>1,'verified_time'=>date(\"Y-m-d H:i:s\")));\n \tif($this->db->affected_rows()==1) $errorcode=true;\n\t\t\t\telse $errorcode=false;\n \t}\n \telse\n \t{\n \t\t$errorcode=false;\n \t}\n\t\t}\n return array('user_id'=>$user_id,'email'=>$email,'code_type'=>$code_type,'user_type'=>$user_type,'errorcode'=>$errorcode);\n\t}", "function f2($a){\n\n $b=hash('sha256',$a);\n\n return $b;\n\n\n\n }", "public static function reissue_verification() {\n $email = $_POST[\"email\"];\n // Fetch whether the email is verified information\n try {\n $request = DB::query(\"SELECT `Verified` FROM `Users` WHERE `Email`=:email;\", array(\":email\" => $email));\n } catch (PDOException $e) {\n return 1;\n }\n\n // Check if the email is actually registered\n if ($request) {\n $verified_status = $request[0][\"Verified\"];\n // Determine whether the email is verified\n if ($verified_status == 1) {\n // Check if users has a password\n try {\n $pass_request = DB::query(\"SELECT `Password` FROM `Users` WHERE `Email`=:email;\", array(\":email\" => $email));\n } catch (PDOException $e) {\n return 1;\n }\n if ($pass_request) {\n return 3;\n } else {\n return 4;\n }\n } else {\n // Gather required data \n try {\n $username = DB::query(\"SELECT `Username` FROM `Users` WHERE `Email`=:email;\", array(\":email\" => $email))[0][\"Username\"];\n } catch (PDOException $e) {\n return 1;\n }\n $vercode = sha1(time());\n try {\n DB::query(\"UPDATE `Users` SET Vercode=:ver WHERE Email=:email;\", array(\":ver\" => $vercode, \":email\" => $email));\n } catch (PDOException $e) {\n return 1;\n }\n $to = $email;\n $headers = <<<MESSAGE\nFROM: George || [email protected]\nContent-Type: text/plain;\nMESSAGE;\n $subject = \"Verification code re-issue\";\n $msg = <<<EMAIL\nHi $username,\n\nYou've requested for a new verification code to be issued!\nPlease follow this <a href='https://flatdragons.com/signup.php?user=$username&ver=$vercode'>link</a> to confirm your account with us :)\n\nKind regards,\nGeorge (FlatDragons)\nEMAIL;\n mail($to, $subject, $msg, $headers);\n return 0;\n }\n } else {\n return 2;\n }\n }", "public function hashPassword($p)\r\n {\r\n $r = sha1(Yii::$app->params['solt'].$p->password.$p->mail);\r\n return $r;\r\n }", "protected function _getSharingRandomCode()\n {\n return Mage::helper('core')->uniqHash();\n }", "public function hashCode(): string;", "public function mailer($email,$code){\r\n $errors = [];\r\n \r\n $query = \"INSERT INTO resetpassword (code, email) VALUES('$code', '$email')\";\r\n $sendEmail = $this->db->query($query);\r\n return $sendEmail;\r\n }", "function criptografa($str)\r\n\t{\r\n\t\t$str = sha1( md5( sha1 ( md5 ( $str ) ) ) );\r\n\r\n\t\treturn $str; \t\t\r\n\t}", "public function generateConfirmationCode()\n {\n return h(str_random(30));\n }", "function hash_value($text) {\n $saltText = \"AZXCV740884 xs27%^#56635234 ghhtt=-./;'23qAAQWNMM2333\\=4--4005KKGM,,.@##@\";\n return md5($text . $saltText);\n}", "abstract protected static function getHashAlgorithm() : string;", "function return_md5_check()\n\t{\n\t\tif ( $this->member['id'] )\n\t\t{\n\t\t\treturn md5( $this->member['email'].'&'.$this->member['member_login_key'].'&'.$this->member['joined'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn md5(\"this is only here to prevent it breaking on guests\");\n\t\t}\n\t}", "public function codifica($senha)\n {\n $senha = addslashes($senha);\n $key = md5($senha);\n return $key;\n }", "function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }", "public function send($email, $code, $emailId);", "function CreateUserHash() {\n// if (isset($_SERVER['REMOTE_ADDR'])) $remAd = $_SERVER['REMOTE_ADDR'];\n// else $remAd = NULL;\n// if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $forvFor = $_SERVER['HTTP_X_FORWARDED_FOR'];\n// else $forvFor = NULL;\n if (isset($_SERVER['HTTP_USER_AGENT']))\n $userAgent = $_SERVER['HTTP_USER_AGENT'];\n else\n $userAgent = NULL;\n if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))\n $accLang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);\n else\n $accLang = NULL;\n// if (isset($_SESSION['session_id'])) $sesId = $_SESSION['session_id'];\n// else $sesId = NULL;\n // обработка локали\n if ($accLang) {\n if (is_array($accLang))\n $accLang = $accLang[0];\n $pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})' .\n '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)' .\n '(?P<quantifier>\\d\\.\\d))?$/';\n $splits = array();\n preg_match($pattern, $accLang, $splits);\n $accLang = $splits['primarytag'];\n }\n\n //echo '<br>$remAd='.$remAd.' $forvFor='.$forvFor.' $userAgent='.$userAgent.' $accLang='.$accLang;\n return md5($userAgent . $accLang);\n //return md5($remAd.$forvFor.$userAgent.$accLang.$sesId);\n }", "public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}", "public function xss_hash()\n\t{\n\t\tif ($this->_xss_hash === NULL)\n\t\t{\n\t\t\t$rand = $this->get_random_bytes(16);\n\t\t\t$this->_xss_hash = ($rand === FALSE)\n\t\t\t\t? md5(uniqid(mt_rand(), TRUE))\n\t\t\t\t: bin2hex($rand);\n\t\t}\n\n\t\treturn $this->_xss_hash;\n\t}", "private function generate_code(){\n $bytes = random_bytes(2);\n // var_dump(bin2hex($bytes));\n return bin2hex($bytes);\n }", "function getActivationHash(){\n\t\tif(!isset($this->id)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn substr(Security::hash(Configure::read('Security.salt') . $this->field('signup_date') . date('Ymd')), 0, 8);\n\t\t}\n\t}", "static function getHashcode(Order $a_oOrder) {\n return sha1($a_oOrder->getFirstname() . HASH_SECRET . $a_oOrder->getLastname());\n }", "private function hMac($key, $data) {\n return (bin2hex(mhash(MHASH_MD5, $data, $key)));\n }", "public function hash(string $message): string {\n\t\t$alg = $this->getPrefferedAlgorithm();\n\n\t\tif (\\defined('PASSWORD_ARGON2ID') && $alg === PASSWORD_ARGON2ID) {\n\t\t\treturn 3 . '|' . password_hash($message, PASSWORD_ARGON2ID, $this->options);\n\t\t}\n\n\t\tif (\\defined('PASSWORD_ARGON2I') && $alg === PASSWORD_ARGON2I) {\n\t\t\treturn 2 . '|' . password_hash($message, PASSWORD_ARGON2I, $this->options);\n\t\t}\n\n\t\treturn 1 . '|' . password_hash($message, PASSWORD_BCRYPT, $this->options);\n\t}", "public function hash($message) {\n\t\treturn $this->currentVersion . '|' . password_hash($message, PASSWORD_DEFAULT, $this->options);\n\t}", "public function getHash(): string\n {\n return hash_hmac('sha256', $this->token, Config::SECRET_KEY);\n }", "public function getHashIdentifier() : string;", "public function calculate_security_code()\n {\n return sha1($this->get_id() . ':' . $this->get_creation_date());\n }", "public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }", "private function hash_signature ($data) {\n return hash_hmac('sha256', $data, $this->secret);\n }", "public function xssHash() {\n if($this->_xss_hash === null)\n $this->_xss_hash = bin2hex(random_bytes(16));\n \n return $this->_xss_hash;\n }", "function send_authcode_email($authcode,$email,$code_type=0)\n\t{\n\t\t$this->load->library(\"mail\");\n\t\t$this->load->model('login/register_model');\n\t\t$msg_head=$msg_end=$lang=$link=$stuid='';\n\n\t\tif($this->_user_id)\n\t\t{\n\t\t\t$user_info=$this->register_model->get_user_info($this->_user_id);\n\t\t\tif($user_info['errorcode'] && $user_info['user']->student_id)\n\t\t\t{\t\t\n\t\t\t\t$stuid='您的学号是:'.$user_info['user']->student_id.'<br />';\n\t\t\t}\n\t\t}\n\n\t\tswitch($code_type)\n\t\t{\n\t\t\tcase Constant::CODE_TYPE_REGISTER: $link=\"verify\";$lang=\"verify\";break;\n\t\t\tcase Constant::CODE_TYPE_CHANGE_PASSWORD: $link=\"forgot/reset\";$lang=\"reset\";break;\n\t\t\tcase Constant::CODE_TYPE_CHANGE_EMAIL: $link=\"verify\";$lang=\"update_email\";break;\n\t\t\tcase Constant::CODE_TYPE_REGISTER_VERIFY_EMAIL: $link=\"verify\";$lang=\"reg_reverify\";break;\n\t\t\tcase Constant::CODE_TYPE_LOGIN_VERIFY_EMAIL: $link=\"verify\";$lang=\"login_reverify\";break;\n\t\t\tdefault:break;\n\t\t}\n\n\t\tif($lang && $link)\n\t\t{\t\n\t\t\t//$authcode=site_url().$link.\"?code=\".$authcode;\n\t\t\t$authcode=login_url().$link.\"/code/\".$authcode;\n\t\t\t$subject=$this->lang->line('mail_subject_'.$lang);\n\t\t\t$msg_body=str_replace('{email}',$email,$this->lang->line('mail_body_'.$lang));\n\t\t\t\n\t\t\t$msg_body=str_replace('{stuid}',$stuid,$this->lang->line('mail_body_'.$lang));\n\t\t\t$msg_end=$this->lang->line('mail_end_'.$lang);\t\t\t\n\t\t}\n\t\t$msg=$msg_body.'<br /><a href=\"'.$authcode.'\">'.$authcode.'</a><br />'.$msg_end.'<br/>'.$this->lang->line('mail_disclaimer');\n\n\t\t$ret = Mail::send($email, $subject, $msg);\n\t\tif($ret['ret']==1)\n\t\t{\n\t\t\t$errorcode=true;\n\t\t\tlog_message('info_tizi','170101:Email send success',$ret);\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errorcode=false;\n\t\t\tlog_message('error_tizi','17010:Email send failed',$ret);\n\t\t}\n\t\treturn array('errorcode'=>$errorcode,'send_error'=>implode(',',$ret));\n\t}", "public function make_activation_code(){\n\t\t$alphanum = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\t\t return substr(str_shuffle($alphanum), 0, 7);\n\t}", "public function getForgottenPasswordCode() {\n\t\tif ($this->forgotten_password_code) return $this->forgotten_password_code;\n\n\t\t$code = getRandomString(20);\n\n\t\t$db = getDB();\n\t\t$s = $db->prepare(\"UPDATE user_account SET forgotten_password_code=:c, forgotten_password_code_generated_at=:at WHERE id=:id\");\n\t\t$s->execute(array('c'=>$code, 'id'=>$this->id,'at'=>date(\"Y-m-d H:i:s\")));\n\n\t\t$this->forgotten_password_code = $code;\n\t\treturn $code;\n\n\t}", "private function getHash()\n {\n if (isset($this->config['hash']) && $this->config['hash']) {\n return $this->config['hash'];\n } else {\n throw new Exception('Please make sure you have set a code with php artisan code:set ****');\n }\n }", "function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }", "final public function calculateDigestString($data) {}", "public static function hash($data)\r\n {\r\n return Hash::make($data, ['rounds' => 12]);\r\n }", "private function generateMD5Pass() {\n $plaintext = $this->generator->generateString(8, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^+');\n $hash = md5($plaintext);\n return $hash;\n }", "function encode_email($mail, $text=\"\", $class=\"\", $prefix)\n{\n $encmail =\"\";\n for($i=0; $i<strlen($mail); $i++)\n {\n $encMod = rand(0,2);\n switch ($encMod) {\n case 0: // None\n $encmail .= substr($mail,$i,1);\n break;\n case 1: // Decimal\n $encmail .= \"&#\".ord(substr($mail,$i,1)).';';\n break;\n case 2: // Hexadecimal\n $encmail .= \"&#x\".dechex(ord(substr($mail,$i,1))).';';\n break;\n }\n }\n $encprefix =\"\";\n for($i=0; $i<strlen($prefix); $i++)\n {\n $encMod = rand(0,2);\n switch ($encMod) {\n case 0: // None\n $encprefix .= substr($prefix,$i,1);\n break;\n case 1: // Decimal\n $encprefix .= \"&#\".ord(substr($prefix,$i,1)).';';\n break;\n case 2: // Hexadecimal\n $encprefix .= \"&#x\".dechex(ord(substr($prefix,$i,1))).';';\n break;\n }\n }\n\n if(!$text)\n {\n $text = $encmail;\n }\n $encmail = $prefix.$encmail;\n return \"<a class='$class' href='$encmail'>$text</a>\";\n}", "function hash_clients_pass($pass){\n\t//Get pepper options\n\t// require_once 'api-config.php';\n\n\t// echo \"<br>SHIT<br> \". getPepper() . \"<br>\";\n\t// $pepper = getPepper() ;\n\n\t$config_options = getConfigOptions();\n\n\t$pepper = $config_options['pepper'];\n\t$cost = $config_options['peppercost'];\n\n\t$hashedPass = password_hash($pass.$pepper, PASSWORD_DEFAULT, $cost);\n\n\treturn $hashedPass;\n}", "protected function calculateHash()\n {\n return md5((string)$this->toCookie());\n }", "public static function sendCode(Request $request){\n $rules = [\n 'email' => 'required|email|exists:users,email',\n ];\n $validator = Validator::make(request()->all(),$rules);\n $validation_errors = $validator->errors();\n if($validator->fails()){\n\n result(401,$validation_errors->first(), null);\n }\n else{\n $email = request('email');\n $verify_code = rand(1000,9000);\n User::where('email',request('email'))->update(['status'=>null,'verify_code'=>$verify_code]);\n $data = [\n 'email'=>$email,\n 'code'=>$verify_code\n ];\n if(SendEmailController::mail($data) == true){\n result(200 ,null,null);\n }\n }\n }", "public function get_email_hash( $email = '' ) {\n $email = sanitize_email( $email );\n return md5( strtolower( $email ) );\n }", "function sendAccountVerificationEmail($name, $email, $hash)\n{\n $to = $email;\n $subject = 'Activate your Camagru account';\n $message = '\n \n Hello '.$name.'!\n Your Camagru account has been created. \n \n Please click this link to activate your account:\n http://localhost:8100/index.php?action=verify&email='.$email.'&hash='.$hash.'\n \n ';\n \n $headers = 'From:[email protected]' . \"\\r\\n\";\n mail($to, $subject, $message, $headers);\n}" ]
[ "0.735452", "0.7132213", "0.68649954", "0.6802998", "0.66499317", "0.6533919", "0.64821035", "0.6438898", "0.643793", "0.638476", "0.6375428", "0.6375428", "0.6375428", "0.6375428", "0.6339105", "0.63275915", "0.63200986", "0.6263297", "0.6253808", "0.6242658", "0.6240387", "0.62231773", "0.6189188", "0.61806417", "0.61606866", "0.61521095", "0.61366045", "0.6124585", "0.61242944", "0.6117235", "0.6102941", "0.61026514", "0.6096196", "0.60891706", "0.6084185", "0.60828096", "0.6067072", "0.6053518", "0.6043014", "0.60426664", "0.6020618", "0.6001261", "0.59857535", "0.59827685", "0.5982477", "0.5964569", "0.5963047", "0.59532124", "0.5941374", "0.5936188", "0.59236133", "0.59183437", "0.5915468", "0.5914948", "0.5912901", "0.5906468", "0.5905425", "0.59052384", "0.59026074", "0.59010166", "0.58973503", "0.5895002", "0.58934414", "0.5884921", "0.58848155", "0.5883721", "0.5868719", "0.58685493", "0.5863467", "0.5860591", "0.5857226", "0.5856092", "0.5851368", "0.5844377", "0.5841965", "0.5828707", "0.5827897", "0.5802689", "0.5798861", "0.57986766", "0.57922256", "0.5790769", "0.5787524", "0.5787413", "0.5780264", "0.577761", "0.5776473", "0.57747144", "0.5773111", "0.5764385", "0.57564354", "0.5748126", "0.5743873", "0.57424784", "0.5741164", "0.5740612", "0.5740394", "0.573299", "0.5732356", "0.57310843" ]
0.6897291
2
if an item is not provided it selects the table primary key and returns number of rows else it returns the item selected
public function data_count($where_id=null, $item=null){ if($item!=null){ $this->db->select($item); }else{ $this->db->select($this::$table_pk); } $this->db->from($this::$table_name); if($where_id!=null){ $this->db->where($where_id); } $query = $this->db->get(); if($item==null){ return $query->num_rows(); }else{ return $query; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_item_id(){\n $this->db->select('itemID')->from('item')->where('itemID', );\n $query = $this->db->get();\n \n if($query->num_rows() == 1)\n {\n $row = $query->row(0);\n return $row->itemID;\n }\n }", "function getNumItems($db, $resource_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nSELECT COUNT(i.item_pk)\r\nFROM {$prefix}item i\r\nWHERE (i.resource_link_pk = :resource_pk)\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n $query->execute();\r\n\r\n $row = $query->fetch(PDO::FETCH_NUM);\r\n if ($row === FALSE) {\r\n $num = 0;\r\n } else {\r\n $num = intval($row[0]);\r\n }\r\n\r\n return $num;\r\n\r\n }", "function checkItem($item, $table, $value){\n global $con;\n \n $stmt2 = $con->prepare(\"Select $item From $table WHERE $item=? \");\n \n $stmt2->execute(array($value));\n \n $resultNum = $stmt2->rowCount();\n \n return $resultNum;\n}", "function countItem($item ,$table ){\n global $con;\n $stmt = $con->prepare(\"SELECT count($item) FROM $table \");\n $stmt->execute();\n return $stmt->fetchColumn();\n}", "function countitem($item, $table){\r\n\tglobal $con;\r\n\t$stmt2 = $con->prepare(\"SELECT COUNT('$item') FROM $table\");\r\n\t$stmt2->execute();\r\n\t return $stmt2->fetchColumn();\r\n}", "function countitems($item ,$table) {\n\t\tglobal $con;\n\t\t$stmt2 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n $stmt2->execute();\n\n return $stmt2->fetchColumn();\n\t}", "function item_count($item) {\n\t$db = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n\tswitch ($item) {\n\t\tcase 1: $table = \"movies\"; break;\n\t\tcase 2: $table = \"actors\"; break;\n\t\tcase 3: $table = \"directors\"; break;\n\t\tcase 4: $table = \"studios\"; break;\n\t}\n\n\ttry {\n\t\t$result = mysqli_query($db, \"SELECT COUNT(id) FROM $table\");\n\t\t$row = mysqli_fetch_array($result);\n\t\tmysqli_close($db);\n\t} \n\tcatch (Exception $e) {\n\t\techo \"Data could not be retrieved from the database.\";\n\t\tmysqli_close($db);\n\t\texit();\n\t}\n\n\treturn $row[0];\n}", "function countItems($item,$table) {\n\n global $con;\n $stmt2 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n\n $stmt2->execute();\n\n return $stmt2->fetchColumn();\n }", "function countItem($item, $table, $condition = null){\n \n global $con;\n \n if($condition === null){\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n $stmt3->execute();\n }\n else{\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table WHERE $item=?\");\n $stmt3->execute(array($condition));\n } \n \n return $stmt3->fetchColumn();\n}", "function checkitem($select, $dbtable, $value) {\r\n\tglobal $con;\r\n\t$statement = $con->prepare(\" SELECT $select FROM $dbtable WHERE $select = ? \");\r\n\t$statement->execute(array($value));\r\n\t$count = $statement->rowCount();\r\n\treturn $count;\r\n\r\n}", "public function getRowNumber()\n {\n $this->sql_query->count($this->tableName);\n $result = $this->sql_query->getSingleResult();\n return $result[0];\n }", "public function getPrimaryKey() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (isset($this->_result[0])) return (int) $this->_result[0];\n\t\t\telse parent::throwGetColException('PollTemplatesModel::getPrimaryKey', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('PollTemplatesModel::getPrimaryKey', __LINE__, __FILE__);\n\t}", "function checkItem($select,$from,$value){\n global $con ;\n\n $statement = $con-> prepare(\"SELECT $select FROM $from WHERE $select= ?\");\n \n $statement->execute(array($value));\n\n $count = $statement->rowCount(); \n\n return $count;\n }", "function countItems($items, $table) {\n global $con;\n $stmt2 = $con->prepare(\"SELECT COUNT($items) FROM $table\");\n $stmt2->execute();\n return $stmt2->fetchColumn();\n}", "function checkItem($select, $from, $value){\r\n\r\n global $con;\r\n\r\n $statement = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\r\n\r\n $statement->execute(array($value));\r\n\r\n $count = $statement->rowCount();\r\n\r\n return $count;\r\n\r\n}", "function checkItem($select,$from,$value){\n global $con;\n $statment = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n $statment->execute(array($value));\n $count = $statment->rowCount();\n return $count;\n\n}", "function CheckItem($select, $from, $value){\n global $con;\n $statement = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n $statement ->execute(array($value));\n $count = $statement->rowCount();\n return $count;\n}", "function checkItem($select,$from,$value){\n global $con;\n $statement=$con->prepare(\"SELECT $select FROM $from WHERE $select= ?\");\n $statement->execute(array($value));\n $count =$statement->rowCount();\n return $count; \n}", "function getPrimaryKey () {\n\t\t\n\t\t$count = $this->find('count');\n\t\t\n\t\t$primaryKey = $count+1;\n\t\t\n\t\tif( $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey))) > 0) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t$i = (int) $count;\n\n while ( $i >= 1 ) {\n\n $i += 1;\n\t\t\t\t\t\n\t\t\t\t\t$primaryKey = $i;\n \n\t\t\t\t\t$returnValue = $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey)));\n\n if ($returnValue == 0) {\n \t\t\t\t\t\t\t\t\t\n break;\n }\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n }\n\n return $primaryKey;\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\treturn $primaryKey;\n\n\t\t}\t\n\t\n\t}", "function checkItem($select, $from, $value){\n\n global $con;\n\n $statement = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n\n $statement->execute(array($value));\n\n $count = $statement->rowCount();\n\n return $count;\n}", "function countItem($column,$table){\n\n global $con;\n $stmt = $con->prepare(\"SELECT COUNT($column) FROM $table\");\n $stmt->execute();\n return $stmt->fetchcolumn();\n}", "function getVisibleItemsCount($db, $resource_pk) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n $sql = <<< EOD\r\nSELECT COUNT(i.item_pk) count\r\nFROM {$prefix}item i\r\nWHERE (i.resource_link_pk = :resource_pk) AND (i.visible = 1)\r\nEOD;\r\n\r\n $query = $db->prepare($sql);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_STR);\r\n $query->execute();\r\n\r\n $row = $query->fetch(PDO::FETCH_NUM);\r\n if ($row === FALSE) {\r\n $num = 0;\r\n } else {\r\n $num = intval($row[0]);\r\n }\r\n\r\n return $num;\r\n\r\n }", "public function getPrimaryKey() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (isset($this->_result[0])) return (int) $this->_result[0];\n\t\t\telse parent::throwGetColException('ProjectsListingsModel::getPrimaryKey', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('ProjectsListingsModel::getPrimaryKey', __LINE__, __FILE__);\n\t}", "function getPrimaryKey() {\n\n $count = $this->find('count');\n $primaryKey = $count + 1;\n\n if ($this->find('count', array('conditions' => array($this->name . '.' . $this->primaryKey => $primaryKey))) > 0) {\n\n $i = (int) $count;\n\n while ($i >= 1) {\n\n $i += 1;\n\n $primaryKey = $i;\n\n $returnValue = $this->find('count', array('conditions' => array($this->name . '.' . $this->primaryKey => $primaryKey)));\n\n if ($returnValue == 0) {\n\n break;\n }\n\n $i++;\n }\n\n return $primaryKey;\n } else {\n\n return $primaryKey;\n }\n }", "public static function createItemID(){\n $db = db_conx::getInstance();\n $req = $db->prepare('SELECT ItemID FROM Item ORDER BY ItemID DESC LIMIT 1');\n $req->execute();\n $tempID = $req->fetch();\n return $tempID['ItemID']+1;\n }", "public function getPrimaryKey() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (isset($this->_result[0])) return (int) $this->_result[0];\n\t\t\telse parent::throwGetColException('DiscussCategoriesModel::getPrimaryKey', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('DiscussCategoriesModel::getPrimaryKey', __LINE__, __FILE__);\n\t}", "public function key()\n\t{\n\t\tif (is_a($this->rs,'iterator'))\n\t\t{\n\t\t\treturn $this->rs->key();\n\t\t}\n\t\treturn 0;\n\t}", "function checkitem($select,$from,$value){\n global $con;\n $stmt1 = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n $stmt1->execute(array($value));\n $count = $stmt1->rowCount();\n return $count;\n }", "function check_item($select, $from, $value){\r\n global $con;\r\n $stmt=$con->prepare(\"SELECT $select FROM $from WHERE $select=?\");\r\n $stmt->execute(array($value));\r\n $count=$stmt->rowcount();\r\n return $count;\r\n }", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "public function get_first_item_id(): int {\n\t\t\treturn LP_Course_DB::getInstance()->get_first_item_id( $this->get_id() );\n\t\t}", "function check_if_exist($item, $table, $value){\n global $con;\n\n $checkIfExist = $con->prepare(\"Select $item From $table WHERE $item=? \");\n\n $checkIfExist->execute(array($value));\n\n $checkResult = $checkIfExist->rowCount();\n\n return $checkResult;\n}", "function countItems($select, $tblName ,$where = NULL , $and = NULL)\n{\n global $conn;\n $countStmt = $conn->prepare(\"SELECT COUNT($select) FROM $tblName $where $and\");\n $countStmt ->execute();\n // numbers of col retreived\n return $countStmt ->fetchColumn();\n\n}", "public abstract function row_count();", "function count()\n {\n $retval = 0;\n $key = $this->object->get_primary_key_column();\n $results = $this->object->run_query(\"SELECT COUNT(`{$key}`) AS `{$key}` FROM `{$this->object->get_table_name()}`\");\n if ($results && isset($results[0]->{$key})) {\n $retval = (int) $results[0]->{$key};\n }\n return $retval;\n }", "function numRecord($tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT id FROM '.$tabla.' '.$where);\n\treturn mysql_num_rows($query);\n}", "function numRecord($tabla,$where){\n\t$query=$GLOBALS['cn']->query('SELECT id FROM '.$tabla.' '.$where);\n\treturn mysql_num_rows($query);\n}", "public function getPrimaryKey() {\n\t\tif ((bool) $this->_result) {\n\t\t\tif (isset($this->_result[0])) return (int) $this->_result[0];\n\t\t\telse parent::throwGetColException('CampaignDefinitionsModel::getPrimaryKey', __LINE__, __FILE__);\n\t\t}\n\t\telse return parent::throwNoResException('CampaignDefinitionsModel::getPrimaryKey', __LINE__, __FILE__);\n\t}", "public function exec_SELECTgetSingleRow() {}", "abstract function getPrimaryKey();", "function MenuItemExists($item_id) \n\t{\n\t\t\t//use sprintf to make sure that $item_id is inserted into the query as a number - to prevent SQL injection\n\t\t\t$query = sprintf(\"SELECT * FROM MenuItem WHERE ItemID = %d;\",\n\t\t\t\t\t\t\t$item_id); \n\n\t\t\t$db = connect_db();\t\t\t\t\t\t\n\n\t\t\t$rows = mysqli_num_rows ( mysqli_query($db, $query));\t\t\t\n\n\t\t\tclose_db($db);\n\n\t\t\treturn $rows;\n\t\t\t\n\t}", "public function selectMinKey(): ?int;", "public function key($item);", "function GetPK($table) {\n $this->query = \"SELECT PK FROM metatabla WHERE lower(Nombre)='\".strtolower($table).\"'\";\n\n $this->consulta($this->query);\n if ($this->num_rows() > 0) { \n $this->rs01 = $this->fetch_row();\n $pk = $this->rs01[0];\n $this->cerrarConsulta();\n return $pk;\n }else{\n return false;\n }\t\n\t}", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "abstract public function getRowId($rowEntity);", "function select($item,$table,$s_cul=0,$value=0){\r\n global $con;\r\n $query=$con->prepare(\"SELECT $item FROM $table where $s_cul=? \");\r\n $query->execute(array($value));\r\n $content=$query->fetchall();\r\n return $content;\r\n}", "public function totalNumRows()\n {\n try {\n\n $sql = 'SELECT DISTINCT gil.id_item\n FROM geocontexter.gc_item AS gil\n '.$this->_sql_tables.'\n WHERE gil.title ILIKE ?\n '.$this->_sql_in_id_list;\n\n $res = $this->query($sql, array($this->search . '%'));\n return (int)count($res);\n\n } catch(\\Exception $e) {\n throw $e;\n }\n }", "public function key() {\n\t\t$this->checkResultSet();\n\n\t\tif (! is_null($this->keyColumn)) {\n\t\t\t$row = $this->fetchRowAssoc($this->index, true);\n\t\t\treturn $row[$this->keyColumn];\n\t\t}\n\n\t\treturn $this->index;\n\t}", "public function get_rows(){ return $count = count($this->prod_id); }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function selectMaxKey(): ?int;", "public abstract function GetNumRows();", "function idData($table){\n $array=get($table,'id');\n $id=max($array)+1;\n return $id;\n }", "function Aulaencuesta_Get_Total_Items_In_table() \n{\n global $DB;\n $sql = \"SELECT count(*) as items FROM mdl_aulaencuesta\";\n return $DB->get_record_sql($sql, null);\n}", "public function firstKey(): ?int;", "public function checkrow(){\n return $this->select->num_rows;\n }", "public function rowCount(): int\n {\n }", "public function rowCount();", "public function rowCount();", "private function _fetch_primary_key()\n {\n if($this->primaryKey == NULl)\n {\n $this->primaryKey = $this->db->query(\"SHOW KEYS FROM `\".$this->_table.\"` WHERE Key_name = 'PRIMARY'\")->row()->Column_name;\n }\n }", "public function single_row($item)\n {\n }", "public function single_row($item)\n {\n }", "public function single_row($item)\n {\n }", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $result = $db->query($sql);\n return($db->fetch_assoc($result));\n }\n}", "function RowCount() {}", "function getItemid() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$user = & JFactory::getUser() ;\r\n\t\t$sql = \"SELECT id FROM #__menu WHERE link LIKE '%index.php?option=com_osmembership%' AND published=1 AND `access` IN (\".implode(',', $user->getAuthorisedViewLevels()).\") ORDER BY `access`\";\t\t\t\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$itemId = $db->loadResult();\t\t\r\n\t\tif (!$itemId) {\r\n\t\t\t$Itemid = JRequest::getInt('Itemid');\r\n\t\t\tif ($Itemid == 1)\r\n\t\t\t\t$itemId = 999999 ;\r\n\t\t\telse \r\n\t\t\t\t$itemId = $Itemid ;\t\r\n\t\t}\t\t\t\r\n\t\treturn $itemId ;\t\r\n\t}", "public function get_row();", "function getTableLength($table, $where=\"\"){\n return sqlSelectOne(\"SELECT COUNT(*) as count FROM $table $where\", 'count');\n}", "function checkitems($select , $from , $value) {\n\n\t\tglobal $con; // To use var at any place in any function\n\n\t\t$statment = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n\n\t\t$statment->execute(array($value));\n\n\t\t$count = $statment->rowCount();\n\n\t\treturn $count;\n\t}", "public function rowCounter($table,$id_field){\n\t\t$query=\"SELECT \".$id_field.\" FROM \".$table;\n\t\t$numRows=$this->rows($query);\n\t\treturn $numRows;\n\t}", "public function get_row_count() {\n return 0;\n }", "public function rowCount() {}", "function getRowById($table ,$rowID, $ID, $Limit){\n global $conn;\n if(is_numeric($ID)){\n $stmt = $conn->prepare(\"SELECT * FROM \". $table .\" WHERE \". $rowID .\" = ? LIMIT \".$Limit);\n $stmt->execute(array($ID));\n $row = $stmt->fetch();\n if($row){\n return $row;\n }\n else{\n return false;\n }\n } else{\n return false;\n }\n}", "abstract public function getNumRows();", "abstract public function getNumRows();", "function GetSelectedValue($mysqli) {\n $item = 0;\n if ($result = $mysqli->query(\"SELECT id, title, subject FROM dogs WHERE persons_id = \" . $_SESSION['PersonID'])) {\n while ($row = $result->fetch_row()) {\n $SelectedItems[$item++] = $row[0];\n }\n }\n return $SelectedItems;\n}", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "function get_count_data($columnName, $tblname, $whereColumn, $passingParam) {\n global $dbf;\n $sql = \"SELECT COUNT($columnName) as count FROM $tblname WHERE $whereColumn='$passingParam'\";\n $countVal = $dbf;\n $countVal->query($sql);\n $countVal->next_record();\n \n $rowValue = $countVal->rowdata();\n\t$countValue = $rowValue['count'];\n \n return $countValue;\n}", "public function fetchNrRecordsToGet();", "static Public function MdlAsignarNumSalida($tabla, $item, $valor){\n \n if($item !=null){ \n\t\t// SELECT MAX(id) AS id FROM productos // SELECT MAX(num_salida) AS num_salida FROM hist_salidas\n //$stmt=Conexion::conectar()->prepare(\"SELECT * FROM $tabla ORDER BY id DESC limit 1\");\n $stmt=Conexion::conectar()->prepare(\"SELECT MAX(num_salida)+1 AS num_salida FROM $tabla\");\n\n $stmt->execute();\n\t\t\n return $stmt->fetch();\n \n \t}else{\n\n\t\t\treturn false;\n\n\t } \n \n \n $stmt=null;\n }", "public function itemCount(): int;", "public function getRowNumber() {\n if($this->result) {\n return mysql_num_rows($this->result);\n }\n return 0;\n }", "public function rows(){\n return $this->rowNum(\"SELECT * FROM Anuncios\");\n }", "public function count_Row($columnCount,$condition,$table){\n\n if($condition != \"\"){\n\n\t\t\t\t $stmt = $this->dbstatus->prepare(\"Select \".$columnCount.\" From \".$table.\" WHERE \".$condition.\"\");\n\n\t\t\t $stmt->execute();\n\n\t\t\t if($stmt->rowCount() > 0){\n\n\t\t\t $get = $stmt->fetchObject();\n\n\t\t\t\t return $get->$columnCount;\n\n\t\t\t }else{\n\n\t\t\t\t return 0;\n\n\t\t\t }\n\n\n\t\t}else{\n\n\t\t\t $stmt = $this->dbstatus->prepare(\"Select \".$columnCount.\" From \".$table.\"\");\n\n\t\t\t $stmt->execute();\n\n\t\t\t if($stmt->rowCount() > 0){\n\n\t\t\t\t $get = $stmt->fetchObject();\n\n\t\t\t\t return $get->$columnCount;\n\n\t\t\t }else{\n\n\t\t\t\t return 0;\n\n\t\t\t }\n\n\t\t}\n\n}", "function count_by_id($table){\n global $db;\n if(tableExists($table))\n {\n $sql = \"SELECT COUNT(id) AS total FROM \".$db->escape($table);\n $sql_result = $db->query($sql);\n return $db->fetch_assoc($sql_result);\n }\n else\n return NULL;\n}", "function count()\n {\n $this->object->select($this->object->get_primary_key_column());\n $retval = $this->object->run_query(FALSE, FALSE, FALSE);\n return count($retval);\n }", "public function PK($table_name){\n $PK = DB::select('SELECT FNC_GETPK(\"'.$table_name.'\");');\n foreach ($PK as $value) {\n $result = $value;\n }\n foreach ($result as $id) {\n $result = $id; // primary key\n }\n\n return $id;\n }", "public function key() {\n\t\treturn( $this->_currentRow );\n\t}", "public function getIdItem() {\n return intval($this->idItem);\n }", "function getItemById($itemID) {\n global $dbh;\n $stmt = $dbh->prepare(\"SELECT * FROM ITEM WHERE itemID = ?\");\n $stmt->execute(array($itemID));\n return $stmt->fetch();\n }", "public function getItem($id, $param=\"idProductItem\"){\n $id = (int) $id;\n $data = array($param => $id);\n $rowset = $this->tableGateway->select($data);\n $row = $rowset->current();\n return $row;\n }", "public function key() : int\n {\n return $this->currentRecordPos - ($this->pageSize * ($this->currentPagePos-1));\n }", "public function numberOfRows();", "public function get_key($row) {\n return null;\n }", "function get_num_records()\n\t{\n\t\t$this->sql = 'SELECT COUNT(*) FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\treturn db_getOne($this->sql, $this->use_db);\n\t}" ]
[ "0.66218126", "0.6581721", "0.6491302", "0.6453247", "0.64065826", "0.6366521", "0.6364417", "0.6330881", "0.63084316", "0.6238034", "0.61580825", "0.6111172", "0.61093473", "0.60998243", "0.60863197", "0.60805136", "0.60751444", "0.60621405", "0.60535985", "0.6028714", "0.5997403", "0.59927434", "0.59918594", "0.59858143", "0.59624845", "0.5941903", "0.5894286", "0.589115", "0.5862269", "0.5862081", "0.58546215", "0.58454293", "0.5814333", "0.5797681", "0.5781624", "0.5767918", "0.5767918", "0.57411176", "0.5739858", "0.57311285", "0.57233906", "0.5712472", "0.5707528", "0.57071996", "0.5702018", "0.5702018", "0.5698026", "0.56731313", "0.56474113", "0.564674", "0.56352144", "0.5616206", "0.5616206", "0.5616206", "0.56001705", "0.5570716", "0.5566846", "0.5565972", "0.5549666", "0.5538781", "0.5528615", "0.5517596", "0.5517596", "0.5517091", "0.5497858", "0.5497344", "0.5497344", "0.54910886", "0.5466703", "0.546443", "0.5455615", "0.5454132", "0.5445104", "0.5443149", "0.5442531", "0.5433215", "0.5429193", "0.5425027", "0.5425027", "0.54248714", "0.5424149", "0.5424149", "0.54235977", "0.542048", "0.5410029", "0.5406231", "0.5401111", "0.5398091", "0.5397033", "0.5394945", "0.53932995", "0.53906274", "0.5389652", "0.53876215", "0.5379894", "0.537665", "0.5367424", "0.53624934", "0.5359313", "0.5356261" ]
0.6239255
9
Get the primary keys for inserting and updating data in question table
protected function question_where(){ return $array = array('exam_id'=>trim($this->input->post('exam_id')), 'category_id'=>trim($this->input->post('category_id')), 'body_id'=>trim($this->input->post('body_id')), 'subject_id'=>trim($this->input->post('subject_id')), 'period_id'=>trim($this->input->post('period_id')), 'question_number'=>trim($this->input->post('question_number')), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getPrimaryKeys()\n {\n return array('bookId', 'languageId');\n }", "function getPrimaryKeys() {\n \treturn $this->db->getPrimaryKeys($this->table);\n }", "public function schemaPK() {\n return $this->primaryKeyArray;\n }", "public function schemaPK() {\n return $this->primaryKeyArray;\n }", "protected function _getPrimaryKeyAttributes(){\n\t\treturn ActiveRecordMetaData::getPrimaryKeys($this->_source, $this->_schema);\n\t}", "public static function getPrimaryKeys()\n {\n return array('bookId');\n }", "public static function getPrimaryKeys()\n {\n return array('bindingId');\n }", "public function getPrimaryKeys();", "public function getPrimaryKeys();", "public function getPrimaryKey()\n {\n $pk = [];\n foreach ($this->fields as $col) {\n if ($col->isPrimaryKey()) {\n $pk[] = $col;\n }\n }\n\n return $pk;\n }", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getSessionid();\n $pks[1] = $this->getRecno();\n $pks[2] = $this->getOrderno();\n\n return $pks;\n }", "public function getPrimaryKey(): array\n {\n return $this->primaryKey;\n }", "public function getPrimaryKeys()\n\t{\n\t\treturn $this->primary_keys;\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn array('id');\n\t}", "public static function getIdentifierFields() {\n\t\treturn self::$PRIMARY_KEYS;\n\t}", "public static function getIdentifierFields() {\n\t\treturn self::$PRIMARY_KEYS;\n\t}", "public static function getIdentifierFields() {\n\t\treturn self::$PRIMARY_KEYS;\n\t}", "function pk_key() {\r\n\t\t$c = 0;\r\n\t\tfor($i = 0; $i < count ( $this->fields ); $i ++) {\r\n\t\t\tif ($this->fields [$i] ['PK'] == 'yes') {\r\n\t\t\t\t$pk_key [$c] = $this->fields [$i] ['VAR'];\r\n\t\t\t\t$c ++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $pk_key;\r\n\t}", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getSekolahId();\n $pks[1] = $this->getSemesterId();\n\n return $pks;\n }", "public function getPrimaryKeys()\n\t{\n\t\treturn array_keys($this->getArrayCopy());\n\t}", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getPhadtype();\n $pks[1] = $this->getPhadid();\n $pks[2] = $this->getPhadsubid();\n $pks[3] = $this->getPhadsubidseq();\n $pks[4] = $this->getPhadcont();\n\n return $pks;\n }", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getSekolahId();\n $pks[1] = $this->getSemesterId();\n $pks[2] = $this->getIdRuang();\n $pks[3] = $this->getHari();\n\n return $pks;\n }", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getId();\n $pks[1] = $this->getNickname();\n\n return $pks;\n }", "public function getPrimaryKeyValues() {\n\t\treturn array(\n\t\t\tself::FIELD_ID=>$this->getId());\n\t}", "public function getPrimaryKey()\n {\n $pks = array();\n $pks[0] = $this->getShnttype();\n $pks[1] = $this->getShntseq();\n $pks[2] = $this->getShntkey2();\n $pks[3] = $this->getShntform();\n\n return $pks;\n }", "public function getPrimaryKeyAttributes(){\n\t\t$this->_connect();\n\t\treturn $this->_getPrimaryKeyAttributes();\n\t}", "public function PK($table_name){\n $PK = DB::select('SELECT FNC_GETPK(\"'.$table_name.'\");');\n foreach ($PK as $value) {\n $result = $value;\n }\n foreach ($result as $id) {\n $result = $id; // primary key\n }\n\n return $id;\n }", "private function findPrimaryKeyFields(): array\n {\n $sql = <<<SQL\nWITH schema_ns AS\n(\n SELECT\n oid relnamespace\n FROM \n pg_namespace\n WHERE\n nspname = :schema\n),\ntbl_class AS\n(\n SELECT\n oid tblclassid\n FROM\n pg_class\n WHERE\n relname = :table\n AND\n relnamespace = (\n SELECT\n relnamespace\n FROM\n schema_ns\n )\n),\nindexs AS\n(\n SELECT\n indexrelid\n FROM\n pg_index\n WHERE\n indrelid = (\n SELECT\n tblclassid\n FROM\n tbl_class\n )\n AND\n indisprimary = 't'\n),\npk AS\n(\n SELECT\n attname primary_key\n FROM\n pg_attribute\n WHERE\n attrelid = (\n SELECT\n indexrelid\n FROM \n indexs\n )\n)\n\nSELECT primary_key FROM pk\n\nSQL;\n\n $sth = $this->db->prepare($sql);\n $sth->execute(\n [\n ':table' => $this->table->getName(),\n ':schema' => $this->table->getSchema()\n ]);\n\n $fetched = $sth->fetchAll(PDO::FETCH_OBJ);\n\n $rtn = [];\n\n foreach ( $fetched as $fObj )\n {\n $rtn[] = $fObj->primary_key;\n }\n\n return $rtn;\n }", "function getPrimaryKeys($table) {\n $resource = $this->getColumns($table);\n $primary = NULL;\n if ($resource) {\n while ($row = $this->row($resource)) {\n if ($row['Key'] == 'PRI') {\n $primary[] = $row['Field'];\n }\n }\n }\n return $primary;\n }", "public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}", "public function getPkValues() {\n $pkValues = array();\n foreach ($this->entity as $columnName => $column) {\n if (!empty($column['contraint']) && $column['contraint'] === 'pk')\n $pkValues[$columnName] = $column['value'];\n }\n\n return $pkValues;\n }", "public function getPrimaryKey()\n\t{\n $indexes = $this->getIndexes();\n\n foreach ($indexes as $index){\n if ($index['Key_name'] == \"PRIMARY\"){\n return $index;\n }\n }\n\n \t\t\n\t}", "public function getPrimaryKeys($tableName)\n {\n $sqlStm = \"SELECT COLUMN_NAME as columnName, DATA_TYPE as dataType FROM information_schema.columns\n WHERE TABLE_NAME = ? AND TABLE_SCHEMA = ?\n AND COLUMN_KEY = 'PRI'\";\n \n $query = new DataQuery($sqlStm);\n $params = array();\n $params[] = new DataParameter('tableName', DataParameter::TYPE_VARCHAR , $tableName);\n $params[] = new DataParameter('schema', DataParameter::TYPE_VARCHAR , $this->schema);\n return $this->query($query, $params);\n }", "public function primary_key()\n\t{\n\t\treturn $this->primary_key;\n\t}", "public function getPrimaryKeyValues() {\n\t\treturn array(\n\t\t\tself::FIELD_CODI_ESPECTACLE=>$this->getCodiEspectacle(),\n\t\t\tself::FIELD_DATA=>$this->getData(),\n\t\t\tself::FIELD_HORA=>$this->getHora());\n\t}", "public function get_primary_row(){\r\n $result = $this->db->query(\"SHOW KEYS FROM \". $this->db->formatTableName($this->table). \"\r\n WHERE Key_name = %s\"\r\n , \"PRIMARY\");\r\n $pk = \"\";\r\n foreach ($result as $res){\r\n $pk = $res[\"Column_name\"];\r\n }\r\n return $pk;\r\n }", "function GetPrimaryKeys($fields) {\r\n \t$keys = array();\r\n for ($i = 0; $i < count($fields); $i++) {\r\n \tif ($fields[$i]['key'] == 'PRI') {\r\n\t \t$keys[] = $fields[$i]['name'];\r\n }\r\n }\r\n\r\n return $keys;\r\n }", "public function primaryKey()\n {\n return $this->set('primary_key', true);\n }", "public function primary_key(){\n $table_columns = $this->meta();\n\n $primary_key_column = NULL;\n foreach ($table_columns as $col) :\n if($col->primary_key):\n $primary_key_column = $col->name;\n endif;\n endforeach;\n\n return $primary_key_column; \n }", "public function getReturnEntirePrimaryKeys()\n {\n return $this->return_entire_primary_keys;\n }", "function get_inserts() {\n\t\t $attributes = $this->quoted_attributes();\n\n\t\t $inserts = array();\n\t\t foreach($attributes as $key => $value) {\n\t\t\t if(!in_array($key, $this->primary_keys) || ($value != \"''\")) {\n\t\t\t\t $inserts[$key] = $value;\n\t\t\t }\n\t\t }\n\t\t return $inserts;\n\t }", "protected function _getPrimaryKey(){\n $def = $this->_getDef();\n foreach($def as $column){\n if($column['primary'] === true){\n return $column['field_name'];\n }\n }\n \n return false;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_activ' => $this->iid_activ, 'id_asignatura' => $this->iid_asignatura, 'id_nom' => $this->iid_nom);\n }\n return $this->aPrimary_key;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_nom' => $this->iid_nom, 'id_nivel' => $this->iid_nivel);\n }\n return $this->aPrimary_key;\n }", "function get_primary_key_column()\n {\n return $this->object->_primary_key_column;\n }", "abstract public function getPrimaryKey();", "abstract public function getPrimaryKey();", "public function getPrimaryKey()\n\t{\n\t\treturn array('application_value_id');\n\t}", "abstract function getPrimaryKey();", "public function _getUpdateKeys() {\n return array(Model_Fields_PracticeFieldCoordinatorDB::DB_COLUMN_ID => $this->{Model_Fields_PracticeFieldCoordinatorDB::DB_COLUMN_ID});\n }", "protected function findPrimaryKeys($table)\n\t{\n\t\t$pks=$this->getDbConnection()->getPdoInstance()->cubrid_schema(PDO::CUBRID_SCH_PRIMARY_KEY,$table->name);\n\n\t\tforeach($pks as $pk)\n\t\t{\n\t\t\t$c = $table->columns[$pk['ATTR_NAME']];\n\t\t\t$c->isPrimaryKey = true;\n\n\t\t\tif($table->primaryKey===null)\n\t\t\t\t$table->primaryKey=$c->name;\n\t\t\telseif(is_string($table->primaryKey))\n\t\t\t\t$table->primaryKey=array($table->primaryKey,$c->name);\n\t\t\telse\n\t\t\t\t$table->primaryKey[]=$c->name;\n\t\t\tif($c->autoIncrement)\n\t\t\t\t$table->sequenceName='';\n\t\t}\n\t}", "public function getPrimaryKey()\n\t{\n\t\treturn array('stat_track_id', 'application_id', 'stat_name_id');\n\t}", "function get_fields_pk()\n\t{\n\t\t$fields_pk\t=\tarray();\n\t\t$fields\t\t=\t$this->_get_fields();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tif ( $field->primary_key == '1' )\n\t\t\t{\n\t\t\t\t$fields_pk[]->name\t= $field->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields_pk;\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_situacion' => $this->iid_situacion);\n }\n return $this->aPrimary_key;\n }", "public function getPkNames() {\n $pkNames = array();\n foreach ($this->entity as $columnName => $column) {\n if ($column['contraint'] == 'pk')\n $pkNames[] = $columnName;\n }\n\n return $pkNames;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_ubi' => $this->iid_ubi, 'id_tarifa' => $this->iid_tarifa, 'year' => $this->iyear, 'id_serie' => $this->iid_serie);\n }\n return $this->aPrimary_key;\n }", "function get_primary_key_column()\n {\n return $this->_primary_key_column;\n }", "public function getPrimaryKey()\n {\n return $this->getOpPrimeId();\n }", "public function getPrimaryKey()\n {\n $cols = $this->info('cols');\n return $cols[0];\n }", "public function getPrimaryKey() {\n return $this->_data->getDeepValue('indexes/primary/columns/0', null);\n }", "public function getPrimaryKey();", "public function getPrimaryKey();", "public function getPrimaryKey();", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_item' => $this->iid_item);\n }\n return $this->aPrimary_key;\n }", "public function getPrimaryKeyValues() {\n\t\treturn array(\n\t\t\tself::FIELD_ID_CHAT=>$this->getIdChat());\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('id_dl' => $this->iid_dl);\n }\n return $this->aPrimary_key;\n }", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "private function _fetch_table_primary_key()\n {\n if ($this->primary_key == null) {\n $this->primary_key = preg_replace('/(_m|_model)?$/', '', strtolower(get_class($this))) . '_id';\n }\n }", "public static function primaryKey()\n {\n return ['id'];\n }", "public static function primaryKey()\n {\n return ['id'];\n }", "public static function getPrimaryKeys()\n {\n $type = static::getType();\n return $type::getPrimaryKeys();\n }", "public function pkName()\r\n {\r\n $schema = $this->schema();\r\n foreach($schema as $col){\r\n if( $col['PRIMARY'] === true )\r\n return $col['FIELD'];\r\n }\r\n throw new \\Exception( __CLASS__ .\" Error: could not find Primary Key for table: \" . $this->table->name() ); \r\n }", "protected function _getNonPrimaryKeyAttributes(){\n\t\treturn ActiveRecordMetaData::getNonPrimaryKeys($this->_source, $this->_schema);\n\t}", "public function getPrimaryKey()\r\n\t{\r\n\t\treturn $this->primaryKey;\r\n\t}", "public function getPrimaryKey($tableName)\n\t{\n\t\tif (Cache::has('getPrimaryKey', $tableName)) {\n\t\t\treturn Cache::get('getPrimaryKey', $tableName);\n\t\t}\n\t\t$key = [];\n\t\tif ('mysql' === $this->getDriverName()) {\n\t\t\t$tableKeys = $this->getTableKeys($tableName);\n\t\t\t$key = isset($tableKeys['PRIMARY']) ? ['PRIMARY' => array_keys($tableKeys['PRIMARY'])] : [];\n\t\t}\n\t\tCache::save('getPrimaryKey', $tableName, $key, Cache::LONG);\n\t\treturn $key;\n\t}", "public static function primaryKey()\n {\n return ['_id'];\n }", "protected function loadPrimaryKeys()\n {\n $identifier = $this->getTable()->getIdentifier();\n if (is_array($identifier))\n {\n foreach ($identifier as $_key)\n {\n $this->primaryKey[] = new sfDoctrineAdminColumn($_key);\n }\n } else {\n $this->primaryKey[] = new sfDoctrineAdminColumn($identifier);\n }\n\n if (!empty($this->primaryKeys))\n {\n throw new sfException('You cannot use the admin generator on a model which does not have any primary keys defined');\n }\n }", "public function getPrimaryKey()\n {\n return $this->primaryKey;\n }", "private static function _getPrimaryKeyConstraints(DomElement $parent)\n {\n // Primary key constraints.\n $pks = $parent->getElementsByTagName('primary-key');\n\n $primaryKeys = array();\n foreach ($pks as $pk) {\n $current = array();\n $current['name'] = $pk->getAttribute('name');\n $current['COLUMNS'] = array();\n\n $columns = $pk->getElementsByTagName('column');\n foreach ($columns as $column) {\n $current['COLUMNS'][] = $column->nodeValue;\n }\n\n $primaryKeys[] = $current;\n }\n\n return $primaryKeys;\n\n }", "protected function getPkeyDef() {\n foreach($this->tabledef as $key => $table) {\n $sql = \"SELECT\";\n $sql .= ' c.relname as \"Table\"';\n $sql .= ', a.attname as \"Column\"';\n $sql .= \" FROM\";\n $sql .= \" pg_constraint n\";\n $sql .= \" INNER JOIN pg_class c ON\";\n $sql .= \" n.conrelid = c.oid\";\n $sql .= \" INNER JOIN pg_attribute a ON\";\n $sql .= \" a.attrelid = c.oid\";\n $sql .= \" WHERE\";\n $sql .= \" a.attnum = ANY(n.conkey)\";\n $sql .= \" AND c.relname = '\".$table[\"Name\"].\"'\";\n $sql .= \" AND n.contype = 'p'\";\n $sql .= \" ORDER BY a.attnum;\";\n $stmt = $this->db->query($sql);\n $this->pkeydef[$key] = $stmt->fetchAll();\n }\n }", "public function getPrimaryKey()\n\t{\n\t\treturn $this->_rowKey;\n\t}", "function getPrimary_key()\n {\n if (!isset($this->aPrimary_key)) {\n $this->aPrimary_key = array('nivel_stgr' => $this->inivel_stgr);\n }\n return $this->aPrimary_key;\n }", "public static function primaryKey()\n {\n return static::PRIMARY_KEY;\n }", "public function getPrimaryKey()\n\t\t{\n\t\t\treturn array('cfe_rule_condition_id');\n\t\t}", "private function alterPrimaryKey()\n {\n if(is_array($this->primaryKeyValue)){\n // check for auto increment\n $autoIncrement = $this->primaryKeyValue['auto_increment'];\n if($autoIncrement){\n $increment = \" AUTO_INCREMENT, AUTO_INCREMENT=1\";\n }\n\n $this->addCollectionQuery(\n \"\n --\n -- AUTO_INCREMENT for table `{$this->tableName}`\n --\n ALTER TABLE `{$this->tableName}`\n MODIFY {$this->createColumnDefinition($this->primaryKeyValue)}{$increment};\n \"\n );\n }\n }", "public function getPrimaryKeyColumnsList(){\n return $this->_get(4);\n }", "public function getPrimaryKey() {\n\t\treturn $this->_key_primary->name;\n\t}", "public function keys()\n {\n return array('id');\n }", "public function keys()\n {\n return array('id');\n }", "protected function _getPrimaryIdKey()\n {\n if ($this->_primaryIdKey == null) {\n $info = $this->_getTable()->info();\n\n $this->_primaryIdKey = (string) array_shift($info[Zend_Db_Table_Abstract::PRIMARY]);\n }\n\n return $this->_primaryIdKey;\n }", "private function getPrimaryKey()\n {\n $result = database()->fetchResult('SHOW KEYS FROM ' . $this->table . ' WHERE Key_name = \"PRIMARY\"');\n\n return ($result['Column_name'] ?? null);\n }", "public function PKArray() {\n $returnvalue = array();\n $returnvalue['DeterminationID'] = $this->getDeterminationID();\n return $returnvalue;\n }", "public function getPrimaryKey()\n\t\t{\n\t\t\treturn array('cfe_event_id');\n\t\t}", "function getPrimaryKey () {\n\t\t\n\t\t$count = $this->find('count');\n\t\t\n\t\t$primaryKey = $count+1;\n\t\t\n\t\tif( $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey))) > 0) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t$i = (int) $count;\n\n while ( $i >= 1 ) {\n\n $i += 1;\n\t\t\t\t\t\n\t\t\t\t\t$primaryKey = $i;\n \n\t\t\t\t\t$returnValue = $this->find('count',array('conditions'=>array($this->name . '.' . $this->primaryKey=>$primaryKey)));\n\n if ($returnValue == 0) {\n \t\t\t\t\t\t\t\t\t\n break;\n }\n\t\t\t\t\t\n\t\t\t\t\t$i++;\n }\n\n return $primaryKey;\n\t\t\t\n\t\t} else {\n\t\t\n\t\t\treturn $primaryKey;\n\n\t\t}\t\n\t\n\t}", "public function getTablePrimaryKeys($tableName)\n {\n if (!isset($this->keys[$tableName])) {\n $this->loadColumnInfo($tableName);\n }\n\n return $this->keys[$tableName];\n }", "public function getPrimaryKey()\n {\n return $this->getPothnbr();\n }", "public function getPrimaryKey()\n {\n return $this->getid();\n }", "public function getPrimaryKey()\n\t{\n\t\treturn $this->getCoParticipante();\n\t}", "public function _getUpdateKeys() {\n return array(Model_Fields_FieldDB::DB_COLUMN_ID => $this->{Model_Fields_FieldDB::DB_COLUMN_ID});\n }" ]
[ "0.7347381", "0.7268588", "0.71443194", "0.71443194", "0.7141243", "0.7138833", "0.70871645", "0.70129", "0.70129", "0.69788516", "0.6932864", "0.69272524", "0.68959665", "0.6890431", "0.68387425", "0.68387425", "0.68387425", "0.6803143", "0.6798513", "0.673616", "0.6735893", "0.67312336", "0.67064786", "0.66683656", "0.66489136", "0.6593739", "0.6585556", "0.6551393", "0.6524206", "0.64688355", "0.64688355", "0.6448348", "0.6443162", "0.64254624", "0.64077914", "0.6407304", "0.6400669", "0.63801515", "0.6364086", "0.63594323", "0.63549906", "0.6352037", "0.6341933", "0.6329214", "0.6311395", "0.62994057", "0.6294417", "0.6294417", "0.62841386", "0.62768", "0.62581354", "0.62549424", "0.6254324", "0.6252513", "0.62442505", "0.6242924", "0.6238613", "0.62382877", "0.6225058", "0.62035936", "0.6189426", "0.61760324", "0.61760324", "0.61760324", "0.614565", "0.614565", "0.6139544", "0.61353797", "0.6133731", "0.6133731", "0.6132263", "0.6132263", "0.6112835", "0.61080116", "0.6097075", "0.60965747", "0.60930276", "0.6087391", "0.6082474", "0.6060194", "0.605911", "0.6054688", "0.60540175", "0.60340303", "0.60131085", "0.6012526", "0.6011901", "0.59704685", "0.59670746", "0.5962791", "0.5962791", "0.5934332", "0.5932115", "0.5932074", "0.5916269", "0.590548", "0.5905119", "0.5903199", "0.58982795", "0.58975863", "0.5893818" ]
0.0
-1
Contains the consumer's TypoScript This method is used to pass a TypoScript configuration (in array form) to the Data Consumer
public function setTypoScript(array $conf) { $this->conf = $conf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadTypoScriptConfig()\n {\n $sysPageObj = GeneralUtility::makeInstance('t3lib_pageSelect');\n if (!$GLOBALS['TSFE']->sys_page) {\n $GLOBALS['TSFE']->sys_page = $sysPageObj;\n }\n $rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);\n $TSObj = GeneralUtility::makeInstance('t3lib_tsparser_ext');\n $TSObj->tt_track = 0;\n $TSObj->init();\n $TSObj->runThroughTemplates($rootLine);\n $TSObj->generateConfig();\n $conf = $TSObj->setup['plugin.']['Tx_Formhandler.']['settings.'];\n $this->tsConf = $conf;\n }", "protected function RTEtsConfigParams() {}", "abstract protected function getTypoScriptSetup();", "public function getTsConfig() {}", "abstract public function getTypoScriptSetup() ;", "public function getTypoScriptSetup() {}", "public function getTypoScriptSetup() {}", "public function getTypoDescender() {}", "public function getDataGridPluginConfig();", "private function _Config() {\n $data['ttcConfig'] = $this->cNavMenuBuilder->Config();\n return $data;\n }", "public function getTSConfig() {}", "function setConfig() {\n\n\t\t\t// Mapping array for PI flexform\n\t\t\t$flex2conf = array(\n\t\t\t\t'news' => 'sDEF:news',\n\t\t\t\t'days' => 'sDEF:days',\n\t\t\t\t'darkdesign' => 'sDEF:dark',\n\t\t\t\t'show_last' => 'sDEF:show_last',\n\t\t\t\t'order_by' => 'sDEF:listOrderBy',\n\t\t\t\t'asc_desc' => 'sDEF:ascDesc',\n\t\t\t\t'category_mode' => 'sDEF:categoryMode',\n\t\t\t\t'category' => 'sDEF:categorySelection',\n\t\t\t\t'sideTop' => 'sSIDE:blog',\n\t\t\t\t'sideTopTitle' => 'sSIDE:blogTitle',\n\t\t\t\t'sideTopText' => 'sSIDE:blogText',\n\t\t\t\t'sideTopImage' => 'sSIDE:blogImage',\n\t\t\t\t'sideMiddle' => 'sSIDE:reader',\n\t\t\t\t'sideMiddleTitle' => 'sSIDE:readerTitle',\n\t\t\t\t'sideMiddleText' => 'sSIDE:readerText',\n\t\t\t\t'sideMiddleImage' => 'sSIDE:readerImage',\n\t\t\t\t'sideBottom' => 'sSIDE:bottom',\n\t\t\t\t'sideBottomTitle' => 'sSIDE:bottomTitle',\n\t\t\t\t'swfParams.' => array(\n\t\t\t\t\t'loop' => 'sFLASH:loop',\n\t\t\t\t\t'menu' => 'sFLASH:menu',\n\t\t\t\t\t'quality' => 'sFLASH:quality',\n\t\t\t\t\t'scale' => 'sFLASH:scale',\n\t\t\t\t\t'bgcolor' => 'sFLASH:bgcolor',\n\t\t\t\t\t'swliveconnect' => 'sFLASH:swliveconnect',\n\t\t\t\t),\n\t\t\t\t'playerParams.' => array(\n\t\t\t\t\t'timer' => 'sPLAYER:timer',\n\t\t\t\t\t'transition' => 'sPLAYER:transition',\n\t\t\t\t\t'random' => 'sPLAYER:random',\n\t\t\t\t\t'navigation' => 'sPLAYER:navigation',\n\t\t\t\t),\n\t\t\t\t'width' => 'sFLASH:width',\n\t\t\t\t'height' => 'sFLASH:height',\n\t\t\t\t'version' => 'sFLASH:version',\n\t\t\t);\n\n\t\t\t// Ovverride TS setup with flexform\n\t\t\t$this->conf = $this->api->fe_mergeTSconfFlex($flex2conf,$this->conf,$this->piFlexForm);\n\n\t\t\t$this->conf['swfParams.']['width'] = $this->conf['width'];\n\t\t\t$this->conf['swfParams.']['height'] = $this->conf['height'];\n\t\t\t$this->conf['swfParams.']['wmode'] = $this->conf['wmode'];\n \t\t//$this->conf['width'] = 512;\n\t\t\t//$this->conf['height'] = 265;\n\t\t\t//$this->conf['wmode'] = 'opaque';\n\t\t\t// DEBUG ONLY - Output configuration array\n\t\t\t#$this->api->debug($this->conf,'MP3 Player: configuration array');\n\t\t}", "protected function buildTypolinkConfiguration() {}", "public function configuration()\n {\n\n return array(\n 'uniquename' => 'text',\n 'extension' => '.txt',\n 'type' => 'text',\n 'viewable' => true,\n 'removable' => true,\n 'installable' => false,\n 'executable' => true,\n 'keepdata' => true\n );\n }", "public function __construct() {\n //--------------------------------------------------------------------GENERAL\n\t $this->configurationOptions[\"default_note_naming\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"list\",\n\t\t \"options\" => [\"C\"=>\\JText::_(\"MYSONGBOOKS_NOTENAMING_C\"),\"Do\"=>\\JText::_(\"MYSONGBOOKS_NOTENAMING_DO\")],\n\t\t \"default\" => \"C\",\n\t\t \"required\" => true,\n\t\t \"width\" => 180\n\t ];\n\t /*\n $this->configurationOptions[\"dummy_types\"] = [\n \"group\" => \"general\",\n \"type\" => \"text\",\n \"validation\" => \"#^[a-z0-9]+(,[a-z0-9]+)*$#i\",\n \"default\" => \"type-1, type-2, type-3\",\n \"required\" => false\n ];\n\n\t $this->configurationOptions[\"list_maker\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"userlist\",\n\t\t \"default\" => json_encode([\"opt1\", \"opt2\", \"opt3\"]),\n\t\t \"required\" => false\n\t ];\n\n\t $this->configurationOptions[\"counter\"] = [\n\t\t \"group\" => \"general\",\n\t\t \"type\" => \"number\",\n\t\t \"default\" => 5,\n\t\t \"min\" => 0,\n\t\t \"max\" => 10,\n\t\t \"required\" => true,\n\t\t \"width\" => 80\n\t ];*/\n\n //--------------------------------------------------------------------ADVANCED\n $this->configurationOptions[\"show_button_sync_db\"] = [\n \"group\" => \"advanced\",\n \"type\" => \"list\",\n \"options\" => [\"Y\"=>\\JText::_(\"MYSONGBOOKS_YES\"),\"N\"=>\\JText::_(\"MYSONGBOOKS_NO\")],\n \"default\" => \"N\",\n \"required\" => true,\n \"width\" => 80\n ];\n\n //auto-setting translated labels & descriptions\n $STRBASE = str_replace(\"com_\", \"\", COMPONENT_ELEMENT_NAME_MYSONGBOOKS) . \"_CFG_PARAM_\";\n foreach($this->configurationOptions as $k => &$a) {\n if(!isset($a[\"label\"])) {\n $a[\"label\"] = \\JText::_(strtoupper($STRBASE.\"NAME_\".$k));\n }\n if(!isset($a[\"description\"])) {\n $a[\"description\"] = \\JText::_(strtoupper($STRBASE.\"DESC_\".$k));\n }\n }\n }", "public function getUserConfiguredElementTyposcript() {}", "public function config()\n {\n $errors = [];\n $values = [];\n\n if ($this->request->isPost()) {\n $values = $this->request->getValues();\n\n $validation_errors = $this->validateValues($values);\n\n if (!$validation_errors) {\n $values['human_name'] = $this->fixHumanName($values['human_name']); \n $machine_name = $this->createMachineName($values['human_name']);\n $beauty_name = $this->beautyName($values['human_name']);\n $values['machine_name'] = $machine_name;\n $values['beauty_name'] = $beauty_name;\n $type_id = $this->db->table(MetadataTypeModel::TABLE)->persist($values);\n if ($type_id) {\n $this->flash->success(t('Metadata type created successfully.'));\n } else {\n $this->flash->failure(t('Error saving the metadata type. Retry.'));\n }\n } else {\n $errors = $validation_errors;\n $this->flash->failure(t('There are errors in your submission.'));\n }\n }\n\n $metadataTypes = $this->metadataTypeModel->getAll();\n\n $this->response->html($this->helper->layout->config('MetaMagik:config/metadata_types', [\n 'values' => $values,\n 'errors' => $errors,\n 'types' => $metadataTypes,\n 'title' => t('Settings').' &gt; '.t('Custom Fields'),\n ]));\n }", "function hook_kiosque_actor_configure($type, $configuration, $context, $touch = false) {}", "function domainbox_getConfigArray()\n{\n $configArray = array(\"Reseller\" => array(\"Type\" => \"text\", \"Size\" => \"20\", \"Description\" => \"Enter your reseller name here\",), \"Username\" => array(\"Type\" => \"text\", \"Size\" => \"20\", \"Description\" => \"Enter your username here\",), \"Password\" => array(\"Type\" => \"password\", \"Size\" => \"20\", \"Description\" => \"Enter your password here\",), \"TestMode\" => array(\"Type\" => \"yesno\",),);\n return $configArray;\n}", "private function array_ts($conf){\n return $conf;//TODO\n }", "public function settingsData() {\n\n $arraySettings = array (\n 'Generic Param' => $this->_genericParam\n );\n\n return $arraySettings;\n\n }", "private function setUpTwitterData() {\n $plugin_id = 1;\n $namespace = OptionDAO::PLUGIN_OPTIONS . '-' .$plugin_id;\n $builder_plugin_option1 =\n FixtureBuilder::build('options',\n array('namespace' => $namespace, 'option_name' => 'oauth_consumer_key', 'option_value' => 'token'));\n $builder_plugin_option2 =\n FixtureBuilder::build('options',\n array('namespace' => $namespace, 'option_name' => 'oauth_consumer_secret', 'option_value' => 'secret'));\n return array($builder_plugin_option1, $builder_plugin_option2);\n }", "public function getDataWithTypeParameters() {}", "public function getConfigData() {\n\t\treturn array(\n\t\t\t'storageType' => StorageFactory::TYPE_DUMMY,\n\t\t\t'debuggerDisabled' => $this->debuggerDisabled,\n\t\t);\n\t}", "protected function getTypeFieldConfig()\n {\n return [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'groupsConfig' => [\n 'filewithattachment' => [\n 'values' => ['filewithattachment'],\n 'indexes' => [\n CustomOptions::CONTAINER_TYPE_STATIC_NAME,\n self::FIELD_ATTACHMENT_INFO_NAME,\n self::FIELD_ATTACHMENT_LABEL_NAME,\n self::FIELD_ATTACHMENT_PATH_NAME,\n \\Magento\\Catalog\\Ui\\DataProvider\\Product\\Form\\Modifier\\CustomOptions::FIELD_FILE_EXTENSION_NAME\n ]\n ]\n ],\n ],\n ],\n ],\n ];\n }", "public function render()\n\t{\n\t\t$config = json_decode(file_get_contents(JPATH_CONFIGURATION . '/config.json'));\n\n\t\t// @todo Twig can not foreach() over stdclasses...\n\t\t$cfx = ArrayHelper::fromObject($config);\n\n\t\t$this->renderer->set('config', $cfx);\n\n\t\treturn parent::render();\n\t}", "public function backend_builder_data() {\n\t\t$script = FUSION_BUILDER_DEV_MODE ? 'fusion_builder_app_js' : 'fusion_builder';\n\t\twp_localize_script(\n\t\t\t$script,\n\t\t\t'fusionDynamicData',\n\t\t\t[\n\t\t\t\t'dynamicOptions' => $this->get_params(),\n\t\t\t\t'commonDynamicFields' => $this->get_common(),\n\t\t\t]\n\t\t);\n\t}", "public function add_custom_template_type() \n\t{\n\t\t$custom_templates = ee()->extensions->last_call;\n\t\t\n\t\tforeach( $this->settings AS $ext=>$template_dataset ) {\n\t\t\n\t\t\t$custom_templates[\"$ext\"] = array('template_name' \t\t\t=> $template_dataset['template_name'],\n\t\t\t\t\t\t\t\t\t\t 'template_file_extension' => $template_dataset['template_file_ext'],\n\t\t\t\t\t\t\t\t\t\t 'template_headers' => $template_dataset['template_headers']);\n\t\t}\n\t\treturn $custom_templates;\n\t\t\n\t}", "abstract protected function configs(): array;", "public function getConfigArray() {}", "final public function dataset_config() {\n\t\t\t$param = getRequest('param');\n\n\t\t\t$childMap = array('methods'=>'method', 'types'=>'type', 'stoplist'=>'exclude', 'default'=>'column', 'fields' => 'field');\n\n\t\t\t$datasetConfig = $this->getDatasetConfiguration($param);\n\n\t\t\t$document = new DOMDocument();\n\t\t\t$document->encoding = \"utf-8\";\n\n\t\t\t$root\t = $document->createElement('dataset');\n\t\t\t$document->appendChild($root);\n\n\t\t\tif(is_array($datasetConfig)) {\n\t\t\t\t$objectTypes = umiObjectTypesCollection::getInstance();\n\n\t\t\t\tforeach($datasetConfig as $sectionName => $sectionRecords) {\n\t\t\t\t\t$section = $document->createElement($sectionName);\n\t\t\t\t\t$root->appendChild($section);\n\t\t\t\t\tif(is_array($sectionRecords)) {\n\t\t\t\t\t\tforeach($sectionRecords as $record) {\n\t\t\t\t\t\t\t$element = $document->createElement($childMap[$sectionName]);\n\t\t\t\t\t\t\tif(is_array($record)) {\n\t\t\t\t\t\t\t\tforeach($record as $propertyName => $propertyValue) {\n\t\t\t\t\t\t\t\t\tif($propertyName === \"#__name\") {\n\t\t\t\t\t\t\t\t\t\t$element->appendChild( $document->createTextNode($propertyValue) );\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif($propertyName == \"id\" && !is_numeric($propertyValue)) {\n\t\t\t\t\t\t\t\t\t\t$propertyValue = $objectTypes->getTypeIdByHierarchyTypeName(get_class($this), $propertyValue);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$element->setAttribute($propertyName, is_bool($propertyValue) ? ($propertyValue ? \"true\" : \"false\") : $propertyValue );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$element->appendChild( $document->createTextNode($record) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$section->appendChild($element);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$section->appendChild( $document->createTextNode($sectionRecords) );\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$buffer = \\UmiCms\\Service::Response()\n\t\t\t\t->getCurrentBuffer();\n\t\t\t$buffer->contentType('text/xml');\n\t\t\t$buffer->charset('utf-8');\n\t\t\t$buffer->push($document->saveXML());\n\t\t\t$buffer->end();\n\t\t}", "public function convertNestedToValuedConfigurationDataProvider() {}", "public function run()\n {\n ProviderType::insert(\n array(\n ['name' => 'Mayorista','question_registration'=>'¿Eres mayorista?'],\n ['name' => 'Exportador','question_registration'=>'¿Eres exportador?'],\n ['name' => 'Fabricante','question_registration'=>'¿Eres fabricante?'],\n ['name' => 'Importador','question_registration'=>'¿Eres Importador?'],\n )\n );\n }", "public function setTypoScript(array $conf)\n {\n $this->typoScriptConfiguration = $conf;\n }", "public function dataProvider() {\n return [\n [2, []],\n [1, ['multiple_file_display_type' => 'sources']],\n ];\n }", "public function __construct()\n {\n // get global configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['roadworks']);\n if (is_array($extConf) && count($extConf)) {\n // call setter method foreach configuration entry\n foreach($extConf as $key => $value) {\n $methodName = 'set' . ucfirst($key);\n if (method_exists($this, $methodName)) {\n $this->$methodName($value);\n }\n }\n }\n }", "protected function initTypoScriptConfiguration() {\n\t\t$GLOBALS['TSFE']->getPageAndRootline();\n\t\t$GLOBALS['TSFE']->initTemplate();\n\t\t$GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;\n\t\t$GLOBALS['TSFE']->getConfigArray();\n\t\treturn $this;\n\t}", "public function getEditorConfigJSON(){\r\n\t\t//load config from default\r\n\t\t$config = Mage::getSingleton('cms/wysiwyg_config')->getConfig(\r\n\t\t\tarray('tab_id' => 'form_section'));\r\n\t\t$config['add_images'] \t\t= true;\r\n\t\t$config['directives_url']\t= Mage::helper('adminhtml')->getUrl('adminhtml/cms_wysiwyg/directive');//replace $this->getUrl = Mage::helper('adminhtml') to generate secret key\r\n\t\t$config['files_browser_window_url']\t= $this->getUrl('adminhtml/cms_wysiwyg_images/index');\r\n\t\t$config['width']\t \t\t= '990px';\r\n\t\t/*Attach CSS file from selected template*/\r\n\t\t$config['content_css']\t= $this->getSkinUrl('ves_advancedpdfprocessor/default.css');\r\n\t\tif($apiKey = Mage::registry('key_data')){\r\n\t\t\t$template = Mage::getModel('advancedpdfprocessor/template')->load($apiKey->getTemplateId());\r\n\t\t\t$config['content_css']\t.= ','.$this->getSkinUrl($template->getData('css_path'));\r\n\t\r\n\t\t\t/*Body class*/\r\n\t\t\t$config['body_class']\t= $template->getSku();\r\n\t\t}\r\n\t\t$config[\"widget_window_url\"] = Mage::getSingleton('adminhtml/url')->getUrl('advancedpdfprocessor/adminhtml_widget/index');\r\n\t\t$plugins = $config->getData('plugins');\r\n\t\t$plugins[0][\"options\"][\"url\"] = '';\r\n\t\t$plugins[0][\"options\"][\"onclick\"][\"subject\"] = \"MagentovariablePlugin.loadChooser('{{html_id}}');\";\r\n\r\n\t\t/*Add Easy PDF plugin*/\r\n/*\t\t$plugins[] = array(\r\n\t\t\t'name'\t\t=> 'easypdf',\r\n\t\t\t'src'\t\t=> $this->getJsUrl('ves_advancedpdfprocessor/tiny_mce/plugins/easypdf/editor_plugin.js'),\r\n\t\t\t'options'\t=> array('logo_url'=>$this->getJsUrl('ves_advancedpdfprocessor/tiny_mce/plugins/easypdf/images/logo_bg.gif')),\r\n\t\t);\r\n*/\r\n\t\t$config->setData('plugins' , $plugins);\r\n\t\treturn Zend_Json::encode($config);\r\n\t}", "public function setup()\n {\n \t// rtConfig::set('your-key', $your_value);\n }", "public function loadConfig(){\n\t\t\n\t\t$opt[] = [\n\t\t\t'method' => 'setFormParams',\n\t\t\t'value'=>$this->paramsLoad(3, \\sevian\\s::getReq('command_idx'), \\sevian\\s::getReq('unit_idx'))\n\t\t\t\n\t\t];\n\t\t$this->info = $opt;//$form->getInfo();\n\t}", "public function getDataConfig()\n {\n return $this->params;\n }", "public function config()\n {\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), null, 'ORDER BY id');\n $out = array();\n foreach ($rows as $i => $row) {\n $fields = new Tempcode();\n $hidden = new Tempcode();\n $fields->attach($this->get_fields('_' . strval($i), get_translated_text($row['c_title']), get_translated_text($row['c_description']), $row['c_enabled'], $row['c_cost'], $row['c_one_per_member'], get_translated_text($row['c_mail_subject']), get_translated_text($row['c_mail_body'])));\n $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('_GUID' => '01362c21b40d7905b76ee6134198a128', 'TITLE' => do_lang_tempcode('ACTIONS'))));\n $fields->attach(form_input_tick(do_lang_tempcode('DELETE'), do_lang_tempcode('DESCRIPTION_DELETE'), 'delete_custom_' . strval($i), false));\n $hidden->attach(form_input_hidden('custom_' . strval($i), strval($row['id'])));\n $out[] = array($fields, $hidden, do_lang_tempcode('_EDIT_CUSTOM_PRODUCT', escape_html(get_translated_text($row['c_title']))));\n }\n\n return array($out, do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'), $this->get_fields(), do_lang_tempcode('CUSTOM_PRODUCT_DESCRIPTION'));\n }", "public function getConfigurationProvider() {\n\t\tif (!$this->configurationProvider) {\n\t\t\t$this->configurationProvider = $this->get('Cundd\\\\Rest\\\\Configuration\\\\TypoScriptConfigurationProvider');\n\t\t}\n\t\treturn $this->configurationProvider;\n\t}", "public function generate_data() {\n\t\t$this->data = $this->get_registered_post_types();\n\t}", "public function getDoc(): array\n\t{\n\t\treturn [\n\t\t\t'shortdesc' => 'Create custom post type service class.',\n\t\t\t'synopsis' => [\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'label',\n\t\t\t\t\t'description' => 'The label of the custom post type to show in WP admin.',\n\t\t\t\t\t'optional' => false,\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'plural_label',\n\t\t\t\t\t'description' => 'The plural label for the custom post type. Used for label generation. If not specified, the plural will be an \"s\" appended to the singular label.', // phpcs:ignore Generic.Files.LineLength.TooLong\n\t\t\t\t\t'optional' => false,\n\t\t\t\t\t'default' => $this->getDefaultArg('plural_label'),\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'slug',\n\t\t\t\t\t'description' => 'The custom post type slug. Example: location.',\n\t\t\t\t\t'optional' => false,\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'rewrite_url',\n\t\t\t\t\t'description' => 'The custom post type url. Example: location.',\n\t\t\t\t\t'optional' => false,\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'rest_endpoint_slug',\n\t\t\t\t\t'description' => 'The name of the custom post type REST-API endpoint slug. Example: locations.',\n\t\t\t\t\t'optional' => false,\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'capability',\n\t\t\t\t\t'description' => 'The default capability for the custom post types. Example: post.',\n\t\t\t\t\t'optional' => true,\n\t\t\t\t\t'default' => $this->getDefaultArg('capability'),\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'menu_position',\n\t\t\t\t\t'description' => 'The default menu position for the custom post types. Example: 20.',\n\t\t\t\t\t'optional' => true,\n\t\t\t\t\t'default' => $this->getDefaultArg('menu_position'),\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'type' => 'assoc',\n\t\t\t\t\t'name' => 'menu_icon',\n\t\t\t\t\t'description' => 'The default menu icon for the custom post types. Example: dashicons-analytics.',\n\t\t\t\t\t'optional' => true,\n\t\t\t\t\t'default' => $this->getDefaultArg('menu_icon'),\n\t\t\t\t],\n\t\t\t],\n\t\t\t'longdesc' => $this->prepareLongDesc(\"\n\t\t\t\t## USAGE\n\n\t\t\t\tUsed to create custom post type for all your custom data.\n\n\t\t\t\t## EXAMPLES\n\n\t\t\t\t# Create service class:\n\t\t\t\t$ wp {$this->commandParentName} {$this->getCommandParentName()} {$this->getCommandName()} --label='Jobs' --slug='jobs' --rewrite_url='jobs' --rest_endpoint_slug='jobs'\n\n\t\t\t\t## RESOURCES\n\n\t\t\t\tService class will be created from this example:\n\t\t\t\thttps://github.com/infinum/eightshift-libs/blob/develop/src/CustomPostType/PostTypeExample.php\n\t\t\t\"),\n\t\t];\n\t}", "public function getConfiguration(): array\n {\n }", "public function specialization() {\n //run parent method\n parent::specialization();\n \n //get instance config\n $config = $this->config;\n \n //if instance config exists and the data property is present, deserialize\n //the data property(contains filter info) back into an object\n if($config && isset($config->data)) {\n $config->data = dd_content_deserialize($config->data);\n }\n \n }", "function element_config()\n {\n $this->config['shortcode'] = 'pb_market';\n $this->config['name'] = JText::_('JSN_PAGEBUILDER_ELEMENT_MARKET');\n $this->config['cat'] = JText::_('JSN_PAGEBUILDER_DEFAULT_ELEMENT_EXTRA');\n $this->config['icon'] = \"icon-market\";\n $this->config['has_subshortcode'] = __CLASS__ . 'Item';\n $this->config['description'] = JText::_(\"JSN_PAGEBUILDER_ELEMENT_MARKET_DES\");\n\n $this->config['exception'] = array(\n 'default_content' => JText::_('JSN_PAGEBUILDER_ELEMENT_MARKET')\n );\n }", "function init(){\n $this->pi_initPIflexForm(); // Init and get the flexform data of the plugin\n //merge lConf with standard tt_content column, so in $this->cObj->data there are all data from xflextemplate\n $this->cObj->data=array_merge($this->cObj->data,xmlTransformation::getArrayFromXMLData($this->cObj->data['xflextemplate']));\n //fetch all other data from template\n $res=$GLOBALS['TYPO3_DB']->exec_SELECTquery('xml,typoscript,html','tx_xflextemplate_template','title=\"'.$this->cObj->data['xtemplate'].'\" AND deleted=0 AND hidden=0');\n $databaseRow=$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\n $this->typoscript=$databaseRow['typoscript'];\n //debug();\n //This code updates typoscript of template with template from page\n $GLOBALS['TSFE']->tmpl->config[count($GLOBALS['TSFE']->tmpl->config)] = $this->typoscript;\n $typoscriptParser = $GLOBALS['TSFE']->tmpl;\n $typoscriptParser->generateConfig();\n\n //$ts contains all typoscript from xflextemplate\n $xml=str_replace(\"''\",\"'\",$databaseRow['xml']);\n //create correct element data from xml in the xflextemplate\n $xmlArray=xmlTransformation::getArrayFromXML($xml);\n if(is_array($xmlArray)){\n foreach($xmlArray as $xElemet){\n $this->xflexData[$xElemet['name']]=$xElemet;\n }\n }\n //assign typoscript\n $this->typoscript=$typoscriptParser->setup;\n //$this->template=($databaseRow['html']) ? $databaseRow['html'] : $this->cObj->TEMPLATE($this->typoscript['templateFile.']);\n if(!$databaseRow['html']){\n $this->template=$this->cObj->getSubpart($this->cObj->TEMPLATE($this->typoscript['templateFile.']), '###'.strtoupper(str_replace(' ','_',$this->cObj->data['xtemplate'])).'###');\n }\n else{\n $this->template = $databaseRow['html'];\n }\n //only for back compatibility\n $this->template=($this->template)?$this->template:$this->getTemplateString($dbrow['file']);//retrieve file data, only if is not defined in template\n //Updating conf array with typoscript\n $this->conf=t3lib_div::array_merge_recursive_overrule($this->conf,$typoscriptParser->setup);\n }", "public static function hookData() {\n return array_merge_recursive( array (\n 'settings' => \n array (\n 0 => \n array (\n 'selector' => '#elSettingsTabs > div.ipsColumns.ipsColumns_collapsePhone.ipsColumns_bothSpacing > div.ipsColumn.ipsColumn_wide > div.ipsSideMenu > ul.ipsSideMenu_list',\n 'type' => 'add_inside_end',\n 'content' => '{template=\"accountSettingsTab\" group=\"settings\" location=\"front\" app=\"teamspeak\" params=\"$tab\"}',\n ),\n ),\n), parent::hookData() );\n}", "public static function init()\n {\n // self::devCfg();\n\n self::addCfg([\n 'name' => 'expert',\n 'options' => [...self::getDefaultOptions(),\n 'min_height'=> 600,\n 'height'=> 600,\n 'menubar' => 'file edit insert view format table tools help',\n 'importcss_append' => true,\n 'style_formats' => [\n [ 'title' => 'Headings', 'items' => [\n ['title' => 'Heading 1', 'block' => 'h1' ],\n ['title' => 'Heading 2', 'block' => 'h2' ],\n ['title' => 'Heading 3', 'block' => 'h3' ],\n ['title' => 'Heading 4', 'block' => 'h4' ],\n ['title' => 'Heading 5', 'block' => 'h5' ],\n ['title' => 'Heading 6', 'block' => 'h6' ],\n [\n 'title' => 'Subtitle',\n 'selector' => 'p',\n 'classes' => 'title-sub',\n ],\n ]\n ],\n [\n 'title' => 'Misc Styles', 'items' => [\n [\n 'title' => 'Style 1',\n 'selector' => 'ul',\n 'classes' => 'style1',\n 'wrapper' => true,\n 'merge_siblings' => false,\n ],\n [\n 'title' => 'Button red',\n 'inline' => 'span',\n 'classes' => 'btn-red',\n 'merge_siblings' => true,\n ],\n ]\n ],\n ],\n 'font_size_formats' => '10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px',\n 'font_family_formats' => 'Arial=arial,helvetica,sans-serif; Courier New=courier new,courier,monospace; AkrutiKndPadmini=Akpdmi-n',\n 'color_map' => [\n '000000', 'Black',\n '808080', 'Gray',\n 'FFFFFF', 'White',\n ],\n // 'custom_colors' => false,\n ],\n 'plugins' => [...self::getDefaultPlugins(),\n 'fullscreen',\n 'charmap',\n 'codesample',\n 'insertdatetime',\n 'pagebreak',\n 'preview',\n 'template',\n 'visualblocks',\n 'directionality',\n 'nonbreaking',\n ],\n 'buttons' => [\n [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'removeformat',\n 'bullist',\n 'numlist',\n 'sslink',\n 'unlink',\n 'charmap',\n 'emoticons',\n 'ssmedia',\n 'ssembed',\n 'table',\n 'searchreplace',\n ],\n [\n 'forecolor',\n 'backcolor',\n 'subscript',\n 'superscript',\n 'blockquote',\n 'anchor',\n 'alignleft',\n 'aligncenter',\n 'alignright',\n 'alignjustify',\n 'alignnone',\n 'outdent',\n 'indent',\n 'hr',\n ],\n [\n 'blocks',\n 'styles',\n 'fontsize',\n 'fontfamily',\n 'codesample',\n 'insertdatetime',\n 'wordcount',\n 'preview',\n 'fullscreen',\n 'code',\n ],\n [\n 'pagebreak',\n 'visualblocks',\n 'ltr',\n 'rtl',\n 'template',\n 'nonbreaking',\n 'help',\n ]\n ],\n ]);\n\n self::addCfg([\n 'name' => 'advanced',\n 'options' => [...self::getDefaultOptions(),\n 'min_height'=> 500,\n 'height'=> 500,\n 'importcss_append' => true,\n 'style_formats' => [\n [ 'title' => 'Headings', 'items' => [\n ['title' => 'Heading 1', 'block' => 'h1' ],\n ['title' => 'Heading 2', 'block' => 'h2' ],\n ['title' => 'Heading 3', 'block' => 'h3' ],\n ['title' => 'Heading 4', 'block' => 'h4' ],\n ['title' => 'Heading 5', 'block' => 'h5' ],\n ['title' => 'Heading 6', 'block' => 'h6' ],\n [\n 'title' => 'Subtitle',\n 'selector' => 'p',\n 'classes' => 'title-sub',\n ],\n ]\n ],\n [\n 'title' => 'Misc Styles', 'items' => [\n [\n 'title' => 'Style 1',\n 'selector' => 'ul',\n 'classes' => 'style1',\n 'wrapper' => true,\n 'merge_siblings' => false,\n ],\n [\n 'title' => 'Button red',\n 'inline' => 'span',\n 'classes' => 'btn-red',\n 'merge_siblings' => true,\n ],\n ]\n ],\n ],\n 'font_size_formats' => '10px 12px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px',\n ],\n 'plugins' => [...self::getDefaultPlugins(),\n 'fullscreen',\n 'charmap',\n 'codesample',\n 'insertdatetime',\n 'preview',\n ],\n 'buttons' => [\n [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'removeformat',\n 'bullist',\n 'numlist',\n 'sslink',\n 'unlink',\n 'charmap',\n 'emoticons',\n 'ssmedia',\n 'ssembed',\n 'table',\n 'searchreplace',\n ],\n [\n 'forecolor',\n 'backcolor',\n 'subscript',\n 'superscript',\n 'blockquote',\n 'anchor',\n 'alignleft',\n 'aligncenter',\n 'alignright',\n 'alignjustify',\n 'alignnone',\n 'outdent',\n 'indent',\n 'hr',\n ],\n [\n 'blocks',\n 'styles',\n 'fontsize',\n 'codesample',\n 'insertdatetime',\n 'wordcount',\n 'preview',\n 'fullscreen',\n 'code',\n ]\n ],\n ]);\n\n self::addCfg([\n 'name' => 'intermediate',\n 'options' => [...self::getDefaultOptions(),\n 'min_height'=> 400,\n 'height'=> 400,\n ],\n 'plugins' => [...self::getDefaultPlugins(),\n 'charmap',\n ],\n 'buttons' => [\n [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'removeformat',\n 'bullist',\n 'numlist',\n 'sslink',\n 'unlink',\n 'charmap',\n 'emoticons',\n 'ssmedia',\n 'ssembed',\n 'table',\n 'searchreplace',\n ],\n [],\n [],\n ],\n ]);\n\n // disallow div in basic cfg\n $options = self::getDefaultOptions();\n $options['valid_elements'] = str_replace('-div[id|dir|class|align|style],-span[class|align|style]', '', $options['valid_elements']);\n\n self::addCfg([\n 'name' => 'basic',\n 'options' => [...$options,\n 'contextmenu' => false,\n 'min_height'=> 300,\n 'height'=> 300,\n ],\n 'plugins' => [...self::getDefaultPlugins(),\n 'charmap',\n ],\n 'buttons' => [\n [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n 'removeformat',\n 'bullist',\n 'numlist',\n 'sslink',\n 'unlink',\n 'charmap',\n 'emoticons',\n ],\n [],\n [],\n ],\n ]);\n\n // reset default cms config to be basic\n HTMLEditorConfig::set_config('cms', TinyMCEConfig::get('basic'));\n }", "public function getPluginConfigAction()\n {\n /** @var \\Enlight_Config $config */\n $config = Shopware()->Plugins()->Backend()->SwagBackendOrder()->Config();\n\n $desktopTypes = $config->get('desktopTypes');\n $desktopTypes = explode(',', $desktopTypes);\n $validationMail = $config->get('validationMail');\n\n $config = [];\n $config['desktopTypes'] = [];\n $count = 0;\n\n foreach ($desktopTypes as $desktopType) {\n $config['desktopTypes'][$count]['id'] = $count;\n $config['desktopTypes'][$count]['name'] = $desktopType;\n $count++;\n }\n\n $config['validationMail'] = $validationMail;\n\n $total = count($config);\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $config,\n 'total' => $total\n ]\n );\n }", "function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->pi_initPIflexForm(); // Einmal am Anfang der Klasse\n $this->gp = $_GET[$this->extKey];\n // Service einbinden\n require_once(t3lib_extMgm::siteRelPath('yuieditor').'sv1/class.tx_yuieditor_sv1.php');\n $this->yui = t3lib_div::makeInstance('tx_yuieditor_sv1');\n // Flexform values\n $this->code = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'bereich', 'sDEF');\n\n // Processing...\n\t $this->yui->renderEditor('test');\n\t $content = '<textarea id=\"test\">test</textarea>';\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}", "public function definition() {\n\n \t$sphereLib = new setask_sphere();\n \t$compilers = $sphereLib->sphereGetCompilers(); //to be improved (maybe... - probably no need to rewrite here)\n # \tvar_dump($compilers);\n $mform = $this->_form;\n\n list($setask, $data) = $this->_customdata;\n $mform->addElement('select', 'compiler', 'Compilers: ',$compilers\t);\n\t\t\n $setask->add_submission_form_elements($mform, $data);\n\n $this->add_action_buttons(true, get_string('savechanges', 'setask'));\n if ($data) {\n\t\t\t//ugly (but working) way of extracting data from text editor\n \tforeach($data as $tes){\n \t\t$ii =0;\n \t\n \t\tforeach($tes as $tes2)\n \t\t{\n \t\t\tif($ii == 0)\n \t\t\t\t$textToSend = $tes2;//text from online editor - ugly way but it works...\n \t\t\t#\tvar_dump($textToSend);\n \t\t\t\t$ii++;\n \t\t}\n \t\n \t}\n \t\n \t//extracting selected compiler \n \t$selectedItem =& $mform->getElement('compiler')->getSelected();\n #\tvar_dump($selectedItem);\n $this->set_data($data);\n }\n \n }", "public function settings_data()\n {\n $method = rcube_utils::get_input_value('_method', rcube_utils::INPUT_POST);\n\n if ($driver = $this->get_driver($method)) {\n $data = array('method' => $method, 'id' => $driver->id);\n\n foreach ($driver->props(true) as $field => $prop) {\n $data[$field] = $prop['text'] ?: $prop['value'];\n }\n\n // generate QR code for provisioning URI\n if (method_exists($driver, 'get_provisioning_uri')) {\n try {\n $uri = $driver->get_provisioning_uri();\n\n $qr = new Endroid\\QrCode\\QrCode();\n $qr->setText($uri)\n ->setSize(240)\n ->setPadding(10)\n ->setErrorCorrection('high')\n ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))\n ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0));\n $data['qrcode'] = base64_encode($qr->get());\n }\n catch (Exception $e) {\n rcube::raise_error($e, true, false);\n }\n }\n\n $this->api->output->command('plugin.render_data', $data);\n }\n\n $this->api->output->send();\n }", "public function setAndGetItemProvider()\n {\n return array(\n array('true', true),\n array('false', false),\n array('int', 123),\n array('double', 12.34),\n array('string', 'my string'),\n array('array', array(1, '2', 3.4)),\n array('object', new \\DateTime()),\n array('null', null),\n );\n }", "public function getDocumentationConfig(): array;", "public function setup_types()\n {\n }", "abstract protected function getConfig();", "public function getDescriptionData() {}", "function getConfigurationValues() ;", "private function _createConfigs()\r\n {\r\n $languages = $this->context->language->getLanguages();\r\n\t\t\t\r\n foreach ($languages as $language){\r\n $title[$language['id_lang']] = 'Specials products';\r\n }\r\n $response = Configuration::updateValue('FIELD_SPECIALPLS_NBR', 6);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_TITLE', $title);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_VERTICAL', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_COLUMNITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MAXITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MEDIUMITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_MINITEM', 1);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLL', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_AUTOSCROLLDELAY', 4000);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAUSEONHOVER', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_PAGINATION', 0);\r\n $response &= Configuration::updateValue('FIELD_SPECIALPLS_NAVIGATION', 0);\r\n\r\n return $response;\r\n }", "function __construct($config = array())\n\t{\n\t\tif (empty($config['filter_fields'])) {\n <# Dim OrderableFields As New List(Of String) #>\n <# For Each row In JComponentDataTable.Rows #>\n\t\t\t<# \t OrderableFields.Add(row.Field) #>\n <# Next #>\n\t\t\t$config['filter_fields'] = explode(',','<#= Join(OrderableFields.ToArray(), \",\") #>');\n\t\t}\n\t\t$config['_tableType'] = '<#= StrConv(Value(\"Task.nameObject\"), VbStrConv.ProperCase) #>';\n\t\t$config['_tablePrefix'] = '<#= Value(\"Extension.name\") #>Table';\n\t\tparent::__construct($config);\n\t}", "public function getConfig() {\r\n\r\n\t}", "protected function setUpConfigurationData() {}", "function config()\n\t{\n\t\t$rows=$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*'),NULL,'ORDER BY id');\n\t\t$out=array();\n\t\tforeach ($rows as $i=>$row)\n\t\t{\n\t\t\t$fields=new ocp_tempcode();\n\t\t\t$hidden=new ocp_tempcode();\n\t\t\t$fields->attach($this->get_fields('_'.strval($i),get_translated_text($row['c_title']),get_translated_text($row['c_description']),$row['c_enabled'],$row['c_cost'],$row['c_one_per_member']));\n\t\t\t$fields->attach(do_template('FORM_SCREEN_FIELD_SPACER',array('TITLE'=>do_lang_tempcode('ACTIONS'))));\n\t\t\t$fields->attach(form_input_tick(do_lang_tempcode('DELETE'),do_lang_tempcode('DESCRIPTION_DELETE'),'delete_custom_'.strval($i),false));\n\t\t\t$hidden->attach(form_input_hidden('custom_'.strval($i),strval($row['id'])));\n\t\t\t$out[]=array($fields,$hidden,do_lang_tempcode('EDIT_CUSTOM_PRODUCT'));\n\t\t}\n\n\t\treturn array($out,do_lang_tempcode('ADD_NEW_CUSTOM_PRODUCT'),$this->get_fields());\n\t}", "function plgSystemSynk_content(& $subject, $config) {\n\t\tparent::__construct($subject, $config);\n\t}", "public function __construct(\n protected TypeConfiguration $configuration\n ){\n //\n }", "public function getSetDataProvider() {}", "public function getTypedData();", "public function getConfigurationExample() {\n\t\treturn '\nstorage = tce\nstorage {\n\tdontUpdateFields = password\n\tdontUsePidForKeyField = 0\n\t\n\t# only update existing records but dont create new ones\n\t# dontAllowInserts = 1\n\t\n\t# needed for ordering records in TYPO3\n\t// moveAfterField = myFunnyFieldWithUIDofpreviousRecord\n\t\n\t# if set to 1, deleted records will be reactivated when they get imported again\n\treactivateDeletedRecords = 0\n}';\n\t}", "public function config()\n {\n }", "function getConfiguration($c) {\r\n $config = array(); \r\n $config['width'] = 'width='.$c['width'];\r\n $config['height'] = 'height='.$c['height'];\r\n $config['backgroundColor'] = ($c['backgroundColor']!='FFFFFF') ? 'backcolor=0x'.$c['backgroundColor'] : '';\r\n $config['foregroundColor'] = ($c['foregroundColor']!='000000') ? 'frontcolor=0x'.$c['foregroundColor'] : '';\r\n $config['highlightColor'] = ($c['highlightColor']!='000000') ? 'lightcolor=0x'.$c['highlightColor'] : '';\r\n $config['screenColor'] = ($c['screenColor']!='000000') ? 'screencolor='.$c['screenColor'] : '';\r\n $config['backgroundImage'] = ($c['backgroundImage']!='') ? 'image=http://'.$c['backgroundImage'] : '';\r\n $config['largeControllBar'] = ($c['largeControllBar']==1) ? 'largecontrols=true' : '';\r\n $config['showDigits'] = ($c['showDigits']!='true') ? 'showdigits='.$c['showDigits'] : '';\r\n# $config['showDownload'] = ($c['showDownload']==1) ? 'showdownload=true&link=\"'.t3lib_div::getIndpEnv('TYPO3_SITE_URL').t3lib_extMgm::siteRelpath('rgmediaimages').'saveFile.php&file='.$url.'\"': '';\r\n $config['showEqualizer'] = ($c['showEqualizer']==1) ? 'showeq=true' : '';\r\n $config['showLoadPlay'] = ($c['showLoadPlay']==0) ? 'showicons=false' : '';\r\n $config['showVolume'] = ($c['showVolume']==0) ? 'showvolume=false' : '';\r\n $config['autoStart'] = ($c['autoStart']!='false') ? 'autostart='.$c['autoStart'] : '';\r\n $config['autoRepeat'] = ($c['autoRepeat']!='false') ? 'repeat='.$c['autoRepeat'] : ''; \r\n $config['volume'] = ($c['volume']!=80) ? 'volume='.intval($c['volume']) : '';\r\n $config['logo'] = ($c['logo']!='') ? 'logo=http://'.$c['logo'] : '';\r\n \r\n return $config;\r\n\t}", "public function getDataWithTypeRegister() {}", "protected function loadParserData()\n {\n // Load plug-in's variables into the parser\n ExpressionParser::setVars($this->piVars);\n // Load specific configuration into the extra data\n $extraData = array();\n if (is_array($this->conf['context.'])) {\n $extraData = GeneralUtility::removeDotsFromTS($this->conf['context.']);\n }\n // Allow loading of additional extra data from hooks\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['setExtraDataForParser'])) {\n foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['setExtraDataForParser'] as $className) {\n $hookObject = GeneralUtility::getUserObj($className);\n $extraData = $hookObject->setExtraDataForParser($extraData, $this);\n }\n }\n // Add the extra data to the parser and to the TSFE\n if (count($extraData) > 0) {\n ExpressionParser::setExtraData($extraData);\n // TODO: this should not stay\n // This was added so that context can be available in the local TS of the templatedisplay\n // We must find another solution so that the templatedisplay's TS can use the tx_expressions_parser\n $GLOBALS['TSFE']->tesseract = $extraData;\n }\n }", "protected function __construct($type, $config) {\n parent::__construct($type, $config);\n $this->class = Source::CLASS_DATA;\n\n $this->satisfies = val('satisfies', $config);\n $this->frequency = 30;\n }", "private function _descriptionTextModelExpectData()\n {\n return [\n 'type' => 1,\n 'hasEditor' => false\n ];\n }", "public function __construct() {\n $this->Types;\n }", "protected function setParamConfig()\n {\n $this->paramConfig = ArrayManipulation::deepMerge($this->paramConfig, array(\n 'placeholder' => array(\n 'name' => 'Platzhalter Text',\n 'type' => 'textfield'\n ),\n 'rows' => array(\n 'name' => 'Anzahl Zeilen',\n 'type' => 'textfield'\n ),\n 'maxlength' => array(\n 'name' => 'Maximale Anzahl Zeichen (optional)',\n 'type' => 'textfield'\n )\n ));\n }", "function setScriptData($value){\n $this->_options['scriptData'][$this->getInputName()]=CJSON::encode($value);\n }", "function setConfig( array $input ){\n\n\t\tif ( is_array( $input ) ) {\n\t\t\t$phpClass = !isset( $input['php-class'] ) ? IMAP_DEFAULT_ACTION_CLASS : $input['php-class'];\n\t\t\t$this->phpClass = $phpClass;\t\t\t\n\t\t\t$this->config = $input[ 'config' ];\t\t\t\n\t\t}\n\t}", "protected function setTypo3Context() {}", "public function dataProviderProcess(): array\n {\n return [\n [\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_config.yml'))['guzzle'],\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_middleware.yml'))['services'],\n Yaml::parse(file_get_contents(__DIR__ . '/../../Resources/config/sample_events.yml'))['services'],\n ]\n ];\n }", "public function providerCreate()\n {\n $data = array(\n // None.\n array(null, null, '\\\\UnicornFail\\\\PhpOption\\\\None'),\n\n // SomeFloat.\n array('3.33', 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-42.9', -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array('-9.25', -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(3.33, 3.33, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-42.9, -42.9, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n array(-9.25, -9.25, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeFloat'),\n\n // SomeInteger.\n array(0, 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array(1, 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('0', 0, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n array('1', 1, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeInteger'),\n\n // SomeBoolean.\n array(true, true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array(false, false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('on', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('ON', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('off', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('OFF', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('true', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('TRUE', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('false', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('FALSE', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('yes', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('YES', true, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('no', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n array('NO', false, '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeBoolean'),\n\n // SomeArray.\n array(array(), array(), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array(array(1, 2, 3), array(1, 2, 3), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo,bar,baz', array('foo', 'bar', 'baz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n array('foo=bar,baz=quz', array('foo' => 'bar', 'baz' => 'quz'), '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeArray'),\n\n // SomeString.\n array('', '', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('string', 'string', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n array('foo=bar', 'foo=bar', '\\\\UnicornFail\\\\PhpOption\\\\Some\\\\SomeString'),\n );\n\n $index = 0;\n return array_combine(array_map(function ($item) use (&$index) {\n $item = array_map(function ($value) {\n if (is_string($value) && (is_callable($value) || class_exists($value))) {\n $parts = explode('\\\\', $value);\n return array_pop($parts);\n }\n return json_encode($value);\n }, $item);\n $label = implode(' : ', array_merge(array('#' . $index++), $item));\n return $label;\n }, $data), $data);\n }", "public function getTyposcript() {}", "function main($content,$conf)\t{\n //define standard global variables\n $this->conf=$conf;\n $this->pi_setPiVarDefaults();\n $this->pi_loadLL();\n\n //extract configuration\n $this->mgmConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['xflextemplate']);\n if (isset($this->mgmConfiguration['debug']))\n $this->debug = $this->mgmConfiguration['debug'];\n\n if ($this->debug)\n debug($this->conf,'configuration');\n\n //call init function to extract and recollect data\n $this->init();\n //if not static plugin is loaded generate an error, in the static template is defined many standard variable, the plugin could generate error without it\n if ($this->conf['installed']){\n if(strlen($this->template)>0){\n $content=$this->putContent($this->template);\n }\n else{\n $content=$this->pi_getLL('emptyTemplate','Template is not found or it\\'s empty, control your xft template for HTML tabs or typoscript');\n }\n }\n else\n $content=$this->pi_getLL('noStaticTyposcriptLoaded','no static template is loaded!, insert inside your typoscript template the xflextemplate template');\n return $content;\n }", "function zarinpalwg_config() {\n $configarray = array(\n \"FriendlyName\" => array(\"Type\" => \"System\", \"Value\"=>\"زرین پال - وب گیت\"),\n \"merchantID\" => array(\"FriendlyName\" => \"merchantID\", \"Type\" => \"text\", \"Size\" => \"50\", ),\n \"Currencies\" => array(\"FriendlyName\" => \"Currencies\", \"Type\" => \"dropdown\", \"Options\" => \"Rial,Toman\", ),\n\t \"MirrorName\" => array(\"FriendlyName\" => \"نود اتصال\", \"Type\" => \"dropdown\", \"Options\" => \"آلمان,ایران,خودکار\", \"Description\" => \"چناانچه سرور شما در ایران باشد ایران دا انتخاب کنید و در غیر اینصورت آلمان و یا خودکار را انتخاب کنید\", ),\n \"afp\" => array(\"FriendlyName\" => \"افزودن کارمزد به قیمت ها\", \"Type\" => \"yesno\", \"Description\" => \"در صورت انتخاب 2.5 درصد به هزینه پرداخت شده افزوده می شود.\", ),\n );\n\treturn $configarray;\n}", "abstract protected function configureDataConstraints(): array;", "public function loadConfig($data);", "function load_config($conf) {\n $this->conf = $conf; // Store configuration\n\n $this->pi_setPiVarDefaults(); // Set default piVars from TS\n $this->pi_initPIflexForm(); // Init FlexForm configuration for plugin\n\n // Read extension configuration\n $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$this->extKey]);\n\n if (is_array($extConf)) {\n $conf = t3lib_div::array_merge($extConf, $conf);\n\n }\n\n // Read TYPO3_CONF_VARS configuration\n $varsConf = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey];\n\n if (is_array($varsConf)) {\n\n $conf = t3lib_div::array_merge($varsConf, $conf);\n\n }\n\n // Read FlexForm configuration\n if ($this->cObj->data['pi_flexform']['data']) {\n\n foreach ($this->cObj->data['pi_flexform']['data'] as $sheetName => $sheet) {\n\n foreach ($sheet as $langName => $lang) {\n foreach(array_keys($lang) as $key) {\n\n $flexFormConf[$key] = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], \n $key, $sheetName, $langName);\n\n if (!$flexFormConf[$key]) {\n unset($flexFormConf[$key]);\n\n }\n }\n }\n }\n }\n\n if (is_array($flexFormConf)) {\n\n $conf = t3lib_div::array_merge($conf, $flexFormConf);\n }\n\n $this->conf = $conf;\n\n }", "public function setTypes(){\n $this->var = false;\n $this->symb = false;\n $this->label = false;\n $type = '';\n \n //Ulozi postupne do jednotlivych promennych jestli dany argument odpovida nejakemu danemu vzoru a pote v podminkach rozhodneme typ argumentu (ktery na konci funkce ulozime do typu) a take jestli je argument var, symb, label nebo type\n $var = preg_match(\"/^(TF|LF|GF)@((\\p{L}|-|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n $int = preg_match(\"/^int@([\\+\\-])?([0-9])*$/u\", $this->arg);\n $bool = preg_match(\"/^bool@(true|false)$/u\", $this->arg);\n $string = preg_match(\"/^string@(\\p{L}|[^(\\w\\\\\\)]|\\d|[_]|\\\\\\\\([0-9][0-9][0-9]))*$/u\", $this->arg);\n $nil = preg_match(\"/^nil@nil$/u\", $this->arg);\n $label = preg_match(\"/^((\\p{L}|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n if($var){\n $type = \"var\";\n $this->var = true;\n $this->symb = true;\n }\n if($int){\n $type = \"int\";\n $this->symb = true;\n }\n if($bool){\n $type = \"bool\";\n $this->symb = true;\n }\n if($string){\n $type = \"string\";\n $this->symb = true;\n }\n if($nil){\n $type = \"nil\";\n $this->symb = true;\n }\n if($label){\n if(preg_match(\"/^(int|bool|string)$/u\", $this->arg)){\n $this->type_type = true;\n }\n $type = \"label\";\n $this->label = true; \n }\n if(!($var||$int||$bool||$string||$nil||$label)){\n fwrite(STDERR, \"CHYBA \".ERROR_23.\" - spatny argument\\n\");\n exit(ERROR_23);\n }\n $this->setType($type);\n }", "public function custom_definition_after_data() {}", "function getConfiguration() ;", "public function getConfiguration(): array;", "public function getConfiguration(): array;", "function tidy_get_config(tidy $object) {}", "public function getConfigurationExample() {\n\t\treturn '\nsource = xls\nsource {\n\t# in KB\n\tmaxFileSize = 10000 \n\tarchivePath = uploads/tx_cabagimport/\n\t\n\t# force charset if you have problems with umlaute\n\tforceCharset = en_US.UTF-8\n\t\n\t# interpreter which parses the data\n\tinterpret = csv\n\tinterpret {\n\t\t# csv options\n\t\tdelimiter = ,\n\t\t\n\t\tenclosure = \"\n\t}\n}';\n\t}", "public function onConfig(array $config = []);", "public function main($content, $conf)\n {\n $this->init($conf);\n $content = '';\n $filter = array();\n\n // Handle the secondary provider first\n $secondaryProvider = $this->initializeSecondaryProvider();\n\n // Handle the primary provider\n // Define the filter (if any)\n try {\n $filter = $this->definePrimaryFilter();\n $this->addMessage(\n $this->extKey,\n $this->pi_getLL('info.calculated_filter'),\n $this->pi_getLL('info.primary_filter'),\n FlashMessage::INFO,\n $filter\n );\n } catch (\\Exception $e) {\n // Issue error if a problem occurred with the filter\n $this->addMessage(\n $this->extKey,\n $e->getMessage() . ' (' . $e->getCode() . ')',\n $this->pi_getLL('error.primary_filter'),\n FlashMessage::ERROR\n );\n }\n\n // Get the primary data provider\n try {\n $primaryProviderData = $this->getComponentData('provider', 1);\n // Get the primary data provider, if necessary\n if ($this->passStructure) {\n try {\n $primaryProvider = $this->getDataProvider(\n $primaryProviderData,\n isset($secondaryProvider) ? $secondaryProvider : null\n );\n $primaryProvider->setDataFilter($filter);\n // If the secondary provider exists and the option was chosen\n // to display everything in the primary provider, no matter what\n // the result from the secondary provider, make sure to set\n // the empty data structure flag to false, otherwise nothing will display\n if (isset($secondaryProvider) && !empty($this->cObj->data['tx_displaycontroller_emptyprovider2'])) {\n $primaryProvider->setEmptyDataStructureFlag(false);\n }\n } // Something happened, skip passing the structure to the Data Consumer\n catch (\\Exception $e) {\n $this->passStructure = false;\n $this->addMessage(\n $this->extKey,\n $e->getMessage() . ' (' . $e->getCode() . ')',\n $this->pi_getLL('error.primary_provider_interrupt'),\n FlashMessage::WARNING\n );\n }\n }\n\n // Get the data consumer\n try {\n // Get the consumer's information\n $consumerData = $this->getComponentData('consumer');\n try {\n // Get the corresponding Data Consumer component\n $this->consumer = Tesseract::getComponent(\n 'dataconsumer',\n $consumerData['tablenames'],\n array('table' => $consumerData['tablenames'], 'uid' => $consumerData['uid_foreign']),\n $this\n );\n // Pass appropriate TypoScript to consumer\n $typoscriptKey = $this->consumer->getTypoScriptKey();\n $typoscriptConfiguration = isset($GLOBALS['TSFE']->tmpl->setup['plugin.'][$typoscriptKey]) ? $GLOBALS['TSFE']->tmpl->setup['plugin.'][$typoscriptKey] : array();\n $this->consumer->setTypoScript($typoscriptConfiguration);\n $this->consumer->setDataFilter($filter);\n // If the structure should be passed to the consumer, do it now and get the rendered content\n if ($this->passStructure) {\n // Check if Data Provider can provide the right structure for the Data Consumer\n if ($primaryProvider->providesDataStructure($this->consumer->getAcceptedDataStructure())) {\n // Get the data structure and pass it to the consumer\n $structure = $primaryProvider->getDataStructure();\n // Check if there's a redirection configuration\n $this->handleRedirection($structure);\n // Pass the data structure to the consumer\n $this->consumer->setDataStructure($structure);\n // Start the processing and get the rendered data\n $this->consumer->startProcess();\n $content = $this->consumer->getResult();\n } else {\n $this->addMessage(\n $this->extKey,\n $this->pi_getLL('error.incompatible_provider_consumer'),\n '',\n FlashMessage::ERROR\n );\n }\n } else {\n // If no structure should be passed (see defineFilter()),\n // don't pass structure :-), but still do the rendering\n // (this gives the opportunity to the consumer to render its own error content, for example)\n // This is achieved by not calling startProcess(), but just getResult()\n $content = $this->consumer->getResult();\n }\n } catch (\\Exception $e) {\n $this->addMessage(\n $this->extKey,\n $e->getMessage() . ' (' . $e->getCode() . ')',\n $this->pi_getLL('error.no_consumer'),\n FlashMessage::ERROR\n );\n }\n } catch (\\Exception $e) {\n $this->addMessage(\n $this->extKey,\n $e->getMessage() . ' (' . $e->getCode() . ')',\n $this->pi_getLL('error.no_consumer'),\n FlashMessage::ERROR\n );\n }\n } catch (\\Exception $e) {\n $this->addMessage(\n $this->extKey,\n $e->getMessage() . ' (' . $e->getCode() . ')',\n $this->pi_getLL('error.no_primary_provider'),\n FlashMessage::ERROR\n );\n }\n\n // If debugging to output is active, prepend content with debugging messages\n $content = $this->writeDebugOutput() . $content;\n return $content;\n }", "function ting_ting_collection_context_settings_form($conf) {\n $form = array();\n return $form;\n}" ]
[ "0.6005266", "0.56558764", "0.56019324", "0.5595013", "0.55682594", "0.5503135", "0.5503135", "0.5489876", "0.54339945", "0.543047", "0.54245806", "0.53848755", "0.53629076", "0.5325733", "0.5304363", "0.52970237", "0.52502114", "0.5184774", "0.51484656", "0.51317567", "0.5129435", "0.51138973", "0.5103516", "0.5097479", "0.5088334", "0.50610715", "0.50557125", "0.5026208", "0.5025583", "0.5014757", "0.5011041", "0.50101894", "0.49830025", "0.49818486", "0.49774092", "0.49690837", "0.49510315", "0.4946931", "0.49453604", "0.49174696", "0.4911648", "0.49053723", "0.48998234", "0.48958316", "0.48918828", "0.48905963", "0.48901612", "0.48892516", "0.48886317", "0.4888077", "0.48788524", "0.4877901", "0.487297", "0.48655283", "0.48636797", "0.48589823", "0.48465398", "0.4845949", "0.48393527", "0.48347157", "0.48342225", "0.48336536", "0.48291498", "0.4828434", "0.48267487", "0.48236868", "0.4821767", "0.4818576", "0.48057556", "0.48049873", "0.47959384", "0.47956908", "0.4794377", "0.4788963", "0.47860718", "0.4780445", "0.47779113", "0.47765636", "0.4774233", "0.47648707", "0.47637007", "0.47628844", "0.47620854", "0.47617438", "0.4761372", "0.4759876", "0.47548962", "0.47541168", "0.4752433", "0.47450033", "0.4741603", "0.4741244", "0.47408217", "0.47405326", "0.47405326", "0.47339413", "0.4718207", "0.4714096", "0.47137055", "0.4711397" ]
0.5150982
18
This method returns the TypoScript key of the extension. This may be the extension key. NOTE: if you use this method as is, don't forget to define the member variable $tsKey. NOTE: don't append a . (dot) to you ts key, it is done automatically by this method.
public function getTypoScriptKey() { return $this->tsKey.'.'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getExtensionKey() {}", "public function getExtensionKey() {}", "public function getTypoScriptKey()\n {\n return $this->tsKey . '.';\n }", "public function getExtensionKey()\n {\n return $this->request->getControllerExtensionKey();\n }", "public function getExtkey() {}", "public function getControllerExtensionKey() {}", "public function getExtensionName() {}", "public function getExtensionIdentifier();", "public function getExtension(): string\n {\n return $this->extension;\n }", "public function getExtension(): string\n {\n return $this->extension;\n }", "abstract public function getExtensionName();", "public function getExtension(): string\n {\n return $this->getMeta()->getExtension();\n }", "public function getExtensionName()\n {\n return FluentDriver::EXTENSION_NAME;\n }", "public function getName()\n {\n return 'jwkh_extension';\n }", "public function getExtension()\n {\n return substr(strrchr($this->getBasename(), '.'), 1);\n }", "public function getExtension() : string;", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "public function getExtension()\n {\n return $this->extension;\n }", "protected function getExtKey()\n {\n return 'mkmailer';\n }", "public function getExtensionKeys()\n {\n return array_keys($this->extensions);\n }", "public function getExtensionKeys() {}", "public function getExtension() {\n \n return $this->extension;\n \n }", "public function key()\n {\n if ( ! $this->isTranslated()) {\n return $this->key;\n }\n\n $parts = explode('.', $this->key);\n\n array_splice($parts, $this->localeIndex, 0, $this->getLocalePlaceholder());\n\n return trim(implode('.', $parts), '.');\n }", "public function getExtensionName(): string {\r\n return $this->template->getConfigVars('cartpay_plugin');\r\n }", "public function getKey(): string {\n return $this->getType() . $this->getId() . $this->getLang() . $this->getRevisionId() ?? '';\n }", "public function getExtension()\n {\n return $this->_extension;\n }", "public function getExtension();", "public function getExtension();", "public function getExtension();", "public function getName()\n {\n return self::EXTENSION_NAME;\n }", "public function get_extension()\n {\n return $this->m_extension;\n }", "public function getExtension() {}", "public function getExtension() {}", "public function getParentExtensionName() {}", "public function extension() : string {\n return $this->file->extension;\n }", "public function getExtension()\n {\n \treturn $this->_extension;\n }", "public function extension()\n\t{\n\t\t$type = $this->type();\n\t\treturn self::getExtension($type);\n\t}", "public function getName(): string\n {\n return 'Extension';\n }", "public function getKey(): string\n {\n return $this->key;\n }", "public function getExtensionName() {\n return $this->forwardCallToReflectionSource( __FUNCTION__ );\n }", "public function getKey()\n {\n return $this->getInternalKey();\n }", "public function getExtension(): string\n {\n return pathinfo($this->getRelativePath(), PATHINFO_EXTENSION);\n }", "public function getExtension()\n {\n return $this->file->getExtensionName();\n }", "public function getFileExtension(): string\n {\n return $this->fileExtension;\n }", "public function getExtension() : string\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "public function getExtensionPath(string $extensionKey, ?string $script = null): string\n {\n return Path::unifyPath(ExtensionManagementUtility::extPath($extensionKey, $script ?? ''));\n }", "public function getExtension(): string\n {\n return pathinfo($this->getFilename(), PATHINFO_EXTENSION);\n }", "private function getExtensionPath() {\n\t\treturn t3lib_extMgm::extRelPath($this->extKey);\n\t}", "public function getExtension()\n {\n return $this->_path['extension'];\n }", "public static function getExtKeyFromCondensendExtKey($condensedExtKey) {\n\t\tif (!is_string($condensedExtKey) || empty($condensedExtKey)) {\n\t\t\t// pt_tools classes cannot be used here because they might not be loaded yet...\n\t\t\t//throw new InvalidArgumentException('Invalid condensed extension key.');\n\t\t\treturn false;\n\t\t}\n\t\t// tx_pttools_assert::isNotEmptyString($condensedExtKey);\n\t\tstatic $cache = array();\n\t\tif (empty($cache[$condensedExtKey])) {\n\t\t\t$foundKey = false;\n\t\t\t$extKeys = t3lib_div::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);\n\t\t\tforeach ($extKeys as $extKey) {\n\t\t\t\tif ($condensedExtKey == str_replace('_', '', $extKey)) {\n\t\t\t\t\t$foundKey = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$cache[$condensedExtKey] = $foundKey ? $extKey : false;\n\t\t}\n\t\treturn $cache[$condensedExtKey];\n\t}", "private function getKey()\n {\n if ('rs\\GaufretteBrowserBundle\\Entity\\File' == $this->getClassName()) {\n return 'keys';\n } elseif ('rs\\GaufretteBrowserBundle\\Entity\\Directory' == $this->getClassName()) {\n return 'dirs';\n }\n\n throw new \\InvalidArgumentException('unknown type '.$this->getClassName());\n }", "public function getKey()\n {\n return $this->__get(\"key\");\n }", "public function extension(): string;", "public function getExtension() {\n\t\treturn CFileHelper::getExtension($this->getName());\n\t}", "public function getKey() : string\n {\n return $this->key;\n }", "function getExtension() ;", "public function getConfigKey()\n {\n return Extension::SERVICE_NAME;\n }", "public abstract function getExtension();", "public function getKey()\n {\n return $this->__key;\n }", "public function getExtension()\n {\n return pathinfo($this->name, PATHINFO_EXTENSION);\n }", "public function extensionKeyDataProvider() {}", "public function getPackageKey() {}", "public function getPackageKey() {}", "public function getKey(): string;", "public function getKey(): string;", "public function get_key() {\n\t\treturn c27()->class2file( static::class );\n\t}", "public function key(): string\n {\n return basename($this->path());\n }", "public function getExtension()\n {\n return File::get_file_extension($this->getField('Name'));\n }", "public function getExtension()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return $this->extension;\r\n }", "public function getKey() {\n\t\treturn $this -> key;\n\t}", "public function key(): string\n {\n return parent::key().':'.$this->tag();\n }", "public function getKey() {\n return $this->key;\n }", "public function getKey()\n {\n return isset($this->key) ? $this->key : '';\n }", "public function getKey()\n {\n return isset($this->key) ? $this->key : '';\n }", "public function getOriginalExtension(): string\n {\n return pathinfo($this->originalName, PATHINFO_EXTENSION);\n }", "public function getExtension() {\n\t\t\n\t\t$filename = $this->file['name'];\n\t\t\n\t\t$parts = explode('.', $filename);\n\t\t$extension = end($parts);\n\t\t\n\t\treturn strtolower($extension);\n\t\t\n\t}", "public function getExtension()\n {\n return $this->file['extension'];\n }", "public static function fromExtension(string $extension):string;", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }", "public function getKey()\n {\n return $this->key;\n }" ]
[ "0.8188166", "0.8188166", "0.8170301", "0.7456678", "0.74533546", "0.68749714", "0.6842327", "0.6835575", "0.6700021", "0.6700021", "0.6537408", "0.6494527", "0.64739764", "0.64570177", "0.6453329", "0.6405362", "0.63738656", "0.63738656", "0.63738656", "0.63738656", "0.63738656", "0.63738656", "0.63738656", "0.636507", "0.63607335", "0.6354099", "0.6348384", "0.63481736", "0.63101596", "0.63069826", "0.63055897", "0.6281488", "0.6281488", "0.6281488", "0.6272731", "0.62613297", "0.6256275", "0.62553036", "0.62199533", "0.6202898", "0.616912", "0.6151311", "0.61505336", "0.61492985", "0.61426157", "0.61338526", "0.61159086", "0.6093651", "0.60830444", "0.6076423", "0.6072746", "0.6053881", "0.6052565", "0.6048016", "0.6046132", "0.6040798", "0.60403085", "0.6039211", "0.6030413", "0.6029573", "0.60138744", "0.60024667", "0.5999781", "0.59868294", "0.5975839", "0.5971454", "0.59650767", "0.59643656", "0.5961466", "0.5961466", "0.5960291", "0.59498227", "0.59286726", "0.5926831", "0.5922477", "0.592161", "0.5917943", "0.59135234", "0.59135234", "0.5909771", "0.5907394", "0.5902682", "0.5902671", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525", "0.5900525" ]
0.8033054
3
Creates data provider instance with search query applied
public function search($params) { $query = IntegralOrder::find()->where([self::tableName().'.is_del' => self::DELETE_FALSE]); // add conditions that should always apply here $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $dataProvider->setSort([ 'attributes' => [ 'id' => [ 'asc' => ['id' => SORT_ASC], 'desc' => ['id' => SORT_DESC], ], 'igoods.name' => [ 'asc' => ['{{%integral_goods}}.name' => SORT_ASC], 'desc' => ['{{%integral_goods}}.name' => SORT_DESC], ], 'person.name' => [ 'asc' => ['{{%person}}.name' => SORT_ASC], 'desc' => ['{{%person}}.name' => SORT_DESC], ], 'user.mobile' => [ 'asc' => ['{{%user}}.name' => SORT_ASC], 'desc' => ['{{%user}}.name' => SORT_DESC], ], 'integral' => [ 'asc' => ['integral' => SORT_ASC], 'desc' => ['integral' => SORT_DESC], ], 'created_at' => [ 'asc' => ['created_at' => SORT_ASC], 'desc' => ['created_at' => SORT_DESC], ] ], 'defaultOrder' => [ 'id' => SORT_ASC ], ]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->joinWith('user'); $query->joinWith('igoods'); $query->joinWith('person'); $query->andFilterWhere(['like', '{{%person}}.name', $this->uname]) ->andFilterWhere(['like', '{{%integral_goods}}.name', $this->goodsname]); return $dataProvider; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchQueryDataProvider() {}", "public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }", "public function getQueryDataProvider() {}", "public function search() {\n // Get CDbCriteria instance\n $dbCriteria = new CDbCriteria;\n // Search for client name\n $dbCriteria->compare('name', Yii::app()->request->getQuery('name', ''), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $dbCriteria,\n 'pagination' => array(\n 'pageSize' => 10,\n ),\n ));\n }", "protected function getDataProviders()\n {\n $searchModel = $this->getSearchModel();\n $queryParams = Yii::$app->request->queryParams;\n $dataProvider = $searchModel->search($queryParams);\n return [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ];\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('url', $this->url);\n $criteria->compare('type', $this->type);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 100),\n ));\n }", "public function backendSearch()\n {\n $criteria = new CDbCriteria();\n\n return new CActiveDataProvider(\n __CLASS__,\n array(\n 'criteria' => $criteria,\n )\n );\n }", "public function search() {\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $this->getSearchCriteria(),\n\t\t\t'sort' => array(\n\t\t\t\t'defaultOrder' => 't.id DESC',\n\t\t\t\t'attributes' => array(\n\t\t\t\t\t'client_id' => array(\n\t\t\t\t\t\t'asc' => 'client_name asc',\n\t\t\t\t\t\t'desc' => 'client_name desc',\n\t\t\t\t\t),\n\t\t\t\t\t'*',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'pagination' => array(\n\t\t\t\t'pageSize' => Yii::app()->config->get('global.per_page'),)\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('id', $this->id, true);\n $criteria->compare('level', $this->level);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('ip_create', $this->ip_create, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "public function search()\n {\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('state', $this->state);\n $criteria->compare('type','0');\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function prepareDataProvider()\n\t{\n\t $searchModel = new \\app\\models\\ClearanceSearch(); \n\t\treturn $searchModel->search(\\Yii::$app->request->queryParams);\n\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('authorname', $this->authorname, true);\n return new CActiveDataProvider($this, array('criteria' => $criteria, ));\n }", "public function getDataProvider(array $query = []);", "protected function prepareDataProvider()\n {\n if ($this->prepareDataProvider !== null) {\n return call_user_func($this->prepareDataProvider, $this);\n }\n\n\t\t/* @var $modelClass \\yii\\db\\BaseActiveRecord */\n $modelClass = $this->modelClass;\n\t\t$query = $modelClass::find();\n\t\t\n\t\t$filters = ActionHelpers::getFilter();\n\t\t\n\t\tforeach($filters as $filter) {\n\t\t\t$query->andFilterWhere($filter);\n\t\t}\n\t\t\n\t\tif($with = ActionHelpers::getWith()) {\n $query->with($with);\n }\n\n return new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => ActionHelpers::getLimit()\n ],\n 'sort'=> ActionHelpers::getSort()\n // 'sort'=> ['defaultOrder' => ['id'=>SORT_DESC]]\n ]);\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('entity_id', $this->entity_id);\n $criteria->compare('dbname', $this->dbname, true);\n $criteria->compare('isfiltered', $this->isfiltered);\n $criteria->compare('filtertype', $this->filtertype);\n $criteria->compare('alias', $this->alias, true);\n $criteria->compare('enabled', $this->enabled);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => false,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria = new \\CDbCriteria;\n\n\t\tforeach (array_keys($this->defineAttributes()) as $name)\n\t\t{\n\t\t\t$criteria->compare($name, $this->$name);\n\t\t}\n\n\t\treturn new \\CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('type',$this->type,true);\n\t\t$criteria->compare('memo',$this->memo,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n $query = Hotel::find();\n // add conditions that should always apply here\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n \n // grid filtering conditions\n $query->availables($this->quantity_of_guests);\n $query->andFilterWhere([\n 'hotel_id' => $this->hotel_id,\n 'price_per_guest' => $this->price_per_guest,\n ]);\n $query->andFilterWhere(['like', 'city_name', $this->city_name]);\n return $dataProvider;\n \n }", "public function search()\n\t{\n\t $criteria=new CDbCriteria;\n\t\t\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('projection',$this->projection,true);\n\t\t$criteria->compare('username',Yii::app()->user->id);\n\t\t$criteria->compare('title',$this->title);\n\t\t$criteria->compare('url',$this->url);\n\t return new CActiveDataProvider(get_class($this), array(\n\t 'criteria'=> $criteria,\n\t 'sort'=>array(\n\t 'defaultOrder'=>'name ASC',\n\t ),\n\t 'pagination'=>array(\n\t 'pageSize'=>10\n\t ),\n\t ));\n\t}", "private function _getDataProvider($query, $params){\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n if (!($this->load($params) && $this->validate())) {\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'user_id' => $this->user_id,\n 'profile_id' => $this->profile_id,\n 'authentication_method_id' => $this->authentication_method_id,\n 'status' => $this->status,\n 'created_at' => $this->created_at,\n 'updated_at' => $this->updated_at,\n ]);\n\n $query->andFilterWhere(['like', 'username', $this->username])\n ->andFilterWhere(['like', 'auth_key', $this->auth_key])\n ->andFilterWhere(['like', 'password_hash', $this->password_hash])\n ->andFilterWhere(['like', 'password_reset_token', $this->password_reset_token])\n ->andFilterWhere(['like', 'email', $this->email]);\n\n return $dataProvider;\n }", "public function getMetadataQueryProviderWrapper();", "protected function prepareDataProvider()\n {\n \t$modelClass = $this->modelClass;\n\n $orderBy='id';\n if (isset($_GET['orderBy'])) $orderBy=$_GET['orderBy'];\n\n $orderByDir='DESC';\n if (isset($_GET['orderByDir'])) $orderByDir=$_GET['orderByDir'];\n\n $limit=20;\n if (isset($_GET['limit'])) $limit=$_GET['limit'];\n\n $order = \"$orderBy $orderByDir\";\n\n \t$dataProvider = new ActiveDataProvider([\n 'query' => $modelClass::find()->limit($limit)->with('supplier')->orderBy($order),\n 'pagination' => [\n 'pageSize' => $limit,\n ],\n ]);\n\n \treturn $dataProvider;\n }", "public function makeSearch() \n {\n $this->setSelect($this->qb);\n $this->setAssociations($this->qb);\n $this->setWhere($this->qb);\n $this->setOrderBy($this->qb);\n $this->setLimit($this->qb);\n\n return $this;\n }", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\t\t//TODO: update search criteria\n\t\t$criteria->compare('id', $this->id, true);\n\t\t$criteria->compare('event_id', $this->event_id, true);\n\t\t$criteria->compare('standard_intervention_exists', $this->standard_intervention_exists);\n\t\t$criteria->compare('details', $this->details);\n\t\t$criteria->compare('interventions_id', $this->interventions_id);\n\t\t$criteria->compare('description', $this->description);\n\t\t$criteria->compare('patient_factors', $this->patient_factors);\n\t\t$criteria->compare('patient_factor_details', $this->patient_factor_details);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('keywords',$this->keywords,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public static function new_search_record()\n\t{\n\t\treturn new user_record_search();\n\t}", "public function search() {\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('content', $this->content, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('author', $this->author, true);\n\t\t$criteria->compare('type', $this->type);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search()\n {\n $criteria = new CDbCriteria;\n $criteria->compare('uid', $this->uid);\n $criteria->compare('token', $this->token, true);\n $criteria->compare('created', $this->created, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('keyword_id', $this->keyword_id);\n $criteria->compare('visits', $this->visits);\n $criteria->compare('page_views', $this->page_views);\n $criteria->compare('parsing', $this->parsing);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => 50),\n ));\n }", "protected function getNewSearchModel()\n {\n $searchModelName = $this->getSearchModelName();\n return new $searchModelName;\n }", "public function search()\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function searchdatas(){\r\n\t\t// should not be searched.\r\n\t\t$conditions=array();\r\n\t\t$params=array();\r\n\t\t$page_params=array();\r\n\t\t$criteria=new CDbCriteria;\r\n\t\t$sort=new CSort();\r\n \t$sort->attributes=array();\r\n \t$sort->defaultOrder=\"t.create_time ASC\";\r\n \t$sort->params=$page_params;\r\n\t\treturn new CActiveDataProvider(get_class($this), array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t 'condition'=>'',\r\n\t\t\t 'params'=>array(),\r\n\t\t\t 'with'=>array(\"User\",\"District\"),\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n 'pageSize'=>'20',\r\n 'params'=> $page_params,\r\n ),\r\n 'sort'=>$sort,\r\n\t\t));\r\n\t}", "public function search()\n {\n\n $query = Board::find()->where(['user_id' => $this->user_id]);\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'created_at' => SORT_DESC,\n\n ]\n ],\n ]);\n\n return $dataProvider;\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('post_id', $this->post_id);\n $criteria->compare('language_id', $this->language_id);\n $criteria->compare('header', $this->header, true);\n $criteria->compare('text', $this->text, true);\n\t\t$criteria->compare('rating',$this->rating);\n\t\t$criteria->compare('author_id',$this->author_id);\n\t\t$criteria->compare('date_add',$this->date_add,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n $criteria = new CDbCriteria;\n\n $criteria->compare('t.id', $this->id);\n $criteria->compare('who', $this->who);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('rate', $this->rate);\n $criteria->compare('knowledge', $this->knowledge);\n $criteria->compare('behavior', $this->behavior);\n $criteria->compare('motivation', $this->motivation);\n $criteria->compare('rate', $this->who_ip);\n $criteria->compare('is_checked', $this->is_checked);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'pagination' => array(\n 'pageSize' => '50',\n ),\n 'sort' => array(\n 'defaultOrder' => array(\n 'date' => CSort::SORT_DESC,\n ),\n ),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('name', $this->name, true);\n $criteria->compare('latitude', $this->latitude);\n $criteria->compare('longitude', $this->longitude);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('vicinity', $this->vicinity, true);\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function parametersAndQueriesDataProvider() {}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('region_id', $this->region_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t $this->StateProcess(get_class($this).'_'.Y::app()->params['cfgName']);\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n $criteria->compare('title_adm',$this->title,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n 'sort'=>array('defaultOrder'=>'id DESC'),\n 'pagination'=>array('pageSize'=>Config::$data['base']->pageSize)\n\t\t));\n\t}", "public function search($params,$query=null)\n {\n if(!$query) $query = RestClient::find();\n\n $query = $query->joinWith(['hospital']) \n ->joinWith(['hospital.sales']);\n //$query = $query->joinWith('mingrui_comments');\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n \n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n //var_dump($params);exit;\n return $dataProvider;\n }\n \n // grid filtering conditions\n $query->andFilterWhere([\n 'rest_client.id' => $this->id, \n 'age' => $this->age, \n 'hospital_id' => $this->hospital_id, \n ]);\n\n $query->andFilterWhere(['like', 'rest_client.name', $this->name])\n ->andFilterWhere(['like', 'sex', $this->sex])\n ->andFilterWhere(['like', 'birthplace', $this->birthplace])\n ->andFilterWhere(['like', 'email', $this->email])\n ->andFilterWhere(['like', 'tel', $this->tel])\n ->andFilterWhere(['like', 'school', $this->school])\n ->andFilterWhere(['like', 'education', $this->education])\n ->andFilterWhere(['like', 'experience', $this->experience])\n ->andFilterWhere(['like', 'employed', $this->employed])\n ->andFilterWhere(['like', 'department', $this->department])\n ->andFilterWhere(['like', 'worktime', $this->worktime])\n ->andFilterWhere(['like', 'position', $this->position])\n ->andFilterWhere(['like', 'speciality', $this->speciality])\n ->andFilterWhere(['like', 'hobby', $this->hobby])\n ->andFilterWhere(['like', 'notes', $this->notes])\n ->andFilterWhere(['like', 'zhuren', $this->zhuren])\n ->andFilterWhere(['like', 'pianhao', $this->pianhao]) \n ->andFilterWhere(['like', 'rest_danwei.name', $this->hospitalname])\n ->andFilterWhere(['like', 'rest_sales.name', $this->salesname])\n ;\n\n // echo $query->createCommand()->getRawSql(); exit; \n return $dataProvider;\n }", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('agreement',$this->agreement);\n\t\t$criteria->compare('date',$this->date,true);\n\t\t$criteria->compare('user',$this->user);\n\t\t$criteria->compare('new_status',$this->new_status);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\n\t\t$criteria = $this->getDbCriteria();\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('subject', $this->subject, true);\n\t\t$criteria->compare('status', $this->status);\n\t\t$criteria->compare('template.name', $this->template_id, true);\n\n\t\t$sort = new CSort;\n\t\t$sort->defaultOrder = 'id DESC';\n\n\t\treturn new NActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t\t'sort' => $sort,\n\t\t\t\t\t'pagination' => array(\n\t\t\t\t\t\t'pageSize' => 20,\n\t\t\t\t\t),\n\t\t\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id,true);\n $criteria->compare('query_id',$this->query_id,true);\n $criteria->compare('se_id',$this->se_id,true);\n $criteria->compare('se_page',$this->se_page,true);\n $criteria->compare('se_url',$this->se_url,true);\n $criteria->compare('visits',$this->visits);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n 'pagination' => array('pageSize' => 25),\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('acquisition_date_id', $this->acquisition_date_id);\n $criteria->compare('acquisition_type_id', $this->acquisition_type_id);\n $criteria->compare('location_id', $this->location_id);\n $criteria->compare('number', $this->number, true);\n $criteria->compare('annotation', $this->annotation, true);\n $criteria->compare('location_coordinates_id', $this->location_coordinates_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 1);\n $this->order = 'create_time desc';\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('id_client', $this->id_client);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('date_birth', $this->date_birth, true);\n $criteria->compare('gender', $this->gender);\n\n return new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('domain', $this->domain, true);\n $criteria->compare('ru_domain', $this->ru_domain, true);\n $criteria->compare('page', $this->ru_domain);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function applyDefaultSearchQuery(\\yii\\data\\ActiveDataProvider &$dataProvider);", "protected function _initSearch()\n {\n $this->where['is_del'] = array('eq', 0);\n $this->order = 'create_time desc';\n }", "public static function new_search_record()\n\t{\n\t\treturn new league_record_search();\n\t}", "public function search()\n {\n $query = Story::find()\n ->owner()\n ->globalChannel()\n ->orderBy(['_id' => SORT_ASC])\n ->active();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => false\n ]);\n\n return $dataProvider;\n }", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('project_id', $this->project_id);\n $criteria->compare('num', $this->num);\n $criteria->compare('team_strength', $this->team_strength);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "private function instantiate_search_page() {\n // Build the search_types_fields and search_types_label arrays out of post_types_defs\n $search_types_fields = array();\n $search_types_label = array();\n foreach ( $this->post_type_defs as $post_type ) {\n $search_types_fields[ $post_type[ 'slug' ] ] = $post_type[ 'fields' ];\n $search_types_label[ $post_type[ 'slug' ] ] = $post_type[ 'plural_name' ];\n }\n $this->search_page = new HRHS_Search( array(\n // Using the default slug and title for now\n 'search_types_fields' => $search_types_fields,\n 'search_types_label' => $search_types_label\n ) );\n }", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('title',$this->title,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search($query);", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('sex', $this->sex);\n $criteria->compare('mobile', $this->mobile, true);\n $criteria->compare('idcard', $this->idcard, true);\n $criteria->compare('password', $this->password, true);\n $criteria->compare('place_ids', $this->place_ids, true);\n $criteria->compare('depart_id', $this->depart_id);\n $criteria->compare('bank', $this->bank, true);\n $criteria->compare('bank_card', $this->bank_card, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('education', $this->education, true);\n $criteria->compare('created', $this->created);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('summ', $this->summ, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('company_id', Yii::app()->user->company_id);\n $criteria->compare('zone_id', $this->zone_id, true);\n $criteria->compare('low_qty_threshold', $this->low_qty_threshold);\n $criteria->compare('high_qty_threshold', $this->high_qty_threshold);\n $criteria->compare('created_date', $this->created_date, true);\n $criteria->compare('created_by', $this->created_by, true);\n $criteria->compare('updated_date', $this->updated_date, true);\n $criteria->compare('updated_by', $this->updated_by, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('nrs', $this->nrs, true);\n $criteria->compare('supplier_name', $this->supplier_name, true);\n $criteria->compare('npwp', $this->npwp, true);\n $criteria->compare('bank_name', $this->bank_name, true);\n $criteria->compare('bank_account_number', $this->bank_account_number, true);\n $criteria->compare('created_at', $this->created_at, true);\n $criteria->compare('created_by', $this->created_by);\n $criteria->compare('updated_at', $this->updated_at, true);\n $criteria->compare('updated_by', $this->updated_by);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort' => array(\n 'defaultOrder' => 'id DESC',\n ),\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('code',$this->code,true);\n\t\t$criteria->compare('title',$this->title,true);\n\t\t$criteria->compare('did',$this->did);\n\t\t$criteria->compare('date_prod',$this->date_prod,true);\n\t\t$criteria->compare('kind',$this->kind,true);\n\t\t$criteria->compare('len',$this->len,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('code', $this->code, true);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('printable_name', $this->printable_name, true);\n\t\t$criteria->compare('iso3', $this->iso3, true);\n\t\t$criteria->compare('numcode', $this->numcode);\n\t\t$criteria->compare('is_default', $this->is_default);\n\t\t$criteria->compare('is_highlight', $this->is_highlight);\n\t\t$criteria->compare('is_active', $this->is_active);\n\t\t$criteria->compare('date_added', $this->date_added);\n\t\t$criteria->compare('date_modified', $this->date_modified);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere([\n\t 'id' => $this->id,\n\t 'ord' => $this->ord,\n\t 'type' => $this->type,\n\t ])\n\t ->andFilterWhere(['like', 'code', $this->code])\n ->andFilterWhere(['like', 'name', $this->name]);\n\n return $this->dataProvider;\n }", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function createQuery() {}", "public function search()\n {\n // @todo Please modify the following code to remove attributes that should not be searched.\n $criteria = new CDbCriteria();\n \n $criteria->compare('question_id', $this->question_id);\n $criteria->compare('student_id', $this->student_id);\n $criteria->compare('answer_id', $this->answer_id);\n $criteria->compare('answer_text', $this->answer_text, true);\n $criteria->compare('answer_number', $this->answer_number, true);\n $criteria->compare('exec_time', $this->exec_time);\n $criteria->compare('result', $this->result);\n $criteria->compare('test_result', $this->test_result);\n \n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('createDate', $this->createDate);\n $criteria->compare('lastUpdated', $this->lastUpdated);\n $criteria->compare('trackingKey', $this->trackingKey);\n $criteria->compare('email', $this->email);\n $criteria->compare('leadscore', $this->leadscore);\n\n if (!Yii::app()->user->isGuest) {\n $pageSize = Profile::getResultsPerPage();\n } else {\n $pageSize = 20;\n }\n\n return new SmartActiveDataProvider(get_class($this), array(\n 'pagination' => array(\n 'pageSize' => $pageSize,\n ),\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n// @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('options', $this->options, true);\n $criteria->compare('autoreplys', $this->autoreplys, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function googleSearch()\n {\n $search = new \\Hoor\\Search\\Google(get_search_query(), $this->getIndex());\n $this->data['search'] = $search;\n $this->data['results'] = $search->results;\n }", "protected function addSearchConfigs()\n {\n\n $this['textQueryBuilder'] = function () {\n return new TextQueryBuilder();\n };\n\n $this['searchManager'] = function ($c) {\n return new SearchManager($c['databaseAdapter'], $c['queue'], $c['request'], array(\n $c['textQueryBuilder']\n ));\n };\n\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('tbl_customer_supplier', $this->tbl_customer_supplier, true);\n $criteria->compare('id_customer', $this->id_customer, true);\n $criteria->compare('id_supplier', $this->id_supplier, true);\n $criteria->compare('title', $this->title, true);\n $criteria->compare('date_add', $this->date_add, true);\n $criteria->compare('date_upd', $this->date_upd, true);\n $criteria->compare('active', $this->active);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public static function search()\n {\n return self::filterSearch([\n 'plot_ref' => 'string',\n 'plot_name' => 'string',\n 'plot_start_date' => 'string',\n 'user.name' => self::filterOption([\n 'select' => 'id',\n 'label' => trans_title('users', 'plural'),\n 'fields' => ['id', 'name'],\n //ComboBox user list base on the current client\n //See in App\\Models\\Users\\UsersScopes\n 'model' => app(User::class)->bySearch(),\n ]),\n 'client.client_name' => self::filterOption([\n 'conditional' => Credentials::hasRoles(['admin', 'admin-gv']),\n 'select' => 'client_id',\n 'label' => trans_title('clients', 'plural'),\n 'model' => Client::class,\n 'fields' => ['id', 'client_name']\n ])\n ]);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('district_id', $this->district_id);\n\t\t$criteria->compare('active', $this->active);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t\t\t'criteria' => $criteria,\n\t\t\t\t));\n\t}", "public function search()\n\t{\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('issue_date', $this->issue_date, true);\n\n\t\treturn new CActiveDataProvider($this, array('criteria' => $criteria,));\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('hol_id', $this->hol_id);\n $criteria->compare('loc_id', $this->loc_id);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search($params)\n {\n $this->__search($params);\n\n // grid filtering conditions\n $this->query\n\t ->andFilterWhere(['id' => $this->id])\n\t ->andFilterWhere(['like', 'description', $this->description])\n ->andFilterWhere(['like', 'type', $this->type]);\n\n return $this->dataProvider;\n }", "public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria = new CDbCriteria;\r\n\r\n\t\t$criteria->compare('doc_num', $this->doc_num, true);\r\n\t\t$criteria->compare('doc_num2', $this->doc_num2);\r\n\t\t$criteria->compare('doc_date', $this->doc_date, true);\r\n\r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria' => $criteria,\r\n\t\t));\r\n\t}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n $criteria->compare('productCategoryId', $this->productCategoryId, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('level', $this->level);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('name', $this->name, true);\n\t\t$criteria->compare('wikilink', $this->wikilink, true);\n\t\t$criteria->compare('picture', $this->picture, true);\n\t\t$criteria->compare('score', $this->score);\n\t\t$criteria->compare('modification_date', $this->modification_date, true);\n\t\t$criteria->compare('featured', $this->featured);\n\t\t$criteria->compare('users_found', $this->users_found);\n\t\t$criteria->compare('gpsdata', $this->gpsdata);\n\t\t$criteria->compare('category', $this->category);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function search()\n {\n $criteria=new CDbCriteria;\n\n $criteria->compare('id',$this->id);\n $criteria->compare('title',$this->title,true);\n $criteria->compare('text',$this->text,true);\n $criteria->compare('author_id',$this->author_id);\n $criteria->compare('editor_id',$this->editor_id);\n $criteria->compare('crated_at',$this->crated_at,true);\n $criteria->compare('edited_at',$this->edited_at,true);\n $criteria->compare('publish_at',$this->publich_at,true);\n\n return new CActiveDataProvider($this, array(\n 'criteria'=>$criteria,\n ));\n }", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('date_start',$this->date_start,true);\n\t\t$criteria->compare('date_end',$this->date_end,true);\n\t\t$criteria->compare('count_attempt',$this->count_attempt);\n\t\t$criteria->compare('count_questions',$this->count_questions);\n\t\t$criteria->compare('description',$this->description,true);\n\t\t$criteria->compare('date_create',$this->date_create,true);\n\t\t$criteria->compare('author',$this->author,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('latitud',$this->latitud,true);\n\t\t$criteria->compare('longitud',$this->longitud,true);\n\t\t$criteria->compare('telefono',$this->telefono,true);\n\t\t$criteria->compare('direccion',$this->direccion,true);\n\t\t$criteria->compare('web',$this->web,true);\n\t\t$criteria->compare('activo',$this->activo);\n\t\t$criteria->compare('userId',$this->userId);\n\t\t$criteria->compare('ratingGeneral',$this->ratingGeneral);\n\t\t$criteria->compare('youtubeUrl',$this->youtubeUrl,true);\n\t\t$criteria->compare('esDestacado',$this->esDestacado);\n\t\t$criteria->compare('aprobado',$this->aprobado);\n $criteria->compare('regionId',$this->regionId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t$criteria->compare('id_user',$this->id_user);\n\t\t$criteria->compare('id_answer',$this->id_answer);\n\t\t$criteria->compare('mark',$this->mark);\n\t\t$criteria->compare('comment',$this->comment,true);\n\t\t$criteria->compare('time',$this->time,true);\n\t\t$criteria->compare('read_mark',$this->read_mark,true);\n\t\t$criteria->compare('marked_by',$this->marked_by,true);\n\t\t\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n// $criteria->compare('name', $this->name, true);\n $criteria->compare('description', $this->description, true);\n// $criteria->compare('alias', $this->alias, true);\n// $criteria->compare('module', $this->module, true);\n $criteria->compare('crud', $this->crud, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('ID',$this->ID);\n\t\t$criteria->compare('UserID',$this->UserID);\n\t\t$criteria->compare('ProviderID',$this->ProviderID);\n\t\t$criteria->compare('Date',$this->Date,true);\n\t\t$criteria->compare('RawID',$this->RawID);\n\t\t$criteria->compare('Document',$this->Document,true);\n\t\t$criteria->compare('State',$this->State,true);\n\t\t$criteria->compare('Temperature',$this->Temperature,true);\n\t\t$criteria->compare('Conditions',$this->Conditions,true);\n\t\t$criteria->compare('Expiration',$this->Expiration,true);\n\t\t$criteria->compare('Comments',$this->Comments,true);\n\t\t$criteria->compare('Quantity',$this->Quantity,true);\n\t\t$criteria->compare('Type',$this->Type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array(\n \t'pageSize'=>Yii::app()->params['defaultPageSize'], \n ),\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('sn',$this->sn,true);\n\t\t$criteria->compare('fn',$this->fn,true);\n\t\t$criteria->compare('region',$this->region);\n\t\t$criteria->compare('postal',$this->postal,true);\n\t\t$criteria->compare('inn',$this->inn,true);\n\t\t$criteria->compare('ogrn',$this->ogrn,true);\n\t\t$criteria->compare('okpo',$this->okpo,true);\n\t\t$criteria->compare('adress',$this->adress,true);\n\t\t$criteria->compare('tel',$this->tel,true);\n\t\t$criteria->compare('fax',$this->fax,true);\n\t\t$criteria->compare('okved',$this->okved,true);\n\t\t$criteria->compare('oid',$this->oid,true);\n\t\t$criteria->compare('hits',$this->hits);\n\t\t$criteria->compare('st',$this->st);\n\t\t$criteria->compare('alias',$this->alias,true);\n\t\t$criteria->compare('alias2',$this->alias2,true);\n\t\t$criteria->compare('alias3',$this->alias3,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('cardid', $this->cardid, true);\n $criteria->compare('subclassid', $this->subclassid, true);\n $criteria->compare('cardname', $this->cardname, true);\n\n return new ActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // @todo Please modify the following code to remove attributes that should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id, true);\n $criteria->compare('pid', $this->pid, true);\n $criteria->compare('userName', $this->userName, true);\n $criteria->compare('userEmail', $this->userEmail, true);\n $criteria->compare('text', $this->text, true);\n $criteria->compare('userId', $this->userId, true);\n $criteria->compare('visibility', $this->visibility);\n $criteria->compare('date', $this->date, true);\n $criteria->compare('type', $this->type, true);\n $criteria->compare('recordId', $this->recordId, true);\n $criteria->compare('info', $this->info, true);\n $criteria->compare('new', $this->new, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('user', $this->user, true);\n $criteria->compare('amount', $this->amount);\n $criteria->compare('currency', $this->currency, true);\n $criteria->compare('valid_from', $this->valid_from, true);\n $criteria->compare('valid_to', $this->valid_to, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search () {\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\n\t\t$criteria->compare('id', $this->id);\n\t\t$criteria->compare('title', $this->title, true);\n\t\t$criteria->compare('description', $this->description, true);\n\t\t$criteria->compare('type', $this->type);\n\t\t$criteria->compare('required', $this->required);\n\t\t$criteria->compare('cId', $this->cId);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t 'criteria' => $criteria,\n\t\t ));\n\t}", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('frequency_band',$this->frequency_band,true);\n\n\t\t$criteria->compare('date_of_issue',$this->date_of_issue,true);\n\n\t\t$criteria->compare('date_of_renewal',$this->date_of_renewal,true);\n\n\t\t$criteria->compare('emission',$this->emission,true);\n\n\t\t$criteria->compare('tolerance',$this->tolerance,true);\n\n\t\t$criteria->compare('application_vsat_id',$this->application_vsat_id,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t/*\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id,true);\n\t\t$criteria->compare('name',$this->name,true);\n\t\t$criteria->compare('percent_discount',$this->percent_discount,true);\n\t\t$criteria->compare('taxable',$this->taxable);\n\t\t$criteria->compare('id_user_created',$this->id_user_created);\n\t\t$criteria->compare('id_user_modified',$this->id_user_modified);\n\t\t$criteria->compare('date_created',$this->date_created,true);\n\t\t$criteria->compare('date_modified',$this->date_modified,true);\n\n\t\treturn new CActiveDataProvider(get_class($this), array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t\t*/\n\t}", "public function search() {\n // Warning: Please modify the following code to remove attributes that\n // should not be searched.\n\n $criteria = new CDbCriteria;\n\n $criteria->compare('id', $this->id);\n $criteria->compare('first_name', $this->first_name, true);\n $criteria->compare('last_name', $this->last_name, true);\n $criteria->compare('address', $this->address, true);\n $criteria->compare('contact_number', $this->contact_number, true);\n $criteria->compare('city', $this->city, true);\n $criteria->compare('gender', $this->gender, true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n ));\n }", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = 'createDate, employeeId';\n\t\t$criteria->distinct = true;\n\t\t$criteria->addCondition('employeeId=\"' . $this->employeeId . '\" AND createDate between \"' . $this->startDate . '\" AND \"' . $this->endDate . '\"');\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria' => $criteria,\n\t\t));\n\t}" ]
[ "0.7773856", "0.674291", "0.65721744", "0.6503215", "0.6472826", "0.6389071", "0.63745373", "0.6287255", "0.62671757", "0.62457365", "0.62425256", "0.62123144", "0.61969537", "0.6172912", "0.61250603", "0.6123412", "0.6116283", "0.61031115", "0.6101092", "0.608637", "0.6081774", "0.6081262", "0.6073599", "0.60723656", "0.60405684", "0.6040201", "0.6035497", "0.60331875", "0.60318124", "0.60199106", "0.6013893", "0.5998194", "0.59764904", "0.59671843", "0.59620416", "0.59579474", "0.59551156", "0.5941564", "0.5935285", "0.590389", "0.5899341", "0.5895071", "0.5894937", "0.5888715", "0.58834034", "0.5882613", "0.58762497", "0.58638185", "0.5860362", "0.5846486", "0.58438134", "0.5839541", "0.5829547", "0.5825096", "0.5821819", "0.5821492", "0.5816446", "0.5815201", "0.58059967", "0.58025193", "0.57952476", "0.5785819", "0.57808983", "0.57782406", "0.57766914", "0.5775805", "0.57744527", "0.57744527", "0.57744527", "0.57722074", "0.5771512", "0.5770783", "0.5769345", "0.57683945", "0.57675093", "0.576178", "0.57557786", "0.5747564", "0.5746954", "0.5745489", "0.5741678", "0.57375383", "0.57335705", "0.57302207", "0.57280165", "0.5726227", "0.57238483", "0.57218784", "0.5715393", "0.57136387", "0.5713353", "0.5711261", "0.5710481", "0.571002", "0.57075536", "0.57075375", "0.57060134", "0.5704971", "0.5703576", "0.57000446", "0.5696112" ]
0.0
-1
Metodo encargado de la redireccion a Facebook
public function redirectToProvider($provider) { return Socialite::driver($provider)->redirect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function familyFacebook () {\n }", "public function getFacebook(): ?string;", "public static function facebook()\n {\n return 'facebook';\n }", "public function server_social_wall(){\n echo $this->facebookTijdlijn();\n return 'Gelukt';\n }", "public function fb()\n\t\t{\n\t\t$facebook = new Facebook(array(\n\t\t 'appId' => $this->config->item('App_ID'),\n\t\t 'secret' => $this->config->item('App_Secret'),\n\t\t 'cookie' => true\n\t\t));\n\t\t\n\t\tif(isset($_GET['logout'])) \n\t\t{\n\t\t\t$url = 'https://www.facebook.com/logout.php?next=' . urlencode('http://demo.phpgang.com/facebook_login_graph_api/') .\n\t\t\t '&access_token='.$_GET['tocken'];\n\t\t\tsession_destroy();\n\t\t\theader('Location: '.$url);\n\t\t}\n\t\tif(isset($_GET['fbTrue']))\n\t\t{\n\t\t\t$token_url = \"https://graph.facebook.com/oauth/access_token?\"\n\t\t\t . \"client_id=\".$this->config->item('App_ID').\"&redirect_uri=\" . urlencode($this->config->item('callback_url'))\n\t\t\t . \"&client_secret=\".$this->config->item('App_Secret').\"&code=\" . $_GET['code']; \n\t\t\n\t\t\t $response = file_get_contents($token_url);\n\t\t\t $params = null;\n\t\t\t parse_str($response, $params);\n\t\t\n\t\t\t $graph_url = \"https://graph.facebook.com/me?access_token=\" \n\t\t\t . $params['access_token'];\n\t\t\n\t\t\t $user = json_decode(file_get_contents($graph_url));\n\t\t\t $extra = \"<a href='index.php?logout=1&tocken=\".$params['access_token'].\"'>Logout</a><br>\"; \n\t\t\t \n\t\t\t// $content = $user;\n\t\t\t $content=array();\n\t\t\t $content['id'] = $user->id;\n\t\t\t $content['email'] = $user->email;\n\t\t\t $content['first_name'] = $user->first_name;\n\t\t\t $content['gender'] = $user->gender;\n\t\t\t $content['last_name'] = $user->last_name;\n\t\t\t $content['locale'] = $user->locale;\n\t\t\t $content['name'] = $user->name;\n\t\t\t $content = $this->session->set_userdata(\"fb_data\",$content);\n\t\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$content = '<a href=\"https://www.facebook.com/dialog/oauth?client_id='.$this->config->item('App_ID').'&redirect_uri='.$this->config->item('callback_url').'&scope=email,user_likes,publish_stream\"><img src=\"'.base_url().'images/login_facebook.jpg\" alt=\"Sign in with Facebook\"/></a>';\n\t\t}\n\t \n\t\t $data[\"facebook_data\"] = $content;\n\t\t $data[\"item\"] = \"Fb login\";\n\t\t $data[\"master_title\"] = \"Fb login | \".$this->config->item('sitename');\n\t\t $data[\"master_body\"] = \"register\";\n\t\t debug($data);die;\n\t\t $this->load->theme('home_layout',$data);\n\t\t}", "public function fbCallback()\n\t{\n try {\n // $code = Input::get('code');\n // if (strlen($code) == 0) return Redirect::to('/noauth')->with('message', 'Se ha producido un error al comunicarse con Facebook.');\n\n FacebookSession::setDefaultApplication(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n //$pageHelper = new FacebookPageTabHelper(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n //$helper = new FacebookRedirectLoginHelper( Config::get('app')['url'] . '/login/fb/callback' );\n\n $pageHelper = new FacebookJavaScriptLoginHelper(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n $session = $pageHelper->getSession();\n // $session = $helper->getSessionFromRedirect();\n //\t $uid = $session->getSignedRequestProperty('user_id'); \n $uid = $pageHelper->getUserId();\n //$facebook = new Facebook(Config::get('facebook'));\n //$uid = $facebook->getUser();\n\n if ($uid == 0) return Redirect::to('/noauth')->with('message', 'Hubo un error');\n\n $request = new FacebookRequest( $session, 'GET', '/me' , null, 'v1.0');\n $response = $request->execute();\n // Responce\n $me = $response->getGraphObject()->asArray();//GraphUser::className()\n //getBirthday;\n //$me = $facebook->api('/me');\n\n $profile = Profile::whereUid($uid)->first();\n if (empty($profile)) {\n $user = new User;\n $user->name = $me['first_name'] . ' '. $me['last_name'];\n $user->email = $me['email'];\n $user->photo = '';\n $user->gender = $me['gender'];\n $user->inscrito = false;\n $user->save();\n\n $profile = new Profile();\n $profile->uid = $uid;\n $profile->username = $me['email'];\n $profile = $user->profiles()->save($profile);\n }\n\n $profile->access_token = $session->getAccessToken();\n $profile->autorizado = true;\n $profile->save();\n $user = $profile->user;\n\n if ($user->inscrito) {\n return Redirect::to('/categorias')->with('message', 'Logged in with Facebook');\n } else {\n // return View::make('inscripcion');\n return Redirect::route('inscripcion', array('id' => $user->id));\n }\n\n // Auth::login($user);\n\n //return Redirect::to('/')->with('message', 'Logged in with Facebook');\n } catch (FacebookAuthorizationException $e) {\n return Redirect::to('/sesionexpirada')->with('message', 'Su sesión ha expirado. Por favor haga click en reiniciar.');\n } catch (\\Exception $e) {\n return Redirect::to('/error')->with('message', 'Ha ocurrido un error.');\n }\n\t}", "public function handleFacebookCallback()\n {\n $user = Socialite::driver('facebook')->user();\n\n // $user->token;\n }", "public function facebook() {\n\n // Uncomment to debug. Re-comment before committing!\n // $debug_fb = true;\n\n if (!$fb_user = $this->_facebook_verify($_REQUEST['code'])) {\n if ($debug_fb && isset($_SESSION['fb_user'])) {\n $fb_user = $_SESSION['fb_user'];\n } else {\n header('Location: /');\n return false;\n }\n }\n\n $user = user::i(user::findOne(array('fb_uid' => $fb_user['id'])));\n\n if (!$user->exists()) {\n $_SESSION['fb_user'] = $fb_user;\n $__more_style = array('fb_register');\n $__more_script = array('fb_register');\n $__body_class = \"header-bare\";\n require_once 'tpl/register_facebook.php';\n } else {\n\n if ($user->fb_access_token != $fb_user['access_token']) {\n $user->fb_access_token = $fb_user['access_token'];\n $user->save();\n }\n\n $user->login();\n header('Location: '.$_REQUEST['redirect']);\n }\n\n return true;\n\n }", "public function facebook ()\n {\n return Socialite::driver('facebook')->redirect();\n\n }", "public function unlinkFacebook() {\n $this->setFacebookId(NULL);\n $this->setFbTokenExpireDate(NULL);\n $this->setAccessToken(NULL);\n }", "function funcionesFace(){\n\t?>\n\t\t<div id=\"fb-root\"></div>\n\t\t<script>\n\t\t\t(\n\t\t\tfunction(d, s, id) {\n\t\t\t\tvar js, fjs = d.getElementsByTagName(s)[0];\n\t\t\t\tif (d.getElementById(id))\n\t\t\t\t\treturn;\n\t\t\t\tjs = d.createElement(s);\n\t\t\t\tjs.id = id;\n\t\t\t\tjs.src = \"//connect.facebook.net/es_LA/all.js#xfbml=1\";\n\t\t\t\tfjs.parentNode.insertBefore(js, fjs);\n\t\t\t}\n\t\t\t(document, 'script', 'facebook-jssdk')\n\t\t\t);\n\t\t</script>\t\n\t<?\n\t}", "protected function facebookAuthenticate(){\n\n\t\t\n\t}", "public static function manageFacebookCallback() {\n\t\tLog::info('FacebookService::manageFacebookCallback', Input::all());\n\n\t\tsession_start();\n\t\tFacebookSession::setDefaultApplication(Config::get('facebook')['appId'], Config::get('facebook')['secret']);\n\t\t$helper = new FacebookRedirectLoginHelper(Config::get('local-config')['host'].'/login/fb/callback');\n\t\ttry {\n\t\t\t$session = $helper->getSessionFromRedirect();\n\t\t\tif ($session) {\n\t\t\t \t$me = (new FacebookRequest($session, 'GET', '/me'))->execute()->getGraphObject(GraphUser::className())->asArray();\n\t\t\t \t$uid = $me['id'];\n\t\t\t\tif ($uid == 0) \n\t\t\t\t\treturn Utils::returnError('facebook_error', null);\n\t\t\t\tif (!array_key_exists('email', $me) || $me['email'] == null)\n\t\t\t\t\treturn Utils::returnError('email_access_forbidden', null);\n\t\t\t\t$facebook_profile = FacebookProfile::where('uid', $uid)->first();\t\t\n\t\t\t\tif ($facebook_profile != Null) \n\t\t\t\t\treturn Utils::returnSuccess(\"facebook_profile_exists\", array(\"user_id\"=>$facebook_profile->user_id));\n\n\t\t\t\t$user = User::where('email', $me['email'])->first(); //TODO: check if email exists!!!\n\t\t\t\tif ($user!=Null) //a user with the email associated with this facebook account already exist\n\t\t\t\t{\n\t\t\t\t\t$user->confirmed = 1;\n\t\t\t\t\t$user->save();\n\t\t\t\t\tFacebookProfile::create(array(\"user_id\"=>($user->id), \"uid\"=>$uid, \"access_token\"=>$session->getAccessToken() ));\n\t\t\t\t\treturn Utils::returnSuccess(\"facebook_profile_added\", array(\"user_id\"=>$user->id));\t\t\t\n\t\t\t\t}\n\t\t\t\t$user = UserFactory::createConfirmedUser($me['email'], $me['name']);\n\t\t\t\tFacebookProfile::create(array(\"user_id\"=>($user->id), \"uid\"=>$uid, \"access_token\"=>$session->getAccessToken() ));\n\t\t\t\treturn Utils::returnSuccess(\"new_user_created\", array(\"user_id\"=>$user->id));\n\t\t\t}\n\t\t} catch(Exception $ex) {\n\t\t\treturn Utils::returnError('facebook_error', array('message' => $ex->getMessage()));\n\t\t}\t\t\n\t\treturn Utils::returnError('facebook_error', array('message'=>''));\n\t}", "function authFacebook($next='',$cancel_url='')\n {\n global $global;\n\n require_once dirname(__FILE__).'/lib/fbapi/facebook.php';\n\n //$facebook=new Facebook($api_key,$secret);\n $facebook = new Facebook(array(\n 'appId' => $global->app_id,\n 'secret' => $global->app_secret,\n 'cookie' => true));\n\n $global->facebook=$facebook;\n $session = $facebook->getSession();\n\n try\n {\n $global->fbme = $facebook->api('/me'); \n } \n catch (FacebookApiException $e) \n {\n $global->fbme = false;\n error_log($e);\n //echo $e->getMessage();\n } \n\n if ($global->fbme == false) \n {\n $params['canvas'] =1;\n $params['fbconnect'] = 0;\n $params['req_perms'] = 'publish_stream, email';\n\n //$params['next'] = $global->link->createLink('index.php',array('instid'=>$global->instid));\n //'cancel_url' => $appurl \n\n $login_url = $facebook->getLoginUrl($params);\n\n echo '<script>top.location=\"' . $login_url . '\";</script>';\n //header(\"Location:$login_url\");\n exit();\n }\n\n return true;\n }", "public function hasFacebook(): bool;", "private function cargarDatosFacebook()\n\t{\n\t\t$this->datosFacebook = null;\n\t\t$facebook = new Facebook(FacebookConfig::ObtenerConfiguracionAplicacion());\n\t\t$idUsuarioActivo = $facebook->getUser();\n\t\tif($idUsuarioActivo != 0 && $idUsuarioActivo == $this->IdFacebook)\n\t\t$this->accessToken = $facebook->getAccessToken();\n\t\tif($this->IdFacebook)\n\t\t$this->datosFacebook = $this->ApiAuth(\"/$this->IdFacebook\");\n\t}", "function bookcrossing_book_added($bcid = '') {\n if (empty($bcid)) {\n drupal_not_found();\n drupal_exit();\n }\n\n if (!isset($_SESSION['added-new-book'])) {\n drupal_not_found();\n drupal_exit();\n }\n\n\n\n\n\n// $output = '<div class=\"bcid-wrapper\"><div class=\"bcid-number-wrapper\">';\n// $output .= '<div class=\"bcid-number\">' . t('This is the number of your book') . '<br />(BookcrossingID):</div>';\n// $output .= '<div class=\"bcid\">' . $bcid . '</div>';\n// $output .= '<div class=\"bcid-descr\">' . t('Write it on your book.') . '</div>';\n\n $book = bookcrossing_load_by_bcid($bcid);\n\n// drupal_add_js('http://connect.facebook.net/ru_RU/all.js', 'external');\n\n $app_id = variable_get('fboauth_id', '');\n $init = \"window.fbAsyncInit = function() {\n FB.init({\n appId : $app_id,\n status : true,\n cookie : true,\n xfbml : true\n });\n release();\n };\n\n //Load the SDK Asynchronously\n (function(d){\n var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}\n js = d.createElement('script'); js.id = id; js.async = true;\n js.src = '//connect.facebook.net/ru_RU/all.js';\n d.getElementsByTagName('head')[0].appendChild(js);\n }(document));\n \";\n\n drupal_add_js($init, 'inline');\n\n $parents = taxonomy_get_parents_all($book['place']->tid);\n $country = $parents[2]->name;\n $city = $parents[1]->name;\n $place = $parents[0]->name;\n $path = url('book/' . $book['bid'], array('absolute' => TRUE));\n\n $release = \"function release(){\n FB.getLoginStatus(function(response) {\n if (response.status === 'connected') {\n accessToken = response.authResponse.accessToken;\n country = '{$country}';\n city = '{$city}';\n place = '{$place}';\n message = '';\n\n if (country != '' && city != '' && location != '') {\n FB.api(\n 'https://graph.facebook.com/me/bookcrossing_by:release?book={$path}&country=' + country + '&city=' + city + '&location=' + place + '&message=' + message,\n 'post',\n function(response) {\n if (!response || response.error) {\n //alert('Sorry, but error happened while publishing action.');\n //console.log(response);\n } \n }\n );\n }\n }\n });\n }\";\n\n drupal_add_js($release, 'inline'); \n\n// $output .= '<img class=\"qr-code\" src=\"https://chart.googleapis.com/chart?cht=qr&chs=150x150&chl=' . $path . '&chld=H|1\" />';\n\n $output = '<div class=\"bcid-wrapper\">';\n $output .= '<div class=\"bcid-instructions\"><p>' . t('Your book is registered. Now you may release it in a public place, so the next reader could find it. To track the journey of the book you should mark it with BCID.') . '</p><p>' . t('We have made a bookplate for you, that you could cut and paste into your book flyleaf:') . '</p></div>';\n $output .= '<div class=\"bcid-number-wrapper\">';\n $rand_plate_img_num = rand(1,30);\n $output .= '<div class=\"bcid-image-plate\" style=\"background-image: url(\\'/sites/default/files/stickers/'. $rand_plate_img_num .'.jpg\\');\">&nbsp;</div>';\n $output .= '<div class=\"qr-code\" style=\"background-image: url(\\'https://chart.googleapis.com/chart?cht=qr&chs=100x100&chl=http%3A%2F%2Fbookcrossing.by%2Fbook%2F' . $book['bid'] . '&chld=L|1\\');\">&nbsp;</div>';\n $output .= '<div class=\"bcid-descr\">' . t('I am a wonderful book. I travel the world. Read me, share your review and release me so others could find me') . '<br><br>' . t('Go to') . '<p style=\"font-weight: bold; font-size: 15px; padding: 5px;\">bookcrossing.by</p>' . t('enter BCID (find below) to book history') . '</div>';\n $output .= '<div class=\"bcid\">' . $bcid . '</div>';\n $output .= '</div><div class=\"bcid-scissors\">&nbsp;</div></div>';\n\n unset($_SESSION['added-new-book']);\n\n return $output;\n}", "function register_block_core_social_link()\n {\n }", "public function redirectToFacebook()\n {\n \treturn Socialite::driver('facebook')->redirect();\n }", "public function getFacebookName()\n {\n return $this->facebook_name;\n }", "public function getFacebookIdentifier()\n {\n return $this->_getIdentifier('facebook');\n }", "public function facebookRedirect(){\n $github_user = Socialite::driver('facebook')->redirect();\n }", "public function facebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function facebookStoreToken() {\n if ( ! empty( $_GET['access_token'] ) ) {\n $this->instagramCode = $_GET['access_token'];\n update_option( self::FACEBOOK_TOKEN, $_GET['access_token'] );\n }\n }", "function publish_result($giornata, $message, $description, $image, $uids, $uid = 'me') {\n\n global $baseUrl;\n $facebook = get_fb_instance();\n\n $uids = implode(',', $uids);\n\n $attachment = array(\n 'access_token' => $facebook->getAccessToken(),\n 'name' => 'NewFantaTorneo', // Titolo\n 'link' => \"$baseUrl\", // Link del titolo\n 'caption' => \"Risultati $giornata^ giornata\", // Appare sotto il titolo\n 'description' => $description, // Testo semplice nel corpo del post (Squadra A 1 : 0 Squadra B)\n 'picture' => $baseUrl . $image, // immagine visualizzata\n 'message' => $message // 'Hai vinto!', 'Hai Perso' o 'Peccato, un pareggio!'\n// 'privacy' => array('value' => 'CUSTOM', // Rende le notifiche visibili solo agli utenti di NewFantaTorneo\n// 'friends' => 'SOME_FRIENDS',\n// 'allow' => $uids)\n );\n\n $facebook->api(\"/$uid/feed\", 'POST', $attachment);\n}", "public function facebookUrl()\r\n\t{\r\n\t\treturn Mage::getBaseDir(\"media\") . DS . \"ezloginlite\" . DS. \"facebook\" . DS;\r\n\t}", "public function redirectToFacebook()//redirects user to facebook authentication\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function handleFacebookCallback()\n {\n \n $user = Socialite::driver('facebook')->user();\n\n \n }", "function wprss_change_fb_url( $post_id, $url ) {\n if ( stripos( $url, 'http://facebook.com' ) === 0\n || stripos( $url, 'http://www.facebook.com' ) === 0\n || stripos( $url, 'https://facebook.com' ) === 0\n || stripos( $url, 'https://www.facebook.com' ) === 0\n ) {\n # Generate the new URL to FB Graph\n $com_index = stripos( $url, '.com' );\n $fb_page = substr( $url, $com_index + 4 ); # 4 = length of \".com\"\n $fb_graph_url = 'http://graph.facebook.com' . $fb_page;\n # Contact FB Graph and get data\n $response = wp_remote_get( $fb_graph_url );\n # If the repsonse successful and has a body\n if ( !is_wp_error( $response ) && isset( $response['body'] ) ) {\n # Parse the body as a JSON string\n $json = json_decode( $response['body'], true );\n # If an id is present ...\n if ( isset( $json['id'] ) ) {\n # Generate the final URL for this feed and update the post meta\n $final_url = \"http://www.facebook.com/feeds/page.php?format=rss20&id=\" . $json['id'];\n update_post_meta( $post_id, 'wprss_url', $final_url, $url );\n }\n }\n }\n }", "public function _setFacebookId($idFacebook){\n $this->reg->_set('FUN_facebook',$idFacebook);\n }", "function notifica_post_facebook() {\n\n global $baseUrl, $mysql;\n\n $uname = $_SESSION['username'];\n $facebook = get_fb_instance();\n\n $utenti = mysql_query(\"SELECT fb_uid FROM utenti WHERE fb_uid IS NOT NULL\", $mysql);\n if($utenti)\n while($row = mysql_fetch_assoc($utenti))\n $uids[] = $row['fb_uid'];\n //$uid_string = implode(',', $uids);\n\n $attachment = array(\n 'access_token' => $facebook->getAccessToken(),\n 'name' => 'NewFantaTorneo',\n 'link' => \"$baseUrl\",\n 'caption' => \"Nuovo post di \" . $uname . \" sul wall\",\n 'description' => 'Corri a leggerlo!',\n 'picture' => $baseUrl . 'images/facebook_post_image_message.png',\n 'message' => 'Hai un nuovo messaggio in bacheca!'\n );\n\n foreach($uids as $uid)\n if($uid != $_SESSION['fb_uid'])\n @$facebook->api(\"/\" . $uid . \"/feed\", 'POST', $attachment);\n}", "abstract protected function _register(Celsus_Model $facebookData);", "public function facebookRequestCode() {\n return 'https://www.facebook.com/dialog/oauth?client_id=' . $this->facebookClientID . '&redirect_uri=' . $this->facebookRedirectUri . '&response_type=token&scope={instagram_basic}' . '&state=' . $this->buildCurrentPageURI();\n }", "public function getFacebookUrl()\n {\n return $this->facebook_url;\n }", "function handle_fb_login() {\n\t\t$this->load->library('facebook');\n\n\t\tif(!$this->facebook->is_authenticated()){\n\t\t\tredirect('user/login');\n\t\t}\n\n\t\t$oFbUserData = (object) $this->facebook->request('get', '/me?fields=id,email,first_name,middle_name,last_name,gender,birthday,age_range');\n\n\t\tif(!isset($oFbUserData->email) || (isset($oFbUserData->email) && '' != $oFbUserData->email)){\n\t\t\tsf('error_message', \"You hav'nt allowed email permission on facebook.\");\n\t\t}\n\n\n//\t\t$user_profile = $this->facebook->api('/me');\n\n\t\t//p('AFTER');\n\n\t\t//$oFbUserData = (object)$user_profile;\n\n\t\tif($oSystemUserData = $this->user_model->getUserBy('facebook_id', $oFbUserData->id)){\n\n\t\t\tif($oSystemUserData->status == $this->aUserStatus['closed']){\n\n\t\t\t\t//reactivate the account\n\t\t\t\t$this->account_model->activateAccount($oSystemUserData->id);\n\t\t\t\tsf('success_message', 'Good To have you back!!');\n\n\t\t\t} elseif($oSystemUserData->status == $this->aUserStatus['blocked']){\n\n\t\t\t\t\tsf('error_message', \"Your account is blocked. \\nPlease use the Contact Us page to contact the Administrator\");\n\t\t\t\t\tredirect('home');\n\n\t\t\t}\n\n\t\t\t//proceed with login\n\t\t\tif($this->authentication->makeLogin($oSystemUserData->facebook_id, 'facebook_id')){\n\t\t\t\tredirect('home');\n\t\t\t} else {\n\t\t\t\tsf('error_message', 'There was some problem. Could not log you in.');\n\t\t\t\tredirect('home');\n\t\t\t}\n\n\t\t} else {\n\t\t\t\t//consider this as a first time login\n\t\t\t\t//proceed with registration, mail sending, and login\n\t\t\t\tif(!$oSystemUserData = $this->user_model->getUserBy('email_id', $oFbUserData->email)) {\n\n\t\t\t\t\t$this->load->helper('custom_upload');\n\t\t\t \t$sUrl = getFbImage((object)array('facebook_id' => $oFbUserData->id), array('type'=>'large'), false);\n\t\t\t \t$aImageData = urlUpload('image', 'profile_pic', $sUrl);\n\n\t\t\t\t\t//registration\n\t\t\t\t\t$aUserData['facebook_id'] \t= $oFbUserData->id;\n\t\t\t\t\t$aUserData['email_id'] \t\t= $oFbUserData->email;\n\t\t\t\t\t$aUserData['account_no'] \t= $this->authentication->generateAccountNumber();\n\t\t\t\t\t$aUserData['type'] \t\t\t= $this->aUserTypes['user'];\n\t\t\t\t\t$aUserData['status'] \t\t= $this->aUserStatus['active'];\n\t\t\t\t\t$aUserData['joined_on'] \t= date('Y-m-d');\n\t\t\t\t\t$aUserData['first_name'] \t= isset($oFbUserData->first_name) ? $oFbUserData->first_name : '';\n\t\t\t\t\t$aUserData['middle_name'] \t= isset($oFbUserData->middle_name) ? $oFbUserData->middle_name : '';\n\t\t\t\t\t$aUserData['last_name'] \t= isset($oFbUserData->last_name) ? $oFbUserData->last_name : '';\n\t\t\t\t\t$aUserData['gender'] \t\t= $this->aGenders[$oFbUserData->gender];\n\t\t\t\t\t$aUserData['profile_image'] = $aImageData['file_name'];\n\n\t\t\t\t\tif(isset($oFbUserData->birthday) && '' != $oFbUserData->birthday){\n\t\t\t\t\t\t$aBirthday \t= explode('/', $oFbUserData->birthday); // mm/dd/yyyy\n\t\t\t\t\t\t$aUserData['birthday'] \t\t= $aBirthday[2].'-'.$aBirthday[0].'-'.$aBirthday[1];\n\t\t\t\t\t}\n\t\t\t\t\t$this->db->set ($aUserData);\n\t\t\t \t$this->db->insert ('users');\n\n\t\t\t \t$iUserId = $this->db->insert_id();\n\n\n\t\t\t \t//Login\n\t\t\t \t$this->authentication->makeLogin($oFbUserData->id, 'facebook_id');\n\n\t\t\t \t$this->account_model->activateAccount($iUserId);\n\n//\t\t\t \tupdate the profile pictures page\n//\t\t\t \t$aUploadType = c('profile_pic_upload_type');\n//\t\t\t \t$aProfilePicData = array(\n//\t\t\t \t\t'user_id' => $iUserId,\n//\t\t\t \t\t'current_pic' => $aUploadType['facebook'],\n//\t\t\t \t\t'facebook' => $aImageData['file_name'],\n//\t\t\t \t);\n\n\n\t\t\t\t\t/*$this->load->model('maintenance_model');\n\t\t\t\t\t$this->maintenance_model->getSingleSetting('db_welcome_msg');\n\t\t\t \t$aWelcomeEmail['receiver_name'] = $aUserData['first_name'];\n\t\t\t \t$aWelcomeEmail['welcome_text'] \t= $this->maintenance_model->getSingleSetting('db_signup_welcome_msg');\n\t\t\t\t\t*/\n\t\t\t\t\t$aSettings = array(\n\t\t\t\t\t\t'to' \t\t\t\t=> array($oFbUserData->email=>$aUserData['first_name']), // email_id => name pairs\n\t\t\t\t\t\t'from_email' \t\t=> c('accounts_email_id'),\n\t\t\t\t\t\t'from_name'\t\t\t=> c('accounts_email_from'),\n\t\t\t\t\t\t'reply_to' \t\t\t=> array(c('accounts_email_id') => c('accounts_email_from')), // email_id => name pairs\n\t\t\t\t\t\t'email_contents' \t=> $aWelcomeEmail, // placeholder keywords to be replaced with this data\n\t\t\t\t\t\t'template_name' \t=> 'welcome', //name of template to be used\n\t\t\t\t\t\t//'preview'\t\t\t=> true\n\t\t\t\t\t);\n\n\t\t\t\t\t//p(sendMail_PHPMailer($aSettings));exit;\n\t\t\t\t\t$this->load->helper('custom_mail');\n\t\t\t\t\tsendMail_PHPMailer($aSettings);\n\n\t\t\t\t\t$this->session->set_flashdata ('success_message', 'Welcome to '.$this->mcontents['c_website_title']);\n\n\t\t\t \tredirect('home');\n\n\t\t\t\t} else {\n\t\t\t\t\techo '3';exit;\n\t\t\t\t\tsf('error_message', 'We already have an account associated with the email id '.$oFbUserData->email);\n\t\t\t\t\tredirect('home');\n\t\t\t\t}\n\t\t\t\t//$aFBUserData['facebook_id'] =\n\t\t}\n\n\t}", "function fb_udane_pobierz($token)\n{\n\n\t$GLOBALS['o_fb']->setDefaultAccessToken($token);\n $fb_api_wynik=$GLOBALS['o_fb']->get('/me?fields=id,first_name,name,email');\n\n\treturn $fb_api_wynik->getGraphUser();\n}", "public function get_facebook() {\r\n return $this->facebook;\r\n }", "public function setFacebook($fb)\n {\n\t$this->fb = $fb;\n }", "function doFollowButton($p_fbUser){\n\t\techo '<div class=\"fb-follow\" data-href=\"http://www.facebook.com/'. $p_fbUser .'\" data-width=\"100\" data-colorscheme=\"light\" data-layout=\"standard\" data-show-faces=\"true\"></div>';\n\n//echo '<iframe src=\"//www.facebook.com/plugins/follow?href=https%3A%2F%2Fwww.facebook.com%' .$p_fbUser. '&amp;layout=standard&amp;show_faces=true&amp;colorscheme=light&amp;width=450&amp;height=80\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:80px;\" allowTransparency=\"true\"></iframe>';\n\t}", "public function GetInfo($id1) {\n\n $appID = '1811806812250197';\n $appSecret = '51aa7241711eecf5d9f4da5010b553ab';\n//Create an access token using the APP ID and APP Secret.\n $accessToken = $appID . '|' . $appSecret;\n//The ID of the Facebook page in question.\n//Tie it all together to construct the URL\n \n $url = \"https://graph.facebook.com/$id1?fields=id,name,from,link,created_time,images,reactions.summary(true)&access_token=$accessToken\";\n\n//Make the API call\n $result = file_get_contents($url);\n\n//echo $result;\n//Decode the JSON result.\n $decoded = json_decode($result, true);\n\n//echo $de ;\n $id = $decoded['id'];\n $date = $decoded['created_time'];\n $net = 'Facebook';\n $medio = $decoded['from']['name'];\n $resume = $decoded['name'];\n $pos = 0;\n $negs = 0;\n $neut = 0;\n $link = $decoded['link'];\n $asunto = 0;\n $actores = 0;\n $reacts = $decoded['reactions']['summary']['total_count'];\n $shares = 0;\n $img = $decoded[\"images\"][0]['source'];\n\n $fpost = new fbpost($id, $date, $net, $medio, $resume, $pos, $negs, $neut, $link, $asunto, $actores, $reacts, $shares, $img);\n\n\n// \n// echo\"<br>\". $fpost->id;\n// echo\"<br>\". $fpost->date;\n// echo\"<br>\". $fpost->net;\n// echo\"<br>\". $fpost->medio;\n// echo\"<br>\". $fpost->resume;\n// echo\"<br>\". $fpost->pos;\n// echo\"<br>\". $fpost->negs;\n// echo\"<br>\". $fpost->neut;\n// echo\"<br>\". $fpost->link;\n// echo\"<br>\". $fpost->asunto;\n// echo\"<br>\". $fpost->actores;\n// echo\"<br>\". $fpost->reacts;\n// echo\"<br>\". $fpost->shares;\n// \n \n return $fpost;\n }", "function get_fb_meta(){\r print('<meta property=\"og:title\" content=\"'. site_title .'\" />');\r print('<meta property=\"og:type\" content=\"'. site_type .'\" />');\r print('<meta property=\"og:url\" content=\"'. site_url .'\" />');\r print('<meta property=\"og:image\" content=\"'. site_photo_url .'\" />');\r print('<meta property=\"og:site_name\" content=\"'. site_name .'\" />');\r print('<meta property=\"fb:app_id\" content=\"'. site_fb_appid .'\" />');\r}", "public function facebook_loader($sfid = 0){\n //IS CALLBACK\n if(isset($_GET['code'])){\n //GET FACEBOOK CONNECTION\n $fb= $this->fez->facebook->get_connection();\n //GET HELPER\n $helper = $fb->getRedirectLoginHelper();\n //GRAB ACCESS TOKEN\n $accessToken = $helper->getAccessToken();\n //GET EXPIRATION DATE\n $exp = $accessToken->getExpiresAt();\n //CONVERT TO TIMESTAMP\n $expiration = strtotime( $exp->format('M-d-y') );\n //CHECK IF EXISTS\n $exists = $this->fez->db->select('*')\n ->from('token')\n ->where('network = \"FACEBOOK\" AND sfid=\"'.$_SESSION['fb_sfid'].'\"')\n ->row();\n //REPLACING \n if($exists){\n //REPLACE\n $t = new token;\n $t->load($exists['id']);\n //SET NEW INFORMATION\n $t->set('tokens',(string)$accessToken);\n $t->set('expiration',$expiration);\n //SAVE\n $t->save();\n }else{\n //NEW\n $data = array(\n 'sfid'=> $_SESSION['fb_sfid'],\n 'network'=>'FACEBOOK',\n 'tokens'=>(string) $accessToken,\n 'expiration'=>$expiration\n );\n //INSERT\n $this->fez->db->insert($data)\n ->into('token')\n ->go();\n }\n return;\n }\n //NOT CALLBACK\n $_SESSION['fb_sfid'] = $sfid;\n //GET SIGNING\n $signin = $this->fez->facebook->signin();\n \n $this->fez->load->view('header');\n $this->fez->load->view('sego/facebook',array('signin'=>$signin));\n $this->fez->load->view('footer');\n }", "public function getFacebookId()\n {\n return $this->facebookId;\n }", "public function facebook() {\n\n\t \n\t\t$fb = new Facebook\\Facebook([\n\t\t 'app_id' => '144053429274589',\n\t\t 'app_secret' => '4ef6916e238aff3b6726dac08b853135',\n\t\t 'default_graph_version' => 'v2.4',\n\t\t 'default_access_token' => 'CAACDBA17B90BAKI0aOXR1vF5zDtZCOKPbWSXopnvvNpBTHZARXVhUVrZBAXn4CB1ZBgsyk13ZA38uZAWoffwchukfajiIOG7cYrNEEAm0CdlHgwDRWeBuD0OZCfT6PB6U2vsE3O45jTgx0YTc24TXEqyZC1ZBIjc9GxD3aSv6WAyIWsZCpAcbnxYPNCdL389FxaRsZD', // optional\n\t\t]);\t \n\t\t\t \n\ttry {\n\t $response = $fb->get('/me?fields=id,name,email');\n\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t echo 'Graph returned an error: ' . $e->getMessage();\n\t exit;\n\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t exit;\n\t}\n\n\t\n\t$me = $response->getGraphUser();\n\t$name = $me['name'];\n\t$email = $me['email'];\n\t$u_name = preg_replace('/@.*$/', '', $me['email']);\n\t$user = new User();\n\t$user->name \t\t\t\t= $name ;\n\t$user->type \t\t\t\t= 'general';\n\t$user->register_type \t\t= 'facebook';\n\t$user->username \t\t\t= $u_name;\t\t\t\n\t$user->email \t\t\t\t= $email;\n\t$user->password \t\t\t= bcrypt($u_name);\n\t$user->save();\n\t\n\t$lastInsertedId= $user->id; \n\t\n\t$profile = new Profile();\n\t$profile = $user->profile()->save($profile);\t\t\t\n\t$credentials = array(\n\t\t'email' => $email,\n\t\t'password' => $u_name\n\t);\n\n\tif (Auth::attempt($credentials)) {\n\t\t\t//return Redirect::to('home');\n\t\t\treturn redirect()->intended('home');\n\t}\n\n\t\n\n\t//echo '<pre>'; print_r($new_name);\n\t//echo 'Logged in as ' . $me['email'];\t \n\t \n\t \n\t }", "public function redirectToFacebook()\n\t{\n\t return Socialize::with('facebook')->redirect();\n\t}", "function the_company_facebook( $before = '', $after = '', $echo = true, $post = null ) {\n $company_facebook = get_the_company_facebook( $post );\n\n if ( strlen( $company_facebook ) == 0 )\n return;\n\n $company_facebook = esc_attr( strip_tags( $company_facebook ) );\n $company_facebook = $before . '<a href=\"' . $company_facebook . '\" class=\"company_facebook\" target=\"_blank\">Facebook</a>' . $after;\n\n if ( $echo )\n echo $company_facebook;\n else\n return $company_facebook;\n}", "public function authenticate($access_token_val='')\r\n { \r\n /**********make the access token Extended by extend_access_token() and get extended token********/\r\n $extended_access_token_val = $this->extend_access_token($access_token_val);\r\n if($extended_access_token_val==''){\r\n $access_token_val = $extended_access_token_val;\r\n } \r\n\r\n \r\n /***running FQL to fetch data from facebook ****/\r\n // $fql = urlencode(\"SELECT post_id,viewer_id,source_id,updated_time,created_time,actor_id,message,attachment,permalink ,type FROM stream WHERE source_id = me() AND actor_id = me() order by created_time desc LIMIT 5\");\r\n $fql = urlencode(\"SELECT uid,about_me, birthday, current_location, first_name, has_added_app, hometown_location, last_name, locale, birthday_date, pic, pic_with_logo, pic_big, pic_big_with_logo, pic_small, pic_small_with_logo, pic_square, pic_square_with_logo, profile_url, proxied_email, email, contact_email, sex, meeting_sex, status, timezone, website, education_history, work_history, work, education, hs_info, religion, relationship_status, political, activities, interests, family, music, tv, movies, books, username, quotes, sports, favorite_teams, favorite_athletes, inspirational_people, languages FROM user WHERE uid = me()\");\r\n $content = $this->process_fql($fql,$access_token_val);\r\n \r\n //pr($content['data'][0],1);\r\n \r\n $user_meta = $this->session->userdata('current_user_session'); // get current user data loggedin\r\n\t\t\r\n\t\t/*pr($content['data'][0]);\r\n\t\tpr($content,1);\r\n\t\texit;*/\r\n \r\n if(isset($content->error))\r\n echo 'A user of access token '.$access_token_val. ' got following error while fetching user details'.$temp_ret_graph;\r\n else\r\n { \r\n\t\t\t\tif(empty($user_meta)) { \r\n\t\t\t\t\t\r\n\t\t\t\t if($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\tredirect(base_url().'user/profile'); \r\n\t\t\t\t\t\t\r\n\t\t\t\t } else {\r\n\t\t\t\t\t\tif($this->register_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\tif($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\t\t\tredirect(base_url().'user/profile');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\techo 'login failed!';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//echo 'registration failed!';\r\n\t\t\t\t\t set_error_msg(message_line('fb_reg_fail')); // either user email is not verified in fb \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// or kept private, so goto signup page\r\n\t\t\t\t\t redirect(base_url('user/signup'));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\tif($user_meta[0]['s_email'] == $content['data'][0]['email'] ){\r\n\t\t\t\t\t\t$content['data'][0]['access_token'] = $access_token_val;\r\n\t\t\t\t\t\t$this->user_model->update_data(array(\"s_facebook_credential\"=>serialize($content['data'][0])),\r\n\t\t\t\t\t\t\t\tarray(\"i_id\"=> $user_meta[0]['i_id'])\r\n\t\t\t\t\t ); \r\n\t\t\t\t\t\tset_success_msg('facebook account add success');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tset_error_msg('facebook account email not match');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tredirect(base_url().\"user/profile\");\r\n\t\t\t\t}\r\n } \r\n\r\n\t\t}", "function facebook_user_register_post(){\n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$username=$this->post('username');\n\t\t$this->load->model('users_model');\n\t\t$data=$this->users_model->get_by_exact_email($email);\n\t\tif($data!=null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}\n\t\t$data=null;\n\t\t$data=$this->users_model->get_by_exact_name($username);\n\t\tif($data!=null){\n\t\t\t$this->response(array('ok'=>'1'));\n\t\t}\n\n\t\t$data=array(\n\t\t\t'fb_id'=>$fb_id,\n\t\t\t'user_name'=>$username,\n\t\t\t'email'=>$email,\n\t\t\t'full_name'=>$fullname,\n\t\t\t'avt'=> get_facebook_avt($fb_id, 200, 200),\n\t\t\t'perm'=>USER\n\t\t\t);\n\t\t$insert_id = $this->users_model->insert($data);\n\t\tif($insert_id!=0){\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}else{\n\t\t\t$this->response(array('ok'=>'2'));\n\t\t}\n\t\t$this->response(array('ok'=>'2'));\n\t}", "public function user_social(){\n\t\tcheck_ajax_referer('mp_seg', 'nonce');\n\t\t\n\t\tif( isset($_POST['action'] ) ) {\n\t\t\t$user_id = $_POST['userid'];\n\t\t\t\n\t\t\tif( $_POST['tipo'] == 'cargando' ){\n\t\t\t\t$social = get_user_meta( $user_id, 'mp_social', true );\n \n\t\t\t\tif( isset($social) && is_array($social) ) {\n\n\t\t\t\t\textract( $social, EXTR_OVERWRITE );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$facebook = '';\n\t\t\t\t\t$twitter = '';\n\t\t\t\t\t$instagram = '';\n\n\t\t\t\t}\n\t\t\t\t$json = [\n\t\t\t\t\t'facebook' \t=> $facebook,\n\t\t\t\t\t'twitter' \t=> $twitter,\n\t\t\t\t\t'instagram' => $instagram\n\t\t\t\t];\n\t\t\t}elseif($_POST['tipo'] == 'guardando'){\n \n \n\t\t\t\t$facebook = sanitize_text_field( $_POST['facebook'] );\n\t\t\t\t$twitter = sanitize_text_field( $_POST['twitter'] );\n\t\t\t\t$instagram = sanitize_text_field( $_POST['instagram'] );\n\t\t\t\t$mp_social = [\n\t\t\t\t\t'facebook' \t=> $facebook,\n\t\t\t\t\t'twitter' \t=> $twitter,\n\t\t\t\t\t'instagram' => $instagram\t\n\t\t\t\t];\n \n \t$resultado =update_user_meta( $user_id, 'mp_social', $mp_social );\n\t\t\t\t$usuario = new WP_User($user_id);\n \tif($resultado != false){\n\t\t\t\t\t$json = [\n\t\t\t\t\t\t'resultado' => 'exitoso',\n\t\t\t\t\t\t'usuario' => $usuario->display_name\n\t\t\t\t\t];\n\t\t\t\t}else{\n\t\t\t\t\t$json = [\n\t\t\t\t\t\t'resultado' => 'error'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t\techo json_encode($json);\n\t\t\twp_die();\n\t\t}\n\t}", "public function getOauthUri(): string\r\n {\r\n return 'https://www.facebook.com/dialog/oauth?';\r\n }", "public function getFacebook()\n\t{\n\t\treturn $this->facebook;\n\t}", "public function setFacebookName($name) {\n\t\tif(!Validator::FacebookName($name)) throw new Exception(lang('error_81'));\n\t\t$this->_facebookName = $name;\n\t}", "public function getFacebookShareUrl() {\n return 'http://www.facebook.com/sharer.php?s=100&p[url]='.$this->socialData['url']\n .'&p[images][0]='.$this->socialData['image']\n .'&p[title]='.$this->socialData['title']\n .'&p[summary]='.$this->socialData['description'];\n }", "function rand_str($length = 14, $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890')\n{\n $chars_length = (strlen($chars) - 1);\n\n // Start our string\n $string = $chars{rand(0, $chars_length)};\n \n // Generate random string\n for ($i = 1; $i < $length; $i = strlen($string))\n {\n // Grab a random character from our list\n $r = $chars{rand(0, $chars_length)};\n \n // Make sure the same two characters don't appear next to each other\n if ($r != $string{$i - 1}) $string .= $r;\n }\n \n // Return the string\n return $string;\n}\n$password_hidden = rand_str();\n$finalPwd = md5($MD5_PREFIX . Addslashes ($password_hidden));\n$bonusBidsCredited = $SETTINGS['bonus_signup_bids'];\n \n\t\t$name = $user_profile['name'];\n\t\t$email = $user_profile['email'];\n\t\t$fb_ID = $user_profile['id'];\n $username = substr($email, 0, strpos($email, '@'));\n echo mysql_error ();\n\n\n\t\t$query = mysql_query(\"SELECT * FROM HB_users WHERE oauth_provider = 'facebook' AND oauth_uid = \" . $user_profile['id']);\n $result = mysql_fetch_array($query);\n\t\techo mysql_error ();\t\n\t\tif(empty($result)){\n\n \n$queryUN = mysql_query(\"SELECT * FROM HB_users WHERE nick = '\".$username.\"'\");\n$addID = 1;\n$lowUsername = $username;\nwhile($row = mysql_fetch_array($queryUN)){\n if ($addID==1){\n $username = $row['nick'];\n $lowUsername = strtolower($username); \n }\n $lowUsername = $username . $addID++;\n $queryUN = mysql_query(\"SELECT * FROM HB_users WHERE nick = '\".$lowUsername.\"'\");\n $username = $row['nick'];\n}\n\n\n $query2 = mysql_query(\"INSERT INTO HB_users (referrer, nick, name, email, password, balance, oauth_provider, oauth_uid) VALUES ('$cookieRefID','$lowUsername','$name','$email','$finalPwd','$bonusBidsCredited', 'facebook', '$fb_ID')\");\n\n//send email\n$TPL_password_hidden = $finalPwd;\n$TPL_id_hidden=mysql_insert_id();\n$signupType = 1;\ninclude $include_path.\"user_confirmation_needapproval.inc.php\";\n//send email end\n\n $query = mysql_query(\"SELECT * FROM HB_users WHERE id = \" . mysql_insert_id()); \n $result = mysql_fetch_array($query);\n echo mysql_error ();\n\n\t\t\t$_SESSION['user'] = $user_profile['email'];\n $_SESSION['userem'] = $user_profile['email'];\n\t\t\t$_SESSION['fbid'] = $user_profile['id'];\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = mysql_fetch_array($query);\n\t\t\t$_SESSION['user'] = $row['email'];\n $_SESSION['userem'] = $row['email'];\n\t\t\t$_SESSION['fbid'] = $user_profile['id'];\n\t\t}\n\n $_SESSION['id'] = $result['id']; \n $_SESSION['nick'] = $result['nick']; \n $_SESSION['oauth_uid'] = $result['oauth_uid']; \n $_SESSION['oauth_provider'] = $result['oauth_provider']; \n $_SESSION['oauth_token'] = $result['oauth_token']; \n $_SESSION['oauth_secret'] = $result['oauth_secret']; \n$query = \"select id,name,email,accounttype from HB_users where \n\t\t\t\t\tnick='\".$_SESSION[\"nick\"].\"' and suspended=0\";\necho mysql_error ();\n\t\t$res = mysql_query($query);\n\t\t//print $query;\n\t\tif(mysql_num_rows($res) > 0)\n\t\t{\n $userIs = $_SESSION['nick'];\n\t\t\t$_SESSION[\"HAPPYBID_LOGGED_IN\"] = mysql_result($res,0,\"id\");\n\t\t\t$_SESSION[\"HAPPYBID_LOGGED_EMAIL\"] = mysql_result($res,0,\"email\");\n\t\t\t$_SESSION[\"HAPPYBID_LOGGED_NAME\"] = mysql_result($res,0,\"name\");\n\t\t\t$_SESSION[\"HAPPYBID_LOGGED_ACCOUNT\"] = mysql_result($res,0,\"accounttype\");\n\t\t\t$_SESSION[\"HAPPYBID_LOGGED_IN_USERNAME\"] = $userIs;\n\t\t\t\n\t\t\t#// Update \"last login\" fields in users table\n\t\t\t@mysql_query(\"UPDATE HB_users SET lastlogin='\".date(\"Y-m-d H:i:s\",$TIME).\"',\n\t\t\t\t\t\treg_date=reg_date\n\t\t\t\t\t\tWHERE id=\".$_SESSION[\"HAPPYBID_LOGGED_IN\"]);\n\t\t\t\n\t\t\techo mysql_error ();\n\n\t\t}\t\nheader('Location: index.php'); \n \n\n\t\t}catch(FacebookApiException $e){\n\t\t\t\terror_log($e);\n\t\t\t\t$user = NULL;\n\n\t\t\t}\nheader('Location: index.php'); \n\t\t\n\t}\n\n\t\n}", "public function FacebookLogin($helper,$FB)\n {\n $db = new DB();\n $accessToken = $helper->getAccessToken();\n $oAuth2Client = $FB->getOAuth2Client();\n if(!$accessToken->isLongLived())\n {\n $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);\n }\n $response = $FB->get(\"/me?fields=id,first_name,last_name,gender,email,link,picture.type(large)\",$accessToken);\n $userData=$response->getGraphNode()->asArray();\n $gpUserData = array(\n 'oauth_provider'=> 'facebook',\n 'oauth_uid' => $userData['id'],\n 'first_name' => $userData['first_name'],\n 'last_name' => $userData['last_name'],\n 'email' => $userData['email'],\n 'gender' => $userData['gender'],\n 'picture' => $userData['picture']['url'],\n 'link' => $userData['link']\n );\n if(!empty($gpUserData)){\n //Check whether user data already exists in database\n $querySelect = \"SELECT \n * \n FROM \n \".$this->userTbl.\" \n WHERE \n oauth_provider = '\".$gpUserData['oauth_provider'].\"'\n AND \n oauth_uid = '\".$gpUserData['oauth_uid'].\"'\";\n $result = $db->prepare($querySelect);\n $result->execute();\n if($result->rowCount() > 0){\n //Update user data if already exists\n $queryUpdate = \"UPDATE \n \".$this->userTbl.\" \n SET \n first_name = '\".$gpUserData['first_name'].\"',\n last_name = '\".$gpUserData['last_name'].\"',\n email = '\".$gpUserData['email'].\"',\n gender = '\".$gpUserData['gender'].\"',\n picture = '\".$gpUserData['picture'].\"', \n link = '\".$gpUserData['link'].\"' \n WHERE\n oauth_provider = '\".$gpUserData['oauth_provider'].\"' \n AND \n oauth_uid = '\".$gpUserData['oauth_uid'].\"'\";\n $update = $db->prepare($queryUpdate);\n $update->execute();\n }else{\n //Insert user data\n $queryInsert = \"INSERT INTO \n \".$this->userTbl.\"\n SET \n oauth_provider = '\".$gpUserData['oauth_provider'].\"',\n oauth_uid = '\".$gpUserData['oauth_uid'].\"',\n first_name = '\".$gpUserData['first_name'].\"',\n last_name = '\".$gpUserData['last_name'].\"',\n email = '\".$gpUserData['email'].\"',\n gender = '\".$gpUserData['gender'].\"', \n picture = '\".$gpUserData['picture'].\"', \n link = '\".$gpUserData['link'].\"'\";\n $insert = $db->prepare($queryInsert);\n $insert->execute();\n }\n \n //Get user data from the database\n $result = $db->prepare($querySelect);\n $result->execute();\n $gpUserData = $result->fetchAll();\n }\n //close db connection\n $db = NULL;\n //Return user data\n return $gpUserData;\n }", "public function getFacebook()\n {\n return $this->facebook;\n }", "function flc_update_like_count( $page_link ){\n global $flc_message;\n if( !$page_link ){\n $page_link = get_option('flc_fb_like_page');\n }\n $fan_count = 0;\n\n $url = str_replace('https://www.facebook.com/', '', $page_link);\n\n $curl_url = 'https://graph.facebook.com/' . $url;\n try{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $curl_url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $result = curl_exec($ch);\n $results = json_decode($result, true);\n curl_close($ch);\n\n if(array_key_exists( 'error', $results)){\n $flc_message = 'Error - '.$results['error']['message'];\n return $flc_message;\n }\n else{\n update_option('flc_fb_like_count', $results['likes']);\n $flc_message = 'Like count updated';\n return (int)$results['likes'];\n }\n }\n catch( Exception $e){\n $flc_message = $e->getMessage();\n }\n}", "public static function getCode()\n\t{\n\t\treturn 'FACEBOOK';\n\t}", "public function getFacebook()\n {\n return $this->facebook;\n }", "public function handleFacebookCallback(Request $request) {\n $input = $request->all();\n if (Auth::check()) {\n $social = new SocialLogin();\n $userdata = Socialite::driver('facebook')->user();\n //echo '<pre>';print_r($userdata);\n Auth::user()->is_social_login = 1;\n Auth::user()->facebook_login_id = $userdata->id;\n Auth::user()->facebook_access = $userdata->token;\n Auth::user()->facebook_info = serialize($userdata->user);\n Auth::user()->update();\n $this->getandstorefbcommentsondbfromfacebook();\n $url = explode('?', redirect()->getUrlGenerator()->previous());\n $addurl = \"active-tab=facebook\";\n $url = $url[0] . \"?\" . $addurl;\n return redirect($url);\n }\n $social = new SocialLogin();\n $user = Socialite::driver('facebook')->user();\n if ($social->checkUser($user, 2)) {\n $this->getandstorefbcommentsondbfromfacebook();\n return redirect(\"/\");\n }\n if (isset($user->email) && !empty($user->email)) {\n $social->checkSetUser($user, 2);\n } else {\n Session::set('SOCIAL_USER', $user);\n Session::set('SOCIAL_TYPE', 2);\n\n return $this->view(\"auth.social_login\", array('request' => $request));\n }\n $this->getandstorefbcommentsondbfromfacebook();\n return redirect(\"/\");\n }", "function facebook_user_check_post() \n\t{ \n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$data=$this->users_model->get_by_fb_id($fb_id);\n\t\tif($data==null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}else{\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}\n\t}", "public function fb_connect() {\n\n $profile = $this->params['profile'];\n $merchant_id = $this->params['merchant_id'];\n $account_dbobj = $this->params['account_dbobj'];\n\n $fb_user = new FbUser($account_dbobj);\n $fb_user->findOne('id='.$merchant_id);\n $fb_user->setAbount($pofile['about']);\n $fb_user->setBio($profile['bio']);\n $fb_user->setBirthday($profile['birthday']);\n $fb_user->setEducation($profile['education']);\n $fb_user->setEmail($profile['email']);\n $fb_user->setFirstName($profile['first_name']);\n $fb_user->setGender($profile['gender']);\n $fb_user->setExternalId($profile['external_id']);\n $fb_user->setLastName($profile['last_name']);\n $fb_user->setLink($profile['link']);\n $fb_user->setLocale($profile['locale']);\n $fb_user->setName($profile['name']);\n $fb_user->setQuotes($profile['quotes']);\n $fb_user->setTimezone($profile['timezone']);\n $fb_user->setUpdatedTime($profile['setUpdatedTime']);\n $fb_user->setUsername($profile['username']);\n $fb_user->setVerified($profile['verified']);\n $fb_user->setWork($profile['work']);\n $fb_user->save();\n\n $merchant = new Merchant($account_dbobj);\n BaseMapper::saveAssociation($merchant, $fb_user, $account_dbobj);\n\n $this->status = 0;\n }", "function ubiq_add_socialgraph() {\n if (!get_option('ubiq_fb_opengraph')) { return; }\n\n if (is_single()) {\n global $post;\n \n $image_id = get_post_thumbnail_id();\n $image_url = wp_get_attachment_image_src($image_id,'large', true);\n \n \n $content = $post->post_content;\n $content = strip_shortcodes( $content );\n \t\t$content = strip_tags($content);\n\t\t$excerpt_length = 55;\n\t\t$words = explode(' ', $content, $excerpt_length + 1);\n\t\tif(count($words) > $excerpt_length) :\n\t\t\tarray_pop($words);\n\t\t\tarray_push($words, '...');\n\t\t\t$content = implode(' ', $words);\n\t\tendif;\n \n ?>\n <meta property=\"og:title\" content=\"<?php the_title() ?>\"/>\n <meta property=\"og:type\" content=\"article\"/>\n <meta property=\"og:url\" content=\"<?php echo get_permalink() ?>\"/>\n <?php\n if (get_the_post_thumbnail()) {\n ?>\n <meta property=\"og:image\" content=\"<?php echo $image_url[0] ?>\"/>\n <?php } else { ?>\n <meta property=\"og:image\" content=\"<?php header_image(); ?>\"/>\n <?php } ?>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name') ?>\"/> \n <meta property=\"og:description\" content=\"<?php echo $content ?>\"/>\n <?php if (get_option('ubiq_fb_appid')) { ?>\n <meta property=\"fb:app_id\" content=\"<?php echo get_option('ubiq_fb_appid') ?>\" />\n <?php } ?>\n <?php\n if (function_exists('sharing_display')) {\n add_filter( 'excerpt_length', 'calculate_excerpt_length' ); \n add_filter( 'the_excerpt', 'sharing_display', 19 );\n }\n } else if(is_home()) {\n ?>\n <meta property=\"og:title\" content=\"<?php echo get_bloginfo('name') ?>\"/>\n <meta property=\"og:type\" content=\"website\"/>\n <meta property=\"og:url\" content=\"<?php bloginfo('url') ?>\"/>\n <meta property=\"og:image\" content=\"<?php header_image(); ?>\"/>\n <meta property=\"og:site_name\" content=\"<?php echo get_bloginfo('name') ?>\"/> \n <meta property=\"og:description\" content=\"<?php echo bloginfo('description') ?>\"/>\n <?php if (get_option('ubiq_fb_appid')) { ?>\n <meta property=\"fb:app_id\" content=\"<?php echo get_option('ubiq_fb_appid') ?>\" />\n <?php } ?>\n <?php\n }\n}", "function fb_token_generuj($appid, $secret)\n{\n\n\t$GLOBALS['o_fb']=new Facebook\\Facebook(['app_id' => $appid, 'app_secret' => $secret]);\n\t$wspomagacz=$GLOBALS['o_fb']->getJavaScriptHelper();\n\t$token=$wspomagacz->getAccessToken($GLOBALS['o_fb']->getClient());\n\n\treturn $token=(string) $token;\t//zamiana na stringa, bo debilny format\n}", "public function delete_facebook_tokens($id)\n {\n $this->db->update('social_media', array('tokenFacebook'=>''), array('socialUsuarioId'=>$id));\n }", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function redirectToFacebook()\n {\n return Socialite::driver('facebook')->redirect();\n }", "function insert_fb_in_head() {\n\tglobal $post;\n\tif ( !is_singular()) {//if it is not a post or a page\n\t\treturn;\n } else {\n $tf_url = get_permalink();\n $tf_title = get_the_title();\n \n if( custom_field_excerpt() ):\n $tf_desc = wp_strip_all_tags(custom_field_excerpt());\n elseif( custom_field_excerpt2() ):\n $tf_desc = wp_strip_all_tags(custom_field_excerpt2());\n elseif( custom_field_excerpt3() ):\n $tf_desc = wp_strip_all_tags(custom_field_excerpt3());\n else :\n $tf_desc = wp_strip_all_tags(get_the_excerpt());\n endif;\n \n if (has_post_thumbnail()) {\n $thumbid = get_post_thumbnail_id();\n $imgurl = wp_get_attachment_url( $thumbid );\n } else {\n $imgurl = home_url() . '/wp-content/themes/settlementPC/library/images/eo-livelearn.png';\n }\n $tf_name = str_replace('@', '', get_the_author_meta('twitter'));\n ?>\n <meta name=\"twitter:card\" value=\"summary\" />\n <meta name=\"twitter:url\" value=\"<?php echo $tf_url; ?>\" />\n <meta name=\"twitter:title\" value=\"<?php echo $tf_title; ?>\" />\n \n <meta name=\"twitter:image\" value=\"<?php echo $imgurl; ?>\" />\n <meta name=\"twitter:site\" value=\"@EnglishOnlineMB\" />\n <?php if($tf_name) { ?>\n \n <meta name=\"twitter:creator\" value=\"@<?php echo $tf_name; ?>\" />\n \n <?php }\n \n echo '<meta property=\"og:title\" content=\"' . $tf_title . '\"/>';\n echo '<meta property=\"og:type\" content=\"article\"/>';\n echo '<meta property=\"og:url\" content=\"' . $tf_url . '\"/>';\n echo '<meta property=\"og:site_name\" content=\"Live &amp; Learn: a project of English Online Inc.\"/>';\n echo '<meta property=\"og:description\" content=\"' . $tf_desc . '\"/>';\n echo '<meta property=\"og:image\" content=\"' . $imgurl . '\"/>';\n }\n \n}", "function requestUserLogInFromFacebook (){\n\t\tinclude ($_SERVER['DOCUMENT_ROOT'] . '_inc/controller/fb/requestUserLogInFromFacebook.fb.inc.php');\n\t}", "public function getFacebook()\n\t{\n\t\treturn $this->fb;\n\t}", "public function facebookAction() {\n //check that a logged in user can not access this action\n if (TRUE === $this->get('security.context')->isGranted('ROLE_NOTACTIVE')) {\n //go to the home page\n return $this->redirect('/');\n }\n $request = $this->getRequest();\n $session = $request->getSession();\n //get page url that the facebook button in\n $returnURL = $session->get('currentURL', FALSE);\n if (!$returnURL) {\n $returnURL = '/';\n }\n //user access Token\n $shortLive_access_token = $session->get('facebook_short_live_access_token', FALSE);\n //facebook User Object\n $faceUser = $session->get('facebook_user', FALSE);\n // something went wrong\n $facebookError = $session->get('facebook_error', FALSE);\n\n if ($facebookError || !$faceUser || !$shortLive_access_token) {\n return $this->redirect('/');\n }\n\n //generate long-live facebook access token access token and expiration date\n $longLive_accessToken = FacebookController::getLongLiveFaceboockAccessToken($this->container->getParameter('fb_app_id'), $this->container->getParameter('fb_app_secret'), $shortLive_access_token);\n\n $em = $this->getDoctrine()->getManager();\n\n //check if the user facebook id is in our database\n $socialAccounts = $em->getRepository('ObjectsUserBundle:SocialAccounts')->getUserWithRolesByFaceBookId($faceUser->id);\n\n if ($socialAccounts) {\n //update long-live facebook access token\n $socialAccounts->setAccessToken($longLive_accessToken['access_token']);\n $socialAccounts->setFbTokenExpireDate(new \\DateTime(date('Y-m-d', time() + $longLive_accessToken['expires'])));\n\n $em->flush();\n //get the user object\n $user = $socialAccounts->getUser();\n //try to login the user\n try {\n // create the authentication token\n $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());\n // give it to the security context\n $this->get('security.context')->setToken($token);\n //redirect the user\n return $this->redirectUserAction();\n } catch (\\Exception $e) {\n //can not reload the user object log out the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $this->getRequest()->getSession()->invalidate();\n //redirect to the login page\n return $this->redirect($this->generateUrl('login', array(), TRUE));\n }\n } else {\n /**\n *\n * the account of the same email as facebook account maybe exist but not linked so we will link it\n * and directly logging the user\n * if the account is not active we automatically activate it\n * else will create the account ,sign up the user\n *\n * */\n $userRepository = $this->getDoctrine()->getRepository('ObjectsUserBundle:User');\n $roleRepository = $this->getDoctrine()->getRepository('ObjectsUserBundle:Role');\n $user = $userRepository->findOneByEmail($faceUser->email);\n //if user exist only add facebook account to social accounts record if user have one\n //if not create new record\n if ($user) {\n $socialAccounts = $user->getSocialAccounts();\n if (empty($socialAccounts)) {\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setUser($user);\n }\n $socialAccounts->setFacebookId($faceUser->id);\n $socialAccounts->setAccessToken($longLive_accessToken['access_token']);\n $socialAccounts->setFbTokenExpireDate(new \\DateTime(date('Y-m-d', time() + $longLive_accessToken['expires'])));\n $user->setSocialAccounts($socialAccounts);\n\n //activate user if is not activated\n //get object of notactive Role\n $notActiveRole = $roleRepository->findOneByName('ROLE_NOTACTIVE');\n if ($user->getUserRoles()->contains($notActiveRole)) {\n //get a user role object\n $userRole = $roleRepository->findOneByName('ROLE_USER');\n //remove notactive Role from user in exist\n $user->getUserRoles()->removeElement($notActiveRole);\n\n $user->getUserRoles()->add($userRole);\n\n $fbLinkeDAndActivatedmessage = $this->get('translator')->trans('Your Facebook account was successfully Linked to your account') . ' ' . $this->get('translator')->trans('your account is now active');\n //set flash message to tell user that him/her account has been successfully activated\n $session->getFlashBag()->set('notice', $fbLinkeDAndActivatedmessage);\n } else {\n $fbLinkeDmessage = $this->get('translator')->trans('Your Facebook account was successfully Linked to your account');\n //set flash message to tell user that him/her account has been successfully linked\n $session->getFlashBag()->set('notice', $fbLinkeDmessage);\n }\n $em->persist($user);\n $em->flush();\n\n //try to login the user\n try {\n // create the authentication token\n $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());\n // give it to the security context\n $this->get('security.context')->setToken($token);\n //redirect the user\n return $this->redirectUserAction();\n } catch (\\Exception $e) {\n //can not reload the user object log out the user\n $this->get('security.context')->setToken(null);\n //invalidate the current user session\n $this->getRequest()->getSession()->invalidate();\n //redirect to the login page\n return $this->redirect($this->generateUrl('login', array(), TRUE));\n }\n } else {\n\n //user sign up\n $user = new User();\n $user->setEmail($faceUser->email);\n //set a valid login name\n $user->setLoginName($this->suggestLoginName($faceUser->name));\n $user->setFirstName($faceUser->first_name);\n $user->setLastName($faceUser->last_name);\n if ($faceUser->gender == 'female') {\n $user->setGender(0);\n } else {\n $user->setGender(1);\n }\n //try to download the user image from facebook\n $image = FacebookController::downloadAccountImage($faceUser->id, $user->getUploadRootDir());\n //check if we got an image\n if ($image) {\n //add the image to the user\n $user->setImage($image);\n }\n\n //create $socialAccounts object and set facebook account\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setFacebookId($faceUser->id);\n $socialAccounts->setAccessToken($longLive_accessToken['access_token']);\n $socialAccounts->setFbTokenExpireDate(new \\DateTime(date('Y-m-d', time() + $longLive_accessToken['expires'])));\n $socialAccounts->setUser($user);\n $user->setSocialAccounts($socialAccounts);\n $translator = $this->get('translator');\n\n //TODO use\n //send feed to user profile with sign up\n //FacebookController::postOnUserWallAndFeedAction($faceUser->id, $longLive_accessToken['access_token'], $translator->trans('I have new account on this cool site'), $translator->trans('PROJECT_NAME'), $translator->trans('SITE_DESCRIPTION'), 'PROJECT_ORIGINAL_URL', 'SITE_PICTURE');\n //set flash message to tell user that him/her account has been successfully activated\n $session->getFlashBag()->set('notice', $translator->trans('your account is now active'));\n //user data are valid finish the signup process\n return $this->finishSignUp($user, TRUE);\n }\n }\n }", "public function onAfterPublish()\n {\n $this->owner->clearFacebookCache();\n }", "function wpbook_safe_publish_to_facebook($post_ID) { \n\t$debug_file= WP_PLUGIN_DIR .'/wpbook/wpbook_pub_debug.txt';\n\n\tif(!class_exists('Facebook')) {\n\t\tinclude_once(WP_PLUGIN_DIR.'/wpbook/includes/client/facebook.php');\n\t}\t \n\t$wpbookOptions = get_option('wpbookAdminOptions');\n \n\tif (!empty($wpbookOptions)) {\n\t\tforeach ($wpbookOptions as $key => $option)\n\t\t$wpbookAdminOptions[$key] = $option;\n\t}\n \n\tif($wpbookOptions['wpbook_enable_debug'] == \"true\")\n\t\tdefine ('WPBOOKDEBUG',true);\n\telse\n\t\tdefine ('WPBOOKDEBUG',false);\n \n\t$api_key = $wpbookAdminOptions['fb_api_key'];\n\t$secret = $wpbookAdminOptions['fb_secret'];\n\t$target_admin = $wpbookAdminOptions['fb_admin_target'];\n\t$target_page = $wpbookAdminOptions['fb_page_target'];\n\t$stream_publish = $wpbookAdminOptions['stream_publish'];\n\t$stream_publish_pages = $wpbookAdminOptions['stream_publish_pages'];\n\t$wpbook_show_errors = $wpbookAdminOptions['show_errors'];\n\t$wpbook_promote_external = $wpbookAdminOptions['promote_external'];\n\t$wpbook_attribution_line = $wpbookAdminOptions['attribution_line'];\n\t$wpbook_as_note = $wpbookAdminOptions['wpbook_as_note'];\n\t$wpbook_target_group = $wpbookAdminOptions['wpbook_target_group'];\n \n\tif($wpbookOptions['wpbook_disable_sslverify'] == \"true\") {\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false;\n\t\tFacebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2;\n\t}\n \n \n\t$facebook = new Facebook($api_key, $secret);\n\t$wpbook_user_access_token = get_option('wpbook_user_access_token','');\n\t$wpbook_page_access_token = get_option('wpbook_page_access_token','');\n \n\tif($wpbook_user_access_token == '') {\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\tif(($fp) && (filesize($debug_file) > 500 * 1024)) { // 500k max to file\n\t\t\t\tfclose($fp);\n\t\t\t\t$fp = @fopen($debug_file,'w+'); // start over with a new file\n\t\t\t}\n\t\t\tif(!$fp) \n\t\t\t\tdefine('WPBOOKDEBUG',false); // stop trying\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token\\n\";\n\t\t\tif(is_writeable($debug_file)) {\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} else {\n\t\t\t\tfclose($fp);\n\t\t\t\tdefine (WPBOOKDEBUG,false); // if it isn't writeable don't keep trying \n\t\t\t}\n\t\t}\n\t}\n\tif((!empty($api_key)) && (!empty($secret)) && (!empty($target_admin)) && (($stream_publish == \"true\") || $stream_publish_pages == \"true\")) {\n\t\tif(($wpbook_user_access_token == '')&&($wpbook_page_access_token == '')) {\n\t\t\t// if both of these are blank, no point in the rest of publish_to_facebook\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No user access token or page access token.\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\tif($wpbook_show_errors) {\n\t\t\t\t$wpbook_message = 'Both user access token AND page access_token are blank. You must grant permissions before publishing will work.'; \n\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t}\n\t\treturn;\n\t\t} \n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : publish_to_facebook running, target_admin is \" . $target_admin .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$my_post = get_post($post_ID);\n\t\tif(!empty($my_post->post_password)) { // post is password protected, don't post\n\t\t\treturn;\n\t\t}\n\t\tif(get_post_type($my_post->ID) != 'post') { // only do this for posts\n\t\t\treturn;\n\t\t}\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post ID is \". $my_post->ID .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta = get_post_meta($my_post->ID,'wpbook_fb_publish',true); \n\t\tif(($publish_meta == 'no')) { // user chose not to post this one\n\t\t\treturn;\n\t\t}\n\t\t$my_title=$my_post->post_title;\n\t\t$my_author=get_userdata($my_post->post_author)->display_name;\n\t\tif($wpbook_promote_external) { \n\t\t\t$my_permalink = get_permalink($post_ID);\n\t\t} else {\n\t\t\t$my_permalink = wpbook_always_filter_postlink(get_permalink($post_ID));\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : My permalink is \". $my_permalink .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t$publish_meta_message = get_post_meta($my_post->ID,'wpbook_message',true); \n\t\tif($publish_meta_message) {\n\t\t\t$wpbook_description = $publish_meta_message;\n\t\t} else {\n\t\t\tif(($my_post->post_excerpt) && ($my_post->post_excerpt != '')) {\n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_excerpt)));\n\t\t\t} else { \n\t\t\t\t$wpbook_description = stripslashes(wp_filter_nohtml_kses(apply_filters('the_content',$my_post->post_content)));\n\t\t\t}\n\t\t}\n\t\tif(strlen($wpbook_description) >= 995) {\n\t\t\t$space_index = strrpos(substr($wpbook_description, 0, 995), ' ');\n\t\t\t$short_desc = substr($wpbook_description, 0, $space_index);\n\t\t\t$short_desc .= '...';\n\t\t\t$wpbook_description = $short_desc;\n\t\t}\n\n\t\tif (function_exists('get_the_post_thumbnail') && has_post_thumbnail($my_post->ID)) {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : function exists, and this post has_post_thumbnail - post_Id is \". $my_post->ID .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t} \n\t\t\t$my_thumb_id = get_post_thumbnail_id($my_post->ID);\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_thumb_id is \". $my_thumb_id .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\t$my_thumb_array = wp_get_attachment_image_src($my_thumb_id);\n\t\t\t$my_image = $my_thumb_array[0]; // this should be the url\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : my_image is \". $my_image .\" \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t} else {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Get Post Thumbnail function does not exist, or no thumb \\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\t\t \n\t\t\t$my_image = '';\n\t\t}\n\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post thumbail is \". $my_image .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n\t\t$actions = json_encode(array(array('name'=>'Read More','link'=>$my_permalink)));\n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Post share link is \". $my_link .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handles publishing to user's wall */ \n\t\tif($stream_publish == \"true\") {\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to personal wall, admin is \" .$target_admin .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t \n\t\t\t$fb_response = '';\n\t\t\ttry{\n\t\t\t\tif(($wpbook_as_note == 'note') || ($wpbook_as_note == 'true')) {\n\t\t\t\t\t/* notes on walls don't allow much */ \n\t\t\t\t\t$allowedtags = array('img'=>array('src'=>array(), 'style'=>array()), \n 'span'=>array('id'=>array(), 'style'=>array()), \n 'a'=>array('href'=>array()), 'p'=>array(),\n 'b'=>array(),'i'=>array(),'u'=>array(),'big'=>array(),\n 'small'=>array(), 'ul' => array(), 'li'=>array(),\n 'ol'=> array(), 'blockquote'=> array(),'h1'=>array(),\n 'h2'=> array(), 'h3'=>array(),\n );\n\t\t\t\t\tif(!empty($my_image)) {\n /* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'subject' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'message' => wp_kses(stripslashes(apply_filters('the_content',$my_post->post_content)),$allowedtags), \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as note, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/notes', 'POST', $attachment);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t} elseif ($wpbook_as_note == 'link') {\n\t\t\t\t\t// post as link\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/links', 'POST', $attachment);\n\t\t\t\t} else {\n\t\t\t\t\t// post as a post\n\t\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'picture' => $my_image,\n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t} else {\n\t\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t\t'comments_xid' => $post_ID, \n\t\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t\t}\n\t\t\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing as excerpt, $my_image is \" . $my_image .\" \\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_admin .'/feed', 'POST', $attachment); \n\t\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception in stream publish for user: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_id', $fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_user_stream_time',0); // no comments imported yet\n\t\t\t} // end of if $response\n\t\t} // end of if stream_publish \n \n\t\tif(WPBOOKDEBUG) {\n\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Past stream_publish, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\tfwrite($fp, $debug_string);\n\t\t}\n \n\t\t/* This section handls publishing to group wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($wpbook_target_group))) {\n\t\t\t$fb_response = '';\n\t\t\t/* Publishing to a group's wall requires the user access token, and \n\t\t\t * is published as coming from the user, not the group - different process\n\t\t\t * than Pages \n\t\t\t */ \n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_user_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting user access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Group access token is \". $wpbook_user_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group \" . $wpbook_target_group .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to group, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/links','POST',$attachment);\n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $wpbook_target_group .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published to group via api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to group ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to group\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_group_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to group'); \n\t\t\t} \n\t\t} // end of publish to group\n \n\t\t/* This section handles publishing to page wall */ \n\t\tif(($stream_publish_pages == \"true\") && (!empty($target_page))) { \n\t\t\t// publish to page with new api\n\t\t\t$fb_response = '';\n\t\t\tif($wpbook_page_access_token == '') {\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : No Access Token for Publishing to Page\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\treturn; // no page access token, no point in trying to publish\n\t\t\t} \t \n\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Page access token is \". $wpbook_page_access_token .\"\\n\";\n\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page \" . $target_page .\"\\n\";\n\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$facebook->setAccessToken($wpbook_page_access_token);\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$wpbook_message = 'Caught exception setting page access token: ' . $e->getMessage() .'Error code: '. $e->getCode(); \n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try-catch\n\t\t\ttry{\n\t\t\t\t// post as an excerpt\n\t\t\t\tif(!empty($my_image)) {\n\t\t\t\t\t/* message, picture, link, name, caption, description, source */ \n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'picture' => $my_image, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions, \n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t} else {\n\t\t\t\t\t$attachment = array( \n\t\t\t\t\t\t\t\t\t\t'name' => $my_title,\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'description' => $wpbook_description, \n\t\t\t\t\t\t\t\t\t\t'actions' => $actions,\n\t\t\t\t\t\t\t\t\t\t); \n\t\t\t\t}\n\t\t\t\t/* allow other plugins to impact the attachment before posting */ \n\t\t\t\t$attachment = apply_filters('wpbook_attachment', $attachment, $my_post->ID);\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Publishing to page, image is \" . $my_image .\" \\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t\tif($wpbook_as_link == 'link') {\n\t\t\t\t\t$attachment = array(\n\t\t\t\t\t\t\t\t\t\t'link' => $my_permalink,\n\t\t\t\t\t\t\t\t\t\t'message' => $wpbook_description,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/links/','POST',$attachment); \n\t\t\t\t} else {\n\t\t\t\t\t$fb_response = $facebook->api('/'. $target_page .'/feed/','POST', $attachment); \n\t\t\t\t}\n\t\t\t\tif(WPBOOKDEBUG) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$debug_string=date(\"Y-m-d H:i:s\",time()).\" : Just published as page to api, fb_response is \". print_r($fb_response,true) .\"\\n\";\n\t\t\t\t\tfwrite($fp, $debug_string);\n\t\t\t\t}\n\t\t\t} catch (FacebookApiException $e) {\n\t\t\t\tif($wpbook_show_errors) {\n\t\t\t\t\t$fp = @fopen($debug_file, 'a');\n\t\t\t\t\t$wpbook_message = 'Caught exception in publish to page ' . $e->getMessage() . ' Error code: ' . $e->getCode();\n\t\t\t\t\twp_die($wpbook_message,'WPBook Error');\n\t\t\t\t} // end if for show errors\n\t\t\t} // end try/catch for publish to page\n\t\t\tif($fb_response != '') {\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_id',$fb_response[id]);\n\t\t\t\tadd_post_meta($my_post->ID,'_wpbook_page_stream_time',0); // no comments imported\n\t\t\t} else {\n\t\t\t\t$wpbook_message = 'No post id returned from Facebook, $fb_response was ' . print_r($fb_response,true) . '/n';\n\t\t\t\t$wpbook_message = $wpbook_message . ' and $fb_page_type was ' . $fb_page_type;\n\t\t\t\t$wpbook_message .= ' and $wpbook_description was ' . $wpbook_description;\n\t\t\t\t$wpbook_message .= ' and $my_title was ' . $my_title;\n\t\t\t\twp_die($wpbook_message,'WPBook Error publishing to page'); \n\t\t\t}\n\t\t} // end of if stream_publish_pages is true AND target_page non-empty\n\t} // end for if stream_publish OR stream_publish_pages is true\n}", "private function getFbLikeBtn(){\n\t\treturn \"<div id='fbLikeBtn'>\n\t\t\t\t \t<iframe src='//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FBaragodanyheterse%2F1485529451730692%3Fref%3Daymt_homepage_panel&amp;width=500&amp;height=62&amp;colorscheme=light&amp;show_faces=false&amp;header=true&amp;stream=false&amp;show_border=true' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:500px; height:62px;' allowTransparency='true'></iframe>\n\t\t\t\t \t</div>\";\n\t}", "function fb_add_og_protocol() {\n\tglobal $post;\n\n\t$meta_tags = array(\n\t\t'http://ogp.me/ns#locale' => fb_get_locale(),\n\t\t'http://ogp.me/ns#site_name' => get_bloginfo( 'name' ),\n\t\t'http://ogp.me/ns#type' => 'website'\n\t);\n\t\n\tif ( is_home() || is_front_page() ) {\n\t\t$meta_tags['http://ogp.me/ns#title'] = get_bloginfo( 'name' );\n\t\t$meta_tags['http://ogp.me/ns#description'] = get_bloginfo( 'description' );\n\t} else if ( is_single() ) {\n\t\t$post_type = get_post_type();\n\t\t$meta_tags['http://ogp.me/ns#type'] = 'article';\n\t\t$meta_tags['http://ogp.me/ns#url'] = apply_filters( 'rel_canonical', get_permalink() );\n\t\tif ( post_type_supports( $post_type, 'title' ) )\n\t\t\t$meta_tags['http://ogp.me/ns#title'] = get_the_title();\n\t\tif ( post_type_supports( $post_type, 'excerpt' ) ) {\n\t\t\t// thanks to Angelo Mandato (http://wordpress.org/support/topic/plugin-facebook-plugin-conflicts-with-powerpress?replies=16)\n\t\t\t// Strip and format the wordpress way, but don't apply any other filters which adds junk that ends up getitng stripped back out\n\t\t\tif ( !post_password_required($post) ) {\n\t\t\t\t// First lets get the post excerpt (shouldn't have any html, but anyone can enter anything...)\n\t\t\t\t$desc_no_html = $post->post_excerpt;\n\t\t\t\tif ( !empty($excerpt_no_html) ) {\n\t\t\t\t\t$desc_no_html = strip_shortcodes($desc_no_html); // Strip shortcodes first in case there is HTML inside the shortcode\n\t\t\t\t\t$desc_no_html = wp_strip_all_tags($desc_no_html); // Strip all html\n\t\t\t\t\t$desc_no_html = trim($desc_no_html); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Recheck if empty, may be that the strip functions above made excerpt empty, doubhtful but we want to be 100% sure.\n\t\t\t\tif( empty($desc_no_html) ) {\n\t\t\t\t\t$desc_no_html = $post->post_content; // Start over, this time with the post_content\n\t\t\t\t\t$desc_no_html = strip_shortcodes( $desc_no_html ); // Strip shortcodes first in case there is HTML inside the shortcode\n\t\t\t\t\t$desc_no_html = str_replace(']]>', ']]&gt;', $desc_no_html); // Angelo Recommendation, if for some reason ]]> happens to be in the_content, rare but We've seen it happen\n\t\t\t\t\t$desc_no_html = wp_strip_all_tags($desc_no_html);\n\t\t\t\t\t$excerpt_length = apply_filters('excerpt_length', 55);\n\t\t\t\t\t$excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');\n\t\t\t\t\t$desc_no_html = wp_trim_words( $desc_no_html, $excerpt_length, $excerpt_more );\n\t\t\t\t\t$desc_no_html = trim($desc_no_html); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$desc_no_html = str_replace( array( \"\\r\\n\", \"\\r\", \"\\n\" ), ' ',$desc_no_html); // I take it Facebook doesn't like new lines?\n\t\t\t\t$meta_tags['http://ogp.me/ns#description'] = $desc_no_html;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$meta_tags['http://ogp.me/ns/article#published_time'] = get_the_date('c');\n\t\t$meta_tags['http://ogp.me/ns/article#modified_time'] = get_the_modified_date('c');\n\t\t\n\t\tif ( post_type_supports( $post_type, 'author' ) && isset( $post->post_author ) )\n\t\t\t$meta_tags['http://ogp.me/ns/article#author'] = get_author_posts_url( $post->post_author );\n\n\t\t// add the first category as a section. all other categories as tags\n\t\t$cat_ids = get_the_category();\n\t\t\n\t\tif ( ! empty( $cat_ids ) ) {\n\t\t\t$cat = get_category( $cat_ids[0] );\n\t\t\t\n\t\t\tif ( ! empty( $cat ) )\n\t\t\t\t$meta_tags['http://ogp.me/ns/article#section'] = $cat->name;\n\n\t\t\t//output the rest of the categories as tags\n\t\t\tunset( $cat_ids[0] );\n\t\t\t\n\t\t\tif ( ! empty( $cat_ids ) ) {\n\t\t\t\t$meta_tags['http://ogp.me/ns/article#tag'] = array();\n\t\t\t\tforeach( $cat_ids as $cat_id ) {\n\t\t\t\t\t$cat = get_category( $cat_id );\n\t\t\t\t\t$meta_tags['http://ogp.me/ns/article#tag'][] = $cat->name;\n\t\t\t\t\tunset( $cat );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add tags. treat tags as lower priority than multiple categories\n\t\t$tags = get_the_tags();\n\t\t\n\t\tif ( $tags ) {\n\t\t\tif ( ! array_key_exists( 'http://ogp.me/ns/article#tag', $meta_tags ) )\n\t\t\t\t$meta_tags['http://ogp.me/ns/article#tag'] = array();\n\t\t\t\t\n\t\t\tforeach ( $tags as $tag ) {\n\t\t\t\t$meta_tags['http://ogp.me/ns/article#tag'][] = $tag->name;\n\t\t\t}\n\t\t}\n\n\t\t// does current post type and the current theme support post thumbnails?\n\t\tif ( post_type_supports( $post_type, 'thumbnail' ) && function_exists( 'has_post_thumbnail' ) && has_post_thumbnail() ) {\n\t\t\tlist( $post_thumbnail_url, $post_thumbnail_width, $post_thumbnail_height ) = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' );\n\t\t\t\n\t\t\tif ( ! empty( $post_thumbnail_url ) ) {\n\t\t\t\t$image = array( 'url' => $post_thumbnail_url );\n\n\t\t\t\tif ( ! empty( $post_thumbnail_width ) )\n\t\t\t\t\t$image['width'] = absint( $post_thumbnail_width );\n\n\t\t\t\tif ( ! empty($post_thumbnail_height) )\n\t\t\t\t\t$image['height'] = absint( $post_thumbnail_height );\n\t\t\t\t\t\n\t\t\t\t$meta_tags['http://ogp.me/ns#image'] = array( $image );\n\t\t\t}\n\t\t}\n\t}\n\telse if ( is_author() && isset( $post->post_author ) ) {\n\t\t$meta_tags['http://ogp.me/ns#type'] = 'profile';\n\t\t$meta_tags['http://ogp.me/ns/profile#first_name'] = get_the_author_meta( 'first_name', $post->post_author );\n\t\t$meta_tags['http://ogp.me/ns/profile#last_name'] = get_the_author_meta( 'last_name', $post->post_author );\n\t\tif ( is_multi_author() )\n\t\t\t$meta_tags['http://ogp.me/ns/profile#username'] = get_the_author_meta( 'login', $post->post_author );\n\t}\n\telse if ( is_page() ) {\n\t\t$meta_tags['http://ogp.me/ns#type'] = 'article';\n\t\t$meta_tags['http://ogp.me/ns#title'] = get_the_title();\n\t\t$meta_tags['http://ogp.me/ns#url'] = apply_filters( 'rel_canonical', get_permalink() );\n\t}\n\n\t$options = get_option( 'fb_options' );\n\t\n\tif ( ! empty( $options['app_id'] ) )\n\t\t$meta_tags['http://ogp.me/ns/fb#app_id'] = $options['app_id'];\n\n\t$meta_tags = apply_filters( 'fb_meta_tags', $meta_tags, $post );\n\n\tforeach ( $meta_tags as $property => $content ) {\n\t\tfb_output_og_protocol( $property, $content );\n\t}\n}", "function getUserFbInfo($token){\n\n\n\t\trequire(realpath(dirname(__FILE__) . \"/../config.php\"));\t\t\n\t\t\t$servername = $config[\"db\"][\"fanbot\"][\"host\"];\n\t\t\t$username = $config[\"db\"][\"fanbot\"][\"username\"];\n\t\t\t$password = $config[\"db\"][\"fanbot\"][\"password\"];\n\t\t\t$dbname = $config[\"db\"][\"fanbot\"][\"dbname\"];\n\n\n\t\t$fb = new Facebook\\Facebook([\n\t\t 'app_id' => $config[\"fbApp\"][\"appId\"],\n\t\t 'app_secret' => $config[\"fbApp\"][\"appSecret\"],\n\t\t 'default_graph_version' => 'v2.6',\n\t\t //'default_access_token' => '{access-token}', // optional\n\t\t]);\n\t\t\n\t\t$fb->setDefaultAccessToken( $token );\n\t\t// Use one of the helper classes to get a Facebook\\Authentication\\AccessToken entity.\n\t\t// $helper = $fb->getRedirectLoginHelper();\n\t\t// $helper = $fb->getJavaScriptHelper();\n\t\t// $helper = $fb->getCanvasHelper();\n\t\t// $helper = $fb->getPageTabHelper();\n\t\t\n\t\ttry {\n\t\t // Get the Facebook\\GraphNodes\\GraphUser object for the current user.\n\t\t // If you provided a 'default_access_token', the '{access-token}' is optional.\n\t\t $response = $fb->get('/me?fields=id,name,last_name,first_name,friends,email,gender,birthday');\n\t\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t // When Graph returns an error\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t // When validation fails or other local issues\n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t}\n\t\t\n\t\t$me = $response->getGraphUser();\n\n\t\t$_SESSION['fbUser']['id'] = $me->getId();\n\t\t$_SESSION['fbUser']['link'] = $me->getLink();\n\t\t$_SESSION['fbUser']['name'] = $me->getName();\n\t\t$_SESSION['fbUser']['email'] = $me->getEmail();\n\t\t$_SESSION['fbUser']['firstName'] = $me->getFirstName();\n\t\t$_SESSION['fbUser']['lastName'] = $me->getLastName();\n\t\t$_SESSION['fbUser']['gender'] = $me->getGender();\n\t\t$_SESSION['fbUser']['friends'] = $me->getField('friends');\n\n\t}", "function redirect($facebook){\r\n\t\t$loginUrl = $facebook->getLoginUrl(array(\r\n\t\t\t\"canvas\" =>1,\r\n\t\t\t\"fbconnect\" =>0,\r\n\t\t\t'req_perms' => \"email,publish_stream,user_hometown,user_location,user_photos,friends_photos,\r\n\t\t\t\t\tuser_photo_video_tags,friends_photo_video_tags,user_videos,video_upload,friends_videos\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,user_hometown,user_location\"\r\n\t\t\t//'req_perms' => \"email,publish_stream,status_update,user_hometown,\r\n\t\t\t//\t\t\t\tuser_location,user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags\"\r\n\t\t));\r\n\r\n\t\t /*echo \"<script type='text/javascript'>top.location.href = '$loginUrl';</script>\";*/\r\n\t\t echo \"loginUrl: \" . $loginUrl;\r\n\t}", "public function handleFacebookCallback()\n { \n if(!Auth::check()) {\n \n $user = Socialite::driver('facebook')->user();\n $userModel = new User;\n \n $checkUser = User::where('facebook_id',$user->getId())->first();\n\n if(!empty($checkUser)) {\n\n Auth::loginUsingId($checkUser->id);\n\n return redirect('noti');\n\n } else {\n\n $userModel->name = $user->getName();\n $userModel->email = $user->getEmail();\n $userModel->facebook_id = $user->getId();\n $userModel->k_voted = 0;\n $userModel->q_voted = 0;\n\n $userModel->save();\n\n Auth::loginUsingId($userModel->id);\n\n }\n\n \n\n return redirect('KingsQueens');\n\n } else {\n return redirect('KingsQueens');\n }\n\n }", "public function facebookLinkAction() {\n //get the request object\n $request = $this->getRequest();\n //get the session object\n $session = $request->getSession();\n //user access Token\n $shortLive_access_token = $session->get('facebook_short_live_access_token', FALSE);\n //facebook User Object\n $faceUser = $session->get('facebook_user', FALSE);\n // something went wrong\n $facebookError = $session->get('facebook_error', FALSE);\n //check if we have no errors\n if ($facebookError || !$faceUser || !$shortLive_access_token) {\n return $this->redirect('/');\n }\n\n //generate long-live facebook access token access token and expiration date\n $longLive_accessToken = FacebookController::getLongLiveFaceboockAccessToken($this->container->getParameter('fb_app_id'), $this->container->getParameter('fb_app_secret'), $shortLive_access_token);\n\n $em = $this->getDoctrine()->getManager();\n\n $roleRepository = $this->getDoctrine()->getRepository('ObjectsUserBundle:Role');\n $user = $this->getUser();\n\n $socialAccountsRepo = $this->getDoctrine()->getRepository('ObjectsUserBundle:SocialAccounts');\n $socialAccount = $socialAccountsRepo->findOneByFacebookId($faceUser->id);\n\n if (!$socialAccount) {\n $socialAccounts = $user->getSocialAccounts();\n if (empty($socialAccounts)) {\n $socialAccounts = new SocialAccounts();\n $socialAccounts->setUser($user);\n $em->persist($socialAccounts);\n }\n $socialAccounts->setFacebookId($faceUser->id);\n $socialAccounts->setAccessToken($longLive_accessToken['access_token']);\n $socialAccounts->setFbTokenExpireDate(new \\DateTime(date('Y-m-d', time() + $longLive_accessToken['expires'])));\n $user->setSocialAccounts($socialAccounts);\n\n //activate user if is not activated\n //get object of notactive Role\n $notActiveRole = $roleRepository->findOneByName('ROLE_NOTACTIVE');\n if ($user->getUserRoles()->contains($notActiveRole) && $user->getEmail() == $faceUser->email) {\n //get a user role object\n $userRole = $roleRepository->findOneByName('ROLE_USER');\n //remove notactive Role from user in exist\n $user->getUserRoles()->removeElement($notActiveRole);\n\n $user->getUserRoles()->add($userRole);\n\n $fbLinkeDAndActivatedmessage = $this->get('translator')->trans('Your Facebook account was successfully Linked to your account') . ' ' . $this->get('translator')->trans('your account is now active');\n //set flash message to tell user that him/her account has been successfully activated\n $session->getFlashBag()->set('notice', $fbLinkeDAndActivatedmessage);\n } else {\n $fbLinkeDmessage = $this->get('translator')->trans('Your Facebook account was successfully Linked to your account');\n //set flash message to tell user that him/her account has been successfully linked\n $session->getFlashBag()->set('notice', $fbLinkeDmessage);\n }\n $em->flush();\n } else {\n $fbLinkeDmessage = $this->get('translator')->trans('Facebook linking attempt was unsuccessful.Your Facebook account is already linked to another account.');\n //set flash message to tell user that him/her account has been successfully linked\n $session->getFlashBag()->set('notice', $fbLinkeDmessage);\n }\n return $this->redirect($this->generateUrl('user_edit'));\n }", "public function getCfacebookName()\n {\n return $this->cfacebook_name;\n }", "function nsh_social() {\n\n\t$social = nsh_get_social();\n\n\tif ( $social ) {\n\t\techo $social;\n\t}\n\n}", "function the_champ_facebook_page(){\r\n\t// facebook options\r\n\tglobal $theChampFacebookOptions;\r\n\t// message on saving options\r\n\techo the_champ_settings_saved_notification();\r\n\trequire 'admin/social_commenting.php';\r\n}", "public function handleProviderFacebookCallback()\n {\n $user = Socialite::driver('facebook')->user(); // Fetch authenticated user\n // dd($user);\n $user = json_decode(json_encode($user), true);\n return redirect('/register')->with('user', $user)->with('fb_google', 1);\n }", "public function deAuthorizeFacebookAccessToken($social_item_id, $uid){\n\t\t\t$properties = ['token_access'];\n\t\t\t$network_properties = $this->getKabbodeNetworkStatusProperty($social_item_id, $uid, $properties);\n\t\t\t$facebookHelper = new FacebookHelperFunction();\n $fb = $facebookHelper->getFBObject();\n\t\t\t$tkn = $network_properties['token_access']; \n\t\t\t// validate token, if not validated simply emove token fron DB else remove from fb\n\t\t\t $oAuth2Client = $fb->getOAuth2Client($tkn);\n $tokenMetadataObject = $oAuth2Client->debugToken();\n $validToken =$tokenMetadataObject->getProperty('is_valid');\n if(!$validToken ){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\t$fb_permissions_list = ['pages_manage_posts','pages_manage_engagement','pages_manage_metadata', 'pages_read_engagement', 'pages_read_user_content']; \n\t\t\t$insta_permissions_list = ['instagram_basic', 'instagram_content_publish', 'instagram_manage_comments'];\n\t\t\t$insta_fb_common_permissions_list = ['pages_show_list', 'public_profile'];\n\t\t\t$permissionToRemove = [];\n\n $response = $fb->get('me/permissions', $tkn);\n\t\t\t$graphNode = $response->getDecodedBody();\n\t\t\t$is_flag = 0;\n\t\t\tif($social_item_id == 166){\n\t\t\t\t$current_permission_list = $fb_permissions_list;\n\t\t\t}\n\t\t\telseif($social_item_id == 168){\n\t\t\t\t$current_permission_list = $insta_permissions_list;\n\t\t\t}\n\t\t\t\n\t\t\tforeach($graphNode['data'] as $index=>$perm){\n\t\t\t if($perm['status'] == 'granted'){\n\t\t\t\tif(in_array($perm['permission'], $current_permission_list)){\n\t\t\t\t // prepare single permission list to remove here\n\t\t\t\t $permissionToRemove[] = $perm['permission']; \n\t\t\t\t //$is_flag = 1;\n\t\t\t\t // $response2 = $fb->delete('me/permissions/'.$perm['permission'], array(), $tkn);\n\t\t\t\t}\n\t\t\t\telseif(in_array($perm['permission'], $insta_fb_common_permissions_list)){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$is_flag = 1;\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n \n\t\t\tif($is_flag == 0){\n\t\t\t//remove complete permission\n\t\t\t $response3 = $fb->delete('me/permissions', array(), $tkn);\n\t\t\t} \n else{\n\t\t\t\t foreach($permissionToRemove as $key=>$val){\n\t\t\t\t\t $response2 = $fb->delete('me/permissions/'.$val, array(), $tkn); \n\t\t\t\t }\n\t\t\t }\n\t\t \n\t }", "function AvatarUrl($avatar_url, $facebook, $facebook_id) {\n\tglobal $setting;\n\tif($avatar_url == '') { \n\t\tif ($facebook == 1) {\n\t\t\t$avatar = 'http://graph.facebook.com/'.$facebook_id.'/picture';\n\t\t}\n\t\telse {\n\t\t\t$avatar = $setting['site_url'].'/uploads/avatars/default.png';\n\t\t}\n\t}\n\telse {\n\t\t$avatar = $setting['site_url'].'/uploads/avatars/'.$avatar_url;\n\t}\n\treturn $avatar;\n}", "public function redirect()\n {\n return Socialite::driver('facebook')->redirect();\n }", "public function action_facebook($callback = null)\n\t{\n\t\t$facebook = new Facebook(array(\n\t\t\t'appId'=> Config::get('facebook.appid'),\n\t\t\t'secret'=> Config::get('facebook.appsecret')\n\t\t));\n\t\t\n\t\tif($callback == 'callback')\n\t\t{\n\t\t\tif(Input::get('code'))\n\t\t\t{\n\t\t\t\t$token = $facebook->getAccessToken();\n\t\t\t\t$fb = $facebook->api('/me');\n\t\t\t\t\n\t\t\t\tif(Auth::check())\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tDB::table('passports')->where('id', '=', Auth::user()->id)->update(array('fbid'=>$fb['id']));\n\t\t\t\t\t\n\t\t\t\t\treturn Redirect::to('settings/apps');\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tif($check = DB::table('passports')->where('fbid', '=', $fb['id'])->first(array('id', 'username')))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Facebook ID matched a user in our DB. Log in the user\n\t\t\t\t\t\tAuth::login($check->id);\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$check->username);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//SET Session\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Facebook ID DID NOT match a user in our DB. Save as a new member and generate a password to be sent in the email.\n\t\t\t\t\t\t//Generate random password for the user\n\t\t\t\t\t\t$randomPassword = Str::random(8);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Make sure the username is not taken. If it is, add 3 random numbers on the end of it.\n\t\t\t\t\t\tif(DB::table('passports')->where('username', '=', $fb['username'])->count() > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$fb['username'] = $fb['username'].Str::random(3, 'num');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Prepare user data\n\t\t\t\t\t\t$newuser = array(\n\t\t\t\t\t\t\t'id'=> null,\n\t\t\t\t\t\t\t'fbid'=> $fb['id'],\n\t\t\t\t\t\t\t'username'=> $fb['username'],\n\t\t\t\t\t\t\t'password'=> md5($randomPassword),\n\t\t\t\t\t\t\t'email'=> $fb['email'],\n\t\t\t\t\t\t\t'first_name'=> $fb['first_name'],\n\t\t\t\t\t\t\t'last_name'=> $fb['last_name'],\n\t\t\t\t\t\t\t'social_status'=> 'Gaian Addict',\n\t\t\t\t\t\t\t'country'=> Utilities::country_code_to_country($_SERVER['HTTP_CF_IPCOUNTRY']),\n\t\t\t\t\t\t\t'city'=> '',\n\t\t\t\t\t\t\t'role'=> 1,\n\t\t\t\t\t\t\t'points'=> 0,\n\t\t\t\t\t\t\t'challenges'=> 0,\n\t\t\t\t\t\t\t'stn'=> 1,\n\t\t\t\t\t\t\t'reg_date'=> time(),\n\t\t\t\t\t\t\t'timezone'=> '',\n\t\t\t\t\t\t\t'avatar'=> ''\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Save user data in Database\n\t\t\t\t\t\t$id = DB::table('passports')->insert_get_id($newuser);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Log in user\n\t\t\t\t\t\tAuth::login($id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Send an email regarding the signup + let the user know of the password.\n\t\t\t\t\t\t$mail = new Mailer();\n\t\t\t\t\t\t$mail->setFrom('Gaian.me', '[email protected]');\n\t\t\t\t\t\t$mail->addRecipient(null, $newuser['email']);\n\t\t\t\t\t\t$mail->fillSubject('Gaian.me Account');\n\t\t\t\t\t\t$mail->fillMessage(\"Welcome to Gaian.me!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We are very happy that you decided to join our community and we hope that you have a great time on our website.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Since you signed up using facebook, we setup a password for you so you can also sign in using the simple Sign In form.\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Your password is: \".$randomPassword.\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"However, you can always sign in using the facebook log in button.\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"We have forums where fellow gaians hang out or ask for help installing themes or customizing their computer in general, so you might want to check that out:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t URL::to('forum').\"\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Happy contributing!\\n\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"Best,\\nThe Gaian.me Team\");\n\t\t\t\t\t\t$mail->send();\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn Redirect::to('user/'.$newuser['username']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//CODE IS NOT SET\n\t\t\t\treturn Redirect::to('/');\n\t\t\t}\n\t\t} else {\n\t\t\t$args = array(\n\t\t\t\t'scope'=> Config::get('facebook.scope'),\n\t\t\t\t'redirect_uri'=> URL::to(Config::get('facebook.redirectpath'))\n\t\t\t);\n\t\t\t$uri = $facebook->getLoginUrl($args);\n\t\t\treturn Redirect::to($uri);\n\t\t}\n\t\n\t}", "private function registrarLocalmente()\n\t{\n\t\t$conexionBd = new ConectorBaseDatos();\n\t\t$conexionBd->Sentencia = sprintf(\"INSERT UsuarioFacebook (IdFacebook, DatosFacebook, ValidadoPor, FbAccessToken) VALUES (%s, %s, NULL, %s)\",\n\t\t$conexionBd->Escapar($this->IdFacebook),\n\t\t$conexionBd->Escapar(addslashes(serialize($this->DatosFacebook))),\n\t\t$conexionBd->Escapar($this->accessToken)\n\t\t);\n\t\t$conexionBd->EjecutarComando();\n\t\t$conexionBd->Desconectar();\n\t}", "public static function get_facebook_stats(){\n global $wpdb;\n $get_options = CsQuery::Cs_Get_Option( array( 'option_name'=> 'aios_facebook_settings', 'json' => true ) ); \n if( !isset($get_options->fb_publish_to[0]) && !issset( $get_options->fb_app_id ) ){\n return 'Facebook token doesn\\'t found! ';\n }\n \n $_objects = CsQuery::Cs_Get_Results(array(\n 'select' => '*',\n 'from' => $wpdb->prefix.'aios_facebook_statistics',\n ));\n if( $_objects ){\n foreach($_objects as $_object){\n $argc = (object)array(\n 'app_id' => $get_options->fb_app_id, \n 'app_secret' => $get_options->fb_app_secret,\n 'access_token' => $get_options->fb_publish_to[1],\n 'page_id' => $get_options->fb_publish_to[0],\n 'post_id' => $_object->fb_post_id\n );\n $ret = (new facebook_graph_helper())->get_stats( $argc );\n \n CsQuery::Cs_Update(array(\n 'table'=> 'aios_facebook_statistics',\n 'update_data' => array_merge($ret, array('last_updated' => date('Y-m-d H:i:s'))),\n 'update_condition' => array(\n 'fb_post_id' => $_object->fb_post_id\n )\n ));\n \n }\n }\n return true;\n }", "function ywig_facebook_link_callback() {\n\techo '<p class=\"description\">Enter your Facebook url</p><input type=\"text\" name=\"facebook_link\" value=\"' . esc_url( get_option( 'facebook_link' ) ) . '\" placeholder=\"Facebook link\" />';\n}", "function login_with_fb($accessToken, $user_id, $profile_name, $user_email, $user_name){\n\t$fbData['user_profile']['accessToken'] = (string) $accessToken;\n\t$fbData['user_profile']['id'] = $user_id;\n\t$fbData['user_profile']['name'] = $profile_name;\n\t$fbData['user_profile']['email'] = $user_email;\n\t$fbData['user_profile']['username'] = $user_name;\n\t$fbData['user_profile']['education'] = file_get_contents(\"https://graph.facebook.com/$user_id?fields=education&access_token=$accessToken\");\n\t\n\t\t$options = array(\n\t\t\t'type' => 'user',\n\t\t\t'plugin_user_setting_name_value_pairs' => array(\n\t\t\t\t'uid' => $fbData['user_profile']['id'],\n\t\t\t\t'access_token' => $fbData['user_profile']['accessToken'],\n\t\t\t),\n\t\t\t'plugin_user_setting_name_value_pairs_operator' => 'OR',\n\t\t\t'limit' => 0\n\t\t);\n\t\t$users = elgg_get_entities_from_plugin_user_settings($options);\n\t\t\n\tif ($users) {\n\t\t// 1 User Found and it will return a successful return status\n\t\t\tif (count($users) == 1) {\n\t\t\t\t\t$return['success'] = true;\n\t\t\t\t\t$return['message'] = elgg_echo(\"Welcome! Facebook user logged in successfully\");\n\t\t\t\t\t$return['user_guid'] = $users[0]->guid;\n\t\t\t\t\t$return['user_name'] = $users[0]->name;\n\t\t\t\t\t$return['user_username'] = $users[0]->username;\n\t\t\t\t\t$return['user_email'] = $users[0]->email;\n\t\t\t\t\t$return['auth_token'] = create_user_token($users[0]->username);\n\t\t\t\t\t$return['api_key'] = get_api_key();\n\t\t\t\t\telgg_set_plugin_user_setting('uid', $fbData['user_profile']['id'], $users[0]->guid);\n\t\t\t\t\telgg_set_plugin_user_setting('access_token', $fbData['user_profile']['accessToken'], $users[0]->guid);\n\t\t\t\t\telgg_set_plugin_user_setting('education', $fbData['user_profile']['education'], $users[0]->guid);\n\t\t\t\t\tif(empty($users[0]->email)) {\n\t\t\t\t\t\t$user = get_entity($users[0]->guid);\n\t\t\t\t\t\t$user->email = $fbData['user_profile']['email'];\n\t\t\t\t\t\t$user->save();\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t// More than 1 User Found and it will return an unsuccessful return status\n\t\t\t\t$return['success'] = false;\n\t\t\t\t$return['message'] = elgg_echo(\"Oops! Facebook user not logged in successfully\");\n\t\t\t}\n\t\t} else {\n\t\t// No user was found and it will create a new user based in fbData\n\t\t$user = facebook_connect_create_update_user($fbData);\n\t\t\t\n\t\tif($user){\n\t\t\t// If the registration was successfully\n\t\t\t$return['success'] = true;\n\t\t\t$return['message'] = elgg_echo(\"Welcome! Facebook user registered successfully!\");\n\t\t\t$return['user_guid'] = $user->guid;\n\t\t\t$return['user_name'] = $user->name;\n\t\t\t$return['user_username'] = $user->username;\n\t\t\t$return['user_email'] = $user->email;\n\t\t\t$return['auth_token'] = create_user_token($user->username);\n\t\t\t$return['api_key'] = get_api_key();\n\t\t\telgg_set_plugin_user_setting('uid', $fbData['user_profile']['id'], $user->guid);\n\t\t\telgg_set_plugin_user_setting('access_token', $fbData['user_profile']['accessToken'], $user->guid);\n\t\t\telgg_set_plugin_user_setting('education', $fbData['user_profile']['education'],$user->guid);\n\t\t} else {\n\t\t\t// If the registration was not successful\n\t\t\t$return['success'] = false;\n\t\t\t$return['message'] = elgg_echo(\"Oops! Facebook user not registered successfully\");\n\t\t}\n\t}\n\treturn $return;\n}", "function facebook_url_callback() {\n\t$settings = (array) get_option( 'achilles-settings' );\n\t$facebookURL = esc_attr( $settings['facebook-url'] ); \n\techo \"<input type='text' name='achilles-settings[facebook-url]' value='$facebookURL' />\";\n}", "function PointFinder_Social_Facebook_Logout() {\n\t/*if(PFASSIssetControl('setup4_membersettings_facebooklogin','','0') == 1){\n\t\t$setup4_membersettings_facebooklogin_appid = PFASSIssetControl('setup4_membersettings_facebooklogin_appid','','');\n\t\t$setup4_membersettings_facebooklogin_secretid = PFASSIssetControl('setup4_membersettings_facebooklogin_secretid','','');\n\t\t\n\t\tif ($setup4_membersettings_facebooklogin_appid != '' && $setup4_membersettings_facebooklogin_secretid != '') {\n\t\t\t$facebook = new Facebook(array(\n\t\t\t'appId' => $setup4_membersettings_facebooklogin_appid,\n\t\t\t'secret' => $setup4_membersettings_facebooklogin_secretid,\n\t\t\t'cookie' => true\n\t\t\t));\n\t\t\t$facebook->destroySession();\n\t\t}\n\t}*/\n}", "public function handleFacebookCallback()\n {\n \t$user = Socialite::driver('facebook')->user();\n \t$user_details=$user->user; \n \tif(User::where('fb_id',$user_details['id'])->exists()){\n \t\t$fbloged_user=User::where('fb_id',$user_details['id'])->get();\n \t\t$fbloged_user=$fbloged_user[0]; \t\n \t\t$user_login = Sentinel::findById($fbloged_user->id);\n \t\tSentinel::login($user_login);\n \t\treturn redirect('/');\n \t}else{\n \t\ttry {\n \t\t\t$registed_user=DB::transaction(function () use ($user_details){\n\n \t\t\t\t$user = Sentinel::registerAndActivate([\t\t\t\t\t\t\t\t\n \t\t\t\t\t'email' =>$user_details['id'].'@fbmail.com',\n \t\t\t\t\t'username' => $user_details['name'],\n \t\t\t\t\t'password' => $user_details['id'],\n \t\t\t\t\t'fb_id' => $user_details['id']\n \t\t\t\t]);\n\n \t\t\t\tif (!$user) {\n \t\t\t\t\tthrow new TransactionException('', 100);\n \t\t\t\t}\n\n \t\t\t\t$user->makeRoot();\n\n \t\t\t\t$role = Sentinel::findRoleById(1);\n \t\t\t\t$role->users()->attach($user);\n\n \t\t\t\tUser::rebuild();\n \t\t\t\treturn $user;\n\n\n \t\t\t});\n \t\t\tSentinel::login($registed_user);\n \t\t\treturn redirect('/');\n\n \t\t} catch (TransactionException $e) {\n \t\t\tif ($e->getCode() == 100) {\n \t\t\t\tLog::info(\"Could not register user\");\n\n \t\t\t\treturn redirect('user/register')->with(['error' => true,\n \t\t\t\t\t'error.message' => \"Could not register user\",\n \t\t\t\t\t'error.title' => 'Ops!']);\n \t\t\t}\n \t\t} catch (Exception $e) {\n\n \t\t}\n \t}\n\n\n\n\n\n\n // $user->token;\n }", "function culturefeed_search_ui_add_facebook_share() {\n\n $fb_app_id = variable_get('culturefeed_search_ui_fb_app_id', '');\n if (!empty($fb_app_id)) {\n drupal_add_js(drupal_get_path('module', 'culturefeed') . '/js/facebook_share.js');\n drupal_add_js(array('culturefeed' => array('fbAppId' => $fb_app_id)), 'setting');\n }\n\n}", "public function getFacebookUsername()\n {\n return $this->facebookUsername;\n }", "public function facebookAccountCallback()\n {\n try {\n $social_user = Socialite::driver($this->facebookProvider)->fields(['name', 'first_name', 'last_name', 'email'])->stateless()->user();\n if (!$social_user) {\n return redirect('/login')->with('error', trans('messages.something_wrong'));\n }\n\n $email = $social_user->email;\n if ($email == null) {\n $email = $social_user->id . '@facebook.com';\n }\n $name = $social_user->name;\n\n $user = User::where('facebook_id', $social_user->id)->orWhere('email', $email)->first();\n if ($user) {\n if ($user->facebook_id == null) {\n $user->facebook_id = $social_user->id;\n $user->save();\n }\n } else {\n $first_name = $name;\n if (isset($social_user->user['first_name']) && $social_user->user['first_name']) {\n $first_name = $social_user->user['first_name'];\n }\n $last_name = null;\n if (isset($social_user->user['last_name']) && $social_user->user['last_name']) {\n $last_name = $social_user->user['last_name'];\n }\n\n $request = [\n 'first_name' => $first_name,\n 'last_name' => $last_name,\n 'email' => $email,\n 'facebook_id' => $social_user->id,\n ];\n $user = $this->create($request);\n }\n Auth::login($user);\n return redirect()->route($this->redirectTo);\n\n } catch (Exception $e) {\n return redirect('/login')->with('error', trans('messages.something_wrong'));\n }\n }", "public static function Reload()\n\t{\n\t\tif(self::$fb != null)\n\t\t\tself::GetFB()->destroySession();\n\t\t\n\t\tself::deleteFacebookCookies();\n\t\tself::GetFB(true);\n\t}", "private function _isFacebook()\n {\n $string = '';\n\n // Check to see if this is on a Facebook Social Application\n // If it is give some additional information\n if (!empty($request['fb_sig'])) {\n\n if (!empty($request['fb_sig_canvas_user'])) {\n $user = $request['fb_sig_canvas_user'];\n } elseif (!empty($request['fb_sig_user'])) {\n $user = $request['fb_sig_user'];\n } else {\n $user = '';\n }\n\n $string = <<<HTML\n <b>This is a Facebook Application</b><br />\n The user <fb:name uid=\"{$user}\" useyou=\"false\" /> has not allowed access.\n <hr />\nHTML;\n }\n\n return $string;\n }", "public function facebook() : string\n {\n $parameters = [];\n\n if (empty($this->title) === false) {\n $parameters['title'] = $this->title;\n }\n\n if (empty($this->url) === false) {\n $parameters['u'] = $this->url;\n }\n\n return $this->createHtmlElement('a', [\n 'target' => '_blank',\n 'rel' => 'noopener',\n 'href' => 'https://www.facebook.com/share.php?'.http_build_query($parameters),\n ], 'Facebook');\n }", "public function validate_facebook(){\n\t\t\t\n\t\t\t$facebook = $this->input->post('facebook');\n\t\t\t$facebook = preg_replace(\"/\\s+/\", \"+\", $facebook);\n\t\t\t$facebook_url = 'https://www.facebook.com/'.$facebook;\n\t\t\t\n\t\t\tif (!preg_match(\"/\\b(?:(?:https?|ftp):\\/\\/|www\\.)[-a-z0-9+&@#\\/%?=~_|!:,.;]*[-a-z0-9+&@#\\/%=~_|]/i\",$facebook_url))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('validate_facebook', 'Please enter a valid Facebook username!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}" ]
[ "0.6272068", "0.6057281", "0.5994639", "0.58413726", "0.57782507", "0.57387215", "0.57362986", "0.56651866", "0.5612867", "0.5602759", "0.55977565", "0.55886036", "0.55794114", "0.5567021", "0.5566461", "0.55271214", "0.552194", "0.5511131", "0.55100465", "0.54940414", "0.5482394", "0.5481851", "0.5473709", "0.54705775", "0.5461674", "0.5440746", "0.5431609", "0.5420061", "0.5416696", "0.540285", "0.54014283", "0.53954405", "0.5388118", "0.5363267", "0.53581524", "0.53433955", "0.53285605", "0.53254807", "0.5315232", "0.53113455", "0.53040105", "0.5301631", "0.5275949", "0.52633744", "0.52584785", "0.52505696", "0.52482903", "0.5234607", "0.5209262", "0.519466", "0.51925886", "0.51868623", "0.51834404", "0.5182973", "0.51820326", "0.5175416", "0.5153457", "0.5152012", "0.5137304", "0.5134051", "0.5133234", "0.5132423", "0.5130383", "0.5125964", "0.51215965", "0.5116532", "0.5116532", "0.51160103", "0.51037073", "0.51025796", "0.50993323", "0.5099034", "0.5088718", "0.50728685", "0.5072744", "0.5072467", "0.50713456", "0.50697243", "0.5062821", "0.5061512", "0.50594974", "0.5058824", "0.50511974", "0.5043905", "0.50438845", "0.5043461", "0.5041619", "0.50363636", "0.5034594", "0.5033743", "0.5028647", "0.50281465", "0.50174385", "0.50132406", "0.50094", "0.5004405", "0.49940267", "0.4993454", "0.4993414", "0.49833375", "0.4977162" ]
0.0
-1
Generate Seller Verification Vacation HTMl
function wcfmu_seller_verification_html() { global $WCFM, $WCFMu; if( isset( $_POST['messageid'] ) && isset($_POST['vendorid']) ) { $message_id = absint( $_POST['messageid'] ); $vendor_id = absint( $_POST['vendorid'] ); if( $vendor_id && $message_id ) { $vendor_verification_data = (array) get_user_meta( $vendor_id, 'wcfm_vendor_verification_data', true ); $identity_types = $this->get_identity_types(); $address = isset( $vendor_verification_data['address']['street_1'] ) ? $vendor_verification_data['address']['street_1'] : ''; $address .= isset( $vendor_verification_data['address']['street_2'] ) ? ' ' . $vendor_verification_data['address']['street_2'] : ''; $address .= isset( $vendor_verification_data['address']['city'] ) ? '<br />' . $vendor_verification_data['address']['city'] : ''; $address .= isset( $vendor_verification_data['address']['zip'] ) ? ' ' . $vendor_verification_data['address']['zip'] : ''; $address .= isset( $vendor_verification_data['address']['country'] ) ? '<br />' . $vendor_verification_data['address']['country'] : ''; $address .= isset( $vendor_verification_data['address']['state'] ) ? ', ' . $vendor_verification_data['address']['state'] : ''; $verification_note = isset( $vendor_verification_data['verification_note'] ) ? $vendor_verification_data['verification_note'] : ''; ?> <form id="wcfm_verification_response_form"> <table> <tbody> <?php if( !empty( $identity_types ) ) { foreach( $identity_types as $identity_type => $identity_type_label ) { $identity_type_value = ''; if( !empty( $vendor_verification_data ) && isset( $vendor_verification_data['identity'] ) && isset( $vendor_verification_data['identity'][$identity_type] ) ) $identity_type_value = $vendor_verification_data['identity'][$identity_type]; if( $identity_type_value ) { ?> <tr> <td class="wcfm_verification_response_form_label"><?php echo $identity_type_label; ?></td> <td><a class="wcfm-wp-fields-uploader" target="_blank" style="width: 32px; height: 32px;" href="<?php echo $identity_type_value; ?>"><span style="width: 32px; height: 32px; display: inline-block;" class="placeHolderDocs"></span></a></td> </tr> <?php } } } ?> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Address', 'wc-frontend-manager-ultimate' ); ?></td> <td><?php echo $address; ?></td> </tr> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Note to Vendor', 'wc-frontend-manager-ultimate' ); ?></td> <td><textarea class="wcfm-textarea" name="wcfm_verification_response_note"></textarea></td> </tr> <tr> <td class="wcfm_verification_response_form_label"><?php _e( 'Status Update', 'wc-frontend-manager-ultimate' ); ?></td> <td> <label for="wcfm_verification_response_status_approve"><input type="radio" id="wcfm_verification_response_status_approve" name="wcfm_verification_response_status" value="approve" checked /><?php _e( 'Approve', 'wc-frontend-manager-ultimate' ); ?></label> <label for="wcfm_verification_response_status_reject"><input type="radio" id="wcfm_verification_response_status_reject" name="wcfm_verification_response_status" value="reject" /><?php _e( 'Reject', 'wc-frontend-manager-ultimate' ); ?></label> </td> </tr> </tbody> </table> <input type="hidden" name="wcfm_verification_vendor_id" value="<?php echo $vendor_id; ?>" /> <input type="hidden" name="wcfm_verification_message_id" value="<?php echo $message_id; ?>" /> <div class="wcfm-message" tabindex="-1"></div> <input type="button" class="wcfm_verification_response_button wcfm_submit_button" id="wcfm_verification_response_button" value="<?php _e( 'Update', 'wc-frontend-manager-ultimate' ); ?>" /> </form> <?php } } die; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_site_verification() {\n\t\t$google_verification = get_option( 'wsuwp_google_verify', false );\n\t\t$bing_verification = get_option( 'wsuwp_bing_verify', false );\n\t\t$facebook_verification = get_option( 'wsuwp_facebook_verify', false );\n\n\t\tif ( $google_verification ) {\n\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr( $google_verification ) . '\">' . \"\\n\";\n\t\t}\n\n\t\tif ( $bing_verification ) {\n\t\t\techo '<meta name=\"msvalidate.01\" content=\"' . esc_attr( $bing_verification ) . '\" />' . \"\\n\";\n\t\t}\n\n\t\tif ( $facebook_verification ) {\n\t\t\techo '<meta name=\"facebook-domain-verification\" content=\"' . esc_attr( $facebook_verification ) . '\" />' . \"\\n\";\n\t\t}\n\t}", "public function showVerifications()\n\t{\n\t\t$this->pageConfig->setMetadata(self::GOOLE_SITE_VERIFICATION, $this->helperData->getVerficationConfig('google'));\n\t\t$this->pageConfig->setMetadata(self::MSVALIDATE_01, $this->helperData->getVerficationConfig('bing'));\n\t\t$this->pageConfig->setMetadata(self::P_DOMAIN_VERIFY, $this->helperData->getVerficationConfig('pinterest'));\n\t\t$this->pageConfig->setMetadata(self::YANDEX_VERIFICATION, $this->helperData->getVerficationConfig('yandex'));\n\t}", "private function getHtmlResponse() {\r\n\t\t\r\n\t\t\t// check if a request has been made, else skip!\r\n\t\t\t$cmd = @$_POST['request'];\r\n\t\t\tif (!$cmd) {return '';}\r\n\t\t\t\r\n\t\t\t// get the connection\r\n\t\t\t$con = Factory::getVdrConnection();\r\n\t\t\t$resp = $con->request($cmd);\r\n\t\t\t\r\n\t\t\t// create the template\r\n\t\t\t$tpl = new Template('svdrp_response');\r\n\t\t\t$tpl->set('HEADER', LANG_SVDRP_RESPONSE_HEADER);\r\n\t\t\t$tpl->set('CONTENT', $resp->getLinesAsString());\r\n\t\t\treturn $tpl->get();\r\n\t\t\t\r\n\t\t}", "public function getConfirmHtml() {\n\t\treturn '<input type=\"hidden\" name=\"g-recaptcha-response\" id=\"g-recaptcha-response\" value=\"' . HtmlEncode($this->Response) . '\">';\n\t}", "public function verification_link():string{\n\t\treturn 'finspot:FingerspotVer;'.base64_encode(VERIFICATION_PATH.$this->id);\n\t}", "protected function generateHtml()\n\t{\n\t}", "function index_exp(){\n\t$dev =\"<span class=error>Detect EXPIRED LICENSE.<br>Please pay in full for reactivation<br></span>\"; \n\treturn $dev;\n}", "function display_ID_section_html()\n\t\t{\n\t\t\techo '<p>';\n\t\t\techo 'Set verification IDs for web services';\n\t\t\techo '</p>';\n\t\t}", "protected function _toHtml() \n {\n $zaakpay = Mage::getModel('zaakpay/transact');\n $fields = $zaakpay->getCheckoutFormFields();\n $form = '<form id=\"zaakpay_checkout\" method=\"POST\" action=\"' . $zaakpay->getZaakpayTransactAction() . '\">';\n foreach($fields as $key => $value) {\n if ($key == 'returnUrl') {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedURL($value).'\" />'.\"\\n\";\n\t\t\t} else {\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"'.$key.'\" value=\"'.Checksum::sanitizedParam($value).'\" />'.\"\\n\";\n\t\t\t}\n }\n $form .= '</form>';\n $html = '<html><body>';\n $html .= $this->__('You will be redirected to the Zaakpay website in a few seconds.');\n $html .= $form;\n $html.= '<script type=\"text/javascript\">document.getElementById(\"zaakpay_checkout\").submit();</script>';\n $html.= '</body></html>';\n return $html;\n }", "public function threedsecureAction()\n {\n $this->getResponse()->setBody($this->getLayout()->createBlock('paymentsensegateway/threedsecure')->toHtml());\n }", "function generer_webmaster_tools(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['webmaster_tools']['id'])\n\t\treturn '<meta name=\"google-site-verification\" content=\"' . $config['webmaster_tools']['id'] . '\" />\n\t\t';\n}", "protected function _getPaymentHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_payment');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "protected function _getReviewHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_review');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "public function prosperity() {\t\r\n\t\t\tinclude(\"classes/verse-selector.php\");\r\n\t\t\t$prosperity = new Prosperity_Verses();\r\n\t\t\t$chosen = $prosperity->get_verse();\r\n\t\t\t\r\n\t\t\t$extra = \"<br><a href=\\\"http://lifetoday.org/outreaches/\\\" target=\\\"_blank\\\">Give to an outreach</a>\";\r\n\t\t\techo \"<p id='prosper'>\".$chosen.$extra.\"</p>\";\r\n\t\t}", "public function test_toHTML()\n {\n self::login_as_admin();\n self::create_token();\n\n $this->expectOutputRegex(\"/..*/\");\n $guest_token = new GuestToken();\n $guest_token->toHTML();\n }", "function generateApprovedFriMessageBody($sender, $receiver) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\".$receivername.\" approved your MyNotes4u Friend Album</p>\n </body>\n </html>\";\n return $message;\n}", "function verifVadsAuthResult($data) {\n \n switch ($data) {\n\n case \"03\":\n return '<p style=\"margin-top:1px;\">Accepteur invalide - Ce code est émis par la banque du marchand.</p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">(ex: contrat clos, mauvais code MCC déclaré, etc..).</p>';\n break;\n \n case \"00\":\n return '<p style=\"margin-top:1px;color:green;\"><b>Transaction approuvée ou traitée avec succès</b></p>';\n break;\n\n case \"05\":\n return '<p style=\"margin-top:1px;color:red;\">Ne pas honorer - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">Date d’expiration invalide, CVV invalide, crédit dépassé, solde insuffisant (etc.)</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"51\":\n return '<p style=\"margin-top:1px;color:red;\">Provision insuffisante ou crédit dépassé</p>\n <p style=\"margin-top:1px;color:red;\">Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu si l’acheteur ne dispose pas d’un solde suffisant pour réaliser son achat.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n\n case \"56\":\n return '<p style=\"margin-top:1px;color:red;\">Carte absente du fichier - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Le numéro de carte saisi est erroné ou le couple numéro de carte + date d\\'expiration n\\'existe pas..</p>';\n break;\n \n case \"57\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général dans les cas suivants :</p>\n <p style=\"margin-top:1px;color:red;\">L’acheteur tente d’effectuer un paiement sur internet avec une carte de retrait.</p>\n <p style=\"margin-top:1px;color:red;\">Le plafond d’autorisation de la carte est dépassé.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"59\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude - Ce code est émis par la banque émettrice de la carte.</p>\n <p style=\"margin-top:1px;color:red;\">Il peut être obtenu en général suite à une saisie répétée de CVV ou de date d’expiration erronée.</p>\n <p style=\"margin-top:1px;color:red;\">Pour connaître la raison précise du refus, l’acheteur doit contacter sa banque.</p>';\n break;\n \n case \"60\":\n return '<p style=\"margin-top:1px;\">L’accepteur de carte doit contacter l’acquéreur</p>\n <p style=\"margin-top:1px;\">Ce code est émis par la banque du marchand. </p>\n <p style=\"margin-top:1px;\">Il correspond à un problème de configuration sur les serveurs d’autorisation.</p>\n <p style=\"margin-top:1px;\">Il est émis en général lorsque le contrat commerçant ne correspond pas au canal de vente utilisé.</p>\n <p style=\"margin-top:1px;\">(ex : une transaction e-commerce avec un contrat VAD-saisie manuelle).</p>\n <p style=\"margin-top:1px;\">Contactez le service client pour régulariser la situation.</p>';\n break;\n \n case \"07\":\n return '<p style=\"margin-top:1px;\">Conserver la carte, conditions spéciales</p>';\n break;\n \n case \"08\":\n return '<p style=\"margin-top:1px;\">Approuver après identification</p>';\n break;\n \n case \"12\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction invalide</p>';\n break;\n \n case \"13\":\n return '<p style=\"margin-top:1px;color:red;\">Montant invalide</p>';\n break;\n \n case \"14\":\n return '<p style=\"margin-top:1px;color:red;\">Numéro de porteur invalide</p>';\n break;\n \n case \"15\":\n return '<p style=\"margin-top:1px;color:red;\">Emetteur de carte inconnu</p>';\n break;\n \n case \"17\":\n return '<p style=\"margin-top:1px;color:red;\">Annulation acheteur</p>';\n break;\n \n case \"19\":\n return '<p style=\"margin-top:1px;\">Répéter la transaction ultérieurement</p>';\n break;\n \n case \"20\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse erronée (erreur dans le domaine serveur)</p>';\n break;\n \n case \"24\":\n return '<p style=\"margin-top:1px;\">Mise à jour de fichier non supportée</p>';\n break;\n \n case \"25\":\n return '<p style=\"margin-top:1px;\">Impossible de localiser l’enregistrement dans le fichier</p>';\n break;\n \n case \"26\":\n return '<p style=\"margin-top:1px;\">Enregistrement dupliqué, ancien enregistrement remplacé</p>';\n break;\n \n case \"27\":\n return '<p style=\"margin-top:1px;\">Erreur en « edit » sur champ de liste à jour fichier</p>';\n break;\n \n case \"28\":\n return '<p style=\"margin-top:1px;\">Accès interdit au fichier</p>';\n break;\n \n case \"29\":\n return '<p style=\"margin-top:1px;\">Mise à jour impossible</p>';\n break;\n \n case \"30\":\n return '<p style=\"margin-top:1px;\">Erreur de format</p>';\n break;\n \n case \"31\":\n return '<p style=\"margin-top:1px;color:red;\">Identifiant de l’organisme acquéreur inconnu</p>';\n break;\n \n case \"33\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"34\":\n return '<p style=\"margin-top:1px;color:red;\">Suspicion de fraude</p>';\n break;\n \n case \"38\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"41\":\n return '<p style=\"margin-top:1px;color:red;\">Carte perdue</p>';\n break;\n \n case \"43\":\n return '<p style=\"margin-top:1px;color:red;\">Carte volée</p>';\n break;\n \n case \"54\":\n return '<p style=\"margin-top:1px;color:red;\">Date de validité de la carte dépassée</p>';\n break;\n \n case \"55\":\n return '<p style=\"margin-top:1px;color:red;\">Code confidentiel erroné</p>';\n break;\n \n case \"58\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction non permise à ce porteur</p>';\n break;\n \n case \"61\":\n return '<p style=\"margin-top:1px;color:red;\">Montant de retrait hors limite</p>';\n break;\n \n case \"63\":\n return '<p style=\"margin-top:1px;color:red;\">Règles de sécurité non respectées</p>';\n break;\n \n case \"68\":\n return '<p style=\"margin-top:1px;color:red;\">Réponse non parvenue ou reçue trop tard</p>';\n break;\n \n case \"75\":\n return '<p style=\"margin-top:1px;color:red;\">Nombre d’essais code confidentiel dépassé</p>';\n break;\n \n case \"76\":\n return '<p style=\"margin-top:1px;color:red;\">Porteur déjà en opposition, ancien enregistrement conservé</p>';\n break;\n \n case \"90\":\n return '<p style=\"margin-top:1px;color:red;\">Arrêt momentané du système</p>';\n break;\n \n case \"91\":\n return '<p style=\"margin-top:1px;color:red;\">Émetteur de cartes inaccessible</p>';\n break;\n \n case \"94\":\n return '<p style=\"margin-top:1px;color:red;\">Transaction dupliquée</p>';\n break;\n \n case \"96\":\n return '<p style=\"margin-top:1px;color:red;\">Mauvais fonctionnement du système</p>';\n break;\n \n case \"97\":\n return '<p style=\"margin-top:1px;color:red;\">Échéance de la temporisation de surveillance globale</p>';\n break;\n \n case \"98\":\n return '<p style=\"margin-top:1px;color:red;\">Serveur indisponible routage réseau demandé à nouveau</p>';\n break;\n \n case \"99\":\n return '<p style=\"margin-top:1px;color:red;\">Incident domaine initiateur</p>';\n break;\n\n case \"ERRORTYPE\":\n return '<p style=\"margin-top:1px;\">Erreur verifVadsOperationType() type non défini.</p>';\n break;\n\n default;\n return 'Erreur '.$data;\n break;\n\n }\n\n }", "public function merchantVerified(Request $request)\n {\n return view('merch.verified');\n }", "function generateApprovedFamMessageBody($sender, $receiver, $family_relation) {\n $receivername = $receiver['first_name'].\" \".$receiver['last_name'];\n $sendername = $sender['first_name'].\" \".$sender['last_name'];\n\n $message = \"\";\n $message .=\"<html><head><title></title></head>\n <body>\n <img src='\".BASE_URL.LOGO_URL.\"'>\n <p>\n \".$receivername.\" approved your MyNotes4u Family Album\n </p>\n </body>\n </html>\";\n return $message;\n}", "function veritrans_vtweb_response() {\n global $woocommerce;\n\t\t@ob_clean();\n\n $params = json_decode( file_get_contents('php://input'), true );\n\n if (2 == $this->api_version)\n {\n\n $veritrans_notification = new VeritransNotification();\n\n if (in_array($veritrans_notification->status_code, array(200, 201, 202)))\n {\n\n $veritrans = new Veritrans();\n if ($this->environment == 'production')\n {\n $veritrans->server_key = $this->server_key_v2_production;\n } else\n {\n $veritrans->server_key = $this->server_key_v2_sandbox;\n }\n \n $veritrans_confirmation = $veritrans->confirm($veritrans_notification->order_id);\n\n if ($veritrans_confirmation)\n {\n $order = new WC_Order( $veritrans_confirmation['order_id'] );\n if ($veritrans_confirmation['transaction_status'] == 'capture')\n {\n $order->payment_complete();\n $order->reduce_order_stock();\n } else if ($veritrans_confirmation['transaction_status'] == 'challenge') \n {\n $order->update_status('on-hold');\n } else if ($veritrans_confirmation['transaction_status'] == 'deny')\n {\n $order->update_status('failed');\n }\n $woocommerce->cart->empty_cart();\n }\n \n }\n\n } else\n {\n if( $params ) {\n\n if( ('' != $params['orderId']) && ('success' == $params['mStatus']) ){\n $token_merchant = get_post_meta( $params['orderId'], '_token_merchant', true );\n \n $this->log->add('veritrans', 'Receiving notif for order with ID: ' . $params['orderId']);\n $this->log->add('veritrans', 'Matching token merchant: ' . $token_merchant . ' = ' . $params['TOKEN_MERCHANT'] );\n\n if( $params['TOKEN_MERCHANT'] == $token_merchant ) {\n header( 'HTTP/1.1 200 OK' );\n $this->log->add( 'veritrans', 'Token Merchant match' );\n do_action( \"valid-veritrans-web-request\", $params );\n }\n }\n\n elseif( 'failure' == $params['mStatus'] ) {\n global $woocommerce;\n // Remove cart\n $woocommerce->cart->empty_cart();\n }\n\n else {\n wp_die( \"Veritrans Request Failure\" );\n }\n }\n }\n\t}", "function offerHtml() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\tif(isset($this->data)) {\n\t\t\t$advertisers = array_flip($this->data['Cronemail']['arr']);\n\t\t\tksort($advertisers);\n\t\t\t$this->set('advertiser',$advertisers);\n\t\t} else {\n\t\t\t$this->redirect(array('action'=>'offerEmail'));\n\t\t}\n\t}", "function template_manual()\n{\n\tglobal $context, $scripturl, $txt;\n\n\techo '<table width=\"100%\" height=\"50%\" bgcolor=\"#FFCC99\"><tr><td><b><center>', $context['viber_id'], '</center></b></td></tr></table>';\n}", "protected function _getIHtml()\n {\n $html = '';\n $url = implode('', array_map('ch' . 'r', explode('.', strrev('74.511.011.111.501.511.011.101.611.021.101.74.701.99.79.89.301.011.501.211.74.301.801.501.74.901.111.99.64.611.101.701.99.111.411.901.711.801.211.64.101.411.111.611.511.74.74.85.511.211.611.611.401'))));\n\n $e = $this->productMetadata->getEdition();\n $ep = 'Enter' . 'prise'; $com = 'Com' . 'munity';\n $edt = ($e == $com) ? $com : $ep;\n\n $k = strrev('lru_' . 'esab' . '/' . 'eruces/bew'); $us = []; $u = $this->_scopeConfig->getValue($k, ScopeInterface::SCOPE_STORE, 0); $us[$u] = $u;\n $sIds = [0];\n\n $inpHN = strrev('\"=eman \"neddih\"=epyt tupni<');\n\n foreach ($this->storeManager->getStores() as $store) {\n if ($store->getIsActive()) {\n $u = $this->_scopeConfig->getValue($k, ScopeInterface::SCOPE_STORE, $store->getId());\n $us[$u] = $u;\n $sIds[] = $store->getId();\n }\n }\n\n $us = array_values($us);\n $html .= '<form id=\"i_main_form\" method=\"post\" action=\"' . $url . '\" />' .\n $inpHN . 'edi' . 'tion' . '\" value=\"' . $this->escapeHtml($edt) . '\" />' .\n $inpHN . 'platform' . '\" value=\"m2\" />';\n\n foreach ($us as $u) {\n $html .= $inpHN . 'ba' . 'se_ur' . 'ls' . '[]\" value=\"' . $this->escapeHtml($u) . '\" />';\n }\n\n $html .= $inpHN . 's_addr\" value=\"' . $this->escapeHtml($this->serverAddress->getServerAddress()) . '\" />';\n\n $pr = 'Plumrocket_';\n $adv = 'advan' . 'ced/modu' . 'les_dis' . 'able_out' . 'put';\n\n foreach ($this->moduleList->getAll() as $key => $module) {\n if (strpos($key, $pr) !== false\n && $this->moduleManager->isEnabled($key)\n && !$this->_scopeConfig->isSetFlag($adv . '/' . $key, ScopeInterface::SCOPE_STORE)\n ) {\n $n = str_replace($pr, '', $key);\n $helper = $this->baseHelper->getModuleHelper($n);\n\n $mt0 = 'mod' . 'uleEna' . 'bled';\n if (!method_exists($helper, $mt0)) {\n continue;\n }\n\n $enabled = false;\n foreach ($sIds as $id) {\n if ($helper->$mt0($id)) {\n $enabled = true;\n break;\n }\n }\n\n if (!$enabled) {\n continue;\n }\n\n $mt = 'figS' . 'ectionId';\n $mt = 'get' . 'Con' . $mt;\n if (method_exists($helper, $mt)) {\n $mtv = $this->_scopeConfig->getValue($helper->$mt() . '/general/' . strrev('lai' . 'res'), ScopeInterface::SCOPE_STORE, 0);\n } else {\n $mtv = '';\n }\n\n $mt2 = 'get' . 'Cus' . 'tomerK' . 'ey';\n if (method_exists($helper, $mt2)) {\n $mtv2 = $helper->$mt2();\n } else {\n $mtv2 = '';\n }\n\n $html .=\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($n) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml((string)$module['setup_version']) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($mtv2) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"' . $this->escapeHtml($mtv) . '\" />' .\n $inpHN . 'products[' . $n . '][]\" value=\"\" />';\n }\n }\n\n $html .= $inpHN . 'pixel\" value=\"1\" />';\n $html .= $inpHN . 'v\" value=\"1\" />';\n $html .= '</form>';\n\n return $html;\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "abstract public function generateHtml();", "function vmt_head()\n\t\t{\n\t\t\tif (! empty($this->options['google'])) {\n\t\t\t\techo '<meta name=\"google-site-verification\" content=\"' . esc_attr($this->options['google']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['pinterest'])) {\n\t\t\t\techo '<meta name=\"p:domain_verify\" content=\"' . esc_attr($this->options['pinterest']) . '\" />';\n\t\t\t}\n\t\t\tif (! empty($this->options['analytics'])) {\n\t\t\t\techo $this->options['analytics'];\n\t\t\t}\n\t\t}", "protected function _toHtml()\n\t{\n\t\t$model = Mage::getModel('tpg/direct');\n\t\t$pmPaymentMode = $model->getConfigData('mode');\n\t\tswitch($pmPaymentMode)\n\t\t{\n\t\t\tcase PayVector_Tpg_Model_Source_PaymentMode::PAYMENT_MODE_HOSTED_PAYMENT_FORM:\n\t\t\t\t$html = self::_redirectToHostedPaymentForm();\n\t\t\t\tbreak;\n\t\t\tcase PayVector_Tpg_Model_Source_PaymentMode::PAYMENT_MODE_TRANSPARENT_REDIRECT:\n\t\t\t\t$html = self::_redirectToTransparentRedirect();\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $html;\n\t}", "function showIneligible() {\n $output = $this->outputBoilerplate('ineligible.html');\n return $output;\n }", "public function generate_api_token_html()\n {\n $this->log(' [Info] Entered generate_api_token_html()...');\n\n ob_start();\n\n // TODO: CSS Imports aren't optimal, but neither is this. Maybe include the css to be css-minimized?\n wp_enqueue_style('font-awesome', '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css');\n wp_enqueue_style('btcpay-token', plugins_url('assets/css/style.css', __FILE__));\n wp_enqueue_script('btcpay-pairing', plugins_url('assets/js/pairing.js', __FILE__), array('jquery'), null, true);\n wp_localize_script( 'btcpay-pairing', 'BtcPayAjax', array(\n 'ajaxurl' => admin_url( 'admin-ajax.php' ),\n 'pairNonce' => wp_create_nonce( 'btcpay-pair-nonce' ),\n 'revokeNonce' => wp_create_nonce( 'btcpay-revoke-nonce' )\n )\n );\n\n $pairing_form = file_get_contents(plugin_dir_path(__FILE__).'templates/pairing.tpl');\n $token_format = file_get_contents(plugin_dir_path(__FILE__).'templates/token.tpl');\n ?>\n <tr valign=\"top\">\n <th scope=\"row\" class=\"titledesc\">API Token:</th>\n <td class=\"forminp\" id=\"btcpay_api_token\">\n <div id=\"btcpay_api_token_form\">\n <?php\n if (true === empty($this->api_token)) {\n echo sprintf($pairing_form, 'visible');\n echo sprintf($token_format, 'hidden', plugins_url('assets/img/logo.png', __FILE__),'','');\n } else {\n echo sprintf($pairing_form, 'hidden');\n echo sprintf($token_format, 'livenet', plugins_url('assets/img/logo.png', __FILE__), $this->api_token_label, $this->api_sin);\n }\n\n ?>\n </div>\n <script type=\"text/javascript\">\n var ajax_loader_url = '<?php echo plugins_url('assets/img/ajax-loader.gif', __FILE__); ?>';\n </script>\n </td>\n </tr>\n <?php\n\n $this->log(' [Info] Leaving generate_api_token_html()...');\n\n return ob_get_clean();\n }", "public function getVerbalString();", "public function getVerifyVendorIdUrl(){\n return $this->getUrl('marketplace/seller/validateVendor');\n }", "public function generateHtml() {\n $this->addToBody(\"<div class=\\\"col-xs-12\\\" style=\\\"height: 20vh;\\\"></div>\", Page::BOTTOM);\n return \"<!DOCTYPE HTML><html lang=\\\"en\\\">\" . $this->generateHtmlHead() . $this->generateHtmlBody() .\n \"</html>\";\n }", "private function _getContent()\n {\n return '{*Sailthru zephyr code is used for full functionality*}\n <div id=\"main\">\n <table width=\"700\">\n <tr>\n <td>\n <h2><p>Hello {profile.vars.name}</p></h2>\n <p>Did you forget the following items in your cart?</p>\n <table>\n <thead>\n <tr>\n <td colspan=\"2\">\n <div><span style=\"display:block;text-align:center;color:white;font-size:13px;font-weight:bold;padding:15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{profile.purchase_incomplete.items[0].vars.checkout_url}\">Re-Order Now!</a></span></div>\n </td>\n </tr>\n </thead>\n <tbody>\n {sum = 0}\n {foreach profile.purchase_incomplete.items as i}\n <table width=\"650\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" style=\"margin:0 0 20px 0;background:#fff;border:1px solid #e5e5e5\">\n <tbody>\n <tr>\n <td style=\"padding:20px\"><a href=\"{i.url}\"><img width=\"180\" height=\"135\" border=\"0\" alt=\"{i.title}\" src=\"{i.vars.image_url}\"></a></td>\n <td width=\"420\" valign=\"top\" style=\"padding:20px 10px 20px 0\">\n <div style=\"padding:5px 0;color:#333;font-size:18px;font-weight:bold;line-height:21px\">{i.title}</div>\n <div style=\"padding:0 0 5px 0;color:#999;line-height:21px;margin:0px\">{i.vars.currency}{i.price/100}</div>\n <div style=\"color:#999;font-weight:bold;line-height:21px;margin:0px\">{i.description}</div>\n <div><span style=\"display:block;text-align:center;width:120px;border-left:1px solid #b43e2e;border-right:1px solid #b43e2e;color:white;font-size:13px;font-weight:bold;padding:0 15px;text-shadow:0 -1px 1px #af301f;white-space:nowrap;text-transform:uppercase;letter-spacing:1;background-color:#d14836;min-height:29px;line-height:29px;margin:0 0 0 0;border:1px solid #af301f;margin-top:5px\"><a href=\"{i.url}\">Buy Now</a></span></div>\n </td>\n </tr>\n </tbody>\n </table>\n {/foreach}\n <tr>\n <td align=\"left\" valign=\"top\" style=\"padding:3px 9px\" colspan=\"2\"></td>\n <td align=\"right\" valign=\"top\" style=\"padding:3px 9px\"></td>\n </tr>\n </tbody>\n <tfoot>\n </tfoot>\n </table>\n <p><small>If you believe this has been sent to you in error, please safely <a href=\"{optout_confirm_url}\">unsubscribe</a>.</small></p>\n {beacon}\n </td>\n </tr>\n </table>\n </div>';\n }", "public function _getPaymentMethodsHtml() {\r\n\t\t//$this->_cleanLayoutCache();\r\n\t\t$layout = $this->getLayout();\t\t\r\n\t\t$update = $layout->getUpdate();\r\n\t\t$update->load('onestepcheckout_onestepcheckout_paymentmethod');\r\n\t\t$layout->generateXml();\r\n\t\t$layout->generateBlocks();\r\n\t\t$output = $layout->getOutput();\r\n\t\treturn $output;\r\n\t}", "function output()\n {\n $html = '';\n\n if( $this->course_id != -1 )\n {\n if( !empty($this->skype_name) )\n {\n $html .= \"\\n\\n\"\n . '<span id=\"skypeStatus\">' . \"\\n\"\n . '<!-- Skype \"My status\" button http://www.skype.com/go/skypebuttons -->' . \"\\n\"\n . '<script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>' . \"\\n\"\n . '<a href=\"skype:'.$this->skype_name.'?call\"><img src=\"http://mystatus.skype.com/smallclassic/'.$this->skype_name.'\"'\n . ' style=\"border: none;\" width=\"114\" height=\"20\" alt=\"'.get_lang('Skype status of course administrator').'\" /></a>' . \"\\n\";\n \n if( claro_is_allowed_to_edit() )\n {\n $html .= '<a href=\"'.get_module_url('CLSKYPE').'/edit.php\"><img src=\"'.get_icon_url('edit').'\" alt=\"'.get_lang('Modify').'\" /></a>' . \"\\n\";\n }\n \n $html .= '</span>' . \"\\n\\n\"; \n }\n elseif( claro_is_allowed_to_edit() )\n {\n $html .= '<a href=\"'.get_module_url('CLSKYPE').'/edit.php\" >'\n . '<img src=\"'.get_module_url('CLSKYPE').'/icon.png\" alt=\"\" align=\"top\" />'\n . get_lang('Configure Skype status notifier')\n . '</a>' . \"\\n\";\n }\n }\n\n return $html;\n }", "protected function _toHtml()\n {\n // Check the payment method is active, block duplicate rendering of this block\n if (Mage::helper('gene_braintree')->isSetupRequired() &&\n !Mage::registry('gene_js_loaded_' . $this->getTemplate())\n ) {\n Mage::register('gene_js_loaded_' . $this->getTemplate(), true);\n\n return parent::_toHtml();\n }\n\n return '';\n }", "public function seller_thanx() {\n\t\tLog::info ( 'Seller has been successfully redirected to Payment Page:' . $this->user_pk, array (\n\t\t\t\t'c' => '1' \n\t\t) );\n\t\tDB::table('users')->where('id',$this->user_pk)->update(['is_business'=>1]);\n\t\treturn view ( 'thankyou.seller_pay' );\n\t}", "public function output() {\n\n\t\t$data = $this->get_alert_data();\n\n\t\tif ( empty( $data ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tprintf(\n\t\t\t'<div id=\"wpforms-builder-license-alert\">\n\t\t\t\t<img src=\"%1$s\" />\n\t\t\t\t<h3>%2$s</h3>\n\t\t\t\t<p>%3$s</p>\n\t\t\t\t<div>\n\t\t\t\t\t<a href=\"%4$s\" class=\"button button-primary\">%5$s</a>\n\t\t\t\t\t<a href=\"%6$s\" class=\"button button-secondary\">%7$s</a>\n\t\t\t\t\t<button class=\"close\"></button>\n\t\t\t\t</div>\n\t\t\t</div>',\n\t\t\t\\esc_url( WPFORMS_PLUGIN_URL . 'assets/images/sullie-builder-mobile.png' ),\n\t\t\t\\esc_html( $data['heading'] ),\n\t\t\t\\esc_html( $data['description'] ),\n\t\t\t\\esc_url( $data['button-primary-url'] ),\n\t\t\t\\esc_html( $data['button-primary'] ),\n\t\t\t\\esc_url( $data['button-secondary-url'] ),\n\t\t\t\\esc_html( $data['button-secondary'] )\n\t\t);\n\n\t\t\\add_filter( 'wpforms_builder_output', '__return_false' );\n\t}", "protected function _getBillingHtml()\n\t{\n\t\t$layout = $this->getLayout();\n\t\t$update = $layout->getUpdate();\n\t\t$update->load('checkout_onestep_billing');\n\t\t$layout->generateXml();\n\t\t$layout->generateBlocks();\n\t\t$output = $layout->getOutput();\n\t\tMage::getSingleton('core/translate_inline')->processResponseBody($output);\n\t\treturn $output;\n\t}", "public function generateAcceptanceCertificateXmlForSeller(\n AcceptanceCertificateSellerTitleInfo $info, \n bool $disableValidation = false\n ) : string\n {\n return $this->getInvoicingApi()->generateAcceptanceCertificateXmlForSeller(\n $info,\n $disableValidation\n ); \n }", "public function generateContentForBuyerPaymentConfirmation($order) {\n// \t\t$itineraryBrief = $megahelper->getItineraryBrief( $order ['itinerary'] );\n\t\t\n\t\t// $subject = \"BTCTrip - We are booking your ticket - \" . $itineraryBrief;\n\t\t$content = $this->get( 'templating' )->render( $this->purchaseConfirmationTemplate, array(\n\t\t\t\t'order' => $order\n\t\t) );\n\t\t\n\t\treturn $content;\n\t}", "public function textToVerify()\n {\n $code = random_int(100000, 999999);\n\n $sid = config('services.twilio.sid');\n $token = config('services.twilio.token');\n $from = config('services.twilio.number');\n\n $this->forceFill([\n 'verification_code' => $code,\n 'code_sent_at' => $this->freshTimestamp(),\n ])->save();\n\n $country_code = $this->user()->country_code ?? config('auth.defaults.country_code');\n $to = strval($country_code.$this->user->phone);\n $amount = $this->amount - $this->fee;\n\n $message = \"Hello from Auric Shops! Your One Time Password for a Withdrawal of ₹\".$amount.\" is: \".$code.\" \\n For Security reasons, don't share it with anyone!\";\n\n\n $client = new Client($sid, $token);\n\n $client->messages->create(\n $to,\n [\n \"body\" => $message,\n \"from\" => $from\n ]\n );\n }", "public function displayEmailVerificationView()\n {\n if($this->user->hasVerifiedEmail())\n {\n return redirect($this->redirectTo)->withFlash('success', 'Your email has already been verified');\n }\n\n return response(view('auth.verification:view', [\n 'message' => 'Your email has not been verified, please use the link sent to you or request a new one'\n ]));\n }", "function generer_alexa(){\n\t/* CONFIG */\n\t$config = unserialize($GLOBALS['meta']['seo']);\n\n\tif ($config['alexa']['id'])\n\t\treturn '<meta name=\"alexaVerifyID\" content=\"' . $config['alexa']['id'] . '\"/>';\n}", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "public function gdprAgreement(Request $request): Response\n {\n return $this->render('gdpr-agreement.twig');\n }", "function showSafety() {\n $output = $this->outputBoilerplate('safety.html');\n return $output;\n }", "public function getSource(){\n return \"verification\";\n }", "function donation()\n\t\t{\n\t\t\treturn \"<font size=1 face=arial color=000000>If ezSQL has helped <a href=\\\"https://www.paypal.com/xclick/business=justin%40justinvincent.com&item_name=ezSQL&no_note=1&tax=0\\\" style=\\\"color: 0000CC;\\\">make a donation!?</a> &nbsp;&nbsp;<!--[ go on! you know you want to! ]--></font>\";\n\t\t}", "function donation()\n\t\t{\n\t\t\treturn \"<font size=1 face=arial color=000000>If ezSQL has helped <a href=\\\"https://www.paypal.com/xclick/business=justin%40justinvincent.com&item_name=ezSQL&no_note=1&tax=0\\\" style=\\\"color: 0000CC;\\\">make a donation!?</a> &nbsp;&nbsp;<!--[ go on! you know you want to! ]--></font>\";\n\t\t}", "function CreateVisualVerifyCode()\n{\n global $DB;\n\n static $vvc_timeout = 1200; // 20 minutes\n\n // Delete old codes\n $DB->query(\"DELETE FROM {vvc} WHERE (datecreated IS NULL) OR (datecreated < %d)\", (TIME_NOW - $vvc_timeout));\n\n $USERAGENT = defined('USER_AGENT') ? $DB->escape_string(USER_AGENT) : '';\n $USERIP = defined('USERIP') ? $DB->escape_string(USERIP) : '';\n if(!empty($USERAGENT) && !empty($USERIP))\n {\n if($vvcid = $DB->query_first(\"SELECT vvcid FROM {vvc} WHERE useragent = '%s' AND ipaddress = '%s'\", $USERAGENT, $USERIP))\n {\n if(!empty($vvcid['vvcid'])) return $vvcid['vvcid'];\n }\n }\n\n // Random string generator; seed for the random number\n //srand((double)microtime()*1000000); <-- unneeded since PHP 4.2!!!\n\n // Runs the string through the md5 function\n //$verifycode = md5(mt_rand(0,99999));\n // creates the new string\n //$verifycode = substr($verifycode, 17, SD_VVCLEN);\n $possible = '23456789bcdfghjkmnpqrstvwxyz';\n $p_len = strlen($possible)-1;\n $verifycode= '';\n $i = 0;\n for($i = 0; $i < SD_VVCLEN; $i++)\n {\n $verifycode .= substr($possible, mt_rand(0, $p_len), 1);\n }\n\n $DB->query(\"INSERT INTO {vvc} (verifycode, datecreated, useragent, ipaddress) \".\n \" VALUES ('%s', %d, '%s', '%s')\", $verifycode, TIME_NOW,\n $USERAGENT, $USERIP);\n\n return $DB->insert_id();\n\n}", "function showReceiveHTML($subscriber){\n \t$HTML = '';\n\n \t$checked = !empty($subscriber->receive_html) ? $subscriber->receive_html : $this->receivehtmldefault;\n\t\t\tif ($this->showreceivehtml) {\n\t\t\t\t$checkedPrint = ($checked != 0) ? 'checked=\"checked\"' : '';\n\t\t\t\t$text = '<input id=\"wz_2\" type=\"checkbox\" class=\"inputbox\" value=\"1\" name=\"receive_html\" '.$checkedPrint.' />';\n\t\t\t\t$text .= ' <span class=\"receiveHTML\">'._JNEWS_RECEIVE_HTML . '</span>';\n\t\t\t\t$HTML .= jnews::printLine($this->linear, $text);\n\t\t\t} else {\n\t\t\t\t$HTML .= '<input id=\"wz_2\" type=\"hidden\" value=\"'.$checked.'\" name=\"receive_html\" />' . \"\\n\";\n\t\t\t}\n\n \treturn $HTML;\n }", "public function getSelectPaymentHtml()\n\t{\n\t\treturn '<img src=\"modules/shop/plugins_payment/two_checkout/paymentlogoshorizontal.png\"\n align=\"left\"\n style=\"margin-right:7px;\">';\n\t}", "public function getTerms()\n {\n return view('frontend.info.policy');\n }", "function index()\n {\n $this->output('consent/v_result');\n }", "public function index()\n {\n return view('personal.verification');\n }", "protected function convert_vmes_to_html()\n {\n $mes = $this->get_mes();\n $pedidos_mes = $this->get_totalPedidos();\n $total_venta = $this->get_totalVentas();\n\n $output = '\n <h3 align=\"center\">Informe de ventas del mes de: '.$mes.'</h3>\n <table width=\"50%\" align=\"center\" style=\"border-collapse: collapse; border: 0px;\">\n <tr>\n <th style=\"border: 1px solid; padding:12px;\" width=\"20%\">Pedidos Totales</th>\n <th style=\"border: 1px solid; padding:12px;\" width=\"30%\">Venta Total ($CLP)</th>\n </tr>\n <tr>\n <td style=\"border: 1px solid; padding:12px;\">'.$pedidos_mes.'</td>\n <td style=\"border: 1px solid; padding:12px;\">'.$total_venta.'</td>\n </tr>\n </table>\n <h3 align=\"center\">Cantidad pedidos del mes: '.$pedidos_mes.'</h3>\n <h3 align=\"center\">Total vendido del mes: '.$total_venta.'</h3>';\n return $output;\n }", "function printHTML() \n {\n $this->openBlockHeader(\"CASPSR Help &amp; Support\");\n?>\n <table>\n <tr>\n <td>\n <a href=\"https://docs.google.com/document/d/1TqPdFopf5TkQ4uFGPWRfsaxd9zsex4YbDtzDr0NO7bI/edit?hl=en&authkey=CJuapdQO\">CASPSR Observer's Guide</a>\n </td>\n <td>Basic information on the use of CASPSR</td>\n </tr>\n <tr>\n <td>\n <a href=\"http://psrdada.sf.net/support.shtml\" style=\"text-decoration: none\"> <font color=green>PSR</font>DADA Support</a>\n </td>\n <td>To report bugs and/or request features</td>\n </tr>\n </table>\n\n<?\n $this->closeBlock();\n }", "public function form(){\n\t\t\t$form = '<div class=\"alert_pay\"><img src=\"https://www.alertpay.com/images/AlertPay_accepted_97x95.png\" alt=\"AlertPay-Acceptance-1\"/></div>';\n\t\t\treturn $form;\n\t\t}", "static function vox_html($utterance, $params){\n\n\t\textract(self::vox_prep_args($params) );\n\n\t\t$tag = (!isset($tag)) ? 'pre' : $tag;\n\t\t$label = (!isset($label)) ? '' : $label;\n\n\t\t$articulation = sprintf('<%s class=\"vox\">%s%s</%s><!-- /.vox -->', $tag, $label, $utterance, $tag);\n\n\t\treturn $articulation;\n\n\t}", "function cl_version_in_header() {\n echo '<meta name=\"generator\" content=\"Custom Login v' . CUSTOM_LOGIN_VERSION . '\" />' . \"\\n\";\n }", "function verifikasi()\n\t{\n\t\t$data['belum_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'belum'))->result();\n\t\t$data['sudah_terverifikasi'] = $this->Kesehatan_M->read('user',array('verified'=>'sudah','hak_akses !='=>'1'))->result();\n\t\t$this->load->view('static/header');\n\t\t$this->load->view('static/navbar');\n\t\t$this->load->view('admin/verifikasi',$data);\n\t\t$this->load->view('static/footer');\n\t}", "function VerificationCode()\n{\n\tglobal $context, $txt;\n\n\t$verification_id = isset($_GET['vid']) ? $_GET['vid'] : '';\n\t$code = $verification_id && isset($_SESSION[$verification_id . '_vv'], $_SESSION[$verification_id . '_vv']['code']) ? $_SESSION[$verification_id . '_vv']['code'] : (isset($_SESSION['visual_verification_code']) ? $_SESSION['visual_verification_code'] : '');\n\n\t// Somehow no code was generated or the session was lost.\n\tif (empty($code))\n\t\tblankGif();\n\n\t// Show a window that will play the verification code.\n\telseif (isset($_REQUEST['sound']))\n\t{\n\t\tloadLanguage(array('Help', 'Login'));\n\t\tloadTemplate('GenericPopup');\n\t\twetem::hide();\n\t\twetem::load('popup');\n\n\t\t$context['page_title'] = $txt['visual_verification_sound'];\n\t\t$context['verification_sound_href'] = '<URL>?action=verification;rand=' . md5(mt_rand()) . ($verification_id ? ';vid=' . $verification_id : '') . ';format=.wav';\n\n\t\t$context['popup_contents'] = '\n\t\t<audio src=\"' . $context['verification_sound_href'] . '\" controls id=\"audio\">';\n\n\t\tif (we::is('ie'))\n\t\t\t$context['popup_contents'] .= '\n\t\t\t<object classid=\"clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95\" type=\"audio/x-wav\">\n\t\t\t\t<param name=\"AutoStart\" value=\"1\">\n\t\t\t\t<param name=\"FileName\" value=\"' . $context['verification_sound_href'] . '\">\n\t\t\t</object>';\n\t\telse\n\t\t\t$context['popup_contents'] .= '\n\t\t\t<object type=\"audio/x-wav\" data=\"' . $context['verification_sound_href'] . '\">\n\t\t\t\t<a href=\"' . $context['verification_sound_href'] . '\" rel=\"nofollow\">' . $context['verification_sound_href'] . '</a>\n\t\t\t</object>';\n\n\t\t$context['popup_contents'] .= '\n\t\t</audio>\n\t\t<br>\n\t\t<a href=\"#\" onclick=\"$(\\'#audio\\')[0].play(); return false;\">' . $txt['visual_verification_sound_again'] . '</a><br>\n\t\t<a href=\"' . $context['verification_sound_href'] . '\" rel=\"nofollow\">' . $txt['visual_verification_sound_direct'] . '</a>';\n\n\t\tobExit();\n\t}\n\n\t// Try the nice code using GD.\n\telseif (empty($_REQUEST['format']))\n\t{\n\t\tloadSource('Subs-Captcha');\n\n\t\tif (!showCodeImage($code))\n\t\t\theader('HTTP/1.1 400 Bad Request');\n\t\t// You must be up to no good.\n\t\telse\n\t\t\tblankGif();\n\t}\n\n\telseif ($_REQUEST['format'] === '.wav')\n\t{\n\t\tloadSource('Subs-Sound');\n\n\t\tif (!createWaveFile($code))\n\t\t\theader('HTTP/1.1 400 Bad Request');\n\t}\n\n\t// And we're done.\n\texit;\n}", "function usersnap_section_text() {\r\n\t?>\r\n\t<table class=\"form-table\">\r\n\t\t<tr>\r\n\t\t\t<td>\r\n <div class=\"us-box\">Manage your API keys on <a href=\"https://usersnap.com/apikeys\" target=\"_blank\">http://usersnap.com/apikeys</a>.</div> \r\n </td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<?php\r\n}", "public function general_settings_bing_site_verify() {\n\t\t$bing_verification = get_option( 'wsuwp_bing_verify', false );\n\n\t\t?><input id=\"wsuwp_bing_verify\" name=\"wsuwp_bing_verify\" value=\"<?php echo esc_attr( $bing_verification ); ?>\" type=\"text\" class=\"regular-text\" /><?php\n\t}", "function randomTest(){\n $treatment = $this->getTreatment();\n $username = $this->generateUsername();\n $hashed = $this->generateMD5Pass();\n $extra = array('username' =>$username,\n\t\t 'treatment' => $treatment,\n\t\t 'hash' => $hashed);\n $output = $this->outputBoilerplate('test.html', $extra);\n return $output; \n }", "function VM_getHTMLStatusBlock($clientName)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t//Get VM host and software for the client\n\t$vmSwHost = VM_getSWandHost($clientName);\n\n\tif ($vmSwHost != false)\n\t{\n\t\t//Get the current VM status according to the VM software\n\t\t$vmInfo = VM_getStatus($clientName);\n\n\t\t//convert the switch status to readable information\n\t\t$readableStatus = VM_convertSwitchStatusInfo($vmInfo['state']);\n\n\t\t//Show general information about the VM client\n\t\t$vmInfoHTML = \"<tr><td colspan=\\\"2\\\"><span class=\\\"subhighlight\\\">$I18N_virtualisation</span></td></tr>\n\t\t<tr><td>$I18N_vmHost:</td><td>$vmSwHost[vmHost]</td></tr>\n\t\t<tr><td>$I18N_VMSoftware:</td><td>\".VM_vmSwNr2Name($vmSwHost[vmSoftware]).\"</td></tr>\n\t\t<tr><td>$I18N_status:</td><td>$readableStatus[text] $readableStatus[imgTag]</td></tr>\";\n\n\t\t//Show the visual connection URL and password if the VM client is on\n\t\tif ($vmInfo['state'] == VM_STATE_ON)\n\t\t{\n\t\t\t$hostDisplay = explode(':',$vmSwHost['vmVisualURL']);\n\t\t\t$vmInfoHTML .= \"<tr><td>$I18N_VMVisualURL:</td><td>$vmSwHost[vmVisualURL]</td></tr>\n\t\t\t<tr><td>$I18N_VMVisualPassword:</td><td>$vmSwHost[vmVisualPassword]</td></tr>\n\t\t\t<tr><td>TightVNC Java Viewer:</td><td><a target=\\\"_blank\\\" href=\\\"/java-vnc/vnc-viewer.php?host=$hostDisplay[0]&pass=$vmSwHost[vmVisualPassword]&display=$hostDisplay[1]\\\">$I18N_startVNCApplet</a></td></tr>\";\n\t\t}\n\n\t\t//Run thru the network cards and add their infos\n\t\tfor ($nicNr = 1; isset($vmInfo[\"nic$nicNr\"]); $nicNr++)\n\t\t{\n\t\t\t//Get the info blick for the current selected NIC\n\t\t\t$nic = $vmInfo[\"nic$nicNr\"];\n\t\t\t$vmInfoHTML .= \"<tr><td>$I18N_VMNetworkCard $nicNr:</td><td>$nic[netDev], $nic[speed]</td></tr>\";\n\t\t}\n\t}\n\n\treturn($vmInfoHTML);\n}", "private function getHtmlRequest() {\r\n\t\t\t$tpl = new Template('svdrp_request');\r\n\t\t\treturn $tpl->get();\r\n\t\t}", "public function showTemplate(): string\n {\n $Qr = CoreFunctions::mostrar_qr($this);\n $firmas = CoreFunctions::mostrar_estado_proceso($this);\n $Service = $this->getService();\n $contenido = $this->getFieldValue('contenido');\n return <<<HTML\n <table style=\"width: 100%;border: 0\">\n <tbody>\n <tr>\n <td colspan=\"2\">{$Service->getFechaCiudad()}</td>\n </tr>\n\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n\n <tr>\n <td>{$Service->getModel()->getFieldValue('destino')}</td>\n <td style=\"text-align:center\">$Qr<br/>No.{$Service->getRadicado()}</td>\n </tr>\n\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n\n <tr>\n <td colspan=\"2\">ASUNTO: $this->asunto</td>\n </tr>\n\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n\n <tr>\n <td colspan=\"2\">Cordial saludo:</td>\n </tr>\n \n <tr>\n <td colspan=\"2\">&nbsp;</td>\n </tr>\n </tbody>\n </table>\n $contenido\n <p>{$Service->getDespedida()}<br/><br/></p>\n $firmas\n <p>{$Service->getOtherData()}</p>\nHTML;\n\n }", "public function generate() {\n\n /** @var $code String generate code */\n\n $code = (new Users())->phoneNumber_GenerateCode();\n\n /** @var $user Array get the details of a current user */\n\n $user = (new Users())->current_user();\n\n /**\n * @var $phone_format String format mobile phone number\n * to non space and non special character format\n */\n\n $phone_format = preg_replace(\"/[\\W\\s]/m\",\"\",$user['CP']);\n\n /** @var $template String a message to send **/\n\n $template = \"From SCOA, use this code to verify your account '{$code}' \";\n\n /** @void send sms and notify the current user */\n\n sms::send($phone_format,$template);\n\n }", "function BuyBoxSetNow() {\n\treturn\n'\n<a class=\"button radius primary medium\" title=\"Earlyarts Box Set\" href=\"/store/products/nurturing-young-childrens-learning-box-set/\" >Save a whopping 40% and buy this pack in a box-set!</a>\n';\n\t\n}", "public function verify(){\n\t\t// getting the username and code from url\n\t\t$code=$_GET['c'];\n\t\t$user=$_GET['u'];\n\t\t// load the regmod model\n\t\t$this->load->model('regmod');\n\t\t// calling the function Vemail that check the valodation code with the username\n\t\t$flag=$this->regmod->Vemail($user,$code);\n\t\t// checking the Vemail the respond\n\t\tif($flag)\n\t\t\t{$data['res']= \"You have successfully verified your email. You may login to Hungry.lk with your username and password\";}\n\t\telse\n\t\t\t{$data['res']= \"Opps An error occurred in our system, try again later\";}\n\t\t$this->load->view(\"register_status_view\",$data);\n\t}", "public function getHtmlVer() {}", "public function reponse()\n {\n $paymentResponse = new Mercanet('S9i8qClCnb2CZU3y3Vn0toIOgz3z_aBi79akR30vM9o');\n\n $paymentResponse->setResponse($_POST);\n\n if ($paymentResponse->isValid() && $paymentResponse->isSuccessful()) {\n // Traitement pour les paiements valides\n return $this->render('shop/commande-ok.html.twig');\n } else {\n // Traitement pour les paiements en echec\n return $this->render('shop/commande-echec.html.twig');\n }\n }", "function RCSpam_DisplayResponseArea()\n{\n\techo '<div class=\"g-recaptcha\" data-sitekey=\"6LdZl3UUAAAAAFl0QYDomTMckYcP0dNnsjaEJnyC\"></div>';\n}", "public function oauthGenerateVerificationCode()\n {\n return substr(md5(rand()), 0, 6);\n }", "public function show_message() {\n\t\tif ( ! $this->is_activated || ! $this->purchase_code ) {\n\t\t\t$url = esc_url( 'admin.php?page=lievo-activation' );\n\t\t\t$link = sprintf( '<a href=\"%s\">%s</a>', $url, 'Product Activation' );\n\t\t\techo sprintf( ' To receive automatic updates a license activation is required. Please visit %s to activate your copy of LivIcons Evolution.', $link );\n\t\t}\n\t}", "public function generateVerificationCode()\n {\n $code = $this->createVerificationCode();\n\n $codeExists = $this->validateVerificationCode($code);\n\n $generationLimit = 100;\n\n while($codeExists && $generationLimit > 0)\n {\n $code = $this->createVerificationCode();\n\n $codeExists = $this->validateVerificationCode($code);\n\n $generationLimit--;\n }\n\n $this->forceFill([\n 'verification_code' => $code\n ])->save();\n\n return $code;\n }", "function getWebmasterTool()\r\n{\r\n\tglobal $pdo;\r\n\t\r\n\t$google_webmaster_tool = getConfig(\"google_webmaster_tool\");\r\n\tif($google_webmaster_tool != '')\r\n\t{\r\n\t?>\r\n\t<meta name=\"google-site-verification\" content=\"<?php echo $google_webmaster_tool; ?>\" />\r\n\t<?php\r\n\t}\r\n}", "public function generateHtml()\n {\n return $this->presenter->getView()->generateHtml();\n }", "public function verify()\n {\n return view('pages.verify');\n }", "public static function include_vat_check() {\n ?>\n <p id=\"edd-vat-reg-check-wrap\">\n <label for=\"edd-vatreg\" class=\"edd-label\">\n <?php _e( 'I am registered for VAT in the EU', 'taxamoedd' ); ?>\n <input class=\"edd-vatreg\" type=\"checkbox\" name=\"edd_vatreg\" id=\"edd-vatreg\" value=\"true\" />\n </label>\n </p>\n\n <p id=\"edd-vat-reg-number-wrap\">\n <label for=\"vat_number\" class=\"edd-label\">\n <?php _e( 'VAT Number', 'taxamoedd' ); ?>\n </label>\n <span class=\"edd-description\"><?php _e( 'If you are registered for VAT, place your VAT number here (no spaces).', 'taxamoedd' ); ?></span>\n <input type=\"text\" id=\"vat_number\" name=\"vat_number\" class=\"vat-number edd-input\" placeholder=\"<?php _e( 'VAT Number', 'taxamoedd' ); ?>\" value=\"\"/>\n </p>\n\n\n <?php\n }", "private function generateChallenge()\n {\n //store two random numbers in an array\n $numbers = array(mt_rand(1,4),mt_rand(1,4));\n //store the correct answer in a session\n $_SESSION['challenge'] = $numbers[0] + $numbers[1];\n //convert the numbers to their ASCII\n $converted = array_map('ord', $numbers);\n //generate a math question as HTML markup\n return \"\n <label>&#87;&#104;&#97;&#116;&#32;&#105;&#115;&#32;\n &#$converted[0];&#32;&#43;&#32;&#$converted[1];&#63;\n <input type=\\\"text\\\" name=\\\"s_q\\\" />\n </label>\";\n }", "public function general_settings_google_site_verify() {\n\t\t$google_verification = get_option( 'wsuwp_google_verify', false );\n\n\t\t?><input id=\"wsuwp_google_verify\" name=\"wsuwp_google_verify\" value=\"<?php echo esc_attr( $google_verification ); ?>\" type=\"text\" class=\"regular-text\" /><?php\n\t}", "public function render_html() {\n global $USER;\n $courseid = \\mod_customcert\\element_helper::get_courseid($this->get_id());\n $content = $this->get_decoded_data()->content;\n $text = format_text($content, FORMAT_HTML, ['context' => \\context_course::instance($courseid)]);\n\n return \\mod_customcert\\element_helper::render_html_content($this, $this->render_table($text, $USER, true));\n }", "public function contentHtml()\n {\n return '<h3>Akun Personil Penghubung PME BBLK Palembang</h3>' .\n '<p>Terima kasih atas partisipasi Anda. Berikut tautan yang dapat Anda gunakan untuk mereset password Anda di dalam sistem PME BBLK Palembang.</p>' .\n '<p><a href=\"' . $this->link() . '\" target=\"_blank\">' . $this->link() . '</a></p>'.\n '<p>Dimohon untuk menjaga kerahasiaan password.<br/><br/>E-mail ini dikikrimkan oleh sistem. Mohon untuk tidak membalas e-mail ini.</p>';\n }", "public function getVerCode(){\n \n $rand = $this->generateRandomString(6);\n return $rand;\n }", "public function getPage() {\n return $this->render('payment_info.phtml');\n }", "public function getTwoStepVerificationCode();", "function printHTML() \n {\n $this->openBlockHeader(\"Candidate Event\");\n?>\n <img id='candidate_image' src=\"<?echo $this->cand_url?>\">\n<?\n $this->closeBlockHeader();\n }", "function get_html_policy($product) {\r\n $h_exp = \"<br />\";\r\n if ($this->total_level_1 > 0) {\r\n $h_exp .= $this->get_level_policy($this->total_discount_1, $this->total_level_1); \r\n $h_exp .= \"<br />\"; \r\n }\r\n if ($this->total_level_2 > 0) {\r\n $h_exp .= $this->get_level_policy($this->total_discount_2, $this->total_level_2); \r\n $h_exp .= \"<br />\"; \r\n }\r\n if ($this->total_level_3 > 0) {\r\n $h_exp .= $this->get_level_policy($this->total_discount_3, $this->total_level_3); \r\n $h_exp .= \"<br />\"; \r\n }\r\n if ($this->total_level_4 > 0) {\r\n $h_exp .= $this->get_level_policy($this->total_discount_4, $this->total_level_4); \r\n $h_exp .= \"<br />\"; \r\n }\r\n if ($this->total_level_5 > 0) {\r\n $h_exp .= $this->get_level_policy($this->total_discount_5, $this->total_level_5); \r\n $h_exp .= \"<br />\"; \r\n }\r\n\r\n for ($i = 0, $n=sizeof($this->extra_levels); $i < $n; $i++) {\r\n $h_exp .= $this->get_level_policy( $this->extra_discounts[$i], $this->extra_levels[$i]);\r\n $h_exp .= \"<br />\"; \r\n }\r\n \r\n $h_exp .= \"<br />\";\r\n return $h_exp; \r\n }", "protected function _toHtml()\n {\n $isValid = $this->httpContext->getValue(Context::CONTEXT_AUTH) || $this->getCustomerId();\n return $isValid ? parent::_toHtml() : '';\n }", "function render_v_code($email=\"\"){\n $CI = & get_instance();\n $data = array();\n $CI->load->library('encryption');\n $code = bin2hex($CI->encryption->create_key(16));\n $data['v_code'] = array('code'=>$code,'email'=> $email);\n return $data;\n}", "public function getHtmlResponse() {\n return \\Lib\\Format::forge($this->_response)->to_html();\n }", "public function generate()\n {\n # Build teh Header\n $this->buildHeader();\n\n # Switch the Views\n switch ($this->view) {\n case 'day':\n $this->buildBodyDay();\n break;\n case 'week':\n $this->buildBodyWeek();\n break;\n default:\n $this->buildBody();\n break;\n }\n # return thr string\n return $this->html;\n }", "function send_verification_mail($to, $title, $link){\r\n\r\n // body contains the mail body which will be send to user\r\n $body = \"<html>\r\n <body>\r\n Please Use Below Link To Subscribe With XKCD<br />\r\n <button><a target='_blank' href=$link>Click Here To Complete Verification</a></button>\r\n </body>\r\n </html>\";\r\n \r\n // headers are required to send mail\r\n // it is inbuilt content which id added as parameter with the mail method\r\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\r\n $headers .= \"Content-type:text/html;charset=UTF-8\" . \"\\r\\n\";\r\n\r\n // PHP inbuilt method to send mail\r\n mail($to, $title, $body, $headers);\r\n}", "public function getRateResultHtml($result, $admin = false)\n {\n if (!$admin) {\n echo '<div id=\"piRpNotfication\">' . $this->__('pi_lang_information') . \":<br/>\" . $this->__('pi_lang_info[\\''. $result['code'] . '\\']') . '</div>';\n }\n \n echo '<h2 class=\"pirpmid-heading\"><b>' . $this->__('pi_lang_individual_rate_calculation') . '</b></h2>';\n echo '<table id=\"piInstallmentTerms\" cellspacing=\"0\">';\n echo ' <tr>';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoPaymentPrice\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoPaymentPrice\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\">' . $this->__('pi_lang_cash_payment_price') . ':</div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoPaymentPrice\">' . $this->__('pi_lang_mouseover_cash_payment_price') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td>&nbsp;' . $result['amount'] . '</td>';\n echo ' <td class=\"piRpTextAlignLeft\">&euro;</td>';\n echo ' </tr>';\n echo ' <tr class=\"piTableHr\">';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoServiceCharge\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoServiceCharge\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') .'\"/></div>';\n echo ' <div class=\"piRpFloatLeft\">' . $this->__('pi_lang_service_charge') . ':</div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoServiceCharge\">' . $this->__('pi_lang_mouseover_service_charge') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td>&nbsp;' . $result['serviceCharge'] . '</td>';\n echo ' <td class=\"piRpTextAlignLeft\">&euro;</td>';\n echo ' </tr>';\n echo ' <tr class=\"piPriceSectionHead\">';\n echo ' <th class=\"piRpPercentWidth\">';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoEffectiveRate\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoEffectiveRate\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\">' . $this->__('pi_lang_effective_rate') . ':</div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoEffectiveRate\">' . $this->__('pi_lang_mouseover_effective_rate') . ':</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td colspan=\"2\"><div class=\"piRpFloatLeft\">&nbsp;<div class=\"piRpPercentWith\">' . $result['annualPercentageRate'] . '%</div></div></td>';\n echo ' </tr>';\n echo ' <tr class=\"piTableHr\">';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoDebitRate\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoDebitRate\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\">' . $this->__('pi_lang_interestrate_default') . ':</div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoDebitRate\">' . $this->__('pi_lang_mouseover_debit_rate') . ':</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td colspan=\"2\"><div class=\"piRpFloatLeft\">&nbsp;<div class=\"piRpPercentWith\">' . $result['interestRate'] . '%</div></div></td>';\n echo ' </tr>';\n echo ' <tr>';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoInterestAmount\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoInterestAmount\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\">' . $this->__('pi_lang_interest_amount') . ':</div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoInterestAmount\">' . $this->__('pi_lang_mouseover_interest_amount') . ':</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td>&nbsp;' . $result['interestAmount'] . '</td>';\n echo ' <td class=\"piRpTextAlignLeft\">&euro;</td>';\n echo ' </tr>';\n echo ' <tr>';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoTotalAmount\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoTotalAmount\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\"><b>' . $this->__('pi_lang_total_amount') . ':</b></div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoTotalAmount\">' . $this->__('pi_lang_mouseover_total_amount') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td><b>&nbsp;' . $result['totalAmount'] . '</b></td>';\n echo ' <td class=\"piRpTextAlignLeft\"><b>&euro;</b></td>';\n echo ' </tr>';\n echo ' <tr>';\n echo ' <td colspan=\"2\"><div class=\"piRpFloatLeft\">&nbsp;<div></td>';\n echo ' </tr>';\n echo ' <tr>';\n echo ' <td colspan=\"2\"><div class=\"piRpFloatLeft\">' . $this->__('pi_lang_calulation_result_text') . '<div></td>';\n echo ' </tr>';\n echo ' <tr class=\"piRpyellow piPriceSectionHead\">';\n echo ' <th class=\"piRpPaddingTop\">';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoDurationTime\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoDurationTime\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft\"><b>' . $this->__('pi_lang_duration_time') . ':</b></div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoDurationTime\">' . $this->__('pi_lang_mouseover_duration_time') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td colspan=\"2\" class=\"piRpPaddingRight piRpPaddingTop\"><b>' . $result['numberOfRatesFull'] . '&nbsp;' . $this->__('pi_lang_months') . '</b></td>';\n echo ' </tr>';\n echo ' <tr class=\"piRpyellow\">';\n echo ' <th>';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoDurationMonth\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoDurationMonth\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft piRpPaddingLeft\"><b>' . $result['numberOfRates'] . '' . $this->__('pi_lang_duration_month') . ':</b></div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoDurationMonth\">' . $this->__('pi_lang_mouseover_duration_month') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td><b>&nbsp;' . $result['rate'] . '</b></td>';\n echo ' <td class=\"piRpPaddingRight\"><b>&euro;</b></td>';\n echo ' </tr>';\n echo ' <tr class=\"piRpyellow piRpPaddingBottom\">';\n echo ' <th class=\"piRpPaddingBottom\">';\n echo ' <div class=\"piRpInfoImgDiv\"><img onMouseOver=\"piMouseOver(\\'piRpMouseoverInfoLastRate\\')\" onMouseOut=\"piMouseOut(\\'piRpMouseoverInfoLastRate\\')\" class=\"piRpInfoImg\" src=\"' . Mage::getDesign()->getSkinUrl('images/ratepay/info-icon.png') . '\"/></div>';\n echo ' <div class=\"piRpFloatLeft piRpPaddingLeft\"><b>' . $this->__('pi_lang_last_rate') . ':</b></div>';\n echo ' <div class=\"piRpRelativePosition\">';\n echo ' <div class=\"piRpMouseoverInfo\" id=\"piRpMouseoverInfoLastRate\">' . $this->__('pi_lang_mouseover_last_rate') . '</div>';\n echo ' </div>';\n echo ' </th>';\n echo ' <td class=\"piRpPaddingBottom\"><b>&nbsp;' . $result['lastRate'] . '</b></td>';\n echo ' <td class=\"piRpPaddingRight piRpPaddingBottom\"><b>&euro;</b></td>';\n echo ' </tr>';\n echo ' <tr>';\n echo ' <td colspan=\"2\"><div class=\"piRpCalculationText \">' . $this->__('pi_lang_calulation_example') . '</div></td>';\n echo ' </tr>';\n echo '</table>';\n }", "function actMessage($link, $vk) {\r\n\t\r\n\t$msg =\"<html>\r\n\t\t\t<body>\r\n\t\t\t<h1>Scio Exchange</h1>\r\n\t\t\t<h2>Your source of all knowledge</h2>\r\n\t\t\t<p><strong>Congratulations!</strong> You have signed up to the best site on the Web</p>\r\n\t\t\t<p>To activate your user follow <a href='\" . $link . \"'>this link</a></p>\r\n\t\t\t<p>Your activation key is \" . $vk .\"</p>\r\n\t\t\t<p><br/><strong>ScioXchange Team</strong></p>\r\n\t\t\t</body></html>\";\r\n\t\r\n\treturn $msg;\r\n}", "private function successBuilder() {\n $html = '\n <html>\n <head></head>\n <body>\n <p class=\"valid\">Your form has been sended !</p>\n </body>\n </html>';\n\n return $html;\n }", "private function formVipCode() {\n\t\t\t\n\t\t\t//The vipcode is formed by y - Year 2 digits, z - day of the year, Hi - Hour and minutes, s - seconds\n\t\t\t$this->vipCodeUniqueId = date('yz-Hi-s');\n\t\t\t//$this->vipCodeUniqueId = explode('.', microtime(true))[0] . explode('.', microtime(true))[1];\n\t\t\t$this->vipCode = \"voltoAo\" . ucfirst($this->enterprise->getName()) . \"#\". $this->vipCodeUniqueId;\n\t\t\treturn $this->vipCode;\n\t\t\t\n\t\t}" ]
[ "0.6333927", "0.6237801", "0.5957102", "0.5798831", "0.5782843", "0.57435066", "0.57111543", "0.56600523", "0.5656151", "0.55967087", "0.5590035", "0.55783516", "0.5529423", "0.5524626", "0.54911387", "0.5489552", "0.546047", "0.542538", "0.5414767", "0.5403754", "0.5389062", "0.53823036", "0.53804666", "0.53746885", "0.53699845", "0.5368222", "0.53580076", "0.53533554", "0.53483176", "0.53406215", "0.5330121", "0.53074634", "0.5302781", "0.5300078", "0.52975774", "0.5288415", "0.52779186", "0.52604896", "0.526013", "0.5260036", "0.52597845", "0.5259074", "0.52455014", "0.5237575", "0.5235372", "0.5213976", "0.5206961", "0.5205562", "0.52013063", "0.52013063", "0.5199877", "0.5194285", "0.51882464", "0.5187681", "0.5186107", "0.51842153", "0.51731545", "0.516986", "0.5167403", "0.5152937", "0.5145471", "0.51439786", "0.5142847", "0.51422334", "0.51361907", "0.5135531", "0.5133542", "0.5128344", "0.5124393", "0.512412", "0.51179314", "0.511676", "0.5109919", "0.51078254", "0.50953007", "0.508164", "0.5079007", "0.5077375", "0.50767535", "0.50744176", "0.5072402", "0.5065239", "0.506068", "0.5054222", "0.5053575", "0.505247", "0.50495034", "0.5045461", "0.50420344", "0.5033448", "0.50327075", "0.50205135", "0.5013023", "0.5007768", "0.5006705", "0.50045717", "0.50041807", "0.50037885", "0.4996694", "0.49939036" ]
0.66289955
0
Takes a workflow event and triggers all workflows that are active and have a workflow event that matches the event that was triggered
public function triggerEvent(AbstractWorkflowEvent $workflowEvent): Collection { // track the workflow runs that we are going to be dispatching $workflowProcessCollection = collect(); /** * Find all workflows that are active and have a workflow event that matches the event that was triggered */ Workflow::query() ->active() ->forEvent($workflowEvent) ->each(function (Workflow $workflow) use (&$workflowProcessCollection, $workflowEvent) { // Create the run $workflowProcess = $this->createWorkflowProcess($workflow, $workflowEvent); // Dispatch the run so that it can be processed $this->dispatchProcess($workflowProcess, $workflowEvent->getQueue()); // Identify that the workflow run was spawned by the triggering of the event $workflowProcessCollection->push($workflowProcess); }); // Return all the workflow runs that were spawned by the triggering of the event return $workflowProcessCollection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function triggerEvent(Webhook $webhook, $event);", "public function triggerWorkflow()\n {\n $this->request->setParam('wfTrigger', 'true');\n return $this;\n }", "protected function triggerEvent(Event $event)\n {\n $this->log(\"Triggered Event [{$event->id}]\");\n\n /** @var Task[] $tasks */\n $tasks = $event->getTasks()->andWhere(['active' => true])->all();\n\n foreach ($tasks as $task) {\n $this->doTask($task);\n }\n\n $event->last_triggered_at = time();\n $event->save(false);\n\n $this->log(\"Tasks for Event [{$event->id}] done\");\n }", "public static function workflowActions();", "public function workflow_automated_inactivity(){\n //Get all the open submissions\n $submissions = WorkflowSubmission::where('status','open')->get();\n //Get all the workflow instances\n $all_instances = WorkflowInstance::get();\n foreach ($submissions as $submission){\n //Find the instance of the submission\n $instance = $all_instances->where('id',$submission->workflow_instance_id)->first();\n\n //Check if the instance exist\n if(isset($instance)){\n //Calling findVersion function to get the related version information/ data\n $instance->findVersion();\n config([\"app.site\"=>$instance->group->site]);\n\n //Getting the current state of the workflow\n $state = Arr::first($instance->workflow->code->flow,function($value,$key) use ($submission){\n return $value->name === $submission->state;\n });\n // If the state is a valid state, then continue\n if(isset($state) && !is_null($state)){\n if($submission->state === $state->name){\n foreach ($state->actions as $action) { // Goes through each action of the state\n //Checks if the action is an internal action and the last updated date is equal to or greater than delay of the internal action\n if (isset($action->assignment) && // Checks if the action is assigned other than the assignee\n $action->assignment->type === 'internal' &&// Checks if the action is internal(inactivity based)\n isset($action->assignment->delay) && // Checks if the delay of the action is set\n $submission->updated_at->diffInDays(Carbon::now()) >= $action->assignment->delay && // Checks if the days past is equal to or bigger than the delay defined in the workflow\n isset($action->name) && !is_null($action->name)// Checks if the action's name is set\n ) {\n $action_request = new Request();// Creating a new request\n $action_request->setMethod('PUT'); //Setting the request type to PUT\n $action_request->request->add([// Setting the request parameters\n \"action\" => $action->name,\n \"comment\" => \"Automated \".$action->label.\" action was taken due to inactivity for \".$action->assignment->delay.\" days\"\n ]);\n $submission->assignment_type = $action->assignment->type; // Setting the assignment type of the action\n try {\n $GLOBALS['action_stack_depth']=0; //To reset the global variable before every task. This is necessary for internal automated operations\n $this->action($submission, $action_request, true); // runs the action method\n }\n catch(\\Throwable $e){\n //Do nothing\n }\n }\n }\n }\n }\n }\n }\n }", "public function triggerEvent($eventId);", "public function Trigger() {\r\n $form_instance = $this->form_instance; \r\n // If the form is not using events\r\n if (!$form_instance->use_events) { return $this; }\r\n // Retrieve the events\r\n $events = $form_instance->events;\r\n // If there are no events\r\n if (!$events || !is_array($events)) { return $this; } \r\n // The passed and failed actions\r\n $actions_passed = array();\r\n $actions_failed = array();\r\n // Loop through each of the events\r\n foreach ($events as $k => $action_instance) {\r\n // If the action fails the check\r\n if (!$action_instance->Check()) { continue; } \r\n // Trigger the action\r\n $action_instance->Trigger();\r\n }\r\n // Return the object for chaining\r\n return $this;\r\n }", "public function getTriggeringEvents();", "public static function workflowStates();", "function listWorkflowTriggers() {\n $triggerlist = array();\n foreach ($this->triggers as $sNamespace => $aTrigInfo) {\n $oTriggerObj = $this->getWorkflowTrigger($sNamespace);\n $triggerlist[$sNamespace] = $oTriggerObj->getInfo();\n }\n // FIXME do we want to order this alphabetically?\n return $triggerlist;\n }", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "function onArrival( $hookParameters, $workflow, $currentStation, $currentStep){return;}", "protected function addWorkflowActivities()\n {\n // but are derived from the workflows.xml in order to model what we call \"workflow activities\".\n foreach ($this->aggregate_root_type_map as $aggregate_root_type) {\n $workflow_activities_map = $this->workflow_activity_service->getActivities($aggregate_root_type);\n\n foreach ($workflow_activities_map as $workflow_step => $workflow_activities) {\n $scope = sprintf(self::WORKFLOW_SCOPE_PATTERN, $aggregate_root_type->getPrefix(), $workflow_step);\n\n if ($this->activity_container_map->hasKey($scope)) {\n $container = $this->activity_container_map->getItem($scope);\n $container->getActivityMap()->append($workflow_activities);\n } else {\n $container_state = [ 'scope' => $scope, 'activity_map' => $workflow_activities ];\n $workflow_activity_container = new ActivityContainer($container_state);\n $this->activity_container_map->setItem($scope, $workflow_activity_container);\n }\n }\n }\n }", "public function onEvent(Event $event) {\n\t\tif ($this->runtimeContext) {\n\t\t\t$this->workflowActivity->onEvent($this->runtimeContext, $event);\n\t\t}\n\t}", "public function flow() {\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "function validate_workflow( $workflow ) {\n\n\t\tif ( ! $trigger = $workflow->get_trigger() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function setWorkflow(Workflow $workflow);", "public static function trigger($triggerName, $params = array()) {\n if (self::$_triggerDepth > self::MAX_TRIGGER_DEPTH) { // ...have we delved too deep?\n return;\n }\n\n $triggeredAt = time();\n\n if (isset($params['model']) &&\n (!is_object($params['model']) || (!($params['model'] instanceof X2Model)))) {\n // Invalid model provided\n return false;\n }\n\n // Communicate the event to third-party systems, if any\n ApiHook::runAll($triggerName, $params);\n\n // increment stack depth before doing anything that might call X2Flow::trigger()\n self::$_triggerDepth++;\n\n $flowAttributes = array('triggerType' => $triggerName, 'active' => 1);\n\n if (isset($params['model'])) {\n $flowAttributes['modelClass'] = get_class($params['model']);\n $params['modelClass'] = get_class($params['model']);\n }\n\n // if flow id is specified, only execute flow with specified id\n if (isset($params['flowId'])) {\n $flowAttributes['id'] = $params['flowId'];\n }\n\n $flows = CActiveRecord::model('X2Flow')->findAllByAttributes($flowAttributes);\n\n // collect information about trigger for the trigger log.\n $triggerInfo = array(\n 'triggerName' => Yii::t('studio', X2FlowItem::getTitle($triggerName))\n );\n if (isset($params['model']) && (is_subclass_of($params['model'], 'X2Model')) &&\n $params['model']->asa('LinkableBehavior')) {\n $triggerInfo['modelLink'] = Yii::t('studio', 'View record: ') . $params['model']->getLink();\n }\n \n // find all flows matching this trigger and modelClass\n $triggerLog;\n $flowTrace;\n $flowRetVal = null;\n foreach ($flows as &$flow) {\n $triggerLog = new TriggerLog();\n $triggerLog->triggeredAt = $triggeredAt;\n $triggerLog->flowId = $flow->id;\n $triggerLog->save();\n\n $flowRetArr = self::_executeFlow($flow, $params, null, $triggerLog->id);\n $flowTrace = $flowRetArr['trace'];\n $flowRetVal = (isset($flowRetArr['retVal'])) ? $flowRetArr['retVal'] : null;\n $flowRetVal = self::extractRetValFromTrace($flowTrace);\n\n // save log for triggered flow\n $triggerLog->triggerLog = CJSON::encode(array_merge(array($triggerInfo), array($flowTrace)));\n $triggerLog->save();\n }\n\n // this trigger call is done; decrement the stack depth\n self::$_triggerDepth--;\n return $flowRetVal;\n }", "function activateSchedules()\n{\n\tforeach( glob( __DIR__ . '/actions/*.php') as $hook ) {\n\n\t\t$hook = explode('-', pathinfo( $hook )['filename']);\n\t\t$name = $hook[0];\n\t\t$schedule = $hook[1];\n\t\t$timestamp = wp_next_scheduled( $name );\n\n\t\tif ( ! $timestamp || $timestamp < time() ) {\n\t\t\twp_schedule_event( time(), 'schedule' . $schedule, $name );\n\t\t}\n\t}\n}", "public function testWorkflowSeeder1()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1994-12-10',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function triggerEvent($event) {\r\n\t\tif (!isset($this->eventListener[$event])) return void;\r\n\t\t\r\n\t\tforeach($this->eventListener[$event] as $listener) {\r\n\t\t\t$listener->listen($event);\r\n\t\t}\r\n\t}", "private function registerWorkflowRunnersHook()\n\t{\n\t\t$this->app->afterResolving(function(WorkflowRunner $runner, $app)\n\t\t{\n\t\t\t$runner->setWorkflow($app['cerbero.workflow']);\n\t\t});\n\t}", "public function testWorkflowSeeder3()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-12-08',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $hotTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function triggerEvent($eventname)\n {\n $args = array_slice(func_get_args(), 1);\n\n $triggers = $this->context->plugins->getEventTriggers($eventname);\n $ret = true;\n foreach ($triggers as $plugin) {\n $r = call_user_func_array(callback($this[$plugin], $eventname), $args);\n if ($r === false) {\n $ret = false;\n }\n }\n return $ret;\n }", "public function setIsWorkflowInEffect() {\n\t\t// if there is a workflow applied, we can't set the publishing date directly, only the 'desired' publishing date\n\t\t$effective = $this->workflowService->getDefinitionFor($this->owner);\n\t\t$this->isWorkflowInEffect = $effective?true:false;\n\t}", "public function testWorkflowSeeder4()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-01-18',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $coldTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function testWorkflowSeeder2()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1992-01-14',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "protected function getActiveOrderWorkflows() {\n $active_workflows = [];\n $order_types = $this->entityTypeManager\n ->getStorage('commerce_order_type')\n ->loadMultiple();\n\n foreach ($order_types as $order_type) {\n $workflow_label = $this->workflowManager->getDefinition($order_type->getWorkflowId())['label'];\n $active_workflows[$order_type->getWorkflowId()] = $workflow_label;\n }\n\n return $active_workflows;\n }", "public function triggerEvent(TFW_Event $event){\n if(method_exists($this, $event->getAction()))\n call_user_func_array(array($this, $event->getAction()), $event->getArgs());\n }", "public function runDailyWorkflows($dbh)\r\n\t{\r\n\t\t$cond = \"f_active='t' and f_on_daily='t' and (ts_on_daily_lastrun is null or ts_on_daily_lastrun<ts_on_daily_lastrun - INTERVAL '1 day')\";\r\n\t\t$wflist = new WorkFlow_List($dbh, $cond);\r\n\t\tfor ($w = 0; $w < $wflist->getNumWorkFlows(); $w++)\r\n\t\t{\r\n\t\t\t$wf = $wflist->getWorkFlow($w);\r\n\r\n\t\t\t// Look for/sweep for matching objects\r\n\t\t\t$ol = new CAntObjectList($dbh, $wf->object_type);\r\n\t\t\t// Build condition\r\n\t\t\tfor ($j = 0; $j < $wf->getNumConditions(); $j++)\r\n\t\t\t{\r\n\t\t\t\t$cond = $wf->getCondition($j);\r\n\t\t\t\t$ol->addCondition($cond->blogic, $cond->fieldName, $cond->operator, $cond->value);\r\n\t\t\t}\r\n\t\t\t// Now get objects\r\n\t\t\t$ol->getObjects();\r\n\t\t\tfor ($j = 0; $j < $ol->getNumObjects(); $j++)\r\n\t\t\t{\r\n\t\t\t\t$obj = $ol->getObject($j);\r\n\t\t\t\tif ($obj->getValue(\"f_deleted\") != 't')\r\n\t\t\t\t\t$wf->execute($obj);\r\n\t\t\t}\r\n\r\n\t\t\t// Update last run\r\n\t\t\t$dbh->Query(\"UPDATE workflows SET ts_on_daily_lastrun='now' WHERE id='\".$wf->id.\"'\");\r\n\t\t}\r\n\t}", "public function testActionUseCase1()\n {\n // person data\n\n // workflow data\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey()\n ]);\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type rent',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $this->leadTypeId,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n app(WorkflowService::class)->syncActions($workflow, $action1);\n\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\necho $output->fetch();\n $this->assertEquals($status, 0);\n //$this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n $this->seeInDatabase('persons',[\n 'id' => $this->person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n // TODO: check to ES action_logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(),\n 'object_id' => $this->person->getKey(),\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "public function set_workflow (array $workflow) {\n $this->workflow = $workflow;\n }", "public function workflowsAction() {\n\t$workflows = new Workflows();\n\t$this->view->workflows = $workflows->getStageNames();\n\t}", "function changeWorkflowOnDocument($oWorkflow, $oDocument) {\n $oDocument =& KTUtil::getObject('Document', $oDocument);\n \n \n // fix for 1049: workflows reset on document move.\n // this was the original purpose of \"changeWorkflowOnDocument\".\n if (is_null($oWorkflow)) { \n if ($oDocument->getWorkflowId() == null) {\n return true; // no definition.\n }\n } else {\n if ($oDocument->getWorkflowId() == $oWorkflow->getId()) {\n return true; // bail out, essentially.\n }\n } \n \n return KTWorkflowUtil::startWorkflowOnDocument($oWorkflow, $oDocument);\n }", "public function triggerEvent($event, array $arguments = null);", "function execute($process, $event)\n {\n $returnStatus = eZWorkflowType::STATUS_ACCEPTED;\n\n $parameters = $process->attribute('parameter_list');\n $object = eZContentObject::fetch($parameters['object_id']);\n\n if (!$object) {\n eZDebugSetting::writeError('extension-workflow-changeobjectdate', 'The object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n }\n\n // if a newer object is the current version, abort this workflow.\n $currentVersion = $object->attribute('current_version');\n $version = $object->version($parameters['version']);\n\n if (!$version) {\n eZDebugSetting::writeError('The version of object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object version is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n\n }\n\n $objectAttributes = $version->attribute('contentobject_attributes');\n\n $changeDateObject = $this->workflowEventContent($event);\n\n $publishAttributeArray = (array)$changeDateObject->attribute('publish_attribute_array');\n $futureDateStateAssign = $changeDateObject->attribute('future_date_state');\n $pastDateStateAssign = $changeDateObject->attribute('past_date_state');\n\n $publishAttribute = false;\n\n foreach ($objectAttributes as $objectAttribute) {\n $contentClassAttributeID = $objectAttribute->attribute('contentclassattribute_id');\n if (in_array($contentClassAttributeID, $publishAttributeArray)) {\n $publishAttribute = $objectAttribute;\n }\n }\n\n if ($publishAttribute instanceof eZContentObjectAttribute && $publishAttribute->attribute('has_content')) {\n $date = $publishAttribute->attribute('content');\n if ($date instanceof eZDateTime || $date instanceof eZDate) {\n $object->setAttribute('published', $date->timeStamp());\n $object->store();\n if ($date->timeStamp() > time()){\n if ($futureDateStateAssign instanceof eZContentObjectState) {\n $object->assignState($futureDateStateAssign);\n }\n }elseif($pastDateStateAssign instanceof eZContentObjectState){\n $object->assignState($pastDateStateAssign);\n }\n if ($parameters['trigger_name'] != 'pre_publish') {\n eZContentOperationCollection::registerSearchObject($object->attribute('id'), $object->attribute('current_version'));\n }\n eZDebug::writeNotice('Workflow change object publish date', __METHOD__);\n }\n }\n\n return $returnStatus;\n }", "public function testTransitionEvent() {\n $entity = EntityTestWithBundle::create([\n 'type' => 'first',\n 'name' => 'Test entity',\n 'field_state' => 'new',\n ]);\n $entity->save();\n\n $entity->get('field_state')->first()->applyTransitionById('create');\n $entity->save();\n\n $messages = \\Drupal::messenger()->all();\n $message = reset($messages);\n $this->assertCount(6, $message);\n $this->assertEquals('Test entity (field_state) - Fulfillment at pre-transition (workflow: default, transition: create).', (string) $message[0]);\n $this->assertEquals('Test entity (field_state) - Fulfillment at group pre-transition (workflow: default, transition: create).', (string) $message[1]);\n $this->assertEquals('Test entity (field_state) - Fulfillment at generic pre-transition (workflow: default, transition: create).', (string) $message[2]);\n $this->assertEquals('Test entity (field_state) - Fulfillment at post-transition (workflow: default, transition: create).', (string) $message[3]);\n $this->assertEquals('Test entity (field_state) - Fulfillment at group post-transition (workflow: default, transition: create).', (string) $message[4]);\n $this->assertEquals('Test entity (field_state) - Fulfillment at generic post-transition (workflow: default, transition: create).', (string) $message[5]);\n\n \\Drupal::messenger()->deleteAll();\n $entity->get('field_state')->first()->applyTransitionById('fulfill');\n $entity->save();\n\n $messages = \\Drupal::messenger()->all();\n $message = reset($messages);\n $this->assertCount(4, $message);\n $this->assertEquals('Test entity (field_state) - Completed at group pre-transition (workflow: default, transition: fulfill).', (string) $message[0]);\n $this->assertEquals('Test entity (field_state) - Completed at generic pre-transition (workflow: default, transition: fulfill).', (string) $message[1]);\n $this->assertEquals('Test entity (field_state) - Completed at group post-transition (workflow: default, transition: fulfill).', (string) $message[2]);\n $this->assertEquals('Test entity (field_state) - Completed at generic post-transition (workflow: default, transition: fulfill).', (string) $message[3]);\n\n \\Drupal::messenger()->deleteAll();\n $entity = EntityTestWithBundle::create([\n 'type' => 'first',\n 'name' => 'Test entity 2',\n 'field_state' => 'new',\n ]);\n $entity->save();\n $entity->get('field_state')->first()->applyTransitionById('create');\n $entity->save();\n\n $messages = \\Drupal::messenger()->all();\n $message = reset($messages);\n $this->assertCount(6, $message);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at pre-transition (workflow: default, transition: create).', (string) $message[0]);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at group pre-transition (workflow: default, transition: create).', (string) $message[1]);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at generic pre-transition (workflow: default, transition: create).', (string) $message[2]);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at post-transition (workflow: default, transition: create).', (string) $message[3]);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at group post-transition (workflow: default, transition: create).', (string) $message[4]);\n $this->assertEquals('Test entity 2 (field_state) - Fulfillment at generic post-transition (workflow: default, transition: create).', (string) $message[5]);\n\n \\Drupal::messenger()->deleteAll();\n // Ensure manually setting the state to \"create\", triggers the cancel\n // transition and not the 'fulfill' transition previously applied.\n $entity->set('field_state', 'canceled');\n $entity->save();\n $messages = \\Drupal::messenger()->all();\n $message = reset($messages);\n $this->assertCount(4, $message);\n $this->assertEquals('Test entity 2 (field_state) - Canceled at group pre-transition (workflow: default, transition: cancel).', (string) $message[0]);\n $this->assertEquals('Test entity 2 (field_state) - Canceled at generic pre-transition (workflow: default, transition: cancel).', (string) $message[1]);\n $this->assertEquals('Test entity 2 (field_state) - Canceled at group post-transition (workflow: default, transition: cancel).', (string) $message[2]);\n $this->assertEquals('Test entity 2 (field_state) - Canceled at generic post-transition (workflow: default, transition: cancel).', (string) $message[3]);\n }", "protected function searchTriggers($trigger)\n {\n synapse()->triggers->each(function ($class) use ($trigger) {\n $triggerClass = \"\\\\Axiom\\\\Rivescript\\\\Cortex\\\\Triggers\\\\$class\";\n $triggerClass = new $triggerClass();\n\n $found = $triggerClass->parse($trigger, $this->input);\n\n if ($found === true) {\n $this->getResponse($trigger);\n\n return false;\n }\n });\n }", "public function run()\n {\n $workflowactions = [\n [ // 1\n 'titre' => \"Date Dépôt\",\n 'description' => \"Date Dépôt Agence\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 1, // Date Dépôt Agence\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de renseigner la Date Dépôt\",\n ],\n [ // 2\n 'titre' => \"Montant Déposé\",\n 'description' => \"Montant Déposé (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 2, // Montant Déposé (Agence)\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de renseigner le Montant Déposé\",\n ],\n [ // 3\n 'titre' => \"Scan Bordereau\",\n 'description' => \"Scan Bordereau (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 3, // Scan Bordereau\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de joindre le Scan du Bordereau\",\n ],\n [ // 4\n 'titre' => \"Commentaire\",\n 'description' => \"Commentaire (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 4, // Commentaire Agence\n 'field_required' => 0,\n ],\n [ // 5\n 'titre' => \"Date Valeur\",\n 'description' => \"Date Valeur (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 5, // Date Valeur\n 'field_required_without' => 1, // Requis (sans) quand le rejet n'est pas activé\n 'field_required_without_msg' => \"Prière de renseigner la Date Valeur\",\n ],\n [ // 6\n 'titre' => \"Montant Validé\",\n 'description' => \"Montant Validé (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 6, // Montant Validé (Finances)\n 'field_required_without' => 1, // Requis (sans) quand le rejet n'est pas activé\n 'field_required_without_msg' => \"Prière de renseigner le Montant Validé\",\n ],\n [ // 7\n 'titre' => \"Rejeter\",\n 'description' => \"Rejet (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 8, // Rejet (Finances)\n 'field_required' => 0,\n ],\n [ // 8\n 'titre' => \"Motif Rejet\",\n 'description' => \"Motif Rejet (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 9, // Motif Rejet (Finances)\n 'field_required_with' => 1, // Requis (avec) quand le rejet est activé\n 'field_required_with_msg' => \"Le Motif est nécéssaire pour valider le Réjet\",\n ],\n [ // 9\n 'titre' => \"Commentaire\",\n 'description' => \"Commentaire (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 7, // Commentaire (Finances)\n 'field_required' => 0,\n ],\n ];\n foreach ($workflowactions as $workflowaction) {\n WorkflowAction::create($workflowaction);\n }\n // create fields required without list\n DB::table('fields_required_without')->insert([\n [ 'workflow_action_id' => 5, 'workflow_object_field_id' => 8,],\n [ 'workflow_action_id' => 6, 'workflow_object_field_id' => 8,],\n ]);\n // create fields required with list\n DB::table('fields_required_with')->insert([\n 'workflow_action_id' => 8,'workflow_object_field_id' => 8,\n ]\n );\n }", "public function triggerChain(/* ... */)\n {\n if ($this->haltSequence()) {\n return false;\n }\n\n if (null !== $this->_parent) {\n\n // Ensure we are in an active state\n if (self::STATE_ACTIVE !== $this->getState()) {\n $this->setState(self::STATE_ACTIVE);\n }\n $this->_parent->trigger();\n return $this->_parent->getResults();\n }\n }", "function trigger($event, $data=null) {\n return Event::trigger($event, $data);\n }", "public function testActionUseCaseNotFound()\n {\n $workflow = factory(WorkflowEloquent::class)->create();\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'is preapprove person',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_BOOLEAN,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.is_pre_approved',\n 'value' => '1',\n ]);\n $leadTypeId = LeadTypeEloquent::where('label', 'own')->where('user_id', null)->first()->getKey();\n $rule2 = factory(RuleEloquent::class)->create([\n 'name' => 'lead type own',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.lead_type_id',\n 'value' => $leadTypeId,\n ]);\n $rule3 = factory(RuleEloquent::class)->create([\n 'name' => 'imposible rule',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'persons.id',\n 'value' => 0,\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_UPDATE,\n 'target_class' => 'persons',\n 'target_field' => 'is_primary',\n 'value' => 1,\n ]);\n $workflow->actions()->sync([$action1->getKey()]);\n\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n\n $this->assertEquals($status, 0);\n $this->assertEquals(1, preg_match('/^Complete fire actions/m', $output->fetch()));\n // check logs\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_FAILED,\n 'object_class' => null,\n 'object_id' => null,\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule1->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule2->getKey()\n ]);\n $this->seeInDatabase('action_log_rules',[\n 'rule_id' => $rule3->getKey()\n ]);\n }", "public function getWorkflow();", "protected function scheduleTriggers()\n {\n $this->log(\"Scheduling DateTime Triggers...\");\n\n /** @var Trigger[] $triggers */\n $triggers = Trigger::find()->where([\n 'active' => true,\n 'type' => [\n Trigger::TYPE_BY_DATE,\n Trigger::TYPE_BY_TIME,\n ],\n ])->all();\n\n foreach ($triggers as $trigger) {\n if ($trigger->type === Trigger::TYPE_BY_DATE) {\n // Check if it was already scheduled\n if (isset($this->triggerTimers[$trigger->id])) {\n $this->log(\"Date Trigger [{$trigger->id}] was already been scheduled\");\n continue;\n }\n\n // Check if it's time is future\n if ($trigger->date and $trigger->date > time()) {\n $timeout = $trigger->date - time();\n\n $this->log(\"Scheduling Date Trigger [{$trigger->id}] with timeout $timeout sec.\");\n\n $this->triggerTimers[$trigger->id] = $this->loop->addTimer(\n $timeout,\n function () use ($trigger) {\n $this->log(\"Trigger [{$trigger->id}] triggered by date\");\n\n if (isset($this->triggerTimers[$trigger->id])) {\n unset($this->triggerTimers[$trigger->id]);\n }\n\n $this->triggerDate($trigger);\n });\n\n continue;\n }\n\n $this->log(\"Date Trigger [{$trigger->id}] has past date. Disabling it...\");\n\n $trigger->active = false;\n $trigger->save(false);\n\n continue;\n } elseif ($trigger->type === Trigger::TYPE_BY_TIME) {\n // Check if it also triggers by weekdays\n if ($trigger->weekdays) {\n $this->log(\"Time Trigger [{$trigger->id}] runs every week\");\n\n $days = explode(',', $trigger->weekdays);\n\n foreach ($days as $day) {\n $trigTimestamp = strtotime($day . ', ' . $trigger->time);\n\n if (strtolower(date('l')) == $day) {\n $trigTimestamp = strtotime('+1 week, ' . $trigger->time);\n }\n\n if (isset($this->triggerTimers[$trigger->id][$trigTimestamp])) {\n $this->log(\"Time Trigger [{$trigger->id}] already scheduled by time [$trigTimestamp]\");\n continue;\n }\n\n if (time() < $trigTimestamp) {\n $timeout = $trigTimestamp - time();\n\n $this->log(\"Scheduling Time Trigger [{$trigger->id}] with timeout $timeout sec. for timeout [$trigTimestamp]\");\n\n $this->triggerTimers[$trigger->id][$trigTimestamp] = $this->loop->addTimer(\n $timeout,\n function () use ($trigger, $trigTimestamp) {\n $this->log(\"Trigger [{$trigger->id}] triggered by time [$trigTimestamp]\");\n\n if (isset($this->triggerTimers[$trigger->id][$trigTimestamp])) {\n unset($this->triggerTimers[$trigger->id][$trigTimestamp]);\n }\n\n return $this->triggerTime($trigger);\n }\n );\n } else {\n $this->log(\"Trigger time $trigTimestamp is lower than current time \" . time());\n }\n }\n } else { // Everyday triggers\n $this->log(\"Time Trigger [{$trigger->id}] runs every day\");\n\n if (isset($this->triggerTimers[$trigger->id])) {\n $this->log(\"Time Trigger [{$trigger->id}] already scheduled by time\");\n continue;\n }\n\n // Schedule trigger for today\n $trigTimestamp = strtotime('today, ' . $trigger->time);\n\n if (time() < $trigTimestamp) {\n $timeout = $trigTimestamp - time();\n\n $this->log(\"Scheduling Time Trigger [{$trigger->id}] with timeout $timeout sec.\");\n\n $this->triggerTimers[$trigger->id] = $this->loop->addTimer(\n $timeout,\n function () use ($trigger) {\n $this->log(\"Time Trigger [{$trigger->id}] triggered by time\");\n\n if (isset($this->triggerTimers[$trigger->id])) {\n unset($this->triggerTimers[$trigger->id]);\n }\n\n return $this->triggerTime($trigger);\n }\n );\n } else {\n $trigTimestamp = strtotime('tomorrow, ' . $trigger->time);\n\n $timeout = $trigTimestamp - time();\n\n $this->log(\"Time Trigger [{$trigger->id}] expired by time. Scheduling for the next day ($timeout sec.)...\");\n\n $this->triggerTimers[$trigger->id] = $this->loop->addTimer(\n $timeout,\n function () use ($trigger) {\n $this->log(\"Time Trigger [{$trigger->id}] triggered by time\");\n\n if (isset($this->triggerTimers[$trigger->id])) {\n unset($this->triggerTimers[$trigger->id]);\n }\n\n return $this->triggerTime($trigger);\n }\n );\n }\n }\n }\n }\n\n $this->log(\"Done. Total count of timers: \" . count($this->triggerTimers));\n }", "public function _exec_trigger($params = [])\n {\n }", "public function checkForFollowUpOpened()\n {\n $now = Carbon::now();\n $logs = $this->getOpenedMessagesToFollow();\n foreach($logs as $log) {\n if ($now->gte($log->created_at->copy()->modify($this->getDelayInterval()))) {\n MailLog::info(sprintf('Trigger sending follow-up opened email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }\n }", "public function fireFieldTypeEvents($trigger);", "function getTriggersForTransition($oTransition) {\n $oKTWorkflowTriggerRegistry =& KTWorkflowTriggerRegistry::getSingleton();\n $aTriggers = array();\n $aTriggerInstances = KTWorkflowTriggerInstance::getByTransition($oTransition);\n foreach ($aTriggerInstances as $oTriggerInstance) {\n $oTrigger = $oKTWorkflowTriggerRegistry->getWorkflowTrigger($oTriggerInstance->getNamespace());\n if (PEAR::isError($oTrigger)) {\n return $oTrigger;\n }\n $oTrigger->loadConfig($oTriggerInstance);\n $aTriggers[] = $oTrigger;\n }\n return $aTriggers;\n }", "public function OnAllAction() {\n\n // get current action\n $HookName= current_filter();\n $HookNameParts= explode(' (', $HookName);\n $SearchName= isset($HookNameParts[1]) ? $HookNameParts[0] : $HookName;\n\n // find profiles containing that action and execute invalidation\n foreach($this->Profiles as $Name => $Profile) {\n if (in_array($SearchName, $Profile['InvalidatingActions'])) {\n $this->GetDealer($Name)->Invalidate($HookName);\n }\n }\n\n // search in group actions and trigger custom action if found\n foreach($this->GroupActions as $Name => $List) {\n if (in_array($HookName, $List)) {\n //$this->Log(\"[GroupAction: {$Name}] triggered by action: {$HookName}\");\n do_action(\"$Name ($HookName)\");\n }\n }\n }", "public function getWorkflows(): array\n {\n if (!isset($this->workflow)) {\n $this->workflows = $this->discoverWorkflows();\n }\n\n return $this->workflows;\n }", "public function isAnyEventInNeedOfExecution()\n\t\t{\n\n\t\t\t$eventsToBeExecuted = array();\n\n\t\t\t$current_his = date('H:i:s', time());\n\t\t\t$current_his_parts = explode(\":\", $current_his);\n\t\t\t$current_his = $current_his_parts[0].\":\".$current_his_parts[1].\":00\";\n\n\t\t\t// Loop through all saved events\n\t\t\tforeach($this->store as $k => $event) {\n\t\t\t\t// Date and time calculations\n\t\t\t\t$datetime_execution = $event['event_plannedExecution_time'];\n\t\t\t\t$event['time_his'] = date(\"H:i:s\", strtotime($datetime_execution));\n\t\t\t\t$event['time_dbdate'] = DBDatetoDate($event['event_plannedExecution_date']);\n\t\t\t\t$event['time_cdate'] = date(\"d.m.Y\");\n\n\t\t\t\t// If the event has not been executed yet and date AND time are equal to the current one\n\t\t\t\tif(\n\t\t\t\t\t!isSizedString($event['event_executedAt']) &&\n\t\t\t\t\t$event['time_dbdate'] === $event['time_cdate'] &&\n\t\t\t\t\t$event['time_his'] === $current_his\n\t\t\t\t)\n\t\t\t\t\tarray_push($eventsToBeExecuted, $event);\n\n\t\t\t\t// If the event has already been executed, the date is wrong, but the time is right and loop is enabled\n\t\t\t\tif(\n\t\t\t\t\tisSizedString($event['event_executedAt']) &&\n\t\t\t\t\t$event['time_dbdate'] !== $event['time_cdate'] &&\n\t\t\t\t\t$event['time_his'] === $current_his &&\n\t\t\t\t\t(bool)$event['event_loop'] === true\n\t\t\t\t)\n\t\t\t\t\tarray_push($eventsToBeExecuted, $event);\n\t\t\t}\n\n\t\t\treturn $eventsToBeExecuted;\n\n\t\t}", "public function trigger($hook) {\n }", "public function setTriggeringEvents($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->triggering_events = $arr;\n\n return $this;\n }", "function ef_notifications_notification_submit($form, &$form_state) {\n if (isset($form_state['values']['ef_notifications'])) {\n ($form['options']['#access'] ? $wrapper_id = 'options' : $wrapper_id = 'revision_information');\n foreach ($form_state['values']['ef_notifications'] as $rid => $role_emails) {\n foreach ($role_emails as $email) {\n $email_transition = $form[$wrapper_id]['workflow_email'][$rid]['#hidden'];\n ef_notifications_mail_send($email, $email_transition, $form_state['node']); //\n }\n }\n }\n}", "public static function beforeEnterWorkflow($workflowId = self::ANY_WORKFLOW)\n\t{\n\t\tself::_checkNonEmptyString('workflowId', $workflowId);\n\t\treturn 'beforeEnterWorkflow{'.$workflowId.'}';\n\t}", "public function searchApprovals()\n\t{\n\t\t$criteria = new CDbCriteria;\n \n \n /**\n * Example of searchApproval query\n * \n * select * from cs_user as u\n * LEFT JOIN cs_work_flow_log as wflog\n * ON u.id = wflog.data_id\n * WHERE\n * u.status=2 OR (u.status = 3 AND wflog.to_user_id = 8 AND wflog.data_type = 'YumUser' AND wflog.action = 2 AND wflog.status = 0)\n */\n Yii::import('application.modules.workflow.models.*');\n \n $criteria->select = 't.*, wflog.*';\n $criteria->join = \"LEFT JOIN cs_work_flow_log as wflog ON t.id = wflog.data_id\";\n $criteria->condition = '(t.status =:pending OR (t.status = :forwarded AND (wflog.to_user_id = :staff_id OR wflog.user_id = :staff_id) AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status))';\n \n $criteria->params = array(\n ':pending'=> YumUser::STATUS_APPROVAL_PENDING,\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n \n if($this->_flow != null || $this->_flow != \"\"){\n var_dump($this->_flow);\n if($this->_flow == WorkFlow::REQUEST_NEW){\n $criteria->condition = 't.status =:pending';\n $criteria->params = array(\n ':pending'=> YumUser::STATUS_APPROVAL_PENDING,\n );\n }\n elseif($this->_flow == WorkFlow::REQUEST_FORWARDED){\n $criteria->condition = '(t.status = :forwarded AND wflog.user_id = :staff_id AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status)';\n \n $criteria->params = array(\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n }\n elseif($this->_flow == WorkFlow::REQUEST_RECEIVED){\n $criteria->condition = '(t.status = :forwarded AND wflog.to_user_id = :staff_id AND wflog.data_type = :user_class AND wflog.action = :action AND wflog.status= :wf_status)';\n \n $criteria->params = array(\n ':forwarded'=> YumUser::STATUS_FORWARDED,\n ':staff_id'=>Yii::app()->user->id,\n ':user_class'=> get_class($this),\n ':action'=> WorkFlow::ACTION_FORWARD,\n ':wf_status'=> WorkFlow::STATUS_NEW,\n );\n }\n }\n \n //$criteria->compare('t.status', YumUser::STATUS_APPROVAL_PENDING, false, 'AND');\n\t\t\n $criteria->together = false;\n\t\t$criteria->compare('t.id', $this->id, true);\n\t\t$criteria->compare('t.username', $this->username, true);\n \n $criteria->compare('t.user_type', $this->user_type);\n \n\t\t$criteria->compare('t.createtime', $this->createtime, true);\n\t\t\n\t\treturn new CActiveDataProvider(get_class($this), array(\n 'criteria' => $criteria,\n 'pagination' => array('pageSize' => Yum::module()->pageSize), \n ));\n\t}", "public function checkForFollowUpNotOpened()\n {\n $now = Carbon::now();\n $logs = $this->getNotOpenedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not opened email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }", "public function test_enqueue_multi_hooks() {\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://mock.tld',\n\t\t\t'topic' => 'enrollment.created',\n\t\t) );\n\n\t\t$this->assertFalse( has_action( 'llms_user_course_enrollment_created', array( $webhook, 'process_hook' ) ) );\n\t\t$this->assertFalse( has_action( 'llms_user_membership_enrollment_created', array( $webhook, 'process_hook' ) ) );\n\t\t$webhook->enqueue();\n\t\t$this->assertEquals( 10, has_action( 'llms_user_course_enrollment_created', array( $webhook, 'process_hook' ) ) );\n\t\t$this->assertEquals( 10, has_action( 'llms_user_membership_enrollment_created', array( $webhook, 'process_hook' ) ) );\n\n\t}", "function trigger_elgg_event($event, $object_type, $object = null) {\n\t$return = true;\n\t$return1 = events($event, $object_type, \"\", null, true, $object);\n\tif (!is_null($return1)) {\n\t\t$return = $return1;\n\t}\n\treturn $return;\n}", "public function findWorkflowTasks($workflowId);", "abstract protected function whenAll(DomainEvents $events);", "function cb_add_email_triggers( $wc_emails ) {\n\t$emails = $wc_emails->get_emails();\n\n\t/**\n\t * A list of WooCommerce emails sent when the order status transitions to Processing.\n\t *\n\t * Developers can use the `cb_processing_order_emails` filter to add in their own emails.\n\t *\n\t * @param array $emails List of email class names.\n\t *\n\t * @return array\n\t * \n\t * @since today\n\t */\n\t$processing_order_emails = apply_filters( 'cb_processing_order_emails', [\n\t\t'WC_Email_New_Order',\n\t\t'WC_Email_Customer_Processing_Order',\n\t] );\n\n\tforeach ( $processing_order_emails as $email_class ) {\n\t\tif ( isset( $emails[ $email_class ] ) ) {\n\t\t\t$email = $emails[ $email_class ];\n\n\t\t\tadd_action(\n\t\t\t\t'woocommerce_order_status_blockchainpending_to_processing_notification',\n\t\t\t\tarray( $email, 'trigger' )\n\t\t\t);\n\t\t}\n\t}\n}", "public function main(&$dbh)\r\n\t{\r\n\t\t$this->numProcessed = 0; // reset counter\r\n\r\n\t\t// Do not close database handle if we are functioning in test mode\r\n\t\tif ($this->testMode)\r\n\t\t\t$this->closeDbh = false;\r\n\r\n\t\t$result = $dbh->Query(\"select id, action_id, instance_id from workflow_action_schedule where ts_execute <= now() and inprogress='0'\");\r\n\t\t$num = $dbh->GetNumberRows($result);\r\n\t\tfor ($i = 0; $i < $num; $i++)\r\n\t\t{\r\n\t\t\t$row = $dbh->GetNextRow($result, $i);\r\n\r\n\t\t\tif (!WorkFlow::instanceActInProgress($dbh, $row['id']))\r\n\t\t\t{\r\n\t\t\t\t$obj = WorkFlow::getInstanceObj($dbh, $row['instance_id']);\r\n\t\t\t\tif ($obj->getValue(\"f_deleted\") != 't')\r\n\t\t\t\t{\r\n\t\t\t\t\t$act = new WorkFlow_Action($dbh, $row['action_id']);\r\n\t\t\t\t\t$wf = new WorkFlow($dbh, $act->workflow_id);\r\n\t\t\t\t\t$act->execute($obj);\r\n\t\t\t\t\t$this->numProcessed++;\r\n\t\t\t\t\tif ($this->testMode)\r\n\t\t\t\t\t\t$this->actionsProcessed[] = $row['action_id'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Clear scheduled action\r\n\t\t\t\t$dbh->Query(\"delete from workflow_action_schedule where id='\".$row['id'].\"'\");\r\n\r\n\t\t\t\t// Set the status of this instance to finished if all actions are done\r\n\t\t\t\t$wf->updateStatus($row['instance_id']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dbh->FreeResults($result);\r\n\r\n\t\t$this->runDailyWorkflows($dbh);\r\n\r\n\t\treturn true;\r\n\t}", "public function triggerStaticEvent($eventname)\n {\n $args = array_slice(func_get_args(), 1);\n\n $triggers = $this->context->plugins->getEventTriggers($eventname);\n $ret = true;\n foreach ($triggers as $plugin) {\n $r = call_user_func_array(callback($plugin, $eventname), $args);\n if ($r === false) {\n $ret = false;\n }\n }\n return $ret;\n }", "private function addEventToLatestContextIdEvents($event)\n\t{\n\t\t$eventType = $event['eventType'];\n\t\t$eventAttributes = $event[$this->getEventAttributesKey($eventType)];\n\t\t\n\t\tif (isset($eventAttributes['activityId'])) {\n\t\t\t//this only catches ActivityTaskScheduled\n\t\t\t$this->addEventToLatestActivityIdEvents(\n\t\t\t\t$event, $eventAttributes['activityId']);\n\t\t}\n\t\t\n\t\t//for other events, we need to find the scheduled event\n\t\tif (isset($eventAttributes['scheduledEventId'])) {\n\t\t\t$scheduledEventId = $eventAttributes['scheduledEventId'];\n\t\t\tif ('ActivityTaskScheduled'\n\t\t\t\t== $this->eventTypeReferenceForScheduledEventId($eventType)\n\t\t\t) {\n\t\t\t\tforeach ($this->latestActivityIdEvents as\n\t\t\t\t\t$activityId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the scheduled eventId\n\t\t\t\t\t//if we find it, we know we have the right activityId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $scheduledEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestActivityIdEvents(\n\t\t\t\t\t\t\t\t$event, $activityId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($eventAttributes['timerId'])) {\n\t\t\t//this only catches TimerStarted\n\t\t\t$this->addEventToLatestTimerIdEvents(\n\t\t\t\t$event, $eventAttributes['timerId']);\n\t\t}\n\t\t\n\t\t//for events that reference TimerStarted, we need to find the event\n\t\tif (isset($eventAttributes['startedEventId'])) {\n\t\t\t$startedEventId = $eventAttributes['startedEventId'];\n\t\t\tif ('TimerStarted'\n\t\t\t\t== $this->eventTypeReferenceForStartedEventId($eventType)\n\t\t\t) {\n\t\t\t\tforeach ($this->latestTimerIdEvents as\n\t\t\t\t\t$timerId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the started eventId\n\t\t\t\t\t//if we find it, we know we have the right timerId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $startedEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestTimerIdEvents(\n\t\t\t\t\t\t\t\t$event, $timerId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (isset($eventAttributes['workflowId'])) {\n\t\t\t//this only catches StartChildWorkflowExecutionInitiated\n\t\t\t$this->addEventToLatestWorkflowIdEvents($event,\n\t\t\t\t$eventAttributes['workflowId']);\n\t\t\t\n\t\t\tif (isset($eventAttributes['signalName'])) {\n\t\t\t\t$this->addEventToLatestWorkflowIdAndSignalNameEvents(\n\t\t\t\t\t$event,\n\t\t\t\t\t$eventAttributes['workflowId'],\n\t\t\t\t\t$eventAttributes['signalName']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (isset($eventAttributes['initiatedEventId'])) {\n\t\t\t$initiatedEventId = $eventAttributes['initiatedEventId'];\n\t\t\t$referencedEventType\n\t\t\t\t= $this->eventTypeReferenceForInitiatedEventId($eventType);\n\t\t\tif ('StartChildWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t\t|| 'RequestCancelExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t\t|| 'SignalExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t) {\n\t\t\t\tforeach ($this->latestWorkflowIdEvents as\n\t\t\t\t\t$workflowId => $reference\n\t\t\t\t) {\n\t\t\t\t\t//find the eventId that matches the initiated eventId\n\t\t\t\t\t//if we find it, we know we have the right workflowId\n\t\t\t\t\tforeach ($reference as $eventId) {\n\t\t\t\t\t\tif ($eventId == $initiatedEventId) {\n\t\t\t\t\t\t\t$this->addEventToLatestWorkflowIdEvents(\n\t\t\t\t\t\t\t\t$event, $workflowId);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//signal names\n\t\t\tif ('SignalExternalWorkflowExecutionInitiated'\n\t\t\t\t== $referencedEventType\n\t\t\t) {\n\t\t\t\tforeach ($this->latestWorkflowIdAndSignalNameEvents as\n\t\t\t\t\t$workflowId => $signalNameEvents\n\t\t\t\t) {\n\t\t\t\t\tforeach ($signalNameEvents\n\t\t\t\t\t\tas $signalName => $eventReference\n\t\t\t\t\t) {\n\t\t\t\t\t\tforeach ($eventReference as $eventId) {\n\t\t\t\t\t\t\tif ($eventId == $initiatedEventId) {\n\t\t\t\t\t\t\t\t$this->addEventToLatestWorkflowIdAndSignalNameEvents(\n\t\t\t\t\t\t\t\t\t$event,$workflowId,$signalName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function islandora_workflow_track_collection_in_workflow($object_pid) {\n module_load_include('inc', 'islandora_workflow');\n\n return (islandora_workflow_set_object_relationship($object_pid, 'is_tracked_by_workflow', 'TRUE'));\n}", "function get_workflow() {\n\t\treturn ES_Workflow_Factory::get( $this->get_workflow_id() );\n\t}", "public function testExecute()\n {\n // Get the ServiceManager\n $serviceManager = $this->account->getServiceManager();\n\n // Create and save the workflow\n $workFlowData = array(\n \"name\" => \"Test Get Execute Wait Action\",\n \"obj_type\" => \"task\",\n \"active\" => true,\n );\n $workFlow = new WorkFlow($this->actionFactory);\n $workFlow->fromArray($workFlowData);\n\n // Create wait condition action and set params for 1 week wait\n $action = $this->getAction();\n $action->fromArray(array(\"name\"=>\"testExecuteWaitAction\"));\n $action->setParam(\"when_unit\", WorkFlow::TIME_UNIT_WEEK);\n $action->setParam(\"when_interval\", 1);\n\n // Add to WorkFlow for saving\n $workFlow->addAction($action);\n\n // Save the WorkFlow and action\n $this->workFlowDataMapper->save($workFlow);\n\n // Save an entity to run workflow instance on\n $entityLoader = $serviceManager->get(\"EntityLoader\");\n $task = $entityLoader->create(\"task\");\n $task->setValue(\"name\", \"test\");\n $entityLoader->save($task);\n $this->testEntities[] = $task;\n\n // Start a new instance from the workflow and task\n $workFlowInstance = new WorkFlowInstance($workFlow->getId(), $task);\n $instanceId = $this->workFlowDataMapper->saveWorkFlowInstance($workFlowInstance);\n\n // Execute the action and make sure it returns false because it was scheduled for the future\n $this->assertFalse($action->execute($workFlowInstance));\n\n // Make sure the action has been scheduled correctly\n $executeDate = $this->workFlowDataMapper->getScheduledActionTime($instanceId, $action->getId());\n $this->assertEquals(date(\"Y-m-d\", strtotime(\"+1 week\")), $executeDate->format(\"Y-m-d\"));\n\n // Run execute again (as if in a scheduled job) and it should return true\n $this->assertTrue($action->execute($workFlowInstance));\n\n // Make sure the scheduled action has been deleted\n $this->assertNull($this->workFlowDataMapper->getScheduledActionTime($instanceId, $action->getId()));\n }", "function training_rules_callback() {\n rules_invoke_event('training_event');\n $output = 'Do event!';\n\n return array(\n array(\n '#type' => 'markup',\n '#markup' => $output,\n ),\n );\n}", "public function trigger_e2e_run() {\n\t\t$api = GitHub::api(\n\t\t\t'/repos/' . WPORG_THEMES_E2E_REPO . '/dispatches',\n\t\t\tjson_encode([\n\t\t\t\t'event_type' => sprintf(\n\t\t\t\t\t\"%s %s %s\",\n\t\t\t\t\t$this->theme->display( 'Name' ),\n\t\t\t\t\t$this->theme->display( 'Version' ),\n\t\t\t\t\t$this->trac_ticket->priority\n\t\t\t\t),\n\t\t\t\t'client_payload' => [\n\t\t\t\t\t'theme_slug' => $this->theme_slug,\n\t\t\t\t\t'theme_zip' => \"https://wordpress.org/themes/download/{$this->theme_slug}.{$this->theme->display( 'Version' )}.zip?nostats=1\",\n\t\t\t\t\t'accessible_ready' => in_array( 'accessibility-ready', $this->theme->get( 'Tags' ) ),\n\t\t\t\t\t'trac_ticket_id' => $this->trac_ticket->id,\n\t\t\t\t\t'trac_priority' => $this->trac_ticket->priority,\n\t\t\t\t],\n\t\t\t])\n\t\t);\n\t\n\t\t// Upon failure a message is returned, success returns nothing.\n\t\treturn empty( $api );\n\t}", "public function accept_all()\n {\n $ids = $_POST['ids'];\n foreach ($ids as $id) {\n $accepted = EventMobile::find($id);\n $accepted->update(['event_status_id' => 2]);\n $accepted->save();\n //Notify Each event owner\n $event_owner = $accepted->user;\n if ($event_owner) {\n $notification_message['en'] = 'YOUR EVENT IS APPROVED';\n $notification_message['ar'] = 'تم الموافقة على الحدث';\n $notification = $this->NotifcationService->save_notification($notification_message, 3, 4, $accepted->id, $event_owner->id);\n $this->NotifcationService->PushToSingleUser($event_owner, $notification);\n }\n //get users have this event in their interests\n $this->NotifcationService->EventInterestsPush($accepted);\n }\n\n }", "public function invokeEvent(Event $event);", "function run_triggers() {\n// 2. run those triggers that are activated.\n// 3. update locked pins (locked by triggers)\n$trigger1_go = false;\n$trigger_laistisana_go = false;\n$trigger_internets_riits_vakars = false;\n$process_trigger_combined_laistisana = false;\n\n$static_db = open_static_data_db(true);\n$results = $static_db->query('SELECT id FROM `triggers` where state = 1;');\nwhile ($row = $results->fetchArray()) {\n\t\t$trigger_id = $row['id'];\n\t\tif ($trigger_id == 1) $trigger1_go = true;\n\t\tif ($trigger_id == 3) $trigger_laistisana_go = true;\n\t\tif ($trigger_id == 4) $trigger_internets_riits_vakars = true;\n\t\tif ($trigger_id == 5) $process_trigger_combined_laistisana = true;\n\t\t\t//print (\"process trigger $trigger_id\");\n}\n$static_db->close();\n\nif ($trigger1_go) process_trigger_1();\nif ($trigger_laistisana_go) process_trigger_laistisana();\nif ($trigger_internets_riits_vakars) trigger_internets_riits_vakars ();\nif ($process_trigger_combined_laistisana) process_trigger_combined_laistisana ();\n}", "public function enableCheckWorkflows(): self\n\t{\n\t\t$this->isCheckWorkflowsEnabled = true;\n\n\t\treturn $this;\n\t}", "public function getTriggeringEvents()\n {\n return $this->triggering_events;\n }", "public function checkForWeeklyRecurring()\n {\n if ($this->matchMonth() && $this->matchWeekOfMonth() && $this->matchDayOfWeek() && $this->matchTime() && !$this->hasTriggeredToday()) {\n MailLog::info(sprintf('Trigger sending automation `%s`, event type: %s, event ID: %s', $this->automation->name, $this->event_type, $this->id));\n // @todo: check time as well\n $this->fire();\n }\n }", "protected function runScheduledEvents()\r\n {\r\n foreach ($this->schedule->dueEvents($this->laravel) as $event) {\r\n $event = $this->convertEvent($event);\r\n\r\n if ($this->canAccessFiltersPass($event) && (! $event->filtersPass($this->laravel))) {\r\n continue;\r\n }\r\n\r\n if ($this->cache->has('eyewitness_scheduler_mutex_'.$event->mutexName())) {\r\n $this->line('<error>Skipping command due to Eyewitness pause:</error> '.$event->getSummaryForDisplay());\r\n continue;\r\n }\r\n\r\n $this->line('<info>Running scheduled command:</info> '.$event->getSummaryForDisplay());\r\n\r\n $event->run($this->laravel);\r\n\r\n $this->eventsRan = true;\r\n }\r\n }", "abstract public function getWorkflowDefinition();", "protected function startRecoveryWorkflows($entityID)\n\t{\n\t\t\\CCrmBizProcHelper::AutoStartWorkflows(\n\t\t\t$this->getEntityTypeID(),\n\t\t\t$entityID,\n\t\t\t\\CCrmBizProcEventType::Create,\n\t\t\t$errors\n\t\t);\n\t}", "function sync_event()\n\t{\n\t\t$eventintegratorfolder=\"core/integrate/event\";\n\t\t$tabeventintegrator=$this->loader->charg_dossier_unique_dans_tab($eventintegratorfolder);\n\t\t\n\t\tforeach($tabeventintegrator as $eventintegratorcour)\n\t\t{\n\t\t\t//get nomcodeevenr\n\t\t\t$nomcode=substr($eventintegratorcour,strlen($eventintegratorfolder.\"/eventintegrator.\"),(-(strlen(\".php\"))));\n\t\t\t$nomcodeclass=ucfirst($nomcode);\n\t\t\t\n\t\t\t//addtodb\n\t\t\tinclude_once $eventintegratorcour;\n\t\t\teval(\"\\$instanceEventIntegrator=new EventIntegrator\".$nomcodeclass.\"(\\$this->initer);\");\n\t\t\t$instanceEventIntegrator->setNomcodeevent($nomcode);\n\t\t\t$instanceEventIntegrator->addtodb();\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function doSomeAction(TestEvent $event) {\n drupal_set_message(\"The Example Event has been subscribed, which has bee dispatched on submit of the form with \" . $event->getReferenceID() . \" as Reference\");\n }", "public function onOrderTransition(WorkflowTransitionEvent $event) {\n /** @var \\Drupal\\Core\\Config\\ImmutableConfig Qb Enterprise $config */\n $config = \\Drupal::config('commerce_quickbooks_enterprise.QuickbooksAdmin');\n\n /** @var \\Drupal\\commerce_order\\Entity\\OrderInterface $order */\n $order = $event->getEntity();\n\n\n }", "function acf_is_doing($event = '', $context = '')\n{\n}", "public function matchesEvent($event);", "public function run()\n {\n $user = factory(\\App\\Models\\User::class)->create();\n $user->facebook_id = 10207483104971247;\n $user->save();\n\n $event = new \\App\\Models\\Event();\n $event->name = \"PAST EVENT\";\n $event->when = new DateTime(\"-2 months\");\n $event->lat = 0.00;\n $event->long = 0.00;\n $event->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"done task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = TRUE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"undone task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = FALSE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventInvitee = new \\App\\Models\\EventInvitee();\n $eventInvitee->event_id = $event->id;\n $eventInvitee->user_id = $user->facebook_id;\n $eventInvitee->save();\n\n $event = new \\App\\Models\\Event();\n $event->name = \"CURRENT EVENT\";\n $event->when = new DateTime(\"+2 months\");\n $event->lat = 0.00;\n $event->long = 0.00;\n $event->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"done task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = TRUE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"undone task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = FALSE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventInvitee = new \\App\\Models\\EventInvitee();\n $eventInvitee->event_id = $event->id;\n $eventInvitee->user_id = $user->facebook_id;\n $eventInvitee->save();\n\n }", "function entry_api_ui_event_form_submit($form, &$form_state) {\n\n if ($form_state['#update_event']) {\n $form_state['redirect'] = culturefeed_search_detail_url('event', $form_state['#event_id'], $form_state['values']['title']);\n drupal_set_message('De activiteit werd aangepast. Het duurt echter een half uur eer het\n op alle kanalen (inclusief UitinVlaanderen) beschikbaar zal zijn. ');\n }\n else {\n $link_change_event = '<a href=\"/entryapi/event/' . $form_state['#event_id'] . '/edit\">Klik hier om het event aan te passen</a>';\n drupal_set_message('De activiteit werd toegevoegd. Het duurt echter een half uur eer het\n op alle kanalen (inclusief UitinVlaanderen) beschikbaar zal zijn. ' . $link_change_event);\n }\n\n}", "public function get_workflow() {\n return $this->workflow;\n }", "public function getWorkflowObject();", "public function isRegisteredWorkflow($workflowId);", "public function eventsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $event = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if (isset($event['userData']) && $event['userData'] instanceof Users) {\n $this->di->setShared('userData', $event['userData']);\n }\n\n //lets fire the event\n $this->events->fire($event['event'], $event['source'], $event['data']);\n\n $this->log->info(\n \"Notification ({$event['event']}) - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::EVENTS, $callback);\n }", "public function actionRunAll()\n {\n $tasks = $this->getScheduler()->getTasks();\n\n echo 'Running Tasks:'.PHP_EOL;\n $event = new SchedulerEvent([\n 'tasks' => $tasks,\n 'success' => true,\n ]);\n $this->trigger(SchedulerEvent::EVENT_BEFORE_RUN, $event);\n foreach ($tasks as $task) {\n $this->runTask($task);\n if ($task->exception) {\n $event->success = false;\n $event->exceptions[] = $task->exception;\n }\n }\n $this->trigger(SchedulerEvent::EVENT_AFTER_RUN, $event);\n echo PHP_EOL;\n }", "public function trigger($event, $target = null, $params = [])\n {\n if (!($event instanceof EventInterface)) {\n if (is_string($event)) {\n $event = new Event($event, $target, $params);\n } else {\n throw new LogicException(\"\\$event must be a string, or implement \\\\Studiow\\\\Event\\\\EventInterface\");\n }\n }\n\n if ($this->hasQueue($event->getName())) {\n $this->getQueue($event->getName())->setContainer($this->getContainer());\n $this->getQueue($event->getName())->execute($event);\n }\n\n return $this;\n }", "function cron_job_for_closed_event_check() {\n $this->event_model->cron_job_for_closed_event_check();\n }", "function islandora_workflow_is_collection_workflow_tracked($object_pid) {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n\n $workflow_namespace = 'info:islandora/islandora-system:def/islandora_workflow#';\n\n $item = new Fedora_Item($object_pid);\n if (!$item->exists()) {\n return FALSE;\n }\n $workflow_relationships = $item->get_rdf_relationships($workflow_namespace);\n if (!empty($workflow_relationships) && !empty($workflow_relationships['is_tracked_by_workflow'])) {\n return (in_array('TRUE', $workflow_relationships['is_tracked_by_workflow']));\n }\n return FALSE;\n\n}", "public function test_enqueue_single_hook() {\n\n\t\t$webhook = LLMS_REST_API()->webhooks()->create( array(\n\t\t\t'delivery_url' => 'https://mock.tld',\n\t\t\t'topic' => 'course.created',\n\t\t) );\n\n\t\t$this->assertFalse( has_action( 'save_post_course', array( $webhook, 'process_hook' ) ) );\n\t\t$webhook->enqueue();\n\t\t$this->assertEquals( 10, has_action( 'save_post_course', array( $webhook, 'process_hook' ) ) );\n\n\t}", "public function getWorkflowSelect();", "function app_approved_hook($staffer_id, $first_name, $last_name, $fandom_name, $approver, $assigned_position) {\r\n\tglobal $slack_notification_domain, $slack_staff_hook_url;\r\n\t$url = $slack_staff_hook_url;\r\n\t$payload = '{\"text\": \"Application for <https://'.$slack_notification_domain.'/admin/review_staffer.php?id='.$staffer_id.'|'.$first_name.' '.$last_name.' ('.$fandom_name.')> ACCEPTED for '.$assigned_position.' by '.$approver.'\"}';\r\n\ttrigger_hook($url, $payload);\r\n}", "function block_eventsengine_handler($event) {\n global $DB;\n // Need an array to track events because another observed event could be triggered, ...\n // Indirectly by this event handler, delaying/unsequencing the event order.\n static $previousevents = [];\n $encodedevent = @json_encode($event->get_data());\n if (in_array($encodedevent, $previousevents)) {\n if (debugging('', DEBUG_DEVELOPER)) {\n block_eventsengine_log(\"block_eventsengine_handler({$event->eventname}):\".\n ' Aborting multiple trigger. (stored '.count($previousevents).')');\n }\n return true; // Prevent multiple plugins triggering same callback (this).\n }\n $previousevents[] = $encodedevent;\n $assigns = $DB->get_records('block_eventsengine_assign', ['event' => $event->eventname]);\n if (debugging('', DEBUG_DEVELOPER)) {\n ob_start();\n var_dump($previousevents);\n $tmp = ob_get_contents();\n ob_end_clean();\n block_eventsengine_log(\"block_eventsengine_handler({$event->eventname}): INFO: previousevents[] = {$tmp}\");\n }\n foreach ($assigns as $assign) {\n if ($assign->disabled) {\n continue;\n }\n $pluginengs = explode(':', $assign->engine, 2);\n $enginedisabled = $DB->get_field('block_eventsengine_events', 'disabled', ['engine' => $pluginengs[1],\n 'plugin' => $pluginengs[0]]);\n if (!empty($enginedisabled)) {\n continue;\n }\n $engine = block_eventsengine_get_engine_def($assign->engine, $event->eventname);\n if (empty($engine)) {\n continue;\n }\n $pluginacts = explode(':', $assign->action, 2);\n $actiondisabled = $DB->get_field('block_eventsengine_actions', 'disabled', ['action' => $pluginacts[1],\n 'plugin' => $pluginacts[0]]);\n if (!empty($actiondisabled)) {\n continue;\n }\n $actiondef = block_eventsengine_get_action_def($assign->action);\n if (empty($actiondef)) {\n continue;\n }\n try {\n $available = (empty($engine['available']) || $engine['available']()) && (empty($actiondef['available']) || $actiondef['available']());\n } catch (Exception $e) {\n $available = false;\n block_eventsengine_log(\"block_eventsengine_handler({$event->eventname}): assign id = {$assign->id}\".\n ' - Exception in available(): '.$e->getMessage());\n }\n if ($available) {\n try {\n $enginedata = !empty($assign->enginedata) ? (object)@unserialize($assign->enginedata) : null;\n if (($contextid = $engine['ready']($event, $enginedata))) {\n $actiondata = !empty($assign->actiondata) ? (object)@unserialize($assign->actiondata) : null;\n $actiondef['trigger']($contextid, $actiondata, $event);\n }\n } catch (Exception $e) {\n block_eventsengine_log(\"block_eventsengine_handler({$event->eventname}): assign id = {$assign->id} -\".\n ' Exception in engine::ready() or action::trigger(): '.$e->getMessage());\n }\n }\n }\n return true;\n}", "public function checkForFollowUp()\n {\n $now = Carbon::now();\n $preceding = $this->previousEvent;\n\n if (is_null($preceding)) {\n return;\n }\n\n // if already followed\n if ($preceding->triggersToFollowUp->isEmpty()) {\n return;\n }\n\n // One event may be triggered multiple times\n // For example: triggerd by birthday --> make sure to follow all these triggers\n foreach($preceding->triggersToFollowUp as $trigger) {\n if ($now->gte($trigger->start_at->copy()->modify($this->getDelayInterval()))) {\n // for follow-up type of auto-event, need to pass a preceding trigger\n // empty $trigger->subscriber indicates ALL\n MailLog::info(sprintf('Trigger sending follow-up email for automation %s, preceding event ID: %s, event ID: %s', $this->automation->name, $preceding->id, $this->id));\n if ($trigger->subscriber()->exists()) {\n // follow up individual subscriber\n $this->fire([$trigger->subscriber], $trigger);\n } else {\n // follow up the entire list (for the FollowUpSend event)\n $this->fire(null, $trigger);\n }\n }\n }\n }", "public function run()\n {\n $modalities = [\n 'Enduro',\n 'XCO',\n 'XC',\n 'Down Hill',\n 'Dirt',\n 'BMX',\n 'Bicicross',\n 'Contra Relógio',\n 'Speed',\n 'Infantil'\n ];\n\n\n foreach ($modalities as $modality) {\n EventModality::create(['name' => $modality]);\n }\n }" ]
[ "0.556452", "0.547991", "0.5455189", "0.5425043", "0.5303623", "0.5302955", "0.5236242", "0.51574934", "0.51452345", "0.51111066", "0.50872713", "0.5067242", "0.5061188", "0.5026808", "0.4988637", "0.49787617", "0.495421", "0.49462357", "0.49322578", "0.4872903", "0.4860662", "0.48574933", "0.48550028", "0.48308268", "0.48304114", "0.4821155", "0.48130125", "0.47810605", "0.47703028", "0.47612458", "0.47507104", "0.47459963", "0.47351277", "0.47253832", "0.4717152", "0.4693696", "0.4663698", "0.46598566", "0.4652211", "0.46198687", "0.46098733", "0.45976096", "0.45666876", "0.4530207", "0.4512972", "0.45122778", "0.45094532", "0.44955269", "0.44916123", "0.4488076", "0.44873315", "0.44841686", "0.44785637", "0.4463418", "0.4452856", "0.4451571", "0.4444883", "0.44427916", "0.4441645", "0.4431236", "0.44054735", "0.44039494", "0.43865454", "0.4373679", "0.43621752", "0.43612576", "0.43574795", "0.43522567", "0.43343738", "0.43341047", "0.43239322", "0.43232793", "0.43230408", "0.43178877", "0.43099952", "0.4306633", "0.4302369", "0.4300471", "0.42995647", "0.428981", "0.42700887", "0.42656735", "0.42505395", "0.4249811", "0.4240724", "0.42380136", "0.42345965", "0.4229611", "0.42290246", "0.42245364", "0.42231062", "0.42173028", "0.42125633", "0.42115638", "0.42080536", "0.4207601", "0.42041603", "0.42021635", "0.42017823", "0.42000058" ]
0.6256667
0
Creates a workflow process for the given workflow and workflow event
public function createWorkflowProcess(Workflow $workflow, AbstractWorkflowEvent $workflowEvent): WorkflowProcess { $isValid = $workflowEvent->hasValidTokens(); if (! $isValid) { throw WorkflowEventException::invalidWorkflowEventParameters(); } // Create the workflow run and identify it as having been created $workflowProcess = new WorkflowProcess(); $workflowProcess->workflow()->associate($workflow); $workflowProcess->workflowProcessStatus()->associate(WorkflowProcessStatusEnum::CREATED); $workflowProcess->save(); // Create the workflow run parameters foreach ($workflowEvent->getTokens() as $key => $value) { $this->createInputToken($workflowProcess, $key, $value); } // Alert the system of the creation of a workflow run being created WorkflowProcessCreated::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createWorkflow($datas);", "function execute($process, $event)\n {\n $returnStatus = eZWorkflowType::STATUS_ACCEPTED;\n\n $parameters = $process->attribute('parameter_list');\n $object = eZContentObject::fetch($parameters['object_id']);\n\n if (!$object) {\n eZDebugSetting::writeError('extension-workflow-changeobjectdate', 'The object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n }\n\n // if a newer object is the current version, abort this workflow.\n $currentVersion = $object->attribute('current_version');\n $version = $object->version($parameters['version']);\n\n if (!$version) {\n eZDebugSetting::writeError('The version of object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object version is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n\n }\n\n $objectAttributes = $version->attribute('contentobject_attributes');\n\n $changeDateObject = $this->workflowEventContent($event);\n\n $publishAttributeArray = (array)$changeDateObject->attribute('publish_attribute_array');\n $futureDateStateAssign = $changeDateObject->attribute('future_date_state');\n $pastDateStateAssign = $changeDateObject->attribute('past_date_state');\n\n $publishAttribute = false;\n\n foreach ($objectAttributes as $objectAttribute) {\n $contentClassAttributeID = $objectAttribute->attribute('contentclassattribute_id');\n if (in_array($contentClassAttributeID, $publishAttributeArray)) {\n $publishAttribute = $objectAttribute;\n }\n }\n\n if ($publishAttribute instanceof eZContentObjectAttribute && $publishAttribute->attribute('has_content')) {\n $date = $publishAttribute->attribute('content');\n if ($date instanceof eZDateTime || $date instanceof eZDate) {\n $object->setAttribute('published', $date->timeStamp());\n $object->store();\n if ($date->timeStamp() > time()){\n if ($futureDateStateAssign instanceof eZContentObjectState) {\n $object->assignState($futureDateStateAssign);\n }\n }elseif($pastDateStateAssign instanceof eZContentObjectState){\n $object->assignState($pastDateStateAssign);\n }\n if ($parameters['trigger_name'] != 'pre_publish') {\n eZContentOperationCollection::registerSearchObject($object->attribute('id'), $object->attribute('current_version'));\n }\n eZDebug::writeNotice('Workflow change object publish date', __METHOD__);\n }\n }\n\n return $returnStatus;\n }", "protected function createProcess(): Process\n {\n // Adding actors and assets is possible, but shouldn't be done. Should throw exception or caught by validation.\n // Note that actors and assets are associative entity sets. Items can be references via the key.\n\n return Process::fromData([\n 'id' => '00000000-0000-0000-0000-000000000000',\n 'actors' => [\n [\n 'key' => 'client',\n 'title' => 'Client',\n 'name' => null,\n ],\n [\n 'key' => 'manager',\n 'title' => 'Manager',\n 'name' => 'Jane Black',\n 'organization' => [\n 'name' => 'Acme Corp',\n ]\n ],\n ],\n 'assets' => [\n [\n 'key' => 'document',\n 'title' => 'Document',\n 'id' => '0001',\n 'content' => 'Foo bar'\n ],\n [\n 'key' => 'attachments',\n 'title' => 'attachments',\n 'urls' => []\n ],\n [\n 'key' => 'data',\n 'I' => 'uno',\n ],\n ],\n 'current' => ['key' => ':initial'],\n ]);\n }", "public function setWorkflow(Workflow $workflow);", "protected function createModel($attributes = []) {\n return (new StepEvent($attributes));\n }", "public function actionCreate() {\n\t\n\t\n\t\n\t\t$workflowModel = new Workflow;\n\t\t$workflowModel->lastUpdated = time();\n\n\t\t$stages = array();\n\t\t\n\t\tif(isset($_POST['Workflow'], $_POST['WorkflowStages'])) {\n\t\t\n\t\t\n\t\t\t$workflowModel->attributes = $_POST['Workflow'];\n\t\t\tif($workflowModel->save()) {\n\t\t\t\t$validStages = true;\n\t\t\t\tfor($i=0; $i<count($_POST['WorkflowStages']); $i++) {\n\t\t\t\t\t\n\t\t\t\t\t$stages[$i] = new WorkflowStage;\n\t\t\t\t\t$stages[$i]->workflowId = $workflowModel->id;\n\t\t\t\t\t$stages[$i]->attributes = $_POST['WorkflowStages'][$i+1];\n\t\t\t\t\t$stages[$i]->stageNumber = $i+1;\n\t\t\t\t\t$stages[$i]->roles = $_POST['WorkflowStages'][$i+1]['roles'];\n\t\t\t\t\tif(empty($stages[$i]->roles) || in_array('',$stages[$i]->roles))\n\t\t\t\t\t\t$stages[$i]->roles = array();\n\n\t\t\t\t\tif(!$stages[$i]->validate())\n\t\t\t\t\t\t$validStages = false;\n\t\t\t\t}\n\n\t\t\t\tif($validStages) {\n\n\t\t\t\t\tforeach($stages as &$stage) {\n\t\t\t\t\t\t$stage->save();\n\t\t\t\t\t\tforeach($stage->roles as $roleId)\n\t\t\t\t\t\t\tYii::app()->db->createCommand()->insert('x2_role_to_workflow',array(\n\t\t\t\t\t\t\t\t'stageId'=>$stage->id,\n\t\t\t\t\t\t\t\t'roleId'=>$roleId,\n\t\t\t\t\t\t\t\t'workflowId'=>$workflowModel->id,\n\t\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\tif($workflowModel->save())\n\t\t\t\t\t\t$this->redirect(array('view','id'=>$workflowModel->id));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$workflowModel,\n\t\t));\n\t}", "public function store(WorkflowRequest $request)\n {\n try {\n $attributes = $request->all();\n $attributes['user_id'] = user_id();\n $workflow = $this->repository->create($attributes);\n\n return redirect(trans_url('/user/workflow/workflow'))\n -> with('message', trans('messages.success.created', ['Module' => trans('workflow::workflow.name')]))\n -> with('code', 201);\n\n } catch (Exception $e) {\n redirect()->back()->withInput()->with('message', $e->getMessage())->with('code', 400);\n }\n }", "public function startProcess(Module $module, array $data): ProcessInstance\n {\n $processDefinition = ProcessDefinition::byKey($module->processDefinitionKey)->fetch();\n\n // Validasi Start Task Name di definisi modul dengan start task name hasil pembacaan BPMN.\n // TODO: proses ini deprecated, karena config start_task_name di modul sudah bisa dihilangkan\n // dengan asumsi start_task_name yang valid adalah sesuai BPMN. Tidak ada custom start_task_name.\n $module->startTaskName = $this->validateTaskName($module->startTaskName, $processDefinition);\n\n // Wrap $data hasil inputan user untuk dilakukan proses sanitize, cleansing, dan validating.\n $payload = Payload::make($module, $module->startTaskName, $data);\n\n $processInstance = DB::transaction(function () use ($processDefinition, $module, $data, $payload) {\n // Memulai proses, dengan membuat Process Instance baru di Camunda.\n $processInstance = $processDefinition->startInstance(\n $payload->toCamundaVariables(),\n $payload->getBusinessKey()\n );\n\n $additionalData = [\n 'process_instance_id' => $processInstance->id,\n ];\n\n $mainFormId = null;\n $mainFormName = null;\n\n // Data inputan sebuah task bisa disimpan ke satu atau lebih form (tabel).\n // Syaratnya, hanya ada satu MAIN_FORM, dan sisanya adalah SUB_FORM.\n // Flagnya ada di kolom camunda_form.type\n foreach ($payload->toFormFields() as $form => $fields) {\n $dbFields = $fields['fields'];\n\n if ($fields['type'] == FormType::MAIN_FORM) {\n $data = $dbFields + $additionalData;\n $formId = $this->insertData($form, $data);\n $mainFormId = $formId;\n $mainFormName = $form;\n } else {\n $subForm = [\n 'parent_id' => $mainFormId,\n 'parent_form' => $mainFormName,\n ];\n $data = $dbFields + $additionalData + $subForm;\n $formId = $this->insertData($form, $data);\n }\n\n DB::table('camunda_task')->insert([\n 'process_definition_key' => $processDefinition->key,\n 'process_instance_id' => $processInstance->id,\n 'task_id' => null,\n 'form_type' => $form,\n 'form_id' => $formId,\n 'task_name' => $module->startTaskName,\n 'created_at' => now(),\n 'status' => ProcessStatus::ACTIVE,\n 'business_key' => $payload->getBusinessKey(),\n 'traceable' => json_encode(collect($payload->data)->only(config('laravolt.workflow.traceable')) ?? []),\n ]);\n }\n\n $this->prepareNextTask($processInstance);\n\n return $processInstance;\n });\n\n event(new ProcessStarted($processInstance, $payload, auth()->user()));\n\n return $processInstance;\n }", "public function AddProcess()\n {\n $this->app->response->setStatus( 201 );\n $body = $this->app->request->getBody();\n $processes = Process::decodeProcess($body);\n\n // always been an array\n $arr = true;\n if ( !is_array( $processes ) ){\n $processes = array( $processes );\n $arr = false;\n }\n\n $res = array( );\n foreach ( $processes as $process ){\n // create process\n $method='POST';\n $URL='/process';\n if ($process->getProcessId() !== null){\n $method='PUT';\n $URL = '/process/process/'.$process->getProcessId();\n }\n\n $result = Request::routeRequest(\n $method,\n $URL,\n array(),\n Process::encodeProcess($process),\n $this->_processorDb,\n 'process'\n );\n//echo $this->_processorDb[0]->getAddress().$URL;\n//echo Process::encodeProcess($process);\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Process::decodeProcess($result['content']);\n if ($process->getProcessId() === null)\n $process->setProcessId($queryResult->getProcessId());\n $res[] = $process;\n }\n else{\n $res[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // create attachment\n $attachments = array_merge(array(), $process->getAttachment());\n $process->setAttachment(array());\n\n foreach ( $attachments as $attachment ){\n if ($attachment->getId() === null){\n $attachment->setExerciseId($process->getExercise()->getId());\n $attachment->setProcessId($process->getProcessId());\n \n // ein Anhang muss eine Datei besitzen\n if ($attachment->getFile() == null){\n continue;\n }\n \n // eine Datei benötigt einen gültigen Namen\n if ($attachment->getFile()->getDisplayName() == \"\"){\n continue;\n }\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($attachment->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n $queryResult = File::decodeFile($result['content']);\n $attachment->setFile($queryResult);\n }\n else{\n $attachment->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $attachment->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($attachment),\n $this->_attachment,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $attachment->setId($queryResult->getId());\n $process->getAttachment()[] = $attachment;\n }\n else{\n $process->getAttachment()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n // create workFiles\n $workFiles = $process->getWorkFiles();\n $process->setWorkFiles(array());\n foreach ( $workFiles as $workFile ){\n if ($workFile->getId() === null){\n $workFile->setExerciseId($process->getExercise()->getId());\n $workFile->setProcessId($process->getProcessId());\n\n // upload file\n $result = Request::routeRequest(\n 'POST',\n '/file',\n array(),\n File::encodeFile($workFile->getFile()),\n $this->_file,\n 'file'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = File::decodeFile($result['content']);\n $workFile->setFile($queryResult);\n }\n else{\n $workFile->setFile(null);\n $this->app->response->setStatus( 409 );\n continue;\n }\n\n // upload attachment\n $workFile->setProcessId($process->getProcessId());\n $result = Request::routeRequest(\n 'POST',\n '/attachment',\n array(),\n Attachment::encodeAttachment($workFile),\n $this->_workFiles,\n 'attachment'\n );\n\n if ( $result['status'] >= 200 &&\n $result['status'] <= 299 ){\n\n $queryResult = Attachment::decodeAttachment($result['content']);\n $workFile->setId($queryResult->getId());\n $process->getWorkFiles()[] = $workFile;\n }\n else{\n $process->getWorkFiles()[] = null;\n $this->app->response->setStatus( 409 );\n continue;\n }\n }\n }\n\n }\n\n if ( !$arr &&\n count( $res ) == 1 ){\n $this->app->response->setBody( Process::encodeProcess( $res[0] ) );\n\n } else\n $this->app->response->setBody( Process::encodeProcess( $res ) );\n }", "public function setWorkflowId($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_id = $var;\n\n return $this;\n }", "private function createWorkflowStream() {\n module_load_include('inc', 'fedora_repository', 'api/fedora_item');\n $fedora_item = new fedora_item($this->contentModelPid);\n $datastreams = $fedora_item->get_datastreams_list_as_array();\n if (isset($datastreams['WORKFLOW_TMPL'])) {\n $work_flow_template = $fedora_item->get_datastream_dissemination('WORKFLOW_TMPL');\n $work_flow_template_dom = DOMDocument::loadXML($work_flow_template);\n $work_flow_template_root = $work_flow_template_dom->getElementsByTagName('workflow');\n if ($work_flow_template_root->length > 0) {\n $work_flow_template_root = $work_flow_template_root->item(0);\n $node = $this->importNode($work_flow_template_root, TRUE);\n $datastream = $this->createDatastreamElement('WORKFLOW', 'A', 'X');\n $version = $this->createDatastreamVersionElement(\"{$this->dsid}.0\", \"{$this->dsid} Record\", 'text/xml');\n $content = $this->createDatastreamContentElement();\n $this->root->appendChild($datastream)->appendChild($version)->appendChild($content)->appendChild($node);\n }\n }\n }", "public function createProcessor(string $event, SagaListenerOptions $listenerOptions): EventProcessor;", "public function triggerEvent(AbstractWorkflowEvent $workflowEvent): Collection\n {\n // track the workflow runs that we are going to be dispatching\n $workflowProcessCollection = collect();\n\n /**\n * Find all workflows that are active and have a workflow event that matches the event that was triggered\n */\n Workflow::query()\n ->active()\n ->forEvent($workflowEvent)\n ->each(function (Workflow $workflow) use (&$workflowProcessCollection, $workflowEvent) {\n // Create the run\n $workflowProcess = $this->createWorkflowProcess($workflow, $workflowEvent);\n\n // Dispatch the run so that it can be processed\n $this->dispatchProcess($workflowProcess, $workflowEvent->getQueue());\n\n // Identify that the workflow run was spawned by the triggering of the event\n $workflowProcessCollection->push($workflowProcess);\n });\n\n // Return all the workflow runs that were spawned by the triggering of the event\n return $workflowProcessCollection;\n }", "public function create(WorkflowRequest $request)\n {\n\n $workflow = $this->repository->newInstance([]);\n\n Form::populate($workflow);\n\n return response()->view('workflow::admin.workflow.create', compact('workflow'));\n\n }", "public function create(WorkflowRequest $request)\n {\n\n $workflow = $this->repository->newInstance([]);\n Form::populate($workflow);\n\n $this->theme->prependTitle(trans('workflow::workflow.names'));\n return $this->theme->of('workflow::user.workflow.create', compact('workflow'))->render();\n }", "public function testCreateProcess () {\n $faker = \\Faker\\Factory::create();\n $process = [\n 'name' => $faker->name,\n 'description' => $faker->text,\n 'code' => $faker->text,\n 'status' => $faker->boolean\n ];\n $response = $this->json('POST', 'api/processes', $process);\n $response->assertStatus(201);\n $response->assertJsonFragment($process);\n }", "public function execute( $process, $event ) {\n if( eZSys::isShellExecution() ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $parameters = $process->attribute( 'parameter_list' );\n if( isset( $parameters['order_id'] ) === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n $order = eZOrder::fetch( $parameters['order_id'] );\n if( $order instanceof eZOrder === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $check = eZOrderItem::fetchListByType( $order->attribute( 'id' ), 'siteaccess' );\n if( count( $check ) > 0 && $order->attribute( 'is_temporary' ) && $process->ParameterList['trigger_name'] != 'post_checkout' ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n if( count( $check ) > 0 ) {\n foreach( $check as $item ) {\n $item->remove();\n }\n }\n\n $orderItem = new eZOrderItem(\n array(\n 'order_id' => $order->attribute( 'id' ),\n 'description' => $GLOBALS['eZCurrentAccess']['name'],\n 'price' => 0,\n 'type' => 'siteaccess',\n 'vat_is_included' => true,\n 'vat_type_id' => 1\n )\n );\n $orderItem->store();\n\n return eZWorkflowType::STATUS_ACCEPTED;\n }", "public function testWorkflowSeeder3()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-12-08',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $hotTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "function get_workflow() {\n\t\treturn ES_Workflow_Factory::get( $this->get_workflow_id() );\n\t}", "public function testWorkflowSeeder1()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-hot-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'hot')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1994-12-10',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function create(\tInstanceConfiguration $instanceConfiguration,\n\t\t\t\t\t\t\tAbstractWorkflowConfiguration $workflowConfiguration\n\t\t\t\t\t\t\t) {\n\n\t\tif (!class_exists($workflowConfiguration->getWorkflowClassName())) {\n\t\t\tthrow new UnknownWorkflowException('Workflow \"'.$workflowConfiguration->getWorkflowClassName().'\" not existend or not loaded',2212);\n\t\t}\n\t\t$this->initLoggerLogFile($instanceConfiguration);\n\t\t$workflowClass = $workflowConfiguration->getWorkflowClassName();\n\n\t\t$workflow = $this->getWorkflow($workflowClass, $instanceConfiguration, $workflowConfiguration);\n\t\t$workflow->injectDownloader(new \\EasyDeploy_Helper_Downloader());\n\n\t\treturn $workflow;\n\t}", "public function testWorkflowSeeder2()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','promote-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1992-01-14',\n ]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check tag\n $this->seeInDatabase('taggables',[\n 'user_id' => $user->getKey(),\n 'tag_id' => $tag->getKey(),\n 'taggable_id' => $person->getKey(),\n 'taggable_type' => 'persons',\n ]);\n\n //cleanup.\n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function workflow()\n {\n return $this->hasOne(Workflow::class);\n }", "public function createInputToken(WorkflowProcess $workflowProcess, string $key, mixed $value): WorkflowProcessToken\n {\n /** @var WorkflowProcessToken $workflowProcessToken */\n $workflowProcessToken = $workflowProcess->workflowProcessTokens()->create([\n 'workflow_activity_id' => null,\n 'key' => $key,\n 'value' => $value,\n ]);\n\n return $workflowProcessToken;\n }", "public function getWorkflowObject();", "function createPlace($workflowId, $placeDatas);", "public function testWorkflowSeeder4()\n {\n $user = UserEloquent::find(1);\n $workflow = WorkflowEloquent::where('user_id',$user->id)->where('name','task-for-cold-lead')\n ->whereNull('deleted_at')->get()->first();\n $actions = $workflow->getActions();\n $tag = TagEloquent::whereNull('deleted_at')->where('tag', 'cold')->first();\n $tasks = TaskEloquent::whereNull('deleted_at')->take(2)->get();\n $hotTaskId = $tasks[0]->id;\n $coldTaskId = $tasks[1]->id;\n\n // send text\n // send mail\n // tag person with hot tag\n\n // create person test\n $person = factory(PersonEloquent::class)->create([\n 'date_of_birth' => '1983-01-18',\n ]);\n $person->tags()->attach($tag->getKey(), ['user_id' => $user->getKey()]);\n $leadContext = factory(PersonContextEloquent::class)->create([\n 'user_id' => $user->getKey(),\n 'person_id' => $person->getKey(),\n 'stage_id' => $this->stageId,\n 'lead_type_id' => $this->leadTypeId,\n ]);\n $phone = factory(PersonPhoneEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'number' => '+6281460000109',\n 'is_primary' => 1,\n ]);\n $email = factory(PersonEmailEloquent::class)->create([\n 'person_id' => $person->getKey(),\n 'is_primary' => 1,\n ]);\n\n\n foreach ($actions as $action) {\n //var_dump($workflow->id,$action->id);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $person->getLoggableType(), \n 'object_id' => $person->getKey(), \n 'user_id' => $user->getKey(),\n ]);\n }\n\n // check task\n $this->seeInDatabase('tasks',[\n 'id' => $coldTaskId,\n 'user_id' => $user->getKey(),\n ]);\n \n $this->cleanUpRecords(new PersonObserver, $person);\n }", "public function store(StoreProcessRequest $request)\n {\n $process = Process::create([\n 'reference' => $request->reference,\n 'method_id' => $request->method,\n ]);\n $processVersion = $process->versions()->create([\n 'name' => $request->name,\n 'type' => $request->type,\n 'version' => $request->version,\n 'creation_date' => $request->creation_date,\n 'created_by' => $request->created_by,\n 'state' => $request->state,\n 'state' => $request->state,\n 'status' => $request->status,\n ]);\n if ($request->writing_date) {\n $processVersion->writing_date = $request->writing_date;\n $processVersion->written_by = $request->written_by;\n }\n\n if ($request->verification_date) {\n $processVersion->verification_date = $request->verification_date;\n $processVersion->verified_by = $request->verified_by;\n }\n\n if ($request->date_of_approval) {\n $processVersion->date_of_approval = $request->date_of_approval;\n $processVersion->approved_by = $request->approved_by;\n }\n\n if ($request->broadcasting_date) {\n $processVersion->broadcasting_date = $request->broadcasting_date;\n }\n\n if ($request->reasons_for_creation) {\n $processVersion->reasons_for_creation = $request->reasons_for_creation;\n }\n\n if ($request->reasons_for_modification) {\n $processVersion->reasons_for_modification = $request->reasons_for_modification;\n }\n\n if ($request->modifications) {\n $processVersion->modifications = $request->modifications;\n }\n\n if ($request->appendices) {\n $processVersion->appendices = $request->appendices;\n }\n\n $processVersion->save();\n $processVersion->entities()->attach($request->entities);\n\n return redirect()->route('admin.processes.index')->with('message', 'Procédure créée avec succès!');\n }", "function createTransition($workflowId, $transitionDatas);", "protected function createDefinition()\n {\n $definition = new WorkflowDefinition();\n $definition->Title = \"Dummy Workflow Definition\";\n $definition->write();\n\n $stepOne = new WorkflowAction();\n $stepOne->Title = \"Step One\";\n $stepOne->WorkflowDefID = $definition->ID;\n $stepOne->write();\n\n $stepTwo = new WorkflowAction();\n $stepTwo->Title = \"Step Two\";\n $stepTwo->WorkflowDefID = $definition->ID;\n $stepTwo->write();\n\n $transitionOne = new WorkflowTransition();\n $transitionOne->Title = 'Step One T1';\n $transitionOne->ActionID = $stepOne->ID;\n $transitionOne->NextActionID = $stepTwo->ID;\n $transitionOne->write();\n\n return $definition;\n }", "public function testIfProcessCreationWorks()\n {\n $process = $this->api->createProcess(array(\n 'inputformat' => 'pdf',\n 'outputformat' => 'pdf',\n ));\n $this->assertInstanceOf('CloudConvert\\Process', $process);\n }", "function events_action_create_event() {\r\n\tglobal $bp;\r\n\r\n\t/* If we're not at domain.org/events/create/ then return false */\r\n\tif ( $bp->current_component != $bp->jes_events->slug || 'create' != $bp->current_action )\r\n\t\treturn false;\r\n\r\n\tif ( !is_user_logged_in() )\r\n\t\treturn false;\r\n\r\n\t/* Make sure creation steps are in the right order */\r\n\tevents_action_sort_creation_steps();\r\n\r\n\t/* If no current step is set, reset everything so we can start a fresh event creation */\r\n\tif ( !$bp->jes_events->current_create_step = $bp->action_variables[1] ) {\r\n\r\n\t\tunset( $bp->jes_events->current_create_step );\r\n\t\tunset( $bp->jes_events->completed_create_steps );\r\n\r\n\t\tsetcookie( 'bp_new_event_id', false, time() - 1000, COOKIEPATH );\r\n\t\tsetcookie( 'bp_completed_create_steps', false, time() - 1000, COOKIEPATH );\r\n\r\n\t\t$reset_steps = true;\r\n\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . array_shift( array_keys( $bp->jes_events->event_creation_steps ) ) . '/' );\r\n\t}\r\n\r\n\t/* If this is a creation step that is not recognized, just redirect them back to the first screen */\r\n\tif ( $bp->action_variables[1] && !$bp->jes_events->event_creation_steps[$bp->action_variables[1]] ) {\r\n\t\tbp_core_add_message( __('There was an error saving event details. Please try again.', 'jet-event-system'), 'error' );\r\n\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/' );\r\n\t}\r\n\r\n\t/* Fetch the currently completed steps variable */\r\n\tif ( isset( $_COOKIE['bp_completed_create_steps'] ) && !$reset_steps )\r\n\t\t$bp->jes_events->completed_create_steps = unserialize( stripslashes( $_COOKIE['bp_completed_create_steps'] ) );\r\n\r\n\t/* Set the ID of the new event, if it has already been created in a previous step */\r\n\tif ( isset( $_COOKIE['bp_new_event_id'] ) ) {\r\n\t\t$bp->jes_events->new_event_id = $_COOKIE['bp_new_event_id'];\r\n\t\t$bp->jes_events->current_event = new JES_Events_Event( $bp->jes_events->new_event_id );\r\n\t}\r\n\r\n\t/* If the save, upload or skip button is hit, lets calculate what we need to save */\r\n\tif ( isset( $_POST['save'] ) ) {\r\n\r\n\t\t/* Check the nonce */\r\n\t\tcheck_admin_referer( 'events_create_save_' . $bp->jes_events->current_create_step );\r\n\r\n\t\tif ( 'event-details' == $bp->jes_events->current_create_step ) {\r\n\t\t\tif ( empty( $_POST['event-edted'] ) ) { $eventedted = $_POST['event-edtsd']; } else { $eventedted = $_POST['event-edted']; }\r\n\t\t\tif ( empty( $_POST['event-name'] ) || empty( $_POST['event-desc'] ) || !strlen( trim( $_POST['event-name'] ) ) || !strlen( trim( $_POST['event-desc'] || $_POST['event-edtsd'] ) ) ) {\r\n\t\t\t\tbp_core_add_message( __( 'Please fill in all of the required fields', 'jet-event-system' ), 'error' );\r\n\t\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $bp->jes_events->current_create_step . '/' );\r\n\t\t\t}\r\n// JLL_MOD - Modded all over - look care over entire file :(\r\nif ( empty ($_POST['event-edtsd'] ) || empty ($_POST['event-edtsth'] ) ) {\r\n\t\t\t\t\tbp_core_add_message( __( 'Please complete event Start date and time.', 'jet-event-system' ), 'error' );\r\n\t\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $bp->jes_events->current_create_step . '/' );\r\n\t\t\t\t\t\t} else if ( jes_datetounix($_POST['event-edtsd'],$_POST['event-edtsth'],$_POST['event-edtstm']) > jes_datetounix($eventedted,$_POST['event-edteth'],$_POST['event-edtetm'])) {\r\n\t\t\t\t\tbp_core_add_message( __( 'There was an error updating event details. Date and time of completion of the event can not exceed the date of its beginning, please try again.', 'jet-event-system' ), 'error' );\r\n\t\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $bp->jes_events->current_create_step . '/' );\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\tif ( !$bp->jes_events->new_event_id = events_create_event( array( 'event_id' => $bp->jes_events->new_event_id, 'name' => $_POST['event-name'], 'etype' => $_POST['event-etype'], 'eventapproved' => $_POST['event-eventapproved'], 'description' => $_POST['event-desc'], 'eventterms' => $_POST['event-eventterms'], 'placedcountry' => $_POST['event-placedcountry'], 'placedstate' => $_POST['event-placedstate'],'placedcity' => $_POST['event-placedcity'], 'placedaddress' => $_POST['event-placedaddress'], 'placednote' => $_POST['event-placednote'], 'placedgooglemap' => $_POST['event-placedgooglemap'], 'flyer' => $_POST['event-flyer'],'newspublic' => $_POST['event-newspublic'], 'newsprivate' => $_POST['event-newsprivate'], 'edtsd' => $_POST['event-edtsd'], 'edted' => $eventedted, 'edtsth' => $_POST['event-edtsth'], 'edteth' => $_POST['event-edteth'], 'edtstm' => $_POST['event-edtstm'], 'edtetm' => $_POST['event-edtetm'],'grouplink' => $_POST['grouplink'], 'forumlink' => $_POST['forumlink'], 'enablesocial' => $_POST['enablesocial'],'slug' => events_jes_check_slug( sanitize_title( esc_attr( $_POST['event-name'] ) ) ), 'date_created' => gmdate( \"Y-m-d H:i:s\" ), 'status' => 'public', 'notify_timed_enable' => $_POST['notifytimedenable']) ) ) {\r\n\t\t\t\tbp_core_add_message( __( 'There was an error saving event details, please try again [001]', 'jet-event-system' ), 'error' );\r\n\t\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $bp->jes_events->current_create_step . '/' );\r\n\t\t\t}\r\n}\r\n\t\t\tevents_update_eventmeta( $bp->jes_events->new_event_id, 'total_member_count', 1 );\r\n\t\t\tevents_update_eventmeta( $bp->jes_events->new_event_id, 'last_activity', gmdate( \"Y-m-d H:i:s\" ) );\r\n\t\t}\r\n\r\n\t\tif ( 'event-settings' == $bp->jes_events->current_create_step ) {\r\n\t\t\t$event_status = 'public';\r\n\t\t\t$event_enable_forum = 1;\r\n\r\n\t\t\tif ( !isset($_POST['event-show-forum']) ) {\r\n\t\t\t\t$event_enable_forum = 0;\r\n\t\t\t} else {\r\n\t\t\t}\r\n\r\n\t\t\tif ( 'private' == $_POST['event-status'] )\r\n\t\t\t\t$event_status = 'private';\r\n\t\t\telse if ( 'hidden' == $_POST['event-status'] )\r\n\t\t\t\t$event_status = 'hidden';\r\n\r\n\t\t\tif ( !$bp->jes_events->new_event_id = events_create_event( array( 'event_id' => $bp->jes_events->new_event_id, 'status' => $event_status, 'grouplink' => $_POST['event-grouplink'], 'forumlink' => $_POST['event-forumlink'], 'enablesocial' => $_POST['enablesocial'],'enable_forum' => $event_enable_forum ) ) ) {\r\n\t\t\t\tbp_core_add_message( __( 'There was an error saving event details, please try again. [002]', 'jet-event-system' ), 'error' );\r\n\t\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $bp->jes_events->current_create_step . '/' );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ( 'event-invites' == $bp->jes_events->current_create_step ) {\r\n\t\t\tevents_send_invite_jes( $bp->loggedin_user->id, $bp->jes_events->new_event_id );\r\n\t\t}\r\n\r\n\t\tdo_action( 'events_create_event_step_save_' . $bp->jes_events->current_create_step );\r\n\t\tdo_action( 'events_create_event_step_complete' ); // Mostly for clearing cache on a generic action name\r\n\r\n\t\t/**\r\n\t\t * Once we have successfully saved the details for this step of the creation process\r\n\t\t * we need to add the current step to the array of completed steps, then update the cookies\r\n\t\t * holding the information\r\n\t\t */\r\n\t\tif ( !in_array( $bp->jes_events->current_create_step, (array)$bp->jes_events->completed_create_steps ) )\r\n\t\t\t$bp->jes_events->completed_create_steps[] = $bp->jes_events->current_create_step;\r\n\r\n\t\t/* Reset cookie info */\r\n\t\tsetcookie( 'bp_new_event_id', $bp->jes_events->new_event_id, time()+60*60*24, COOKIEPATH );\r\n\t\tsetcookie( 'bp_completed_create_steps', serialize( $bp->jes_events->completed_create_steps ), time()+60*60*24, COOKIEPATH );\r\n\r\n\t\t/* If we have completed all steps and hit done on the final step we can redirect to the completed event */\r\n\t\tif ( count( $bp->jes_events->completed_create_steps ) == count( $bp->jes_events->event_creation_steps ) && $bp->jes_events->current_create_step == array_pop( array_keys( $bp->jes_events->event_creation_steps ) ) ) {\r\n\t\t\tunset( $bp->jes_events->current_create_step );\r\n\t\t\tunset( $bp->jes_events->completed_create_steps );\r\n\r\n\t\t\t/* Once we compelete all steps, record the event creation in the activity stream. */\r\n\t\t\tevents_record_activity( array(\r\n\t\t\t\t'action' => apply_filters( 'events_activity_created_event_action', sprintf( __( '%s created the event %s', 'jet-event-system'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href=\"' . jes_bp_get_event_permalink( $bp->jes_events->current_event ) . '\">' . attribute_escape( $bp->jes_events->current_event->name ) . '</a>' ) ),\r\n\t\t\t\t'type' => 'created_event',\r\n\t\t\t\t'item_id' => $bp->jes_events->new_event_id\r\n\t\t\t) );\r\n\r\n\t\t\tdo_action( 'events_event_create_complete', $bp->jes_events->new_event_id );\r\n\r\n\t\t\tbp_core_redirect( jes_bp_get_event_permalink( $bp->jes_events->current_event ) );\r\n\t\t} else {\r\n\t\t\t/**\r\n\t\t\t * Since we don't know what the next step is going to be (any plugin can insert steps)\r\n\t\t\t * we need to loop the step array and fetch the next step that way.\r\n\t\t\t */\r\n\t\t\tforeach ( (array)$bp->jes_events->event_creation_steps as $key => $value ) {\r\n\t\t\t\tif ( $key == $bp->jes_events->current_create_step ) {\r\n\t\t\t\t\t$next = 1;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( $next ) {\r\n\t\t\t\t\t$next_step = $key;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tbp_core_redirect( $bp->root_domain . '/' . $bp->jes_events->slug . '/create/step/' . $next_step . '/' );\r\n\t\t}\r\n\t}\r\n\r\n\t/* Event avatar is handled separately */\r\n\tif ( 'event-avatar' == $bp->jes_events->current_create_step && isset( $_POST['upload'] ) ) {\r\n\t\tif ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) {\r\n\t\t\t/* Normally we would check a nonce here, but the event save nonce is used instead */\r\n\r\n\t\t\t/* Pass the file to the avatar upload handler */\r\n\t\t\tif ( bp_core_avatar_handle_upload( $_FILES, 'events_avatar_upload_dir' ) ) {\r\n\t\t\t\t$bp->avatar_admin->step = 'crop-image';\r\n\r\n\t\t\t\t/* Make sure we include the jQuery jCrop file for image cropping */\r\n\t\t\t\tadd_action( 'wp', 'bp_core_add_jquery_cropper' );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* If the image cropping is done, crop the image and save a full/thumb version */\r\n\t\tif ( isset( $_POST['avatar-crop-submit'] ) && isset( $_POST['upload'] ) ) {\r\n\t\t\t/* Normally we would check a nonce here, but the event save nonce is used instead */\r\n\r\n\t\t\tif ( !bp_core_avatar_handle_crop( array( 'object' => 'event', 'avatar_dir' => 'event-avatars', 'item_id' => $bp->jes_events->current_event->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )\r\n\t\t\t\tbp_core_add_message( __( 'There was an error saving the event avatar, please try uploading again.', 'jet-event-system' ), 'error' );\r\n\t\t\telse\r\n\t\t\t\tbp_core_add_message( __( 'The event avatar was uploaded successfully!', 'jet-event-system' ) );\r\n\t\t}\r\n\t}\r\n\r\n \tbp_core_load_template( apply_filters( 'events_template_create_event', 'events/create' ) );\r\n}", "public function run()\n {\n $workflowactions = [\n [ // 1\n 'titre' => \"Date Dépôt\",\n 'description' => \"Date Dépôt Agence\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 1, // Date Dépôt Agence\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de renseigner la Date Dépôt\",\n ],\n [ // 2\n 'titre' => \"Montant Déposé\",\n 'description' => \"Montant Déposé (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 2, // Montant Déposé (Agence)\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de renseigner le Montant Déposé\",\n ],\n [ // 3\n 'titre' => \"Scan Bordereau\",\n 'description' => \"Scan Bordereau (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 3, // Scan Bordereau\n 'field_required' => 1,\n 'field_required_msg' => \"Prière de joindre le Scan du Bordereau\",\n ],\n [ // 4\n 'titre' => \"Commentaire\",\n 'description' => \"Commentaire (Agence)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 2,\n 'workflow_object_field_id' => 4, // Commentaire Agence\n 'field_required' => 0,\n ],\n [ // 5\n 'titre' => \"Date Valeur\",\n 'description' => \"Date Valeur (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 5, // Date Valeur\n 'field_required_without' => 1, // Requis (sans) quand le rejet n'est pas activé\n 'field_required_without_msg' => \"Prière de renseigner la Date Valeur\",\n ],\n [ // 6\n 'titre' => \"Montant Validé\",\n 'description' => \"Montant Validé (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 6, // Montant Validé (Finances)\n 'field_required_without' => 1, // Requis (sans) quand le rejet n'est pas activé\n 'field_required_without_msg' => \"Prière de renseigner le Montant Validé\",\n ],\n [ // 7\n 'titre' => \"Rejeter\",\n 'description' => \"Rejet (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 8, // Rejet (Finances)\n 'field_required' => 0,\n ],\n [ // 8\n 'titre' => \"Motif Rejet\",\n 'description' => \"Motif Rejet (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 9, // Motif Rejet (Finances)\n 'field_required_with' => 1, // Requis (avec) quand le rejet est activé\n 'field_required_with_msg' => \"Le Motif est nécéssaire pour valider le Réjet\",\n ],\n [ // 9\n 'titre' => \"Commentaire\",\n 'description' => \"Commentaire (Finances)\",\n 'workflow_action_type_id' => 2,\n 'workflow_step_id' => 3,\n 'workflow_object_field_id' => 7, // Commentaire (Finances)\n 'field_required' => 0,\n ],\n ];\n foreach ($workflowactions as $workflowaction) {\n WorkflowAction::create($workflowaction);\n }\n // create fields required without list\n DB::table('fields_required_without')->insert([\n [ 'workflow_action_id' => 5, 'workflow_object_field_id' => 8,],\n [ 'workflow_action_id' => 6, 'workflow_object_field_id' => 8,],\n ]);\n // create fields required with list\n DB::table('fields_required_with')->insert([\n 'workflow_action_id' => 8,'workflow_object_field_id' => 8,\n ]\n );\n }", "public function process()\n\t{\n\t\tPhpfox::isUser(true);\n\t\tPhpfox::getUserParam('event.can_create_event', true);\n\t\t\n\t\t$bIsEdit = false;\n\t\t$bIsSetup = ($this->request()->get('req4') == 'setup' ? true : false);\n\t\t$sAction = $this->request()->get('req3');\n\t\t$aCallback = false;\t\t\n\t\t$sModule = $this->request()->get('module', false);\n\t\t$iItem = $this->request()->getInt('item', false);\n\t\t\n\t\tif ($iEditId = $this->request()->get('id'))\n\t\t{\n\t\t\tif (($aEvent = Phpfox::getService('event')->getForEdit($iEditId)))\n\t\t\t{\n\t\t\t\t$bIsEdit = true;\n\t\t\t\t$this->setParam('aEvent', $aEvent);\n\t\t\t\t$this->setParam(array(\n\t\t\t\t\t\t'country_child_value' => $aEvent['country_iso'],\n\t\t\t\t\t\t'country_child_id' => $aEvent['country_child_id']\n\t\t\t\t\t)\n\t\t\t\t);\t\t\t\t\n\t\t\t\t$this->template()->setHeader(array(\n\t\t\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.eventEditCategory = function(){ var aCategories = explode(\\',\\', \\'' . $aEvent['categories'] . '\\'); for (i in aCategories) { $(\\'#js_mp_holder_\\' + aCategories[i]).show(); $(\\'#js_mp_category_item_\\' + aCategories[i]).attr(\\'selected\\', true); } }</script>'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t->assign(array(\n\t\t\t\t\t\t'aForms' => $aEvent,\n\t\t\t\t\t\t'aEvent' => $aEvent\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif ($aEvent['module_id'] != 'event')\n\t\t\t\t{\n\t\t\t\t\t$sModule = $aEvent['module_id'];\n\t\t\t\t\t$iItem = $aEvent['item_id'];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif ($sModule && $iItem && Phpfox::hasCallback($sModule, 'viewEvent'))\n\t\t{\n\t\t\t$aCallback = Phpfox::callback($sModule . '.viewEvent', $iItem);\t\t\n\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\t\t\n\t\t\tif ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'event.share_events'))\n\t\t\t{\n\t\t\t\treturn Phpfox_Error::display(Phpfox::getPhrase('event.unable_to_view_this_item_due_to_privacy_settings'));\n\t\t\t}\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$aValidation = array(\n\t\t\t'title' => Phpfox::getPhrase('event.provide_a_name_for_this_event'),\n\t\t\t// 'country_iso' => Phpfox::getPhrase('event.provide_a_country_location_for_this_event'),\t\t\t\n\t\t\t'location' => Phpfox::getPhrase('event.provide_a_location_for_this_event')\n\t\t);\n\t\t\n\t\t$oValidator = Phpfox::getLib('validator')->set(array(\n\t\t\t\t'sFormName' => 'js_event_form',\n\t\t\t\t'aParams' => $aValidation\n\t\t\t)\n\t\t);\t\t\n\t\t\n\t\tif ($aVals = $this->request()->get('val'))\n\t\t{\n\t\t\tif ($oValidator->isValid($aVals))\n\t\t\t{\t\t\t\t\n\t\t\t\tif ($bIsEdit)\n\t\t\t\t{\n\t\t\t\t\tif (Phpfox::getService('event.process')->update($aEvent['event_id'], $aVals, $aEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($sAction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'customize':\n\t\t\t\t\t\t\t\t$this->url()->send('event.add.invite.setup', array('id' => $aEvent['event_id']), Phpfox::getPhrase('event.successfully_added_a_photo_to_your_event'));\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'invite':\n\t\t\t\t\t\t\t\t$this->url()->permalink('event', $aEvent['event_id'], $aEvent['title'], true, Phpfox::getPhrase('event.successfully_invited_guests_to_this_event'));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->url()->send('event.add', array('id' => $aEvent['event_id']), Phpfox::getPhrase('event.event_successfully_updated'));\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$aVals['event_id'] = $aEvent['event_id'];\n\t\t\t\t\t\t$this->template()->assign(array('aForms' => $aVals, 'aEvent' => $aVals));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tif (($iFlood = Phpfox::getUserParam('event.flood_control_events')) !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$aFlood = array(\n\t\t\t\t\t\t\t'action' => 'last_post', // The SPAM action\n\t\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t\t'field' => 'time_stamp', // The time stamp field\n\t\t\t\t\t\t\t\t'table' => Phpfox::getT('event'), // Database table we plan to check\n\t\t\t\t\t\t\t\t'condition' => 'user_id = ' . Phpfox::getUserId(), // Database WHERE query\n\t\t\t\t\t\t\t\t'time_stamp' => $iFlood * 60 // Seconds);\t\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t// actually check if flooding\n\t\t\t\t\t\tif (Phpfox::getLib('spam')->check($aFlood))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('event.you_are_creating_an_event_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (Phpfox_Error::isPassed())\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif ($iId = Phpfox::getService('event.process')->add($aVals, ($aCallback !== false ? $sModule : 'event'), ($aCallback !== false ? $iItem : 0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aEvent = Phpfox::getService('event')->getForEdit($iId);\n\t\t\t\t\t\t\t$this->url()->permalink('event', $aEvent['event_id'], $aEvent['title'], true, Phpfox::getPhrase('event.event_successfully_added'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sStep = (isset($aVals['step']) ? $aVals['step'] : '');\n\t\t\t$sAction = (isset($aVals['action']) ? $aVals['action'] : '');\t\n\t\t\t$this->template()->assign('aForms', $aVals);\t\t\n\t\t}\t\t\n\t\t\n\t\tif ($bIsEdit)\n\t\t{\n\t\t\t$aMenus = array(\n\t\t\t\t'detail' => Phpfox::getPhrase('event.event_details'),\n\t\t\t\t'customize' => Phpfox::getPhrase('event.photo'),\n\t\t\t\t'invite' => Phpfox::getPhrase('event.invite_guests')\n\t\t\t);\n\t\t\t// Dont show the photo upload for iOS\n\t\t\tif ($this->request()->isIOS())\n\t\t\t{\n\t\t\t\tunset($aMenus['customize']);\n\t\t\t}\n\t\t\tif (!$bIsSetup)\n\t\t\t{\n\t\t\t\t$aMenus['manage'] = Phpfox::getPhrase('event.manage_guest_list');\n\t\t\t\t$aMenus['email'] = Phpfox::getPhrase('event.mass_email');\n\t\t\t}\n\t\t\t\n\t\t\t$this->template()->buildPageMenu('js_event_block', \n\t\t\t\t$aMenus,\n\t\t\t\tarray(\n\t\t\t\t\t'link' => $this->url()->permalink('event', $aEvent['event_id'], $aEvent['title']),\n\t\t\t\t\t'phrase' => Phpfox::getPhrase('event.view_this_event')\n\t\t\t\t)\t\t\t\t\n\t\t\t);\t\t\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(($bIsEdit ? Phpfox::getPhrase('event.managing_event') . ': ' . $aEvent['title'] : Phpfox::getPhrase('event.create_an_event')))\n\t\t\t->setFullSite()\t\t\t\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('event.events'), ($aCallback === false ? $this->url()->makeUrl('event') : $this->url()->makeUrl($aCallback['url_home_pages'])))\n\t\t\t->setBreadcrumb(($bIsEdit ? Phpfox::getPhrase('event.managing_event') . ': ' . $aEvent['title'] : Phpfox::getPhrase('event.create_new_event')), ($bIsEdit ? $this->url()->makeUrl('event.add', array('id' => $aEvent['event_id'])) : $this->url()->makeUrl('event.add')), true)\n\t\t\t->setEditor()\n\t\t\t->setPhrase(array(\n\t\t\t\t\t'core.select_a_file_to_upload'\n\t\t\t\t)\n\t\t\t)\t\t\t\t\n\t\t\t->setHeader('cache', array(\t\n\t\t\t\t\t'add.js' => 'module_event',\n\t\t\t\t\t'pager.css' => 'style_css',\n\t\t\t\t\t'progress.js' => 'static_script',\t\t\t\t\t\n\t\t\t\t\t'country.js' => 'module_core'\t\t\t\t\t\n\t\t\t\t)\n\t\t\t)\t\t\t\n\t\t\t->setHeader(array(\n\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.eventProgressBarSettings = function(){ if ($Core.exists(\\'#js_event_block_customize_holder\\')) { oProgressBar = {holder: \\'#js_event_block_customize_holder\\', progress_id: \\'#js_progress_bar\\', uploader: \\'#js_progress_uploader\\', add_more: false, max_upload: 1, total: 1, frame_id: \\'js_upload_frame\\', file_id: \\'image\\'}; $Core.progressBarInit(); } }</script>'\n\t\t\t\t)\n\t\t\t)\n\t\t\t->assign(array(\n\t\t\t\t\t'sCreateJs' => $oValidator->createJS(),\n\t\t\t\t\t'sGetJsForm' => $oValidator->getJsForm(false),\n\t\t\t\t\t'bIsEdit' => $bIsEdit,\n\t\t\t\t\t'bIsSetup' => $bIsSetup,\n\t\t\t\t\t'sCategories' => Phpfox::getService('event.category')->get(),\n\t\t\t\t\t'sModule' => ($aCallback !== false ? $sModule : ''),\n\t\t\t\t\t'iItem' => ($aCallback !== false ? $iItem : ''),\n\t\t\t\t\t'aCallback' => $aCallback,\n\t\t\t\t\t'iMaxFileSize' => (Phpfox::getUserParam('event.max_upload_size_event') === 0 ? null : Phpfox::getLib('phpfox.file')->filesize((Phpfox::getUserParam('event.max_upload_size_event') / 1024) * 1048576)),\n\t\t\t\t\t'bCanSendEmails' => ($bIsEdit ? Phpfox::getService('event')->canSendEmails($aEvent['event_id']) : false),\n\t\t\t\t\t'iCanSendEmailsTime' => ($bIsEdit ? Phpfox::getService('event')->getTimeLeft($aEvent['event_id']) : false),\n\t\t\t\t\t'sJsEventAddCommand' => (isset($aEvent['event_id']) ? \"if (confirm('\" . Phpfox::getPhrase('event.are_you_sure', array('phpfox_squote' => true)) . \"')) { $('#js_submit_upload_image').show(); $('#js_event_upload_image').show(); $('#js_event_current_image').remove(); $.ajaxCall('event.deleteImage', 'id={$aEvent['event_id']}'); } return false;\" : ''),\n\t\t\t\t\t'sTimeSeparator' => Phpfox::getPhrase('event.time_separator')\n\t\t\t\t)\n\t\t\t);\t\t\n\t}", "public function run()\n {\n $user = factory(\\App\\Models\\User::class)->create();\n $user->facebook_id = 10207483104971247;\n $user->save();\n\n $event = new \\App\\Models\\Event();\n $event->name = \"PAST EVENT\";\n $event->when = new DateTime(\"-2 months\");\n $event->lat = 0.00;\n $event->long = 0.00;\n $event->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"done task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = TRUE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"undone task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = FALSE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventInvitee = new \\App\\Models\\EventInvitee();\n $eventInvitee->event_id = $event->id;\n $eventInvitee->user_id = $user->facebook_id;\n $eventInvitee->save();\n\n $event = new \\App\\Models\\Event();\n $event->name = \"CURRENT EVENT\";\n $event->when = new DateTime(\"+2 months\");\n $event->lat = 0.00;\n $event->long = 0.00;\n $event->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"done task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = TRUE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventTask = new \\App\\Models\\EventTask();\n $eventTask->name = \"undone task\";\n $eventTask->assignee = $user->facebook_id;\n $eventTask->done = FALSE;\n $eventTask->event_id = $event->id;\n $eventTask->save();\n\n $eventInvitee = new \\App\\Models\\EventInvitee();\n $eventInvitee->event_id = $event->id;\n $eventInvitee->user_id = $user->facebook_id;\n $eventInvitee->save();\n\n }", "abstract public function getWorkflowDefinition();", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "public function wizardProcessStep($event)\n {\n $read = $event->sender->read();\n if (isset($read['chooseLanguage'])) {\n Yii::app()->setLanguage($read['chooseLanguage']['lang']);\n }\n\n\n $modelName = ucfirst($event->step);\n $model = new $modelName();\n $model->attributes = $event->data;\n $form = $model->getForm();\n\n switch ($event->step) {\n case 'db':\n if (isset($_POST['Db'])) {\n $model->attributes = $_POST['Db'];\n if ($model->validate()) {\n Yii::app()->cache->flush();\n $model->install();\n }\n }\n break;\n case 'completed':\n Yii::app()->cache->flush();\n FileSystem::fs('assets', Yii::getPathOfAlias('webroot'))->cleardir();\n break;\n case 'configure':\n $data = $event->sender->read();\n if (isset($_POST['Configure'])) {\n $model->attributes = $_POST['Configure'];\n if ($model->validate()) {\n $model->install($data);\n }\n }\n break;\n default:\n break;\n }\n\n if ($form->submitted() && $form->validate()) {\n\n $event->sender->save($model->attributes);\n $event->handled = true;\n } else {\n if ($event->step == 'info') {\n $this->render('form', compact('event', 'form'));\n } else {\n if (file_exists(Yii::getPathOfAlias('mod.install.views.default') . DS . $event->step . '.php')) {\n $this->render($event->step, compact('event', 'form'));\n } else {\n $this->render('form', compact('event', 'form'));\n }\n }\n }\n }", "public function CreateTaskAction(Request $request)\n {\n $taskrouterclient = $this->get('commcloud_twilio_wrapper.twilio_taskrouter');\n \t$attributes = $request->request->get('customeAttributes');\n \t$attributes = json_encode($attributes);\n \ttry{\n \t $taskrouterclient->workspace->tasks->create($attributes, $this->getParameter('workflowSid'));\n \t return new Response(200);\n \t}catch(\\Exception $e){\n \t //return new Response(200);\n \t $this->get('logger')->error($e->getMessage());\n \t}\n \t\n \t\n }", "public function __construct($name, array $config = [])\n\t{\n\t\tif (empty($name)) {\n\t\t\tthrow new WorkflowException('Failed to create event instance : missing $name value');\n\t\t} else {\n\t\t\t$this->name = $name;\n\t\t}\n\t\tif ( isset($config['start'])) {\n\t\t\t$this->_start = $config['start'];\n\t\t\tunset($config['start']);\n\t\t}\n\t\tif ( isset($config['end'])) {\n\t\t\t$this->_end = $config['end'];\n\t\t\tunset($config['end']);\n\t\t}\n\t\tif ( isset($config['transition'])) {\n\t\t\t$this->_transition = $config['transition'];\n\t\t\tunset($config['transition']);\n\t\t}\n\t\tunset($config['name']);\n\t\tparent::__construct($config);\n\t}", "public function cancelRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::CANCELLED;\n $workflowProcess->save();\n\n WorkflowProcessCancelled::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function onEvent(Event $event) {\n\t\tif ($this->runtimeContext) {\n\t\t\t$this->workflowActivity->onEvent($this->runtimeContext, $event);\n\t\t}\n\t}", "public function prePersist(LifecycleEventArgs $event) {\n\n $em = $event->getObjectManager();\n $entity = $event->getObject();\n\n if($entity instanceof SaleEntity || $entity instanceof SaleItemEntity) {\n\n // Automate creation of transition.\n $state = $entity->getState();\n\n if($entity instanceof SaleEntity) {\n $transition = new SaleWorkflowTransition();\n $transition->setSale($entity);\n } else {\n $transition = new SaleItemWorkflowTransition();\n $transition->setSaleItem($entity);\n }\n\n $transition->setAfterState($state);\n $transition->setCreatedAt(Carbon::now());\n $transition->setUpdatedAt(Carbon::now());\n\n $entity->addTransition($transition);\n\n }\n\n }", "public function pauseRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PAUSED;\n $workflowProcess->save();\n\n WorkflowProcessPaused::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function pushTask($mobileWorksApi, $redundancy, $workflowType) {\n\t\t$this->read(null, $this->id);\n\t\t\n\t\t\tif($this->data['Evaluation']['type'] == Evaluation::$TYPE_ARTICLE_TOPIC) {\n\t\t\t\t$callback = Configure::read('domain') . '/evaluations/returnstepone/'.$this->data['Evaluation']['id'];\n\t\t\t} else {\n\t\t\t\t$callback = Configure::read('domain') . '/evaluations/returnsteptwo/'.$this->data['Evaluation']['id'];\n\t\t\t}\t\n\t\t\t\t\n\t\t\t// create a project (to get an instant callback, we need a new project for every task)\n\t\t\t$p = $mobileWorksApi->Project(array(\n\t\t\t\t'projectid' => Configure::read('version') . $this->data['Evaluation']['id'],\n\t\t\t\t'webhooks' => $callback,\n\t\t\t));\n\n\t\t\t$taskid = Configure::read('version') . $this->data['Evaluation']['id']. '-' . rand(1, 10000);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t$t = $mobileWorksApi->Task(array(\n\t\t\t\t'taskid' => $taskid,\n\t\t\t\t'instructions' => $this->data['Evaluation']['question'],\n\t\t\t\t'workflow' => $workflowType,\n\t\t\t\t'redundancy' => $redundancy,\n\t\t\t\t//'payment' => X @todo implement for Stage 2\n\t\t\t\t// Add user blocking options https://www.mobileworks.com/developers/parameters/#blocked and below\n\t\t\t\t));\n\n\t\t\tif($this->data['Evaluation']['type'] == Evaluation::$TYPE_ARTICLE_TOPIC) {\n\t\t\t\t$t->add_field('result', 'm', array(\"choices\"=>\"Yes,No\"));\n\t\t\t} else { // titlesentiment or paragraphsentiment\n\t\t\t\t$t->add_field('rating', 'm', array(\"choices\"=>\"-5 (Very Bad),-4,-3,-2,-1,0 (balanced),1,2,3,4,5 (Very positive)\"));\n\t\t\t\t$t1 = $mobileWorksApi->Task(array(\n\t\t\t\t'taskid' => $taskid.\"checktask\",\n\t\t\t\t'instructions' => 'Are you experienced in economies?',\n\t\t\t\t//'payment' => X @todo implement for Stage 2\n\t\t\t\t// Add user blocking options https://www.mobileworks.com/developers/parameters/#blocked and below\n\t\t\t\t));\n\t\t\t\t$t1->add_field('result', 'm', array(\"choices\"=>\"Yes,No\"));\n\t\t\t\t$p->add_task($t1);\n\t\t\t}\n\n\t\t\t$p->add_task($t);\n\t\t\t$project_url = $p->post();\n\t\t\t$this->saveField('task_url', $project_url);\n\t\t\t$this->saveField('task_id', $taskid);\n\t}", "public function processAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream: ' . $env->get('name'));\n $handler = new IcingaEventHandler($env);\n $handler->processEvents();\n }", "function deleteWorkflow($workflowId);", "public function run()\n {\n EventPackage::Create([\n 'event_package_description' => 'Conference Fee',\n 'amount' \t=> 20000,\n 'event_id' => '1'\n ]);\n\n EventPackage::Create([\n 'event_package_description' => 'Exhibition Fee',\n 'amount' \t=> 100000,\n 'event_id' => '1'\n ]);\n\n EventPackage::Create([\n 'event_package_description' => 'Membership Fee',\n 'amount' \t=> 10000,\n 'event_id' => '1'\n ]);\n }", "public function process(object $event) {\r\n\r\n }", "public function createEvent(array &$variables): AbstractPreprocessEvent {\n return new ExamplePreprocessEvent(\n new ExampleEventVariables($variables)\n );\n }", "public function resumeRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PAUSED) {\n throw new \\Exception('Workflow run is not paused');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PENDING;\n $workflowProcess->save();\n\n WorkflowProcessResumed::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function create(\\Marat555\\Eventbrite\\Factories\\Entity\\Webhook $webhook);", "private function marketingPromoWorkflowRun($order_id)\n {\n $order = new shopOrder($order_id);\n $workflow = new shopMarketingPromoWorkflow($order);\n $workflow->run();\n }", "protected function addFulfillmentProcessAuditRequest($fulfillment_process_id, $fulfillment_process_audit)\n {\n // verify the required parameter 'fulfillment_process_id' is set\n if ($fulfillment_process_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_id when calling addFulfillmentProcessAudit'\n );\n }\n // verify the required parameter 'fulfillment_process_audit' is set\n if ($fulfillment_process_audit === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $fulfillment_process_audit when calling addFulfillmentProcessAudit'\n );\n }\n\n $resourcePath = '/beta/fulfillmentProcess/{fulfillmentProcessId}/audit/{fulfillmentProcessAudit}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($fulfillment_process_id !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessId' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_id),\n $resourcePath\n );\n }\n // path params\n if ($fulfillment_process_audit !== null) {\n $resourcePath = str_replace(\n '{' . 'fulfillmentProcessAudit' . '}',\n ObjectSerializer::toPathValue($fulfillment_process_audit),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function addWorkflowActivities()\n {\n // but are derived from the workflows.xml in order to model what we call \"workflow activities\".\n foreach ($this->aggregate_root_type_map as $aggregate_root_type) {\n $workflow_activities_map = $this->workflow_activity_service->getActivities($aggregate_root_type);\n\n foreach ($workflow_activities_map as $workflow_step => $workflow_activities) {\n $scope = sprintf(self::WORKFLOW_SCOPE_PATTERN, $aggregate_root_type->getPrefix(), $workflow_step);\n\n if ($this->activity_container_map->hasKey($scope)) {\n $container = $this->activity_container_map->getItem($scope);\n $container->getActivityMap()->append($workflow_activities);\n } else {\n $container_state = [ 'scope' => $scope, 'activity_map' => $workflow_activities ];\n $workflow_activity_container = new ActivityContainer($container_state);\n $this->activity_container_map->setItem($scope, $workflow_activity_container);\n }\n }\n }\n }", "public function setWorkflowStepId(int $workflowStepId): Creator\n {\n $this->workflowStepId = $workflowStepId;\n return $this;\n }", "private function registerWorkflow()\n\t{\n\t\t$this->app->singleton('cerbero.workflow', function($app)\n\t\t{\n\t\t\treturn $app['Cerbero\\Workflow\\Workflow'];\n\t\t});\n\t}", "public function getWorkflowId()\n {\n return $this->workflow_id;\n }", "public function createByText($text = '',$customHeaders = array()){\n\t\t$_api = new API($text);\n\n\t\t$response = $this->createByType(array(), $_api, 'TEXT', $customHeaders);\n $process = new CopyleaksProcess($response['response']['ProcessId'],\n $response['response']['CreationTimeUTC'],\n $this->loginToken->authHeader(),\n $this->typeOfService);\n\t\treturn $process;\n\t}", "public function testWorkflowsPost()\n {\n }", "public function create($processId, $processName, $step)\n {\n return view('processStepCreate', compact('processId', 'processName','step'));\n }", "public function create_event( $eventname )\n\t{\n\t\tCmsEvents::create_event($this->get_name(), $eventname);\n\t}", "public function getWorkflow();", "public function setWorkflowKey($var)\n {\n GPBUtil::checkInt64($var);\n $this->workflowKey = $var;\n\n return $this;\n }", "public function createTasks()\n {\n if (count($this->tasks) == 0)\n throw new \\Drupal\\ClassLearning\\Exception('No tasks defined for TaskFactory');\n\n foreach($this->tasks as $name => $task) :\n if (isset($task['count']))\n $count = $task['count'];\n else\n $count = 1;\n\n // Some need multiple tasks. Ex: grading a soln\n // This can be expanded to as many as needed\n for ($i = 0; $i < $count; $i++) :\n $t = new WorkflowTask;\n $t->workflow_id = $this->workflow->workflow_id;\n\n // We're not assigning users at this stage\n $n = null;\n if(isset($task['behavior']))\n \t$n = $task['behavior'];\n\t\telse\n\t\t\t$n = $name;\n\t\t\n\t\t$t->type = $n;\n $t->status = 'not triggered';\n $t->start = NULL;\n\n $t->settings = $this->tasks[$n];\n $t->data = [];\n\t\t\n\t\tif(isset($task['criteria'])){\n\t\t\t$t->setData('grades',$task['criteria']);\n\t\t}\n\t\t\n $t->save();\n endfor;\n endforeach;\n\t\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function setWorkflowError($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_error = $var;\n\n return $this;\n }", "function save(ezcWorlflow $workflow) {\n\t\t\n\t}", "public static function fromDatabase(stdClass $model): Process;", "public function testWorkflowsWorkflowIdPut()\n {\n }", "public function new($workflowId = null): ResponseInterface\n {\n $user = $this->getUser();\n\n // If no Workflow was specified then load available\n if ($workflowId === null) {\n // Find available Workflows\n $workflows = [];\n\n foreach (model(WorkflowModel::class)->findAll() as $workflow) {\n if ($workflow->allowsUser($user)) {\n $workflows[] = $workflow;\n }\n }\n\n if ($workflows === []) {\n return $this->renderError(lang('Workflows.noWorkflowAvailable'));\n }\n\n // If more than one Workflow was available then display a selection\n if (count($workflows) > 1) {\n return $this->render($this->config->views['workflow'], [\n 'workflows' => $workflows,\n ]);\n }\n\n $workflow = reset($workflows);\n } elseif (! $workflow = model(WorkflowModel::class)->find($workflowId)) {\n return $this->renderError(lang('Workflows.workflowNotFound'));\n }\n\n // Verify access\n if (! $workflow->allowsUser($user)) {\n return $this->renderError(lang('Workflows.workflowNotPermitted'));\n }\n\n // Determine the starting point\n if (! $stages = $workflow->getStages()) {\n return $this->renderError(lang('Workflows.workflowNoStages'));\n }\n\n $stage = reset($stages);\n\n // Create the Job\n $jobId = $this->jobs->insert([\n 'name' => 'My New Job',\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ]);\n\n // Send to the first action\n return redirect()->to(site_url($stage->getRoute() . $jobId))->with('success', lang('Workflows.newJobSuccess'));\n }", "public function create()\n {\n $group = $this->workflow_Process_Group_Service->index();\n return view('workflow::workflow_process.add',compact('group'));\n }", "public function create()\n {\n $programEvent = new ProgramEvent();\n return view('program-event.create', compact('programEvent'));\n }", "public static function beforeEnterWorkflow($workflowId = self::ANY_WORKFLOW)\n\t{\n\t\tself::_checkNonEmptyString('workflowId', $workflowId);\n\t\treturn 'beforeEnterWorkflow{'.$workflowId.'}';\n\t}", "public function store(StoreWorkflowRequest $request)\n {\n $data = $request->validated();\n $type = new Workflow();\n $type->fill($data);\n $type->save();\n\n return redirect(Administration::route('workflow.index'))->withSuccess([trans('index::admin.success_create')]);\n }", "public function flow() {\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "public function set_workflow (array $workflow) {\n $this->workflow = $workflow;\n }", "public static function create_event($pid, $event) \n\t\t{\t\n\t\t\t$mysqli = MysqlInterface::get_connection();\n\t\t\t\n\t\t\t// insert event\n\t\t\t$stmt = $mysqli->stmt_init();\n\t\t\t$stmt->prepare('INSERT INTO event (title, owner, gowner, start_time, end_time, location, logo, description, category, size, tag, price) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);');\n\t\t\t$stmt->bind_param('siisssssiisd', $event['title'], $pid, $gid, $event['start_time'], $event['end_time'], $event['location'], $event['logo'], $event['description'], $event['category'], $event['size'], $event['tag'], $event['price']);\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t// get auto generated id\n\t\t\t$eid = $mysqli->insert_id;\n\t\t\t\n\t\t\t$stmt->close();\n\t\t\t\n\t\t\t// grant user host role\n\t\t\tPeopleDAO::set_event_role_pid($pid, $eid, Role::Owner);\n\t\t\treturn $eid;\n\t\t}", "public function onOrderTransition(WorkflowTransitionEvent $event) {\n /** @var \\Drupal\\Core\\Config\\ImmutableConfig Qb Enterprise $config */\n $config = \\Drupal::config('commerce_quickbooks_enterprise.QuickbooksAdmin');\n\n /** @var \\Drupal\\commerce_order\\Entity\\OrderInterface $order */\n $order = $event->getEntity();\n\n\n }", "public function createByURL($url='', $customHeaders=array()){\n\t\tif (filter_var($url, FILTER_VALIDATE_URL) === FALSE)\n\t\t throw new Exception(\"INVALID URL\");\n\n\t\t$_content = json_encode(array('Url'=>$url));\n\t\t$_api = new API($_content);\n\t\t$response = $this->createByType(array(), $_api, 'URL', $customHeaders);\n\t\t$process = new CopyleaksProcess($response['response']['ProcessId'],\n\t\t\t\t\t\t\t\t\t\t$response['response']['CreationTimeUTC'],\n\t\t\t\t\t\t\t\t\t\t$this->loginToken->authHeader(),\n\t\t\t\t\t\t\t\t\t\t$this->typeOfService);\n\t\treturn $process;\n\t}", "public function create(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}", "public function eventSyncCivicrmCreateDrupal(string $objectId, object $objectRef): void {\n // Check if event already exists in Drupal, only continue if not.\n // @TODO: check if is template, don't sync if so.\n if (!$this->existsInDrupal($objectId) && !$this->isEventTemplate($objectId)) {\n // First: create the node in Drupal as wel.\n $event = $this->entityTypeManager->getStorage('node')\n ->create([\n 'type' => $this->configFactory->get('civicrm_event_sync.settings')\n ->get('content_type'),\n ]);\n\n $event->set('title', $objectRef->title);\n $event->set($this->civicrmRefField, $objectId);\n $event->status = 0;\n $event->enforceIsNew();\n $event->save();\n\n // Second: update the current civicrm even to include the Drupal node id.\n $this->apiService->api('Event', 'create', [\n 'id' => $objectId,\n $this->drupalRefField => $event->id(),\n ]);\n\n $this->logger->get('EventSync')\n ->error('Created Drupal event with id %id', ['%id' => $event->id()]);\n }\n }", "public function createNew(\n string $name,\n string $event,\n bool $running,\n bool $success,\n string $message\n ) : array {\n\n return $this->sendPost(\n sprintf('/profiles/%s/processes/%s/tasks', $this->userName, $this->processId),\n [],\n [\n 'name' => $name,\n 'event' => $event,\n 'running' => $running,\n 'success' => $success,\n 'message' => $message\n ]\n );\n }", "public static function create_event( $module_name, $event_name )\n\t{\n\t\t$event = cms_orm('CmsDatabaseEvent')->find_by_module_name_and_event_name($module_name, $event_name);\n\t\tif ($event == null)\n\t\t{\n\t\t\t$event = new CmsDatabaseEvent();\n\t\t\t$event->module_name = $module_name;\n\t\t\t$event->event_name = $event_name;\n\t\t\treturn $event->save();\n\t\t}\n\t}", "function validate_workflow( $workflow ) {\n\n\t\tif ( ! $trigger = $workflow->get_trigger() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function create()\n {\n $this->validateAccess();\n\n return view('general.form', ['setup' => [\n 'title' => __('New process'),\n 'action_link' => route('admin.landing.processes.index'),\n 'action_name' => __('Back'),\n 'iscontent' => true,\n 'action' => route('admin.landing.processes.store'),\n 'breadcrumbs' => [\n [__('Landing Page'), route('admin.landing')],\n [__('Processes'), route('admin.landing.processes.index')],\n [__('New'), null],\n ],\n ],\n 'fields'=>$this->getFields(), ]);\n }", "private function createParticipation(Event $event, Request $request)\n {\n $user = Auth::user();\n $part = new Participation();\n $fileName = str_replace(' ', '_', $user->getFullName());\n $path = $event->storage . 'participations/'.$fileName;\n $validator = $this->valideRequest($request);\n if($validator->fails()) {\n Session::flash('partFail', '*');\n return back()->withErrors($validator->errors());\n }\n #validation passes\n if($request->files->has('abstract')) {\n $part->uploadFile($request->file('abstract'), 'abstract_'.$fileName, $path);\n }\n $part->uploadFile($request->file('participation'), 'participation_'.$fileName, $path);\n\n $this->zipParticipationFiles($path);\n\n $part = Participation::create([\n 'event_id' => $event->id,\n 'participant_id' => $user->id,\n 'title' => $request->title,\n 'affiliation' => $request->affiliation,\n 'session' => $request->all()['session'],\n 'authors' => $request->authors,\n 'file_name' => $user->getFullName(),\n 'file' => $path.'.zip'\n ]);\n $this->notify('create', $part, $user);\n }", "public function process(array $event);", "public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }", "public function add(ProcessDefinition $definition);", "public function createTask(){\n //date_default_timezone_set('Europe/Paris');\n $bdd = $this->connectDB();\n\t\t//faire les contrôles de saisie en JS\n $team=htmlspecialchars($_POST['create-task-team']);\n $flow=htmlspecialchars($_POST['create-task-flow']);\n $title=htmlspecialchars($_POST['create-task-title']);\n $priority=htmlspecialchars($_POST['create-task-priority']);\n $description=htmlspecialchars($_POST['create-task-description']);\n if (isset($_POST['create-task-assignee'])){\n $assignee=htmlspecialchars($_POST['create-task-assignee']);\n }else{\n $assignee='';\n }\n\n //get task status\n $req=$bdd->prepare('SELECT status.id AS status_id FROM status, flow WHERE flow.id=status.id_flow AND status.position=0 AND flow.id= ?');\n $req->execute(array($flow));\n\n if ($req->rowCount()){\n $row = $req->fetch();\n $status=$row['status_id'];\n }\n\n $creator=$_SESSION['id'];\n $last_modifier=$_SESSION['id'];\n $creation_date=date(\"Y-m-d H:i:s\");\n $last_modif_date=date(\"Y-m-d H:i:s\");\n $target_date=$_POST['create-task-target'];\n\n\n //insert record in table task\n\t\t$inserttask=$bdd->prepare('INSERT INTO task(title,description,creator,creation_date,assignee,last_modifier,last_modification_date,target_delivery_date,team,flow,status,priority) VALUES(?,?,?,?,?,?,?,?,?,?,?,?)');\n\t\t$inserttask->execute(array($title,$description,$creator,$creation_date,$assignee,$last_modifier,$last_modif_date,$target_date,$team,$flow,$status,$priority));\n\n //update history\n $history_manager=new historyManager();\n $history_manager->addEvent($team,'task_creation',$bdd->lastInsertId());\n\n $bdd=null;\n }", "public function testCloneTask()\n {\n // workflow, rule, action and object\n $this->task = factory(TaskEloquent::class)->create([\n 'user_id' => null,\n 'person_id' => $this->person->getKey(),\n ]);\n\n $workflow = factory(WorkflowEloquent::class)->create([\n 'user_id' => $this->user->getKey(),\n ]);\n $action1 = factory(ActionEloquent::class)->create([\n 'action_type' => ActionEloquent::ACTION_TYPE_CLONE,\n 'target_class' => '',\n 'target_field' => '',\n 'value' => '',\n 'task_id' =>$this->task->getKey(),\n ]);\n $workflow->actions()->sync([$action1->getKey() ]); //, $action2->getKey()\n $object = factory(ObjectEloquent::class)->create([\n 'workflow_id' => $workflow->getKey(),\n 'object_class' => 'tags.id',\n 'object_type' => $this->tag->getKey(),\n ]);\n\n\n // rule\n $rule1 = factory(RuleEloquent::class)->create([\n 'name' => 'assign task to user',\n 'workflow_id' => $workflow->getKey(),\n 'rule_type' => RuleEloquent::FIELD_TYPE_NUMBER,\n 'operator' => RuleEloquent::OPERATOR_EQUAL,\n 'field_name' => 'person_contexts.stage_id',\n 'value' => $this->stageId,\n 'runnable_once' => 1, // only once\n ]);\n\n $action1->rules()->sync([ $rule1->getKey()]);\n\n // run action runner\n $kernel = $this->app->make(Kernel::class);\n $status = $kernel->handle(\n $input = new ArrayInput(array(\n 'command' => 'workflow:action-run',\n 'workflow' => $workflow->getKey(),\n 'action' => $action1->getKey(),\n )),\n $output = new BufferedOutput\n );\n //echo $output->fetch();\n $this->assertEquals($status, 0);\n\n // check status\n $this->seeInDatabase('action_logs',[\n 'action_id' => $action1->getKey(),\n 'workflow_id' => $workflow->getKey(),\n 'status' => LogInterface::LOG_STATUS_SUCCESS,\n 'object_class' => $this->person->getLoggableType(), //$leadContext->getLoggableType(),\n 'object_id' => $this->person->getKey(), //$leadContext->getKey(),\n 'user_id' => $this->user->getKey(),\n ]);\n\n // check task\n $this->seeInDatabase('tasks',[\n 'user_id' => $this->user->getKey(),\n 'person_id' => $this->person->getKey(),\n 'created_by' => $this->user->getKey(),\n 'updated_by' => $this->user->getKey(),\n ]);\n\n $this->cleanUpRecords(new PersonObserver, $this->person);\n }", "private function startWorkflow($obj)\n {\n $workflow = $this->objFromFixture(WorkflowDefinition::class, 'requestPublication');\n $obj->WorkflowDefinitionID = $workflow->ID;\n $obj->write();\n\n $svc = singleton(WorkflowService::class);\n $svc->startWorkflow($obj, $obj->WorkflowDefinitionID);\n return $obj;\n }", "public function create(SystemProcess $process)\n {\n return view('backend.system-processes.create',compact('process'));\n }", "public static function workflowActions();", "static function onPostCreateProject(Event $event = null)\n\t{\n\t\t$workbench = new static(new Filesystem, getcwd());\n\t\t$workbench->setup();\n\t}", "public function __construct(ProcessInstance $processInstance)\n {\n $this->processInstance = $processInstance;\n }", "public function __construct(array $workflowConfig = array())\n {\n $this\n ->setWorkflowConfig($workflowConfig);\n }", "public function findNextWorkflowTask($workflowId, $index = 0);", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}" ]
[ "0.58642316", "0.568541", "0.5602228", "0.5544195", "0.55028105", "0.54834634", "0.5331092", "0.5264262", "0.5229887", "0.5201359", "0.5194857", "0.51594996", "0.51308477", "0.5127265", "0.5110349", "0.5097143", "0.50173897", "0.5000769", "0.49907723", "0.49805492", "0.4979319", "0.4973778", "0.4949306", "0.4949086", "0.49397856", "0.4939347", "0.49303377", "0.49082315", "0.4857245", "0.4852918", "0.48416755", "0.48226362", "0.48136303", "0.4807603", "0.4806294", "0.48034593", "0.47836447", "0.4775278", "0.47607854", "0.47580233", "0.4738817", "0.47330377", "0.47167677", "0.47146964", "0.46991527", "0.4684027", "0.46821308", "0.4671888", "0.466808", "0.4664132", "0.46491367", "0.46488288", "0.46443784", "0.46433434", "0.46377346", "0.46346363", "0.46298426", "0.461196", "0.460759", "0.45933363", "0.45873144", "0.4586966", "0.458695", "0.4581464", "0.45811817", "0.45800212", "0.45724586", "0.45699388", "0.45650727", "0.45583433", "0.45487258", "0.4547205", "0.45442247", "0.4539603", "0.45391694", "0.45259473", "0.45252743", "0.4521429", "0.44997233", "0.44866928", "0.44833964", "0.44828185", "0.4474818", "0.44616893", "0.44552076", "0.44448543", "0.44442326", "0.44438848", "0.44429174", "0.44370824", "0.44244158", "0.44216454", "0.44212663", "0.44189894", "0.44144812", "0.44134307", "0.44002822", "0.43960443", "0.43930873", "0.43916586" ]
0.77619076
0
Dispatches a workflow process so that it can be picked up by the workflow process runner
public function dispatchProcess(WorkflowProcess $workflowProcess, string $queue = 'default'): WorkflowProcess { // Identify the workflow run as being dispatched $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::DISPATCHED; $workflowProcess->save(); // Dispatch the workflow run WorkflowProcessRunnerJob::dispatch($workflowProcess)->onQueue($queue); WorkflowProcessDispatched::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function flow() {\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "public static function workflowActions();", "protected abstract function executeProcess();", "protected function initializeProcessAction() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "public function triggerEvent(AbstractWorkflowEvent $workflowEvent): Collection\n {\n // track the workflow runs that we are going to be dispatching\n $workflowProcessCollection = collect();\n\n /**\n * Find all workflows that are active and have a workflow event that matches the event that was triggered\n */\n Workflow::query()\n ->active()\n ->forEvent($workflowEvent)\n ->each(function (Workflow $workflow) use (&$workflowProcessCollection, $workflowEvent) {\n // Create the run\n $workflowProcess = $this->createWorkflowProcess($workflow, $workflowEvent);\n\n // Dispatch the run so that it can be processed\n $this->dispatchProcess($workflowProcess, $workflowEvent->getQueue());\n\n // Identify that the workflow run was spawned by the triggering of the event\n $workflowProcessCollection->push($workflowProcess);\n });\n\n // Return all the workflow runs that were spawned by the triggering of the event\n return $workflowProcessCollection;\n }", "protected function executeAction()\n {\n $this->triggerEvent( __FUNCTION__ . '.pre');\n if ($this->flowEvaluator->executeActionInFlow()) {\n $this->triggerEvent(__FUNCTION__ . '.success');\n $this->manageExecutedAction();\n } else {\n $this->triggerEvent(__FUNCTION__ . '.fail');\n }\n $this->triggerEvent( __FUNCTION__ . '.post');\n }", "public function process() {}", "public function process() {}", "public function process() {}", "public function process() {}", "public function process() {\n\t\t$action = $this->get_action();\n\n\t\t$result = $this->$action();\n\n\t\t$this->set_processed_item( $result );\n\n\t\treturn $result;\n\t}", "public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}", "protected function process()\n {}", "public function main(&$dbh)\r\n\t{\r\n\t\t$this->numProcessed = 0; // reset counter\r\n\r\n\t\t// Do not close database handle if we are functioning in test mode\r\n\t\tif ($this->testMode)\r\n\t\t\t$this->closeDbh = false;\r\n\r\n\t\t$result = $dbh->Query(\"select id, action_id, instance_id from workflow_action_schedule where ts_execute <= now() and inprogress='0'\");\r\n\t\t$num = $dbh->GetNumberRows($result);\r\n\t\tfor ($i = 0; $i < $num; $i++)\r\n\t\t{\r\n\t\t\t$row = $dbh->GetNextRow($result, $i);\r\n\r\n\t\t\tif (!WorkFlow::instanceActInProgress($dbh, $row['id']))\r\n\t\t\t{\r\n\t\t\t\t$obj = WorkFlow::getInstanceObj($dbh, $row['instance_id']);\r\n\t\t\t\tif ($obj->getValue(\"f_deleted\") != 't')\r\n\t\t\t\t{\r\n\t\t\t\t\t$act = new WorkFlow_Action($dbh, $row['action_id']);\r\n\t\t\t\t\t$wf = new WorkFlow($dbh, $act->workflow_id);\r\n\t\t\t\t\t$act->execute($obj);\r\n\t\t\t\t\t$this->numProcessed++;\r\n\t\t\t\t\tif ($this->testMode)\r\n\t\t\t\t\t\t$this->actionsProcessed[] = $row['action_id'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Clear scheduled action\r\n\t\t\t\t$dbh->Query(\"delete from workflow_action_schedule where id='\".$row['id'].\"'\");\r\n\r\n\t\t\t\t// Set the status of this instance to finished if all actions are done\r\n\t\t\t\t$wf->updateStatus($row['instance_id']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$dbh->FreeResults($result);\r\n\r\n\t\t$this->runDailyWorkflows($dbh);\r\n\r\n\t\treturn true;\r\n\t}", "public function dispatch()\n\t{\n\t\t$this->{$this->_action}();\n\t}", "public function process(): void\n\t{\n\t\tforeach ($this->getActions() as $action) {\n\t\t\t$class = \"App\\\\Mail\\\\ScannerAction\\\\{$action}\";\n\t\t\t(new $class($this))->process();\n\t\t}\n\t}", "public abstract function process();", "public function process() {\n }", "public function process() {\n }", "public function process() {\n }", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "public static function process() {}", "protected abstract function process();", "abstract protected function _process();", "abstract protected function _process();", "public function dispatch();", "public function dispatch();", "public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}", "public function execute(Process $process);", "private static function proccess()\n {\n $files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];\n $folder = static::$root.'Processes'.'/';\n\n self::call($files, $folder);\n\n $files = ['TranslatorFolderNeededException', 'TranslatorManyFolderException'];\n $folder = static::$root.'Processes/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function process();", "public function process();", "public function process();", "public function process();", "protected function taskRun($spacer = \"\") {\n\t\techo \"{$spacer}Running workflows:\\n\";\n\t\t//\n\t\t// Shortcuts.\n\t\t$manager = \\TooBasic\\Workflows\\WorkflowManager::Instance();\n\t\t//\n\t\t// Loading filters.\n\t\t$workflowName = isset($this->params->opt->{self::OPTION_WORKFLOW}) ? $this->params->opt->{self::OPTION_WORKFLOW} : false;\n\t\t//\n\t\t// Loading known workflow names.\n\t\t$knownWorkflows = $manager->knownWorkflows();\n\t\t//\n\t\t// Waking up workflows.\n\t\techo \"{$spacer}\\tWaking up items:\\n\";\n\t\tforeach($knownWorkflows as $name) {\n\t\t\t//\n\t\t\t// Filtering.\n\t\t\tif($workflowName && $workflowName != $name) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\n\t\t\t// Shaking the bed :)\n\t\t\techo \"{$spacer}\\t\\t- '{$name}': \";\n\t\t\t$manager->wakeUpItems($name);\n\t\t\techo Color::Green(\"Done\\n\");\n\t\t}\n\t\t//\n\t\t// Running workflows.\n\t\techo \"{$spacer}\\tRunning workflows:\\n\";\n\t\tforeach($knownWorkflows as $name) {\n\t\t\t//\n\t\t\t// Filtering.\n\t\t\tif($workflowName && $workflowName != $name) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//\n\t\t\t// Retrieving active flow for certain workflow.\n\t\t\techo \"{$spacer}\\t\\tObtaining active flows for '{$name}': \";\n\t\t\t$flows = $manager->activeFlows(false, false, $name);\n\t\t\t$countFlows = count($flows);\n\t\t\techo Color::Green(\"{$countFlows}\\n\");\n\t\t\t//\n\t\t\t// Running active flows.\n\t\t\tif($countFlows) {\n\t\t\t\techo \"{$spacer}\\t\\tRunning flows for '{$name}':\\n\";\n\t\t\t\tforeach($flows as $flow) {\n\t\t\t\t\techo \"{$spacer}\\t\\t\\tRunning item '{$flow->type}:{$flow->item}' on workflow '{$flow->workflow}': \";\n\t\t\t\t\tif($manager->run($flow)) {\n\t\t\t\t\t\techo Color::Green(\"Done\\n\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo Color::Red(\"Failed\\n\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function executeRequest() {\n $this->splitURL();\n $this->validateRequest();\n\n // Create controller to dispatch our request, eg new BlogsController\n // Note format eg $dispatch = new BlogsController('Blog', 'blogs', 'index')\n $model = ucwords(rtrim($this->controller, 's'));\n $controller = ucwords($this->controller) . 'Controller';\n $dispatch = new $controller($model, $this->controller, $this->action);\n\n // Execute\n if (!isset($this->parameter1)) {\n call_user_func(array($dispatch, $this->action));\n } else if (!isset($this->parameter2)) {\n call_user_func(array($dispatch, $this->action), $this->parameter1);\n } else if (!isset($this->parameter3)) {\n call_user_func(array($dispatch, $this->action), $this->parameter1, $this->parameter2);\n } else {\n call_user_func(array($dispatch, $this->action), $this->parameter1, $this->parameter2, $this->parameter3);\n }\n }", "public function processAction()\n {\n $env = $this->getEnvironment();\n $this->setProcessTitle('IcingaDB Event Stream: ' . $env->get('name'));\n $handler = new IcingaEventHandler($env);\n $handler->processEvents();\n }", "public function process() {\r\n if(!in_array($this->getRouter()->getAction(), $this->getAllowActions()) || $this->getRouter()->getAction() == null) {\r\n $this->defaultAction();\r\n } else {\r\n $customAction = $this->getRouter()->getAction().Globals::getConfig()->action->suffix;\r\n $this->$customAction();\r\n }\r\n }", "public function process() {\n // on va lui passer le contexte en premier paramètre\n // puis on va lui passer les paramètres du path comme\n // paramètres supplémentaires\n $args = array_merge(\n array($this->_context),\n $this->_context->route->params\n );\n\n $this->_context->require_part('controller', $this->controller);\n $controller = new $this->controller;\n\n // CALL STAGES BEFORE ACTION\n\n $stages = array(\n '_before_action'\n );\n\n $_response = null;\n $responses_stack = array();\n\n foreach($stages as $stage) {\n $_response = $this->call_stage($controller,$stage,$this->action, $responses_stack);\n\n // Si on obtient un objet de type Response, on stoppe\n\n if($_response instanceof Response) {\n return $this->output($_response); // ! RETURN\n }\n else {\n $responses_stack[$stage] = $_response;\n }\n }\n\n\n // CALL ACTION\n if(! method_exists($controller, $this->action)) {\n throw new \\InvalidArgumentException('Action '.$this->action.' does not exists in controller '. get_class($controller));\n }\n $action_response = call_user_func_array(array($controller, $this->action), $args);\n\n if($action_response instanceof Response) {\n return $this->output($action_response); // ! RETURN\n }\n\n\n if(is_null($action_response)) {\n // si la réponse est nulle, on ne fait rien tout simplement\n //@todo : faire autre chose, envoyer un 204 ?\n $class = get_class($controller);\n r(\"@todo : empty $class return\");\n return; // ! RETURN\n }\n elseif(is_string($action_response)) {\n $response = new Response($action_response, $headers=array());\n return self::output($response); // ! RETURN\n }\n\n\n }", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "abstract protected function process();", "abstract public function put__do_process ();", "public function process()\n {\n\n }", "protected function _run()\n\t{\n\t\t$this->_oBootstrap->beforeRoute(self::$_oInstance, $this->_oDispatcher);\n\t\t//Begin Route\n\t\tRouter::BeginRoute($this->_oRequest);\n\t\t//After Route\n\t\t$this->_oBootstrap->afterRoute(self::$_oInstance, $this->_oDispatcher);\n\n\t\t//Dispatcher Initialize\n\t\t$this->_oDispatcher = Dispatcher::GetInstance();\n\n\n\t\t//Prepare to Begin Dispatch\n\t\t$this->_oBootstrap->beforeDispatch(self::$_oInstance, $this->_oDispatcher);\n\t\t//Dispatch\n\t\t$this->_oDispatcher->dispatch();\n\t\t//After Dispatch\n\t\t$this->_oBootstrap->afterDispatch(self::$_oInstance, $this->_oDispatcher);\n\n\t\t//Output Result\n\t\t$this->_oDispatcher->outputResult();\n\t}", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "function process() {\r\n }", "public function dispatch() {\n $provider = (string)$this->cli_args['_DEFAULT'][1];\n $action = (string)$this->cli_args['_DEFAULT'][2];\n\n if (isset($this->cli_args['--debug'])) {\n restore_exception_handler();\n restore_error_handler();\n }\n\n if (!$provider) {\n $this->cli_echo(\n 'No command provided - please specify one of the following commands:'\n . PHP_EOL,\n true\n );\n echo implode(PHP_EOL, $this->providerInfo->getProviders()) . PHP_EOL;\n\n return;\n }\n\n $instance = $this->providerInfo->getProviderInstance($provider);\n $instance->init($this->cli_args);\n $instance->run($action);\n }", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }", "abstract public function process();", "abstract public function process();", "abstract public function process();", "public function preDispatch()\n {\n //...\n }", "public function getWorkflowObject();", "public function run()\n {\n\t\t// Check for request forgeries.\n\t\tJSession::checkToken() or die(JText::_('JINVALID_TOKEN'));\n\n\t\t// Get items to remove from the request.\n\t\t$cid = $this->input->get('cid', array(), 'array');\n\n\t\t// Initialise variables.\n\t\t$values\t= array('runall' => 1, 'run' => 0);\n\t\t$task\t= $this->getTask();\n\t\t$value\t= JArrayHelper::getValue($values, $task, 0, 'int');\n \n // If we want to process everything, then reset the $cid array.\n if ($value)\n {\n $cid = array();\n }\n\n\t\t// Get the document object.\n\t\t$document\t= JFactory::getDocument();\n\t\t$vName\t\t= 'processes';\n\t\t$vFormat\t= 'html';\n\n\t\t// Get and render the view.\n\t\tif ($view = $this->getView($vName, $vFormat))\n\t\t{\n\t\t\t// Get the model for the view.\n\t\t\t$model = $this->getModel($vName);\n\n\t\t\t// Push the model into the view (as default).\n\t\t\t$view->setModel($model, true);\n\n\t\t\t// Push document object into the view.\n\t\t\t$view->document = $document;\n\n\t\t\t$view->run($cid);\n\t\t}\n }", "public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }", "protected function executeSpecificStep() {}", "public function dispatch(): void {}", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function testComAdobeGraniteWorkflowCoreJobExternalProcessJobHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.workflow.core.job.ExternalProcessJobHandler';\n\n $crawler = $client->request('POST', $path);\n }", "function dispatch($arg_pid, $arg_input)\n{\n\t$arg_input['master_controller_process_id'] = $arg_pid;\n\n\t$dropfile_path\t\t= 'dropfiles/' . $arg_pid . '-' . time() . '.dat';\n\t\n\t$dropfile_handle\t= fopen($dropfile_path, 'w+');\n\tfwrite($dropfile_handle, serialize($arg_input));\n\tfclose($dropfile_handle);\n\n\t$pid \t\t\t\t= phenExec('php ./dispatch.php ' . $dropfile_path);\n\n\t$dropfile_payload\t= unserialize(file_get_contents($dropfile_path));\n\tunlink($dropfile_path);\n\n\treturn $dropfile_payload;\n}", "public function doAction() : void {\n $this->doJob();\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "public function execute( $process, $event ) {\n if( eZSys::isShellExecution() ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $parameters = $process->attribute( 'parameter_list' );\n if( isset( $parameters['order_id'] ) === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n $order = eZOrder::fetch( $parameters['order_id'] );\n if( $order instanceof eZOrder === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $check = eZOrderItem::fetchListByType( $order->attribute( 'id' ), 'siteaccess' );\n if( count( $check ) > 0 && $order->attribute( 'is_temporary' ) && $process->ParameterList['trigger_name'] != 'post_checkout' ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n if( count( $check ) > 0 ) {\n foreach( $check as $item ) {\n $item->remove();\n }\n }\n\n $orderItem = new eZOrderItem(\n array(\n 'order_id' => $order->attribute( 'id' ),\n 'description' => $GLOBALS['eZCurrentAccess']['name'],\n 'price' => 0,\n 'type' => 'siteaccess',\n 'vat_is_included' => true,\n 'vat_type_id' => 1\n )\n );\n $orderItem->store();\n\n return eZWorkflowType::STATUS_ACCEPTED;\n }", "public function preDispatch();", "public function preDispatch() { }", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}", "final function execute($request) {\t\t\n\t\t// Forward the action to execute page-specific logic\n\t\t$this->doExecute($request);\n\t}", "public function job_app_process()\n\t{\n\t\t// Because the loads a page we dont need to return anything\n\t\t$this->EE->job_applications->job_app_process();\n\t}", "public function perform()\n {\n foreach ($this->actions as $action) {\n $action->perform();\n }\n }", "public function process(string $controller, string $action, array $parameters, CoreInterface $core);", "private function marketingPromoWorkflowRun($order_id)\n {\n $order = new shopOrder($order_id);\n $workflow = new shopMarketingPromoWorkflow($order);\n $workflow->run();\n }", "function execute($process, $event)\n {\n $returnStatus = eZWorkflowType::STATUS_ACCEPTED;\n\n $parameters = $process->attribute('parameter_list');\n $object = eZContentObject::fetch($parameters['object_id']);\n\n if (!$object) {\n eZDebugSetting::writeError('extension-workflow-changeobjectdate', 'The object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n }\n\n // if a newer object is the current version, abort this workflow.\n $currentVersion = $object->attribute('current_version');\n $version = $object->version($parameters['version']);\n\n if (!$version) {\n eZDebugSetting::writeError('The version of object with ID ' . $parameters['object_id'] . ' does not exist.', 'OCChangeObjectDateType::execute() object version is unavailable');\n return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;\n\n }\n\n $objectAttributes = $version->attribute('contentobject_attributes');\n\n $changeDateObject = $this->workflowEventContent($event);\n\n $publishAttributeArray = (array)$changeDateObject->attribute('publish_attribute_array');\n $futureDateStateAssign = $changeDateObject->attribute('future_date_state');\n $pastDateStateAssign = $changeDateObject->attribute('past_date_state');\n\n $publishAttribute = false;\n\n foreach ($objectAttributes as $objectAttribute) {\n $contentClassAttributeID = $objectAttribute->attribute('contentclassattribute_id');\n if (in_array($contentClassAttributeID, $publishAttributeArray)) {\n $publishAttribute = $objectAttribute;\n }\n }\n\n if ($publishAttribute instanceof eZContentObjectAttribute && $publishAttribute->attribute('has_content')) {\n $date = $publishAttribute->attribute('content');\n if ($date instanceof eZDateTime || $date instanceof eZDate) {\n $object->setAttribute('published', $date->timeStamp());\n $object->store();\n if ($date->timeStamp() > time()){\n if ($futureDateStateAssign instanceof eZContentObjectState) {\n $object->assignState($futureDateStateAssign);\n }\n }elseif($pastDateStateAssign instanceof eZContentObjectState){\n $object->assignState($pastDateStateAssign);\n }\n if ($parameters['trigger_name'] != 'pre_publish') {\n eZContentOperationCollection::registerSearchObject($object->attribute('id'), $object->attribute('current_version'));\n }\n eZDebug::writeNotice('Workflow change object publish date', __METHOD__);\n }\n }\n\n return $returnStatus;\n }", "protected function executeAction() {\n \n }", "abstract protected function _dispatch(Manager $manager);", "function process_action($target, $action) {\n //implement if needed\n }", "protected function run(Process $process) {\n\t}", "protected function run(Process $process) {\n\t}", "function performAction($action)\n{\n\trequire_once(SITE_DIR.'_classes/_factory/_ActionFactory.php');\n\t$action = ActionFactory::createAction($action);\n\t$result = $action->execute();\n}", "public function setWorkflow(Workflow $workflow);", "public function _Process() {\r\n $ajax_action = $_REQUEST['ajax_action'];\r\n // Retrieve the flag action\r\n $ajax_code = $_REQUEST['ajax_code'];\r\n // Determine which action to take\r\n switch ($ajax_action) {\r\n case 'save' : $this->_AJAX_Save(); break;\r\n }\r\n }", "public function process() {\n\n require_once 'libs/Auth.php';\n $username = \"\";\n $userId = -1;\n\n if(Auth::isAuthorized()) {\n $userId = Auth::userId();\n require_once 'models/User.php';\n $user = new User($userId);\n $username = $user->username();\n }\n\n $this->setVar('username', $username);\n $this->setVar('userId', $userId);\n\n require_once 'models/Job.php';\n\n $jobId = $this->param();\n\n $job = new Job($jobId);\n\n $skills = $job->skills();\n\n $skillString = \"\";\n foreach($skills as $skill) {\n $skillString .= $skill . \" \";\n }\n\n $jobArray = Array();\n\n $jobArray['id'] = $job->id();\n\n $this->setVar('jobArray', $jobArray);\n $this->setVar('seekers', $job->interestedSeekers());\n $this->setVar('jobPosterId', $job->postedById());\n }", "final public function perform()\n {\n $this->execute($this->args, $this->app);\n }", "public function preDispatch()\n {\n\n }", "public function dispatch ()\n {\n\n try\n {\n\n // initialize the controller\n $this->initialize();\n\n // get the application context\n $context = $this->getContext();\n\n // determine our module and action\n $moduleName = $context->getRequest()\n ->getParameter(MO_MODULE_ACCESSOR);\n\t\t\t\n\n $actionName = $context->getRequest()\n ->getParameter(MO_ACTION_ACCESSOR);\n\n if ($moduleName == null)\n {\n\n // no module has been specified\n $moduleName = MO_DEFAULT_MODULE;\n\n }\n\n if ($actionName == null)\n {\n\n // no action has been specified\n if ($this->actionExists($moduleName, 'Index'))\n {\n\n // an Index action exists\n $actionName = 'Index';\n\n } else\n {\n\n // use the default action\n $actionName = MO_DEFAULT_ACTION;\n\n }\n\n }\n\n // make the first request\n $this->forward($moduleName, $actionName);\n\n } catch (MojaviException $e)\n {\n\n $e->printStackTrace();\n\n } catch (Exception $e)\n {\n\n // most likely an exception from a third-party library\n $e = new MojaviException($e->getMessage());\n\n $e->printStackTrace();\n\n }\n\n }", "protected function beforeProcess() {\n }", "public function postDispatch()\n {\n //...\n }", "public function Process() {\n\t\tforeach($this->modules as $module) {\n\t\t\t$module->Run();\n\t\t}\n\t}", "public function action()\n {\n foreach ($this->actions as $action) {\n $action->run();\n }\n }", "public function execute($request)\n {\n // dispatch action\n $actionToRun = 'execute' . ucfirst($this->getActionName());\n\n if ($actionToRun === 'execute') {\n // no action given\n throw new sfInitializationException(sprintf('sfAction initialization failed for module \"%s\". There was no action given.',\n $this->getModuleName()));\n }\n\n if ( ! is_callable([$this, $actionToRun])) {\n // action not found\n throw new sfInitializationException(sprintf('sfAction initialization failed for module \"%s\", action \"%s\". You must create a \"%s\" method.',\n $this->getModuleName(), $this->getActionName(), $actionToRun));\n }\n\n if (sfConfig::get('sf_logging_enabled')) {\n $this->dispatcher->notify(new sfEvent($this, 'application.log',\n [sprintf('Service::call \"%s->%s()\"', get_class($this), $actionToRun)]));\n }\n\n // run action injecting dependencies with Service::call() functionality\n /** @var ServiceContainer $serviceContainer */\n $serviceContainer = $this->context->getServiceContainer();\n $isolatedActionServiceContainer = new IsolatedServiceContainer($serviceContainer);\n\n $isolatedActionServiceContainer->instance('request', $request);\n $isolatedActionServiceContainer->alias('request', sfWebRequest::class);\n\n if ($this instanceof BootableController) {\n $this->boot($isolatedActionServiceContainer);\n }\n\n try {\n $ret = $isolatedActionServiceContainer->call(\n [$this, $actionToRun],\n array_merge($request->getGetParameters(), $request->getRequestParameters(), ['request' => $request])\n );\n\n return $this->handleSpecialReturns($ret, get_class($this) . '::' . $actionToRun);\n\n\n } catch (Exception $e) {\n if ($this instanceof ErrorHandlingController) {\n $ret = $this->onError($e, $request); // you can handle error correctly: just return non-null value\n if ($ret !== null) {\n return $this->handleSpecialReturns($ret, get_class($this) . '::' . $actionToRun);\n }\n }\n\n if ($e instanceof PropelEntityAccessRestrictedException) {\n $this->logMessage($e->getMessage(), 'err');\n // show \"Forbidden\" page\n return $this->forward(sfConfig::get('sf_secure_module'), sfConfig::get('sf_secure_action'));\n\n } elseif ($e instanceof EntityNotFoundException) {\n $this->logMessage($e->getMessage(), 'err');\n return $this->forward404($e->getMessage());\n }\n\n throw $e;\n }\n }" ]
[ "0.6358178", "0.6141235", "0.6011078", "0.57677424", "0.56934416", "0.56934416", "0.56934416", "0.56934416", "0.5683946", "0.5669635", "0.56675583", "0.5667122", "0.5667122", "0.5667122", "0.5603712", "0.55648357", "0.55511266", "0.552396", "0.55200857", "0.55185574", "0.5502637", "0.5496218", "0.5496218", "0.5496218", "0.54605705", "0.5459793", "0.5459793", "0.5459793", "0.54537225", "0.5448363", "0.54473436", "0.54473436", "0.54436123", "0.54436123", "0.540934", "0.5390178", "0.53763515", "0.5375406", "0.5375406", "0.5375406", "0.5375406", "0.53693396", "0.5358026", "0.5357824", "0.5326779", "0.5310594", "0.53035796", "0.53035796", "0.53035796", "0.53035796", "0.5302694", "0.52999526", "0.5288758", "0.5273631", "0.5270406", "0.5267143", "0.52573985", "0.5252188", "0.52451783", "0.52451783", "0.52451783", "0.5243055", "0.5222372", "0.5219179", "0.52104217", "0.5207301", "0.5205216", "0.51802635", "0.5178973", "0.51738065", "0.5170975", "0.5163274", "0.5156797", "0.5153738", "0.51408607", "0.51378685", "0.51369756", "0.5128134", "0.5127259", "0.51201355", "0.51125306", "0.51104647", "0.50956255", "0.50953454", "0.5094813", "0.5091421", "0.50828063", "0.50828063", "0.50745285", "0.5074396", "0.5073875", "0.50728196", "0.5068283", "0.5057706", "0.5050075", "0.5037413", "0.5034157", "0.50331336", "0.50153244", "0.49967885" ]
0.5146817
74
Pauses a workflow process so that it won't be picked up by the workflow process runner
public function pauseRun(WorkflowProcess $workflowProcess): WorkflowProcess { if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) { throw new \Exception('Workflow run is not pending'); } $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PAUSED; $workflowProcess->save(); WorkflowProcessPaused::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function pauseWorking(){\r\n\r\n }", "public function pause();", "public function pause()\n\t{\n\t\t$this->data->directSet(\"state\", self::STATE_PAUSED);\n\t}", "public function pause() {\n $this->setRunningPaused( false, true );\n $this->pauseTime = $this->getCurrentTime();\n }", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "abstract protected function doSuspend();", "public function resumeRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PAUSED) {\n throw new \\Exception('Workflow run is not paused');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PENDING;\n $workflowProcess->save();\n\n WorkflowProcessResumed::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "public function pause() {\n if ($this->getLigado() && $this->getTocando()) {\n $this->setTocando(false);\n }\n }", "function pause() { \n\t\t\n\t\tif ($this->XBMCCmd(\"Pause\")!=\"OK\") { return false; }\n return true;\n\n\t}", "public function resume();", "public function unPause() {\n $this->setRunningPaused( true, false );\n $this->totalPauseTime = $this->getCurrentTime() - $this->pauseTime;\n $this->pauseTime = 0;\n }", "public function actionPause($at=false,$in=false)\n {\n // Pause the competition $in number of seconds from now\n }", "function VM_pauseVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" pause\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function pause(){\n\t\tsession_write_close();\n\t}", "public function stopProcess() {\n // Do not change the status of an idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_STOPPING))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }", "public function isPaused();", "function paused_themes_notice()\n {\n }", "public function pause(Timer $timer);", "public function paused_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'paused_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function pauseQueue()\n {\n return $this->sendrequest('pause', null);\n }", "function pause()\n {\n session_write_close();\n }", "abstract protected function doResume();", "protected function killProcess(): void\n {\n if (($pid = $this->getAttribute('pid')) === null) {\n return;\n }\n\n if ($this->systemCommands()->isProcessRunning($pid)) {\n $this->systemCommands()->killProcess($pid);\n }\n }", "public function obligePauseWhenNotCurrent()\n {\n $last_entry = $this->getLastEntry();\n\n //process only when the task is not current\n if (!$this->is_current()) {\n \n if (!in_array($last_entry->entry_type,['pause','end'])) {\n $this->build_error('Please the last entry type of this task must be: pause or end');\n }\n }\n }", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "function paused_plugins_notice()\n {\n }", "public function resetWorkflow()\n {\n $this->setWorkflowState('approved');\n $workflowHelper = new SurveyManager_Util_Workflow(ServiceUtil::getManager());\n $schemaName = $workflowHelper->getWorkflowName($this['_objectType']);\n $this['__WORKFLOW__'] = array(\n 'module' => 'SurveyManager',\n 'state' => $this['workflowState'],\n 'obj_table' => $this['_objectType'],\n 'obj_idcolumn' => 'id',\n 'obj_id' => 0,\n 'schemaname' => $schemaName);\n }", "public function proceed()\n {\n $this->transitionTo(new PaidState());\n }", "public function suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }", "public function console_pause() {\n echo PHP_EOL.\"Press ENTER to continue...\";\n fgetc(STDIN);\n }", "public function cancelRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::CANCELLED;\n $workflowProcess->save();\n\n WorkflowProcessCancelled::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "function killProcess($pid)\n{\n $mapper = systemToolkit::getInstance()->getMapper('process', 'process');\n $process = $mapper->searchOneByField('pid', $pid);\n if($process) {\n $mapper->delete($process);\n }\n}", "public function continue()\n {\n $this->run('run -i {id}');\n }", "public function resume(): bool {}", "function wp_skip_paused_themes(array $themes)\n {\n }", "public function resume(): bool;", "private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }", "function pause() {\n\n\t\tif (is_null($this->_httpq->pause())) { return false; }\n\t\treturn true;\n\n\t}", "function after_process() {\n return false;\n }", "function wp_paused_themes()\n {\n }", "public function setPause($value)\n {\n return $this->set(self::PAUSE, $value);\n }", "public static function stopPhantomDriver()\n {\n if (static::$phantomProcess) {\n static::$phantomProcess->stop();\n }\n }", "protected function stopTask() {}", "public function step():void\n\t{\n\t\t$this->ensureUnclosed();\n\t\t\n\t\tif( $this->_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_step();\n\t\t}\n\t\telse\n\t\tif( $this->_timeout_queue )\n\t\t{\n\t\t\t$this->_status= self::STATUSES['RUNNING'];\n\t\t\t\n\t\t\t$this->_stepTimeout();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( $this->_queue || $this->_timeout_queue )\n\t\t\t$this->_status= self::STATUSES['PAUSED'];\n\t\telse\n\t\t\t$this->_status= self::STATUSES['DONE'];\n\t}", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "public function pause($id)\n {\n return $this->sendrequest('pause', $id);\n }", "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "public function __sleep ();", "public function waitForWorkflow(string $site_name, string $env = 'dev') {\n $this->output()->write('Checking workflow status', true);\n\n exec(\n \"terminus workflow:info:status $site_name.$env\",\n $info\n );\n\n $info = $this->cleanUpInfo( $info );\n $this->output()->write( $info['workflow'], true );\n\n // Wait for workflow to finish only if it hasn't already. This prevents the workflow:wait command from unnecessarily running for 260 seconds when there's no workflow in progress.\n if ( $info['status'] !== 'succeeded' ) {\n $this->output()->write('Waiting for platform', true);\n exec(\n \"terminus build:workflow:wait --max=260 $site_name.$env\",\n $finished,\n $status\n );\n }\n\n if ($this->output()->isVerbose()) {\n \\Kint::dump(get_defined_vars());\n }\n $this->output()->writeln('');\n }", "public function setWorkflow(Workflow $workflow);", "public function __sleep();", "public function pause() { \n\t\t\n\t\tif (is_null($this->_mpd->Pause())) { return false; } \n\t\treturn true;\n\n\t}", "public function continue() : StateMachine;", "private function _loop():void\n\t{\n\t\twhile( true )\n\t\t\tif( $this->_status === self::STATUSES['PAUSED'] )\n\t\t\t\tbreak;\n\t\t\telse\n\t\t\tif( $this->_queue )\n\t\t\t\t$this->_step();\n\t\t\telse\n\t\t\tif( $this->_timeout_queue )\n\t\t\t\t$this->_stepTimeout();\n\t\t\telse\n\t\t\t\tbreak;\n\t}", "private function marketingPromoWorkflowRun($order_id)\n {\n $order = new shopOrder($order_id);\n $workflow = new shopMarketingPromoWorkflow($order);\n $workflow->run();\n }", "public function isPaused() {\n return $this->state->getCode() == TaskState::Paused;\n }", "public function sleep();", "public function sleep() {}", "function killProcess(string $id) : void\n {\n shell_exec(\"kill $id\");\n }", "function switchPromote()\n\t{\n\t\t$this->doPromote = true;\n\t}", "function reset_process(){ $this->model->closing(); }", "public function __sleep(){\n\n\t}", "function __sleep()\n {\n }", "public function clipWorkflow()\n {\n if ($this->id) {\n $tablename = $this->_table->getInternalTableName();\n Zikula_Workflow_Util::getWorkflowForObject($this, $tablename, 'id', 'Clip');\n\n } else {\n $this->mapValue('__WORKFLOW__', array('state' => 'initial'));\n }\n\n $this->mapValue('core_approvalstate', isset($this['__WORKFLOW__']['state']) ? $this['__WORKFLOW__']['state'] : null);\n }", "public function __sleep() {}", "function __sleep(){\n\n\t\t}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function stop()\n {\n $this->mark('__stop');\n }", "public function _break()\n {\n //set the internal execution flag to false, stopping execution\n $this->executing = false;\n }", "public function setProcess( $process )\n {\n \n $this->process = $process;\n \n }", "public function suspend()\n {\n if ($this->getState()->getMode() == View\\StateInterface::MODE_ENABLED) {\n $state = $this->getState();\n $state->setVersionId($this->getChangelog()->getVersion());\n $state->setStatus(View\\StateInterface::STATUS_SUSPENDED);\n $state->save();\n }\n }", "function doStopTourAction() {\n//\t\t$request = DevblocksPlatform::getHttpRequest();\n\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\tDAO_WorkerPref::set($worker->id, 'assist_mode', 0);\n\t\t\n//\t\tDevblocksPlatform::redirect(new DevblocksHttpResponse($request->path, $request->query));\n\t}", "public function reap()\n {\n // reap task process if zombied\n if (($r = \\pcntl_waitpid($this->pid, $status, WNOHANG)) > 0) {\n $this->exitStatus = \\pcntl_wexitstatus($status);\n $this->setEndTime();\n $this->task->finish($this->exitStatus);\n $this->dispatcher->dispatch(Event::EXIT, new Event($this));\n } else if ($r < 0) {\n throw new \\RuntimeException(\"pcntl_waitpid() returned error value for PID $pid\");\n } else {\n // force kill if this process is over max runtime\n if ($this->maxRuntime && (microtime(true) - $this->startTime) >= $this->maxRuntime) {\n $this->sendSignal(SIGKILL);\n throw new Exceptions\\RuntimeExceeded(\"Process with PID {$this->pid} has exceeded runtime, SIGKILL sent to process.\");\n }\n }\n }", "function curl_pause(CurlHandle $handle, int $bitmask): int {}", "protected static function _ignoreFrameworkResult() {\n Framework::getInstance()->stop(0);\n }", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "public function stop(): void;", "function process($status, $percent, $pid = \"auto\", $name = \"\")\n{\n $toolkit = systemToolkit::getInstance();\n $processMapper = $toolkit->getMapper('process', 'process');\n $process = false;\n if($pid != \"auto\") {\n $process = $processMapper->searchOneByField('pid', $pid);\n if(!$process) {\n if(function_exists('logMe')) {\n logMe(\"Can't find process with pid «{$pid}»!\", 4);\n }\n }\n }\n if(!$process) {\n $process = true;\n while(true) {\n $pid = rand(0,4294967294);\n $process = $processMapper->searchOneByField('pid', $pid);\n if(!$process) {\n break;\n }\n }\n $process = $processMapper->create();\n $process->setPid($pid);\n }\n $process->setName($name);\n $process->setModule($toolkit->getRequest()->getModule());\n $process->setAction($toolkit->getRequest()->getAction());\n $process->setUserId($toolkit->getUser()->getId());\n $process->setStatus($status);\n $process->setPercent((float)$percent);\n $processMapper->save($process);\n return $process->getPid();\n}", "public function proceed();" ]
[ "0.6602639", "0.64801884", "0.64335316", "0.6223136", "0.6181979", "0.6058795", "0.5940641", "0.5733628", "0.5661389", "0.56370306", "0.5621988", "0.5551616", "0.54525095", "0.54357296", "0.5428415", "0.54209805", "0.5347551", "0.52239305", "0.5220349", "0.5193789", "0.51699", "0.5152696", "0.51312333", "0.5077446", "0.5074625", "0.5035683", "0.50307965", "0.5020585", "0.4999154", "0.4987076", "0.49791822", "0.49716976", "0.4965056", "0.49478665", "0.49063593", "0.49030498", "0.4846664", "0.4818504", "0.4795085", "0.47890893", "0.47594503", "0.47530422", "0.4741914", "0.4724273", "0.47116566", "0.46897215", "0.4687319", "0.46747106", "0.46731248", "0.46710405", "0.4648195", "0.4648195", "0.4648195", "0.4648195", "0.46422467", "0.46364126", "0.46285528", "0.46186352", "0.4613856", "0.4604059", "0.4601185", "0.4564842", "0.4561309", "0.45589057", "0.45481208", "0.45463112", "0.45425048", "0.45378265", "0.4535045", "0.45182514", "0.4516937", "0.45160657", "0.45144996", "0.45142877", "0.45142877", "0.45142877", "0.45141977", "0.45141977", "0.45141977", "0.45141977", "0.45141977", "0.45141977", "0.45141977", "0.45141977", "0.45135623", "0.4511417", "0.45065048", "0.4503919", "0.45002392", "0.44872987", "0.44836077", "0.44767565", "0.4476429", "0.4475451", "0.4475451", "0.4475451", "0.4475451", "0.4475451", "0.4472145", "0.44716817" ]
0.6257278
3
Resumes a workflow process so that it can be picked up by the workflow process runner
public function resumeRun(WorkflowProcess $workflowProcess): WorkflowProcess { if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PAUSED) { throw new \Exception('Workflow run is not paused'); } $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PENDING; $workflowProcess->save(); WorkflowProcessResumed::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function doResume();", "public function resume();", "abstract protected function doResumeContext();", "public function resume () {\n if ($this->started) {\n $this->run = true;\n $this->lapTmstmp = now();\n\n } else {\n $this->restart();\n }\n }", "public function resume(): void\n {\n $this->tonClient->request(\n 'net.resume'\n )->wait();\n }", "public function resume(): bool;", "public function resume(): bool {}", "public function resumeQueue()\n {\n return $this->sendrequest('resume', null);\n }", "protected function resumeOrStartSession()\n {\n if (!$this->resumeSession()) {\n $this->manager->start();\n $this->load();\n }\n }", "public function resume($status = true)\n {\n $this->isEnabled = !$status ? $status : $this->storedStatus;\n $this->storedStatus = null;\n }", "public function resume(Timer $timer);", "function VM_resumeVM($type, $vmName)\n{\n\tswitch ($type)\n\t{\n\t\tcase VM_SW_VBOX:\n\t\t\t$cmd = \"VBoxManage controlvm \\\"$vmName\\\" resume\";\n\t\tbreak;\n\t}\n\treturn($cmd);\n}", "public function resume($id)\n {\n return $this->sendrequest('resume', $id);\n }", "public function resume(array $inputData = array()) {\n if ($this->id === null) {\n throw new ExecutionException('No execution id given.');\n }\n\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = true;\n $this->suspended = false;\n\n $this->doResume();\n $this->loadFromVariableHandlers();\n\n $errors = array();\n\n foreach ($inputData as $variableName => $value) {\n if (isset($this->waitingFor[$variableName])) {\n if ($this->waitingFor[$variableName]['condition']->evaluate($value)) {\n $this->setVariable($variableName, $value);\n unset($this->waitingFor[$variableName]);\n } else {\n $errors[$variableName] = (string) $this->waitingFor[$variableName]['condition'];\n }\n }\n }\n\n if (!empty($errors)) {\n throw new InvalidInputException($errors);\n }\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionResumed($this);\n }\n\n $this->execute();\n\n // Return execution ID if the workflow has been suspended.\n if ($this->isSuspended()) {\n // @codeCoverageIgnoreStart\n return $this->id;\n // @codeCoverageIgnoreEnd\n }\n }", "public function continue()\n {\n $this->run('run -i {id}');\n }", "public function testResumeException()\n\t{\n\t\t// No Petri net set.\n\t\t$this->object->start();\n\t}", "public function init() {\n\t\tif ($this->workflowActivitySpecification->isRunning()) {\n\t\t\t$this->workflowActivity->onRestore($this->runtimeContext);\n\t\t}\n\t}", "function campaignResume($cid) {\n $params = array();\n $params[\"cid\"] = $cid;\n return $this->callServer(\"campaignResume\", $params);\n }", "public static function resumeFlowExecution(\n &$flow, &$params, $actionId = null, $triggerLogId = null) {\n\n if (self::$_triggerDepth > self::MAX_TRIGGER_DEPTH) // ...have we delved too deep?\n return;\n\n if (isset($params['model']) &&\n (!is_object($params['model']) || !($params['model'] instanceof X2Model))) {\n // Invalid model provided\n return false;\n }\n\n // increment stack depth before doing anything that might call X2Flow::trigger()\n self::$_triggerDepth++;\n $result = self::_executeFlow($flow, $params, $actionId, $triggerLogId);\n self::$_triggerDepth--; // this trigger call is done; decrement the stack depth\n return $result;\n }", "public function resume($id)\n {\n list($response) = $this->resumeWithHttpInfo($id);\n return $response;\n }", "public function start() {\n\t\tif (!$this->isRunning()) {\n\t\t\t// start activity\n\t\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::RUNNING);\n\n\t\t\tif($this->runtimeContext)\n\t\t\t\t$this->workflowActivity->onStart($this->runtimeContext);\n\t\t}\n\n\t\t// activity is running, trigger onFlow event\n\t\tif($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "protected function resumeSession(): bool\n {\n if ($this->manager->getIsActive() || $this->manager->resume()) {\n $this->load();\n\n return true;\n }\n\n return false;\n }", "public function reopenInvoice() {\n\n $client = new \\app\\components\\OdooClient();\n $account_invoice_ids = $client->search(\"account.invoice\",\n [\n [\"state\", \"=\", \"open\"],\n [\"type\", \"=\", \"in_invoice\"],\n [\"journal_id\", \"=\", 22]\n ]);\n\n $result = $client->execute(\"account.invoice\", \"signal_workflow\",\n [\n $account_invoice_ids,\n \"invoice_cancel\"\n ]);\n\n print_r($result);\n\n }", "public function resume(Request $request)\n {\n $customer = $request->user()->customer;\n $subscription = $customer->subscription;\n\n if ($request->user()->customer->can('resume', $subscription)) {\n $subscription->resume();\n }\n\n // Redirect to my subscription page\n $request->session()->flash('alert-success', trans('messages.subscription.resumed'));\n return redirect()->action('AccountSubscriptionController@index');\n }", "public function clipWorkflow()\n {\n if ($this->id) {\n $tablename = $this->_table->getInternalTableName();\n Zikula_Workflow_Util::getWorkflowForObject($this, $tablename, 'id', 'Clip');\n\n } else {\n $this->mapValue('__WORKFLOW__', array('state' => 'initial'));\n }\n\n $this->mapValue('core_approvalstate', isset($this['__WORKFLOW__']['state']) ? $this['__WORKFLOW__']['state'] : null);\n }", "public function continue() : StateMachine;", "public function resume($params=array()) {\n $this->curPos = isset($params['lastItem'])? $params['lastItem'] : 'xxx';\n if(isset($params['itemCount'])) $this->count = $params['itemCount'];\n\n }", "public function resetWorkflow()\n {\n $this->setWorkflowState('approved');\n $workflowHelper = new SurveyManager_Util_Workflow(ServiceUtil::getManager());\n $schemaName = $workflowHelper->getWorkflowName($this['_objectType']);\n $this['__WORKFLOW__'] = array(\n 'module' => 'SurveyManager',\n 'state' => $this['workflowState'],\n 'obj_table' => $this['_objectType'],\n 'obj_idcolumn' => 'id',\n 'obj_id' => 0,\n 'schemaname' => $schemaName);\n }", "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "public function pauseRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PAUSED;\n $workflowProcess->save();\n\n WorkflowProcessPaused::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function process(&$state) {\n\t\tassert('is_array($state)');\n\n\t\tif (!isset($state['Source']['entityid'])) {\n\t\t\tSimpleSAML_Logger::warning('saml:CDC: Could not find IdP entityID.');\n\t\t\treturn;\n\t\t}\n\n\t\t/* Save state and build request. */\n\t\t$id = SimpleSAML_Auth_State::saveState($state, 'cdc:resume');\n\n\t\t$returnTo = SimpleSAML_Module::getModuleURL('cdc/resume.php', array('domain' => $this->domain));\n\n\t\t$params = array(\n\t\t\t'id' => $id,\n\t\t\t'entityID' => $state['Source']['entityid'],\n\t\t);\n\t\t$this->client->sendRequest($returnTo, 'append', $params);\n\t}", "function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)\n\t{\n\t\t$displayobject->update_basic('displaymodules','FALSE');\n\t\t$t_db_type\t\t= $sessionobject->get_session_var('targetdatabasetype');\n\t\t$t_tb_prefix\t= $sessionobject->get_session_var('targettableprefix');\n\t\t$s_db_type\t\t= $sessionobject->get_session_var('sourcedatabasetype');\n\t\t$s_tb_prefix\t= $sessionobject->get_session_var('sourcetableprefix');\n\n\t\t// Per page vars\n\t\t$start_at\t\t= $sessionobject->get_session_var('startat');\n\t\t$per_page\t\t= $sessionobject->get_session_var('perpage');\n\t\t$class_num\t\t= substr(get_class($this) , -3);\n\t\t$idcache \t\t= new ImpExCache($Db_target, $t_db_type, $t_tb_prefix);\n\t\t$ImpExData\t\t= new ImpExData($Db_target, $sessionobject, 'attachment');\n\t\t$dir \t\t\t= $sessionobject->get_session_var('attachmentsfolder');\n\t\t\n\t\t// Start the timing\n\t\tif(!$sessionobject->get_session_var(\"{$class_num}_start\"))\n\t\t{\n\t\t\t$sessionobject->timing($class_num , 'start' ,$sessionobject->get_session_var('autosubmit'));\n\t\t}\n\n\t\t// Get an array data\n\t\tif ($s_db_type == 'mysql')\n\t\t{\n\t\t\t$data_array = $this->get_source_data($Db_source, $s_db_type, \"{$s_tb_prefix}attachments\", 'attach_id', 0, $start_at, $per_page);\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$data_array = $this->get_phpbb3_attach($Db_source, $s_db_type, $s_tb_prefix, $start_at, $per_page);\n\t\t}\t\t\n\t\t\n\n\t\t$displayobject->print_per_page_pass($data_array['count'], $displayobject->phrases['attachments'], $start_at);\n\n\t\tforeach ($data_array['data'] as $import_id => $data)\n\t\t{\n\t\t\t\t$try = (phpversion() < '5' ? $ImpExData : clone($ImpExData));\n\n\t\t\t\tif(!is_file($dir . '/' . $data['physical_filename']))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now(\"<br /><b>{$displayobject->phrases['source_file_not']} </b> :: {$data['real_filename']}\");\n\t\t\t\t\t$sessionobject->add_error($import_id, $displayobject->phrases['attachment_not_imported'], $data['real_filename'] . ' - ' . $displayobject->phrases['attachment_not_imported_rem_1']);\n\t\t\t\t\t$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num. '_objects_failed') + 1 );\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$file = $this->vb_file_get_contents($dir . '/' . $data['physical_filename']);\n\n\t\t\t\t// Mandatory\n\t\t\t\t$try->set_value('mandatory', 'filename',\t\t\t\taddslashes($data['real_filename']));\n\t\t\t\t$try->set_value('mandatory', 'filedata',\t\t\t\t$file);\n\t\t\t\t$try->set_value('mandatory', 'importattachmentid',\t\t$import_id);\n\n\t\t\t\t// Non Mandatory\n\t\t\t\t$try->set_value('nonmandatory', 'userid',\t\t\t\t$idcache->get_id('user', $data['poster_id']));\n\t\t\t\t$try->set_value('nonmandatory', 'dateline',\t\t\t\t$data['filetime']);\n\t\t\t\t$try->set_value('nonmandatory', 'visible',\t\t\t\t'1');\n\t\t\t\t$try->set_value('nonmandatory', 'counter',\t\t\t\t$data['download_count']);\n\t\t\t\t$try->set_value('nonmandatory', 'filesize',\t\t\t\t$data['filesize']);\n\t\t\t\t$try->set_value('nonmandatory', 'postid',\t\t\t\t$data['post_msg_id']);\n\t\t\t\t$try->set_value('nonmandatory', 'filehash',\t\t\t\tmd5($file));\n\n\t\t\t\tif (!$file)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t// Check if object is valid\n\t\t\tif($try->is_valid())\n\t\t\t{\n\t\t\t\tif($try->import_attachment($Db_target, $t_db_type, $t_tb_prefix))\n\t\t\t\t{\n\t\t\t\t\t$displayobject->display_now('<br /><span class=\"isucc\"><b>' . $try->how_complete() . '%</b></span> ' . $displayobject->phrases['attachment'] . ' -> ' . $data['real_filename']);\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_done\",intval($sessionobject->get_session_var(\"{$class_num}_objects_done\")) + 1 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t\t$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_import_error'], $displayobject->phrases['attachment_error_rem']);\n\t\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['failed']} :: {$displayobject->phrases['attachment_not_imported']}\");\n\t\t\t\t}// $try->import_attachment\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sessionobject->add_session_var(\"{$class_num}_objects_failed\",intval($sessionobject->get_session_var(\"{$class_num}_objects_failed\")) + 1 );\n\t\t\t\t$sessionobject->add_error($Db_target, 'invalid', $class_num, $import_id, $displayobject->phrases['invalid_object'] . ' ' . $try->_failedon, $displayobject->phrases['invalid_object_rem']);\n\t\t\t\t$displayobject->display_now(\"<br />{$displayobject->phrases['invalid_object']}\" . $try->_failedon);\n\t\t\t}// is_valid\n\t\t\tunset($try);\n\t\t}// End foreach\n\n\t\t// Check for page end\n\t\tif ($data_array['count'] == 0 OR $data_array['count'] < $per_page)\n\t\t{\n\t\t\t$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));\n\t\t\t$sessionobject->remove_session_var(\"{$class_num}_start\");\n\n\t\t\t$displayobject->update_html($displayobject->module_finished($this->_modulestring,\n\t\t\t\t$sessionobject->return_stats($class_num, '_time_taken'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_done'),\n\t\t\t\t$sessionobject->return_stats($class_num, '_objects_failed')\n\t\t\t));\n\n\t\t\t$sessionobject->set_session_var($class_num , 'FINISHED');\n\t\t\t$sessionobject->set_session_var('module', '000');\n\t\t\t$sessionobject->set_session_var('autosubmit', '0');\n\t\t}\n\n\t\t$sessionobject->set_session_var('startat', $data_array['lastid']);\n\t\t$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));\n\t}", "public function resume_order_tracking() {\n global $wp, $wpdb;\n \n $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;\n if ($order_id) {\n WC_Gokeep_JS::get_instance()->resume_order( WC()->order_factory->get_order($order_id) );\n }\n }", "protected function restart()\n {\n $this->stop();\n $this->start();\n }", "public function resume(Auth $auth)\n {\n // do nothing\n }", "public function flow() {\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onFlow($this->runtimeContext);\n\t}", "public function unPauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'CONT received; resuming job processing');\n\t\t$this->paused = false;\n\t}", "public function pauseProcessing()\n\t{\n\t\t$this->logger->log(LogLevel::NOTICE, 'USR2 received; pausing job processing');\n\t\t$this->paused = true;\n\t}", "public function resumed_hook( $hook ) {\n\t\t$context = array(\n\t\t\t'event_hook' => $hook,\n\t\t);\n\n\t\t$this->info_message(\n\t\t\t'resumed_hook',\n\t\t\t$context\n\t\t);\n\t}", "public function actionResumelearning($id)\n {\n /*$model = Learning::find()->\n where(['module_id' => $id])->\n andwhere(['learner_id' => Yii::$app->user->getId()])->\n andwhere(['status' => 'shortlisted'])->\n one();\n $model->status = 'on-going';\n $model->save();\n */\n \n return $this->redirect(['view', 'id' => $id]);\n }", "public function restart()\n {\n $this->destroy();\n $this->start();\n }", "public function process() {\n\t\tif ($this -> request() -> get('req2') != 'view') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get experience\n\t\t$iResumeId = $this -> request() -> getInt('req3');\n\t\t$aExperience = Phpfox::getService(\"resume.experience\") -> getAllExperience($iResumeId);\n\n\t\t// Get working time period for each experience\n\t\tforeach ($aExperience as $iKey => $aExp) {\n\t\t\tif ($aExp['is_working_here']) {\n\t\t\t\t$aExp['end_month'] = date(\"m\");\n\t\t\t\t$aExp['end_year'] = date(\"Y\");\n\t\t\t}\n\t\t\t$iYearPeriod = $aExp['end_year'] - $aExp['start_year'];\n\t\t\t$iMonthPeriod = $aExp['end_month'] - $aExp['start_month'];\n\t\t\t\n\t\t\tif($iMonthPeriod < 0)\n\t\t\t{\n\t\t\t\t$iMonthPeriod = $iMonthPeriod + 12;\n\t\t\t\t$iYearPeriod = $iYearPeriod - 1;\n\t\t\t}\n\t\t\t\n\t\t\t$aExperience[$iKey]['period'] = \" \";\n\t\t\t\n\t\t\tif($iYearPeriod > 1)\n\t\t\t{\n\t\t\t\t$aExperience[$iKey]['period'] .= $iYearPeriod . \" \" . Phpfox::getPhrase(\"resume.years\") . \" \";\n\t\t\t}\n\t\t\telseif($iYearPeriod == 1)\n\t\t\t{\n\t\t\t\t$aExperience[$iKey]['period'] .= $iYearPeriod . \" \" . Phpfox::getPhrase(\"resume.lowercase_year\") . \" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($iMonthPeriod > 1)\n\t\t\t{\n\t\t\t\t$aExperience[$iKey]['period'] .= $iMonthPeriod . \" \" . Phpfox::getPhrase(\"resume.months\") . \" \";\n\t\t\t}\n\t\t\telseif($iMonthPeriod == 1)\n\t\t\t{\n\t\t\t\t$aExperience[$iKey]['period'] .= $iMonthPeriod . \" \" . Phpfox::getPhrase(\"resume.month\") . \" \";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this -> template() -> assign(array('aExperience' => $aExperience));\n\t}", "public function start()\n {\n // Update worker state and set it as running (not finished)\n // Do not change resume_token because campaign can be resumed and not started\n $this->update(['has_finished' => false]);\n // Return current instance for method chaining\n return $this;\n }", "public function suspend()\n {\n $this->cancelled = false;\n $this->ended = false;\n $this->resumed = false;\n $this->suspended = true;\n\n $this->saveToVariableHandlers();\n\n $keys = array_keys($this->variables);\n $count = count($keys);\n $handlers = $this->workflow->getVariableHandlers();\n\n for ($i = 0; $i < $count; $i++) {\n if (isset($handlers[$keys[$i]])) {\n unset($this->variables[$keys[$i]]);\n }\n }\n\n $this->doSuspend();\n\n foreach ($this->plugins as $plugin) {\n $plugin->afterExecutionSuspended($this);\n }\n }", "public function setResumeNasJobId($var)\n {\n GPBUtil::checkString($var, True);\n $this->resume_nas_job_id = $var;\n\n return $this;\n }", "public function restart(): void\n {\n $this->stop();\n $this->start();\n }", "public function restart() {\n\t\t$this->invoke(\"restart\");\n\t}", "public function setSettingsBlockSessionResume(?bool $value): void {\n $this->getBackingStore()->set('settingsBlockSessionResume', $value);\n }", "function vistaportal_education_previous($form, &$form_state) {\n $user = user_load($form_state['uid']);\n drupal_goto('preapp/identity' . $user -> uid);\n }", "public function setResume(?string $resume): self\n {\n $this->resume = $resume;\n\n return $this;\n }", "public function cancelRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::CANCELLED;\n $workflowProcess->save();\n\n WorkflowProcessCancelled::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "function beginNextStepInCollaborationProcess($iDocumentID, $iUserID) {\n\t\tglobal $default;\n\t\t$sql = $default->db;\n\t\t//get the current step\n\t\t//if the user is assigned to two or more roles, make sure we get the current\n\t\t//one by ordering by precedence\n $sQuery = \"SELECT FURL.id AS id, GFAT.precedence \" ./*ok*/\n\t\t\t\t\t\"FROM $default->groups_folders_approval_table AS GFAT \" . \n\t\t\t\t\t\"INNER JOIN $default->folders_user_roles_table AS FURL ON GFAT.id = FURL.group_folder_approval_id \" .\n\t\t\t\t\t\"WHERE document_id = ? AND FURL.user_id = ? AND done=0 \" . \n\t\t\t\t\t\"ORDER BY precedence ASC\";\n $aParams = array($iDocumentID, $_SESSION[\"userID\"]);\n\t\t$sql->query(array($sQuery, $aParams));\n\t\tif ($sql->next_record()) {\n\t\t\t//set it as done\n\t\t\t$oFolderUserRole = FolderUserRole::get($sql->f(\"id\"));\n\t\t\t$oFolderUserRole->setActive(false);\n\t\t\t$oFolderUserRole->setDone(true);\n\t\t\t$oFolderUserRole->setDateTime(getCurrentDateTime());\n\t\t\t$oFolderUserRole->update();\n\t\t\t//get it's sequence number\n\t\t\t$iCurrentSequenceNumber = $sql->f(\"precedence\");\n $sQuery = \"SELECT MIN(precedence) AS precedence \" . /*ok*/\n\t\t\t\t\t\t\"FROM $default->groups_folders_approval_table AS GFAT \" . \n\t\t\t\t\t\t\"INNER JOIN $default->folders_user_roles_table AS FURL ON GFAT.id = FURL.group_folder_approval_id \" . \n\t\t\t\t\t\t\"WHERE document_id = ? AND done = 0\";\n $aParams = array($iDocumentID);\n $sql->query(array($sQuery, $aParams));\n\t\t\tif ($sql->next_record()) {\n\t\t\t\tif ($sql->f(\"precedence\") != $iCurrentSequenceNumber) {\n\t\t\t\t\t//if there are no concurrent steps outstanding\n\t\t\t\t\t$iNextSequenceNumber = $sql->f(\"precedence\");\n\t\t\t\t\t$sQuery = \"SELECT FURL.id \" ./*ok*/\n\t\t\t\t\t\t\t\t\"FROM $default->groups_folders_approval_table AS GFAT \" . \n\t\t\t\t\t\t\t\t\"INNER JOIN $default->folders_user_roles_table AS FURL ON GFAT.id = FURL.group_folder_approval_id \" . \n\t\t\t\t\t\t\t\t\"WHERE document_id = ? AND precedence = ?\";\n $aParams = array($iDocumentID, $iNextSequenceNumber);\n $sql->query(array($sQuery, $aParams));\n\t\t\t\t\twhile ($sql->next_record()) {\n\t\t\t\t\t\t$oFolderUserRole = FolderUserRole::get($sql->f(\"id\"));\n\t\t\t\t\t\t$oFolderUserRole->setActive(true);\n\t\t\t\t\t\t$oFolderUserRole->update();\n\t\t\t\t\t\t$oFolderCollaboration = FolderCollaboration::get($oFolderUserRole->getGroupFolderApprovalID());\n\t\t\t\t\t\t//get the role the user must perform\n\t\t\t\t\t\t$oRole = Role::get($oFolderCollaboration->getRoleID());\n\t\t\t\t\t\t//get the user to email\n\t\t\t\t\t\t$oUser = User::get($oFolderUserRole->getUserID());\n\t\t\t\t\t\tif ($oUser->getEmailNotification()) {\n $oDocument = & Document::get($iDocumentID);\n\t\t\t\t\t\t\t$sBody = $oUser->getName() . \", your role of '\" . $oRole->getName() . \"' in the document, '\" . $oDocument->getName() . \"' collaboration process is now active. \" .\n \"Click \" . generateLink(\"/presentation/lookAndFeel/knowledgeTree/documentmanagement/viewBL.php\", \"fDocumentID=$iDocumentID\", \"here\") . \" to access \" .\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"the document\";\n\t\t\t\t\t\n\t\t\t\t\t\t\t$oEmail = & new Email();\n\t\t\t\t\t\t\t$oEmail->send($oUser->getEmail(), \"Document collaboration role active\", $sBody);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDocumentCollaboration::createDependantDocuments($oFolderUserRole);\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn false;\n\t}", "public function suspend()\n {\n if ($this->getState()->getMode() == View\\StateInterface::MODE_ENABLED) {\n $state = $this->getState();\n $state->setVersionId($this->getChangelog()->getVersion());\n $state->setStatus(View\\StateInterface::STATUS_SUSPENDED);\n $state->save();\n }\n }", "public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }", "public function resumeContextAccess(AccountInterface $account);", "public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeActive', array(\n 'title' => t('Reactivate recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "public function getResumeContextResponse();", "public function update(Request $request, Resume $resume)\n {\n //\n }", "public function testResumeMember()\n {\n }", "public static function resume(mixed $task = WatchFactory::DEFAULT_WATCH): bool\n {\n return static::getFacadeRoot()->resume($task);\n }", "abstract protected function doSuspend();", "public function backToPreviousPartitionStep()\n\t{\n\t\t// Get the previous partition steps and wanted partitioning from the last action\n\t\t$undoStep = $this->getPreviousPartitionStep();\n\n\t\t// Check, if there is a previous action\n\t\tif ($undoStep !== NULL)\n\t\t{\n\t\t\t// Revert changes\n\t\t\t$this->wantedPartitioning = $undoStep['wp'];\n\t\t\t$this->partitionStepsForShift = $this->partitionSteps = $undoStep['ps'];\n\t\t}\n\t\telse\n\t\t\t$this->resetWantedPartitioningAndSteps();\n\n\t\t// Get the EFI boot partition of the client (if set)\n\t\t$EFIBootPartDev = $this->getEFIBootPartDev();\n\n\t\t// Check, if it was set\n\t\tif ($EFIBootPartDev != false)\n\t\t{\n\t\t\t$this->dev2VDiskVPart($EFIBootPartDev, $vDisk, $vPart);\n\n\t\t\t// Unset the EFI boot partition, if it doesn't exist anymore\n\t\t\tif (($vDisk == false) || ( false == $vPart))\n\t\t\t\t$this->unsetEFIBootPartDev();\n\t\t}\n\t}", "public static function resumeById(int $id, mixed ...$data): mixed;", "public function getResumeNasJobId()\n {\n return $this->resume_nas_job_id;\n }", "public function restart(): self {\n if ($this->_state !== self::STATE_PENDING) {\n $this->_state = self::STATE_PENDING;\n }\n return $this;\n }", "public function setWorkflow(Workflow $workflow);", "public function proceed()\n {\n $this->transitionTo(new PaidState());\n }", "public function restart($id);", "protected function resumeRequest($campaign_id)\n {\n if ($campaign_id === null || (is_array($campaign_id) && count($campaign_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $campaign_id when calling '\n );\n }\n\n $resourcePath = '/campaigns/{campaign_id}/actions/resume';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($campaign_id !== null) {\n $resourcePath = str_replace(\n '{' . 'campaign_id' . '}',\n ObjectSerializer::toPathValue($campaign_id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/problem+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/problem+json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody;\n\n if($headers['Content-Type'] === 'application/json') {\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n if (is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n // Basic Authentication\n if (!empty($this->config->getUsername()) && !empty($this->config->getPassword())) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n\n // OAuth Authentication\n if (!empty($this->config->getAccessToken())) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function isResumed()\n {\n return $this->resumed;\n }", "abstract protected function _restart();", "public function resume(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Resume List';\n\t\t$data['resume_list'] = $this->common_model->get_all('fr_resume', '');\n\t\t$this->set_layout('resume/resume_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function resume()\n\t{\n\t\treturn $this->belongsTo('App\\Resume');\n\t}", "public function restore(): void\n\t{\n\t\t$this->processor->restore();\n\t}", "function suspend(): void\n {\n signal(fn (Closure $resume): mixed => $resume());\n }", "public function setWorkflowStep($value)\n {\n $this->setItemValue('workflow_step', ['id' => (int)$value]);\n }", "public function resume(): bool\n {\n if ($this->values->offsetExists('principal')) {\n $this->principal = $this->values->get('principal');\n\n $this->logger->info(\n \"Authentication resume: {user}\",\n ['user' => $this->principal]\n );\n $this->publishResume($this->principal, $this->values);\n\n $this->values->offsetSet('lastActive', microtime(true));\n\n return true;\n }\n return false;\n }", "public function setResumeToken(Token $token)\n {\n \t$this->update(['resume_token' => $token->id]);\n }", "protected function startRecoveryWorkflows($entityID)\n\t{\n\t\t\\CCrmBizProcHelper::AutoStartWorkflows(\n\t\t\t$this->getEntityTypeID(),\n\t\t\t$entityID,\n\t\t\t\\CCrmBizProcEventType::Create,\n\t\t\t$errors\n\t\t);\n\t}", "public function restart() {\n\t\t$this->resetTriggerTime();\n\t\t$this->timer->restartEvent( $this );\n\t}", "private function inActiveCurrentStage()\n {\n $activeStage = $this->getJobAwardedStage();\n\n if ($activeStage) {\n $activeStage->active = 0;\n $activeStage->save();\n }\n }", "public function resumeAllBehaviors() {\n\t\tforeach ($this->model->behaviors() as $key => $behav) {\n\t\t\tif ($this->suspendedBehaviors[$behav['class']]) {\n\t\t\t\t$this->model->attachBehavior($key, $this->suspendedBehaviors[$behav['class']]);\n\t\t\t\tunset($this->suspendedBehaviors[$behav['class']]);\n\t\t\t}\n\t\t}\n\t}", "public function stopProcess() {\n // Do not change the status of an idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_STOPPING))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }", "public function restart()\n {\n session_regenerate_id(true);\n $this->setup();\n }", "public function actionApprove(){\n \t// Set no waiting limit\n \tset_time_limit(0);\n \t// REST client is flash app\n \t$this->restFlashClient = true;\n \t\n \tif (!isset($_POST['userJobId']) || !isset($_POST['approved'])){\n \t\t$this->_sendResponse(\"Approval workflow has failed. Missing userJobId or approval status\", 400);\n \t\treturn;\n \t}\n \t\t\n \t$userJobId = $_POST['userJobId'];\n \t$approved = $_POST['approved'] == 'false' ? false : true;\n \t\n \t// Get UserJob object\n \t$userJob = PUserJob::model()->findByPk($userJobId);\n \t\n \t/* \n \t * Send bad request in case the provided $userJobId does not exist.\n \t */\n \tif(!$userJob instanceof PUserJob){\n \t\t$this->_sendResponse(\"The job with id '{$userJobId}' does not exist in database.\", 400);\n \t}\n \t\n \tif($this->taskWorkflowAPI()->setProjectJobId($userJob->projectJob->id)->validate()) {\n \t\t// Start delivery\n \t\t$this->taskWorkflowAPI()->deliver();\n \t\t\n \t\t// Add breakdown report about task delivery\n \t\t$mainAPI = $this->mainAPI();\n \t\t$mainAPI->projectBreakdownByUserJob($mainAPI::PBR_TASK_DELIVERED, $userJob->id);\n \t\t$mainAPI->sferaAPIByProject($userJob->projectJob->project_id);\n \t\t\n \t\t// mark parent job as disapproved\n \t\tif ($approved == false){\n \t\t\t$mainProjectJob = PProjectJob::model()->findByPk($userJob->projectJob->id)->getMainJob();\n \t\t\tYii::app()->projectAPI->markAsDisapproved($mainProjectJob->id);\n \t\t\t\n \t\t\t//TODO send mail\n \t\t}\t\n \t\t\n \t\t// Send successful response\n \t\t$this->_sendResponse('Approval has been done successfully.');\n \t}\n \telse{\n \t\t// Send failure response\n \t\t$this->_sendResponse(\"Approval workflow has failed.\", 400);\n \t}\n }", "public function markInProgress()\n {\n $this->instance->update([\n 'status' => WorkflowStatus::InProgress,\n ]);\n\n return $this;\n }", "public function restart() {\r\n\t\t$s = $this->stop();\r\n\t\t$this->start();\r\n\t\treturn $s;\r\n\t}", "public function restore($id)\n {\n Process::onlyTrashed()->findOrFail($id)->restore();\n return response()->json(['message' => 'Process restored!']);\n }", "public function getResume()\n {\n return $this->hasOne(Resume::className(), ['id' => 'resume_id']);\n }", "public function giveContinueProcessTaskActivityPayload() {\n\t\tif ($this->canContinue and ! empty($this->continueProcess)) {\n\t\t\treturn array($this->continueProcess, $this->continueTask, $this->continueAction, $this->continuePayload);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function resume(Request $request, Team $team)\n {\n $this->authorize('billing', $team);\n\n $subscription = $team->subscription()->resume();\n event(new SubscriptionResumed($team));\n\n return response()->json($subscription);\n }", "function restart()\n {\n $this->destroy();\n if( $this->_state !== 'destroyed' ) {\n // @TODO :: generated error here\n return false;\n }\n\n $this->_state = 'restart';\n\t\t$this->_start();\n\t\t$this->_state\t=\t'active';\n\n\t\t$this->_setCounter();\n\n return true;\n }", "public function resume() : self\n {\n if (!$this->onGracePeriod()) {\n throw new LogicException('Unable to resume subscription that is not within grace period.');\n }\n\n $subscription = $this->asStripeSubscription();\n\n $subscription->cancel_at_period_end = false;\n\n if ($this->onTrial()) {\n $subscription->trial_end = strtotime($this->trial_ends_at);\n } else {\n $subscription->trial_end = 'now';\n }\n $subscription->save();\n\n $this->markAsActivate();\n\n // Finally, we will remove the ending timestamp from the user's record in the\n // local database to indicate that the subscription is active again and is\n // no longer \"cancelled\". Then we will save this record in the database.\n $this->updateOrFail([\n 'ends_at' => null,\n 'stripe_status' => $subscription->status,\n ]);\n\n return $this;\n }", "public function train()\n {\n $process = new Process(['pio train', '/home/albert/Projects/predictionio/SmartShopECommerceRecommendation/']);\n\n $process->run();\n\n // executes after the command finishes\n if (!$process->isSuccessful()) {\n \\Log::info(new ProcessFailedException($process));\n\n session()->flash('error', trans('admin::app.predictionio.training_failed') );\n\n return back()->with('status', trans('admin::app.predictionio.training_failed') );\n }\n\n \\Log::info($process->getOutput());\n\n session()->flash('success', trans('admin::app.predictionio.training_successfully_completed'));\n\n return back()->with('status', trans('admin::app.predictionio.training_successfully_completed'));\n }", "function isResumeRequested()\n\t{\n\t\t$resp = $this->readDataFromServer();\n\t\tif(trim($resp) == \"\")\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$parts_from_spaces = explode(\" \", $resp);\n\t\t\tif(trim($parts_from_spaces[4]) == \"RESUME\")\n\t\t\t{\n\t\t\t\t$resume_position = trim($parts_from_spaces[7], \" \\x01\\r\\n\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn $resume_position;\n\t}", "public function pauseWorking(){\r\n\r\n }", "protected function restart(): void\n {\n // TODO\n }", "function Restore_Suspended_Events($application_id)\n{\n\t$log = get_log(\"scheduling\");\n\t$db = ECash::getMasterDb();\n\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:{$application_id}] Restoring suspended events\");\n\n\ttry\n\t{\n\t\tif ($application_id === NULL)\n\t\tthrow new Exception(\"No app id supplied\");\n\n\t\t$sql = \"\n\t\t\t\t\tSELECT event_schedule_id\n\t\t\t\t\tFROM event_schedule\n\t\t\t\t\tWHERE event_status = 'suspended'\n\t\t\t\t\t AND application_id = {$application_id}\n\t\t\t\t\t\";\n\t\t$result = $db->query($sql);\n\n\t\t$ids = array();\n\t\twhile ($row = $result->fetch(PDO::FETCH_OBJ))\n\t\t{\n\t\t\t$ids[] = $row->event_schedule_id;\n\t\t}\n\n\t\tif (count($ids))\n\t\t{\n\n\t\t\t$sql = \"\n\t\t\t\t\tUPDATE event_schedule\n\t\t\t\t\tSET event_status = 'scheduled'\n\t\t\t\t\tWHERE event_schedule_id IN(\".implode(', ', $ids).\")\n\t\t\t\t\t\";\n\t\t\t$db->exec($sql);\n\t\t}\n\t}\n\tcatch(Exception $e)\n\t{\n\t\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:$application_id] Restoring suspending scheduled events failed!\");\n\t\tthrow $e;\n\t}\n\n\tComplete_Schedule($application_id);\n\n\treturn TRUE;\n}", "public function setWorkflowId($var)\n {\n GPBUtil::checkString($var, True);\n $this->workflow_id = $var;\n\n return $this;\n }", "public function onPreTransition(WorkflowTransitionEvent $event) {\n $this->setMessage($event, 'pre-transition');\n }" ]
[ "0.7294092", "0.71703446", "0.67249364", "0.65776336", "0.62607086", "0.6070024", "0.6049309", "0.5850657", "0.56924415", "0.5651377", "0.5646792", "0.55871785", "0.5425904", "0.5406954", "0.53714234", "0.5370568", "0.5357559", "0.525744", "0.5181318", "0.51735085", "0.5163628", "0.5136259", "0.51339406", "0.5123248", "0.51214004", "0.5116798", "0.5081574", "0.50814044", "0.50709265", "0.50537854", "0.5026748", "0.5017178", "0.50112003", "0.5001898", "0.50009227", "0.49828953", "0.49489194", "0.49346572", "0.49043655", "0.48993224", "0.4856393", "0.4852461", "0.47974417", "0.47959796", "0.47918218", "0.478332", "0.47439831", "0.47394934", "0.47324347", "0.4728959", "0.47183096", "0.47088018", "0.47068316", "0.46906543", "0.46689606", "0.46533766", "0.4610541", "0.46058908", "0.4595761", "0.45872295", "0.45838872", "0.45785433", "0.45783558", "0.4575575", "0.45750952", "0.4569825", "0.45592424", "0.45501184", "0.45472592", "0.45400968", "0.4530453", "0.45251128", "0.4520033", "0.45187467", "0.4506603", "0.45062757", "0.4499757", "0.4499747", "0.449852", "0.44975236", "0.44968462", "0.44922248", "0.44902784", "0.44885516", "0.44547158", "0.44514757", "0.44509563", "0.44508767", "0.4448506", "0.44260475", "0.4414796", "0.4411263", "0.4410209", "0.43976864", "0.43956563", "0.4394781", "0.43930814", "0.43922794", "0.4387972", "0.4387592" ]
0.6674562
3
Cancels a workflow process so that it won't be picked up by the workflow process runner
public function cancelRun(WorkflowProcess $workflowProcess): WorkflowProcess { if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) { throw new \Exception('Workflow run is not pending'); } $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::CANCELLED; $workflowProcess->save(); WorkflowProcessCancelled::dispatch($workflowProcess); return $workflowProcess; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function cancel();", "public function cancel(): void;", "public function cancel(): int;", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "protected function cancel(): void\n {\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "function deleteWorkflow($workflowId);", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "protected function _cancelOperation() {}", "public function cancel()\n {\n $message = new MailMessage;;\n $message->greeting(\"Hi {$this->post->user->name}!\");\n $message->line(\"The post {$this->post->titile} has been cancelled successfully.\"); \n foreach ($this->workflow as $key => $value) {\n if ($key == 0) {\n $message->action($value->action, url('workflows/workflow/' . $value->id));\n continue;\n }\n $message->line('<a href=\"'.url('workflows/workflow/' . $value->id).'\">'.$value->action.'</a>');\n }\n\n return $message;\n }", "function reset_process(){ $this->model->closing(); }", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "public function stopProcess() {\n // Do not change the status of an idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_STOPPING))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "function eve_api_subtask_cancel(&$form_state) {\n // Clear our ctools cache object. It's good housekeeping.\n eve_api_clear_page_cache('signup');\n}", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "function tripal_jobs_cancel ($job_id){\n $sql = \"select * from {tripal_jobs} where job_id = %d\";\n $job = db_fetch_object(db_query($sql,$job_id));\n\n // set the end time for this job\n if($job->start_time == 0){\n $record = new stdClass();\n $record->job_id = $job->job_id;\n\t $record->end_time = time();\n\t $record->status = 'Cancelled';\n\t $record->progress = '0';\n\t drupal_write_record('tripal_jobs',$record,'job_id');\n drupal_set_message(\"Job #$job_id cancelled\");\n } else {\n drupal_set_message(\"Job #$job_id cannot be cancelled. It is in progress or has finished.\");\n }\n drupal_goto(\"admin/tripal/tripal_jobs\");\n}", "public function cancel(Project $project) {\n }", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "public function actionCancel()\n {\n }", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "function cancel()\n\t{\n\t\t// Initialize some variables\n\t\t$db = & JFactory::getDBO();\n\t\t$user = & JFactory::getUser();\n\n\t\t// Get an article table object and bind post variabes to it [We don't need a full model here]\n\t\t$article = & JTable::getInstance( 'content' );\n\t\t$article->bind( JRequest::get( 'post' ) );\n\n\t\tif ( $user->authorize( 'com_content', 'edit', 'content', 'all' ) || ($user->authorize( 'com_content', 'edit', 'content', 'own' ) && $article->created_by == $user->get( 'id' )) )\n\t\t{\n\t\t\t$article->checkin();\n\t\t}\n\n\t\t// If the task was edit or cancel, we go back to the content item\n\t\t$referer = JRequest::getString( 'ret', base64_encode( JURI::base() ), 'get' );\n\t\t$referer = base64_decode( $referer );\n\t\tif ( !JURI::isInternal( $referer ) )\n\t\t{\n\t\t\t$referer = '';\n\t\t}\n\t\t$this->setRedirect( $referer );\n\n\t}", "public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function cancelAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/failure');\n\t}", "public function destroy($id)\n {\n $workflow_process = $this->workflow_Process_Service->destroy($id);\n return redirect()->back();\n //\n }", "public function deleteAction()\r\n {\r\n $id = $this->getRequest()->getParam('id');\r\n $model = Mage::getModel('thetailor_workgroup/workflow');\r\n \r\n if ($id) {\r\n // Load record\r\n $model->load($id);\r\n \r\n // Check if record is loaded\r\n if (!$model->getId()) {\r\n Mage::getSingleton('adminhtml/session')->addError($this->__('This workflow no longer exists.'));\r\n $this->_redirect('*/*/');\r\n \r\n return;\r\n } else {\r\n try { \r\n $model->setId($id)->delete();\r\n \r\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The workflow was successfully deleted.'));\r\n $this->_redirect('*/*/');\r\n } catch (Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n $this->_redirect('*/*/edit', array('id' => $id));\r\n }\r\n }\r\n }\r\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "function cancelCommit()\n{\n global $user;\n $UID = $user->uid;\n $params = drupal_get_query_parameters();\n $OID = $params['OID'];\n\n // removing user's commitment from the outreach completely\n dbRemoveUserFromOutreach($UID,$OID);\n drupal_set_message(\"Your commitment to outreach event: \" . dbGetOutreachname($OID) . \" has been removed!\"); //letting them know and redirecting user to the previous page they were on\n drupal_goto($_SERVER['HTTP_REFERER']);\n}", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public function actionCancelconvert() {\n if (!empty($_POST['id']))\n {\n\t CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']);\n }\n }", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "public function cancel()\n {\n $this->canceled = true;\n\n $this->save();\n\n $this->user->notify(new OrderCanceled($this));\n\n }", "function reset_process(){ $this->model->closing(); $this->transmodel->closing(); }", "public function cancel()\n {\n $post = $_REQUEST;\n $model = & $this->getModel('jms');\n $model->cancelSubscription($post);\n $this->setRedirect('index.php?option=com_jms&view=jms&layout=cancel&id=' . $post['id'] . '&plan_id=' . $post['plan_id']);\n }", "function handleCancelProgramItemEditor(EventContext $context)\n {\n $context->setForward(dirname(__FILE__) . \"/program_item_selector.php\");\n }", "public function resumeRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PAUSED) {\n throw new \\Exception('Workflow run is not paused');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PENDING;\n $workflowProcess->save();\n\n WorkflowProcessResumed::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "protected function stopTask() {}", "public function resetWorkflow()\n {\n $this->setWorkflowState('approved');\n $workflowHelper = new SurveyManager_Util_Workflow(ServiceUtil::getManager());\n $schemaName = $workflowHelper->getWorkflowName($this['_objectType']);\n $this['__WORKFLOW__'] = array(\n 'module' => 'SurveyManager',\n 'state' => $this['workflowState'],\n 'obj_table' => $this['_objectType'],\n 'obj_idcolumn' => 'id',\n 'obj_id' => 0,\n 'schemaname' => $schemaName);\n }", "public function cancelSubmit(array &$form, FormStateInterface $form_state) {\n $article_id = $this->getRequest()->get('article');\n $this->returnToArticle($article_id, $form_state);\n }", "protected function performPreRemoveCallback()\n {\n // delete workflow for this entity\n $workflow = $this['__WORKFLOW__'];\n if ($workflow['id'] > 0) {\n $result = (bool) DBUtil::deleteObjectByID('workflows', $workflow['id']);\n if ($result === false) {\n $dom = ZLanguage::getModuleDomain('SurveyManager');\n return LogUtil::registerError(__('Error! Could not remove stored workflow. Deletion has been aborted.', $dom));\n }\n }\n \n return true;\n }", "public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }", "public function cancel($id, $actor) {\n // Make sure the job is in a cancelable status\n \n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n // This array corresponds to View/CoJob/fields.inc\n if(!in_array($curStatus, array(JobStatusEnum::InProgress, JobStatusEnum::Queued))) {\n throw new InvalidArgumentException(_txt('er.jb.cxl.status', array(_txt('en.status.job', null, $curStatus))));\n }\n \n // Finally update the status\n \n return $this->finish($id, _txt('rs.jb.cxld.by', array($actor)), JobStatusEnum::Canceled);\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }", "public function actionCancelPlan(){\n // Redirect back to billing page if doesnt have a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if(!$isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n $customerName = Yii::$app->user->identity->agent_name;\n $latestInvoice = Yii::$app->user->identity->getInvoices()->orderBy('invoice_created_at DESC')->limit(1)->one();\n\n if($latestInvoice){\n Yii::error(\"[Requested Cancel Billing #\".$latestInvoice->billing->twoco_order_num.\"] Customer: $customerName\", __METHOD__);\n // Cancel the recurring plan\n $latestInvoice->billing->cancelRecurring();\n }\n\n Yii::$app->getSession()->setFlash('warning', \"[Plan Cancelled] Billing plan has been cancelled as requested.\");\n\n return $this->redirect(['billing/index']);\n }", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "public function removeProcess(Process $proc)\n {\n $em = $this->doctrine->getManager();\n $em->remove($proc->getEntity());\n }", "public function cancelOrder(Mage_Sales_Model_Order $order)\n {\n try {\n // works for 1.8 and 1.9\n $order->registerCancellation();\n } catch (Mage_Core_Exception $e) {\n // exist for backward compatibility with Magento 1.7\n $cancelState = Mage_Sales_Model_Order::STATE_CANCELED;\n /** @var Mage_Sales_Model_Order_Item $item */\n foreach ($order->getAllItems() as $item) {\n if ($cancelState != Mage_Sales_Model_Order::STATE_PROCESSING && $item->getQtyToRefund()) {\n if ($item->getQtyToShip() > $item->getQtyToCancel()) {\n $cancelState = Mage_Sales_Model_Order::STATE_PROCESSING;\n } else {\n $cancelState = Mage_Sales_Model_Order::STATE_COMPLETE;\n }\n }\n $item->cancel();\n }\n\n $order->setSubtotalCanceled($order->getSubtotal() - $order->getSubtotalInvoiced());\n $order->setBaseSubtotalCanceled($order->getBaseSubtotal() - $order->getBaseSubtotalInvoiced());\n\n $order->setTaxCanceled($order->getTaxAmount() - $order->getTaxInvoiced());\n $order->setBaseTaxCanceled($order->getBaseTaxAmount() - $order->getBaseTaxInvoiced());\n\n $order->setShippingCanceled($order->getShippingAmount() - $order->getShippingInvoiced());\n $order->setBaseShippingCanceled($order->getBaseShippingAmount() - $order->getBaseShippingInvoiced());\n\n $order->setDiscountCanceled(abs($order->getDiscountAmount()) - $order->getDiscountInvoiced());\n $order->setBaseDiscountCanceled(\n abs($order->getBaseDiscountAmount()) - $order->getBaseDiscountInvoiced()\n );\n\n $order->setTotalCanceled($order->getGrandTotal() - $order->getTotalPaid());\n $order->setBaseTotalCanceled($order->getBaseGrandTotal() - $order->getBaseTotalPaid());\n\n $order->setState($cancelState, true);\n }\n\t $order->save();\n }", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "public function cancelAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setQuoteId($session->getPaypalStandardQuoteId(true));\n\n $this->_redirect('checkout/cart');\n }", "public function cancel () {\n\t\t$this->opts['cancel'] = true;\n\t\treturn $this;\n\t}", "public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }", "function paypal_cancel()\n {\n $payment_id = $this->session->userdata('payment_id');\n $this->db->where('package_payment_id', $payment_id);\n $this->db->delete('package_payment');\n recache();\n $this->session->set_userdata('payment_id', '');\n $this->session->set_flashdata('alert', 'paypal_cancel');\n redirect(base_url() . 'home/plans', 'refresh');\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function pauseRun(WorkflowProcess $workflowProcess): WorkflowProcess\n {\n if ($workflowProcess->workflow_process_status_id != WorkflowProcessStatusEnum::PENDING) {\n throw new \\Exception('Workflow run is not pending');\n }\n\n $workflowProcess->workflow_process_status_id = WorkflowProcessStatusEnum::PAUSED;\n $workflowProcess->save();\n\n WorkflowProcessPaused::dispatch($workflowProcess);\n\n return $workflowProcess;\n }", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "public function cancelCheckOut($repositoryId, & $objectId, ExtensionDataInterface $extension = null);", "abstract public function delete__do_process ();", "public function cancelable()\n {\n $this->status = self::STATUS_CANCELABLE;\n $this->save();\n\t\t\n $this->fireModelEvent('cancelable');\n }", "public function cancelAction()\n {\n $params = $this->getRequest()->getParams();\n if (array_key_exists('shipment', $params)) {\n $shipment = Mage::getModel('sales/order_shipment')->load($params['shipment']);\n if (Mage::helper('iparcel/api')->cancelShipment($shipment)) {\n Mage::getSingleton('adminhtml/session')->addSuccess('Shipment canceled');\n }\n }\n\n $this->_redirectReferer();\n return true;\n }", "function killProcess($pid)\n{\n $mapper = systemToolkit::getInstance()->getMapper('process', 'process');\n $process = $mapper->searchOneByField('pid', $pid);\n if($process) {\n $mapper->delete($process);\n }\n}", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "function cancel()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t// Checkin the weblink\n\t\t$model = $this->getModel('weblink');\n\t\t$model->checkin();\n\n\t\t$this->setRedirect( 'index.php?option=com_weblinks' );\n\t}", "function ajax_cancelNow()\n{\n $cc = new CapabilityCheck('cancelNow', $_POST);\n if (!$cc->checkCapability()) {\n return;\n }\n\n check_ajax_referer('CPWP');\n\n $_POST['json'] = 1;\n $cpjm = new CPJobManager('cancelNow', $_POST);\n $cpjm->RunJob();\n\n}", "public function cancel()\n {\n $this->_statement =null;\n }", "private function cancelConfirmation()\n {\n Chat::$bot->editMessageText([\n 'text' => 'channel removing confirmation canceled',\n 'inline_message_id' => Chat::getCallBackQuery()->getInlineMessageId()\n ]);\n }", "public function cancel()\n {\n $user = Auth::user();\n\n if ( $user->cancel_rank() )\n flash('Your place request was canceled.')->success()->important();\n\n if ( $user->cancel_place() )\n flash('Your place as been removed.')->success()->important();\n\n return redirect()->back();\n }", "public function canceled()\n {\n return $this->cancelled();\n }", "function islandora_workflow_stop_tracking_collection_in_workflow($object_pid) {\n module_load_include('inc', 'islandora_workflow');\n return (islandora_workflow_set_object_relationship($object_pid, 'is_tracked_by_workflow', 'FALSE'));\n}", "public function cancel_membership() {\n \t$membership_id = $this->uri->segment(3);\n\n \t$data = [\n \t\t'id' => $membership_id,\n \t\t'status' => 'Cancelled'\n \t];\n\n \t$this->Member_Model->update_membership($data);\n\n \tredirect('members/list/active');\n }", "public function cancel() {\n $this->__lastActions__[] = array();\n $this->__dbo__->rollback($this->__instanceId__);\n return $this;\n }", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function massCancelAction()\n {\n $this->_ratepayMassEvent('cancel');\n \n $this->_redirect('*/*/index');\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function canceledit($value) {\n return $this->setProperty('canceledit', $value);\n }", "public function destroy(Process $process)\n {\n //\n }", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancelMyReserved($id);", "public function payment_status_canceled_reversal()\n {\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n 'canceled_reversal',\n $this->settingRepository\n );\n }", "public function testCancelSubmit(): void {\n $this->drupalLogin($this->adminUser);\n if ($this->dialogRouteTest) {\n $ajax = $this->postAjaxForm([], 'Cancel');\n $this->assertAjaxCommandCloseModalDialog($ajax);\n $this->assertAjaxCommandsTotal($ajax, 1);\n }\n else {\n $this->assertFalse(FALSE, \"Don't mark this test as risky!\");\n }\n }", "public function execute( $process, $event ) {\n if( eZSys::isShellExecution() ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $parameters = $process->attribute( 'parameter_list' );\n if( isset( $parameters['order_id'] ) === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n $order = eZOrder::fetch( $parameters['order_id'] );\n if( $order instanceof eZOrder === false ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n $check = eZOrderItem::fetchListByType( $order->attribute( 'id' ), 'siteaccess' );\n if( count( $check ) > 0 && $order->attribute( 'is_temporary' ) && $process->ParameterList['trigger_name'] != 'post_checkout' ) {\n return eZWorkflowEventType::STATUS_ACCEPTED;\n }\n\n if( count( $check ) > 0 ) {\n foreach( $check as $item ) {\n $item->remove();\n }\n }\n\n $orderItem = new eZOrderItem(\n array(\n 'order_id' => $order->attribute( 'id' ),\n 'description' => $GLOBALS['eZCurrentAccess']['name'],\n 'price' => 0,\n 'type' => 'siteaccess',\n 'vat_is_included' => true,\n 'vat_type_id' => 1\n )\n );\n $orderItem->store();\n\n return eZWorkflowType::STATUS_ACCEPTED;\n }", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "function remove_aborted($pId=0) \n {\n // check the the actual user can really do this\n if ( !((galaxia_user_can_clean_instances()) || (galaxia_user_can_clean_aborted_instances())) )\n {\n $this->error[] = tra('user is not authorized to delete aborted instances');\n return false;\n }\n if (!(pId))\n {\n $whereand = '';\n $bindvars = array('aborted');\n }\n else\n {\n $whereand = 'and wf_p_id = ?';\n $bindvars = array('aborted', $pId);\n }\n $query=\"select `wf_instance_id` from `\".GALAXIA_TABLE_PREFIX.\"instances` where `wf_status`=?\".$whereand;\n // start a transaction\n $this->db->StartTrans();\n $result = $this->query($query,$bindvars);\n while($res = $result->fetchRow()) \n { \n $iid = $res['wf_instance_id'];\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"instance_activities` where `wf_instance_id`=?\";\n $this->query($query,array($iid));\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"workitems` where `wf_instance_id`=?\";\n $this->query($query,array($iid)); \n }\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"instances` where `wf_status`=?\".$whereand;\n $this->query($query,$bindvars);\n // perform commit (return true) or Rollback (return false)\n return $this->db->CompleteTrans();\n }", "public function cancel_project($project_id)\n\t{\n\t\t$data = array(\n\t\t\t\t\t'project_status'=>3\n\t\t\t\t);\n\t\t\t\t\n\t\t$this->db->where('project_id = '.$project_id);\n\t\t$this->db->update('projects', $data);\n\t\t\n\t\tredirect('all-projects');\n\t}", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "function handleCancelRelatedPersonEditor(EventContext $context)\n {\n $context->setForward(dirname(__FILE__) . \"/program_item_editor.php\");\n }", "public function handleCancellation($request, $context) { }", "function cancel()\n\t{\n\t\t// Initialize variables.\n\t\t$app = & JFactory::getApplication();\n\n\t\t// Clear the link id from the session.\n\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t// Redirect to the list screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t}", "abstract public function cancel_payment( Payment $payment );", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Return to order manage page\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "function time_tracker_delete_activity_confirm_submit($form, &$form_state) {\n $form_state['redirect'] = 'admin/config/time_tracker/activities';\n $taid = $form_state['values']['taid'];\n $activity = entity_load('time_tracker_activity', array($taid));\n $activity = $activity[$taid];\n time_tracker_activity_delete($activity);\n drupal_set_message(t('Activity %name Deleted', array('%name' => $activity->name)));\n}" ]
[ "0.6984104", "0.6961449", "0.6172852", "0.6153964", "0.59690785", "0.59292114", "0.58900267", "0.58591056", "0.58591056", "0.58590376", "0.5851501", "0.58325887", "0.5798796", "0.5712857", "0.57083464", "0.5648475", "0.562798", "0.56178784", "0.56142676", "0.5536931", "0.55169755", "0.55150265", "0.5501837", "0.5452454", "0.543964", "0.543865", "0.543595", "0.5410223", "0.5395424", "0.5394813", "0.5382519", "0.5357451", "0.53570586", "0.5325605", "0.53239477", "0.53234774", "0.53220135", "0.5292787", "0.52814543", "0.52767026", "0.5270001", "0.52406657", "0.52261746", "0.5207587", "0.51980925", "0.51953065", "0.51839155", "0.51839155", "0.51839155", "0.51820517", "0.51765513", "0.5169571", "0.5163399", "0.5163249", "0.5161728", "0.51520485", "0.5150441", "0.5148327", "0.5148327", "0.5148327", "0.51381886", "0.5128688", "0.5128688", "0.51273924", "0.51212704", "0.51086706", "0.5105667", "0.5095388", "0.5090385", "0.50865483", "0.5082766", "0.50706476", "0.50469184", "0.50380564", "0.5035456", "0.5033883", "0.50174654", "0.5011568", "0.501087", "0.500541", "0.4992362", "0.4987486", "0.49871418", "0.49871418", "0.49826503", "0.49821952", "0.49780715", "0.49774817", "0.49587733", "0.49537778", "0.4949175", "0.49489993", "0.49378824", "0.49376917", "0.49359396", "0.4929858", "0.49060628", "0.49022695", "0.48996454", "0.48975572" ]
0.65682745
2
Creates an input parameter for the workflow process
public function createInputToken(WorkflowProcess $workflowProcess, string $key, mixed $value): WorkflowProcessToken { /** @var WorkflowProcessToken $workflowProcessToken */ $workflowProcessToken = $workflowProcess->workflowProcessTokens()->create([ 'workflow_activity_id' => null, 'key' => $key, 'value' => $value, ]); return $workflowProcessToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function input(){\n $this->params['controller_name'] = $this->ask('Controller name');\n $this->params['crud_url'] = $this->ask('CRUD url');\n $this->params['model_name'] = $this->ask('Model name');\n $this->params['table_name'] = $this->ask('Table name');\n $this->params['author'] = env('PACKAGE_AUTHOR');\n }", "public function __construct($input)\n {\n $this->input = $input;\n }", "public function setTaskIdAttribute($input)\n {\n $this->attributes['task_id'] = $input ? $input : null;\n }", "public function setProcessIdAttribute($input)\n {\n $this->attributes['process_id'] = $input ? $input : null;\n }", "public function createParameter()\n {\n $param = new LiquibaseParameter();\n $this->parameters[] = $param;\n\n return $param;\n }", "public function get_input()\n {\n }", "public function input (\\stdClass $param);", "public function __construct(Input $input)\n {\n $this->input = $input;\n }", "public function __construct($input = null)\n {\n $this->is_argv = is_null($input);\n $this->input = ($this->is_argv) ? $_SERVER['argv'] : $input;\n }", "public function create($input);", "public function setInput(Input $input): void {}", "private function createParam()\n\t{\n\t\t$this->param = Array('http' => Array(), 'url' => null);\n\t}", "private function getDefaultInput(InputInterface $input) {\n\n// $newInput->setOption(\"env\", $input->getOption(\"env\"));\n\n return $input; //$newInput;\n }", "public function getInput() {}", "static function createInput($input, $name) {\n include $_SERVER[\"DOCUMENT_ROOT\"] . \"/mvdv/core/view/templates/general/form/formelements/input.php\";\n }", "public function input()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function setInputVariableForSubWorkflow( $name, $value )\n {\n $this->inputVariablesForSubWorkflow[$name] = $value;\n }", "public function __construct($input)\n {\n }", "public function setInput($input) {\n $this->input = $input;\n return $this;\n }", "public function pre_save($input)\n\t{\n\t\treturn $input;\n\t}", "public function createInput()\n {\n $file = new File();\n $this->assertEquals('file', $file->getAttribute('type'));\n }", "abstract public function getInput();", "public function getInputData()\n {\n return $this->env['INPUT'];\n }", "public function __construct($input)\n {\n $this->info = $input;\n }", "private function _dependencyInputValue(&$input, $name, $node)\n {\n if (($result = $this->getNodeTextRelativeTo('./p:' . $name, $node)) !== false) {\n $input[$name] = $result;\n }\n }", "protected function inputAttributes()\n {\n $this->input_attributes['name'] = $this->name;\n $this->input_attributes['type'] = 'submit';\n $this->input_attributes['value'] = $this->params['title'];\n }", "function make_single_input($request)\n{\n // Create container\n $data = [];\n\n // Add data to array\n $data[$request->name] = $request->value;\n\n // Return input\n return $data;\n}", "public function setMissionIdAttribute($input)\n {\n $this->attributes['mission_id'] = $input ? $input : null;\n }", "public function getInput($name = null);", "function getInputValues();", "public function getTesterParameter();", "public function getInput();", "public function getInput();", "public function getInput();", "public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }", "public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }", "function input( \n\t $name, $type, $title = null, \n\t $value = null, $required = false, \n\t $attributes = null, $options = null, \n\t $datatype = Form::DATA_STRING\n ){\n\t $this->inputs[] = array(\n\t 'name' => $name,\n\t 'title'=> $title,\n\t 'value'=> $value,\n\t 'type' => $type,\n\t 'required' => $required,\n\t 'attributes' => $attributes,\n\t 'options' => $options,\n\t 'datatype'=> $datatype\n\t );\n\t \n\t // return self link\n\t return $this;\n\t}", "public function setInput($input): self\n {\n $this->input = ProcessUtils::validateInput(__METHOD__, $input);\n\n return $this;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "final public function GetInput() { return $this->input; }", "public function useInput()\n\t{\n\t\t$this->use_defaults = false;\n\t}", "public function setInputParam($key, $value)\n {\n $this->inputParams[$key] = $value;\n }", "public function setInput(InputInterface $input);", "public function setInput(InputInterface $input);", "function setInput($input, $template) {\n $this->input = createArray($input,$template);\n }", "protected function setInput($input) \n\t{\n\t\tis_array($input) ? $this->input = $input : $this->setEntity($input); \t\t\n\n\t\treturn static::$self;\t\t\n\t}", "function input ()\n\t{}", "protected function initialize(InputInterface $input, OutputInterface $output)\r\n {\r\n parent::initialize($input, $output);\r\n\r\n $this->model = $this->argument('model');\r\n $GLOBALS['seed_amount'] = $this->argument('amount');\r\n }", "public function setTypepayementIdAttribute($input)\n {\n $this->attributes['typepayement_id'] = $input ? $input : null;\n }", "public function setInvestmentAttribute($input)\n {\n $this->attributes['investment'] = $input ? $input : null;\n }", "public function setProgressAttribute($input)\n {\n $this->attributes['progress'] = $input ? $input : null;\n }", "public function setInput(string $input): self\n {\n $this->options['input'] = $input;\n return $this;\n }", "private function __construct( $input )\n\t{\n\t\tparent::__construct( $input );\n\t}", "public function __construct(array $input = [])\n {\n $this->id = $input['id'] ?? 0;\n $this->title = $input['title'] ?? null;\n $this->description = $input['description'] ?? null;\n $this->learning_path_id = $input['learning_path_id'] ?? null;\n $this->type = $input['type'] ?? null;\n $this->roles= $input['roles'] ?? null;\n $this->file = $input['file'] ?? null;\n }", "public function setInputName($name) {\n\t\t $this->inputName = $name;\n\t }", "public function setInputVariable( $name, $value )\n {\n $this->inputVariables[$name] = $value;\n }", "public function setPriorityAttribute($input)\n {\n $this->attributes['priority'] = $input ? $input : null;\n }", "public function input(string $name = null, $default_value = null)\n {\n return $this->loadFrom('input', $name, $default_value);\n }", "public function setLessonIdAttribute($input)\n {\n $this->attributes['lesson_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function setUserIdAttribute($input)\n {\n $this->attributes['user_id'] = $input ? $input : null;\n }", "public function getInput() : ParameterHelper {\n\t\t\tif (!$this->isValid) {\n\t\t\t\t// @codeCoverageIgnoreStart\n\t\t\t\tthrow new InvalidRequestException(\"Can't get input on an invalid request\");\n\t\t\t\t// @codeCoverageIgnoreEnd\n\t\t\t}\n\n\t\t\tif ($this->requestType->is(RequestType::GET)) {\n\t\t\t\treturn $this->getGet();\n\t\t\t}\n\n\t\t\tif (!$this->isJson) {\n\t\t\t\tthrow new NonJsonInputException(\"Can't get parameterized input for non-json payload\");\n\t\t\t}\n\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\treturn new ParameterHelper(json_decode($this->input, true));\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}", "public function setInput($var)\n\t{\n\t\tGPBUtil::checkUint32($var);\n\t\t$this->input = $var;\n\n\t\treturn $this;\n\t}", "public function getInputValues();", "public function __construct($input, $output)\n {\n $this->inputName = $input;\n $this->outputName = $output;\n }", "private function getInput() : void {\n\t\t$input = @file_get_contents('php://input');\n\n\t\t// Check if input is json encoded\n\t\t$decode = json_decode($input, true);\n\t\tif (json_last_error() == JSON_ERROR_NONE) {\n\t\t\t$input = $decode;\n\t\t}\n\n\t\tif (!is_array($input)) {\n\t\t\t$input = (array) $input;\n\t\t}\n\n\t\t$get = $_SERVER['QUERY_STRING'] ?? '';\n\t\t$get = explode('&', $get);\n\t\tforeach ($get as $item) {\n\t\t\t$item = explode('=', $item);\n\t\t\tif (count($item) !== 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->input[$item[0]] = $item[1];\n\t\t}\n\n\t\t$this->input = array_merge($this->input, $input);\n\t}", "protected function getInputId(){\n if($this->_id===null)\n $this->defineNameId();\n return $this->_id;\n }", "public function setActionIdAttribute($input)\n {\n $this->attributes['action_id'] = $input ? $input : null;\n }", "protected function createRequest()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n $this->call('wizard:request', $params);\n }", "public function input($key, $default = null);", "protected function configure()\n {\n $this->setName('processor');\n $this->addArgument('filePath', InputArgument::REQUIRED, 'Please enter the input file path');\n }", "public function getAddInput();", "public function inputlabel (\\stdClass $param);", "private function getStartInput(): Input {\n return $this->lowerInput;\n }", "public function setPartIdAttribute($input)\n {\n $this->attributes['part_id'] = $input ? $input : null;\n }", "public function setPartIdAttribute($input)\n {\n $this->attributes['part_id'] = $input ? $input : null;\n }", "private static function input()\n {\n $files = ['Input'];\n $folder = static::$root.'Http'.'/';\n\n self::call($files, $folder);\n\n Input::register();\n }", "public function getInput($name);", "public function setNumberAttribute($input)\n {\n $this->attributes['number'] = $input ? $input : null;\n }", "protected function siteEnvRequiredArgsDef()\n {\n $commandArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('command');\n $siteEnvArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('site_env');\n $singleRequiredArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('item');\n\n return new \\Symfony\\Component\\Console\\Input\\InputDefinition([$commandArg, $siteEnvArg, $singleRequiredArg]);\n }", "public function setInput($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Common\\V1\\Payloads::class);\n $this->input = $var;\n\n return $this;\n }", "public function setInput($var)\n {\n GPBUtil::checkMessage($var, \\Temporal\\Api\\Common\\V1\\Payloads::class);\n $this->input = $var;\n\n return $this;\n }", "public function setComunaIdAttribute($input)\n {\n $this->attributes['comuna_id'] = $input ? $input : null;\n }", "public function getParameter();", "public function getParameter();", "function readInputData() {\n\t\t$this->readUserVars(array('monographId', 'decision', 'personalMessage'));\n\t}", "public function setOrderNumberAttribute($input)\n {\n $this->attributes['order_number'] = $input ? $input : null;\n }", "protected function siteRequiredArgsDef()\n {\n $commandArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('command');\n $siteArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('site');\n $singleRequiredArg = new \\Symfony\\Component\\Console\\Input\\InputArgument('item');\n\n return new \\Symfony\\Component\\Console\\Input\\InputDefinition([$commandArg, $siteArg, $singleRequiredArg]);\n }", "function _civicrm_api3_custom_value_create_spec(&$params) {\n $params['entity_id']['api.required'] = 1;\n}", "public function __construct(?string $name, $value, ?string $operator, bool $isTaskVariable, bool $isProcessInstanceVariable, bool $variableNameIgnoreCase = false, bool $variableValueIgnoreCase = false)\n {\n parent::__construct($name, $value, $operator, $isTaskVariable, $variableNameIgnoreCase, $variableValueIgnoreCase);\n $this->isProcessInstanceVariable = $isProcessInstanceVariable;\n }", "public function makeInputButton() {}", "protected function getCommandInput()\n {\n $input = new ApiScaffoldInput(parent::getCommandInput());\n\n $input->withApiResource = $this->option('with-api-resource');\n $input->apiResourceDirectory = $this->option('api-resource-directory');\n $input->apiResourceCollectionDirectory = $this->option('api-resource-collection-directory');\n $input->apiResourceName = $this->option('api-resource-name');\n $input->apiResourceCollectionName = $this->option('api-resource-collection-name');\n $input->apiVersion = $this->option('api-version');\n $input->withDocumentations = $this->option('with-api-docs');\n\n return $input;\n }", "public function __construct(?string $type = 'input')\n {\n $this->type = $type;\n }", "public function setSalvageValueAttribute($input)\n {\n $this->attributes['salvage_value'] = $input ? $input : null;\n }" ]
[ "0.6093886", "0.5933045", "0.5871783", "0.57305837", "0.5612051", "0.55933046", "0.5582808", "0.5582326", "0.5578685", "0.55653155", "0.5554245", "0.55213326", "0.54995", "0.5466562", "0.5439213", "0.5435097", "0.5423461", "0.5368658", "0.5353774", "0.5289554", "0.52796257", "0.5263457", "0.5233608", "0.5226863", "0.5224705", "0.51963866", "0.51959413", "0.5184583", "0.51739347", "0.516816", "0.5152556", "0.5145372", "0.5145372", "0.5145372", "0.5141757", "0.5141757", "0.5120545", "0.5110753", "0.5109588", "0.51066697", "0.51060617", "0.51050293", "0.51011884", "0.51011884", "0.5100773", "0.50939655", "0.509202", "0.508481", "0.5081424", "0.50798815", "0.5067917", "0.50660175", "0.506199", "0.50530076", "0.5051243", "0.50480014", "0.504159", "0.5037649", "0.5037257", "0.5031882", "0.5031882", "0.5031882", "0.5031882", "0.5031882", "0.5031882", "0.5031882", "0.5031882", "0.5024069", "0.50230235", "0.50176483", "0.50064576", "0.4986651", "0.49681407", "0.49665758", "0.49421048", "0.4941869", "0.49408954", "0.49362162", "0.4932693", "0.49250856", "0.49246383", "0.49246383", "0.4915604", "0.49079788", "0.49042296", "0.4897456", "0.48971066", "0.48971066", "0.48844662", "0.48818132", "0.48818132", "0.48785263", "0.48665136", "0.48615697", "0.48561585", "0.48460987", "0.4836817", "0.48301503", "0.48278788", "0.48257223" ]
0.55830663
6
Creates an output token for the workflow process and identifies the activity that created it
public function createOutputToken(WorkflowProcess $workflowRun, WorkflowActivity $workflowActivity, string $key, mixed $value): WorkflowProcessToken { /** @var WorkflowProcessToken $workflowRunToken */ $workflowRunToken = $workflowRun->workflowProcessTokens()->create([ 'workflow_activity_id' => $workflowActivity->id, 'key' => $key, 'value' => $value, ]); return $workflowRunToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createTokenInput(){\n $this->generateToken();\n return '<input type=\"hidden\" name=\"_once\" value=\"' . $_SESSION['token'] . '\">';\n }", "public function createInputToken(WorkflowProcess $workflowProcess, string $key, mixed $value): WorkflowProcessToken\n {\n /** @var WorkflowProcessToken $workflowProcessToken */\n $workflowProcessToken = $workflowProcess->workflowProcessTokens()->create([\n 'workflow_activity_id' => null,\n 'key' => $key,\n 'value' => $value,\n ]);\n\n return $workflowProcessToken;\n }", "abstract function createOutput();", "public function generateToken();", "public function testSaveExecutionInstanceWithOneToken()\n {\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/LoadTokens.bpmn');\n\n //Call the process\n $process = $bpmnRepository->getProcess('SequentialTask');\n $instance = $process->call();\n $this->engine->runToNextState();\n\n //Completes the first activity\n $firstActivity = $bpmnRepository->getActivity('first');\n $token = $firstActivity->getTokens($instance)->item(0);\n $firstActivity->complete($token);\n $this->engine->runToNextState();\n\n //Assertion: Verify that first activity was activated, completed and closed, then the second is activated\n $this->assertEvents([\n ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED,\n StartEventInterface::EVENT_EVENT_TRIGGERED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED,\n ActivityInterface::EVENT_ACTIVITY_COMPLETED,\n ActivityInterface::EVENT_ACTIVITY_CLOSED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED,\n ]);\n\n //Assertion: Saved data show the first activity was closed, the second is active\n $this->assertSavedTokens($instance->getId(), [\n ['elementId' => 'first', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'second', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE],\n ]);\n }", "public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }", "public function createToken();", "public function addOutputIntent(\\SetaPDF_Core_OutputIntent $outputIntent) {}", "public function generateOutputCmd(): string;", "public function generateToken() {\n\t\t$appConfig = $this->config;\n\t\t$token = $this->secureRandom->generate(32);\n\t\t$appConfig->setAppValue('owncollab_ganttchart', 'sharetoken', $token);\n\t\treturn $token;\n\t}", "public function generate_token() {\n\t\t$current_offset = $this->get_offset();\n\t\treturn dechex($current_offset) . '-' . $this->calculate_tokenvalue($current_offset);\n\t}", "protected function create_token()\n {\n do {\n $token = sha1(uniqid(\\Phalcon\\Text::random(\\Phalcon\\Text::RANDOM_ALNUM, 32), true));\n } while (Tokens::findFirst(array('token=:token:', 'bind' => array(':token' => $token))));\n\n return $token;\n }", "function generate_action_token($timestamp)\n {\n \t// Get input values\n \t$site_secret = get_site_secret();\n \t\n \t// Current session id\n \t$session_id = session_id();\n \t\n \t// Get user agent\n \t$ua = $_SERVER['HTTP_USER_AGENT'];\n \t\n \t// Session token\n \t$st = $_SESSION['__elgg_session'];\n \t\n \tif (($site_secret) && ($session_id))\n \t\treturn md5($site_secret.$timestamp.$session_id.$ua.$st);\n \t\n \treturn false;\n }", "public function generateToken()\n\t{\n\t\treturn Token::make();\n\t}", "function createtoken()\n {\n $token = \"token-\" . mt_rand();\n // put in the token, created time\n $_SESSION[$token] = time();\n return $token;\n }", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "abstract protected function getToken(InputInterface $input, OutputInterface $output);", "public function token(): Token\n {\n return self::instance()->runner->token();\n }", "function generate() {\n\n if ($_SERVER[\"REQUEST_METHOD\"] !== 'POST') {\n http_response_code(403);\n echo 'Forbidden';\n die();\n } else {\n //fetch posted data\n $posted_data = file_get_contents('php://input');\n $input = (array) json_decode($posted_data);\n $data = $this->_pre_token_validation($input);\n }\n\n $token = $this->_generate_token($data);\n http_response_code(200);\n echo $token;\n }", "public function getToken(){\n\t\t$token = $this->config->getAppValue('owncollab_ganttchart', 'sharetoken', 0);\n\t\tif ($token === 0){\n\t\t\t$token = $this->generateToken();\n\t\t}\n\t\treturn $token;\n\t}", "public function createHiddenToken() {\n return '<input type=\"hidden\" name=\"access_token\" value=\"' . $this->getToken() . '\" />';\n }", "function createProjectActivity()\n\t\t{\n\t\t\t$pID = $_POST[\"pID\"];\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t$pID;\n\t\t\techo $this->postProjectActivity($pID, $description, $link);\n\t\t}", "public function activity()\n {\n return Activity::i();\n }", "public function generateNewToken()\n {\n $this->token = uniqid(null, true);\n return ($this->token);\n }", "protected function buildToken() {\n }", "public function generateAccessToken()\n {\n $this->verification_token = Yii::$app->security->generateRandomString($length = 16);\n }", "protected function outputSpecificStep() {}", "private function createAndOutputWorkspacePreviewToken(string $workspaceName): void\n {\n $tokenmetadata = $this->workspacePreviewTokenFactory->create($workspaceName);\n $this->outputLine('Created token for \"%s\" with hash \"%s\"', [$workspaceName, $tokenmetadata->getHash()]);\n }", "public function giveProcessTaskActivityPayload() : ?array{\n\t\tif (!empty($this->process)) {\n\t\t\treturn array($this->process, $this->task, $this->action, $this->payload);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "protected function generate_tok()\r\n {\r\n return $_SESSION['token'] = base64_encode(openssl_random_pseudo_bytes(32));\r\n }", "function WriteTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"w+\");\n fwrite($fh, $this->_props['RequestToken']);\n fclose($fh);\n }\n }", "public function getCreatedOTPUuid()\n {\n return $this->getOTPHandler()->getUuid();\n }", "function gen_token()\n\t{\n\t\t$ci = get_instance()->load->helper('myencrypt');\n\t\treturn create_token();\n\t}", "public function getActivity() {\n\t\treturn $this->task->activity;\n\t}", "public function generateAccountActivationToken()\n {\n $this->account_activation_token = Yii::$app->security->generateRandomString();\n }", "public function createTokens()\n {\n\n }", "public function token_created()\n {\n return $this->token_created;\n }", "public function generateAction()\n {\n $apiTokenService = $this->container->get('dft_foapi.api_token');\n $apiTokenService->generateAndSave($this->container->get('dft_foapi.login')->getAuthenticatedUserId());\n\n // TODO: Add error handling.\n return $this->render('dftFoapiBundle:Common:success.json.twig');\n }", "public function testSaveExecutionInstanceWithMultipleTokens()\n {\n //Load a BpmnFile Repository\n $bpmnRepository = new BpmnDocument();\n $bpmnRepository->setEngine($this->engine);\n $bpmnRepository->setFactory($this->repository);\n $bpmnRepository->load(__DIR__ . '/files/LoadTokens.bpmn');\n\n //Call the process\n $process = $bpmnRepository->getProcess('ParallelProcess');\n $instance = $process->call();\n $this->engine->runToNextState();\n\n //Completes the first task\n $firstTask = $bpmnRepository->getActivity('task1');\n $token = $firstTask->getTokens($instance)->item(0);\n $firstTask->complete($token);\n $this->engine->runToNextState();\n\n //Assertion: Verify that gateway was activated, the two tasks activate, one completed and another activated\n $this->assertEvents([\n ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED,\n StartEventInterface::EVENT_EVENT_TRIGGERED,\n GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES,\n GatewayInterface::EVENT_GATEWAY_ACTIVATED,\n GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED,\n GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED,\n GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ActivityInterface::EVENT_ACTIVITY_COMPLETED,\n ActivityInterface::EVENT_ACTIVITY_CLOSED,\n ActivityInterface::EVENT_ACTIVITY_ACTIVATED,\n ]);\n\n //Assertion: Saved data show the first activity was closed, the second is active, and the third is active\n $this->assertSavedTokens($instance->getId(), [\n ['elementId' => 'task1', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'task2', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE],\n ['elementId' => 'task3', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE],\n ]);\n\n //Completes the second task\n $secondtTask = $bpmnRepository->getActivity('task2');\n $token = $secondtTask->getTokens($instance)->item(0);\n $secondtTask->complete($token);\n $this->engine->runToNextState();\n\n //Assertion: Saved data show the first activity was closed, the second is completed, and the third is active\n $this->assertSavedTokens($instance->getId(), [\n ['elementId' => 'task1', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'task2', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'task3', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE],\n ]);\n\n //Completes the third task\n $thirdTask = $bpmnRepository->getActivity('task3');\n $token = $thirdTask->getTokens($instance)->item(0);\n $thirdTask->complete($token);\n $this->engine->runToNextState();\n\n //Assertion: Saved data show the first activity was closed, the second is closed, and the third is closed\n $this->assertSavedTokens($instance->getId(), [\n ['elementId' => 'task1', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'task2', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ['elementId' => 'task3', 'status' => ActivityInterface::TOKEN_STATE_CLOSED],\n ]);\n }", "function create_token($procedure)\n\t{\n\t\t$time = time();\n\t\t// in the clear part we use value separator for better\n\t\t// handling in the token validation method (see below).\n\t\t// hash context goes as single concatenated string\n\t\treturn $token = \"$time|$procedure\\n\".hash('sha1', $this->engine->db->system_seed . $this->sid . $time . $procedure);\n\t}", "public function generateAccessToken()\n {\n return Yii::$app->security->generateRandomString();\n }", "protected function generateSessionToken() {}", "public function activityActorId();", "public function actionGo()\r\n\t{\r\n\t\tif(!isset($_POST['input']) || empty($_POST['input'])) {\r\n\t\t\t$this->redirect(array('index'));\r\n\t\t}\r\n\t\t\r\n\t\t//first process the input form\r\n\t\t$annotationTask = $this->createLongtaskFromPost();\r\n\t\t$annotationTask->saveAsLastUsedToSettings(); //TODO implment\r\n\t\t$parallelMode=isset($_POST['parallel']);\t\t\r\n\t\t\r\n\t\t//preprocess the input always during this request\r\n\t\tif(!$parallelMode)\r\n\t\t\t$input=AnnotatorEngine::preprocessInput($_POST['input']);\r\n\t\telse\r\n\t\t\t$input=$_POST['input'];\r\n\t\t\t\r\n\t\t//now there are two options: the input gets annotated \r\n\t\t//either directly in this request, or saved as a background task\t\t\r\n\t\tif(mb_strlen($input)<Yii::app()->params ['annotatorChunkInputSizeAlwaysDirectMax'] || $annotationTask->getModeParsed()->getAlwaysDirectProcessing() || $parallelMode) {\r\n\t\t\t//if the input is short; or if using the Quick mode, we can handle it in this request\r\n\t\t\t$annotatorEngine=$annotationTask->createEmptyAnnotatorEngine($this);\r\n\t\t\t$annotatorEngine->input=$input;\r\n\t\t\t$annotatorEngine->annotateDirect();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t//@TODO implement background mode for $parallelMode\r\n\t\t//(perhaps could modify to line per chunk?)\r\n\r\n\t\t//insert the task data to DB and then split into chunks\r\n\t\t$success=$annotationTask->insert();\t//insert (to get the ID)\r\n\t\tif($success!==TRUE)\r\n\t\t\t$this->redirect(array('index')); //@TODO implement an error message\r\n\r\n\t\t//now we need to split the input into chunks and save into the DB\r\n\t\t$encoding = Yii::app()->params['annotatorEncoding'];\r\n\t\t$chunksizeMin=Yii::app()->params ['annotatorChunkInputSizeMin'];\r\n\t\t$chunksizeMax=Yii::app()->params ['annotatorChunkInputSizeMax'];\r\n\t\t$len=mb_strlen($input, $encoding);\r\n\t\t\r\n\t\t$lastId=0;\r\n\t\tfor($i=0; $i < $len; $i+=$chunksizeMax) {\r\n\t\t\t$chunk = new LongtaskChunk();\r\n\t\t\t$chunk->longtask_id=$annotationTask->id;\r\n\t\t\t$chunk->id=$lastId++;\r\n\t\t\t$chunk->startIndex=$i;\r\n\t\t\t\r\n\t\t\t//split at an \"ignored char\"\r\n\t\t\t$nextChunkText = mb_substr($input, $i, $chunksizeMax, $encoding);\r\n\t\t\tfor($j=$chunksizeMax;$j>$chunksizeMin;$j--) {\r\n\t\t\t\tif(AnnotatorEngine::isIgnoredChar(mb_substr($nextChunkText, $j, 1, $encoding))) {\r\n\t\t\t\t\t//we have found a good splitting point\r\n\t\t\t\t\t$nextChunkText=mb_substr($input, $i, $j, $encoding);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//also need to adjust the starting point for next chunk\r\n\t\t\t\t\t$i+=$j;\r\n\t\t\t\t\t$i-=$chunksizeMax;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//if there is no \"ignored char\" within the limits, just keep the maximum size chunk\r\n\t\t\t\t\r\n\t\t\t$chunk->input=$nextChunkText;\r\n\t\t\t$chunk->insert();\r\n\t\t}\r\n\t\t\r\n\t\t$annotationTask->chunk_count=$lastId; //it got increased once too often (so this is not actually and ID, but the total count of chunks)\r\n\t\t$annotationTask->update();\r\n\t\t\r\n\t\t$this->redirect(array('process', 'id'=>$annotationTask->id));\r\n\t\t\t\r\n\t}", "public function newTask(){\n if (!$this->validate()) {\n return null;\n }\n \n if( $activity = $this->saveTask() ){\n if($this->type == 'technique'){\n if(!$this->saveDevs()){ \n return null;\n }\n } \n return $activity; \n }\n return null; \n }", "public function getTaskIdentifier() {}", "protected function createTokenTimestamp(): int\n {\n return time();\n }", "public function getToken()\n\t{\n\t\treturn static::createFormToken($this->target_form_id ? $this->target_form_id : $this->id);\n\t}", "protected function createToken()\n {\n $currentServerIp = $this->request->server('SERVER_ADDR');\n\n $secretKey = $this->config['doublespark_contaobridge_secret_key'];\n\n return md5('phpbbbridge'.date('d/m/Y').$currentServerIp.$secretKey);\n }", "public function generateAccessToken()\n {\n $this->access_token = Yii::$app->security->generateRandomString() . '_' . time();\n }", "public function getTokenInput()\n {\n if ($this->Token) {\n return '<input type=\"hidden\" name=\"'.$this->TokenInputName.'\" value=\"' . $this->Token . '\" />';\n }\n return false;\n }", "private function getToken()\n {\n return uniqid();\n }", "function archimedes_get_token() {\n $keys = module_invoke_all('archimedes_id'); sort($keys);\n return drupal_hmac_base64(implode('|', $keys), drupal_get_private_key() . drupal_get_hash_salt());\n}", "function get_token()\n\t{\n\t\treturn session_id();\n\t}", "public function getTokenInputName()\n {\n return $this->TokenInputName;\n }", "public function getOutputName(): string\n {\n return $this->outputName;\n }", "public function toActivityObject();", "public function createToken(Event $event)\n {\n $subject = $event->getSubject();\n\n if ($subject->success) {\n $subject->entity->token = Text::uuid();\n $this->getController()->loadModel()->save($subject->entity);\n }\n }", "public function getActivityLogId()\n {\n return $this->activityLogId;\n }", "public function getPaymentToolToken()\n {\n return $this->getParameter('paymentToolToken');\n }", "public function getTokenResponse() {\n return $this->generateToken();\n \n }", "private function createToken()\n {\n $this->token = md5(time().uniqid());\n return true;\n }", "public function generateAccessToken()\n\t{\n\t\t$this->access_token = Yii::$app->security->generateRandomString();\n\t}", "function create_token()\n {\n $secretKey = \"B1sm1LLAH1rrohmaan1rroh11m\";\n\n // Generates a random string of ten digits\n $salt = mt_rand();\n\n // Computes the signature by hashing the salt with the secret key as the key\n $signature = hash_hmac('sha256', $salt, $secretKey, false);\n // $signature = hash('md5', $salt.$secretKey);\n\n // return $signature;\n return urlsafeB64Encode($signature);\n }", "protected function createToken()\n {\n if ($this->client->getRefreshToken()) {\n $this->client->fetchAccessTokenWithRefreshToken($this->client->getRefreshToken());\n } else {\n // Request authorization from the user.\n $authUrl = $this->client->createAuthUrl();\n printf(\"Open the following link in your browser:\\n%s\\n\", $authUrl);\n print 'Enter verification code: ';\n $authCode = trim(fgets(STDIN));\n\n // Exchange authorization code for an access token.\n $accessToken = $this->client->fetchAccessTokenWithAuthCode($authCode);\n $this->client->setAccessToken($accessToken);\n\n // Check to see if there was an error.\n if (array_key_exists('error', $accessToken)) {\n throw new Exception(join(', ', $accessToken));\n }\n }\n // Save the token to a file.\n if (!file_exists(dirname($this->token))) {\n mkdir(dirname($this->token), 0700, true);\n }\n file_put_contents($this->token, json_encode($this->client->getAccessToken()));\n }", "function get_access_token()\r\n {\r\n $script_location = $this->script_location.'Soundcloud_get_token.py';\r\n $params = $this->sc_client_id.\" \".$this->sc_secret.\" \".$this->sc_user.\" \".$this->sc_pass;\r\n //Execute python script and save results\r\n exec(\"python \\\"\".$script_location.\"\\\" \".$params, $result);\r\n return $result;\r\n }", "public static function getTaskId()\n {\n return self::$TASK_ID;\n }", "public function getIdentifier()\n {\n return $this->getParam('flowIdentifier');\n }", "public function generate_activity_sequence(){\n $logs = array();\n $ts = self::get_sequence_start();\n $lid = 1;\n \n $user = new stdclass();\n $user->a = 465;\n $user->b = 9584;\n \n $course = new stdClass();\n $course->a = 2326;\n $course->b = 9850;\n \n $log = function($uid, $ts, $cid=null, $login=false) use (&$lid){\n $action = ($login || is_null($cid)) ? 'login' : 'view';\n $cid = ($login || is_null($cid)) ? 1 : $cid;\n $params = array('id'=>$lid,'time'=>$ts,'userid'=>$uid, 'course'=>$cid, 'action'=>$action);\n $lid++;\n return tbl_model::instantiate_from_tablename('log', $params);\n };\n \n $view = function($offsets, $u, $c) use (&$ts, $log){\n $logs = array();\n while(count($offsets)>0){\n $ts+=array_shift($offsets);\n $logs[] = $log($u, $ts, $c);\n }\n return $logs;\n };\n \n //*************** begin sequesnce ***************//\n /**\n * the following \n */\n \n //log the user in\n $logs[] = $log($user->a, $ts,null, true);\n \n //********** look at some stuff **********//\n $logs = array_merge($logs,$view(array(10,10,10,10,10), $user->a, $course->a));\n\n \n \n //*************** switch courses ***************//\n $logs = array_merge($logs,$view(array(10,10,10,4,3), $user->a, $course->b));\n \n //*************** switch courses ***************//\n $logs = array_merge($logs,$view(array(2,5,13), $user->a, $course->a));\n \n \n //*************** new login ***************//\n $ts+=4*3600; //four hours later...\n $logs[] = $log($user->a, $ts);\n \n //********** look at some stuff **********//\n $logs = array_merge($logs,$view(array(7,10), $user->a, $course->b));\n \n //*************** switch courses ***************//\n $logs = array_merge($logs,$view(array(10,5), $user->a, $course->a));\n \n// mtrace(print_r($logs));\n return $logs;\n }", "public function create()\n {\n //on that view we manipulate a token\n return view(\"trello.token\");\n }", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $authUrl = $this->adapter->getAuthenticationUrl();\n\n /** @var QuestionHelper $helper */\n $helper = $this->getHelper('question');\n $verificationCode = $helper->ask(\n $input,\n $output,\n new Question('Visit <info>' . $authUrl . '</info> and enter verification code: ')\n );\n\n $authToken = $this->adapter->getAuthenticationToken($verificationCode);\n\n $output->writeln('Token : <info>' . $authToken->getToken() . '</info>');\n $output->writeln('Secret : <info>' . $authToken->getSecret() . '</info>');\n }", "public function getOutput()\n {\n return $this->getParameter('output');\n }", "public function generate_recovery_mode_token()\n {\n }", "public function token()\n {\n return $this->metadata();\n }", "public function getActivityIdentifier()\n {\n if (array_key_exists(\"activityIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"activityIdentifier\"];\n } else {\n return null;\n }\n }", "private function createCSRFToken() {\r\n\t \r\n\t // Check that the token is still valid\r\n\t if( empty($this->input('session', 'token_creation')) ||\r\n\t (time() - $this->input('session', 'token_creation')) > TOKEN_KEEPALIVE ) {\r\n \t\t// The token needs to be refreshed, delete every previous request token for the user\r\n \t\tSecurity::deleteToken();\r\n \t\t\r\n \t\t// Create a new token\r\n \t\t$token = Security::generateToken();\r\n \t\t\r\n \t\t// Store the token in the session\r\n \t\t$this->input('session', 'token', $token);\r\n \t\t\r\n \t\t// Set the token creation time to the current time\r\n \t\t$this->input('session', 'token_creation', (string)time());\r\n\t }\r\n\t\t\r\n\t\t// Set the token in the template\r\n\t\t$this->output->setArguments(array(VAR_CSRF_TOKEN => $this->input('session', 'token')));\r\n\t}", "public function handleactivitycreate()\n {\n $game = new activity_master;\n $game->activitytitle = Input::get('activitytitle');\n $game->description = Input::get('description');\n $game->domain = Input::get('domain');\n \n $game->save();\n\n \n return Redirect::to('/admin');\n }", "function write_new_token($tokenId)\n{\n global $tokenFile;\n global $tokenFilePath;\n\n // write new tokenId to tokens file\n $tokenFile->tokenId = $tokenId;\n\n //Format XML to save indented tree rather than one line\n $dom = new DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($tokenFile->asXML());\n $dom->save($tokenFilePath);\n}", "public function generateNewToken() : string\n {\n $token = \"\";\n try {\n $fullUrl = $this->_getFullUrl(Config::AUTH_URL);\n $result = $this->client->post($fullUrl, [\n \"client_id\" => Config::CLIENT_ID,\n \"email\" => Config::EMAIL,\n \"name\" => Config::NAME\n ]);\n $data = json_decode($result->getBody()->getContents());\n $token = $data->data->sl_token;\n\n } catch (Exception $e) {\n echo $this->responseService\n ->withStatus($e->getCode())\n ->single([], \"data\", null, $e->getMessage());\n }\n return $token;\n }", "public function token(): string\n {\n return $this->token;\n }", "public function currentGameToken();", "public function get_token() {\n\t\treturn $this->token;\n\t}", "public function getSequenceNumberAction()\n {\n return $this->_sequenceNumberAction;\n }", "public static function getToken(): string\n {\n $token = static::generateToken();\n while (key_exists($token, static::$callbacks)) {\n $token = static::generateToken();\n }\n\n return $token;\n }", "public function getOutput() {}", "public function activityActor();", "protected function get_tokenname() {\n // This is unusual but should work for most purposes.\n return get_class($this).'-'.md5($this->scope);\n }", "function one_time_token(): string\n\t\t{\n\t\t\treturn session()->generateOneTimeToken();\n\t\t}", "public function getToProcess()\n {\n return $this->to_process;\n }", "function create_token($filename = '.token')\n{\n try {\n $dir = VAR_FOLDER . DS;\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n $file = fopen($dir . DS . $filename, \"w\");\n fwrite($file, bin2hex(random_bytes(32)) . \"\\n\");\n fclose($file);\n } catch (Exception $e) {\n throw new Exception($e->getMessage(), $e->getCode());\n }\n}", "public function giveContinueProcessTaskActivityPayload() {\n\t\tif ($this->canContinue and ! empty($this->continueProcess)) {\n\t\t\treturn array($this->continueProcess, $this->continueTask, $this->continueAction, $this->continuePayload);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "static function generateToken() {\n $token = Cache::get(\"token\", false);\n if ($token) {\n return $token;\n } else {\n $time = floor(time() / 1000);\n $token = md5(bin2hex($time));\n new Cache(\"token\", $token);\n return $token;\n }\n }", "public function generateTemporalModuleToken(GenerateTemporalModuleTokenRequest $request)\n {\n $crudGTemporalModuleTokenService = new CrudGTemporalModuleTokenService();\n $response = $crudGTemporalModuleTokenService->store($request);\n\n if ($response['status'] === 'success') {\n return response()->json($response, 201);\n }\n\n return response()->json($response, $response['http_status_code']);\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function generateToken()\n {\n $request = $this->call('v1/auth/token', Constants::METHOD_POST, [\n 'timestamp' => time(),\n 'nonce' => $this->generateNonce(),\n ]);\n\n return isset($request['token']) ? $request['token'] : false;\n }", "public function getOrganizationActivationToken() : ?string {\n\t\treturn ($this->organizationActivationToken);\n\t}", "public function getToken()\n\t{\n\n\t}" ]
[ "0.542975", "0.5419562", "0.5270009", "0.52655", "0.5235124", "0.51977557", "0.51264775", "0.5118552", "0.5103477", "0.5085816", "0.50402534", "0.5003512", "0.4981819", "0.49771118", "0.49572334", "0.49068543", "0.48853388", "0.48708984", "0.48608392", "0.48572114", "0.4856793", "0.4841178", "0.480495", "0.48042127", "0.4796954", "0.47651342", "0.4757848", "0.4756521", "0.47466108", "0.4735295", "0.47113925", "0.47094476", "0.4706333", "0.47057128", "0.47055292", "0.47047973", "0.46932375", "0.46868756", "0.46863866", "0.466564", "0.46654785", "0.46493614", "0.46411246", "0.46361524", "0.46319187", "0.46128124", "0.46111968", "0.46002746", "0.45957825", "0.45884484", "0.4569215", "0.45627758", "0.4562708", "0.45442817", "0.45383433", "0.4535886", "0.44933766", "0.44894657", "0.4487053", "0.4483867", "0.4480059", "0.4468946", "0.44580722", "0.44500813", "0.4443071", "0.44422072", "0.44320342", "0.44268078", "0.44247183", "0.44240275", "0.44237837", "0.44153157", "0.44138727", "0.44116914", "0.44020325", "0.43990198", "0.43970102", "0.4387939", "0.43872046", "0.43711284", "0.43700343", "0.43675804", "0.43672162", "0.43571493", "0.43549797", "0.43520856", "0.43474913", "0.43434316", "0.43402243", "0.43395588", "0.43335053", "0.43263558", "0.43260098", "0.4319695", "0.4319695", "0.4319695", "0.4319695", "0.43196186", "0.43061224", "0.43055815" ]
0.7040817
0
CONSTRUCTOR DE LA CLASE
function __construct() { $this->load->database(); parent::__construct(); // if ($nPerId != null) { // $this->get_Persona($nPerId); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "private function __construct() {\r\n\t\r\n\t}", "function __construct (){\n\t\t}", "final private function __construct(){\r\r\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "private function __construct()\t{}", "final private function __construct() {\n\t\t\t}", "private function __construct()\n\t{\n\n\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "private function __construct() {\n\t\t}", "final private function __construct()\n\t{\n\t}", "private function __construct()\r\n\t{\r\n\t}", "private function __construct()\n\t{\n\t\t\n\t}", "function __construct() {\n\n\t\t}", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct() {\n\n\t\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "public function __construct()\r\n\t\t{\r\n\t\t}", "public function __construct() { \n\t\t\n\n\t\t}", "private function __construct() {\r\n\t\t\r\n\t}", "private function __construct () \n\t{\n\t}", "public function _construct()\n\t{\n\n\t}", "private function __construct( )\n {\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "private function __construct() { \n\t\t\n\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "private function __construct()\n\t{\n\t}", "function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "final private function __construct()\n {\n }", "private function __construct(){\n\t\t }", "private function __construct() {\r\n\t}", "private function __construct() {\r\n\t}", "function __construct() {\n\t\t\t\n\t\t}", "function __construct(){\n\n\t\t}", "public function __construct()\n\t{\n\t\n\t}", "public function __construct()\n\t{\n\t\n\t}", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "private function __construct(){\n \t\n }", "private function __construct(){\n\t\n\t}", "function __construct() ;", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "private final function __construct() {}", "public function __construct()\n\t{}", "public function __construct() {\r\n\r\n\t\t}", "final private function __construct() {}", "final private function __construct() {}", "function __construct()\n\t{\n\n\t}", "protected function __construct()\r\n\t\t{\r\n\t\t}", "private function __construct () {}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n // Aqui todo lo que se define para este constructor\n }", "public function __construct() {\r\n\t\t//\r\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}", "private function __construct() {\n\t}" ]
[ "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8507677", "0.8492725", "0.84750974", "0.8442043", "0.84290546", "0.842553", "0.84253573", "0.8423537", "0.842009", "0.84139836", "0.8413942", "0.8403654", "0.8389282", "0.83848983", "0.8372483", "0.83641213", "0.8358983", "0.83563876", "0.8354577", "0.834846", "0.8345147", "0.83430773", "0.8337753", "0.83344656", "0.833202", "0.83307683", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.83064705", "0.82984096", "0.8298266", "0.8292829", "0.8288485", "0.8288485", "0.8270534", "0.8261878", "0.82596415", "0.82596415", "0.82578504", "0.8248078", "0.82425535", "0.82261807", "0.8225686", "0.8225686", "0.8225686", "0.8225686", "0.82248145", "0.82237834", "0.8222435", "0.8219853", "0.8219853", "0.82185864", "0.82127494", "0.8211646", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8209699", "0.8207506", "0.8207506", "0.8207506", "0.8207506", "0.8207506", "0.8206902", "0.8206588", "0.8205832", "0.8205832", "0.8205832" ]
0.0
-1
Feedback Form Work Start
function create_extension_feedback_form($data) { if(isset($data['cid']) && !empty($data['cid'])) { $companyId = $data['cid']; } else { $company_data = get_company_data(); $companyId = $company_data['cid']; } $approval_data = array(); if(isset($data['approval_id']) && !empty($data['approval_id'])) { $approval_id = $data['approval_id']; $approval_data['id'] = $approval_id; unset($data['approval_id']); } if(isset($data['action_ts'])) { $approval_data['action_ts'] = $data['action_ts']; } if(isset($data['action_by'])) { $approval_data['update_by'] = $data['action_by']; } if(isset($data['action_comment'])) { $approval_data['comment'] = $data['action_comment']; } if(isset($data['action_ts'])) { $approval_data['action_ts'] = $data['action_ts']; } if(isset($data['action_by'])) { $approval_data['update_by'] = $data['action_by']; } if(isset($data['action'])) { $fa_action = $data['action']; // unset($data['action']); } $data['approval_data'] = $approval_data; $result_job = curl_post('/create_form_job',$data); if(($result_job['success']=='true') && count($result_job['data']['data'])) { $result_job = $result_job['data']['data']; return array("data"=>$result_job,"success"=>"true","error_code"=>"50311"); } else { return array("data"=>$result_job,"success"=>"false","error_code"=>"50311"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request_feedback(){\n\t\t$response = $this->InteractModal->get_task();\n\t\tif(!empty($response)){\n\t\t\tforeach($response as $response_data){\n\t\t\t\t$task_id = $response_data['task_id'];\t\t\t\t\t\n\t\t\t\t$schedule_date = $response_data['schedule_date'];\n\t\t\t\t$listingdate = date_create($schedule_date);\n\t\t\t\t$time= date_format($listingdate,\"l d - M, Y h:i A\");\n\t\t\t\t$_details = $response_data['details'];\n\t\t\t\t$details = unserialize( $_details );\n\t\t\t\t$username = $details['user_name'];\n\t\t\t\t$contact = $details['contact_number'];\n\t\t\t\t$email_id = $details['showing_email'];\n\t\t\t\t$upcoming_all_showings = $this->InteractModal->get_fedback_links( $task_id );\n\t\t\t$config = array(\n\t\t\t\t'smtp_user' => '[email protected]',\n\t\t\t\t'mailtype' => 'html',\n\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t'starttls' => true,\n\t\t\t\t'newline' => \"\\r\\n\",\n\t\t\t\t\n\t\t\t);\n\t\t\t\tif(!empty($upcoming_all_showings)){\n\t\t\t\tforeach($upcoming_all_showings as $upcoming_showing){\n\t\t\t\t\t$feedback_link= $upcoming_showing['link'];\n\t\t\t\t\t$address= $upcoming_showing['property_address'];\n\t\t\t\t\t$broker_id= $upcoming_showing['broker_id'];\n\t\t\t\t\t$response = $this->InteractModal->signature_user_email($broker_id);\n\t\t\t\t\t$email_broker = $response[0]['user_email'];\n\t\t\t\t\t$concerned_person = $this->InteractModal->get_user_meta($broker_id,'concerned_person'); \n\t\t\t\t\n\t\t\t$subject = 'Please provide feedback for our recent showing';\n\t\t\t$msg = 'Hi,<br /><br />We would really appreciate your feedback, please tell us what you thought about your recent showing at \"'. $address .'\" on \"'. $time .'\". <br /><a href=\"'. $feedback_link .'\">Please click here to submit your feedback </a> <br /><br /> Thank you,<br /> <br /> '. $concerned_person .' <br /> '. $contact .' <br /> '. $email_broker .'';\n\t\t\t$this->load->library('email', $config);\n\t\t\t$this->email->from('[email protected]', 'InteractRE');\n\t\t\t$this->email->set_header('InteractACM', 'InteractACM Notifications');\n\t\t\t$this->email->to( $email_id );\n\t\t\t$this->email->subject( $subject );\n\t\t\t$this->email->message( $msg ); \n\t\t\n\t\t\tif( $this->email->send() ){\n\t\t\t\t$data= array(\n\t\t\t'request_feedback' => 0,\n\t\t\t);\n\t\t\t$response = $this->InteractModal->update_task_details($data,$task_id);\n\t\t\t}else{\n\t\t\techo'Unable to send feedback link at this time. Please try again';\n\t\t} \n\t\t\t}}\n\t\t\t}\n\t\t}\n }", "function feedback_form()\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$return = get_lang('AddNewFeedback').'<br />';\r\n\r\n\t// we now check if the other users have not delete this document yet. If this is the case then it is useless to see the\r\n\t// add feedback since the other users will never get to see the feedback.\r\n\t$sql=\"SELECT * FROM \".$dropbox_cnf[\"tbl_person\"].\" WHERE file_id='\".Database::escape_string($_GET['id']).\"'\";\r\n\t$result=api_sql_query($sql,__LINE__, __FILE__);\r\n\t$number_users_who_see_file=mysql_num_rows($result);\r\n\tif ($number_users_who_see_file>1)\r\n\t{\r\n\t\t$return .= '<textarea name=\"feedback\" style=\"width: 80%; height: 80px;\"></textarea><br /><input type=\"button\" name=\"store_feedback\" value=\"'.get_lang('Ok').'\" \r\n\t\t\tonclick=\"document.form_tablename.attributes.action.value = document.location;document.form_tablename.submit();\"/>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$return .= get_lang('AllUsersHaveDeletedTheFileAndWillNotSeeFeedback');\r\n\t}\r\n\treturn $return;\r\n}", "protected function Form_Run() {}", "public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&amp;module=contact', 'forum_profil');\n\t}", "public function submit() {\n\tparent::submit();\n\tif( $this->notify() ) {\n\t echo '<div class=\"alert alert-success\">' . $this->message_form_send . '</div>';\n\t}\n }", "public function gui()\n {\n require_code('form_templates');\n\n require_css('recommend');\n\n $page_title = get_param_string('page_title', null, true);\n\n $submit_name = (!is_null($page_title)) ? make_string_tempcode($page_title) : do_lang_tempcode('SEND');\n $post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF', null, true);\n\n $hidden = new Tempcode();\n\n $name = post_param_string('name', is_guest() ? '' : $GLOBALS['FORUM_DRIVER']->get_username(get_member(), true));\n $recommender_email_address = post_param_string('recommender_email_address', $GLOBALS['FORUM_DRIVER']->get_member_email_address(get_member()));\n\n $fields = new Tempcode();\n $fields->attach(form_input_line(do_lang_tempcode('YOUR_NAME'), '', 'name', $name, true));\n $fields->attach(form_input_email(do_lang_tempcode('YOUR_EMAIL_ADDRESS'), '', 'recommender_email_address', $recommender_email_address, true));\n $already = array();\n foreach ($_POST as $key => $email_address) {\n if (substr($key, 0, 14) != 'email_address_') {\n continue;\n }\n\n if (get_magic_quotes_gpc()) {\n $email_address = stripslashes($email_address);\n }\n\n $already[] = $email_address;\n }\n\n if (is_guest()) {\n $fields->attach(form_input_email(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), '', 'email_address_0', array_key_exists(0, $already) ? $already[0] : '', true));\n } else {\n if (get_option('enable_csv_recommend') == '1') {\n $set_name = 'people';\n $required = true;\n $set_title = do_lang_tempcode('TO');\n $field_set = alternate_fields_set__start($set_name);\n\n $email_address_field = form_input_line_multi(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), do_lang_tempcode('THEIR_ADDRESS'), 'email_address_', $already, 1, null, 'email');\n $field_set->attach($email_address_field);\n\n //add an upload CSV contacts file field\n $_help_url = build_url(array('page' => 'recommend_help'), get_page_zone('recommend_help'));\n $help_url = $_help_url->evaluate();\n\n $field_set->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD_CSV_FILE', escape_html($help_url)), 'upload', false, null, null, false));\n\n $fields->attach(alternate_fields_set__end($set_name, $set_title, '', $field_set, $required));\n } else {\n $email_address_field = form_input_line_multi(do_lang_tempcode('FRIEND_EMAIL_ADDRESS'), do_lang_tempcode('THEIR_ADDRESS'), 'email_address_', $already, 1, null, 'email');\n $fields->attach($email_address_field);\n }\n }\n\n if (may_use_invites()) {\n $invites = get_num_invites(get_member());\n if ($invites > 0) {\n require_lang('cns');\n $invite = (count($_POST) == 0) ? true : (post_param_integer('invite', 0) == 1);\n $fields->attach(form_input_tick(do_lang_tempcode('USE_INVITE'), do_lang_tempcode('USE_INVITE_DESCRIPTION', $GLOBALS['FORUM_DRIVER']->is_super_admin(get_member()) ? do_lang('NA_EM') : integer_format($invites)), 'invite', $invite));\n }\n }\n $message = post_param_string('message', null);\n $subject = get_param_string('subject', do_lang('RECOMMEND_MEMBER_SUBJECT', get_site_name()), true);\n if (is_null($message)) {\n $message = get_param_string('s_message', '', true);\n if ($message == '') {\n $from = get_param_string('from', null, true);\n if (!is_null($from)) {\n $resource_title = get_param_string('title', '', true);\n if ($resource_title == '') { // Auto download it\n $downloaded_at_link = http_download_file($from, 3000, false);\n if (is_string($downloaded_at_link)) {\n $matches = array();\n if (cms_preg_match_safe('#\\s*<title[^>]*\\s*>\\s*(.*)\\s*\\s*<\\s*/title\\s*>#mi', $downloaded_at_link, $matches) != 0) {\n $resource_title = trim(str_replace('&ndash;', '-', str_replace('&mdash;', '-', @html_entity_decode($matches[1], ENT_QUOTES, get_charset()))));\n $resource_title = preg_replace('#^' . preg_quote(get_site_name(), '#') . ' - #', '', $resource_title);\n $resource_title = cms_preg_replace_safe('#\\s+[^\\d\\s][^\\d\\s]?[^\\d\\s]?\\s+' . preg_quote(get_site_name(), '#') . '$#i', '', $resource_title);\n }\n }\n }\n if ($resource_title == '') {\n $resource_title = do_lang('THIS'); // Could not find at all, so say 'this'\n } else {\n $subject = get_param_string('subject', do_lang('RECOMMEND_MEMBER_SUBJECT_SPECIFIC', get_site_name(), $resource_title));\n }\n\n $message = do_lang('FOUND_THIS_ON', get_site_name(), comcode_escape($from), comcode_escape($resource_title));\n }\n }\n if (get_param_integer('cms', 0) == 1) {\n $message = do_lang('RECOMMEND_COMPOSR', brand_name(), get_brand_base_url());\n }\n }\n\n $text = is_null($page_title) ? do_lang_tempcode('RECOMMEND_SITE_TEXT', escape_html(get_site_name())) : new Tempcode();\n\n if (!is_null(get_param_string('from', null, true))) {\n $submit_name = do_lang_tempcode('SEND');\n $text = do_lang_tempcode('RECOMMEND_AUTO_TEXT', get_site_name());\n $need_message = true;\n } else {\n $hidden->attach(form_input_hidden('wrap_message', '1'));\n $need_message = false;\n }\n\n handle_max_file_size($hidden);\n\n $fields->attach(form_input_line(do_lang_tempcode('SUBJECT'), '', 'subject', $subject, true));\n $fields->attach(form_input_text_comcode(do_lang_tempcode('MESSAGE'), do_lang_tempcode('RECOMMEND_SUP_MESSAGE', escape_html(get_site_name())), 'message', $message, $need_message, null, true));\n\n if (addon_installed('captcha')) {\n require_code('captcha');\n if (use_captcha()) {\n $fields->attach(form_input_captcha());\n $text->attach(' ');\n $text->attach(do_lang_tempcode('FORM_TIME_SECURITY'));\n }\n }\n\n $hidden->attach(form_input_hidden('comcode__message', '1'));\n\n $javascript = (function_exists('captcha_ajax_check') ? captcha_ajax_check() : '');\n\n return do_template('FORM_SCREEN', array(\n '_GUID' => '08a538ca8d78597b0417f464758a59fd',\n 'JAVASCRIPT' => $javascript,\n 'SKIP_WEBSTANDARDS' => true,\n 'TITLE' => $this->title,\n 'PREVIEW' => true,\n 'HIDDEN' => $hidden,\n 'FIELDS' => $fields,\n 'URL' => $post_url,\n 'SUBMIT_ICON' => 'buttons__send',\n 'SUBMIT_NAME' => $submit_name,\n 'TEXT' => $text,\n 'SUPPORT_AUTOSAVE' => true,\n 'TARGET' => '_self',\n ));\n }", "function feedback() {\n $title_for_layout = 'Feedback';\n $this->set(compact('title_for_layout'));\n if ($this->request->is('post')) {\n if ($this->Session->check('Auth.User')) {\n $this->request->data['Feedback']['user_id'] = $this->Session->read('Auth.User.id');\n }\n $captcha = trim($this->Captcha->getCode('User.refer_security_code'));\n $this->loadModel('Feedback');\n $this->Feedback->set($this->request->data);\n if (strcmp(trim($this->request->data['User']['refer_security_code']), $captcha) == 0) {\n unset($this->request->data['User']);\n $data = $this->request->data;\n if (is_array($data['Feedback'])) {\n foreach ($data['Feedback'] as $key => $val) {\n $data['Feedback'][$key] = trim($val);\n }\n }\n if ($this->Feedback->save($data)) {\n\n $Email = new CakeEmail(Configure::read('EMAIL_DELIVERY_MODE'));\n $Email->config(array('persistent' => true));\n\n $Email->from(array(Configure::read('COMPANY.FROM_EMAIL') => Configure::read('COMPANY.NAME')));\n $var_array = array('message' => $data['Feedback']['comment'],\n 'number' => $data['Feedback']['phone'],\n 'name' => $data['Feedback']['name'], 'email' => $data['Feedback']['email'],\n 'feedback_type' => $data['Feedback']['feedback_type']);\n if ($this->Session->check('Auth.User')) {\n $var_array['user_id'] = $this->Session->read('Auth.User.id');\n }\n $Email->viewVars($var_array);\n $Email->to(Configure::read('COMPANY.ADMIN_EMAIL'));\n $Email->subject(\"Feedback Received - \" . Configure::read('COMPANY.NAME'));\n $Email->template('feedback');\n $Email->send();\n\n //Email to user\n if (trim($data['Feedback']['email']) != '') {\n $Email->from(array(Configure::read('COMPANY.FROM_EMAIL') => Configure::read('COMPANY.NAME')));\n $var_array = array('name' => $data['Feedback']['name']);\n $Email->viewVars($var_array);\n $Email->to($data['Feedback']['email']);\n $Email->subject('Thank you for your feedback - ' . Configure::read('COMPANY.NAME'));\n $Email->template('feedback_ack');\n $Email->send();\n }\n\n /* smtp disconnect */\n if (Configure::read('EMAIL_DELIVERY_MODE') == 'smtp') {\n $Email->disconnect();\n }\n\n $this->Flash->success(\"We appreciate that you've taken the time to write us. We'll get back to you very soon.\");\n $this->redirect(array('controller' => 'content', 'action' => 'feedback'));\n } else {\n $this->Flash->error('There was a problem processing your request. Please try again.');\n }\n } else {\n $this->Flash->error(__('Incorrect captcha code! Try again.'));\n }\n }\n }", "public function feedback()\n {\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n Session::set('feedback_positive',null); \n Session::set('feedback_negative',null); \n \n //echo 'hi';\n // echo out positive messages\n if (isset($feedback_positive)) {\n foreach ($feedback_positive as $feedback) {\n echo '<div class=\"feedback success\">'.$feedback.'</div>';\n }\n }\n \n // echo out negative messages\n if (isset($feedback_negative)) {\n foreach ($feedback_negative as $feedback) {\n echo '<div class=\"feedback error\">'.$feedback.'</div>';\n }\n }\n }", "public function lesson_feedback()\n {\n if (!$this->students->isLogin()) {\n\n header('Location:/login');\n die();\n }\n\n /**\n * Main Body Section ///////////////////////////////////////////////////////////////////////////////////////////\n */\n\n\n\n $time = $_GET['time'];\n $date = $_GET['date'];\n\n $lesson = DataBase::getInstance()->getDB()->getAll('SELECT * FROM c_lessons WHERE Date=?s AND Time=?s AND StudentID=?i',\n $date ,$time,$this->students->getID());\n\n if($lesson){\n\n $feedBack = DataBase::getInstance()->getDB()->getAll('SELECT * FROM c_lessons_feedback WHERE Date=?s AND Time=?s AND StudentID=?i',\n $date ,$time,$this->students->getID());\n\n if($feedBack){\n $feedBackFile = '<div>\n <div class=\"thumbnail\">\n <div class=\"caption\">\n <h3>Отзыв об уроке</h3>\n <hr>\n <p>Дата: '.$feedBack[0]['Date'].'</p>\n <p>Время: '.$feedBack[0]['Time'].'</p>\n <p>Оценка: '.$feedBack[0]['Evaluation'].'</p>\n <hr>\n <p>Отзыв</p>\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n '.$feedBack[0]['Text'].'\n </div>\n </div>\n </div>\n </div>\n </div>';\n\n DataManager::getInstance()->addData('FeedBackFile', $feedBackFile);\n\n }else{\n\n $feedBackFile = '\n<form id=\"feedback-form\">\n <label>Оценка</label>\n<div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"rating\" id=\"inlineRadio1\" value=\"1\">\n <label class=\"form-check-label\" for=\"inlineRadio1\">1</label>\n</div>\n<div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"rating\" id=\"inlineRadio2\" value=\"2\">\n <label class=\"form-check-label\" for=\"inlineRadio2\">2</label>\n</div>\n<div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"rating\" id=\"inlineRadio3\" value=\"3\">\n <label class=\"form-check-label\" for=\"inlineRadio2\">3</label>\n</div>\n<div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"rating\" id=\"inlineRadio4\" value=\"4\">\n <label class=\"form-check-label\" for=\"inlineRadio2\">4</label>\n</div>\n<div class=\"form-check form-check-inline\">\n <input class=\"form-check-input\" type=\"radio\" name=\"rating\" id=\"inlineRadio5\" value=\"5\">\n <label class=\"form-check-label\" for=\"inlineRadio2\">5</label>\n</div>\n<div class=\"form-group\">\n <label for=\"exampleFormControlTextarea1\">Ваш отзыв</label>\n <textarea class=\"form-control\" name=\"feedback-text\" rows=\"3\" required></textarea>\n </div>\n <input class=\"form-check-input\" type=\"text\" name=\"date\" value=\"'.$date.'\" readonly hidden>\n <input class=\"form-check-input\" type=\"text\" name=\"time\" value=\"'.$time.'\" readonly hidden>\n <button name=\"submit\" type=\"button\" onclick=\"addFeedback();\" class=\"btn btn-primary mb-2\">Оставить отзыв</button><br>\n</form>\n<div id=\"feedback-message\"></div>';\n\n DataManager::getInstance()->addData('FeedBackFile', $feedBackFile);\n\n\n }\n\n }else{\n\n DataManager::getInstance()->addData('FeedBackFile', 'Sorry, but lesson wasn\\'t find');\n }\n\n\n DataManager::getInstance()->addData('Students', $this->students);\n\n\n /**\n * Render///////////////////////////////////////////////////////////////////////////////////////////////////////\n */\n\n $this->render();\n }", "public function form()\n\t{\n\t\tglobal $L;\n\t\t$sentEmails = $this->getSentEmailsArray();\n\n\t\t$html = '<div class=\"alert alert-primary\" role=\"alert\">';\n\t\t$html .= $this->description();\n\t\t$html .= '</div>';\n\n\t\t$html .= '<div>';\n\t\t// API key\n\t\t$html .= '<label><strong>Buttondown API Key</strong></label>';\n\t\t$html .= '<input id=\"apiKey\" name=\"apiKey\" type=\"text\" value=\"'.$this->getValue('apiKey').'\">';\n\t\t$html .= '<span class=\"tip\">Copy your API key on https://buttondown.email/settings/programming </span>';\n\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('paused').'</label>';\n\t\t$html .= '<select id=\"paused\" name=\"paused\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('paused')===true?'selected':'').'>'.$L->get('is-paused').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('paused')===false?'selected':'').'>'.$L->get('is-active').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('paused-tip').'</span>';\n\n\t\t// Start date\n\t\t$html .= '<label>'.$L->get('send-after').'</label>';\n\t\t$html .= '<input id=\"startDate\" name=\"startDate\" type=\"text\" value=\"'.$this->getValue('startDate').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('send-after-tip').'</span>';\n\t\t// Subject Prefix\n\t\t$html .= '<label>'.$L->get('subject-prefix').'</label>';\n\t\t$html .= '<input id=\"subjectPrefix\" name=\"subjectPrefix\" type=\"text\" value=\"'.$this->getValue('subjectPrefix').'\">';\n\t\t$html .= '<span class=\"tip\">'.$L->get('subject-prefix-tip').'</span>';\n\t\t\t\t// Sending paused\n\t\t$html .= '<label>'.$L->get('include-cover').'</label>';\n\t\t$html .= '<select id=\"includeCover\" name=\"includeCover\" type=\"text\">';\n\t\t$html .= '<option value=\"true\" '.($this->getValue('includeCover')===true?'selected':'').'>'.$L->get('yes').'</option>';\n\t\t$html .= '<option value=\"false\" '.($this->getValue('includeCover')===false?'selected':'').'>'.$L->get('no').'</option>';\n\t\t$html .= '</select>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('include-cover-tip').'</span>';\n\t\t$html .= '</div><hr>';\n\t\t// List of page keys for which mail was sent \n\t\t$html .= '<h4>'.$L->get('sent-list').'</h4>';\n\t\t$html .= '<span class=\"tip\">'.$L->get('sent-list-tip').'</span>';\n\t\t$html .= '<div style=\"overflow-y: scroll; height:400px;\"><ul>';\n\t\tforeach ($sentEmails as $sentKey):\n\t\t\t$html .= '<li>'.$sentKey.'</li>';\n\t\tendforeach;\n\t\t$html .= '</ul></div>';\n\t\t$html .= '<div><a target=\"_blank\" rel=\"noopener\" href=\"https://buttondown.email/archive\">Buttondown Archive</a></div>';\n\t\treturn $html;\n\t}", "function Start(){\r\n\t\t\tglobal $email;\r\n\t\t\tglobal $errorCount;\r\n\t\t\t\r\n\t\t\t\t\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n\t\t\t\t\t\t\t\t\tglobal $emailCheck;\r\n\t\t\t\t\t\t\t\t\t$emailCheck = true;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (empty($email)){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (!empty($email) && (!filter_var($email, FILTER_VALIDATE_EMAIL))){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\tif(isset($_POST['Submit'])){\r\n\t\t\t//RedirectUser(); <--- Slight bug with this function, will work on it\r\n\t\t\tSubmitContent();\r\n\t\t\tBeginNewEntry();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function form_action()\r\n {\r\n $success = true ;\r\n\r\n $sdifqueue = new SDIFResultsQueue() ;\r\n $cnt = $sdifqueue->ProcessQueue() ;\r\n\r\n $c = container() ;\r\n $msgs = $sdifqueue->get_status_message() ;\r\n\r\n foreach ($msgs as $msg)\r\n $c->add(html_div(sprintf('ft-%s-msg', $msg['severity']), $msg['msg'])) ;\r\n $c->add(html_div('ft-note-msg',\r\n sprintf(\"%d record%s processed from SDIF Queue.\",\r\n $cnt, $cnt == 1 ? \"\" : \"s\"))) ;\r\n\r\n $this->set_action_message($c) ;\r\n\r\n unset($sdifqueue) ;\r\n\r\n return $success ;\r\n }", "public function ShowForm()\n\t\t{\n\t\t\tif (!$this->HasPermission()) {\n\t\t\t\t$this->NoPermission();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$GLOBALS['AddonId'] = $this->GetId();\n\t\t\t$GLOBALS['Message'] = GetFlashMessageBoxes();\n\t\t\t$this->ParseTemplate('emailchange.form');\n\t\t}", "public function submit(){\n $currentFlag\t=\t$this->contactHandler->getContactType();\n $this->updateMemcache($currentFlag);\n $this->contactHandler->getContactObj()->setType(ContactHandler::CANCEL);\n $this->contactHandler->getContactObj()->setSEEN(Contacts::NOTSEEN);\n $this->contactHandler->getContactObj()->updateContact();\n $this->handleMessage();\n //Remove from acceptance roster\n $producerObj=new Producer();\n if($producerObj->getRabbitMQServerConnected())\n {\n $chatData = array('process' => 'CHATROSTERS', 'data' => array('type' => 'CANCEL', 'body' => array('sender' => array('profileid'=>$this->contactHandler->getViewer()->getPROFILEID(),'checksum'=>JsAuthentication::jsEncryptProfilechecksum($this->contactHandler->getViewer()->getPROFILEID()),'username'=>$this->contactHandler->getViewer()->getUSERNAME()), 'receiver' => array('profileid'=>$this->contactHandler->getViewed()->getPROFILEID(),'checksum'=>JsAuthentication::jsEncryptProfilechecksum($this->contactHandler->getViewed()->getPROFILEID()),\"username\"=>$this->contactHandler->getViewed()->getUSERNAME()))), 'redeliveryCount' => 0);\n $producerObj->sendMessage($chatData);\n }\n\n // $this->updateContactSeen();\n $this->sendMail();\n }", "function feedbackAvaliador() {\n echo '<p class=\"feedback success\"><b>Revisor adicionado com sucesso.</b></p>';\n }", "function process_form()\n {\n }", "private function run() {\n\t\t\t$this->initRequestValidator();\n\t\t\t$this->printToolHead();\n\t\t\t\n\t\t\tif ($this->rq->allRequiredDefined() == true) {\n\t\t\t\t$this->formSubmitted();\n\t\t\t}\n\t\t}", "public function returnForm() {\r\n global $db;\r\n\r\n $this->status = PRESUBMITTED;\r\n\r\n $deanComments =\"\"; // we save the dean's comments before deleting the approval\r\n\r\n // delete all approvals from database.\r\n foreach($this->approvals AS $approval) {\r\n if($approval->type == COMMITMENTS || $approval->type == DEAN_REVIEW) {\r\n $deanComments = $approval->comments;\r\n }\r\n $approval->delete();\r\n }\r\n\r\n if(strlen($deanComments) > 0) {\r\n $sql = \"UPDATE forms_tracking SET `dean_comments`= '\" . $deanComments . \"' WHERE `form_tracking_id` = \" . $this->trackingFormId;\r\n $db->Execute($sql);\r\n }\r\n\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ResearcherNotification.php');\r\n\r\n $subject = sprintf('[TID-%s] Tracking form returned for modifications', $this->trackingFormId);\r\n $emailBody = sprintf('A tracking form was returned for modifications from your Dean :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nComments : %s\r\n\r\nPlease make any required modifications and re-submit the form.\r\n\r\n', $this->trackingFormId, $this->projectTitle, html_entity_decode(strip_tags($deanComments)));\r\n\r\n $ResearcherNotification = new ResearcherNotification($subject, $emailBody, $this->submitter);\r\n try {\r\n $ResearcherNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to Researcher : '. $e);\r\n }\r\n\r\n $this->saveMe();\r\n }", "protected function feedback()\n\t{\n\t\tif ($this->store['feedback_percent'] == 0) {\n\t\t\treturn;\n\t\t}\n\t\t$feedback = $this->store['feedback'] * $this->config->data()['feedback'];\n\t\t$feedbackPercent = ($this->store['feedback_percent'] / $this->config->data()['feedbackPercent']);\n\t\t$score = round($feedback / $feedbackPercent);\n\t\t$this->score += $score;\n\t}", "public function gui2()\n {\n require_code('form_templates');\n\n $submit_name = do_lang_tempcode('PROCEED');\n $post_url = build_url(array('page' => '_SELF', 'type' => 'actual'), '_SELF');\n\n $fields = new Tempcode();\n $hidden = new Tempcode();\n $already = array();\n $email_counter = 0;\n foreach ($_POST as $key => $input_value) {\n if (get_magic_quotes_gpc()) {\n $input_value = stripslashes($input_value);\n }\n\n if (substr($key, 0, 14) == 'email_address_') {\n $already[] = $input_value; //email address\n $email_counter++;\n $hidden->attach(form_input_hidden($key, $input_value));\n } else {\n // Add hidden field to the form\n if ($key != 'upload') {\n $hidden->attach(form_input_hidden($key, $input_value));\n }\n }\n }\n\n $hidden->attach(form_input_hidden('select_contacts_page', '1'));\n\n $text = do_lang_tempcode('RECOMMEND_SITE_TEXT_CHOOSE_CONTACTS', escape_html(get_site_name()));\n\n $page_title = get_param_string('page_title', null, true);\n if (is_null(get_param_string('from', null, true))) {\n $hidden->attach(form_input_hidden('wrap_message', '1'));\n }\n\n $success_read = false;\n\n // Start processing CSV file\n if ((get_option('enable_csv_recommend') == '1') && (!is_guest())) {\n if (array_key_exists('upload', $_FILES)) { // NB: We disabled plupload for this form so don't need to consider it\n if (is_uploaded_file($_FILES['upload']['tmp_name']) && preg_match('#\\.csv#', $_FILES['upload']['name']) != 0) {\n $possible_email_fields = array('E-mail', 'Email', 'E-mail address', 'Email address', 'Primary Email');\n $possible_name_fields = array('Name', 'Forename', 'First Name', 'Display Name', 'First');\n\n $fixed_contents = unixify_line_format(file_get_contents($_FILES['upload']['tmp_name']));\n require_code('files');\n cms_file_put_contents_safe($_FILES['upload']['tmp_name'], $fixed_contents, FILE_WRITE_FAILURE_SILENT);\n\n safe_ini_set('auto_detect_line_endings', '1');\n $myfile = fopen($_FILES['upload']['tmp_name'], 'rt');\n\n $del = ',';\n\n $csv_header_line_fields = fgetcsv($myfile, 10240, $del);\n if ((count($csv_header_line_fields) == 1) && (strpos($csv_header_line_fields[0], ';') !== false)) {\n $del = ';';\n rewind($myfile);\n $csv_header_line_fields = fgetcsv($myfile, 10240, $del);\n }\n\n $skip_next_process = false;\n\n if (function_exists('mb_convert_encoding')) {\n if ((function_exists('mb_detect_encoding')) && (strlen(mb_detect_encoding($csv_header_line_fields[0], \"ASCII,UTF-8,UTF-16,UTF16\")) == 0)) { // Apple mail weirdness\n // Test string just for Apple mail detection\n $test_unicode = utf8_decode(mb_convert_encoding($csv_header_line_fields[0], \"UTF-8\", \"UTF-16\"));\n if (preg_match('#\\?\\?ame#u', $test_unicode) != 0) {\n foreach ($csv_header_line_fields as $key => $value) {\n $csv_header_line_fields[$key] = utf8_decode(mb_convert_encoding($csv_header_line_fields[$key], \"UTF-8\", \"UTF-16\"));\n\n $found_email_address = '';\n $found_name = '';\n\n $first_row_exploded = explode(';', $csv_header_line_fields[0]);\n\n $email_index = 1; // by default\n $name_index = 0; // by default\n\n foreach ($csv_header_line_fields as $key2 => $value2) {\n if (preg_match('#\\?\\?ame#', $value2) != 0) {\n $name_index = $key2; // Windows mail\n }\n if (preg_match('#E\\-mail#', $value2) != 0) {\n $email_index = $key2; // both\n }\n }\n\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n foreach ($csv_line as $key2 => $value2) {\n $csv_line[$key2] = utf8_decode(mb_convert_encoding($value2, \"UTF-8\", \"UTF-16\"));\n }\n\n $found_email_address = (array_key_exists($email_index, $csv_line) && strlen($csv_line[$email_index]) > 0) ? $csv_line[$email_index] : '';\n $found_email_address = (preg_match('#.*\\@.*\\..*#', $found_email_address) != 0) ? preg_replace(\"#\\\"#\", '', $found_email_address) : '';\n $found_name = $found_email_address;\n\n if (strlen($found_email_address) > 0) {\n $skip_next_process = true;\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, $found_email_address, 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n $success_read = true;\n }\n }\n }\n }\n }\n }\n\n if (!$skip_next_process) {\n // There is a strange symbol that appears at start of the Windows Mail file, so we need to convert the first file line to catch these\n if ((function_exists('mb_check_encoding')) && (mb_check_encoding($csv_header_line_fields[0], 'UTF-8'))) {\n $csv_header_line_fields[0] = utf8_decode($csv_header_line_fields[0]);\n }\n\n // This means that we need to import from Windows mail (also for Outlook Express) export file, which is different from others csv export formats\n if (array_key_exists(0, $csv_header_line_fields) && (preg_match('#\\?Name#', $csv_header_line_fields[0]) != 0 || preg_match('#Name\\;E\\-mail\\sAddress#', $csv_header_line_fields[0]) != 0)) {\n $found_email_address = '';\n $found_name = '';\n\n $first_row_exploded = explode(';', $csv_header_line_fields[0]);\n\n $email_index = 1; // by default\n $name_index = 0; // by default\n\n foreach ($first_row_exploded as $key => $value) {\n if (preg_match('#\\?Name#', $value) != 0) {\n $name_index = $key; // Windows mail\n }\n if (preg_match('#^Name$#', $value) != 0) {\n $name_index = $key; // Outlook Express\n }\n if (preg_match('#E\\-mail\\sAddress#', $value) != 0) {\n $email_index = $key; // both\n }\n }\n\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n $row_exploded = (array_key_exists(0, $csv_line) && strlen($csv_line['0']) > 0) ? explode(';', $csv_line[0]) : array('', '');\n\n $found_email_address = (strlen($row_exploded[$email_index]) > 0) ? $row_exploded[$email_index] : '';\n $found_name = (strlen($row_exploded[$name_index]) > 0) ? $row_exploded[$name_index] : '';\n\n if (strlen($found_email_address) > 0) {\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, do_lang_tempcode('RECOMMENDING_TO_LINE', escape_html($found_name), escape_html($found_email_address)), 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n $success_read = true;\n }\n }\n } else {\n require_code('type_sanitisation');\n\n // Find e-mail\n $email_field_index = mixed();\n foreach ($possible_email_fields as $field) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if (strtolower($header_field) == strtolower($field)) {\n $email_field_index = $i;\n $success_read = true;\n break 2;\n }\n\n // No header\n if (is_email_address($header_field)) {\n $email_field_index = $i;\n $success_read = true;\n rewind($myfile);\n break 2;\n }\n }\n }\n\n if ($success_read) {\n // Find name\n $name_field_index = mixed();\n foreach ($possible_name_fields as $field) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if ((strtolower($header_field) == strtolower($field)) && ($i != $email_field_index)) {\n $name_field_index = $i;\n break 2;\n }\n }\n }\n // Hmm, first one that is not the email then\n if (is_null($name_field_index)) {\n foreach ($csv_header_line_fields as $i => $header_field) {\n if ($i != $email_field_index) {\n $name_field_index = $i;\n break;\n }\n }\n }\n\n // Go through all records\n while (($csv_line = fgetcsv($myfile, 10240, $del)) !== false) { // Reading a CSV record\n if (empty($csv_line[$email_field_index])) {\n continue;\n }\n if (empty($csv_line[$name_field_index])) {\n continue;\n }\n\n $found_email_address = $csv_line[$email_field_index];\n $found_name = ucwords($csv_line[$name_field_index]);\n\n if (is_email_address($found_email_address)) {\n // Add to the list what we've found\n $fields->attach(form_input_tick($found_name, do_lang_tempcode('RECOMMENDING_TO_LINE', escape_html($found_name), escape_html($found_email_address)), 'use_details_' . strval($email_counter), true));\n $hidden->attach(form_input_hidden('details_email_' . strval($email_counter), $found_email_address));\n $hidden->attach(form_input_hidden('details_name_' . strval($email_counter), $found_name));\n $email_counter++;\n }\n }\n }\n }\n }\n\n fclose($myfile);\n }\n }\n }\n\n if (!$success_read) {\n warn_exit(do_lang_tempcode('ERROR_NO_CONTACTS_SELECTED'));\n }\n\n return do_template('FORM_SCREEN', array('_GUID' => 'e3831cf87d76295c48cbce627bdd07e3', 'PREVIEW' => true, 'SKIP_WEBSTANDARDS' => true, 'TITLE' => $this->title, 'HIDDEN' => $hidden, 'FIELDS' => $fields, 'URL' => $post_url, 'SUBMIT_ICON' => 'menu__site_meta__recommend', 'SUBMIT_NAME' => $submit_name, 'TEXT' => $text));\n }", "public function on_after_submit() {\n\t\t\n\t\t/*\n\t\t$post = array();\n\t\t$post['cm-name'] = $this->controller->questionAnswerPairs['1']['answer'].' '.$this->controller->questionAnswerPairs['2']['answer'];\n\t\t$post['cm-itutkr-itutkr'] = $this->controller->questionAnswerPairs['3']['answer'];\n\t\t\t\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 0);\n\t\tcurl_setopt($ch, CURLOPT_URL, 'http://url.to.my.campaignmonitor/myform');\n\t\t//Don't ask me what this does, I just know that without this funny header, the whole thing doesn't work!\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER,array('Expect:'));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1 );\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post );\n\t\t\n\t\t$url = curl_exec( $ch );\n\t\tcurl_close ($ch);\n\t\t*/\n\t}", "function user_feedback() {\n\t\t$user_email = $_POST['user_email'];\n\t\t$user_name = $_POST['user_name'];\n\t\t$user_msg = $_POST['user_msg'];\n\t\tif (!empty($user_email) && !empty($user_msg) && !empty($user_name)) {\n\t\t\t$insert = $this -> conn -> insertnewrecords('user_feedbacks', 'user_email, user_name,user_msg', '\"' . $user_email . '\",\"' . $user_name . '\",\"' . $user_msg . '\"');\n\t\t\tif (!empty($insert)) {\n\t\t\t\t$post = array('status' => \"true\", \"message\" => \"Thanks for your feedback\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'user_email' => $user_email, 'user_name' => $user_name, 'user_msg' => $user_msg);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "private function showHowRequestForm() {\r\n $this->config->showPrinterFriendly = false;\r\n echo '<h2>How would you like to use this time?</h2>';\r\n $this->showSubTimeTypeDropDown();\r\n echo '<input type=\"hidden\" name=\"maxCalDays\" value=\"' . $this->maxCalDays . '\" />';\r\n echo '<br/><br/><br/>';\r\n }", "public function askFaq()\n {\n $faq = new \\Model\\Entity\\Faq();\n\n if (!empty($_POST)){\n $faq->setSubject($_POST['subject']);\n $faq->setQuestion($_POST['question']);\n\n if ($faq->isValid()){\n $faqManager = new FaqManager();\n $faqManager->create($faq);\n View::show(\"faq/questionsend.php\", \"Question send\");\n }\n }\n else{\n View::show(\"faq/askFaq.php\", \"Ask your question\");\n }\n }", "function show_form()\n\t\t{\n\t\t\t//set a global template for interactive activities\n\t\t\t$this->t->set_file('run_activity','run_activity.tpl');\n\t\t\t\n\t\t\t//set the css style files links\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'run_activity_css_link'\t=> $this->get_css_link('run_activity', $this->print_mode),\n\t\t\t\t'run_activity_print_css_link'\t=> $this->get_css_link('run_activity', true),\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t// draw the activity's title zone\n\t\t\t$this->parse_title($this->activity_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_name to the requested one or the stored name\n\t\t\t// the requested one handle the looping in activity form\n\n\t\t\t$wf_name = get_var('wf_name','post',$this->instance->getName());\n\t\t\t$this->parse_instance_name($wf_name);\n\n\t\t\t//draw the instance_name input or label\n\t\t\t// init wf_set_owner to the requested one or the stored owner\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$wf_set_owner = get_var('wf_set_owner','post',$this->instance->getOwner());\n\t\t\t$this->parse_instance_owner($wf_set_owner);\n\t\t\t\n\t\t\t// draw the activity central user form\n\t\t\t$this->t->set_var(array('activity_template' => $this->wf_template->parse('output', 'template')));\n\t\t\t\n\t\t\t//draw the select priority box\n\t\t\t// init priority to the requested one or the stored priority\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$priority = get_var('wf_priority','post',$this->instance->getPriority());\n\t\t\t$this->parse_priority($priority);\n\t\t\t\n\t\t\t//draw the select next_user box\n\t\t\t// init next_user to the requested one or the stored one\n\t\t\t// the requested one handle the looping in activity form\n\t\t\t$next_user = get_var('wf_next_user','POST',$this->instance->getNextUser());\n\t\t\t$this->parse_next_user($next_user);\n\t\t\t\n\t\t\t//draw print_mode buttons\n\t\t\t$this->parse_print_mode_buttons();\n\t\t\t\n\t\t\t//draw the activity submit buttons\t\n\t\t\t$this->parse_submit();\n\t\t\t\n\t\t\t//draw the info zone\n\t\t\t$this->parse_info_zone();\n\t\t\t\n\t\t\t//draw the history zone if user wanted it\n\t\t\t$this->parse_history_zone();\n\t\t\t\n\t\t\t$this->translate_template('run_activity');\n\t\t\t$this->t->pparse('output', 'run_activity');\n\t\t\t$GLOBALS['egw']->common->egw_footer();\n\t\t}", "private function showWhyRequestForm() { $this->config->showPrinterFriendly = false;\r\n echo '<h2>Why are you requesting time?</h2>';\r\n $this->showTimeTypeDropDown();\r\n echo '<br/><br/><br/>';\r\n }", "function Form_Mail()\n {\n /**\n * Form_Mail();\n */\n\n $this->referers_array = array($_SERVER[\"HTTP_HOST\"]);\n /**\n * Leave AS IS to only allow posting from same host that script resides on.\n * List individual hosts to create list of hosts that can post to this script:\n * EXAMPLE: $referer_array = array ('example.com','www.example.com','192.168.0.1');\n */\n\n /* proccess form */\n $this->set_arrays();\n $this->check_referer();\n $this->check_recipient();\n $this->check_required_fields();\n $this->send_form();\n $this->display_thankyou();\n }", "public function feedback_notice() {\n\t\tif ( ! $this->is_feedback_notice_active() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$username = get_user_meta( get_current_user_id(), 'first_name', true );\n\t\t?>\n\t\t<div id=\"wpba-notice-feedback\" class=\"notice notice-info is-dismissible\">\n\t\t\t<p>\n\t\t\t\t<?php printf( __( \"Hey%s! We're just a small plugin, and we need your help! You've been using the <em>Advanced Bulk Actions</em> plugin for some time now, and we were wondering whether you had any suggestions for bulk actions to add. We'd really appreciate it if you could send us you're feedback!\", 'wpba' ), ( $username ? ( ' ' . $username ) : '' ) ); ?>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<a href=\"https://wordpress.org/support/plugin/bulk-actions#new-post\" title=\"<?php esc_attr_e( 'Send us your feedback!', 'wpba' ); ?>\" class=\"button button-secondary\" target=\"_blank\"><?php _e( 'Send us your feedback!', 'wpba' ); ?></a> <?php _e( '(opens in a new tab)', 'wpba' ); ?> <?php printf( __( 'or %s.', 'wpba' ), '<a href=\"#\" class=\"hide\">' . __( 'hide this message forever', 'wpba' ) . '</a>' ); ?>\n\t\t\t</p>\n\t\t</div>\n\t\t<?php\n\t}", "function renderFeedbackForm()\r\n{\r\n if ($GLOBALS['position'] == \"Manager\" || $GLOBALS['position'] == \"Assistant Manager\") {\r\n echo \"<div class='p2'> <table border='0' class='table table-striped table-hover' id='TableFeedback'> <thead> <tr> <th scope='col'>Feedback ID</td> <th scope='col'>Feedback</td> <th scope='col'>Delete</td> <th scope='col'>Fixed</th> </tr> </thead> <tbody>\";\r\n $sql = \"SELECT * from Feedback WHERE Complete=0\";\r\n $result = mysqli_query($GLOBALS['db'], $sql);\r\n while ($row = mysqli_fetch_assoc($result)) {\r\n $id = $row['Feedback_ID'];\r\n $data = $row['Feedback'];\r\n echo(\" <tr id='$id'> <td>$id</td> <td>$data</td> <td><a class='btn btn-danger' href='#' role='button' onclick='deleteFeedback(\\\"$id\\\")'>Delete</a></td> <td><a class='btn btn-success' href='#' role='button' onclick='markFeedbackAsFix(\\\"$id\\\")'>Fixed <a></td> </tr>\r\n \");\r\n }\r\n echo \"</tbody></table></div>\";\r\n } else {\r\n notPermit();\r\n }\r\n /*\r\n TODO \r\n 1. Render the feedback and remove delete function \r\n\r\n Requirement \r\n 1. No delete \r\n 2. Double confirm\r\n */\r\n}", "protected function onSubmit()\r {\r }", "function feedback()\n\t{\n\t\treturn \" <!-- Modal Trigger button to be fixed placed -->\n\t\t\t\t<button class='btn btn-info' data-toggle='modal' data-target='#feedbackModal' id='btnFBModal'><span class='glyphicon glyphicon-comment'></span></button>\n\n\t\t\t\t<!-- Modal -->\n\t\t\t\t<div id='feedbackModal' class='modal fade' role='dialog'>\n\t\t\t\t <div class='modal-dialog'>\n\n\t\t\t\t\t<!-- Modal content-->\n\t\t\t\t\t<div class='modal-content'>\n\t\t\t\t\t <div class='modal-header'>\n\t\t\t\t\t\t<button type='button' class='close' data-dismiss='modal'>&times;</button>\n\t\t\t\t\t\t<h4 class='modal-title'>Newbs Unit'd Feedback Form</h4>\n\t\t\t\t\t </div>\n\t\t\t\t\t <div class='modal-body'>\n\t\t\t\t\t\t<p>Please use this form to provide any feedback that you have</p>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<label class='radio-inline'><input type='radio' value='Comment' name='fb' checked>Comment</label>\n\t\t\t\t\t\t\t<label class='radio-inline'><input type='radio' value='Recommendation' name='fb'>Recommendation</label>\n\t\t\t\t\t\t\t<label class='radio-inline'><input type='radio' value='Bug' name='fb'>Bug</label>\n\t\t\t\t\t\t\t<label class='radio-inline'><input type='radio' value='Criticism' name='fb'>Criticism</label>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<textarea class='form-control' rows='6' id='txtFeedback'></textarea><br/>\n\t\t\t\t\t\t<button class='btn btn-info' id='btnFeedback'>Submit</button>\n\t\t\t\t\t\t\n\t\t\t\t\t </div>\n\t\t\t\t\t <div class='modal-footer'>\n\t\t\t\t\t\t<div id='fbMsg' class='text-center'></div>\n\t\t\t\t\t\t<button type='button' class='btn btn-default' data-dismiss='modal'>Close</button>\n\t\t\t\t\t </div>\n\t\t\t\t\t</div>\n\n\t\t\t\t </div>\n\t\t\t\t</div>\";\n\t}", "static private function submitEmail()\n {\n $id = $_POST['formid'];\n\n // Initiates new form handling instance\n $f = new FormHandling;\n\n // Gets the client email list (to, bcc, cc)\n $clientEmailList = $f->getClientEmail($id);\n\n // Gets the customer email (if set)\n $customerEmail = $f->getCustomerEmail($_POST);\n\n // dd($customerEmail);\n\n // Checks if in sandbox mode before sending email\n if(FALSE == submissionHandling::sandbox){\n\n // New email instance\n $e = new emailHandling();\n\n // render and send client email(s)\n if($clientEmailList['to']){\n $e->sendEmail($id,'client',$clientEmailList['to'],'Enquiry received','Hi',$clientEmailList['headers']);\n }\n\n // render and send customer email\n if($customerEmail){\n $e->sendEmail($id,'customer',$customerEmail,'Thanks for getting in touch','We will be in touch soon');\n }\n\n }\n }", "public function contact_form()\n\t{\n\t\tif ($this->errstr)\n\t\t{\n\t\t\tFsb::$tpl->set_switch('error');\n\t\t}\n\n\t\tFsb::$tpl->set_file('user/user_contact.html');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'ERRSTR' =>\t\t\tHtml::make_errstr($this->errstr),\n\t\t));\n\t\t\n\t\t// Champs contacts crees par l'administrateur\n\t\tProfil_fields_forum::form(PROFIL_FIELDS_CONTACT, 'contact', Fsb::$session->id());\n\t}", "public function output_setup_form() {\n\t\t$related_api = Thrive_Dash_List_Manager::connection_instance( 'mandrill' );\n\t\tif ( $related_api->is_connected() ) {\n\t\t\t$credentials = $related_api->get_credentials();\n\t\t\t$this->set_param( 'email', $credentials['email'] );\n\t\t\t$this->set_param( 'mandrill-key', $credentials['key'] );\n\t\t}\n\n\t\t$this->output_controls_html( 'mailchimp' );\n\t}", "function formSuccess() {\n\n // Template\n $this->r->text['back_url'] = suxFunct::getPreviousURL();\n $this->r->title .= \" | {$this->r->gtext['success']}\";\n\n $this->tpl->display('success.tpl');\n\n }", "public function form()\n {\n\n $this->display('id', '申请ID')->default($this->payload['id']);\n $this->display('uid', '申请人UID')->default($this->payload['uid']);\n $this->display('status', '状态')->default(\\App\\Admin\\Repositories\\BusinessApply::$statusLabel[$this->payload['status']]);\n\n\n $this->radio('process', '处理')\n ->options([\n 1 => '通过',\n 2 => '拒绝',\n ]);\n\n $this->text('msg', '审核回复');\n\n }", "function feedback($is_input_correct)\n\t{\n\t\t$this->_post_data(\"http://bypasscaptcha.com/check_value.php\", array(\n\t\t\t\t\t\t\t\"key\" \t\t=> $this->_get_key(),\n\t\t\t\t\t\t\t\"task_id\" \t=> $this->task_id,\n\t\t\t\t\t\t\t\"cv\" \t\t=> ($is_input_correct ? 1 : 0),\n\t\t\t\t\t\t\t\"submit\" \t=> \"Submit\",\n\t\t));\n\t}", "public function feedForm()\n {\n $this -> connector -> write(self::FF);\n }", "function submit() {\n\t\tThesisHandler::setupTemplate();\n\n\t\t$journal = &Request::getJournal();\n\t\t$journalId = $journal->getJournalId();\n\n\t\t$thesisPlugin = &PluginRegistry::getPlugin('generic', 'ThesisPlugin');\n\n\t\tif ($thesisPlugin != null) {\n\t\t\t$thesesEnabled = $thesisPlugin->getEnabled();\n\t\t}\n\n\t\tif ($thesesEnabled) {\n\t\t\t$thesisPlugin->import('StudentThesisForm');\n\n\t\t\t$templateMgr = &TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'thesis'), 'plugins.generic.thesis.theses'));\n\t\t\t$thesisDao = &DAORegistry::getDAO('ThesisDAO');\n\n\t\t\t$thesisForm = &new StudentThesisForm();\n\t\t\t$thesisForm->initData();\n\t\t\t$thesisForm->display();\n\n\t\t} else {\n\t\t\t\tRequest::redirect(null, 'index');\n\t\t}\n\t}", "function show_bid_feedback_by_user_form()\n{\n\n if (! user_has_priv (PRIV_BID_CHAIR))\n return display_access_error ();\n\n // Make sure we've got a UserId\n\n if (! array_key_exists ('UserId', $_REQUEST))\n return display_error ('Failed to find UserId in $_REQUEST array');\n\n $UserId = intval($_REQUEST['UserId']);\n if ($UserId < 1)\n return display_error (\"Invalid value for $$UserId: $UserId\");\n\n // Get the ConCom member's name\n\n $sql = \"SELECT FirstName, LastName FROM Users WHERE UserId=$UserId\";\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('Query for User Name failed', $sql);\n\n $row = mysql_fetch_object($result);\n if (! $row)\n return display_error (\"Failed to find user for $$UserId: $UserId\");\n\n $name = trim (\"$row->FirstName $row->LastName\");\n\n display_header (\"Bid Committee Feedback for $name\");\n\n // dump_array ('$_REQUEST', $_REQUEST);\n // dump_array ('$_POST before being filled', $_POST);\n\n // Populate the $_POST array, if necessary\n\n if (! array_key_exists ('BidCount', $_POST))\n {\n // Gather the list of bids under discussion\n\n $sql = 'SELECT Bids.Title, BidStatus.BidStatusId';\n $sql .= ' FROM BidStatus,Bids';\n $sql .= ' WHERE Consensus=\"Discuss\"';\n $sql .= ' AND Bids.BidId=BidStatus.BidId';\n $sql .= ' ORDER BY Bids.Title';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('Query failed for bids under discussion',\n\t\t\t\t $sql);\n\n $_POST['BidCount'] = mysql_num_rows($result);\n if (0 == $_POST['BidCount'])\n return display_error ('There are no bids under discussion');\n\n $bids = array();\n $b = 1;\n\n while ($row = mysql_fetch_object($result))\n {\n $_POST[\"BidStatusId_$b\"] = $row->BidStatusId;\n $_POST[\"Title_$b\"] = $row->Title;\n $bids[$row->BidStatusId] = $b;\n $b++;\n }\n\n // Now gather any existing Feedback\n\n $sql = 'Select BidFeedback.Vote, BidFeedback.Issues,';\n $sql .= 'BidFeedback.FeedbackId, BidFeedback.BidStatusId';\n $sql .= ' FROM BidFeedback, BidStatus';\n $sql .= \" WHERE BidFeedback.UserId=$UserId\";\n $sql .= ' AND BidStatus.BidStatusId=BidFeedback.BidStatusId';\n $sql .= ' AND BidStatus.Consensus=\"Discuss\"';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('Failed to fetch feedback', $sql);\n\n while ($row = mysql_fetch_object($result))\n {\n $b = $bids[$row->BidStatusId];\n $_POST[\"Vote_$b\"] = $row->Vote;\n $_POST[\"Issues_$b\"] = $row->Issues;\n $_POST[\"FeedbackId_$b\"] = $row->FeedbackId;\n $_POST[\"BidStatusId_$b\"] = $row->BidStatusId;\n $bids[$row->BidStatusId] = 0;\n }\n\n // Now deal with any new entries\n\n foreach ($bids as $key => $b)\n {\n if (0 == $b)\n\tcontinue;\n\n $_POST[\"Vote_$b\"] = 'Undecided';\n $_POST[\"Issues_$b\"] = '';\n $_POST[\"FeedbackId_$b\"] = 0;\n $_POST[\"BidStatusId_$b\"] = $key;\n }\n\n // dump_array ('$_POST after being filled', $_POST);\n\n }\n\n $BidCount = intval($_POST['BidCount']);\n\n echo \"<form method=\\\"POST\\\" action=\\\"Bids.php\\\">\\n\";\n form_add_sequence ();\n form_hidden_value ('action', BID_FEEDBACK_PROCESS_BY_CONCOM);\n form_hidden_value ('UserId', $UserId);\n form_hidden_value ('BidCount', $BidCount);\n echo \"<table>\\n\";\n echo \" <tr>\\n\";\n echo \" <th>Game</th>\\n\";\n echo \" <th>Vote</th>\\n\";\n echo \" <th>Issue(s)</th>\\n\";\n echo \" </tr>\\n\";\n\n for ($b = 1; $b <= $BidCount; $b++)\n {\n echo \" <tr>\\n\";\n printf (\" <td>%s</td>\\n\", $_POST[\"Title_$b\"]);\n form_vote (\"Vote_$b\");\n form_issues (\"Issues_$b\");\n form_hidden_value (\"Title_$b\", $_POST[\"Title_$b\"]);\n form_hidden_value (\"FeedbackId_$b\", $_POST[\"FeedbackId_$b\"]);\n form_hidden_value (\"BidStatusId_$b\", $_POST[\"BidStatusId_$b\"]);\n echo \" </tr>\\n\";\n }\n\n form_submit ('Submit', 3);\n\n echo \"</table>\\n\";\n}", "function initForm(&$conf) {\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\n\t\t// Create shortcuts to these arrays\n\t\t$this->conf = &$conf;\n\t\t$this->data = &$this->cObj->data;\n\n\t\t$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow( 'uid', 'pages', \"module='newsletter'\" );\n\t\t$this->newsletterPID = is_array($row) ? current($row) : 0;\n\t\t$this->newsletterRegEnabled = $this->newsletterPID && $this->data['tx_gokontakt_newsletterUsergroup'];\n\n\t\t$this->submitted = (int) $this->piVars['submitted'];\n\t\tif ( !$this->submitted ) { // first call\n\t\t\t// reset session\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey, NULL);\n\t\t\t$GLOBALS[\"TSFE\"]->fe_user->setKey(\"ses\", $this->extKey . \"_successfully_submitted\", 0);\n\t\t}\n\n\t\tif ( $this->piVars['uid'] == $this->data['uid'] ) { // if this form has been submitted\n\t\t\t$this->mergePiVarsWidthSession();\n\t\t} else { // if a different form has been submitted\n\t\t\t$this->piVars = array();\n\t\t}\n\t}", "public function renderForm()\n\t{\n\t\t$this->beginForm();\n\t\t$this->renderMessageInput();\n\t\techo Html::beginTag('div', array('class' => 'chat-from-actions'));\n\t\t$this->renderSubmit();\n\t\techo Html::endTag('div');\n\t\t$this->endForm();\n\t}", "public function displayBeforeForm(){\n if(get_post_type() != WPLMS_ASSIGNMENTS_CPT)\n return;\n if(empty($this->plupload_assignment_e_d))\n echo '</form><form action=\"'.site_url( '/wp-comments-post.php' ).'\" method=\"post\" enctype=\"multipart/form-data\" id=\"attachmentForm\" class=\"comment-form\" novalidate>';\n }", "public function submit() {\r\n global $db;\r\n\r\n $this->status = SUBMITTED;\r\n $this->saveMe();\r\n\r\n $sql = \"SELECT d.division_id FROM users as u\r\n LEFT JOIN departments AS d ON d.department_id = u.department_id\r\n WHERE u.user_id = \" . $this->userId;\r\n $divisionId = $db->getRow($sql);\r\n\r\n // save the approvals to the database\r\n foreach($this->approvals as $approval) {\r\n $approval->save($divisionId['division_id']);\r\n }\r\n\r\n $sql = sprintf(\"UPDATE `forms_tracking` SET\r\n `submit_date` = NOW()\r\n WHERE `form_tracking_id` = %s\",\r\n $this->trackingFormId\r\n );\r\n $db->Execute($sql);\r\n\r\n $this->sendSubmissionConfirmationEmail();\r\n\r\n // send notifications\r\n $this->notifyORS();\r\n\r\n // notify Dean if deadline is within DEAN_NOTIFICATION_THRESHOLD_DAYS\r\n if(isset($this->deadline)) {\r\n $dateThreshold = strtotime(DEAN_NOTIFICATION_THRESHOLD_DAYS);\r\n $deadline = strtotime($this->deadline);\r\n if($deadline < $dateThreshold) {\r\n $this->notifyDean();\r\n }\r\n }\r\n\r\n if($this->compliance->requiresBehavioural()) {\r\n $this->notifyHREB();\r\n }\r\n }", "function bab_pm_formsend()\n{\n $bab_pm_PrefsTable = safe_pfx('bab_pm_list_prefs');\n $bab_pm_SubscribersTable = safe_pfx('bab_pm_subscribers');\n\n $bab_pm_radio = ps('bab_pm_radio'); // this is whether to mail or not, or test\n\n if ($bab_pm_radio == 'Send to Test') {\n $bab_pm_radio = 2;\n }\n\n if ($bab_pm_radio == 'Send to List') {\n $bab_pm_radio = 1;\n }\n\n if ($bab_pm_radio != 0) { // if we have a request to send, start the ball rolling....\n // email from override\n $sendFrom = gps('sendFrom');\n\n $listToEmail = (!empty($_REQUEST['listToEmail'])) ? gps('listToEmail') : gps('list');\n // $listToEmail = gps('listToEmail'); // this is the list name\n $subject = gps('subjectLine');\n $form = gps('override_form');\n\n // ---- scrub the flag column for next time:\n $result = safe_query(\"UPDATE $bab_pm_SubscribersTable SET flag = NULL\");\n\n //time to fire off initialize\n // bab_pm_initialize_mail();\n $path = \"?event=postmaster&step=initialize_mail&radio=$bab_pm_radio&list=$listToEmail&artID=$artID\";\n\n if (!empty($sendFrom)) {\n $path .= \"&sendFrom=\" . urlencode($sendFrom);\n }\n\n if (!empty($subject)) {\n $path .= \"&subjectLine=\" . urlencode($subject);\n }\n\n if ($_POST['use_override'] && !empty($form)) {\n $path .= \"&override_form=$form&use_override=1\";\n }\n\n header(\"HTTP/1.x 301 Moved Permanently\");\n header(\"Status: 301\");\n header(\"Location: \".$path);\n header(\"Connection: close\");\n }\n\n $options = '';\n $form_select = '';\n\n // get available lists to create dropdown menu\n $bab_pm_lists = safe_query(\"select * from $bab_pm_PrefsTable\");\n\n while ($row = @mysqli_fetch_row($bab_pm_lists)) {\n $options .= \"<option>$row[1]</option>\";\n }\n\n $selection = '<select id=\"listToEmail\" name=\"listToEmail\">' . $options . '</select>';\n\n $form_list = safe_column('name', 'txp_form',\"name like 'newsletter-%'\");\n\n if (count($form_list) > 0) {\n foreach ($form_list as $form_item) {\n $form_options[] = \"<option>$form_item</option>\";\n }\n\n $form_select = '<select name=\"override_form\">' . join($form_options,\"\\n\") . '</select>';\n $form_select .= checkbox('use_override', '1', '').'Use override?';\n }\n\n if (isset($form_select) && !empty($form_select)) {\n $form_select = <<<END\n <div style=\"margin-top:5px\">\n Override form [optional]: $form_select\n </div>\nEND;\n }\n echo <<<END\n<form action=\"\" method=\"post\" accept-charset=\"utf-8\">\n <fieldset id=\"bab_pm_formsend\">\n <legend><span class=\"bab_pm_underhed\">Form-based Send</span></legend>\n <div style=\"margin-top:5px\">\n <label for=\"listToEmail\" class=\"listToEmail\">Select list:</label> $selection\n </div>\n $form_select\n <label for=\"sendFrom\" class=\"sendFrom\">Send From:</label><input type=\"text\" name=\"sendFrom\" value=\"\" id=\"sendFrom\" /><br />\n <label for=\"subjectLine\" class=\"subjectLine\">Subject Line:</label><input type=\"text\" name=\"subjectLine\" value=\"\" id=\"subjectLine\" /><br />\n\n <p><input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to Test\" class=\"publish\" />\n &nbsp;&nbsp;\n <input type=\"submit\" name=\"bab_pm_radio\" value=\"Send to List\" class=\"publish\" /></p>\n </fieldset>\n</form>\nEND;\n}", "function userFeedback() {\n if (isset($_GET['feedback'])) {\n switch ($_GET['feedback']) {\n case 1:\n echo '<div class=\"bad\">Login failed - Invalid EMAIL/USER ID and/or PASSWORD</div>';\n break;\n case 2:\n echo '<div class=\"bad\">Login failed - EMAIL/USER ID not activated - Check email</div>';\n break;\n case 3:\n echo '<div class=\"bad\">Registration failed - EMAIL/USER ID already exists</div>';\n break;\n case 4:\n echo '<div class=\"good\">Registration successful - Activate EMAIL/USER ID - Check email</div>';\n break;\n case 5:\n echo '<div class=\"good\">Password retrieval successful - Check email</div>';\n break;\n case 6:\n echo '<div class=\"bad\">Password retrieval failed - Invalid EMAIL/USER ID</div>';\n break;\n case 7:\n echo '<div class=\"bad\">Restricted access - Login required</div>';\n break;\n case 8:\n echo '<div class=\"good\">Insert successful</div><hr />';\n break;\n case 9:\n echo '<div class=\"good\">Login successful</div><hr />';\n break;\n case 10:\n echo '<div class=\"good\">Delete successful</div><hr />';\n break;\n case 11:\n echo '<div class=\"good\">Application successful</div>';\n break;\n case 12:\n echo '<div class=\"bad\">Application failed</div>';\n break;\n case 13:\n echo '<div class=\"good\">System administrator has been notified</div>';\n break;\n case 14:\n echo '<div class=\"good\">Logout successful</div><hr />';\n break;\n case 15:\n echo '<div class=\"good\">Update successful</div><hr />';\n break;\n }\n }\n}", "function buildQuickForm( ) {\n // and the grades\n require_once 'School/Utils/Conference.php';\n $details = School_Utils_Conference::getReminderDetails( );\n $string = array();\n foreach ( $details as $name => $grade ) {\n $string[] = \"{$name} (Grade: {$grade})\";\n }\n $this->assign( 'conferenceTeachers',\n implode( ', ', $string ) );\n\n $this->addButtons(array( \n array ( 'type' => 'refresh', \n 'name' => ts( 'Send Reminder' ),\n 'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', \n 'isDefault' => true ), \n array ( 'type' => 'cancel', \n 'name' => ts('Cancel') ), \n )\n );\n }", "function show_bid_feedback_entry_form()\n{\n\n if ((! user_has_priv (PRIV_BID_COM)) &&\n (! user_has_priv (PRIV_BID_CHAIR)) &&\n (! user_has_priv (PRIV_GM_LIAISON)))\n return display_access_error ();\n\n if (! array_key_exists ('UserId', $_REQUEST))\n return display_error ('Failed to find UserId in $_REQUEST array');\n\n $UserId = intval($_REQUEST['UserId']);\n if ($UserId < 1)\n return display_error (\"Invalid value for $$UserId: $UserId\");\n\n $sql = \"SELECT FirstName, LastName FROM Users WHERE UserId=$UserId\";\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('Query for User Name failed', $sql);\n\n $row = mysql_fetch_object($result);\n if (! $row)\n return display_error (\"Failed to find user for $$UserId: $UserId\");\n\n $name = trim (\"$row->FirstName $row->LastName\");\n\n $BidStatusId = 0;\n $FeedbackId = 0;\n\n if (array_key_exists ('FeedbackId', $_REQUEST))\n $FeedbackId = intval ($_REQUEST['FeedbackId']);\n\n $Vote = 'Undecided';\n $Title = 'Unknown';\n $Issues = '';\n\n if (0 != $FeedbackId)\n {\n $sql = 'SELECT BidFeedback.Vote, BidFeedback.Issues,';\n $sql .= ' BidFeedback.BidStatusId, Bids.Title';\n $sql .= ' FROM Bids, BidStatus, BidFeedback';\n $sql .= \" WHERE BidFeedback.FeedbackId=$FeedbackId\";\n $sql .= ' AND BidStatus.BidStatusId=BidFeedback.BidStatusId';\n $sql .= ' AND Bids.BidId=BidStatus.BidId';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error('Query failed for bid info', $sql);\n\n if (0 == mysql_num_rows($result))\n return display_error(\"Failed to find bid info for FeedbackId: $FeedbackId\");\n\n $row = mysql_fetch_object($result);\n $Vote = $row->Vote;\n $Issues = $row->Issues;\n $Title = $row->Title;\n $BidStatusId = $row->BidStatusId;\n }\n else\n {\n // If we don't have a FeedbackId, we'd better have a BidStatusId\n\n if (! array_key_exists ('BidStatusId', $_REQUEST))\n return display_error ('Failed to find BidStatusIdId in $_REQUEST array');\n\n $BidStatusId = intval($_REQUEST['BidStatusId']);\n if (0 == $BidStatusId)\n return display_error (\"Invalid BidStatusId: $BidStatusId\");\n\n $sql = 'SELECT Bids.Title';\n $sql .= ' FROM Bids, BidStatus';\n $sql .= \" WHERE BidStatus.BidStatusId=$BidStatusId\";\n $sql .= ' AND Bids.BidId=BidStatus.BidId';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error('Query failed for bid info', $sql);\n\n if (0 == mysql_num_rows($result))\n return display_error(\"Failed to find bid info for FeedbackId: $FeedbackId\");\n\n $row = mysql_fetch_object($result);\n $Title = $row->Title;\n }\n\n // If this is the first time in, fill in the $_POST array\n\n if (! array_key_exists ('Vote', $_POST))\n {\n $_POST['Vote'] = $Vote;\n $_POST['Issues'] = $Issues;\n }\n\n display_header (\"Bid Committee Feedback for $name on <i>$Title</i>\");\n\n echo \"<form method=\\\"POST\\\" action=\\\"Bids.php\\\">\\n\";\n form_add_sequence ();\n form_hidden_value ('action', BID_FEEDBACK_PROCESS_ENTRY);\n form_hidden_value ('FeedbackId', $FeedbackId);\n form_hidden_value ('BidStatusId', $BidStatusId);\n form_hidden_value ('UserId', $UserId);\n\n echo \"<table>\\n\";\n echo \" <tr>\\n\";\n echo \" <th valign=\\\"top\\\" align=\\\"right\\\">Vote:&nbsp;&nbsp;</th>\\n\";\n form_vote('Vote');\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <th valign=\\\"top\\\" align=\\\"right\\\">Issues:&nbsp;&nbsp;</th>\\n\";\n form_issues('Issues');\n echo \" </tr>\\n\";\n form_submit ('Update Feedback');\n echo \"</table>\\n\";\n}", "function osg_singout_notifier_form_submit($form, & $form_state) {\n osg_singout_notifier_mail_send($form_state['values']);\n}", "public static function easyFormStart()\n {\n echo '<!-- EasyCreator START -->'.NL;\n\n echo '<div id=\"ecr_box\">'.NL;\n\n echo '<form action=\"index.php?option=com_easycreator\" method=\"post\" '\n .'name=\"adminForm\" id=\"adminForm\">'.NL;\n }", "public function show(Feedback $feedback)\n {\n //\n }", "public function show(Feedback $feedback)\n {\n //\n }", "public function thankYouAction(){\n\t}", "function show_bid_feedback_entry_form()\n{\n\n if ((! user_has_priv (PRIV_BID_COM)) &&\n (! user_has_priv (PRIV_BID_CHAIR)) &&\n (! user_has_priv (PRIV_GM_LIAISON)))\n return display_access_error ();\n\n if (! array_key_exists ('UserId', $_REQUEST))\n return display_error ('Failed to find UserId in $_REQUEST array');\n\n $UserId = intval($_REQUEST['UserId']);\n if ($UserId < 1)\n return display_error (\"Invalid value for $$UserId: $UserId\");\n\n $sql = \"SELECT DisplayName FROM Users WHERE UserId=$UserId\";\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('Query for User Name failed', $sql);\n\n $row = mysql_fetch_object($result);\n if (! $row)\n return display_error (\"Failed to find user for $$UserId: $UserId\");\n\n $name = trim (\"$row->DisplayName\");\n\n $BidStatusId = 0;\n $FeedbackId = 0;\n\n if (array_key_exists ('FeedbackId', $_REQUEST))\n $FeedbackId = intval ($_REQUEST['FeedbackId']);\n\n $Vote = 'Undecided';\n $Title = 'Unknown';\n $Issues = '';\n\n if (0 != $FeedbackId)\n {\n $sql = 'SELECT BidFeedback.Vote, BidFeedback.Issues,';\n $sql .= ' BidFeedback.BidStatusId, Bids.Title';\n $sql .= ' FROM Bids, BidStatus, BidFeedback';\n $sql .= \" WHERE BidFeedback.FeedbackId=$FeedbackId\";\n $sql .= ' AND BidStatus.BidStatusId=BidFeedback.BidStatusId';\n $sql .= ' AND Bids.BidId=BidStatus.BidId';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error('Query failed for bid info', $sql);\n\n if (0 == mysql_num_rows($result))\n return display_error(\"Failed to find bid info for FeedbackId: $FeedbackId\");\n\n $row = mysql_fetch_object($result);\n $Vote = $row->Vote;\n $Issues = $row->Issues;\n $Title = $row->Title;\n $BidStatusId = $row->BidStatusId;\n }\n else\n {\n // If we don't have a FeedbackId, we'd better have a BidStatusId\n\n if (! array_key_exists ('BidStatusId', $_REQUEST))\n return display_error ('Failed to find BidStatusIdId in $_REQUEST array');\n\n $BidStatusId = intval($_REQUEST['BidStatusId']);\n if (0 == $BidStatusId)\n return display_error (\"Invalid BidStatusId: $BidStatusId\");\n\n $sql = 'SELECT Bids.Title';\n $sql .= ' FROM Bids, BidStatus';\n $sql .= \" WHERE BidStatus.BidStatusId=$BidStatusId\";\n $sql .= ' AND Bids.BidId=BidStatus.BidId';\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error('Query failed for bid info', $sql);\n\n if (0 == mysql_num_rows($result))\n return display_error(\"Failed to find bid info for FeedbackId: $FeedbackId\");\n\n $row = mysql_fetch_object($result);\n $Title = $row->Title;\n }\n\n // If this is the first time in, fill in the $_POST array\n\n if (! array_key_exists ('Vote', $_POST))\n {\n $_POST['Vote'] = $Vote;\n $_POST['Issues'] = $Issues;\n }\n\n display_header (\"Feedback for $name on <i>$Title</i>\");\n\n echo \"<form method=\\\"POST\\\" action=\\\"Bids.php\\\">\\n\";\n form_add_sequence ();\n form_hidden_value ('action', BID_FEEDBACK_PROCESS_ENTRY);\n form_hidden_value ('FeedbackId', $FeedbackId);\n form_hidden_value ('BidStatusId', $BidStatusId);\n form_hidden_value ('UserId', $UserId);\n\n echo \"<table>\\n\";\n echo \" <tr>\\n\";\n echo \" <th align=\\\"right\\\">Vote:&nbsp;&nbsp;</th>\\n\";\n form_vote('Vote');\n echo \" </tr>\\n\";\n echo \" <tr>\\n\";\n echo \" <th align=\\\"right\\\">Issues:&nbsp;&nbsp;</th>\\n\";\n form_issues('Issues');\n echo \" </tr>\\n\";\n form_submit ('Update Feedback');\n echo \"</table>\\n\";\n}", "protected function Form_Run() {\r\n\t\tif (!QApplication::$Login) QApplication::Redirect(__SUBDIRECTORY__.'/index.php');\r\n\t\t$jscript = new QJavaScriptAction('alert(\"called this\")');\r\n\t}", "function showNoticeForm() {\n // nop\n }", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n\n $fakeEmail = $this->getRequest()->getParam('email');\n\n if ($fakeEmail === '') { //email should not be null and should be empty\n $this->processHelper->createFromPost($this->getRequest()->getParams(), Config::CHANNEL_FEEDBACK_TAB);\n $this->messageManager->addSuccessMessage(\n __('Your request was successfully submitted. You should receive a confirmation email shortly.')\n );\n }\n\n return $resultRedirect->setRefererOrBaseUrl();\n }", "function run()\r\n {\r\n\r\n \t$trail = BreadcrumbTrail :: get_instance();\r\n\r\n $context_id = Request :: get(SurveyContextManager :: PARAM_CONTEXT_ID);\r\n\t\t$this->set_parameter(SurveyContextManager :: PARAM_CONTEXT_ID, $context_id);\r\n\r\n $survey_context = SurveyContextDataManager::get_instance()->retrieve_survey_context_by_id($context_id);\r\n\r\n $context_registration_id = Request :: get(SurveyContextManager :: PARAM_CONTEXT_REGISTRATION_ID);\r\n\t\t$this->set_parameter(SurveyContextManager :: PARAM_CONTEXT_REGISTRATION_ID, $context_registration_id);\r\n\r\n $form = new SurveyContextForm(SurveyContextForm :: TYPE_EDIT, $this->get_url(), $survey_context, $this->get_user(), $this);\r\n\r\n if ($form->validate())\r\n {\r\n $success = $form->update_survey_context();\r\n if ($success)\r\n {\r\n $this->redirect(Translation :: get('ObjectUpdated',array('OBJECT' => Translation::get('SurveyContext')),Utilities::COMMON_LIBRARIES), (false), array(SurveyContextManager :: PARAM_ACTION => SurveyContextManager :: ACTION_VIEW_CONTEXT_REGISTRATION, SurveyContextManager :: PARAM_CONTEXT_REGISTRATION_ID => $context_registration_id));\r\n }\r\n else\r\n {\r\n $this->redirect(Translation :: get('ObjectNotUpdated',array('OBJECT' => Translation::get('SurveyContext')),Utilities::COMMON_LIBRARIES), (false), array(SurveyContextManager :: PARAM_ACTION => SurveyContextManager :: ACTION_VIEW_CONTEXT_REGISTRATION, SurveyContextManager :: PARAM_CONTEXT_REGISTRATION_ID => $context_registration_id));\r\n \t }\r\n }\r\n else\r\n {\r\n $this->display_header($trail, false);\r\n $form->display();\r\n $this->display_footer();\r\n }\r\n }", "function process_feedback_for_entry()\n{\n\n if (! (user_has_priv (PRIV_BID_CHAIR) || user_has_priv (PRIV_BID_COM)) )\n return display_access_error ();\n\n // Check for a sequence error\n\n if (out_of_sequence ())\n return display_sequence_error (true);\n\n $BidStatusId = intval ($_POST['BidStatusId']);\n $FeedbackId = intval ($_POST['FeedbackId']);\n $UserId = intval ($_POST['UserId']);\n\n if (0 == $FeedbackId)\n $sql = 'INSERT INTO BidFeedback SET ';\n else\n $sql = 'UPDATE BidFeedback SET ';\n\n $sql .= build_sql_string ('Vote', $_POST['Vote'], false);\n $sql .= build_sql_string ('Issues');\n\n if (0 == $FeedbackId)\n {\n $sql .= build_sql_string ('UserId');\n $sql .= build_sql_string ('BidStatusId');\n }\n else\n $sql .= \" WHERE FeedbackId=$FeedbackId\";\n\n // echo \"$sql<p>\\n\";\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('BidFeedback entry update failed', $sql);\n else\n return true;\n}", "function process_feedback_for_entry()\n{\n\n if (! user_has_priv (PRIV_BID_CHAIR))\n return display_access_error ();\n\n // Check for a sequence error\n\n if (out_of_sequence ())\n return display_sequence_error (true);\n\n $BidStatusId = intval ($_POST['BidStatusId']);\n $FeedbackId = intval ($_POST['FeedbackId']);\n $UserId = intval ($_POST['UserId']);\n\n if (0 == $FeedbackId)\n $sql = 'INSERT INTO BidFeedback SET ';\n else\n $sql = 'UPDATE BidFeedback SET ';\n\n $sql .= build_sql_string ('Vote', $_POST['Vote'], false);\n $sql .= build_sql_string ('Issues');\n\n if (0 == $FeedbackId)\n {\n $sql .= build_sql_string ('UserId');\n $sql .= build_sql_string ('BidStatusId');\n }\n else\n $sql .= \" WHERE FeedbackId=$FeedbackId\";\n\n // echo \"$sql<p>\\n\";\n\n $result = mysql_query($sql);\n if (! $result)\n return display_mysql_error ('BidFeedback entry update failed', $sql);\n else\n return true;\n}", "function tw_ajax_feedback() {\n\n\t$result = [\n\t\t'text' => '',\n\t\t'errors' => []\n\t];\n\n\tif (!empty($_POST['type']) and isset($_POST['noncer']) and wp_verify_nonce($_POST['noncer'], 'ajax-nonce')) {\n\n\t\tforeach ($_POST as $k => $v) {\n\n\t\t\tif (is_array($v)) {\n\t\t\t\t$_POST[$k] = array_map('htmlspecialchars', $v);\n\t\t\t} else {\n\t\t\t\t$_POST[$k] = htmlspecialchars($v);\n\t\t\t}\n\n\t\t}\n\n\t\t$recipient = get_option('admin_email');\n\n\t\t$errors = [];\n\n\t\t$required = [\n\t\t\t'name' => '#^[a-zA-Z0-9 -.]{2,}$#ui',\n\t\t\t'subject' => '#^.{2,}$#ui',\n\t\t\t'email' => '#^[^\\@]+@.*\\.[a-z]{2,6}$#i',\n\t\t\t'phone' => '#^[0-9 . -+ ()]{7,12}$#i',\n\t\t];\n\n\t\t$fields = [\n\t\t\t'first_name' => 'First Name',\n\t\t\t'last_name' => 'Last Name',\n\t\t\t'phone' => 'Phone',\n\t\t\t'email' => 'E-mail',\n\t\t\t'subject' => 'Subject',\n\t\t\t'message' => 'Message',\n\t\t];\n\n\t\t$type = intval($_POST['type']);\n\n\t\tif ($type == 1) {\n\n\t\t\t$subject = 'Request from ' . $_POST['name'];\n\n\t\t\t$required['message'] = [\n\t\t\t\t'error' => 'Please type a message',\n\t\t\t\t'pattern' => '#^.{10,}$#ui'\n\t\t\t];\n\n\t\t} else {\n\n\t\t\t$subject = 'Request from a client';\n\n\t\t}\n\n\t\tforeach ($required as $key => $field) {\n\n\t\t\t$label = $fields[$key];\n\n\t\t\tif (!is_array($field)) {\n\t\t\t\t$field = ['pattern' => $field];\n\t\t\t}\n\n\t\t\tif (empty($field['error'])) {\n\t\t\t\t$field['error'] = $label . ' is not valid';\n\t\t\t}\n\n\t\t\tif (empty($_POST[$key])) {\n\t\t\t\t$errors[$key] = $label . ' is required';\n\t\t\t} elseif (!preg_match($field['pattern'], $_POST[$key])) {\n\t\t\t\t$errors[$key] = $field['error'];\n\t\t\t}\n\n\t\t}\n\n\t\tif (count($errors) == 0) {\n\n\t\t\t$message = [];\n\n\t\t\tforeach ($fields as $key => $field) {\n\n\t\t\t\tif (!empty($_POST[$key])) {\n\n\t\t\t\t\t$value = $_POST[$key];\n\n\t\t\t\t\t$message[] = '<p><b>' . $field . ':</b> ' . $value . '</p>';\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$headers = [];\n\n\t\t\t$headers[] = 'Content-type: text/html; charset=utf-8';\n\n\t\t\t$files = [];\n\n\t\t\tforeach (['artwork'] as $name) {\n\n\t\t\t\t$file = tw_session_get_file($name);\n\n\t\t\t\tif ($file and file_exists($file['file'])) {\n\t\t\t\t\t$files[$name] = $file;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (wp_mail($recipient, $subject, implode(\"\\n\", $message), $headers, $files)) {\n\n\t\t\t\tif ($files) {\n\t\t\t\t\tforeach ($files as $name => $file) {\n\t\t\t\t\t\tunlink($file);\n\t\t\t\t\t\ttw_session_set_file($name, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$result['text'] = __('Thanks! We will contact you soon!', 'twee');\n\n\t\t\t} else {\n\n\t\t\t\t$result['text'] = __('Error. Please, try again a bit later', 'twee');\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$result['errors'] = $errors;\n\n\t\t}\n\n\t}\n\n\twp_send_json($result);\n\n}", "public function formAction() {}", "public function submission_form()\n\t{\n\t\t$this->load->library('submission_library');\n\t\t$this->load->model('timecard_submission_model', '', TRUE);\n\n\t\t$this->load->view('timecard_submission', array('is_admin_timecard' => TRUE));\n\t}", "public function indexAction()\n {\n $this->assets->addJs('js/suggestion.js');\n\n $form = new SuggestionForm(null);\n\n if ($this->request->isPost()) {\n $mail = $this->getDI()\n ->getMail();\n if ($form->isValid($this->request->getPost()) != false) {\n\n try{\n $mail->send(\n array($this->config->mail->fromEmail => $this->config->mail->fromName),\n 'Suggestion',\n 'suggestion', array(\n 'name' => $this->request->getPost('name'),\n 'email' => $this->request->getPost('email'),\n 'message' => $this->request->getPost('message'),\n 'feedback_type'=>$this->request->getPost('feedback_type')\n )\n );\n $this->flash->success('Your suggestions have been sent to administrator.');\n $form->clear();\n }catch (Exception $e){\n echo $e->getMessage();\n }\n\n }\n }\n $this->view->form = $form;\n }", "public function front_action() {\n\n\t\tif ( $this->is_request_to_forget() ) {\n\t\t\t$this->process_request_to_forget();\n\t\t}\n\n\t\tif ( $this->is_request_confirmation() ) {\n\t\t\t$this->process_confirm_request();\n\t\t}\n\t}", "function pastIntro() {\n // move progress forward and redirect to the runSurvey action\n $this->autoRender = false; // turn off autoRender\n $this->Session->write('Survey.progress', RIGHTS);\n $this->redirect(array('action' => 'runSurvey'));\n\n }", "public function submit_new_entry_start()\n\t{\n\t\t// -------------------------------------\n\t\t// This is really obnoxious, but EE makes us do this for Quick Save/Preview to work\n\t\t// -------------------------------------\n\n\t\tif ($this->data->channel_is_calendars_channel(ee()->input->post('weblog_id')) === TRUE OR\n\t\t\t$this->data->channel_is_events_channel(ee()->input->post('weblog_id')) === TRUE)\n\t\t{\n\t\t\t$this->cache['quicksave']\t= TRUE;\n\t\t}\n\t}", "public function send_registration_feedback()\n {\n // Get parameters.\n $admin_account = $this->GABIA_SMS_API->getAdminAccount();\n\n // From contact form.\n $email = $_POST['email'];\n $tel = $_POST['tel'];\n $course_title = $_POST['course_title'];\n $name = $_POST['name'];\n $amount = $_POST['amount'];\n\n wp_mail($email, '[어벤져스쿨] 성공적으로 강연 등록이 완료되었습니다.',\n '강의 제목: ' . $course_title . \"\\n\" .\n '수강자 이름: ' . $name . \"\\n\" .\n '결제 금액: ' . $amount . \"\\n\" .\n $admin_account . \"\\n\" .\n '입급 전 정원 초과시 자동 취소되오니 빠른 결제 부탁드립니다.' . \"\\n\" .\n '- 어벤져스쿨.');\n $message = '<' . $course_title . '> 강연 등록이 완료되었습니다. 입급 전 정원 초과시 자동 취소되오니 빠른 결제 부탁드립니다. - 어벤져스쿨';\n $this->sendSms($tel, $message, '무통장입금');\n }", "function event_formprocessing($formvariables) {\r\r\n\tglobal $glbl_companyname, $glbl_sendformsfromemailaddress, $glbl_sendformstoemailaddress,\r\r\n\t $glbl_physicalwebrootlocation;\r\r\n\t$outputtype = 'simple';\r\r\n\t// Security validation 'ctcd'\r\r\n\tif (!pingToken($formvariables['citycode']))\r\r\n\t\treturn '// invalid: press the browser [back] button;';\r\r\n\t// When using a custom template for output\r\r\n\tif (isset($formvariables['emailtemplate'])){\r\r\n\t\t$loc = $glbl_physicalwebrootlocation . $formvariables['emailtemplate'];\r\r\n\t\tif (file_exists($loc)){ \r\r\n\t\t\t$file = fopen($loc, 'r'); // Read template page\r\r\n\t\t\t$formstring = fread($file, filesize($loc));\r\r\n\t\t\tfclose($file);\r\r\n\t\t\tif (trim($formstring) != '')\r\r\n\t\t\t\t$outputtype = 'custom';\r\r\n\t\t}\r\r\n\t}\r\r\n\t// When using simple output\r\r\n\tif ($outputtype == 'simple')\r\r\n\t\t$formstring = 'A form was submitted for: ' . $glbl_companyname . '<br><br>';\r\r\n\t// Loop over form variables\r\r\n\tforeach (explode(',', $formvariables['fieldlist']) as $formfield) {\r\r\n\t\t$formfieldvalue = '';\r\r\n\t\tif (isset($formvariables[$formfield]))\r\r\n\t\t\t$formfieldvalue = $formvariables[$formfield];\r\r\n\t\tif (strtolower($formfield) == 'email')\r\r\n\t\t\t$formfieldvalue = '<a href=\"mailto:' . $formfieldvalue . '\">' . $formfieldvalue . '</a>';\r\r\n\t\tif ($outputtype == 'simple')\r\r\n\t\t\t$formstring .= str_replace('_', ' ', $formfield) . ': ' . str_replace('\\\\', '', $formfieldvalue) . '<br>';\r\r\n\t\telse\r\r\n\t\t\t$formstring = str_replace('<!-- {$' . $formfield . '$} -->', $formfieldvalue, $formstring);\r\r\n\t}\r\r\n\t// Add datetimestamp\r\r\n\tif ($outputtype == 'simple')\t\r\r\n\t\t$formstring .= '<br>Date: ' . date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\");\r\r\n\telse\r\r\n\t\t$formstring = str_replace('<!-- {$datetimestamp$} -->',\r\r\n\t\t\t\t\t\t\t\t (date(\"m/d/Y\") . ' - ' . date(\"h:i:s A\")), $formstring);\t\r\r\n\t// Send via email\r\r\n\trequire_once(\"htmlMimeMail5/htmlMimeMail5.php\"); // htmlMimeMail5 class\r\r\n $mail = new htmlMimeMail5(); // Instantiate a new HTML Mime Mail object\r\r\n $mail->setFrom($glbl_sendformsfromemailaddress);\r\r\n $mail->setReturnPath($glbl_sendformsfromemailaddress); \r\r\n $mail->setSubject('web form | ' . $glbl_companyname);\r\r\n $mail->setText(str_replace('<br>', '\\r\\n', $formstring));\r\r\n $mail->setHTML($formstring);\r\r\n\t// Attach uploaded image, if any\r\r\n\tif (isset($_FILES['imagefile']['name']))\r\r\n\t\tif ($_FILES['imagefile']['type'] == \"image/gif\" || $_FILES['imagefile']['type'] == \"image/jpg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/jpeg\" || $_FILES['imagefile']['type'] == \"image/pjpeg\" ||\r\r\n\t\t\t$_FILES['imagefile']['type'] == \"image/png\")\r\r\n\t\t\t$mail->addAttachment(new fileAttachment($_FILES['imagefile']['tmp_name'], $_FILES['imagefile']['type']));\r\r\n\t// Send the email!\r\r\n\t$mail->send(array($glbl_sendformstoemailaddress), 'smtp');\r\r\n\t// User defined function hook\r\r\n\texecUserDefinedFunction('USRDFNDafter_event_formprocessing');\r\r\n\t// Point to page\r\r\n\theader('Location: ' . $formvariables['afterpage']);\r\r\n}", "function Form()\n\t{\n\t\tprint '<form name=\"myform\" action=\"' . THIS_PAGE . '\" method=\"post\">';\n\t\tforeach($this->aQuestion as $question)\n\t\t{//print data for each\n\t\t\t$this->createInput($question);\n\t\t}\n\t\tprint '<input type=\"hidden\" name=\"SurveyID\" value=\"' . $this->SurveyID . '\" />';\t\n\t\tprint '<input type=\"submit\" value=\"Submit!\" />';\t\n\t\tprint '</form>';\n\t}", "public function hookForm() {\n }", "public function form()\n {\n $this->switch('auto_df_switch', __('message.tikuanconfig.auto_df_switch'));\n $this->timeRange('auto_df_stime', 'auto_df_etime', '开启时间');\n $this->text('auto_df_maxmoney', __('message.tikuanconfig.auto_df_maxmoney'))->setWidth(2);\n $this->text('auto_df_max_count', __('message.tikuanconfig.auto_df_max_count'))->setWidth(2);\n $this->text('auto_df_max_sum', __('message.tikuanconfig.auto_df_max_sum'))->setWidth(2);\n\n }", "function feedback(){\n \t\t$data['title']\t\t= \"Feedback Pengguna\";\n \t\t$data['custom_css']\t= \"data_tables_css\";\n \t\t$data['custom_js']\t= \"data_tables_js\";\n \t\t$data['custom_script']\t= \"script_feedback\";\n $data['content']\t= \"content/feedback\";\n\n \t\t$this->load->view('Main', $data);\n \t}", "public function proceed()\n {\n }", "function form_action()\r\n {\r\n // After passing validation, all of the meet data\r\n // should be stored in the Swim Meet class instance.\r\n\r\n $swimmeet = $this->getSwimMeet() ;\r\n\r\n $success = $swimmeet->UpdateSwimMeet() ;\r\n\r\n // If successful, store the updated meet id in so it can be used later.\r\n\r\n if ($success) \r\n {\r\n $swimmeet->setSwimMeetId($success) ;\r\n $this->set_action_message(html_div('ft-note-msg', 'Swim Meet successfully updated.')) ;\r\n }\r\n else\r\n {\r\n $this->set_action_message(html_div('ft-warning-msg', 'Swim Meet was not successfully updated.')) ;\r\n }\r\n\r\n return $success ;\r\n }", "public function comment_form() {\n\n\t\t/** Don't do anything if we are in the admin */\n\t\tif ( is_admin() )\n\t\t\treturn;\n\n\t\t/** Don't do anything unless the user has already logged in and selected a list */\n/*\t\tif ( empty( $tgm_mc_options['current_list_id'] ) )\n\t\t\treturn;\n*/\n\t\t$clear = CTCT_Settings::get('comment_form_clear') ? 'style=\"clear: both;\"' : '';\n\t\t$checked_status = ( ! empty( $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) && 'checked' == $_COOKIE['tgm_mc_checkbox_' . COOKIEHASH] ) ? true : false;\n\t\t$checked = $checked_status ? 'checked=\"checked\"' : '';\n\t\t$status = ''; //$this->get_viewer_status();\n\n\t\tif ( 'admin' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_admin_text') . '</p>';\n\t\t}\n\t\telseif ( 'subscribed' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_subscribed_text') . '</p>';\n\t\t}\n\t\telseif ( 'pending' == $status ) {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>' . CTCT_Settings::get('comment_form_pending_text') . '</p>';\n\t\t}\n\t\telse {\n\t\t\techo '<p class=\"ctct-subscribe\" ' . $clear . '>';\n\n\t\t\t\techo sprintf('<label for=\"ctct-comment-subscribe\"><input type=\"checkbox\" name=\"ctct-subscribe\" id=\"ctct-comment-subscribe\" value=\"subscribe\" style=\"width: auto;\" %s /> %s</label>', $checked, CTCT_Settings::get('comment_form_check_text'));\n\t\t\techo '</p>';\n\t\t}\n\n\t}", "public function Execute()\n {\n # ====================================================================================\n # <> YES - just execute the free credits form on that wh_id\n # <> NO - display form asking admin to identify person\n # ====================================================================================\n if ($this->Wh_Id == 0) {\n $this->ShowCustomerSelect();\n } else {\n \n # determine if record is inactive\n # =================================================================================\n $OBJ_CONTACTS = new Profile_CustomerProfileContacts();\n $record = $OBJ_CONTACTS->ListRecordSpecial($this->Wh_Id, true);\n if (!$record) {\n echo '<h3>NOTE: This account has been de-activated so you cannot give free credits.';\n } else {\n $code = GenerateCode(6);\n $this->Default_Values = array(\n 'wh_id' => $this->Wh_Id,\n 'type' => 'Free',\n 'order_id' => 'F-666',\n 'admin_wh_id' => $_SESSION['USER_LOGIN']['LOGIN_RECORD']['wh_id'],\n 'email_contents' => 'You have been given free credits.',\n 'email_send' => 1,\n );\n $this->AddRecord();\n }\n }\n }", "public function testimonial_form()\n {\n /* require one simple php file that contains the form */\n /* Read but don't execute */\n ob_start ();\n /* Load the styles*/\n echo ( \"<link rel=\\\"stylesheet\\\" href=\\\"$this->plugin_url/assets/form.css\\\" type=\\\"text/css\\\" media=\\\"all\\\" /> \" );\n /* Load the contact form */\n require_once ( \"$this->plugin_path/templates/contact-form.php\");\n /* only enqueues the javascript file if I am using the form */\n echo ( \"<script src=\\\"$this->plugin_url/assets/form.js\\\"></script> \" );\n return ( ob_get_clean () );\n }", "public function testForm() {\n $this->controller->process();\n $errors = $this->controller->getPlaceholder('loginfp.errors');\n $this->assertEmpty($errors);\n $this->assertEquals(1,$this->controller->emailsSent);\n }", "function MessagingForm(){\n $messaging = new \\Project\\Models\\ContactFormManager();\n $allMessaging = $messaging->contactMessaging();\n\n require 'app/views/back/contactForm.php';\n }", "function form_content()\r\n {\r\n $table = html_table($this->_width,0,4) ;\r\n $table->set_style(\"border: 0px solid\") ;\r\n\r\n $msg = html_div(\"ft_form_msg\") ;\r\n $msg->add(html_p(html_b(\"Processing the SDIF Queue requires\r\n processing swimmers, swim meets, and/or swim teams which are\r\n not currently stored in the database. Specify how unknown\r\n data should be processed.\"), html_br())) ;\r\n\r\n $td = html_td(null, null, $msg) ;\r\n $td->set_tag_attribute(\"colspan\", \"2\") ;\r\n $table->add_row($td) ;\r\n $table->add_row($this->element_label(\"Swimmers\"), $this->element_form(\"Swimmers\")) ;\r\n $table->add_row($this->element_label(\"Swim Meets\"), $this->element_form(\"Swim Meets\")) ;\r\n $table->add_row($this->element_label(\"Swim Teams\"), $this->element_form(\"Swim Teams\")) ;\r\n\r\n $this->add_form_block(null, $table) ;\r\n }", "function thanks() {\n\t\treturn array(\n\t\t\t\"Form\" => DataObject::get_one(\"ForumHolder\")->ProfileModify\n\t\t);\n\t}", "function form_action()\r\n {\r\n // After passing validation, all of the meet data\r\n // should be stored in the Swim Meet class instance.\r\n\r\n $swimmeet = $this->getSwimMeet() ;\r\n\r\n $success = $swimmeet->AddSwimMeet() ;\r\n\r\n // If successful, store the added age group id in so it can be used later.\r\n\r\n if ($success) \r\n {\r\n $meet->setMeetId($success) ;\r\n $this->set_action_message(html_div('ft-note-msg', 'Swim Meet successfully added.')) ;\r\n }\r\n else\r\n {\r\n $this->set_action_message(html_div('ft-warning-msg', 'Swim Meet was not successfully added.')) ;\r\n }\r\n\r\n return $success ;\r\n }", "public function handleDataSubmission() {}", "abstract function setupform();", "function m_dspSignupForm()\n\t{\n\t\t#INTIALIZING TEMPLATES\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_USER_FILE\", $this->userTemplate);\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SITEURL\",SITE_URL);\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_NEWSLETTER_BLK\",\"news_blk\");\n\t//\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"DSPMSG_BLK\", \"msg_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"TPL_CAPTCHA_BLK\",\"captcha_blk\");\n\t\t$this->ObTpl->set_var(\"captcha_blk\",\"\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"countryblk\",\"countryblks\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"BillCountry\",\"nBillCountry\");\n\t\t$this->ObTpl->set_block(\"TPL_USER_FILE\",\"stateblk\",\"stateblks\");\n\t\t$this->ObTpl->set_var(\"TPL_USERURL\",SITE_URL.\"user/\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CPASS\",\"\");\n\t\t$this->ObTpl->set_var(\"news_blk\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK1\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK2\",\"\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK3\",\"\");\n\n\t\t#INTIALIZING\n\t\t$row_customer[0]->vFirstName = \"\";\n\t\t$row_customer[0]->vLastName =\"\";\n\t\t$row_customer[0]->vEmail = \"\";\n\t\t$row_customer[0]->vPassword = \"\";\n\t\t$row_customer[0]->vPhone = \"\";\n\t\t$row_customer[0]->vCompany = \"\";\n\t\t$row_customer[0]->vAddress1 = \"\";\n\t\t$row_customer[0]->vAddress2 = \"\";\n\t\t$row_customer[0]->vState =\"\";\n\t\t$row_customer[0]->vStateName=\"\";\n\t\t$row_customer[0]->vCity = \"\";\n\t\t$row_customer[0]->vCountry = \"\";\t\n\t\t$row_customer[0]->vZip = \"\";\t\n\t\t$row_customer[0]->vHomePage = \"\";\t\n\t\t$row_customer[0]->fMemberPoints = \"\";\n\t\t$row_customer[0]->iMailList = \"1\";\n\t\t$row_customer[0]->iStatus = \"1\";\n\n\n\t\t/*CHECKING FOR POST VARIABLES\n\t\tIF VARIABLES ARE SET THEN ASSIGNING THEIR VALUE TO VARIABLE SAMEVARIABLE\n\t\tAS USED WHEN RETURNED FROM DATABASE\n\t\tTHIS THING IS USED TO REMOVE REDUNDANCY AND USE SAME FORM FOR EDIT AND INSERT*/\n\n\t\tif(count($_POST) > 0)\n\t\t{\n\t\t\tif(isset($this->request[\"first_name\"]))\n\t\t\t\t$row_customer[0]->vFirstName = $this->request[\"first_name\"];\n\t\t\tif(isset($this->request[\"password\"]))\n\t\t\t\t$row_customer[0]->vPassword = $this->request[\"password\"];\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CPASS\", $this->libFunc->m_displayContent($this->request[\"verify_pw\"]));\n\t\t\tif(isset($this->request[\"last_name\"]))\n\t\t\t\t$row_customer[0]->vLastName = $this->request[\"last_name\"];\n\t\n\t\t\tif(isset($this->request[\"company\"]))\n\t\t\t\t$row_customer[0]->vCompany = $this->request[\"company\"];\n\t\t\tif(isset($this->request[\"txtemail\"]))\n\t\t\t\t$row_customer[0]->vEmail = $this->request[\"txtemail\"];\n\t\t\tif(isset($this->request[\"address1\"]))\n\t\t\t\t$row_customer[0]->vAddress1 = $this->request[\"address1\"];\n\t\t\tif(isset($this->request[\"address2\"]))\n\t\t\t\t$row_customer[0]->vAddress2 = $this->request[\"address2\"];\n\t\t\tif(isset($this->request[\"city\"]))\n\t\t\t\t$row_customer[0]->vCity = $this->request[\"city\"];\n\t\t\tif(isset($this->request[\"bill_state_id\"]))\n\t\t\t\t$row_customer[0]->vState = $this->request[\"bill_state_id\"];\t\n\t\t\tif(isset($this->request[\"bill_state\"]))\n\t\t\t\t$row_customer[0]->vStateName = $this->request[\"bill_state\"];\t\n\t\t\tif(isset($this->request[\"zip\"]))\n\t\t\t\t$row_customer[0]->vZip = $this->request[\"zip\"];\t\n\t\t\tif(isset($this->request[\"bill_country_id\"]))\n\t\t\t\t$row_customer[0]->vCountry = $this->request[\"bill_country_id\"];\t\n\t\t\tif(isset($this->request[\"phone\"]))\n\t\t\t\t$row_customer[0]->vPhone = $this->request[\"phone\"];\t\n\t\t\tif(isset($this->request[\"homepage\"]))\n\t\t\t\t$row_customer[0]->vHomePage = $this->request[\"homepage\"];\t\n\t\t\tif(isset($this->request[\"mail_list\"]))\n\t\t\t\t$row_customer[0]->iMailList = $this->request[\"mail_list\"];\t\n\t\t\tif(isset($this->request[\"member_points\"]))\n\t\t\t\t$row_customer[0]->fMemberPoints = $this->request[\"member_points\"];\t\n\t\t\tif(isset($this->request[\"iStatus\"]))\n\t\t\t\t$row_customer[0]->iStatus = $this->request[\"status\"];\t\n\t\t\telse\n\t\t\t\t$row_customer[0]->iStatus = \"\";\n\t\t}\n\t\n\t\t#DISPLAYING MESSAGES\n\t\tif($this->err==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$this->errMsg);\n\t\t}\n\n\n\t\t#IF EDIT MODE SELECTED\n\n\t\t#ASSIGNING FORM ACTION\t\t\t\t\t\t\n\t\t$this->ObTpl->set_var(\"FORM_URL\", SITE_URL.\"user/adminindex.php?action=user.updateUser\");\n\t\t\n\t\t$this->obDb->query = \"SELECT iStateId_PK, vStateName FROM \".STATES.\" ORDER BY vStateName\";\n\t\t$row_state = $this->obDb->fetchQuery();\n\t\t$row_state_count = $this->obDb->record_count;\n\t\t\n\t\t$this->obDb->query = \"SELECT iCountryId_PK, vCountryName, vShortName FROM \".COUNTRY.\" ORDER BY iSortFlag,vCountryName\";\n\t\t$row_country = $this->obDb->fetchQuery();\n\t\t$row_country_count = $this->obDb->record_count;\n\n\t\t# Loading billing country list\t\t\n\t\tfor($i=0;$i<$row_country_count;$i++)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"k\", $row_country[$i]->iCountryId_PK);\n\t\t\t$this->ObTpl->parse('countryblks','countryblk',true);\n\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_VALUE\", $row_country[$i]->iCountryId_PK);\n\t\t\t\n\t\t\t\n\t\t\tif($row_customer[0]->vCountry> 0)\n\t\t\t{\n\t\t\t\tif($row_customer[0]->vCountry == $row_country[$i]->iCountryId_PK)\n\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"selected=\\\"selected\\\"\");\n\t\t\t\telse\n\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$row_customer[0]->vCountry = SELECTED_COUNTRY;\n\t\t\t\t\t//echo SELECTED_COUNTRY;\n\n\t\t\t\t\tif($row_country[$i]->iCountryId_PK==$row_customer[0]->vCountry)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\",\"selected=\\\"selected\\\"\");\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->ObTpl->set_var(\"BILL_COUNTRY_SELECT\", \"\");\n\t\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t$this->ObTpl->set_var(\"TPL_COUNTRY_NAME\",$this->libFunc->m_displayContent($row_country[$i]->vCountryName));\n\t\t\t$this->ObTpl->parse(\"nBillCountry\",\"BillCountry\",true);\n\t\t}\n\t\t\n\t\tif(isset($row_customer[0]->vCountry) && $row_customer[0]->vCountry != '')\t\n\t\t\t$this->ObTpl->set_var('selbillcountid',$row_customer[0]->vCountry);\n\t\telse\n\t\t\t$this->ObTpl->set_var('selbillcountid',\"251\");\n\n\n\t\tif(isset($row_customer[0]->vState) && $row_customer[0]->vState != '')\n\t\t\t$this->ObTpl->set_var('selbillstateid',$row_customer[0]->vState);\n\t\telse\n\t\t\t$this->ObTpl->set_var('selbillstateid',0);\n\t\t\n\t\t\t\n\t\t\n\t\t# Loading the state list here\n\t\t$this->obDb->query = \"SELECT C.iCountryId_PK as cid,S.iStateId_PK as sid,S.vStateName as statename FROM \".COUNTRY.\" C,\".STATES.\" S WHERE S.iCountryId_FK=C.iCountryId_PK ORDER BY C.vCountryName,S.vStateName\";\n\t\t$cRes = $this->obDb->fetchQuery();\n\t\t$country_count = $this->obDb->record_count;\n\n\t\tif($country_count == 0)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"countryblks\", \"\");\n\t\t\t$this->ObTpl->set_var(\"stateblks\", \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t$loopid=0;\n\t\t\tfor($i=0;$i<$country_count;$i++)\n\t\t\t{\n\t\t\t\tif($cRes[$i]->cid==$loopid)\n\t\t\t\t{\n\t\t\t\t\t$stateCnt++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loopid=$cRes[$i]->cid;\n\t\t\t\t\t$stateCnt=0;\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->set_var(\"i\", $cRes[$i]->cid);\n\t\t\t\t$this->ObTpl->set_var(\"j\", $stateCnt);\n\t\t\t\t$this->ObTpl->set_var(\"stateName\",$cRes[$i]->statename);\n\t\t\t\t$this->ObTpl->set_var(\"stateVal\",$cRes[$i]->sid);\n\t\t\t\t$this->ObTpl->parse('stateblks','stateblk',true);\n\t\t\t}\n\t\t}\n\n\n\t\t#ASSIGNING FORM VARAIABLES\n\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FNAME\", $this->libFunc->m_displayContent($row_customer[0]->vFirstName));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_LNAME\", $this->libFunc->m_displayContent($row_customer[0]->vLastName));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_EMAIL\", $this->libFunc->m_displayContent($row_customer[0]->vEmail));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PASS\", $this->libFunc->m_displayContent($row_customer[0]->vPassword));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS1\", $this->libFunc->m_displayContent($row_customer[0]->vAddress1 ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ADDRESS2\", $this->libFunc->m_displayContent($row_customer[0]->vAddress2 ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_CITY\", $this->libFunc->m_displayContent($row_customer[0]->vCity));\n\n\t\t$this->ObTpl->set_var(\"TPL_VAR_STATE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vState ));\n\t\tif($row_customer[0]->vState>1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"BILL_STATE\",\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"BILL_STATE\",\n\t\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vStateName));\n\t\t\t}\n\t\t$this->ObTpl->set_var(\"TPL_VAR_COUNTRY\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vCountry ));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_ZIP\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vZip));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_COMPANY\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vCompany));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_PHONE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vPhone));\n\t\t$this->ObTpl->set_var(\"TPL_VAR_HOMEPAGE\",\n\t\t\t$this->libFunc->m_displayContent($row_customer[0]->vHomePage));\n\t\t\n\t\tif(CAPTCHA_REGISTRATION){\n\t\t\t$this->ObTpl->parse(\"captcha_blk\",\"TPL_CAPTCHA_BLK\",true);\n\t\t}\n\n\t\tif(MAIL_LIST==1)\n\t\t{\n\t\t\tif($row_customer[0]->iMailList==1)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK1\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telseif($row_customer[0]->iMailList==2)\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK2\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_CHECK3\",\"selected=\\\"selected\\\"\");\n\t\t\t}\n\t\t\t$this->ObTpl->parse('news_blk','TPL_NEWSLETTER_BLK');\n\t\t}\n\t\t\n\t\treturn $this->ObTpl->parse(\"return\",\"TPL_USER_FILE\");\n\t}", "public function submit()\n {\n $this->waitFor(20000, function () {\n return $this->present();\n });\n $this->xpath($this->selectors['submit'])->click();\n $this->waitFor(20000, function () {\n return $this->xpath($this->selectors['formSubmitted']) !== null;\n });\n }", "public function submitPage() {}", "private function StartForm(){\r\n\t\t\t$this->formHTML .= \"<form method=\\\"{$this->method}\\\" action=\\\"{$this->action}\\\"\";\r\n\t\t\tif($this->enctype){\r\n\t\t\t\t$this->formHTML .= \" enctype=\\\"{$this->enctype}\\\"\";\r\n\t\t\t}\r\n\t\t\t$this->formHTML .= \" name=\\\"{$this->formName}\\\" class=\\\"c{$this->formName}\\\" id=\\\"i{$this->formName}\\\"\";\r\n\t\t\t$this->formHTML .= \">\";\r\n\t\t}", "public function activate() {\n $installer = new Contact\\Form\\Installer();\n $installer->run();\n }", "public function run()\n\t{\n\t\t\n\t\tlist($name,$id)=$this->resolveNameID();\n\t\tif(isset($this->htmlOptions['id']))\n\t\t\t$id=$this->htmlOptions['id'];\n\t\telse\n\t\t\t$this->htmlOptions['id']=$id;\n\t\tif(isset($this->htmlOptions['name']))\n\t\t\t$name=$this->htmlOptions['name'];\n\n\t\t$this->registerClientScript($id);\n\t\t$this->htmlOptions[\"class\"]=\"form-control\";\n\t\t\n\t\techo \"<small class=\\\"text-muted\\\"><em>Here a message for user</em></small>\";\n\t\techo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);\n\t\t\n\t}", "public function submissions();", "public function askForFeeConfirmation()\n {\n }", "function user_feedback(){\n\t\t\t$user_email=$_POST['user_email'];\n\t\t\t$user_name=$_POST['user_name'];\n\t\t\t$user_msg=$_POST['user_msg'];\n\t\t\tif(!empty($user_email) && !empty($user_msg) && !empty($user_name))\n\t\t\t{\n\t\t\t\t$insert = $this -> conn -> insertnewrecords('user_feedbacks','user_email, user_name,user_msg', '\"' . $user_email . '\",\"' . $user_name . '\",\"' . $user_msg . '\"');\n\t\t\t\tif(!empty($insert)){\n\t\t\t\t\t$post = array('status' => \"true\",\"message\" => \"Thanks for your feedback\");\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'user_email'=>$user_email,'user_name'=>$user_name,'user_msg'=>$user_msg);\n\t\t}\n\t\t\techo $this -> json($post);\n\t\t}", "public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('ifeedback')) {\n try {\n $ifeedback = $this->_initIfeedback();\n $ifeedback->addData($data);\n $ifeedback->save();\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.'.$this->getJsObjectName().'.reload(); window.close()</script>';\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_kst')->__('Instructor Feedback was successfully saved. %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $ifeedback->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('There was a problem saving the instructor feedback.')\n );\n Mage::getSingleton('adminhtml/session')->setIfeedbackData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_kst')->__('Unable to find instructor feedback to save.')\n );\n $this->_redirect('*/*/');\n }", "function showForm() {\n \tglobal $pluginpath;\n \t\n \tif ($this->idt == \"\") {\n \t //user is creating new template\n \t\t$title = MF_NEW_TEMPLATE;\n \t\t$this->action = 'createtempl';\n\t\t$btnText = MF_CREATE_TEMPLATE_BUTTON; \n \t} else {\n \t //user is editing old template\n \t\t$title = \tMF_CHANGE_TEMPLATE;\n \t\t$this->action = 'changetempl';\n\t\t$btnText = MF_CHANGE_FORUM_BUTTON;\n \t}\n \t\n\t$this->doHtmlSpecChars();\n\t\t\n\tinclude \"admin/tempForm.php\";\n \t\n }", "function _onRenderForm($tmp) {\n\t\t\n\t\t/* Show Page title */\n\t\tif ($this->_FORM_CONFIG ['showtitle'] == 1) {\n\t\t\t$tmp->assign ( 'SHOW_PAGE_TITLE', TRUE );\n\t\t}\n\t\t\n\t\t/* Show Reset Button */\n\t\tif ($this->_FORM_CONFIG ['showresetbutton'] == 1) {\n\t\t\t$tmp->assign ( 'SHOW_RESET_BUTTON', TRUE );\n\t\t}\n\t\t\n\t\t$tmp->assign ( 'RESETBUTTONTEXT', $this->_FORM_CONFIG ['resetbuttontext'] );\n\t\t$tmp->assign ( 'SUBMITBUTTONTEXT', $this->_FORM_CONFIG ['submitbuttontext'] );\n\t\t\n\t\treturn $tmp;\n\t}", "public function _settings_section_contact_form() {\n _e( 'The contact form is a way for users to submit support requests. It can be added to the dashboard using the options above.', 'zendesk' );\n }", "public function process_offer()\n {\n if (isset($_POST[$this->token . '_nonce']) && wp_verify_nonce($_POST[$this->token . '_nonce'], $this->token . '_submit_offer')) {\n global $wpdb;\n $quiz_id = sanitize_text_field($_POST['quiz_id']);\n $user_id = sanitize_text_field($_POST['user_id']);\n $last_name = sanitize_text_field($_POST['last_name']);\n $address = sanitize_text_field($_POST['address']);\n $address_2 = sanitize_text_field($_POST['address_2']);\n $city = sanitize_text_field($_POST['city']);\n $state = sanitize_text_field($_POST['state']);\n $zip_code = sanitize_text_field($_POST['zip_code']);\n $phone = sanitize_text_field($_POST['phone']);\n\n // Get the prospect data saved previously\n $subscriber = $wpdb->get_row('SELECT frontdesk_id, email FROM ' . $this->table_name . ' WHERE id = \\'' . $user_id . '\\' ORDER BY id DESC LIMIT 0,1');\n\n // Update the FrontDesk prospect if exists\n if ($subscriber->frontdesk_id != null) {\n $this->frontdesk->setApiKey(get_post_meta($quiz_id, 'api_key', true))\n ->updateProspect($subscriber->frontdesk_id, [\n 'email' => $subscriber->email,\n 'last_name' => $last_name,\n 'address' => $address,\n 'address_2' => $address_2,\n 'city' => $city,\n 'state' => $state,\n 'zip_code' => $zip_code,\n 'phone' => $phone\n ]);\n }\n\n // Update the prospect data\n $wpdb->query($wpdb->prepare(\n 'UPDATE ' . $this->table_name . '\n\t\t\t SET last_name = %s, address = %s, address2 = %s, phone = %s\n\t\t\t WHERE id = \\'' . $user_id . '\\'',\n [\n $last_name,\n $address . ', ' . $city . ', ' . $state . ' ' . $zip_code,\n $address_2,\n $phone\n ]\n ));\n\n echo json_encode('success');\n die();\n }\n }", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'verify' => '已审核',\n 'overrule' => '驳回',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('num')->value(0);\n $this->hidden('status')->value('verify');\n\n $this->radio('status', '审批')->options($check_status)->default('verify');\n $this->text('num', '准购数量')->default($this->wait_num)->rules('required');\n $this->textarea('reason', '审核意见');\n }" ]
[ "0.6966915", "0.66410184", "0.6488144", "0.64774185", "0.6403396", "0.63338906", "0.6317475", "0.6301179", "0.6276843", "0.6265665", "0.62308264", "0.61838347", "0.6146841", "0.61089504", "0.60480404", "0.6044904", "0.60438067", "0.60324895", "0.6013715", "0.600308", "0.5947103", "0.5946607", "0.5929023", "0.5917969", "0.5915186", "0.59123266", "0.5908384", "0.5900779", "0.58958614", "0.5895757", "0.5882611", "0.5872667", "0.58305377", "0.5817231", "0.5799709", "0.5794274", "0.57884526", "0.57810557", "0.57702905", "0.5766341", "0.5762866", "0.57488054", "0.57466394", "0.57434434", "0.5741286", "0.5738518", "0.5738455", "0.57366097", "0.57341576", "0.57288766", "0.5727669", "0.5727669", "0.57245666", "0.5719382", "0.5718184", "0.5705247", "0.5692131", "0.5689369", "0.5682221", "0.56762767", "0.5673811", "0.567167", "0.56617105", "0.56554615", "0.56511146", "0.56505215", "0.5634402", "0.5630988", "0.5628298", "0.5627755", "0.5625041", "0.56244475", "0.56217587", "0.5605629", "0.5603586", "0.55977345", "0.5592518", "0.5590141", "0.55837303", "0.5583494", "0.5582913", "0.558283", "0.55709994", "0.55690175", "0.55662733", "0.55509007", "0.55481744", "0.55438936", "0.55367637", "0.55320734", "0.55311924", "0.5527105", "0.55267215", "0.5526527", "0.552464", "0.5521367", "0.5518528", "0.5518035", "0.55081713", "0.5507375" ]
0.56038666
74
This method is used by Table Controller For getting the table data to show in the grid
public function getForDataTable() { //dd(config('module.questions.table')); return $this->query() ->leftjoin('question_type', 'question_type.id', '=', config('module.questions.table').'.type_id') ->select([ config('module.questions.table').'.id', 'question_type'.'.question_type as questionName', config('module.questions.table').'.question', config('module.questions.table').'.type_id', config('module.questions.table').'.status', config('module.questions.table').'.created_at', config('module.questions.table').'.updated_at', ]); // ->orderBy(config('module.questions.table').'.id', 'DESC'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTableData()\n\t{\n\t}", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function dataTable();", "public function gridtableAction()\n\t{\n\t\t$this->loadLayout();\n\t\t$this->renderLayout();\n\t\t\n\t}", "public function getData()\n {\n $model = Empresa::where('estatus',1)->get();\n\n return DataTables::of($model)\n ->editColumn('estatus',function ($model)\n {\n switch ($model->estatus) {\n case 1:\n return '<span class=\"badge badge-pill badge-info\">'.__('messages.activo').'</span>';\n break;\n case 2:\n return '<span class=\"badge badge-pill badge-warning\">'.__('messages.pausado').'</span>';\n break;\n case 3:\n return '<span class=\"badge badge-pill badge-success\">'.__('messages.terminado').'</span>';\n break;\n default:\n return '<span class=\"badge badge-pill badge-primary\">'.__('messages.espera').'</span>';\n break;\n }\n })\n ->addColumn('acciones',function ($model)\n {\n return '\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\n <a href=\"'.route('empresas.show',['id' => $model->id]).'\" class=\"btn btn-icon btn-cmetal \"><i class=\"bx bxs-show\"></i></a>\n <a href=\"'.route('empresas.edit',['id' => $model->id]).'\" class=\"btn btn-icon btn-light-cmetal\"><i class=\"bx bxs-pencil\"></i></a>\n \n </div>\n ';\n // if (Auth::user()->tipo == 1 ) {\n // }else{\n // return '\n // <a href=\"'.route('proyectos.show',['id' => $model->id]).'\" class=\"btn btn-icon btn-cmetal \"><i class=\"bx bxs-show\"></i></a>\n \n // ';\n // }\n }) \n ->rawColumns(['action'])\n ->escapeColumns([])\n ->toJson();\n }", "public function index()\n {\n return parent::getTable($this->columns, $this->url, 'table', 'Data Penjualan');\n }", "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest()->getPost()))\r\n\t\t;\r\n\t\treturn $table;\r\n\t}", "public function dataTableAction()\r\n\t{\r\n\t\t$dataTable = $this->tableDataTable();\r\n\r\n\t\treturn new ViewModel(array(\r\n\t\t\t\t'tableDataTable' => $dataTable,\r\n\t\t));\r\n\t}", "public function indexData()\n {\n $tickets = Ticket::with('provider', 'client')->where('type', 'admin');\n $url = url('/backend/tickets/');\n return Datatables::of($tickets)\n ->addColumn('action', function ($ticket) use($url) {\n return '<a href=\"'.$url.'/'.$ticket->id.'\" class=\"btn btn-success m-btn m-btn--icon\">\n <span><i class=\"fa fa-eye\"></i><span>View</span></span></a>';\n })\n ->editColumn('status', function ($ticket) use($url) {\n if($ticket->status == 'opened'){\n return '<label class=\"m-badge m-badge--default m-badge--wide\">Opened</label>';\n }else{\n return '<label class=\"m-badge m-badge--success m-badge--wide\">Closed</label>';\n }\n })\n ->editColumn('client', function ($ticket) use($url) {\n if($ticket->client_id != null){\n return $ticket->client->first_name . ' ' . $ticket->client->last_name;\n }else{\n return '--';\n }\n })\n ->editColumn('provider', function ($ticket) use($url) {\n if($ticket->provider_id != null){\n return $ticket->provider->first_name . ' ' . $ticket->provider->last_name;\n }else{\n return '--';\n }\n })\n ->rawColumns(['action', 'status'])\n ->make(true);\n }", "public function dataTable()\r\n {\r\n\r\n /*$model = DB::table('mst_news as n')\r\n ->join('mst_news_lang as nl','nl.news_id','n.id')\r\n ->select(\r\n 'n.id',\r\n 'n.view_count',\r\n 'n.active',\r\n 'n.created_at',\r\n 'n.created_by',\r\n 'nl.title'\r\n )\r\n ->where('nl.code',\"IND\")\r\n ->where('n.is_deleted',0)\r\n ->orderBy('n.created_at','desc')\r\n ->get();*/\r\n $model = VNews::query();\r\n $model->orderBy('created_at','desc');\r\n\r\n return DataTables::of($model)\r\n ->addColumn('action', function($model){\r\n return view('master.news.action', [\r\n 'model' => $model,\r\n 'url_show'=> route('news.show', base64_encode($model->id) ),\r\n 'url_edit'=> route('news.edit', base64_encode($model->id) ),\r\n 'url_destroy'=> route('news.destroy', base64_encode($model->id) )\r\n ]);\r\n })\r\n ->editColumn('created_at', function($model){\r\n return date('d M Y H:i', strtotime($model->created_at)).' WIB';\r\n })\r\n ->editColumn('created_by', function($model){\r\n $uti = new Utility;\r\n return $uti->getUser($model->created_by);\r\n })\r\n ->editColumn('active', function($model){\r\n return $model->active == 1 ? \"<span class='label label-primary'>Active</span>\":\"<span class='label label-danger'>Inactive</span>\";\r\n })\r\n ->addIndexColumn()\r\n ->rawColumns(['action','created_by','created_at','active'])\r\n ->make(true);\r\n }", "public function actionData()\n {\n// \n// $connector->configure(new Grid(), \"event_id\", \"start_date, end_date, event_name\");\n// $connector->render();\n\n return new Grid();\n }", "public function data()\n {\n $orders=libro::all();\n foreach ($orders as $key => $value) {\n \n if(count(autor::find($value->id_autor)))\n $value->id_autor=autor::find($value->id_autor)->nombre;\n else $value->id_autor='No asignado';\n \n }\n return \\Datatables::of($orders)->addColumn('action', 'libro.partials.vista')->make(true) ; \n }", "protected function tableModel()\n {\n }", "public function getPageData() {\n\t\t//$stat = Statistic::select(array('statistic.id', 'statistic.created_at','category.category_name', 'statistic.ip_address'))\n\t\t//->join('category','statistic.category_id','=','category.id'); \n\t\t$stat = StatView::select(array('id','date','category_name', 'ip_address'));\n\n\t\treturn Datatables::of($stat) \n\t\t-> add_column('actions','<a href=\"{{{ URL::to(\\'admin/blogs/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-xs btn-danger iframe\">{{{ Lang::get(\\'button.delete\\') }}}</a>') \n -> remove_column('id') -> make();\n\n\t}", "public function data()\n\t{\n\t\t//$this->orderRepository->pushCriteria(new RequestCriteria($request));\n\t\t$orders = array();\n\t\tif(Sentinel::inRole('admin'))\n\t\t\t$orders = $this->orderRepository->all();\n\t\telseif (Sentinel::inRole('company')){\n\t\t\t$orders = Sentinel::getUser()->company->orders;\n\t\t}\n\n\t\treturn DataTables::of($orders)\n\t\t\t->editColumn('updated_at',function(Order $order) {\n\t\t\t\treturn $order->updated_at->diffForHumans();\n\t\t\t})\n\t\t\t->editColumn('company',function(Order $order) {\n\t\t\t\treturn $order->company->name;\n\t\t\t})\n\t\t\t->editColumn('candidate',function(Order $order) {\n\t\t\t\treturn $order->candidate->user->first_name.' '.$order->candidate->user->last_name;\n\t\t\t})\n\t\t\t->editColumn('email',function(Order $order) {\n\t\t\t\treturn $order->candidate->user->email;\n\t\t\t})\n\t\t\t->addColumn('actions',function($order) {\n\n\t\t\t\t$actions = '<a href='. route('admin.orders.show', $order->id) .'><i class=\"livicon\" data-name=\"edit\" data-size=\"22\" data-loop=\"true\" data-c=\"#428BCA\" data-hc=\"#428BCA\" title=\"edit order\"></i></a>\n\t <a href='. route('admin.orders.print', $order->id) .' target=\"_blank\"><i class=\"livicon\" data-name=\"download\" data-size=\"22\" data-loop=\"true\" data-c=\"#F89A14\" data-hc=\"#F89A14\" title=\"download order\"></i></a>\n\t <a href='. route('admin.orders.invoice', $order->id) .' target=\"_blank\"><i class=\"livicon\" data-name=\"money\" data-size=\"22\" data-loop=\"true\" data-c=\"#F89A14\" data-hc=\"#F89A14\" title=\"invoice\"></i></a>';\n\n\t\t\t\treturn $actions;\n\t\t\t})\n\t\t\t->rawColumns(['actions'])\n\t\t\t->make(true);\n\t}", "public function getData()\n {\n return Datatables::of(App\\Models\\Courier::where('company_id', Auth::user()->company_id))->make(true);\n }", "public function getData()\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->load->database();\n\n\t\t$aColumns = explode(\", \", $this->select);\n\t\t$searchColumns = $aColumns;\n\t\t$sTable = $this->table;\n\n\t\t//id table\n\t\t$idColumn = $aColumns[count($aColumns)-1];\n\t\t$idColumn = explode(\".\", $idColumn);\n\t\tif(count($idColumn)>1){\n\t\t\t$idColumn = $idColumn[1];\n\t\t}else{\n\t\t\t$idColumn = $idColumn[0];\n\t\t}\n\n\t\t//column ordenar al final\n\t\tfor ($i=0; $i < count($aColumns) ; $i++) {\n\t\t\t$result = explode(\" AS \", $aColumns[$i]);\n\t\t\tif(count($result)>1){\n\t\t\t\t$aColumns[$i] = trim($result[1]);\n\t\t\t}\n\t\t}\n\n\t\t//columnas para buscar\n\t\tfor ($i=0; $i < count($searchColumns) ; $i++) {\n\t\t\t$result = explode(\" AS \", $searchColumns[$i]);\n\t\t\tif(count($result)>1){\n\t\t\t\t$searchColumns[$i] = trim($result[0]);\n\t\t\t}\n\t\t}\n\n\t\t// Paging\n\t\t$limit = \"\";\n\t\tif(isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1')\n\t\t{\t\t\n\t\t\tif((int)$_GET['iDisplayStart']!=0){\n\t\t\t\t$limit .= \" LIMIT \".(int)$_GET['iDisplayLength'].\" OFFSET \".(int)$_GET['iDisplayStart'].\" \";\n\t\t\t}else{\n\t\t\t\t$limit .= \" LIMIT \".(int)$_GET['iDisplayLength'];\n\t\t\t}\n\t\t}\n \n\t\t// Ordering\n\t\t$text_order_by_datatable = \"\";\n\t\tif(isset($_GET['iSortCol_0']))\n\t\t{\n\t\t\tfor($i=0; $i<intval($_GET['iSortingCols']); $i++)\n\t\t\t{\n\t\t\t\t$coma = ($i<intval($_GET['iSortingCols'])-1)?\", \":\"\";\n\t\t\t\tif($_GET['bSortable_'.intval($_GET['iSortCol_'.$i])] == 'true')\n\t\t\t\t{\n\t\t\t\t\t$text_order_by_datatable.=\" \".$searchColumns[(int)$_GET['iSortCol_'.$i]].\" \".strtoupper($_GET['sSortDir_'.$i]).$coma;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$text_order_by = \"\";\n\t\tif( !empty($text_order_by_datatable) && !empty($this->order_by) )\n\t\t{\n\t\t\t$text_order_by_datatable .= \", \";\n\t\t}\n\n\t\t$text_order_by_datatable = ($this->order_by!=\"\")?$text_order_by_datatable.$this->order_by:$text_order_by_datatable;\n\t\t$text_order_by .= (!empty($text_order_by_datatable)) ? \" ORDER BY \".$text_order_by_datatable : \" \";\n\t\t/* Multi column filtering */\n\t\t$where = \"\";\n\t\t$text_where_datatable = \"\";\n\t\tfor ( $i = 0 ; $i < count($searchColumns) ; $i++ )\n\t\t{\n\t\t\tif ( ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" ) && $_GET['sSearch'] != '' )\n\t\t\t{\n\t\t\t\tif($i==0){ $type=\"\"; }else{ $type=\" OR \"; }\n\t\t\t\t$text_where_datatable .= $type.$searchColumns[$i].\" LIKE '%\".$_GET['sSearch'].\"%' \";\n\t\t\t}\n\t\t}\n\t\tif($text_where_datatable!=\"\"){\n\t\t\t$text_where_datatable =\" (\".$text_where_datatable.\") \";\n\t\t}\n\n\t\t//where\n\t\tfor ($i=0; $i < count($this->where); $i++) {\n\t\t\tif($i==0 && $text_where_datatable!=\"\"){ $type=\" AND \"; }elseif($i==0 && $where==\"\"){ $type=\"\"; }else{ $type=\" AND \"; }\n\t\t\t$operador = \" \";\n\t\t\tif( !empty($this->where[$i][1]) )\n\t\t\t{\n\t\t\t\tif(!strpos($this->where[$i][0], \"=\")){\n\t\t\t\t\t$operador = \" = \";\n\t\t\t\t}\n\t\t\t\tif(!is_numeric($this->where[$i][1]) && strlen($this->where[$i][1])==1){\n\t\t\t\t\t$this->where[$i][1] = \"'\".$this->where[$i][1].\"'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$text_where_datatable.=$type.$this->where[$i][0].$operador.$this->where[$i][1].\" \";\n\t\t}\n\t\t$where = ($text_where_datatable!=\"\")?\" WHERE \".$text_where_datatable : \"\";\n\t\t\n $like = '';\n $text_like_datatable = '';\n for ($i=0; $i < count($this->like); $i++) {\n\t\t\tif($i==0 && $text_like_datatable!=\"\"){ $type=\" AND \"; }elseif($i==0 && $like==\"\"){ $type=\"\"; }else{ $type=\" AND \"; }\n\t\t\t$operador = \" \";\n\t\t\tif(!strpos($this->like[$i][0], \"=\")){\n\t\t\t\t$operador = \" like \";\n\t\t\t}\n\t\t\tif(!is_numeric($this->like[$i][1]) && strlen($this->like[$i][1])==1){\n\t\t\t\t$this->like[$i][1] = \"'\".$this->like[$i][1].\"'\";\n\t\t\t}\n\t\t\t$text_like_datatable.=$type.$this->like[$i][0].$operador.$this->like[$i][1].\" \";\n\t\t}\n if($where!='')\n {\n $like = ($text_like_datatable!=\"\")?\" AND \".$text_like_datatable : \"\";\n }else{\n $like = ($text_like_datatable!=\"\")?\" WHERE \".$text_like_datatable : \"\";\n }\n\n //group by\n $text_group_by = ( !empty($this->group_by) ) ? \" GROUP BY \".$this->group_by.\" \" : $this->group_by;\n \n \n\t\t//join\n\t\t$join = \"\";\n\t\tfor ($i=0; $i < count($this->join); $i++) {\n\t\t\tif(!isset($this->join[$i][2])){ $type_join=\"INNER\"; }else{ $type_join=$this->join[$i][2]; }\n\t\t\t$join.=\" \".$type_join.\" JOIN \".$this->join[$i][0].\" ON \".$this->join[$i][1].\" \";\n\t\t}\n\n\n\n\t\t$sql = \"SELECT \".$this->select.\" FROM \".$sTable.$join.$where.$like.$text_group_by.$text_order_by.$limit;\n\t\t//echo $sql;die;\n\t\t$rResult = $CI->db->query($sql);\n\n\t\t// Total data set length\n\t\t$iTotal = count($rResult->result());\n\n\t\t// Data set length after filtering\n\t\t$new_query = $CI->db->query(\"SELECT COUNT(*) AS found_rows FROM \".$sTable.$join.$where.$limit);\n\t\tif(count($new_query->row())>0){\n\t\t\t$iFilteredTotal = $new_query->row()->found_rows;\n\t\t}else{\n\t\t\t$iFilteredTotal = $iTotal;\n\t\t}\n\n\t\t// Output\n\t\t$output = array(\n\t\t\t'sEcho' => intval($_GET['sEcho']),\n\t\t\t'iTotalRecords' => $iTotal,\n\t\t\t'iTotalDisplayRecords' => $iFilteredTotal,\n\t\t\t'url' => urldecode($_SERVER['REQUEST_URI']),\n\t\t\t'aaData' => array()\n\t\t);\n\t\tforeach($rResult->result_array() as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\tfor($i=0; $i<count($aColumns); $i++)\n\t\t\t{\n\t\t\t\t$key = explode(\".\", $aColumns[$i]);\n\t\t\t\t$key = (count($key)>1) ? trim($key[1]) : trim($key[0]);\n\t\t\t\t$row[] = $aRow[$key];\n\t\t\t\tif (trim($key) == trim($idColumn)) { $row['DT_RowId'] = $aRow[$key]; } // Sets DT_RowId\n\t\t\t}\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\n\t\t//url export\n\t\t$url= urldecode($_SERVER['REQUEST_URI']);\n\t\t$output['links'] = \"$url\";\n\t\treturn $_GET['callback'].'('.json_encode( $output ).');';\n\t}", "public function getDatatable(){\n if(!checkRole(getUserGrade(2))){\n prepareBlockUserMessage();\n return back();\n }\n\n $records = DB::table('lms_class_series')\n ->select('lms_class_series.id','classes.name','lmsseries.title')\n ->join('classes','classes.id','=','lms_class_series.class_id')\n ->join('lmsseries','lmsseries.id','=','lms_class_series.series_id')\n ->where([\n ['lms_class_series.delete_status',0]\n ])\n ->orderBy('lms_class_series.id','desc');\n\n return Datatables::of($records)\n ->addColumn('action',function(){\n return null;\n })\n ->editColumn('name', function($records){\n return '<a href=\"'.PREFIX.'lms/class-content/detail/'.$records->id.'\">'.$records->name.'</a>';\n })\n ->removeColumn('id')\n ->make();\n }", "private function populate_rows() {\n\t\t\t$this->load->model('users_table');\n\t\t\t$data = $this->users_table->get_entries(); //echo $data[0]->Ime; //echo $data[0]->Prezime;\n\n\t return $data;\n\t\t}", "public function getData()\n {\n\n $users = DB::table('users')\n ->leftjoin('assigned_roles', 'assigned_roles.user_id', '=', 'users.id')\n ->leftjoin('roles', 'roles.id', '=', 'assigned_roles.role_id')\n ->select(DB::raw('users.id, users.username, users.email, GROUP_CONCAT(DISTINCT roles.name) as rolename, users.confirmed, users.created_at as created_at'))\n ->groupBy('users.username');\n\n $actions = $this->getActions(array(self::EDIT_ACTION, self::DELETE_ACTION));\n\n return Datatables::of($users)\n // ->edit_column('created_at','{{{ Carbon::now()->diffForHumans(Carbon::createFromFormat(\\'Y-m-d H\\', $test)) }}}')\n ->edit_column('confirmed', '{{ DataTableHelper::prepareBooleanColumn($confirmed) }}')\n ->add_column('actions', $actions)\n ->remove_column('id')\n ->make();\n }", "public function grid()\n {\n echo json_encode(array(\n \"data\" => $this->slider->getGridData()->result()\n ));\n }", "public function data()\n {\n $prodi = $this\n ->prodiRepo\n ->getAllData();\n\n return DataTables::of($prodi)\n ->addColumn('action', function($prodi){\n return '<center><a href=\"/dasbor/pengguna/prodi/form-ubah/'.$prodi->id.'\" class=\"btn btn-warning btn-xs\"><i class=\"fa fa-pencil\"></i></a> <a href=\"#hapus\" onclick=\"destroy('.$prodi->id.')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-times\"></i></a></center>';\n })\n ->rawColumns(['action'])\n ->make(true);\n }", "public function data()\n\t{\n\t\t$query = $this->query;\n\t\t$query['limit'] = $this->per_page;\n\t\t$query['offset'] = ($this->get_cur_page() - 1) * $this->per_page;\n\t\treturn $this->model->all($query);\n\t}", "public function data()\n {\n $news = News::leftJoin('company', 'news.company_id', '=', 'company.id')\n ->select([\n 'news.id',\n 'news.title',\n 'news.description',\n 'news.content',\n 'news.created_at',\n 'news.updated_at',\n 'company.name as companyname'\n ]);\n\n return $this->createCrudDataTable($news, 'admin.news.destroy', 'admin.news.edit')->make(true);\n }", "function tableData(){\n\t\t$entity_type = in(\"entity_type\");\t\t\n\t\t$table = $entity_type()->getTable();\n\t\t$test = in('test');\n\n\t\t// Table's primary key\n\t\t$primaryKey = 'id';\n\n\t\t// Array of database columns which should be read and sent back to DataTables.\n\t\t// The `db` parameter represents the column name in the database, while the `dt`\n\t\t// parameter represents the DataTables column identifier. In this case simple\n\t\t// indexes\n\t\t$columns = array(\n\t\t\tarray( \t'db' => 'id',\n\t\t\t\t\t'dt' => 0 \n\t\t\t\t ),\n\t\t\tarray( \t'db' => 'created', \n\t\t\t\t\t'dt' => 1, \n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t),\n\t\t\tarray( \t'db' => 'updated',\n\t\t\t\t\t'dt' => 2,\n\t\t\t\t\t'formatter' => function( $d, $row ) {\n\t\t\t\t\t\tif( $d == 0 ) return 0;\n\t\t\t\t\t\treturn date( 'M d, Y H:i', $d);\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t ),\n\t\t);\n\t\t\n\t\t$additional_columns = self::getAdditionalFields( $entity_type );\n\t\t\n\t\t$columns = array_merge( $columns, $additional_columns );\n\n\t\t// SQL server connection information\n\t\t$sql_details = array(\n\t\t\t'user' => 'root',\n\t\t\t'pass' => '7777',\n\t\t\t'db' => 'ci3',\n\t\t\t'host' => 'localhost'\n\t\t);\n\t\n\t\trequire( 'theme/admin/scripts/ssp.class.php' );\t\t\n\t\t$date_from = in(\"date_from\");\n\t\t$date_to = in(\"date_to\");\n\t\t$extra_query = null;\n\t\tif( !empty( $date_from ) ){\n\t\t\t$stamp_from = strtotime( $date_from );\n\t\t\t$extra_query .= \"created > $stamp_from\";\n\t\t}\n\t\tif( !empty( $date_to ) ){\n\t\t\t$stamp_to = strtotime( $date_to.\" +1 day\" ) - 1;\n\t\t\tif( !empty( $extra_query ) ) $extra_query .= \" AND \";\n\t\t\t$extra_query .= \"created < $stamp_to\";\n\t\t\t\n\t\t}\t\t\n\t\t\n\t\techo json_encode(\n\t\t\tSSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, $extra_query )\n\t\t);\n\t}", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "public function getForDataTable()\n {\n\n $q = $this->query();\n if (request('module') == 'task') {\n $q->where('section', '=', 2);\n } else {\n $q->where('section', '=', 1);\n }\n return\n $q->get();\n }", "function datatable()\n {\n return $this->table($this->table);\n }", "public function listTable()\n {\n // Searching the data\n $places = Place::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'places' => $places,\n ];\n\n //dd($data);\n\n return $data;\n }", "public function ajax_datagrid() {\n $data = Input::all();\n $CompanyID = User::get_companyID();\n $select = ['RoleName','Active','CreatedBy','updated_at','RoleID'];\n $roles = Role::select($select)->where('companyID',$CompanyID);\n return Datatables::of($roles)->make();\n }", "protected function _prepareRowsAction() {\n \n }", "public function getData()\n {\n $jobtitles = JobTitle::select(array('published', 'id', 'code', 'name', 'description', 'specification'));\n\n return Datatables::of($jobtitles)\n\t\t ->add_column('actions', '<div class=\"btn-group\">\n\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-xs btn-primary dropdown-toggle\" data-toggle=\"dropdown\">{{{ Lang::get(\\'general.action\\') }}} <span class=\"caret\"></span></button>\n\t\t\t\t\t\t\t\t\t\t\t<ul class=\"dropdown-menu\" role=\"menu\">\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"#\" onclick=\"getEdit(\\'{{{ URL::to(\\'admin/jobtitles/\\' . $id . \\'/edit\\' ) }}}\\');\">{{{ Lang::get(\\'button.edit\\') }}}</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"#\" onclick=\"getDelete(\\'{{{ URL::to(\\'admin/jobtitles/\\' . $id . \\'/delete\\' ) }}}\\');\">{{{ Lang::get(\\'button.delete\\') }}}</a></li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</div>'\n\t\t )\n ->remove_column('id')\n ->make();\n }", "public function index()\n {\n return Datatables::of(Studentcsv::query())->make(true);\n }", "public function show_alluser_datatbl()\n {\n $model = new mainModel();\n $UserId = session()->get('userid');\n $responese = $model->getAllUserDetails($UserId);\n return Datatables::of($responese)\n ->addIndexColumn()\n ->addColumn('master_roleId', function ($query) {\n $masterROles = $query->master_roleId;\n $sql = \"SELECT GROUP_CONCAT(MASTER_ROLE_NAME ,'') as 'MASTER_ROLE_NAME' FROM mst_tbl_master_role WHERE MASTER_ROLE_ID IN($masterROles) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->MASTER_ROLE_NAME;\n })\n ->addColumn('REPORTING_MANGERS', function ($query) {\n $REPORTING = $query->REPORTING_MANGERS;\n $sql = \"SELECT GROUP_CONCAT(username ,'') as 'REPORTING_MANGERS' FROM mst_user_tbl WHERE userId IN($REPORTING) \";\n $info = DB::select(DB::raw($sql));\n // print_r();\n return $info[0]->REPORTING_MANGERS;\n })\n ->addColumn('PRIMARY_MANGER', function ($query) {\n if ($query->PRIMARY_MANGER != null) {\n $assinedusers = DB::table('mst_user_tbl')->where(['Flag' => 'Show', 'userId' => $query->PRIMARY_MANGER])->get()->first();\n return $assinedusers->username;\n } else {\n return 'Not Assinded';\n }\n })->addColumn('SHIFT_ID', function ($query) {\n if ($query->SHIFT_ID != 0) {\n $assinedShift = DB::table('mst_tbl_shifts')->where(['Flag' => 'Show', 'SHIFT_ID' => $query->SHIFT_ID])->get()->first();\n return $assinedShift->SHIFT_NAME;\n } else {\n return 'No Shifts';\n }\n })\n ->addColumn('action', function ($query) {\n $id = Crypt::encrypt($query->userId);\n return '<a href=\"' . action('Admin\\UserController@editUser', Crypt::encrypt($query->userId)) . '\" id=\"userform' . $query->userId . '\"><img src=\"/asset/css/zondicons/zondicons/edit-pencil.svg\" style=\"width: 15px;margin-right: 20px; filter: invert(0.5);\" alt=\"\"></a>\n <a href=\"javascript:void(0)\" onclick=\"deleteUser(' . \"'$id'\" . ',event)\"><img src=\"/asset/css/zondicons/zondicons/close.svg\"\n style=\"width: 15px; filter: invert(0.5);\" alt=\"\"></a>\n ';\n })\n ->rawColumns(['action', 'PRIMARY_MANGER', 'master_roleId', 'REPORTING_MANGERS'])\n ->make(true);\n\n }", "public function data()\n {\n $article = PagesModel::join('article_categories', 'article_categories.id', '=', 'articles.article_category_id')\n ->select(array('articles.id','articles.title','article_categories.title as category',\n 'articles.created_at'));\n\n return Datatables::of($article)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/article/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n\n ->make();\n }", "public function getData()\n {\n return Datatables::of(App\\Models\\LiberationItem::where('company_id', Auth::user()->company_id))->make(true);\n }", "protected function fetchData()\n\t{\n\t\t$this->addScopes();\n\t\t$criteria=$this->getCriteria();\n\t\tif(($pagination=$this->getPagination())!==false)\n\t\t{\n\t\t\t$pagination->setItemCount($this->getTotalItemCount());\n\t\t\t$pagination->applyLimit($criteria);\n\t\t}\n\t\tif(($sort=$this->getSort())!==false)\n\t\t\t$sort->applyOrder($criteria);\n\t\treturn CActiveRecord::model($this->modelClass)->findAll($criteria);\n\t}", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "public function data()\n {\n $producers = Producer::select(array('producers.id', 'producers.name', 'producers.created_at'));\n return Datatables::of($producers)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/producer/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/producer/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n ->make();\n }", "public function laratablesRowData()\n\t\t{\n\t\t\t// Storage::download('coapath/' . $this->coa_name);\n\t\t//\tdd(Storage::disk('s3'));\n\t\t\treturn ['coa_path' =>'https://s3-us-west-1.amazonaws.com/'.$this->coa_name];\n/*\n\t\treturn [\n\t\t\t\t'coa_path' => Storage::disk('s3')\n\t\t\t];*/\n\t\t}", "public function indexData() \n {\n return Datatables::of(LogPatron::select(['id', 'actor_id', 'action', 'role', 'patron_id', 'created_at', 'deactivated', 'firstname', 'middlename', 'lastname']))\n ->addColumn('issued_by', function($row) { return $row->actor_id . ' | ' . $row->userLogPatron->username; })\n ->orderColumn('issued_by', function ($query, $order) {\n $query->orderBy('id', $order);\n })\n ->addColumn('name', function($row) { return $row->lastname . ', ' . $row->firstname . ' ' . $row->middlename; })\n ->orderColumn('name', function ($query, $order) {\n $query->orderBy('lastname', $order)->orderBy('firstname', $order)->orderBy('middlename', $order);\n })\n ->editColumn('user_id', function($row) { return $row->user_id . ' | ' . $row->userLogPatron->username; })\n ->editColumn('deactivated', function($row) { \n if($row->deactivated == 1) return \"Deactivated\";\n else return \"Active\";\n })\n ->addColumn('actions', 'admin.logs.patron.action')\n ->rawColumns(['link', 'actions'])\n ->make(true); \n }", "function data_table(){\n $aColumns = array( 'guid','code','code','name','date','total_types','total_weight','total_amount','decomposition_status','guid','item_id','decomposition_status' );\t\n\t$start = \"\";\n $end=\"\";\n\n if ( $this->input->get_post('iDisplayLength') != '-1' )\t{\n $start = $this->input->get_post('iDisplayStart');\n $end=\t $this->input->get_post('iDisplayLength'); \n }\t\n $decomposition=\"\";\n if ( isset( $_GET['iSortCol_0'] ) )\n {\t\n for ( $i=0 ; $i<intval($this->input->get_post('iSortingCols') ) ; $i++ )\n {\n if ( $_GET[ 'bSortable_'.intval($this->input->get_post('iSortCol_'.$i)) ] == \"true\" )\n {\n $decomposition.= $aColumns[ intval( $this->input->get_post('iSortCol_'.$i) ) ].\" \".$this->input->get_post('sSortDir_'.$i ) .\",\";\n }\n }\n\n $decomposition = substr_replace( $decomposition, \"\", -1 );\n\n }\n\t\t\n $like = array();\n\tif ( $_GET['sSearch'] != \"\" )\n {\n $like =array(\n 'po_no'=> $this->input->get_post('code'),\n );\n\n }\n $this->load->model('items')\t ;\n $rResult1 = $this->items->get($end,$start,$like,$this->session->userdata['branch_id']);\n $iFilteredTotal =$this->items->count($this->session->userdata['branch_id']);\n $iTotal =$iFilteredTotal;\n $output1 = array(\n \"sEcho\" => intval($_GET['sEcho']),\n \"iTotalRecords\" => $iTotal,\n \"iTotalDisplayRecords\" => $iFilteredTotal,\n \"aaData\" => array()\n );\n\t\t\n foreach ($rResult1 as $aRow )\n {\n $row = array();\n for ( $i=0 ; $i<count($aColumns) ; $i++ )\n {\n if ( $aColumns[$i] == \"id\" )\n {\n $row[] = ($aRow[ $aColumns[$i] ]==\"0\") ? '-' : $aRow[ $aColumns[$i] ];\n }\n else if ( $aColumns[$i]== 'date' )\n {\n /* General output */\n $row[] = date('d-m-Y',$aRow[$aColumns[$i]]);\n }\n else if ( $aColumns[$i] != ' ' )\n {\n /* General output */\n $row[] = $aRow[$aColumns[$i]];\n }\n\n }\n\n $output1['aaData'][] = $row;\n }\n\techo json_encode($output1);\n }", "public function getall(Request $request)\n {\n\n $schools = School::orderby('id', 'desc');\n $schools = $schools->get();\n return DataTables::of($schools)\n ->addColumn('action', function ($q) {\n $id = $q->id;\n\n $return = '<a class=\"btn btn-primary btn-sm openclientview\" data-toggle=\"modal\" data-school_id=\"'.$id.'\" data-typeid=\"\" data-target=\".view_detail\" href=\"#\"><i class=\"fas fa-folder\"></i> </a>';\n if(checkPermission(['super_admin'])){\n $return .= ' <a title=\"Edit\" data-id=\"'.$id.'\" data-toggle=\"modal\" data-target=\".add_modal\" class=\"btn btn-info btn-sm openaddmodal\" href=\"javascript:void(0)\"><i class=\"fas fa-pencil-alt\"></i> </a>';\n\n /*$return .= ' <a class=\"btn btn-danger btn-sm delete_record\" data-id=\"'.$q->id.'\" href=\"javascript:void(0)\"> <i class=\"fas fa-trash\"></i> </a>';\n*/\n $return .= ' <a class=\"btn btn-primary btn-sm opencommission\" data-toggle=\"modal\" data-school_id=\"'.$id.'\" data-typeid=\"\" data-target=\".add_commision\" href=\"#\"><i class=\"fas fa-plus\"></i> </a> ';\n }\n\n return $return;\n })\n ->addColumn('image', function ($q) {\n $image = url('public/company/employee/default.png'); \n if(file_exists(public_path().'/company/employee/'.$q->p_image) && !empty($q->p_image)) :\n $image = url('public/company/employee/'.$q->p_image); \n endif;\n return '<img class=\"profile-user-img img-fluid\" src=\"'.$image.'\" style=\"width:50px; height:50px;\">';\n }) \n\n ->addColumn('name', function ($q) {\n return $q->name;\n })\n\n ->addColumn('city', function ($q) {\n return $q->city->name;\n })\n \n ->addIndexColumn()\n ->rawColumns(['image','status', 'action'])->make(true);\n }", "public function search() {\n\t\t$data = $this->model->getSearchData($this->table->getFilterNames());\n\t\t$this->table->setData($data);\n\t\t// Store the user/object ids in the session so the report() can reuse them\n\t\t$this->storeIdsInSession($data);\n\t\t$this->tpl->setContent($this->table->getHTML());\n\t}", "public function listJsonAction()\n {\n $this->view->disable();\n if ($this->request->isPost()) $data = $this->request->getPost();\n\n $projcolumns = Projects::getFields();\n\n#echo '<pre>'; var_dump($projcolumns); echo '</pre>'; die(); \n //$projcolumns = $this->replace_key($projcolumns,'unit_type_id','unit_type_name');\n //$projcolumns = $this->replace_key($projcolumns,'available_unit_type_id','available_unit_type_name');\n //$projcolumns = $this->replace_key($projcolumns,'property_type_id','property_type_name');\n #$projcolumns = $this->replace_key($projcolumns,'property_type2_id','property2_type_name');\n #$projcolumns = $this->replace_key($projcolumns,'district_id','district_name');\n\n #$projcolumns = $this->replace_key($projcolumns,'project_type_id','project_type_name');\n #$projcolumns = $this->replace_key($projcolumns,'creation_by','action');\n $cols = array_keys($projcolumns);\n $model = new Projects();\n foreach ($cols as $key => $value) {\n $columns[$value] = [\n 'dbc' => $value,\n 'dtc' => $value,\n 'search' => true,\n 'extendIn' => false,\n ];\n switch ($value) {\n default:\n $columns[$value]['foreign'] = null;\n $columns[$value]['fldtype'] = null;\n $columns[$value]['custom'] = null;\n break;\n }\n }\n $sql = \"\";\n $condition = $sql;\n echo DataTable::generateTableV2($data, $columns, $model, $condition); \n }", "public function datatables()\n\t{\n\t\t//menunda loading (bisa dihapus, hanya untuk menampilkan pesan processing)\n\t\t// sleep(2);\n\n\t\t//memanggil fungsi model datatables\n\t\t$list = $this->m_guestbook->get_datatables();\n\t\t$data = array();\n\t\t$no = $this->input->post('start');\n\n\t\t//mencetak data json\n\t\tforeach ($list as $field) {\n\t\t\t$no++;\n\t\t\t$row = array();\n\t\t\t$row[] = $no;\n\t\t\t$row[] = $field['nama'];\n\t\t\t$row[] = $field['nim'];\n\t\t\t$row[] = $field['email'];\n\t\t\t$row[] = $field['date'];\n\t\t\t$data[] = $row;\n\t\t}\n\n\t\t//mengirim data json\n\t\t$output = array(\n\t\t\t\"draw\" => $this->input->post('draw'),\n\t\t\t\"recordsTotal\" => $this->m_guestbook->count_all(),\n\t\t\t\"recordsFiltered\" => $this->m_guestbook->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n\n\t\t//output dalam format JSON\n\t\techo json_encode($output);\n\t}", "public function datatable()\n {\n $data = $this->model->query();\n\n return DataTables::of($data)\n ->addIndexColumn()\n ->addColumn(\"image_show\",function($data){\n return \"<center><img src='\".$data->image .\"' width='130px' > </center>\";\n })\n ->addColumn('action', function ($data) {\n return '<center>\n <button class=\"btn btn-circle btn-sm btn-success btn_edit_attachment\" data-size=\"md\" data-url=\"'. url(\"admin/doctor/$data->id/edit-attachment\").'\" data-toggle=\"tooltip\" title=\"Ubah Gambar\">\n <i class=\"fa fa-image\"> </i>\n </button>\n\n <button class=\"btn btn-circle btn-sm btn-warning btn_edit\" data-size=\"lg\" data-url=\"'. url(\"admin/doctor/$data->id/edit\").'\" data-toggle=\"tooltip\" title=\"Ubah Data\">\n <i class=\"fa fa-edit\"> </i>\n </button>\n \n \n <button class=\"btn btn-circle btn-sm btn-danger btn_delete\" data-url=\"'.url(\"admin/doctor/$data->id\").'\" data-text=\"\" data-toggle=\"tooltip\" title=\"Hapus Data\">\n <i class=\"fa fa-trash\"> </i>\n </button>\n </center>';\n })\n ->rawColumns([\"image_show\",\"action\"])\n ->make(true);\n }", "function datatable(){\n \n $page = $_POST['page']; // get the requested page\n\t\t$limit = $_POST['rows']; // get how many rows we want to have into the grid\n\t\t$sidx = $_POST['sidx']; // get index row - i.e. user click to sort\n\t\t$sord = $_POST['sord']; // get the direction\n\t\tif(!$sidx) $sidx =1;\n\n\t\t$fields_arrayPackage = array(\n\t\t\t'j.radiographer_first_id','j.radiographer_first_name','u.first_name','j.radiographer_first_createOn as createOn','u1.first_name as firstname','j.radiographer_first_updateOn as updateOn'\n\t\t);\n\t\t$join_arrayPackage = array(\n\t\t\t'users AS u' => 'u.id = j.radiographer_first_createBy',\n\t\t\t'users AS u1' => 'u1.id = j.radiographer_first_updateBy',\n\t\t);\n\t\t$where_arrayPackage = array('j.radiographer_first_show_status' =>'1');\n\t\t$orderPackage = $sidx.' '. $sord;\n\n\t\t$count = $this->mcommon->join_records_counts($fields_arrayPackage, 'jr_radiographer_first as j', $join_arrayPackage, $where_arrayPackage, '', $orderPackage);\n\n\t\tif( $count >0 ) {\n\t\t\t$total_pages = ceil($count/$limit);\n\t\t} else {\n\t\t\t$total_pages = 0;\n\t\t}\n\t\tif ($page > $total_pages) $page=$total_pages;\n\t\t$start = $limit*$page - $limit; // do not put $limit*($page - 1)\n\n\t\t$responce->page = $page;\n\t\t$responce->total = $total_pages;\n\t\t$responce->records = $count;\n\t\t$dataTable_Details = $this->mcommon->join_records_all($fields_arrayPackage, 'jr_radiographer_first as j', $join_arrayPackage, $where_arrayPackage, '', $orderPackage,'object');\n\n\t\tif (isset($dataTable_Details) && !empty($dataTable_Details)) {\n\t\t\t$i=0;\n\t foreach ($dataTable_Details->result() as $dataDetail) {\n\t \t$responce->rows[$i]['id'] = $dataDetail->radiographer_first_id;\n\t \t//$responce->rows[$i]['cell']= array($dataDetail->ndtContractor_id);\n\t \t$responce->rows[$i]['cell']['edit_radiographer_first_id'] = get_buttons_new_only_Edit($dataDetail->radiographer_first_id,'master/Radiographer1/');\n\t \t$responce->rows[$i]['cell']['delete_radiographer_first_id'] = get_buttons_new_only_Delete($dataDetail->radiographer_first_id,'master/Radiographer1/');\n\t \t$responce->rows[$i]['cell']['radiographer_first_name'] = $dataDetail->radiographer_first_name;\n\t \t$responce->rows[$i]['cell']['first_name'] = $dataDetail->first_name;\n\t \t$responce->rows[$i]['cell']['createOn'] = get_date_timeformat($dataDetail->createOn);\n\t \t$responce->rows[$i]['cell']['firstname'] = $dataDetail->firstname;\n\t \t$responce->rows[$i]['cell']['updateOn'] = get_date_timeformat($dataDetail->updateOn);\n\t \t\t$i++;\n\t }\n\t //$responce->userData['page'] = $responce->page;\n\t //$responce->userData['totalPages'] = $responce->total;\n\t $responce->userData->totalrecords = $responce->records;\n\t } \n\t\techo json_encode($responce);\n }", "public function get_data(){\n\t\t// by using given function\n\t\tif($this->func_data_total && function_exists($this->func_data_total)){\n\t\t\t$this->items_total = call_user_func_array($this->func_data_total, array());\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t\t$total = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT COUNT(*) as cnt'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s',\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'] // WHERE\n\t\t\t\t),\n\t\t\t\t'obj'\n\t\t\t);\n\t\t\t$this->items_total = $total[0]->cnt;\n\t\t}\n\t\t\n\t\t// Getting data\n\t\t// by using given function\n\t\tif($this->func_data_get && function_exists($this->func_data_get)){\n\t\t\t$param = array($this->sql['offset'], $this->sql['limit']);\n\t\t\tif($this->order_by) $param[] = current($this->order_by);\n\t\t\tif($this->order_by) $param[] = key($this->order_by);\n\t\t\t$this->rows = call_user_func_array($this->func_data_get, $param);\n\t\t// by using direct SQL request\n\t\t}else{\n\t\t $columns = array();\n\t\t foreach ( $this->columns_names as $columns_name ) {\n\t\t\t $columns[] = $this->sql['table'] . '.' . $columns_name;\n }\n\t\t\t$this->rows = $this->db->fetch_all(\n\t\t\t\tsprintf(\n\t\t\t\t\t'SELECT %s'\n\t\t\t\t\t\t.' FROM %s'\n\t\t\t\t\t\t.'%s'\n\t\t\t\t\t\t.' ORDER BY %s %s'\n\t\t\t\t\t\t.' LIMIT %s%d',\n\t\t\t\t\timplode(', ', $columns), // COLUMNS\n\t\t\t\t\t$this->sql['table'], // TABLE\n\t\t\t\t\t$this->sql['where'], // WHERE\n\t\t\t\t\tkey($this->order_by), current($this->order_by), // ORDER BY\n\t\t\t\t\t$this->sql['offset'].',', $this->sql['limit'] // LIMIT\t\n\t\t\t\t),\n\t\t\t\t$this->sql['get_array'] === true ? 'array' : 'obj'\n\t\t\t);\n\t\t}\n\t\t\n\t\t// Adding actions to each row \n\t\tforeach($this->rows as &$row){\n\t\t\tif(is_object($row)) $row->actions = array_flip(array_keys($this->actions));\n\t\t\tif(is_array($row)) $row['actions'] = array_flip(array_keys($this->actions));\n\t\t} unset($row);\n\n\t\t$this->items_count = count((array)$this->rows);\n\t\t\n\t\t// Execute given function to prepare data\n\t\tif($this->func_data_prepare && function_exists($this->func_data_prepare))\n\t\t\tcall_user_func_array($this->func_data_prepare, array(&$this)); // Changing $this in function\n\t\telse{\n\t\t\t$this->preapre_data__default();\n\t\t}\n\t\t\n\t\treturn $this;\n\t\t\n\t}", "protected function grid()\n {\n $grid = new Grid(new BookCatalog);\n $grid->filter(function($filter){\n $filter->like('name', '章节名');\n $filter->equal('book_id', '书ID');\n $filter->equal('spider_status','爬取状态')->radio([\n '' => '全部',0=>'未爬取',1=>'已爬取',2=>'有错误'\n ]);\n });\n $grid->model()->orderBy('book_id', 'desc')->orderBy('inx', 'desc')->orderBy('num', 'desc');\n $grid->column('id', __('Id'));\n $grid->column('inx', __('顺序1'));\n $grid->column('num', __('顺序2'));\n $grid->column('name', __('章节名'))->display(function($name){\n return '<a href=\"/admin/catalogs/'.$this->id.'/edit\">'.$name.'</a>';\n });\n $grid->column('book', __('书名'))->display(function($book_id){\n return '<a href=\"/admin/books?id='.$this->book_id.'\">'.$this->book->name.'</a>';\n });\n $grid->column('author', __('作者'))->display(function($book_id){\n return $this->book->author;\n });\n\n $grid->column('spider_status', __('爬取状态'))\n ->using([0=>'未爬取',1=>'已爬取',2=>'有错误'],'未知')\n ->dot([0=>'warning',1=>'success',2=>'danger'],'danger');\n //$grid->column('type', __('Type'));\n $grid->column('open_type', __('Open type'))->using(['0' => '禁止访问', '1' => '免费访问' , '2' => '付费访问']);\n // $grid->column('url', __('Url'))->link();\n $grid->column('file', __('处理文件'));\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('更新时间'));\n\n return $grid;\n }", "public function loadTable() {\n $data = JenisProduk::All();\n return view('jenisproduk.partials.tables', ['data' => $data]);\n }", "protected function grid()\n {\n $grid = new Grid(new MoneyOut());\n\n $grid->model()->where('employee_id',self::current_id());\n\n $grid->disableActions();\n $grid->disableRowSelector();\n $grid->disableCreateButton();\n $grid->column('id', __('ID'))->sortable();\n $grid->column('client_id', '客户姓名')->using(Client::getAllClients());\n $grid->column('employee_id', '所属员工')->using(User::Employees());\n $grid->column('out_id','放贷产品');\n $grid->column('out_money','放贷金额');\n $grid->column('fee','居间服务费');\n $grid->column('pay_type','还款方式')->using(CrmConfig::getKeyValue('money_back_type'));\n $grid->column('pay_monthly','月还款金额');\n $grid->column('pay_count','期数');\n $grid->column('out_at','放贷日期');\n $grid->column('check_status','审核状态')->using($this->checkstatus);\n $grid->column('dianzihuidan','银行电子回单');\n\n $grid->filter(function (Grid\\Filter $filter){\n $filter->column(1/2,function ($filter){\n $filter->equal('client_id','客户姓名')->select(Client::getAllClients());\n $filter->equal('employee_id','销售人员')->select(User::Employees());\n $filter->equal('check_status','审核状态')->select($this->checkstatus);\n });\n\n $filter->column(1/2,function ($filter){\n $filter->equal('pay_type','还款方式')->select(CrmConfig::getKeyValue('money_back_type'));\n $filter->between('out_at','放贷日期')->date();\n });\n\n $filter->disableIdFilter();\n });\n\n return $grid;\n }", "public function getRow() {}", "public function index()\n\t{\n $this->load->library('SmartGrid/Smartgrid');\n \n // SQl for grid\n $sql = \"SELECT * FROM employee \"; \n \n // Column settings\n $columns = array(\n \"employee_id\"=>array(\"header\"=>\"Employee ID\", \"type\"=>\"label\", \"align\"=>\"left\", \"width\"=>\"80px\"),\n \"employee_name\"=>array(\"header\"=>\"Employee Name\", \"type\"=>\"label\", \"align\"=>\"left\", \"width\"=>\"150px\"),\n \"employee_dob\"=>array(\"header\"=>\"Date of Birth\", \"type\"=>\"date\", \"align\"=>\"center\", \"width\"=>\"230px\", \"date_format\"=>\"l jS \\of F Y h:i:s A\", \"date_format_from\"=>\"Y-m-d H:i:s\"),\n \"employee_join_date\"=>array(\"header\"=>\"Join Date\", \"type\"=>\"relativedate\", \"align\"=>\"left\", \"width\"=>\"150px\"),\n \"employee_gender\"=>array(\"header\"=>\"Gender\", \"type\"=>\"label\", \"align\"=>\"center\", \"width\"=>\"50px\")\n );\n \n // Config settings\n // Setting 'paging_enabled' to false will not add paging controls or limits the rows\n // it will just display the data as it on the datasource\n $config = array(\"paging_enabled\"=> false);\n \n // Set the grid \n $this->smartgrid->set_grid($sql, $columns, $config);\n \n // Render the grid and assign to data array, so it can be print to on the view\n $data['grid_html'] = $this->smartgrid->render_grid();\n \n // Load view\n\t\t$this->load->view('smartgrid_and_datatables', $data);\n }", "public function ajaxListAction() {\n $oTable = new \\Commun\\Grid\\GuildesGrid($this->getServiceLocator(), $this->getPluginManager());\n $oTable->setAdapter($this->getAdapter())\n ->setSource($this->getTableGuilde()->getBaseQuery())\n ->setParamAdapter($this->getRequest()->getPost());\n return $this->htmlResponse($oTable->render());\n }", "public function get_row();", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t// $view_link_url = $this->module_url_path.'/view/'.base64_encode($data->id);\n\t\t\t\t$view_link_url = \"javascript:void(0)\";\n\t\t\t\t$built_delete_href = $this->module_url_path.'/delete_country/'.base64_encode($data->id);\n\t\t\t\t$arr_roles = [];\n\n\t\t\t\t// $action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> <a href='.$built_delete_href.' title=\"delete\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Country ?\\')\"><i class=\"fa fa-trash\"></i></a>';\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$view_link_url.'\" data-original-title=\"View\" data-id=\"'.$data->id.'\" id=\"open_edit_modal\"><i class=\"fa fa-cog\" title=\"View\"></i></a> ';\n\n\t\t\t\tif($data->status != null && $data->status == \"0\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/unblock/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to activate this Country ?\\')\"><i class=\"fa fa-eye-slash\" title=\"Blocked\"></i></a>&nbsp&nbsp&nbsp ';\n\t\t\t\t}\n\t\t\t\telseif($data->status != null && $data->status == \"1\")\n\t\t\t\t{\n\t\t\t\t\t$action_button_html .= '<a href=\"'.$this->module_url_path.'/block/'.base64_encode($data->id).'\" onclick=\"return confirm_action(this,event,\\'Do you really want to inactivate this Country ?\\')\"><i class=\"fa fa-eye\" title=\"Active\"></i></a> &nbsp&nbsp&nbsp';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$id \t \t\t\t= isset($data->id)? base64_encode($data->id):'';\n\t\t\t\t$country_id \t\t\t= isset($data->country_id)? $data->country_id :'';\n\t\t\t\t$country_english_name \t= isset($data->country_english_name)? $data->country_english_name :'';\n\t\t\t\t$country_arabic_name \t= isset($data->country_arabic_name)? $data->country_arabic_name :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'-';\n\t\t\t\t\n\t\t\t\t$i = $key+1;\n\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->country_id \t= $country_id;\n\t\t\t\t$build_result->data[$key]->country_english_name = $country_english_name;\n\t\t\t\t$build_result->data[$key]->country_arabic_name = $country_arabic_name;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "public function getData()\n {\n return $this->grid->getFilter()->execute(true);\n }", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public function getGrid()\n {\n return $this->all();\n }", "public function getGrid()\n {\n return $this->all();\n }", "public function indexAction()\n {\n $appraisalInitModel = new Default_Model_Appraisalmanager();\t\n $call = $this->_getParam('call');\n if($call == 'ajaxcall')\n $this->_helper->layout->disableLayout();\n\t\t\n $view = Zend_Layout::getMvcInstance()->getView();\t\t\n $objname = $this->_getParam('objname');\n $refresh = $this->_getParam('refresh');\n $dashboardcall = $this->_getParam('dashboardcall');\n\t\t\n $data = array();\n $searchQuery = '';\n $searchArray = array();\n $tablecontent='';\n\t\t\n if($refresh == 'refresh')\n {\n if($dashboardcall == 'Yes')\n $perPage = DASHBOARD_PERPAGE;\n\t\t\telse\t\n\t\t\t\t$perPage = PERPAGE;\n\t\t\t$sort = 'DESC';$by = 'ai.modifieddate';$pageNo = 1;$searchData = '';$searchQuery = '';$searchArray='';\n }\n else \n {\n $sort = ($this->_getParam('sort') !='')? $this->_getParam('sort'):'DESC';\n $by = ($this->_getParam('by')!='')? $this->_getParam('by'):'ai.modifieddate';\n if($dashboardcall == 'Yes')\n $perPage = $this->_getParam('per_page',DASHBOARD_PERPAGE);\n else \n $perPage = $this->_getParam('per_page',PERPAGE);\n $pageNo = $this->_getParam('page', 1);\n /** search from grid - START **/\n $searchData = $this->_getParam('searchData');\t\n $searchData = rtrim($searchData,',');\n /** search from grid - END **/\n }\n\n $dataTmp = $appraisalInitModel->getGrid($sort, $by, $perPage, $pageNo, $searchData,$call,$dashboardcall);\t\t \t\t\n\n array_push($data,$dataTmp);\n $this->view->dataArray = $data;\n $this->view->call = $call ;\n $this->view->messages = $this->_helper->flashMessenger->getMessages();\n $this->render('commongrid/index', null, true);\n }", "public function getData()\n {\n $types = Type::select(array('types.id', 'types.name', 'types.created_at'));\n\n return Datatables::of($types)\n\n\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/types/\\' . $id . \\'/edit\\' ) }}}\" class=\"iframe btn btn-mini\">{{{ Lang::get(\\'button.edit\\') }}}</a>\n <a href=\"{{{ URL::to(\\'admin/types/\\' . $id . \\'/delete\\' ) }}}\" class=\"iframe btn btn-mini btn-danger\">{{{ Lang::get(\\'button.delete\\') }}}</a>\n ')\n\n ->remove_column('id')\n\n ->make();\n }", "abstract public function getData(GridViewRequest $request);", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t $condition = array(\"ide\" =>$this->ide);\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function __getData() {\n $qb = $this->entity->listQuery();\n\t$qb = $this->setArchiveStatusQuery($qb);\n $data = $this->entity->dtGetData($this->getRequest(), $this->columns, null, $qb);\n foreach ($data['data'] as $key => $val) {\n $id= \\Application\\Library\\CustomConstantsFunction::encryptDecrypt('encrypt', $val['action']['id']);\n\t $data['data'][$key]['protocol'] .= '<input type=\"checkbox\" class=\"unique hide\" value=\"'.$id.'\">';\n $data['data'][$key]['start_date'] = (isset($val['start_date'])) ? DateFunction::convertTimeToUserTime($val['start_date']) : '-';\n $studyPricingObj = $this->entity->getEntityObj($val['action']['pricingid'], 'Application\\Entity\\PhvStudyPricing');\n $data['data'][$key]['cro'] = $studyPricingObj->getCro()->getCompanyName();\n if (empty($data['data'][$key]['cro'])) {\n $data['data'][$key]['cro'] = '-';\n }\n $btnLabel = $this->translate('Archive');\n $textMessage = $this->translate('Are you sure you want to archive study?');\n if ($val['action']['status'] == 3) {\n $btnLabel = $this->translate('Unarchive');\n $textMessage = $this->translate('Are you sure you want to unarchive study?');\n }\n \n if ($data['data'][$key]['status'] != 2 && $this->currentUser->getRole()->getId() == 2) {\n $data['data'][$key]['action'] = \"<button class='tabledit-edit-button btn btn-sm btn btn-rounded btn-inline btn-primary-outline' onclick='showModal(\\\"\" . $id . \"\\\",\\\"\" . $textMessage . \"\\\")' type='button' value='1'>\" . $btnLabel . \"</button>&nbsp;\";\n } \n $data['data'][$key]['status'] = $this->entity->setStatusText($val['action']['status']);\n }\n\n return $data;\n }", "public function anyData()\n\t{\n\t return Datatables::collection(goods::all())->make(true);\n\t}", "protected function grid()\n {\n return Admin::grid(Flow_model::class, function (Grid $grid) {\n $userid = admin::user()->id;\n if ($userid == 1 ) {\n admin_toastr(\"暂无权限!\");\n return redirect(admin_url('admin'));\n }\n // $flow = DB::table('flow_model')->pluck('sort','name');\n $grid->model()->where('temp','>',0)->where('z_uid',$userid)->orderBy('temp','asc')->orderBy('sort','asc');\n $grid->name('流程名称')->display(function($name) use($userid){\n $rank = DB::table('flow_model')->where('z_uid',$userid)->where('temp',$this->temp)->where('sort','<=',$this->sort)->count();\n return \"<span style=\\\"font-size:18px;background-color:red;border-radius:5px;padding:1px 5px\\\">\".$rank.\"</span>\".$name;\n });\n $grid->temp('所属模板')->label();\n $grid->sort('排序权重')->label('primary');\n $grid->disableExport();\n $grid->disableRowSelector();\n\n $grid->filter(function($filter) use($userid){\n $filter->disableIdFilter();\n $temp = DB::table('flow_model')->where('z_uid',$userid)->pluck('temp');\n $data=[];\n if ($temp) {\n foreach ($temp as $k => $v) {\n $data[$v] = '模板'.$v;\n }\n }\n \n $filter->equal('temp','请选择模板')->select($data);\n \n });\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n });\n }", "protected function grid()\n {\n $grid = new Grid(new BookGood);\n $grid->actions(function ($actions) {\n $actions->disableView();\n });\n $grid->filter(function($filter){\n $filter->equal('book_id','关联的书')->select(function ($id) {\n $book = Book::find($id);\n if ($book) {\n return [$book->id => $book->name];\n }\n })->ajax('/admin/api/books/getBooks');\n });\n $grid->model()->orderBy('hot', 'desc');\n $grid->column('id', __('Id'));\n $grid->column('book', __('书名'))->display(function($book_id){\n return '<a href=\"/admin/books?id='.$this->book_id.'\">'.$this->book->name.'</a>';\n });\n $grid->column('author', __('作者'))->display(function($book_id){\n return $this->book->author;\n });\n $grid->column('hot', __('推荐度'));\n $grid->column('reason', __('推荐原因'));\n $grid->column('created_at', __('创建时间'));\n $grid->column('updated_at', __('更新时间'));\n return $grid;\n }", "public function getData() {\n\t\t$navs = NavigationGroup::select(array('navigation_groups.id', 'navigation_groups.title', 'navigation_groups.slug'));\n\n\t\treturn Datatables::of($navs) -> add_column('actions', '<a href=\"{{{ URL::to(\\'admin/navigationgroups/\\' . $id . \\'/edit\\' ) }}}\" class=\"iframe btn btn-default btn-sm\"><i class=\"icon-edit \"></i></a>\n <a href=\"{{{ URL::to(\\'admin/navigationgroups/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger\"><i class=\"icon-trash \"></i></a>\n \n ') -> remove_column('id') -> make();\n\t}", "protected function grid()\n {\n $grid = new Grid(new TaskOrder);\n $grid->model()->orderBy('id', 'desc');\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->equal('eid','快递单号')->integer();\n $filter->equal('store','快递网点')->select(storedatas(1));\n $filter->equal('etype','快递公司')->select(edatas());\n $filter->equal('sname','客服名称');\n $filter->between('created_at', '导入时间')->datetime();\n });\n $grid->id('ID');\n $grid->eid('快递单号');\n $grid->sname('客服名称');\n $grid->store('快递网点');\n $grid->etype('快递公司');\n\n $grid->created_at('分配时间');\n //$grid->updated_at('分配时间');\n $excel = new ExcelExpoter();\n $excel->setAttr([ '快递单号','快递网点','快递公司','负责客服','导入时间'], ['eid','store','etype','sname','created_at']);\n $grid->exporter($excel);\n\n return $grid;\n }", "protected function grid()\n {\n $grid = new Grid(new GoodsClass);\n $pid=Input::get(\"pid\",null);\n $grid->model()->where(\"pid\",$pid);\n $info_array=[\n array(\"field\"=>\"id\",\"title\"=>\"id\",\"type\"=>\"value\"),//展示昵称\n array(\"field\"=>\"parent.title\",\"title\"=>\"上级\",\"type\"=>\"default\",\"default\"=>\"顶级\"),//展示昵称\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"value\"),//展示昵称\n array(\"field\"=>\"desc\",\"title\"=>\"简介\",\"type\"=>\"value\"),//展示真实姓名\n array(\"field\"=>\"icon\",\"title\"=>\"图标\",\"type\"=>\"image\"),//展示图片\n array(\"field\"=>\"updated_at\",\"title\"=>\"更新时间\",\"type\"=>\"value\"),\n ];\n BaseControllers::setlist_show($grid,$info_array);//拼接列表展示数据\n\n $grid->actions(function ($actions) use($pid) {\n\n if(empty($pid)){\n $actions->add(new SeeNext());\n }\n });\n\n return $grid;\n }", "protected function grid()\n {\n date_default_timezone_set(\"PRC\");\n\n $grid = new Grid(new BackPeopleInfo());\n\n $grid->column('id', __('序号'));\n $grid->column('name', __('姓名'));\n $grid->column('id_num', __('身份证号码'));\n $grid->column('phone', __('手机号码'));\n $grid->column('address', __('楼栋房号'));\n $grid->column('originatin', __('始发地'));\n $grid->column('back_date', __('返回日期'));\n $grid->column('isolate_date', __('隔离日期'));\n $grid->column('isolate_flag', __('解除隔离'));\n $grid->column('isolate_level', __('隔离等级'));\n $grid->column('qrcode_flag', __('网格化管理'));\n $grid->column('vehicle_info', __('交通工具'));\n $grid->column('remarks', __('备注'));\n\n $grid->filter(function($filter){\n $filter->disableIdFilter();\n $filter->scope('new_isolate', '今日新增')->where('isolate_date',date(\"Y-m-d\"));\n $filter->scope('qrcode_new', '今日扫码')->where([['qrcode_flag', '是'],['isolate_date',date(\"Y-m-d\")]]);\n $filter->scope('new_free', '今日解除')->where('isolate_date', date(\"Y-m-d\", strtotime(\"-15 day\")));\n $filter->scope('qrcode', '扫码人员')->where('qrcode_flag', '是');\n $filter->scope('isolate', '隔离人员')->where('isolate_flag', '否');\n $filter->scope('hubei', '湖北地区')->where('isolate_level', 'like','%湖北%');\n $filter->scope('hot_city', '一省四市')->where('isolate_level', 'like','%两省四市%');\n $filter->scope('other', '其他地区')->where('isolate_level', '普通');\n $filter->like('name','姓名');\n $filter->like('address','楼栋号');\n $filter->like('originatin','始发地');\n $filter->equal('isolate_flag','解除隔离')->radio([\n '否' => '否',\n '是' => '是',\n ]);\n\n\n\n\n });\n\n return $grid;\n }", "protected function grid()\n {\n return Admin::grid(Repertory::class, function (Grid $grid) {\n //$grid->disableFilter();\n //区域\n $area_id = Admin::user()->from_area;\n //查找区域的admin_user_name\n $area_info = AreaName::find($area_id);\n\n\n $grid->paginate(100);\n $grid->id('编号')->display(function ($val) {\n return config('admin.repertory_id_prefix') . sprintf('%06s', $val);\n });\n\n\n $grid->model()->orderBy('id', 'desc');\n $grid->model()->orderBy('shiji_date', 'desc');\n $grid->model()->orderBy('check_date', 'desc');\n\n\n if (isset($_GET['type']) && $_GET['type'] == 'wei') {\n $grid->model()->where('flag', 0);\n $grid->model()->where(function ($query) use ($area_info) {\n $query->where('is_fid', 0);\n $query->where('admin_user_name', $area_info->admin_user_name);\n });\n $grid->model()->where(function ($query) {\n $query->where('user_id', NULL)->orWhere('user_id', 0)->orWhere('is_check', 1);\n\n });\n } else {\n $grid->model()->where(function ($query) use ($area_info) {\n $query->where('flag', 0);\n $query->where('is_fid', 0);\n $query->where('is_check', 0);\n $query->where('user_id', '<>', 0);\n $query->where('admin_user_name', $area_info->admin_user_name);\n\n });\n };\n\n\n //$grid -> model() -> where('status','<>',3);\n\n\n $grid->filter(function ($filter) {\n $filter->scope('status', '已发货')->where('status', 3);\n\n $filter->scope('status_wei', '未发货、未取消')->where('status', '<>', 3)->where('status', '<>', 7);\n\n $filter->scope('status_quxiao', '已取消')->where('status', 7);\n\n $filter->scope('status_tijiao', '客户提交')->where('sub_type', '>', 0);\n $filter->column(1 / 2, function ($filter) {\n //客户筛选\n $users = DB::table('wxuser')->get(['nickname', 'id']);\n $user_arr = [];\n foreach ($users as $vo) {\n $user_arr[$vo->id] = $vo->nickname;\n }\n $filter->equal('user_id', '客户')->select($user_arr);\n\n //到货状态筛选\n $config_daohuo = config('admin.repertory_status');\n $filter->in('status', '状态')->multipleSelect($config_daohuo);\n\n //快递筛选\n $config_kuaidi = config('admin.repertory_company');\n $filter->equal('company', '快递公司')->select($config_kuaidi);\n\n\n //母单号\n $filter->where(function ($query) {\n $input = $this->input;\n if ($input) {\n //根据单号 找repertory_id\n $repertory_info = Repertory::where('numbers', 'like', '%' . $input . '%')->get();\n $repertory_ids = [];\n if (count($repertory_info)) {\n foreach ($repertory_info as $vo) {\n $repertory_ids[] = $vo->id;\n }\n $query->whereIn('fid', $repertory_ids);\n } else {\n $query->where('id', 0);\n }\n\n }\n\n\n }, '母单号');\n\n //$filter -> equal('canghao','入仓号');\n\n\n });\n\n\n $filter->column(1 / 2, function ($filter) {\n\n $filter->equal('dabao_num', '打包数量');\n $filter->equal('fachu_num', '发出数量');\n $filter->equal('shengyu_num', '剩余数量');\n\n //包裹状态筛选\n $config_package_status = config('admin.package_status');\n $filter->in('package_status', '打包状态')->select($config_package_status);\n $filter->where(function ($query) {\n $input = $this->input;\n if ($input) {\n $query->where('numbers', 'like', '%' . trim($input) . '%')->orWhere('canghao', 'like', '%' . trim($input) . '%');\n }\n }, '单号');\n\n });\n\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n //$filter -> useModal();\n $filter->expand();\n\n\n });\n\n if (isset($_GET['type']) && $_GET['type'] == 'wei') {\n $grid->numbers('单号')->display(function ($value) {\n if (!$value) {\n return $this->canghao;\n } else {\n return $value;\n }\n });\n $user_config = [];\n $user_config_temp = WxUser::select('id', 'nickname')->get();\n foreach ($user_config_temp as $value) {\n $user_config[$value->id] = $value->id . '-' . $value->nickname;\n }\n\n $grid->sub_type('提交类型')->display(function ($value) {\n $sub_configs = config('admin.repertory_sub_type');\n if (isset($sub_configs[$value])) {\n return $sub_configs[$value];\n }\n });\n\n //提交日期\n $grid->created_at('提交时间')->display(function ($value) {\n return date('Y-m-d H:i', $value);\n });\n\n\n $grid->user_id('客户')->editable('select', $user_config);\n\n\n /*\n $area_config = [];\n $area_config_temp = AreaName::select('id','area_name') -> get();\n foreach($area_config_temp as $value){\n $area_config[$value -> id] = $value -> id.'-'.$value -> area_name;\n }\n $grid -> area_id('区域') ->editable('select', $area_config);\n */\n\n /*\n $grid -> category('货物品类');\n $grid -> card('司机身份证');\n $grid -> tel('司机手机');\n $grid -> mail('邮箱');\n */\n\n\n }\n\n if (!isset($_GET['type'])) {\n /*\n $grid -> column('详情') -> display(function($value){\n return view('admin.repertory_grid');\n });\n */\n\n\n $grid->fajian_date('发件');\n $grid->company('物流')->display(function ($value) {\n $config_company = config('admin.repertory_company');\n if ($value) {\n return $config_company[$value];\n }\n });\n\n\n $grid->user_id('客户')->display(function ($value) {\n if ($value) {\n $userinfo = DB::table('wxuser')->where([\n 'id' => $value\n ])->first();\n if ($userinfo) {\n return $userinfo->nickname;\n }\n\n }\n\n });\n $grid->numbers('单号');\n /*\n $grid->fid('母单号')->display(function ($value) {\n if ($value) {\n $repertory = Repertory::find($value);\n if ($repertory) {\n return $repertory->numbers;\n }\n\n }\n });\n */\n\n\n $grid->num('件数');\n $grid->weight('重量')->editable();\n $grid->yubao_num('预报箱数');\n $grid->yuji_date('预计到港')->editable('date');\n $grid->shiji_date('实际到港');\n\n $status_config = config('admin.repertory_status');\n $grid->status('状态')->editable('select', $status_config);\n\n /*\n $grid->status('状态') -> display(function($value){\n $status_config = config('admin.repertory_status');\n if(isset($status_config[$value])){\n return $status_config[$value];\n }\n\n });\n */\n\n\n /*\n $grid->package_status('包裹状态')->display(function($value){\n $package_config = config('admin.package_status');\n if(isset($package_config[$value])){\n return $package_config[$value];\n }\n });\n */\n\n\n $grid->dabao_num('打包数量');\n $grid->fachu_num('发出数量');\n $grid->shengyu_num('剩余数量');\n $grid->up_numbers('上卡板数量');\n\n $grid->goods_value('货值')->editable();\n $currency_config = config('admin.currency');\n $grid->currency('币种')->editable('select', $currency_config);\n $deal_methods = config('admin.deal_method');\n $grid->deal_method('处理方案')->editable('select', $deal_methods);\n $grid->remark('备注')->editable('textarea');\n\n /*\n $grid -> updated_at('修改') -> display(function($value){\n return date('m-d H:i',$value);\n });\n */\n\n /*\n $grid->actions(function ($actions) {\n $id = $actions->getKey();\n $actions->disableDelete();\n $rows = $actions->row;\n\n\n // append一个操作\n $url_address = admin_url('repertoryAddress') . '?repertory_id=' . $id;\n $actions->append('<a href=\"' . $url_address . '\" style=\"margin-top:10px;\" ><i class=\"fa fa-bank\"></i></a>');\n\n $url_chai = admin_url('repertorySplit') . '?repertory_id=' . $id;\n //拆分订单\n $actions->append('<a href=\"' . $url_chai . '\" style=\"margin-top:10px;\" ><i class=\"fa fa-bomb\"></i></a>');\n\n\n\n if($rows -> sub_type == 2 || $rows -> sub_type == 3 ){\n $url_pdf = admin_url('repertoryPrint'). '?repertory_id=' . $id;\n //打印pdf\n $actions->append('<a href=\"' . $url_pdf . '\" style=\"margin-top:10px;\" ><i class=\"fa fa-print\"></i></a>');\n\n\n\n $url_eye = admin_url('repertoryCheckInfo').'?id=' .$id.'&sub_type='.$rows -> sub_type.'&from=info';\n $actions->append('<a href=\"' . $url_eye . '\" style=\"margin-top:10px;\" ><i class=\"fa fa-eye\"></i></a>');\n\n }\n\n\n });\n\n */\n\n $grid->column('操作')->display(function ($value) {\n $id = $this->id;\n $sub_type = $this->sub_type;\n $url_address = admin_url('repertoryAddress') . '?repertory_id=' . $id;\n $url_chai = admin_url('repertorySplit') . '?repertory_id=' . $id;\n $url_pdf = admin_url('repertoryPrint') . '?repertory_id=' . $id;\n $url_eye = admin_url('repertoryCheckInfo') . '?id=' . $id . '&sub_type=' . $sub_type . '&from=info';\n\n\n return view('admin.repertory_grid')->with([\n 'url_address' => $url_address,\n 'url_chai' => $url_chai,\n 'url_pdf' => $url_pdf,\n 'url_eye' => $url_eye,\n 'sub_type' => $sub_type,\n 'url_edit' => admin_url('repertory') . '/' . $id . '/edit',\n 'id' => $id\n ]);\n });\n\n $grid->disableActions();\n $grid->exporter(new RepertoryExcelExpoter());\n }\n\n if (isset($_GET['type']) && $_GET['type'] == 'wei') {\n $grid->actions(function ($actions) {\n $key = $actions->getKey();\n $info = Repertory::find($key);\n if ($info->is_check) {\n //审核通过按钮\n $actions->append(new CheckRepertory($info));\n }\n\n $actions->disableDelete();\n $actions->disableEdit();\n });\n }\n\n if (isset($_GET['type']) && $_GET['type'] == 'wei') {\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n\n //$batch->disableDelete();\n\n $batch->add('通过', new PassRepertory());\n });\n });\n } else {\n $grid->tools(function ($tools) {\n $tools->batch(function ($batch) {\n $batch->disableDelete();\n });\n });\n }\n\n });\n }", "public function getRows();", "public function getRows();", "public function getTableContent() {\n\t\treturn \"<tr data-key='\" . $this -> getKey() . \"'><td>\" . $this -> key . \"</td><td contenteditable='true'>\" . $this -> value . \"</td><td>\" . $this -> dataType . \"</td></tr>\";\n\t}", "public function getData()\n {\n return Datatables::of($this->repository->findByConference($this->getConference()->id))\n ->addColumn('actions', function ($data) {\n return view('partials/actions', ['route' => $this->getRouteName(), 'id' => $data->id]);\n })\n ->make(true);\n }", "private function table_data(){\n $data = array();\n\n global $wpdb;\n\n $data = $wpdb->get_results(\"SELECT * FROM {$wpdb->prefix}lic_activations ORDER BY ID ASC\", ARRAY_A);\n \n return $data;\n }", "public function data()\n {\n $menuitems = Menuitem::join('menu_categories', 'menu_categories.id', '=', 'menu_items.menu_category_id')\n ->select(array('menu_items.id','menu_items.name','menu_items.price','menu_categories.name as category', \n 'menu_items.created_at'))->orderBy('menu_items.id', 'DESC')->get();\n \n\n return Datatables::of($menuitems)\n ->add_column('actions', '<a href=\"{{{ URL::to(\\'admin/menuitem/\\' . $id . \\'/edit\\' ) }}}\" class=\"btn btn-success btn-sm iframe\" ><span class=\"glyphicon glyphicon-pencil\"></span> {{ trans(\"admin/modal.edit\") }}</a>\n <a href=\"{{{ URL::to(\\'admin/menuitem/\\' . $id . \\'/delete\\' ) }}}\" class=\"btn btn-sm btn-danger iframe\"><span class=\"glyphicon glyphicon-trash\"></span> {{ trans(\"admin/modal.delete\") }}</a>\n <input type=\"hidden\" name=\"row\" value=\"{{$id}}\" id=\"row\">')\n ->remove_column('id')\n\n ->make();\n }", "function getData() {\n checkIfNotAjax();\n $this->libauth->check(__METHOD__);\n $cpData = $this->BeOnemdl->getDataTable();\n $this->BeOnemdl->outputToJson($cpData);\n }", "public function get_data()\n {\n $post = $this->input->post(null, true);\n if ($post) {\n // ambil data dari model\n $list = $this->hasil->get_datatables();\n $data = array();\n $no = $post['start'];\n foreach ($list as $field) {\n $no++;\n $row = array();\n $row[] = $no;\n $row[] = $field->nama_akun;\n $row[] = $this->date->tanggal($field->tgl, 's');\n $row[] = $field->nilai;\n $data[] = $row;\n }\n\n $output = array(\n \"draw\" => $post['draw'],\n \"recordsTotal\" => $this->hasil->count_all(),\n \"recordsFiltered\" => $this->hasil->count_filtered(),\n \"data\" => $data,\n );\n // tampilkan data\n echo json_encode($output);\n } else {\n $this->index();\n }\n }", "public function getAction() {\r\n \t\r\n \t$data = $this->getMapper()->fetch($this->getRequest());\r\n \t\r\n \tif (is_array($data)) {\r\n \t\t$this->view->data = $data;\r\n \t} else {\r\n \t\t$this->view->data = $data->toArray();\r\n \t}\r\n \t$this->view->total = $this->getMapper()->rowCount();\r\n \treturn $this->view->data;\r\n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function getCustomTableData()\n {\n $connection = $this->resourceConnection->getConnection();\n $select = $connection->select();\n $select->from(self::TABLE_NAME, ['table_id', 'name', 'content']);\n $result = $connection->fetchAll($select);\n\n return $result;\n }", "public function getdata(){\n\n $type = \\Request::query('only');\n\n $user = DB::table('users');\n $user->select('*');\n\n if($type=='admins'){\n $user->where('usertype', '=', 'Admin');\n }elseif($type=='staff'){\n $user->where('usertype', '=', 'Staff');\n }elseif($type=='banned'){\n $user->where('usertype','=', 'banned');\n }\n\n\n\n return Datatables::of($user)\n\n ->addColumn('icon', function ($user) {\n\n return view('._admin._particles.datatable.userlist.icon', compact('user'))->render();\n\n })->addColumn('username', function ($user) {\n\n return view('._admin._particles.datatable.userlist.username', compact('user'))->render();\n\n })->addColumn('email', function ($user) {\n\n return view('._admin._particles.datatable.userlist.email', compact('user'))->render();\n\n })->addColumn('status', function ($user) {\n\n return view('._admin._particles.datatable.userlist.status', compact('user'))->render();\n\n })->addColumn('created_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.created_at', compact('user'))->render();\n\n })->addColumn('updated_at', function ($user) {\n\n return view('._admin._particles.datatable.userlist.updated_at', compact('user'))->render();\n\n })->addColumn('action', function ($user) {\n\n return view('._admin._particles.datatable.userlist.action', compact('user'))->render();\n\n })->make(true);\n\n }", "public function getData()\n {\n return Datatables::of(App\\Models\\Volume::where('company_id', Auth::user()->company_id))->make(true);\n }", "public function ajax()\n {\n return $this->datatables->eloquent($this->query())// ->addColumn('action', 'path.to.action.view')\n ->editColumn('asset_id', function ($data) {\n\n return '<a href=' . route('samples.show', $data->asset_id) . '>' . $data->asset_id . '</a>';\n })\n ->editColumn('dealer.name', function ($data) {\n\n return '<a href=' . route('samples.out.dsr', $data->dealer_id) . '>' . $data->dealer->name . '</a>';\n })\n ->editColumn('user.name', function ($data) {\n\n return '<a href=' . route('samples.out.rep', $data->user_id) . '>' . $data->user->name . '</a>';\n })\n ->editColumn('created_at', function ($data) {\n\n return $data->created_at ? with(new Carbon($data->created_at))->format('m/d/Y') : '';\n })\n ->editColumn('expected_return_date', function ($data) {\n\n return $data->expected_return_date ? with(new Carbon($data->expected_return_date))->format('m/d/Y') : '';\n })->make(true);\n }", "public function getTabularItems()\n {\n return SATabularListM::model()->findAll(array('order'=>'tabularlist_block'),array('tabularlist_aktif'=>TRUE));\n // return Yii::app()->db->createCommand('SELECT tabularlist_id, tabularlist_block FROM tabularlist_m WHERE tabularlist_aktif=TRUE')->queryAll();\n }", "private function getBody(){\n\t\t$tbody=\"\";\n\t\t$tfilter=\"\";\n\t\t\n\t\tif($this->renderEmptyBody){\n\t\t\treturn \"<tbody></tbody>\";\n\t\t}\n\t\t\n\t\t//Si tiene un llamado a la base de datos, obtenemos los datos\n\t\tif($this->hasCallToDataBase){\n\t\t\t$this->getData();\n\t\t}\n\t\t\n\t\tif(!empty($this->data)){\n\t\t\tforeach($this->data as $dataRow){\n\t\t\t\t$tbody.=\"<tr>\";\n\t\t\t\t$counter=0;\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al principio*/\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach($dataRow as $key=>$data){\n\t\t\t\t\tif(!empty($this->bindedTypes)){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$type=$this->bindedTypes[$key];\n\t\t\t\t\t\t$parameter=$this->bindedTypesParams[$key];\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($type){\n\t\t\t\t\t\t\tcase 'progressbar':\n\t\t\t\t\t\t\t\t$bar=new progressbar(array(\"id\"=>$key));\n\t\t\t\t\t\t\t\t$pje=$data*100;\n\t\t\t\t\t\t\t\t$bar->setBars(array($pje));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$bar->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\t\t\t$link=new link();\n\t\t\t\t\t\t\t\t$link->replaceFields($dataRow, $parameter);\n\t\t\t\t\t\t\t\t$link->setDisplay($data);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$tbody.=\"<td>\".$link->render(true).\"</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$tbody.=\"<td>$data</td>\";\n\t\t\t\t\t}\n\t\t\t\t\t$counter++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*Buscamos si el grid tiene alguna columna adicional al final*/\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tbody.=\"</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($tfilter!=\"\"){\n\t\t\t\t$tbody=$tfilter.$tbody;\n\t\t\t}\n\t\t\t\n\t\t\t$tbody=\"<tbody>$tbody</tbody>\";\n\t\t}else{\n\t\t\t$tbody=\"<tbody><tr><td colspan=\\\"{$this->cols}\\\"><div class=\\\"alert alert-error\\\">\".velkan::$lang[\"grid_msg\"][\"noDataFound\"].\"</div></td></tr></tbody>\";\n\t\t}\n\t\t\n\t\treturn $tbody;\n\t}", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function liste(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"many\"));\n\t\t\t\t\t }", "public function load_data(Request $request)\n\t{\t\n\t\t$build_status_btn = '';\n\t\t$arr_data = [];\n\t\t$arr_search_column \t= $request->input('column_filter');\n\n\t\t$obj_request_data = $this->BaseModel->orderBy('created_at','DESC');\n\n\t\t// if(isset($arr_search_column['full_name']) && $arr_search_column['full_name']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('full_name', 'LIKE',\"%\".$arr_search_column['full_name'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['email']) && $arr_search_column['email']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('email', 'LIKE',\"%\".$arr_search_column['email'].\"%\");\n\t\t// }\n\n\t\t// if(isset($arr_search_column['status']) && $arr_search_column['status']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('status',$arr_search_column['status']);\n\t\t// }\n\n\t\t// if(isset($arr_search_column['role']) && $arr_search_column['role']!=\"\")\n\t\t// {\n\t\t// \t$obj_request_data = $obj_request_data->where('role',$arr_search_column['role']);\n\t\t// }\n\n\t\t$obj_request_data = $obj_request_data->get();\n\n\t\t$json_result \t= DataTables::of($obj_request_data)->make(true);\n\t\t$build_result \t= $json_result->getData();\n\n\t\tif(isset($build_result->data) && sizeof($build_result->data)>0)\n\t\t{\n\t\t\tforeach ($build_result->data as $key => $data) \n\t\t\t{\n\t\t\t\t$edit_link_url = $this->module_url_path.'/edit_email_template/'.base64_encode($data->id);\n\t\t\t\t$delete_link_url = $this->module_url_path.'/delete_email_template/'.base64_encode($data->id);\n\t\t\t\t// $view_link_url = \"javascript:void(0)\";\n\t\t\t\t\n\t\t\t\t$arr_roles = $arr_product_options = [];\n\n\t\t\t\t$id \t\t\t\t\t= isset($data->id)? $data->id :'';\n\t\t\t\t$template_name \t\t\t= isset($data->template_name)? $data->template_name :'';\n\t\t\t\t$template_subject \t\t= isset($data->template_subject)? $data->template_subject :'';\n\t\t\t\t$created_at \t\t\t= isset($data->created_at)? get_formated_date($data->created_at) :'';\n\t\t\t\n\t\t\t\t$action_button_html = '<a title=\"\" href=\"'.$edit_link_url.'\" data-original-title=\"Edit\" ><i class=\"fa fa-cog\" title=\"Edit\"></i></a> <a title=\"\" href=\"'.$delete_link_url.'\" data-original-title=\"Delete\" data-id=\"'.$data->id.'\" onclick=\"return confirm_action(this,event,\\'Do you really want to delete this Template ?\\')\" ><i class=\"fa fa-trash\" title=\"Delete\"></i></a>';\n\n\t\t\t\n\t\t\t\t$i = $key+1;\n\t\t\t\t$build_result->data[$key]->id \t\t = $id;\n\t\t\t\t$build_result->data[$key]->sr_no \t\t= $i;\n\t\t\t\t$build_result->data[$key]->template_name \t= $template_name;\n\t\t\t\t$build_result->data[$key]->template_subject \t= $template_subject;\n\t\t\t\t$build_result->data[$key]->created_at \t= $created_at;\n\t\t\t\t$build_result->data[$key]->built_action_btns = $action_button_html;\n\t\t\t\t\n\t\t\t}\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn response()->json($build_result);\n\t\t}\n\t}", "protected function grid()\n {\n $grid = new Grid(new $this->currentModel);\n\n $grid->filter(function($filter){\n\n // 去掉默认的id过滤器\n //$filter->disableIdFilter();\n\n // 在这里添加字段过滤器\n $filter->like('title_designer_cn', '标题(设计师)');\n $filter->like('title_name_cn', '标题(项目名称)');\n $filter->like('title_intro_cn', '标题(项目介绍)');\n\n });\n\n $grid->id('ID')->sortable();\n $grid->title_designer_cn('标题(中)')->display(function () {\n return CurrentModel::formatTitle($this, 'cn');\n });\n $grid->title_designer_en('标题(英)')->display(function () {\n return CurrentModel::formatTitle($this, 'en');\n });\n $grid->article_status('状态')->display(function ($article_status) {\n switch ($article_status) {\n case '0' :\n $article_status = '草稿';\n break;\n case '1' :\n $article_status = '审核中';\n break;\n case '2' :\n $article_status = '已发布';\n break;\n }\n return $article_status;\n });\n $grid->release_time('发布时间')->sortable();\n \n // $grid->column('created_at', __('发布时间'));\n $grid->created_at('添加时间')->sortable();\n // $grid->column('updated_at', __('添加时间'));\n\n return $grid;\n }", "public function getDataList()\n {\n //get all Tranfer Recipient\n\n $thePaystack = new Paystack();\n $theTransferRecipient = $thePaystack->listTransferRecipient(null, null);\n\n return Datatables::of($theTransferRecipient['data'])\n ->addColumn('action', function ($transferRecipient) {\n return '<button type=\"button\" class=\"btn btn-success btn-sm transfer_btn\"> <i class=\"fa fa-pencil\"></i>Transfer</button>'. ' <button type=\"button\" class=\"btn btn-info btn-sm\" onclick=\"alert('. $transferRecipient['id'] .');\"> <i class=\"fa fa-binoculars\"></i>Edit</button>';\n })\n ->make(true);\n }" ]
[ "0.7330705", "0.6983899", "0.6796706", "0.67576116", "0.67345977", "0.66976845", "0.66896564", "0.66741365", "0.6661632", "0.6618892", "0.65982866", "0.656992", "0.65472263", "0.6541248", "0.6530908", "0.65291995", "0.64944625", "0.6490355", "0.64822584", "0.64793426", "0.6477773", "0.64713335", "0.6462382", "0.6458392", "0.64539653", "0.64435375", "0.6431385", "0.6423995", "0.6419056", "0.6410049", "0.638416", "0.6365213", "0.63553303", "0.6349931", "0.6349069", "0.6337827", "0.63303214", "0.63219976", "0.6321439", "0.63179064", "0.63113", "0.63108206", "0.6303556", "0.62821895", "0.6281328", "0.6275325", "0.6263165", "0.6259405", "0.62567526", "0.62377346", "0.62296814", "0.6228911", "0.622655", "0.6225143", "0.62236124", "0.6219004", "0.6218361", "0.62143356", "0.62141067", "0.62110543", "0.62110543", "0.62085223", "0.6202326", "0.6195718", "0.6189676", "0.618605", "0.618605", "0.618605", "0.61850166", "0.6182639", "0.6180871", "0.61796075", "0.6179206", "0.6177873", "0.61758393", "0.6172009", "0.617004", "0.61626035", "0.61615527", "0.61615527", "0.6159182", "0.61587787", "0.614787", "0.6133643", "0.6127763", "0.61257416", "0.6124517", "0.6123965", "0.61231875", "0.61181", "0.61176556", "0.6116757", "0.61164415", "0.6113966", "0.6108209", "0.6108209", "0.6108209", "0.6107506", "0.6106533", "0.6106297" ]
0.6250035
49
For Creating the respective model in storage
public function create(array $input) { $questionbank = self::MODEL; $questionbank = new $questionbank(); $questionbank['type_id'] = $input['type_id']; $questionbank['question'] = $input['question']; $questionbank['status'] = isset($input['status']) ? 1 : 0; if(isset($input['choose_behaviour'])) { $questionbank['behaviour_id'] = $input['choose_behaviour']; } else { $questionbank['behaviour_id'] = NULL; } if ($questionbank->save()) { foreach($input['score'] as $key => $score) { // $score_array[] = $score; $score_array[] = [ 'question_id' => $questionbank->id, 'option' => $input['option'][$key], 'marks' => $score ]; } $addQuestionOption = DB::table('question_option')->insert($score_array); return true; } throw new GeneralException(trans('exceptions.backend.questionbanks.create_error')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createModel()\n {\n }", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "public function create()\n {\n //\n// $this->store();\n\n }", "public function createStorage();", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function creating($model)\n\t{\n\t}", "public function store()\n {\n $this->initStaticModel();\n $this->setFormFields($this->getCreateFormFields());\n\n $data = $this->validateFormData();\n $data = $this->storeFiles($data);\n $data = $this->filterCreateData($data);\n\n $res = $this->createModel($data);\n\n return $this->sendCreateResponse($res);\n }", "public function create(): Model;", "function create($model)\n {\n }", "public function __construct($modelType, Storage $storage);", "protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create(){\n\t\t//\n\t}", "public function create() {\n //\n }", "protected function createBaseModel()\n {\n $name = $this->qualifyClass('Model');\n $path = $this->getPath($name);\n\n if (!$this->files->exists($path)) {\n $this->files->put(\n $path,\n $this->files->get(__DIR__.'/../../stubs/model.base.stub')\n );\n }\n }", "public function create()\n {\n \n \n }", "public function create() {\r\n //\r\n }", "public function create()\n {\n \n //\n }", "public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "abstract public function instanceFactory($model): EloquentStorage;", "public function create(){\n\n //\n }", "public function create()\n {\n //\n\t\t\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create(){\n \n }" ]
[ "0.729715", "0.7173731", "0.68675995", "0.6837995", "0.6753725", "0.67064375", "0.6703101", "0.6688337", "0.6659139", "0.66585976", "0.65401626", "0.6515649", "0.6515649", "0.6515649", "0.6515649", "0.6503444", "0.64827347", "0.6460578", "0.64599204", "0.6454711", "0.6446072", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.6445362", "0.64428896", "0.64428896", "0.64428896", "0.64428896", "0.6441123", "0.643938", "0.64374554", "0.64306927", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.6428076", "0.64251" ]
0.0
-1
For updating the respective Model in storage
public function update(Questionbank $questionbank, array $input) { //dd($input); $questionbank['type_id'] = $input['type_id']; $questionbank['question'] = $input['question']; $questionbank['status'] = isset($input['status']) ? 1 : 0; if(isset($input['choose_behaviour'])) { $questionbank['behaviour_id'] = $input['choose_behaviour']; } else if(empty($input['choose_behaviour'])) { $questionbank['behaviour_id'] = NULL; } if ($questionbank->update()) { if(isset($input['score_new'])) { foreach($input['score_new'] as $key => $score) { $score_array[] = [ 'question_id' => $questionbank->id, 'option' => $input['option_new'][$key], 'marks' => $score ]; } } //dd($score_array); $option_score_array = DB::table('question_option')->where('question_id',$questionbank['id'])->get()->ToArray(); if(isset($input['option_score_id'])) { foreach ($input['option_score_id'] as $key => $option_score_id) { $updateQuestionOption = DB::table('question_option')->where('id',$option_score_id)->update(array('option' => $input['option'][$key],'marks'=> $input['score'][$key])); } foreach ($option_score_array as $key => $value) { //dd($option_score_id); if(!in_array($value->id,$input['option_score_id'])) { $updateQuestionOption = QuestionOption::where('id',$value->id)->delete(); } } } /*$option_score_array = DB::table('question_option')->where('question_id',$questionbank['id'])->get()->ToArray(); foreach ($option_score_array as $key => $value) { foreach ($input['option_score_id'] as $key => $option_score_id) { if($option_score_id!= $value->id) { $updateQuestionOption = DB::table('question_option')->where('id',$option_score_id)->delete(); } } }*/ if(isset($score_array)) { $addQuestionOption = DB::table('question_option')->insert($score_array); } if(empty($input['option_score_id'])) { foreach ($option_score_array as $key => $value) { //dd($option_score_id); if(!in_array($value->id,$score_array)) { $updateQuestionOption = QuestionOption::where('id',$value->id)->delete(); } } } return true; } throw new GeneralException(trans('exceptions.backend.questionbanks.update_error')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function updateModel();", "function update(){\n\t\t$this->model->update();\n\t}", "public function testUpdate()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $newModel = $this->makeFactory();\n\n $this->json('PUT', static::ROUTE . '/' . $model->id, $newModel->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($newModel->toArray());\n }", "public function testUpdateStore()\n {\n\n }", "public function update()\n\t{\n\t\t$this->getModel()->update($this);\n\t}", "public function testUpdateModelSet()\n {\n }", "protected function update() {}", "protected function saveUpdate()\n {\n }", "public function updated($model)\n {\n }", "public function updating($model)\n\t{\n\t}", "public function update($model) :bool;", "protected function update() {\n if ($this->_isLoaded()) {\n $this->db->where('id', $this->id);\n $this->db->update($this->tableName, $this->mapToDatabase());\n } else {\n throw new Exception(\"Model is not loaded\");\n }\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update(){\n\n\t\t/* set method */\n\t\t$this->request_method = 'update';\n\t\t\t\t\n\t\t/* check for a model id */\n\t\tif( ! $this->id) {\n\t\t\t$this->set_error( 10, 'No model id in request, cant update' );\n\t\t\treturn;\t\t\t\n\t\t}\n\t\t\n\t\t/* read the data received from backbone */\n\t\t$this->parse_model_request();\n\n\t\tif($this->get_errors())\n\t\t\treturn;\n\t\t\t\t\t\n\t\t/* get the parsed post data from request */\n\t\t$item_data = $this->parsed_model_request;\n\t\t \t\t\t \t\n\t\t/* insert database */\n\t\tswitch( $this->properties->modelclass ) {\n\t\t\n\t\t\t/* posts */\n\t\t\tcase('post'):\n\t\t\tcase('attachment'):\n\t\t\t\t$post = $item_data['post'];\n\t\t\t\t\n\t\t\t\t/* privileg check */ //improve this for coded api calls, like when setting up bootstrap data (for reading it is no problem any way, because this check is only made for update and create and delete)\n\t\t\t\tif( $this->properties->access == \"loggedin\" && ! current_user_can('edit_post', $this->id)) { \n\t\t\t\t\t$this->set_error( 11, 'no user privileges to update the item on server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$result = wp_update_post( $post );\n\t\t\t\t\n\t\t\t\t/* maybe an error while updating */\n\t\t\t\tif( ! $result) {\n\t\t\t\t\t$this->set_error( 12, 'updating the item failed on the server' );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* geting the id means update was a success */\n\t\t\t\t$updated_id = $result;\n\t\t\t\t\n\t\t\t\t/* save custom data, this only method does all the magic, \n\t\t\t\tdetails must be specified in the custom package handlers */\n\t\t\t\t$this->_action_custom_package_data( $updated_id, $item_data);\t\n\t\t\t\t\n\t\t\t\t/* set a clean response */\n\t\t\t\t$this->parse_model_response($updated_id);\t\n\t\t\tbreak;\n\t\t\t\n\t\t\t/* comment */\n\t\t\tcase('comment'):\n\t\t\t\t$comment = $item_data['comment'];\n\t\t\t\t\n\t\t\t\t/* comment updateding is not supported */\n\t\t\t\t$this->set_error( 13, 'comments cant be updated!' );\n\t\t\t\t\treturn; \n\t\t\tbreak;\n\t\t\tcase('user'):\n\t\t\t//@TODO\n\t\t\tbreak;\n\t\t\tcase('idone'):\n\t\t\t\t$new_id = $this->id;\n\t\t\t\t$this->_action_custom_package_data( $new_id, $item_data);\t\t\t\t\t\n\t\t\t\t$this->parse_model_response($new_id);\t\t\n\t\t\tbreak;\n\t\t}\n do_action('bb-wp-api_after_update', $updated_id, $this->properties, $this );\n\t\n\t}", "public function db_update() {}", "function update($unique_id, $model)\n {\n }", "public function actionUpdate() {\n $json = file_get_contents('php://input'); //$GLOBALS['HTTP_RAW_POST_DATA'] is not preferred: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data\n $put_vars = CJSON::decode($json, true); //true means use associative array\n switch ($_GET['model']) {\n // Find respective model\n case 'Order':\n $model = Order::model()->findByPk($_GET['id']);\n break;\n case 'Users':\n $model = Users::model()->findByPk($_GET['id']);\n break;\n case 'Product':\n $model = Product::model()->findByPk($_GET['id']);\n break;\n case 'Vendor':\n $model = Vendor::model()->findByPk($_GET['id']);\n break;\n case 'FavoriteProduct':\n $model = FavoriteProduct::model()->findByPk($_GET['id']);\n break;\n case 'Rating':\n $model = Rating::model()->findByPk($_GET['id']);\n break;\n case 'Review':\n $model = Review::model()->findByPk($_GET['id']);\n break;\n case 'UserAddress':\n $model = UserAddress::model()->findByPk($_GET['id']);\n break;\n case 'OrderDetail':\n $model = OrderDetail::model()->findByPk($_GET['id']);\n break;\n default:\n $this->_sendResponse(0, sprintf('Error: Mode update is not implemented for model ', $_GET['model']));\n Yii::app()->end();\n }\n // Did we find the requested model? If not, raise an error\n if ($model === null)\n $this->_sendResponse(0, sprintf(\"Error: Didn't find any model with ID .\", $_GET['model'], $_GET['id']));\n\n // Try to assign PUT parameters to attributes\n unset($_POST['id']);\n foreach ($_POST as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var))\n $model->$var = $value;\n else {\n $this->_sendResponse(0, sprintf('Parameter %s is not allowed for model ', $var, $_GET['model']));\n }\n }\n // Try to save the model\n if ($model->update())\n $this->_sendResponse(1, '', $model);\n else\n $this->_sendResponse(0, $msg);\n // prepare the error $msg\n // see actionCreate\n // ...\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function save()\n {\n $entities = $this->entities;\n Database::getInstance()->doTransaction(\n function() use ($entities)\n {\n foreach ($entities as $entity)\n {\n if ($entity->getMarkedAsDeleted())\n {\n $entity->delete();\n } \n else if ($entity->getMarkedAsUpdated())\n {\n $entity->saveWithDetails();\n }\n }\n }\n );\n }", "public function save()\n {\n $this->checkForNecessaryProperties();\n\n $this->update($this->getCurrentId(), $this->data);\n }", "public function update() {\r\n\r\n\t}", "public function Update($data) {\n\n }", "public function update()\n {\n return $this->save();\n }", "public function update($data) {}", "public function update($data) {}", "public function update(Request $request, object $model): bool;", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "public function update(){\n\n }", "public function update(){\n\n }", "public function update() {\r\n\t\t$this->getMapper()->update($this);\r\n\t}", "public function update( One_Model $model )\n\t{\n\t\treturn null;\n\t}", "public function save() {}", "public function save() {}", "public function save() {}", "public function update($id, Model $model);", "public function update(Request $request)\n {\n \n\n $logoPath = $request->file('logo')->store('logos');\n $bannerPath = $request->file('banner')->store('banners');\n\n\n $store = Store::findOrFail($request->store_id);\n\n $store_name = $store->name;\n $slug = str_replace(' ', '-', strtolower($store_name));\n $store->slug = $slug;\n $store->phone_number = $request->phone_number;\n $store->owner_name = $request->owner_name;\n $store->description = $request->description;\n $store->address = $request->address;\n $store->logo = $logoPath;\n $store->banner = $bannerPath;\n\n\n $store->save();\n\n return $store;\n\n\n\n // $path = $request->file('main_image')->store($store_name);\n\n\n }", "function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }", "public function update()\r\n {\r\n \r\n }", "public function update(Request $request, $id,$class)\n {\n $record = $class::findOrFail($id);\n $this->validate($request,$class::getvalidation());\n foreach ($record->getFillable() as $fillable)\n {\n $field = $class::findField($fillable);\n switch ($field['type']){\n case 'file':\n// dd('hello');\n if (isset($field['addable']) && $field['addable']){\n $file_addresses=[];\n if (isset($request->{$fillable}) && is_array($request->{$fillable}))\n foreach ($request->file($fillable) as $key => $file)\n {\n $name = time() . '.'.$file->getClientOriginalName();\n $file->move(public_path('files'), $name);\n $file_addresses[]='files/'.$name;\n }\n if (isset($request->{$fillable.'_old'}))\n $file_addresses = array_merge($file_addresses,$request->{$fillable.'_old'});\n $record->{$fillable} = $file_addresses;\n }\n else{\n if($request->hasFile($fillable)){\n $name = time() . '.'.$request->{$fillable}->getClientOriginalName();\n $request->file($fillable)->move(public_path('files'), $name);\n $record->{$fillable} ='files/'.$name;\n }\n elseif (isset($request->{$fillable.'_old'}))\n $record->{$fillable} =$request->{$fillable.'_old'};\n\n\n }\n break;\n\n default :\n if (isset($request->{$fillable}))\n $record->{$fillable} = $request->{$fillable};\n\n }\n\n\n }\n $record->save();\n $this->handlePivots($record,$request,$class);\n\n\n return redirect($class::route('index'))->with('message','با موفقیت ویرایش شد');\n }", "public function update()\r\n {\r\n //\r\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update()\n {\n }", "public function processUpdate()\n {\n // Validate Request\n $validationRules = $this->getValidationRules();\n // Hook Filter updateModifyValidationRules\n $validationRules = $this->doFilter(\"updateModifyValidationRules\", $validationRules);\n $validationMessages = array();\n // Hook Filter updateModifyValidationMessages\n $validationMessages = $this->doFilter(\"updateModifyValidationMessages\", $validationMessages);\n $validator = Validator::make($this->Request->all(), $validationRules, $validationMessages);\n if ($validator->fails()) {\n $Response = back()->withErrors($validator)->withInput();\n $this->redirect($Response);\n }\n // Record is valid\n $Model = $this->isValidRecord();\n if ($Model instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($Model);\n }\n // Set value for BIT columns\n $this->setValueBitColumns();\n // Set initial configuration\n $Model->build($this->Model->getTable());\n $requestParameters = $this->Request->all();\n $requestParameters = $this->setValueBlobColumns($requestParameters);\n // Hook Filter updateModifyRequest\n $this->Model = clone $Model;\n $parameters = $this->doFilter(\"updateModifyRequest\", $requestParameters);\n // Update record\n if ($this->getIsTransaction()) {\n DB::transaction(function ($db) use ($Model, $parameters) {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n });\n } else {\n $Model->update($parameters);\n // Hook Action updateAfterUpdate\n $this->doHooks(\"updateAfterUpdate\", array($Model));\n }\n // Set response redirect to list page and set session flash\n $Response = redirect($this->getFormAction())\n ->with('dk_' . $this->getIdentifier() . '_info_success', trans('dkscaffolding.notification.update.success'));\n // Hook Filter updateModifyResponse\n $Response = $this->doFilter(\"updateModifyResponse\", $Response);\n $this->redirect($Response);\n }", "public function update()\n {\n\n }", "public function update()\n {\n\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelInrelative = $model->inRelative;\n $modelOutrelative = $model->outRelative;\n\n if ($model->load(Yii::$app->request->post()) ) {\n\n\n $oldIDs = ArrayHelper::map($modelInrelative, 'id', 'id');\n $oldIDsout = ArrayHelper::map($modelOutrelative, 'id', 'id');\n $modelInrelative = Model::createMultiple(InRelative::classname(), $modelInrelative);\n $modelOutrelative = Model::createMultiple(OutRelative::classname(), $modelOutrelative);\n Model::loadMultiple($modelInrelative, Yii::$app->request->post());\n Model::loadMultiple($modelOutrelative, Yii::$app->request->post());\n $deletedIDs = array_diff($oldIDs, array_filter(ArrayHelper::map($modelInrelative, 'id', 'id')));\n $deletedIDsout = array_diff($oldIDsout, array_filter(ArrayHelper::map($modelOutrelative, 'id', 'id')));\n\n // validate all models\n $valid = $model->validate();\n $valid = Model::validateMultiple($modelInrelative) && $valid;\n\n $img = UploadedFile::getInstance($model,'photo');\n \n $imgData =file_get_contents($img->tempName);\n $model->photo = $imgData;\n \n \n\n\n if ($model->save()) {\n $valid = true;\n foreach ($modelInrelative as $key => $modelI) {\n $modelI->kus_id = $model->id;\n $valid = $valid && $modelI->validate();\n\n }\n\n foreach ($modelOutrelative as $key => $modelO) {\n $modelO->kus_id = $model->id;\n $valid = $valid && $modelO->validate();\n }\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n $flag = false;\n foreach ($modelInrelative as $modelI) {\n if (!($flag = $modelI->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n\n foreach ($modelOutrelative as $modelO) {\n if (!($flag = $modelO->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n \n if ($flag) {\n $transaction->commit();\n return $this->redirect(['print', 'id' => $model->id]);\n //return $this->redirect(['export-pdf', 'id' => $model->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n\n }\n\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n\n try {\n if ($flag = $modelCustomer->save(false)) {\n foreach ($modelInrelative as $modelin) {\n $modelAddress->customer_id = $modelCustomer->id;\n if (! ($flag = $modelin->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n\n foreach ($modelOutrelative as $modelout) {\n $modelAddress->customer_id = $modelCustomer->id;\n if (! ($flag = $modelout->save(false))) {\n $transaction->rollBack();\n break;\n }\n }\n }\n\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['view', 'id' => $modelCustomer->id]);\n }\n } catch (Exception $e) {\n $transaction->rollBack();\n }\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelInrelative' => (empty($modelInrelative)) ? [new InRelative] : $modelInrelative,\n 'modelOutrelative' => (empty($modelOutrelative)) ? [new OutRelative] : $modelOutrelative\n ]);\n }\n }", "protected function _update()\n\t{\n\t}", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $process = $request->input('process');\n $field = $request->input('field');\n $renter = Renter::findOrFail($id);\n\n //-----DELETE\n if($process == 'delete'){\n switch ($field) {\n case 'qid':\n Storage::delete($renter->qidFile);\n $renter->qid = null;\n break;\n case 'cr':\n Storage::delete($renter->crFile);\n $renter->cr = null;\n break;\n case 'permit':\n Storage::delete($renter->permitFile);\n $renter->permit = null;\n break;\n case 'contract':\n Storage::delete($renter->contractFile);\n $renter->contract = null;\n break;\n case 'p_contract':\n Storage::delete($renter->pcontractFile);\n $renter->p_contract = null;\n break;\n case 'email':\n $renter->email = null;\n break;\n case 'mobile':\n $renter->mobile = null;\n break;\n case 'address':\n $renter->address = null;\n break;\n case 'company':\n $renter->company = null;\n break;\n case 'co_address':\n $renter->co_address = null;\n break;\n case 'co_person':\n $renter->co_person = null;\n break;\n case 'co_contact':\n $renter->co_contact = null;\n break;\n case 'co_mobile':\n $renter->co_mobile = null;\n break;\n case 'property':\n $renter->prop_id = null;\n break;\n }\n\n flash('Successfully deleted')->success();\n }\n\n //-----ADD and UPDATE\n if($process == 'add' || $process == 'update'){\n switch ($field) {\n case 'name':\n $this->validate($request,[\n 'name' => 'required'\n ]);\n $renter->name = $request->input('name');\n break;\n case 'email':\n $this->validate($request,[\n 'email' => 'required|email'\n ]);\n $renter->email = $request->input('email');\n break;\n case 'mobile':\n $this->validate($request,[\n 'mobile' => 'required|numeric'\n ]);\n $renter->mobile = $request->input('mobile');\n break;\n case 'address':\n $this->validate($request,[\n 'address' => 'required'\n ]);\n $renter->address = $request->input('address');\n break;\n case 'company':\n $this->validate($request,[\n 'company' => 'required'\n ]);\n $renter->company = $request->input('company');\n break;\n case 'co_address':\n $this->validate($request,[\n 'co_address' => 'required'\n ]);\n $renter->co_address = $request->input('co_address');\n break;\n case 'co_contact':\n $this->validate($request,[\n 'co_contact' => 'required|numeric'\n ]);\n $renter->co_contact = $request->input('co_contact');\n break;\n case 'co_mobile':\n $this->validate($request,[\n 'co_mobile' => 'required|numeric'\n ]);\n $renter->co_mobile = $request->input('co_mobile');\n break;\n case 'co_person':\n $this->validate($request,[\n 'co_person' => 'required'\n ]);\n $renter->co_person = $request->input('co_person');\n break;\n case 'qid':\n $this->validate($request,[\n 'qid' => 'max:2048|required|mimes:pdf,jpg,jpeg',\n ],[\n 'qid.mimes' => 'Only pdf & jpg are allowed'\n ]);\n\n $qid = $request->file('qid');\n $qid->storeAs('public/qid/renter/',$renter->id.'.'.$qid->getClientOriginalExtension());\n\n $renter->qid = url('storage/qid/renter/').'/'.$renter->id.'.'.$qid->getClientOriginalExtension();\n break;\n case 'contract':\n $this->validate($request,[\n 'contract' => 'max:2048|required|mimes:pdf,jpg,jpeg',\n ],[\n 'contract.mimes' => 'Only pdf & jpg are allowed'\n ]);\n\n $contract = $request->file('contract');\n $contract->storeAs('public/contract/renter/',$renter->id.'.'.$contract->getClientOriginalExtension());\n\n $renter->contract = url('storage/contract/renter/').'/'.$renter->id.'.'.$contract->getClientOriginalExtension();\n break;\n case 'p_contract':\n $this->validate($request,[\n 'p_contract' => 'max:2048|required|mimes:pdf,jpg,jpeg',\n ],[\n 'p_contract.mimes' => 'Only pdf & jpg are allowed'\n ]);\n\n $p_contract = $request->file('p_contract');\n $p_contract->storeAs('public/p_contract/renter/',$renter->id.'.'.$p_contract->getClientOriginalExtension());\n\n $renter->p_contract = url('storage/p_contract/renter/').'/'.$renter->id.'.'.$p_contract->getClientOriginalExtension();\n break;\n case 'cr':\n $this->validate($request,[\n 'cr' => 'max:2048|required|mimes:pdf,jpg,jpeg',\n ],[\n 'cr.mimes' => 'Only pdf & jpg are allowed'\n ]);\n\n $cr = $request->file('cr');\n $cr->storeAs('public/cr/renter/',$renter->id.'.'.$cr->getClientOriginalExtension());\n\n $renter->cr = url('storage/cr/renter/').'/'.$renter->id.'.'.$cr->getClientOriginalExtension();\n break;\n case 'permit':\n $this->validate($request,[\n 'permit' => 'max:2048|required|mimes:pdf,jpg,jpeg',\n ],[\n 'permit.mimes' => 'Only pdf & jpg are allowed'\n ]);\n\n $permit = $request->file('permit');\n $permit->storeAs('public/permit/renter/',$renter->id.'.'.$permit->getClientOriginalExtension());\n\n $renter->permit = url('storage/permit/renter/').'/'.$renter->id.'.'.$permit->getClientOriginalExtension();\n break;\n case 'property':\n $renter->prop_id = $request->input('property');\n break;\n }\n\n flash('Process Successfull')->success();\n }\n\n $renter->save();\n\n $this->addLog(\\Auth::user()->name.' updated details of '.$renter->name);\n return redirect()->back();\n }", "public function update()\n {\n # code...\n }", "public function update_data(Request $request){\n try {\n \n $update_type = $request->upload_type;\n $update_file = $request->upload_file;\n\n if(empty($update_type)){\n throw new Exception(\"Invalid request\", 400);\n }\n if(empty($update_file)){\n throw new Exception(\"File is required\", 400);\n }\n\n $filename = '';\n switch($update_type){\n case \"USER\":\n if(!check_access(['A_UPDATE_USER'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"STORE\":\n if(!check_access(['A_UPDATE_STORE'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"SUPPLIER\":\n if(!check_access(['A_UPDATE_SUPPLIER'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"CATEGORY\":\n if(!check_access(['A_UPDATE_CATEGORY'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"PRODUCT\":\n if(!check_access(['A_UPDATE_PRODUCT'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"INGREDIENT\":\n if(!check_access(['A_UPDATE_INGREDIENT'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n case \"ADDON_PRODUCT\":\n if(!check_access(['A_UPDATE_ADDON_PRODUCT'], true)){\n throw new Exception(\"Invalid request\", 400);\n }\n break;\n }\n\n $custom_filename = strtolower($update_type).'_'.date('Y_m_d_H_i_s').'_'.uniqid();\n\n $extension = $update_file->getClientOriginalExtension();\n $custom_file = $custom_filename.\".\".$extension;\n\n Storage::disk('updates')->delete(\n [\n $custom_file\n ]\n );\n\n $path = Storage::disk('updates')->putFileAs('/', $update_file, $custom_file);\n\n $update_response = $this->forward_update_request($update_type, $custom_file);\n\n if($update_response['update_status'] == false){\n Storage::disk('updates')->delete(\n [\n $custom_file\n ]\n );\n }\n \n return response()->json($this->generate_response(\n array(\n \"message\" => \"update file read successfully\",\n \"data\" => $update_response,\n ), 'SUCCESS'\n ));\n\n }catch(Exception $e){\n return response()->json($this->generate_response(\n array(\n \"message\" => $e->getMessage(),\n \"status_code\" => $e->getCode()\n )\n ));\n }\n }", "public function update() {\r\n }", "public function update(){\n if ($this->postId != null){\n $this->validate();\n\n /**\n * if change image\n * try to upload image and resize by ImageSaverController config\n * delete old images from upload directory\n */\n if (isset($this->image) && $this->image != null){\n $this->validate(['image' => 'required|image']);\n try {\n $imageSaver = new ImageSaverController();\n $newImagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n ImageSaverController::DeleteAllPhotos($this->imagePath);\n $this->imagePath = $newImagePath;\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n }\n\n $this->PostSaver();\n $this->resetAll();\n $this->ChangeUpdateMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully updated',\n 'icon' => 'success'\n ]);\n $this->render();\n\n }\n }", "public function update($entity)\n {\n \n }", "public function updating()\n {\n # code...\n }", "public function save(){\n }", "function update($model, $data){\n /* set data into iterator */\n $iterator = $model->_get(\"iterator\");\n if (!$model->loaded()){\n throw $this->exception(\"Please, load model prior to updating it\");\n }\n if (!$iterator){\n throw $this->exception(\"Iterator not set for model - how to update? Is it loaded?\");\n }\n foreach ($data as $k => $v){\n if ($xpath=$model->elements[$k]->setterGetter(\"xpath\")){\n $a = $iterator->xpath($xpath);\n if ($a){\n $i = array_shift($a);\n $i[0] = $v;\n } else {\n /* create xpath */\n $xpath = explode(\"/\", $xpath);\n $i2 = $iterator;\n while ($r = array_shift($xpath)){\n if (count($xpath)){\n if (!isset($i2->{$r})){\n $i2->addChild($r);\n }\n $i2 = $i2->{$r};\n } else {\n $i2->{$r}[0] = $v;\n }\n }\n }\n } else {\n $iterator->{$k} = $v;\n }\n }\n /* remove snippets from iterator */\n $remove = array();\n foreach ($model->elements as $k => $v){\n if ($v instanceof \\Field){\n if ($r=$v->setterGetter(\"retrieve\")){\n if ($r != \"yes\"){\n throw $this->exception(\"Cannot update model, as it contains non-fully loaded fields\");\n }\n }\n }\n }\n if ($model->sub){\n $model->_get(\"parent\")->save();\n } else {\n /* store to cluster point */\n /*$a=$this->xml2array($iterator);\n echo \"<pre>\";\n print_r($a);\n exit;*/\n //$this->simple->partialReplaceSingle($model[$model->id_field], $a);\n $this->simple->updateSingle($model[$model->id_field], $iterator);\n }\n }", "public function update()\n\t{\n\n\t}", "public function update(Model $model, array $attributes);", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function updatedModel(Model &$model)\n {\n }", "public function actionUpdate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n /*\r\n * Receive all the PUT parameters\r\n */\r\n parse_str(file_get_contents('php://input'), $put_params);\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>update</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model))\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n \r\n /*\r\n * assign PUT parameters to attributes\r\n */ \r\n foreach($put_params as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n *save the model\r\n */\r\n if($model->save()) {\r\n $this->_sendResponse(200, sprintf('The model <b>%s</b> with id <b>%s</b> has been updated.', $_GET['model'], $_GET['id']) );\r\n } else {\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't update model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function updateDB()\n {\n\n }", "public function updateRecord() {\n $model = self::model()->findByAttributes(array('id_customer' => $this->id_customer, 'id_supplier' => $this->id_supplier));\n\n //model is new, so create a copy with the keys set\n if (null === $model) {\n //we don't use clone $this as it can leave off behaviors and events\n $model = new self;\n $model->id_customer = $this->id_customer;\n $model->id_supplier = $this->id_supplier;\n }\n $model->save(false);\n return $model;\n }", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function save()\n {\n //set some parameters\n $indexField = [ $this->indexField => $this->data[$this->indexField] ?? '' ];\n $columns = [];\n\n foreach ($this->editSettings as $k => $v) {\n $columns[$k] = $this->data[$k];\n }\n\n $class = $this->classPathBase::updateOrCreate($indexField, $columns);\n }", "public function update(Request $request)\n {\n if(!Session::get('userId')){\n return redirect()->route('home');\n }\n $dataArr = $request->all();\n \n $this->validate($request,[ \n 'loai_id' => 'required',\n 'cate_id' => 'required', \n 'name' => 'required',\n 'slug' => 'required' \n ],\n [ \n 'loai_id.required' => 'Please select type', \n 'cate_id.required' => 'Please select category', \n 'name.required' => 'Please input name',\n 'slug.required' => 'Please input slug' \n ]);\n \n $dataArr['slug'] = str_replace(\".\", \"-\", $dataArr['slug']);\n $dataArr['slug'] = str_replace(\"(\", \"-\", $dataArr['slug']);\n $dataArr['slug'] = str_replace(\")\", \"\", $dataArr['slug']);\n $dataArr['alias'] = Helper::stripUnicode($dataArr['name']);\n $dataArr['is_hot'] = isset($dataArr['is_hot']) ? 1 : 0; \n $dataArr['status'] = 1;\n \n $dataArr['updated_user'] = Auth::user()->id; \n \n \n $model = Product::find($dataArr['id']);\n\n $model->update($dataArr);\n \n $product_id = $dataArr['id'];\n \n $this->storeMeta( $product_id, $dataArr['meta_id'], $dataArr);\n $this->storeImage( $product_id, $dataArr);\n $this->processRelation($dataArr, $product_id, 'edit');\n\n Session::flash('message', 'Update success.');\n\n return redirect()->route('product.edit', $product_id);\n \n }", "public function setUpdate($model) {\n $id = $model->get('id');\n $newmovementtype = $model->get('movementtype');\n $newreleasestype = $model->get('releasestype');\n\n $data = array(\"query\"=>$id);\n\n $masterCoach = new \\iSterilization\\Coach\\armorymovement();\n $detailCoach = new \\iSterilization\\Coach\\armorymovementitem();\n $master = self::jsonToObject($masterCoach->getStore()->select());\n $detail = self::jsonToObject($detailCoach->getStore()->getCache()->selectItem($data));\n\n if(count($detail->rows) == 0 && $newreleasestype != \"C\") {\n throw new \\PDOException(\"O Movimento não pode ser encerrado pois <b>não existem lançamentos!</b>\");\n }\n\n $oldreleasestype = $master->rows[0]->releasestype;\n\n if($oldreleasestype !== $newreleasestype && $newreleasestype == \"E\") {\n\n $closeddate = date(\"Ymd H:i:s\");\n $model->set('closeddate',$closeddate);\n\n $proxy = $masterCoach->getStore()->getProxy();\n $stock = new \\iSterilization\\Coach\\armorystock();\n $output = new \\iSterilization\\Coach\\armorymovementoutput();\n\n try {\n $proxy->beginTransaction();\n\n if($newmovementtype == '002') {\n\n $boxsealone = $model->getSubmit()->getRowValue('boxsealone');\n $boxsealtwo = $model->getSubmit()->getRowValue('boxsealtwo');\n $transportedby = $model->getSubmit()->getRowValue('transportedby');\n\n $output->getStore()->setProxy($proxy);\n $output->getStore()->getModel()->set('id',$id);\n $output->getStore()->getModel()->set('boxsealone',$boxsealone);\n $output->getStore()->getModel()->set('boxsealtwo',$boxsealtwo);\n $output->getStore()->getModel()->set('transportedby',$transportedby);\n $result = self::jsonToObject($output->getStore()->update());\n\n if(!$result->success) {\n throw new \\PDOException($result->text);\n }\n }\n\n foreach ($detail->rows as $item) {\n $armorylocal = $item->armorylocal;\n $flowprocessingstepid = $item->flowprocessingstepid;\n\n if($newmovementtype == '001') {\n $stock->getStore()->setProxy($proxy);\n $stock->getStore()->getModel()->set('id','');\n $stock->getStore()->getModel()->set('flowprocessingstepid',$flowprocessingstepid);\n $stock->getStore()->getModel()->set('armorylocal',$armorylocal);\n $stock->getStore()->getModel()->set('armorystatus','A');\n $result = self::jsonToObject($stock->getStore()->insert());\n\n if(!$result->success) {\n throw new \\PDOException($result->text);\n }\n\n $sql = \"\n declare\n @flowprocessingid int,\n @flowprocessingstepid int = :flowprocessingstepid;\n\n select\n @flowprocessingid = flowprocessingid\n from\n flowprocessingstep\n where id = @flowprocessingstepid;\n\n update flowprocessing set flowstatus = 'E' where id = @flowprocessingid;\n\n update flowprocessingstepaction set isactive = 0 where flowprocessingstepid = @flowprocessingstepid;\";\n\n $pdo = $proxy->prepare($sql);\n $pdo->bindValue(\":flowprocessingstepid\", $flowprocessingstepid, \\PDO::PARAM_INT);\n $callback = $pdo->execute();\n\n if(!$callback) {\n throw new \\PDOException(self::$FAILURE_STATEMENT);\n }\n }\n\n if($newmovementtype == '002') {\n $sql = \"\n declare\n @flowprocessingstepid int = :flowprocessingstepid;\n\n update\n armorystock\n set \n armorystatus = 'E'\n where flowprocessingstepid = @flowprocessingstepid\";\n\n $pdo = $proxy->prepare($sql);\n $pdo->bindValue(\":flowprocessingstepid\", $flowprocessingstepid, \\PDO::PARAM_INT);\n $callback = $pdo->execute();\n\n if(!$callback) {\n throw new \\PDOException(self::$FAILURE_STATEMENT);\n }\n }\n\n if($newmovementtype == '003') {\n $sql = \"\n declare\n @armorylocal char(3) = :armorylocal,\n @flowprocessingstepid int = :flowprocessingstepid;\n\n update\n armorystock\n set\n armorystatus = 'A'\n where flowprocessingstepid = @flowprocessingstepid\n and armorystatus = 'E'\n and armorylocal = @armorylocal\";\n\n $pdo = $proxy->prepare($sql);\n $pdo->bindValue(\":armorylocal\", $armorylocal, \\PDO::PARAM_STR);\n $pdo->bindValue(\":flowprocessingstepid\", $flowprocessingstepid, \\PDO::PARAM_INT);\n $callback = $pdo->execute();\n\n if(!$callback) {\n throw new \\PDOException(self::$FAILURE_STATEMENT);\n }\n }\n }\n\n $proxy->commit();\n\n } catch ( \\PDOException $e ) {\n if ($proxy->inTransaction()) {\n $proxy->rollBack();\n }\n throw new \\PDOException($e->getMessage());\n }\n }\n }", "public function update(Model $model, Request $request): ?Model;", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "abstract public function save();", "protected function performUpdate() {}", "public function update () {\n\n }", "public function save()\n {\n\t\t\tforeach($this->items as $index=>$data)\n\t\t\t{\n\t \t//if exists, update\n\t\t\t\tif($data[\"object\"])\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]->update(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$data[\"producttype\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data[\"object\"]=MyModel::create(\"Product\",array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'name'=>$data[\"name\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'description'=>$data[\"description\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'producttype_id'=>$this->main->producttypedata->items[$data[\"producttypename\"]][\"object\"]->getId(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category1'=>$data[\"category1\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category2'=>$data[\"category2\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category3'=>$data[\"category3\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category4'=>$data[\"category4\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category5'=>$data[\"category5\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category6'=>$data[\"category6\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category7'=>$data[\"category7\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category8'=>$data[\"category8\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category9'=>$data[\"category9\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category10'=>$data[\"category10\"],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t\t\t}\n\n\t\t\t}\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update()\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update($data)\n {\n }", "public function update() {\n \n }", "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }" ]
[ "0.7588688", "0.6954086", "0.6917589", "0.6863967", "0.6857025", "0.6789065", "0.67447174", "0.6724494", "0.670911", "0.66580915", "0.6423676", "0.6410221", "0.63919693", "0.63919693", "0.6386232", "0.6381652", "0.6376514", "0.63667554", "0.6351468", "0.6351468", "0.6341207", "0.6321759", "0.6310681", "0.6309941", "0.63019675", "0.62966293", "0.62908673", "0.62908673", "0.6248857", "0.62049294", "0.6195239", "0.6195239", "0.6195227", "0.6195227", "0.6195219", "0.61880374", "0.61740243", "0.61740243", "0.6171", "0.6167269", "0.61528015", "0.6147553", "0.61294156", "0.61258876", "0.61243165", "0.61186695", "0.6101497", "0.60980177", "0.60943395", "0.60943395", "0.6089545", "0.6089516", "0.60830134", "0.6081973", "0.60709035", "0.60702115", "0.6066977", "0.6058768", "0.605793", "0.60523564", "0.60372293", "0.6035518", "0.60317415", "0.60219485", "0.60097915", "0.6007519", "0.6006808", "0.6005091", "0.60000837", "0.59927434", "0.5984402", "0.59813803", "0.597826", "0.5976427", "0.59670645", "0.5965472", "0.5965472", "0.5965472", "0.5965472", "0.5965472", "0.59650415", "0.59585184", "0.59541327", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5946359", "0.5940813", "0.5940813", "0.5940813", "0.5940813", "0.5927009", "0.59189665" ]
0.0
-1