query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
add_carousel Add a nav carousel to a post. Wraps the I2M_Module__carousel object. Note: position is always 'full'
function add_carousel( $source = null ) { $module = new I2M_Module__carousel( $source ); $this->module_list[] = $module->get_acf_layout( $source ); $this->modules[] = $module; return $module; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cool_carousel_activation(){}", "public function render_carousel(){\n\t\tif(is_home() && !$this->_template_builder->get_specific_option('carousel_global') \n\t\t\t&& !$this->_template_builder->get_specific_option('carousel_home') || \n\t\t\tis_single() && $this->_template_builder->get_specific_option('carousel_single')){\n\n\t\t\t$this->_template_builder->render_view('carousel');\n\t\t}\t\n\t}", "function wpb_carousel_widget() {\n\t register_widget( 'wpb_widget' );\n\t}", "public function show(Carousel $carousel)\n {\n //\n }", "function wpcoupon_register_carousel_widget() {\r\n register_widget( 'WPCoupon_Carousel_Widget' );\r\n}", "function create_bootstrap_carousel($string)\n{\n# Nur zum Debug:\n# return \"hier soll mal ein Slider rein\";\n# enthaelt teilweise noch Code, der aktuell nicht benötigt wird, ggf fuer Ausbau\n global $settings, $template;\n $page = isset($GLOBALS['parent_page']) && $GLOBALS['parent_page'] ? $GLOBALS['parent_page'] : PAGE;\n $template->assign('contains_thumbnails', true);\n $template->assign('page', $page);\n $string = explode('|',$string[1]);\n $bootstrap_carousel = $string[0];\n #if(isset($string[1])) $img_class = $string[1];\n $bootstrap_carousel = new Gallery($bootstrap_carousel);\n if($bootstrap_carousel->photos)\n {\n $template->assign('number_of_photos', $bootstrap_carousel->number_of_photos);\n $template->assign('photos', $bootstrap_carousel->photos);\n }\n #$template->assign('lang', Localization::$lang);\n $bootstrap_carousel = $template->fetch(BASE_PATH.'cms/templates/subtemplates/bootstrap-carousel.inc.tpl');\n return $bootstrap_carousel;\n}", "public function created(Carousel $carousel)\n {\n //\n }", "function additem()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '新增轮播图';\n $this->global['pageName'] = 'carousel_add';\n $data = '';\n\n $this->loadViews(\"carousel_add\", $this->global, $data, NULL);\n }\n }", "function _sp_custom_box_carousel_shortcode( $post ) {\n\n\t$output = '';\n\n\t$output .= '<div class=\"settings-container\">' . PHP_EOL;\t\n\t$output .= sp_get_slider_shortcode( $post->ID ) . PHP_EOL;\n\t$output .= '<p class=\"howto\">' . __( 'Paste this shortcode on the page you want this carousel slider to show.', 'sp-theme' ) . '</p>' . PHP_EOL;\t\n\t$output .= '</div>' . PHP_EOL;\n\n\techo $output;\n}", "public function carousel()\n\t\t{\n\t\t\treturn $this->render('incs/carousel');\n\t\t}", "public function htheme_imgcarousel_element(){\r\n\r\n\t\t//SETUP VC MAP\r\n\t\tvc_map(\r\n\t\t\tarray(\r\n\t\t\t\t\"name\" => esc_html__( \"Basic Image Carousel\", \"js_composer\" ),\r\n\t\t\t\t\"base\" => \"htheme_imgcarousel_slug\",\r\n\t\t\t\t\"class\" => \"\",\r\n\t\t\t\t'icon' => 'htheme_imgcarousel_icon',\r\n\t\t\t\t\"category\" => esc_html__( \"WooCommerce\", \"js_composer\"),\r\n\t\t\t\t'description' => esc_html__( \"Add an image carousel to your site.\", \"js_composer\" ),\r\n\t\t\t\t\"params\" => array(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"attach_images\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Images\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_imgcarousel_images\",\r\n\t\t\t\t\t\t\"value\" => __( \"\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Add multiple images for you image carousel.\", \"js_composer\" )\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Image sizing\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_size\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Contain' => 'contain',\r\n\t\t\t\t\t\t\t'Cover' => 'cover',\r\n\t\t\t\t\t\t\t'Auto' => 'auto'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the image sizing.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Layout\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_layout\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'Full row carousel' => 'full_row',\r\n\t\t\t\t\t\t\t'Contained carousel' => 'contained_row'\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Choose the layout for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\"type\" => \"dropdown\",\r\n\t\t\t\t\t\t\"holder\" => \"div\",\r\n\t\t\t\t\t\t\"class\" => \"htheme_element_class\",\r\n\t\t\t\t\t\t\"heading\" => esc_html__( \"Carousel height\", \"js_composer\" ),\r\n\t\t\t\t\t\t\"param_name\" => \"htheme_image_carousel_height\",\r\n\t\t\t\t\t\t\"value\" => array(\r\n\t\t\t\t\t\t\t'100px' => 100,\r\n\t\t\t\t\t\t\t'200px' => 200,\r\n\t\t\t\t\t\t\t'300px' => 300,\r\n\t\t\t\t\t\t\t'400px' => 400,\r\n\t\t\t\t\t\t\t'500px' => 500,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t'std' => '',\r\n\t\t\t\t\t\t\"description\" => esc_html__( \"Set the height for your image carousel.\", \"js_composer\" ),\r\n\t\t\t\t\t),\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t}", "public function render($post)\n {\n\n // Add an nonce field to check for it when we save .\n wp_nonce_field(Self::NONCE_ACTION, 'carousel_nonce');\n\n //retrieve an existing value from the database.\n $carousel = get_post_meta($post->ID, '_carousel', true) ?: [];\n\n $count = count($carousel);\n\n // Display the form, using the current value.\n?>\n\n <div class=\"metabox-content\">\n <div class=\"container-fluid\">\n <div class=\"row bg-light border my-2\">\n <div class=\"col-2 py-2 \">\n <div class=\"font-weight-bold\"><?php _e('Your Selection', 'pao') ?></div>\n </div>\n <div class=\" carousel-img-container col-10 d-flex align-items-center\">\n <?php foreach ($carousel as $key => $image) : ?>\n <div class=\" m-2 position-relative\">\n <img class=\"img-thumbnail\" src=\"<?php echo esc_url($image['url']) ?>\" alt=\"\" style=\"width:150px; height:150px ;\" />\n <a href=\"#\" class=\" delete-carousel-img position-absolute btn btn-danger btn-sm \" title=\"<?php _e('Remove', 'pao') ?>\" style=\"top:2px;right:2px;\"> &times;</a>\n <input type=\"hidden\" name=\"carousel[<?= $key ?>][url]\" value=\"<?= esc_url($image['url']) ?>\" />\n <input type=\"hidden\" name=\"carousel[<?= $key ?>][link]\" value=\"<?= esc_url($image['link']) ?>\" />\n </div>\n <?php endforeach ?>\n </div>\n </div>\n <div class=\"row bg-light border my-2\">\n <div class=\"col-2 py-2 \">\n <div class=\"font-weight-bold\"><?php _e('Image', 'pao') ?></div>\n <p><?php _e('Upload carousel image', 'pao') ?></p>\n </div>\n <div class=\"col-10 d-flex flex-column justify-content-center \">\n\n <div class=\"custom-img-container \">\n <!-- uploaded image goes here -->\n </div>\n <input type=\"hidden\" class=\"form-control custom-img-url\" value=\"\" placeholder=\"\" />\n <input type=\"url\" class=\"form-control custom-img-link d-none\" value=\"\" placeholder=\"<?php _e('Enter link for this image', '') ?>\" />\n <p class=\"pt-2\">\n <a class=\"upload-custom-img btn btn-info \" href=\"#\">\n <?php _e('Upload', 'pao') ?>\n </a>\n <a class=\"register-custom-img btn btn-info d-none\" href=\"#\">\n <?php _e('Add', 'pao') ?>\n </a>\n <a class=\"delete-custom-img btn btn-info d-none\" href=\"#\">\n <?php _e('Remove', 'pao') ?>\n </a>\n </p>\n </div>\n </div>\n </div>\n </div>\n\n<?php\n }", "function _portfolio_carousel( $options )\n\t{\n\t\n\t\t\n\t\t$element_size = zn_get_size( $options['_sizer'] );\n\t\n\t\twp_reset_query();\n\t\tglobal $post;\n\n\t\t\n\t\t$posts_per_page = isset($options['ports_per_page']) ? $options['ports_per_page'] : '4'; // how many posts\n\n\t\t$query = array(\n\t\t\t'post_type' => 'portfolio',\n\t\t\t'paged' => (get_query_var('paged')) ? get_query_var('paged') : 1,\n\t\t\t'posts_per_page' => $posts_per_page,\n\t\t\t'tax_query' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'taxonomy' => 'project_category',\n\t\t\t\t\t'field' => 'id',\n\t\t\t\t\t'terms' => $options['portfolio_categories']\n\t\t\t\t)\n\t\t\t),\n\t\t\t'showposts' => $options['ports_per_page_visible']\n\t\t);\n\n\n\n\n\t\t// Start the query\n\t\tquery_posts( $query );\n\t\t$i = 1;\n\n\t\t?>\n\t\t\t\t\t\t<div class=\"span12\">\n\t\t\t\t\t\t\t<div class=\"row hg-portfolio-carousel\">\n\n\t\t\t\t\t\t\t<?php if ( have_posts() ): while ( have_posts() ): the_post(); \n\t\t\t\t\t\t\t\t// Get post meta information\n\t\t\t\t\t\t\t\t$post_meta_fields = get_post_meta($post->ID, 'zn_meta_elements', true);\n\t\t\t\t\t\t\t\t$post_meta_fields = maybe_unserialize( $post_meta_fields );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\t\t\t\t<div class=\"ptcontent\">\n\t\t\t\t\t\t\t\t\t\t<h3 class=\"title\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\"><span class=\"name\"><?php the_title(); ?></span></a>\n\t\t\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t\t\t<div class=\"pt-cat-desc\">\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\tif ( preg_match('/<!--more(.*?)?-->/', $post->post_content) ) {\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\tthe_content('');\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\telse {\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\tthe_excerpt();\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</div><!-- end item desc -->\n\t\t\t\t\t\t\t\t\t\t<div class=\"itemLinks\">\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\tif ( !empty ( $post_meta_fields['sp_link']['url'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<span><a href=\"'.$post_meta_fields['sp_link']['url'].'\" target=\"'.$post_meta_fields['sp_link']['target'].'\" >'.__(\"Live Preview: \",THEMENAME).'<strong>'.$post_meta_fields['sp_link']['url'].'</strong></a></span>';\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<span class=\"seemore\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\" ><?php _e('See more &rarr;',THEMENAME);?></a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div><!-- end item links -->\n\t\t\t\t\t\t\t\t\t</div><!-- end item content -->\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"span6\">\n\t\t\t\t\t\t\t\t\t<div class=\"ptcarousel\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"controls\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"prev\"><span class=\"icon-chevron-left icon-white\"></span></a>\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"next\"><span class=\"icon-chevron-right icon-white\"></span></a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<ul class=\"ptcarousel1\">\n\t\t\t\t\t\t\t\t\t\t<?php\n\n\t\t\t\t\t\t\t\t\t\t\tif ( !empty ( $post_meta_fields['port_media'] ) && is_array( $post_meta_fields['port_media'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tforeach ( $post_meta_fields['port_media'] as $media ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// COMBINED\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ( !empty ( $media['port_media_image_comb'] ) && !empty ( $media['port_media_video_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$media['port_media_video_comb'].'\" rel=\"prettyPhoto\" data-type=\"image\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '', $media['port_media_image_comb'] , $size['width'],$size['height'] , true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" alt=\"'.get_the_title().'\" />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\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// IMAGE\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif ( !empty ( $media['port_media_image_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<a href=\"'.$media['port_media_image_comb'].'\" data-type=\"image\" rel=\"prettyPhoto\">';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$image = vt_resize( '', $media['port_media_image_comb'] , $size['width'],$size['height'] , true );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<img src=\"'.$image['url'].'\" width=\"'.$image['width'].'\" height=\"'.$image['height'].'\" alt=\"'.get_the_title().'\" />';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</a>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\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// VIDEO\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telseif ( !empty ( $media['port_media_video_comb'] ) ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>';\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$size = zn_get_size( 'eight' );\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo get_video_from_link( $media['port_media_video_comb'] , '' , $size['width'] , $size['height'] );\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\techo '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t</div><!-- end ptcarousel -->\n\t\t\t\t\t\t\t\t</div>\n\n\n\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\tif ( $i % $options['ports_per_page_visible'] != 0 ) {\n\n\t\t\t\t\t\t\t\t\t\techo '<div class=\"span12\"><hr class=\"bs-docs-separator\"></div>';\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t?>\n\n\n\t\t\t\t\t\t\t<?php endwhile; ?>\n\t\t\t\t\t\t\t<?php endif; ?>\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</div><!-- end portfolio layout -->\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\techo '<div class=\"clear\"></div>';\n\t\t\t\t\t\t\t\techo '<div class=\"span12\" >';\n\t\t\t\t\t\t\t\t\tzn_pagination(); \n\t\t\t\t\t\t\t\t\twp_reset_query();\n\t\t\t\t\t\t\t\techo '</div>';\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</div>\n\t\t<?php\n\n\t}", "function htheme_blog_carousel_shortcode( $atts ) {\r\n\r\n\t\t#SETUP CONTENT CLASS\r\n\t\t$htheme_data = $this->htheme_content->htheme_get_content_blog_carousel($atts);\r\n\r\n\t\t#RETURN DATA/HTML\r\n\t\treturn $htheme_data;\r\n\r\n\t}", "function pexeto_show_carousel( $atts, $content = null ) {\r\n\t\textract( shortcode_atts( array(\r\n\t\t\t\t\t'title' => '',\r\n\t\t\t\t\t'cat' => '-1',\r\n\t\t\t\t\t'orderby' => 'date',\r\n\t\t\t\t\t'order' => 'DESC',\r\n\t\t\t\t\t'maxnum' => '-1'\r\n\t\t\t\t), $atts ) );\r\n\t\t$html='';\r\n\r\n\t\t$args = array(\r\n\t\t\t'post_type'=>PEXETO_PORTFOLIO_POST_TYPE,\r\n\t\t\t'orderby'=>$orderby,\r\n\t\t\t'order'=>$order,\r\n\t\t\t'posts_per_page'=>$maxnum\r\n\t\t);\r\n\r\n\t\tif ( $cat!='-1' ) {\r\n\t\t\t$args[PEXETO_PORTFOLIO_TAXONOMY]=get_term_by( 'id', $cat, PEXETO_PORTFOLIO_TAXONOMY )->slug;\r\n\t\t}\r\n\r\n\r\n\t\t$car_posts = get_posts( $args );\r\n\r\n\t\t$html = pexeto_build_portfolio_carousel_html( $car_posts, $title );\r\n\r\n\t\treturn $html;\r\n\t}", "function thmplt_carousel_slide_meta(){\r\n\tadd_meta_box(\"thmplt_carousel_meta_box1\", \"Slide Settings\", \"thmplt_carousel_slide_settings_html\", \"thmplt_carousel\", \"normal\", \"high\");\r\n\tadd_meta_box(\"thmplt_carousel_meta_box2\", \"Slide Images\", \"thmplt_carousel_slide_settings_html2\", \"thmplt_carousel\", \"normal\", \"high\");\r\n}", "function prk_carousel( $atts, $content = null ) \n\t{\n\t\textract(shortcode_atts(array(\n\t\t\t'title' \t => ''\n\t\t), $atts));\n\t\tif (isset($atts['title']) && $atts['title']!=\"\")\n\t\t\t$title=$atts['title'];\n\t\telse\n\t\t\t$title=\"\";\n\t\t$output = '';\n\t\tif ($title!=\"\")\n \t$output.=do_shortcode('[prk_styled_title align=\"left\" text_color=\"\" show_lines=\"no\" use_italic=\"\" title_size=\"small\"]'.$title.'[/prk_styled_title]');\n\t\t$output .= '<div class=\"prk_list_carousel\">';\n\t\t$output .= '<ul class=\"prk_rousel\">';\n\t\t$output .= do_shortcode( $content );\n\t\t$output .= '</ul>';\n\t\t$output .= '</div>';\n\t\treturn $output;\n\t}", "function carousel_slider(){\r\n\tregister_post_type('slider', array(\r\n\t\t\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t\t\t'rewrite' => array('slug' => 'slider'),\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'public' => true,\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => 'Slider',\r\n\t\t\t\t'add_new_item' => 'Add New Slider',\r\n\t\t\t\t'edit_item' => 'Edit Slider',\r\n\t\t\t\t'singular_name' => 'Slider'\r\n\t\t\t),\r\n\t\t\t'menu_icon' => 'dashicons-images-alt'));\r\n}", "public function edit(Carousel $carousel)\n {\n //\n }", "function custom_active_slide($atts){\n $para = shortcode_atts(\n array(\n 'id' => '1'\n ), $atts );\n ob_start(); ?>\n\n\n\n <!-- Begin #carousel-section --> \n <section id=\"carousel-section\" class=\"section-global-wrapper\"> \n <div class=\"container-fluid-kamn\">\n <div class=\"row\">\n <div id=\"carousel-<?php echo $para['id']; ?>\" class=\"carousel slide\">\n\n <!-- Wrapper for slides -->\n <div class=\"carousel-inner\">\n \n\n <?php\n\n $slider_query = null;\n $slider_query = new WP_Query( array(\n 'post_type' => 'slider',\n 'posts_per_page' => -1,\n ) );\n\n $pre = '_office_master_';\n $x = 0;\n while ( $slider_query->have_posts() ) {\n $slider_query->the_post(); \n $x++;\n \n $slider_caption = get_post_meta( get_the_ID(), $pre.'slider_caption', true );\n ?> \n\n <!-- Begin Slide 1 -->\n <div class=\"item <?php if ( $x == 1 ) {\n echo 'active';\n } ?>\">\n <?php the_post_thumbnail('slider-pic'); ?>\n <div class=\"carousel-caption\">\n <h3 class=\"carousel-title hidden-xs\"> <?php the_title(); ?> </h3>\n <p class=\"carousel-body\"> <?php echo $slider_caption; ?> </p>\n </div>\n </div>\n <!-- End Slide 1 -->\n\n <?php } ?>\n\n\n \n\n\n </div>\n \n\n\n <!-- Indicators -->\n <ol class=\"carousel-indicators visible-lg\">\n\n <?php for ($i=0; $i < $x ; $i++) { ?>\n \n <li data-target=\"#carousel-<?php echo $para['id']; ?>\" data-slide-to=\"<?php echo $i; ?>\" class=\"<?php if ($i==0) { echo 'active'; } ?>\"> </li>\n \n <?php } ?>\n </ol>\n\n <!-- Controls -->\n <a class=\"left carousel-control\" href=\"#carousel-<?php echo $para['id']; ?>\" data-slide=\"prev\">\n <span class=\"glyphicon glyphicon-chevron-left\"></span>\n </a>\n <a class=\"right carousel-control\" href=\"#carousel-<?php echo $para['id']; ?>\" data-slide=\"next\">\n <span class=\"glyphicon glyphicon-chevron-right\"></span>\n </a>\n </div>\n </div>\n </div>\n </section>\n <!-- End #carousel-section -->\n\n\n\n\n\n <?php \n return ob_get_clean();\n }", "function createCarousel($data) {\n\n\t\tif (is_array($data)) {\n\t\t\t$unq = uniqid();\n\t\t\t$this->id = $unq;\n\t\t\t\n\t\t\t$output = \"<div class='carousel' id='carousel\".$unq.\"'\";\n\t\t\t$output .= (!MOBILE) ? \" style='width:\".$this->width.\"px'>\" : \">\";\n\t\t\t\t$output .= \"<div class='carousel_left' onclick=\\\"carousel('\".$unq.\"', 'left')\\\">\";\n\t\t\t\t$output .= \"</div>\"; //<p><a onclick=\\\"carousel('\".$unq.\"', 'first')\\\">Start</a></p>\";\n\t\t\t\t$output .= \"<div class='carousel_inner'\";\n\t\t\t\t$output .= (!MOBILE) ? \" style='width:\".($this->width).\"px'>\" : \">\";\n\t\t\t\t\t$output .= \"<div class='carousel_slider'\";\n\t\t\t\t\t$output .= (!MOBILE) ? \" style='width:\".(($this->elm_width+25)*count($data)).\"px'>\" : \">\";\n\t\t\t\t\tforeach ($data as $key=>$elm) {\n\t\t\t\t\t\t$output .= \"<div class='carousel_element' style='max-width:\".$this->elm_width.\"px'>\";\n\t\t\t\t\t\t$output .= $elm;\n\t\t\t\t\t\t$output .= \"</div>\";\n\t\t\t\t\t}\n\t\t\t\t\t$output .= \"</div>\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t\t$output .= \"<div class='carousel_right' onclick=\\\"carousel('\".$unq.\"', 'right')\\\">\";\n\t\t\t\t$output .= \"</div>\";\n\t\t\t//$output .= \"</div><p style='float:right; font-size:11px;'><a onclick=\\\"carousel('\".$unq.\"', 'last')\\\">Skip to end</a></p>\";\n\t\t\t$output .= \"<script type='text/javascript'>$(document).ready(function(){carousel_skip=\".($this->elm_width+20).\"});</script>\";\n\t\t\t\n\t\t} else {\n\t\t\t$output = \"<p><em>please supply at least one element to create carousel</em></p>\";\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "function getCarousel(Http $http)\n {\n \n $id = $http->get(\"id\");\n \n $slider = oCoder::find($id);\n $arrItems=json_decode($slider->image_link);\n \t\t\t\n return view('@oCoder/admin/edit_slideshow.twig', [\n 'arrItems' => $arrItems,\n 'slider' => $slider,\n 'get_site_url' => get_site_url(),\n 'frontJS' => Helper::assetUrl('/js/responsive_testemonial_carousel.js'),\n 'css' => Helper::assetUrl('/css/responsive_testemonial_carousel.css')\n ]);\n }", "function fr_carousel_slider(){\r\n\tregister_post_type('fr_slider', array(\r\n\t\t\t'supports' => array('title', 'editor', 'excerpt'),\r\n\t\t\t'rewrite' => array('slug' => 'fr_slider'),\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'public' => true,\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => 'FR_Slider',\r\n\t\t\t\t'add_new_item' => 'FR Add New Slider',\r\n\t\t\t\t'edit_item' => 'FR Edit Slider',\r\n\t\t\t\t'singular_name' => 'FR Slider'\r\n\t\t\t),\r\n\t\t\t'menu_icon' => 'dashicons-images-alt'));\r\n}", "function thmplt_bootstrap_carousel_shortcode($atts){\r\n\r\n\t\textract( shortcode_atts( array(\r\n\t\t'ID' => 'tpf_carousel', // \r\n\t\t'legacy' => 'on'\t\r\n\t\t//'excerpt' => ''\r\n\t), $atts ) );\r\n\t\r\n\treturn thmplt_do_carousel_slides($ID, false, $legacy);\r\n\t\r\n}", "function thmplt_do_carousel_slides($id, $echo = true, $legacy = 'on' ) { \r\n\r\n\r\n\t$thmplt_carousel_options = get_option('thmplt_carousel_options');\r\n\t$thmplt_carousel_slides = get_option('thmplt_carousel_slides');\r\n\t\r\n\t$s = 0;\r\n\t$classes = \"\";\r\n\t\r\n\t// If there are no slides... return false\r\n\tif ( !is_array( $thmplt_carousel_slides ) ) { return false; }\t\r\n\t\r\n\t// If there are no options, then set it to be an empty array \t\r\n\tif ( !is_array( $thmplt_carousel_options ) ) { $thmplt_carousel_options = array(); }\r\n\t\r\n\t$options = array ( \r\n\t\t\r\n\t\t\"indicators\" => \"on\",\r\n\t\t\"controls\" => \"on\",\r\n\t\t\"imageoptions\" => \"normal\",\r\n\t\t\"interval\" => \"3\",\r\n\t\t\"pause\" => \"none\",\r\n\t\t\"transition\" => \"slide\"\r\n\t\r\n\t);\r\n\r\n\t$options = array_merge($options, $thmplt_carousel_options );\r\n\r\n\t$html = \"\";\r\n\r\n\t/**\r\n\t * Add the hover attribute\r\n\t */\t\t\r\n\tif ($options['pause'] == \"hover\" ) { \r\n\r\n\t\t$html .= \"<script type='text/javascript'> \\n\";\r\n\t\t\t$html .= \"jQuery(document).ready(function(){ \r\n\t\t\t\r\n\t\t\t\tjQuery('#\".$id.\"').mouseenter(function() {\r\n\t\t\t\t\tjQuery(this).carousel('pause');\r\n\t\t\t\t}).mouseleave(function() {\r\n\t\t\t\t\tjQuery(this).carousel('cycle');\r\n\t\t\t\t}); \r\n\t\t\t\r\n\t\t\t});\";\r\n\t\t$html .= \"</script> \\n \\n\";\r\n\r\n\t}\r\n\t\r\n\r\n\t\r\n\t\r\n\t// Appened which transition we want \r\n\t$classes .= \"carousel-\" . $options['transition'];\r\n\t\r\n\r\n\t$html .= \"<div id='\".$id.\"' class='carousel slide \".$classes.\"' \";\r\n\r\n\t\t/**\r\n\t\t * Add the interval attribute\r\n\t\t */\t\t\r\n\t\t$interval = $options['interval'] * 1000;\r\n\t\t$html .= \" data-interval='\". $interval .\"' \";\r\n\r\n\r\n\tif ($options['pause'] == \"hover\" ) {\r\n\t\t#$html .= \" data-pause='true' \";\r\n\t} else {\r\n\t\t$html .= \" data-pause='false' \";\r\n\t}\r\n\t\r\n\t\r\n\t$html .= \" data-ride='carousel' > \\n\\n\";\r\n\r\n\t/**\r\n\t * Create the indicators if they are turned on in the settings\r\n\t * they are on \r\n\t */\t\r\n\tif ( $options['indicators'] == \"on\" ) {\r\n\r\n\t\t$html .= \"<!-- Indicators --> \\n\";\r\n\t\t$html .= \"<ol class='carousel-indicators'> \\n\";\r\n\t\t\r\n\t\tforeach ($thmplt_carousel_slides as $slide ) { \r\n\r\n\t\t\tif ( $slide != \"none\" ) { \r\n\t\t\t\r\n\t\t\t\t// Build the indicators list items \t\t\t\r\n\t\t\t\t$html .= \"\\t <li data-target='#\".$id.\"' data-slide-to='\".$s.\"'\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t// if its the first one, give it a class of active \t\r\n\t\t\t\t\tif ($s == 0 ) { $html .= \" class='active'\"; }\r\n\t\t\t\t\r\n\t\t\t\t$html .= \" ></li> \\n\";\r\n\t\t\t\t\r\n\t\t\t\t$s = $s + 1;\r\n\t\t\t\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\t$html .= \"</ol> \\n \\n\";\r\n\t\t\r\n\t} #end if \r\n\r\n\r\n\r\n\t$s = 0;\r\n\t/**\r\n\t * Create the slides \r\n\t */\r\n\t$html .= \"<!-- Wrapper for slides --> \\n\";\r\n\t$html .= \"<div class='carousel-inner'> \\n\";\r\n\t \r\n\tforeach ($thmplt_carousel_slides as $slide ) { \r\n\t\r\n\t\tif ( $slide != \"none\" ) { \r\n\t\t\t\r\n\t\t\t$car_post = get_post($slide);\r\n\t\t\r\n\t\t\t$custom = get_post_custom($car_post->ID);\r\n\t\t\t@$slide_set = unserialize($custom['thmplt_carousel_slide_settings'][0]);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$yt = thmplt_extract_yt_video_id($slide_set['video']);\r\n\t\t\t\r\n\t\t\t$slideid = !empty($slide_set['ID'])? $slide_set['ID'] : \"slide-\".$car_post->ID;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= \" \\t <div \";\r\n\t\t\t$html .= !empty($slideid)? \"id='\".$slideid.\"' \":\"\";\r\n\t\t\t$html .= \" class='item carousel-\". $car_post->ID . \" \".$slide_set['class'].\" \";\r\n\t\t\t// if its the first one, give it a class of active \t\r\n\t\t\tif ($s == 0 ) { $html .= \" active\"; }\r\n\t\t\t$html .= \"' \";\r\n\t\t\t$html .= !empty($slide_set['interval'])? \" data-interval='\".($slide_set['interval']*1000).\"' \":\"\";\r\n\t\t\t\r\n\t\t\t//$html .= !empty($slide_set['height'])? \" style='height:\".$slide_set['height'].\"px'\":\"\";\r\n\t\t\t\r\n\t\t\t$html .= \" > \\n\";\r\n\t\t\t\r\n\r\n\t\t\t//.1666666\r\n\t\t\t//$margintop = \"52.5$\";\r\n\t\t\t\r\n\t\t\tif (!empty($yt)){\r\n\t\t\t\t\r\n\t\t\t\t// iF Responsive \r\n\t\t\t\tif(!empty($slide_set['vresponsive']) && $slide_set['vresponsive'] == \"yes\"){ \r\n\t\t\t\t\t\r\n\t\t\t\t\t$heightratio = ($slide_set['height'] / $slide_set['width']) * 100;\r\n\t\t\t\t\t$scale = empty($slide_set['scale']) ? \"100\" : str_replace(\"%\", \"\", $slide_set['scale']);\r\n\t\t\t\t\t$scaleoffset = (100 - $scale)/2;\t\t\t\t\t\r\n\t\t\t\t\t$html .= \"\r\n\t\t\t\t\t<style scoped>\r\n\t\t\t\t\t\t#\".$slideid.\" .video-container {width:100%;height:0;padding-bottom:\".$heightratio.\"%}\r\n\t\t\t\t\t\t#\".$slideid.\" .video-container iframe {height:\".$scale.\"%;top:\".$scaleoffset.\"%}\r\n\t\t\t\t\t\t#\".$slideid.\" .video-container iframe {width:\".$scale.\"%;left:\".$scaleoffset.\"%}\r\n\t\t\t\t\t</style>\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$html .= \"<!-- YT ID: \".$yt.\" -->\"; //width='560' height='315'\r\n\t\t\t\t$html .= \"<div class='video-container \";\r\n\t\t\t\t$html .= ($slide_set['vresponsive'] == \"yes\") ? \" embed-responsive \": \"\";\r\n\t\t\t\t$html .= \"'><iframe id='#\".$slideid.\"-video' class='carousel-video position-center' \";\r\n\t\t\t\t\r\n\t\t\t\t$html .= (!empty($slide_set['height']))? \" height='\".$slide_set['height'].\"'\":\"\";\r\n\t\t\t\t$html .= (!empty($slide_set['width']))? \" width='\".$slide_set['width'].\"'\":\"\";\r\n\t\t\t\t\r\n\t\t\t\t//$slide_set['sound'] = \"no\";\r\n\t\t\t\t\r\n\t\t\t\t$mute = (!empty($slide_set['sound']) && $slide_set['sound'] == \"no\")? \"1\" :\"0\";\r\n\t\t\t\t\r\n\t\t\t\t$src_sets = \"?rel=0&controls=0&showinfo=0&disablekb=0&autoplay=1&loop=1&mute=\".$mute.\"&playlist=\".$yt;\r\n\t\t\t\t\r\n\t\t\t\t$html .= \" src='//www.youtube.com/embed/\".$yt.$src_sets.\"' frameborder='0' allow='autoplay; encrypted-media' volume='0' allowfullscreen> </iframe></div>\";\r\n\t\t\t\t$html .= \"<div class='tpf-videomask'></div>\";\r\n\t\t\t\t\r\n/*\t\t\t\t$html .= \"\r\n\t\t\t\t<script>\r\n\t\t\t\t\tvar myVideo = iframe.getElementById('\".$slideid.\"-video'); \r\n\t\t\t\t\tmyVideo.mute();\r\n\t\t\t\t</script>\r\n\t\t\t\t\";*/\r\n\t\t\t\t\r\n\t\t\t} else {\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t* Check if a featured image was set, if not then use the bootstrap default grascale image\r\n\t\t\t\t*/\t\t\r\n\t\t\t\t$pictures=\"\";\r\n\t\t\t\t$custom = get_post_custom($car_post->ID);\r\n\t\t\t\t@$slide_set = unserialize($custom['thmplt_carousel_slide_images'][0]);\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif (has_post_thumbnail($car_post->ID) && empty($slide_set['main'])){\r\n\t\t\t\t\t$slide_set['main'] = get_the_post_thumbnail_url($car_post->ID);\r\n\t\t\t\t} \r\n\r\n\t\t\t\tif (!empty($slide_set)){\r\n\t\t\t\t\t$slide_set = array_reverse($slide_set);\r\n\t\t\t\t\tforeach ($slide_set as $key => $img ){\r\n\t\t\t\t\t\tif (!empty($img)){\r\n\t\t\t\t\t\t\t$key = ($key == \"main\")? \"2560\":$key;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$sz = str_replace(\"p\",\"\", $key);\r\n\t\t\t\t\t\t\t$pictures .= \"<source media='(max-width: \".$sz.\"px)' srcset='\".$img.\"'> \\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif ( !empty($slide_set['main'])) { \r\n\r\n\t\t\t\t\t$imgurl = $slide_set['main'];//wp_get_attachment_url ( get_post_thumbnail_id( $car_post->ID ) );\r\n\r\n\t\t\t\t\tif ( $options['imageoptions'] == \"constrained\" ) { \r\n\r\n\t\t\t\t\t\t$html .= \"<div class='imageslide constrained' style='background: url(\".$imgurl.\") center center no-repeat;'>\";\r\n\t\t\t\t\t\t\t$html .= \"<picture style='visibility:hidden'>\";\r\n\t\t\t\t\t\t\t\t$html .= $pictures;\r\n\t\t\t\t\t\t\t\t$html .= \"<img src='\".$imgurl.\"' class='imageslide fullwidthimg' >\";\r\n\t\t\t\t\t\t\t$html .= \"</picture>\";\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"</div>\";\r\n\r\n\t\t\t\t\t} elseif ( $options['imageoptions'] == \"full-width\" ) { \r\n\t\t\t\t\t\t$html .= \"<picture>\";\r\n\t\t\t\t\t\t\t$html .= $pictures;\r\n\t\t\t\t\t\t\t$html .= \"<img src='\".$imgurl.\"' class='imageslide fullwidthimg' >\";\r\n\t\t\t\t\t\t$html .= \"</picture>\";\r\n\t\t\t\t\t} else { \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= \"<picture>\";\r\n\t\t\t\t\t\t\t$html .= $pictures;\r\n\t\t\t\t\t\t\t$html .= \"<img src='\".$imgurl.\"' class='imageslide' >\";\r\n\t\t\t\t\t\t$html .= \"</picture>\";\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//$html .= get_the_post_thumbnail( $car_post->ID , 'full' ); \t\t\t\t\r\n\t\t\t\t\t} \r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t$html .= \"<img alt='Carousel Slide' src='data:image/gif;base64,R0lGODlhAQABAIAAAFVVVQAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='>\";\t\r\n\r\n\t\t\t\t}// End if has_post_thumbnail \r\n\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\tif ( !empty($car_post->post_content)){\r\n\t\t\t\r\n\t\t\t\tif ($legacy == 'on' ){\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='container'> \\n\";\t\t\t\t\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='carousel-caption'> \\n\";\r\n\t\t\t\t\t\t$html .= \"\\t \\t \\t\". wpautop($car_post->post_content) . \"\\n\";\r\n\t\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\t\r\n\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($legacy == 'off' ){\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='caption-wrapper'> \\n\";\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='container'> \\n\";\t\t\t\t\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='caption-box-wrapper container row'> \\n\";\r\n\t\t\t\t\t$html .= \" \\t \\t<div class='caption-box'> \\n\";\r\n\t\t\t\t\t\t$html .= \"\\t \\t \\t\". wpautop($car_post->post_content) . \"\\n\";\r\n\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\r\n\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\r\n\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\t\r\n\t\t\t\t\t$html .= \"\\t \\t </div> \\n\";\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} // if !empty($car_post->post_content)\r\n\r\n\t\t\t\r\n\t\t\t// Add an A TAG here \r\n\t\t\tif (!empty($slide_set['href'])){\r\n\t\t\t\t$html .= \"<a class='tpf-linkslide' href='\".$slide_set['href'].\"'>&nbsp;</a>\";\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= \"\\t </div> \\n\";\r\n\t\t\t\r\n\t\t\t$s = $s + 1;\r\n\t\t\r\n\t\t} \r\n\t}\r\n\t\r\n\t\r\n\t$html .= \"</div> \\n \\n\"; // end the slides div\r\n\r\n\r\n\t/**\r\n\t * Create the controls if they are turned on in the seetings\r\n\t * they are on by default\r\n\t */\t\r\n\tif ( $options['controls'] == \"on\" ) {\r\n\r\n\t\t$html .= \"<!-- Controls --> \\n\";\r\n\t\t\r\n\t\t$html .= \"\t<a class='left carousel-control' href='#\".$id.\"' role='button' data-slide='prev'>\r\n\t \t\t\t<span class='glyphicon glyphicon-chevron-left'></span>\r\n\t\t\t \t</a> \\n\r\n\t\t\t\";\r\n\t\t$html .= \"\t<a class='right carousel-control' href='#\".$id.\"' role='button' data-slide='next'>\r\n \t\t\t\t<span class='glyphicon glyphicon-chevron-right'></span>\r\n \t\t\t\t</a> \\n\r\n\t\t\t\";\t\t\t\r\n\t} #end if \r\n\r\n\r\n\t$html .= \"</div> \\n \\n\"; // End closing carousel\r\n\r\n\r\n\t// @todo check that data interval is set... if not, do not run this \r\n\t\r\n\t$html .= \"<script type='text/javascript'> \\n\";\r\n\t\t $html .= \"jQuery(document).ready(function(){ \r\n\t\t \tvar defaultInterval = jQuery('#\".$id.\"').attr('data-interval');\r\n\t\t\tvar activeInterval = jQuery('#\".$id.\"').find('.item.active').attr('data-interval');\r\n\t\t\tif ( activeInterval ){\r\n\t\t\t\tjQuery('#\".$id.\"').carousel({interval: activeInterval});\r\n\t\t\t}\r\n\r\n\t\t\tjQuery('#\".$id.\"').on('slide.bs.carousel', function (e) { \r\n\r\n\t\t\t\tvar newInterval = jQuery(e.relatedTarget).attr('data-interval'); // next slide \r\n\t\t\t\r\n\t\t\t\tif ( newInterval ) { \r\n\t\t\t\t\tc = jQuery('#\".$id.\"')\r\n\t\t\t\t\topt = c.data()['bs.carousel'].options\r\n\t\t\t\t\topt.interval= newInterval;\r\n\t\t\t\t\tc.data({options: opt})\r\n\r\n\t\t\t\t} else { \r\n\t\t\t\t\tc = jQuery('#\".$id.\"')\r\n\t\t\t\t\topt = c.data()['bs.carousel'].options\r\n\t\t\t\t\topt.interval= defaultInterval;\r\n\t\t\t\t\tc.data({options: opt})\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t});\"; \r\n\t$html .= \"</script> \\n \\n\";\t\t\r\n\t\r\n\t\r\n\tif ($echo == true ) {\r\n\t\techo $html;\r\n\t} else { \r\n\t\treturn $html;\r\n\t}\r\n\t\r\n}", "function thmplt_bootstrap_carousel($atts){\r\n\r\n\t/**\r\n\t * Create the controls if they are turned on in the seetings\r\n\t * they are on by default\r\n\t */\t\r\n\tif ( $options['controls'] == \"on\" ) {\r\n\r\n\t\techo \"<!-- Controls --> \\n\";\r\n\t\t\r\n\t\techo \"\t<a class='left carousel-control' href='#\".$id.\"' role='button' data-slide='prev'>\r\n\t \t\t\t<span class='glyphicon glyphicon-chevron-left'></span>\r\n\t\t\t \t</a> \\n\r\n\t\t\t\";\r\n\t\techo \"\t<a class='right carousel-control' href='#\".$id.\"' role='button' data-slide='next'>\r\n \t\t\t\t<span class='glyphicon glyphicon-chevron-right'></span>\r\n \t\t\t\t</a> \\n\r\n\t\t\t\";\t\t\t\r\n\t} #end if \r\n\t\r\n\t\r\n\t\r\n}", "public function register_carousel_two_options ( $wp_customize ){\n\t $wp_customize->add_section( 'mytheme_options_two',\n\t \tarray(\n\t\t\t'title'=> __('Carousel Two Options', 'Claremont Theme'),\n\t\t\t'priority'=> 36, //Determines what order this appears in\n\t\t\t'capability'=> 'edit_theme_options', //Capability needed to tweak\n\t\t\t'description'=> __('Allows you to customize some example setting for Claremont Theme', 'Claremont Theme'),\n\t\t)\n\t );\n\n\t \t\t \n // =============================\n // = Image =\n // =============================\n\n\t \n\t $wp_customize->add_setting('mytheme_options_two[carousel_image_two]',\n\t\tarray(\n\t\t\t'default'=> get_template_directory_uri() . '/images/header/IMG_0932.JPG',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t \n\t $wp_customize->add_control ( new WP_Customize_Image_Control( $wp_customize,\n\t \t'mytheme_carousel_control_two',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel image', 'Claremont Theme'),\n\t\t\t'section'=> 'mytheme_options_two',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_two[carousel_image_two]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n \n // =============================\n // = Title =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_two[carousel_title_two]',\n\t\tarray(\n\t\t\t'default'=> 'Default Title',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t\t\t \n\t $wp_customize->add_control ( new WP_Customize_Control( $wp_customize,\n\t \t'mytheme_carousel_title_two',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel title', 'Claremont Theme'),\n\t\t\t'type'=>'text',\n\t\t\t'section'=> 'mytheme_options_two',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_two[carousel_title_two]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n \n // =============================\n // = TextArea =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_two[carousel_textarea_two]',\n\t\tarray(\n\t\t\t'default'=> 'Place text here.',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\t \n\t $wp_customize->add_control ( new Example_Customize_Textarea_Control( $wp_customize,\n\t \t'mytheme_carousel_textarea_two',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel textarea', 'Claremont Theme'),\n\t\t\t'section'=>'mytheme_options_two',//ID of the section this control renders\n\t\t\t'settings'=>'mytheme_options_two[carousel_textarea_two]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n\t \n\t \n // =============================\n // = Page Dropdown =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_two[carousel_pagelink_two]',\n\t \tarray(\n\t\t\t'capability'=>'edit_theme_options',\n \t\t'type'=>'option',\n\t\t));\n\n\t $wp_customize->add_control('mytheme_carousel_pagelink_two', array(\n \t'label'=> __('Carousel page link', 'Claremont Theme'),\n \t'section'=> 'mytheme_options_two',\n \t'type' => 'dropdown-pages',\n \t'settings' => 'mytheme_options_two[carousel_pagelink_two]',\n\t ));\n\t\n \n // =============================\n // = Pagelink Title =\n // =============================\n\t $wp_customize->add_setting('mytheme_options_two[carousel_pagelink_title_two]',\n\t\tarray(\n\t\t\t'default'=> 'Button Two Title',\n\t\t\t'type' => 'option',\n\t\t\t'capability'=> 'edit_theme_options',\n\t\t)\n\t );\n\n\t $wp_customize->add_control ( new WP_Customize_Control( $wp_customize,\n\t \t'mytheme_carousel_pagelinktitle_two',//Set a unique ID for the control\n\t\tarray(\n\t\t \n\t\t\t'label'=> __('Carousel page link title', 'Claremont Theme'),\n\t\t\t'type'=>'text',\n\t\t\t'section'=> 'mytheme_options_two',//ID of the section this control renders \n\t\t\t'settings'=>'mytheme_options_two[carousel_pagelink_title_two]',//ID of the setting\n\t\t\t)\t\t\t\t\t \n\t ));\n \n }", "public function build_carousel($simpleResponseText, $items) {\n\t $this->build_simpleResponse($simpleResponseText, $simpleResponseText);\n\t $carousel = array(\n\t \t\t'carouselSelect' => array(\n\t\t\t 'items' => $items\n\t\t )\n\t );\n\t $this->items[] = $carousel;\n }", "public function init( $opts ) {\r\n $atts = array(\r\n 'posts_style' => '',\r\n 'posts_limit' => 5,\r\n 'posts_category' => '',\r\n 'read_more_text' => esc_html__( 'Read more', 'myhome-core' ),\r\n 'owl_visible' \t => 'owl-carousel--visible-3',\r\n 'owl_dots' \t => ''\r\n );\r\n if ( function_exists( 'vc_map_get_attributes' ) ) {\r\n $atts = array_merge( $atts, vc_map_get_attributes( 'mh_carousel_post', $opts ) );\r\n }\r\n\r\n\t $args = array(\r\n\t\t 'ignore_sticky_posts' => true,\r\n\t\t 'posts_per_page' => intval( $atts['posts_limit'] ),\r\n\t );\r\n\t $posts_category = intval( $atts['posts_category'] );\r\n\t if ( $posts_category ) {\r\n\t \t$args['category'] = $posts_category;\r\n\t }\r\n\r\n\t if ( ! empty( My_Home_Core()->lang ) ) {\r\n\t $args['suppress_filters'] = 0;\r\n }\r\n\r\n\t $carousel_posts = get_posts( $args );\r\n $class = $atts['owl_visible'] . ' ' . $atts['owl_dots'];\r\n ob_start();\r\n\r\n global $post;\r\n ?>\r\n\t\t<div class=\"owl-carousel <?php echo esc_attr( $class ); ?>\">\r\n\t <?php foreach ( $carousel_posts as $post ) : setup_postdata( $post ); ?>\r\n\t\t\t\t<article\r\n <?php post_class( 'mh-post-grid mh-post-grid--img-absolute '\r\n . $atts['posts_style'] ); ?>>\r\n\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\"\r\n\t\t\t\t\t title=\"<?php the_title_attribute(); ?>\"\r\n\t\t\t\t\t class=\"mh-post-grid__thumbnail\">\r\n\t\t\t\t\t\t<?php if ( has_post_thumbnail() ) : ?>\r\n\t\t\t\t\t\t\t<span class=\"mh-thumbnail__inner \">\r\n\t\t\t\t\t\t\t\t<?php My_Home_Image::the_image( get_post_thumbnail_id(), 'standard', get_the_title() ); ?>\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t<span class=\"mh-caption\">\r\n\t\t\t\t\t\t\t\t<span class=\"mh-caption__inner\"><?php echo esc_html( get_the_date( 'j F Y' ) ); ?></span>\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t<?php endif; ?>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t\t<div class=\"mh-post-grid__inner\">\r\n\t\t\t\t\t\t<h3 class=\"mh-post-grid__heading\">\r\n\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title_attribute(); ?>\">\r\n\t\t\t\t\t\t\t\t<?php echo esc_html( get_the_title() ); ?>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</h3>\r\n\t\t\t\t\t\t<div class=\"mh-post-grid__excerpt\">\r\n\t\t\t\t\t\t\t<?php echo esc_html( wp_trim_words( get_the_excerpt() , 35, '...' ) ); ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div class=\"mh-post-grid__btn-wrapper\">\r\n\t\t\t\t\t\t\t<a href=\"<?php the_permalink(); ?>\" title=\"<?php the_title_attribute(); ?>\"\r\n class=\"mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--primary-ghost\">\r\n\t\t\t\t\t\t\t\t<?php echo esc_html( $atts['read_more_text'] ); ?>\r\n\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</article>\r\n\t <?php endforeach; ?>\r\n\t </div>\r\n\t <?php\r\n wp_reset_postdata();\r\n return ob_get_clean();\r\n }", "static function add_slides(): void {\r\n self::add_acf_field(self::slides, [\r\n 'label' => 'Slides',\r\n 'min' => 1,\r\n 'max' => 4,\r\n 'layout' => 'row',\r\n 'collapsed' => '',\r\n 'type' => 'repeater',\r\n 'instructions' => 'These are the slides on the front page. These will only display if the slider is set to Medium Big Grid Slide. You can choose one or two slides.',\r\n 'required' => 1,\r\n 'conditional_logic' => 0,\r\n 'button_label' => 'Add slide',\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n ]);\r\n }" ]
[ "0.60323757", "0.59554535", "0.591349", "0.578085", "0.573027", "0.5709064", "0.5656739", "0.5617786", "0.56157786", "0.5577424", "0.5518481", "0.5480065", "0.54679817", "0.54305947", "0.5398047", "0.5381028", "0.53389555", "0.5317667", "0.531598", "0.5300458", "0.5269823", "0.52648425", "0.52375406", "0.5207833", "0.5200763", "0.5169478", "0.5167102", "0.51653296", "0.5158135", "0.51270497" ]
0.6740586
0
add_child Registers (and stores) another modular post object as a child of this one, so that all ModularPosts are published together when the parent is published.
function add_child( $child ) { if( $child instanceof ModularPost ) { $this->children[] = $child; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addChild(self $child): void\n\t{\n\t\tif (!$this->children->contains($child)) {\n\t\t\t// ...and assign it to collection\n\t\t\t$this->children->add($child);\n\t\t}\n\t}", "public function add_child($child) {\n\t\t$this->children[] = $child;\n\t}", "public function add($child) {\n $this->children[] = $child;\n }", "public function addChild($child)\r\n\t{\r\n\t\t$this->last = $child->last;\r\n\r\n\t\t$this->entries []= $child;\r\n\t}", "public function addChild(Node $child);", "public function addChild(Node $child)\n {\n $this->children[] = $child;\n }", "public function addChild(self $child): self\n {\n $this->children[] = $child;\n\n return $this;\n }", "public function addChild(object $child): self\n {\n $this->children->add($child);\n\n return $this;\n }", "public function add_child(\\WP_Comment $child)\n {\n }", "public function addChild(pdoMap_Core_XML_Node $child) {\n $this->__childs[] = $child;\n // echo 'Add child '.$this->getName().'.'.$child->getName().'<br />';\n }", "public function add($child, $type = null, array $options = array());", "protected function append($child): void\n {\n $this->children[] = $child;\n }", "function create_children_custom_post() {\n register_post_type( 'children',\n array(\n 'labels' => array(\n 'name' => __( 'Children' ),\n 'singular_name' => __( 'Child' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n )\n ));\n}", "public function add_child(SBBCodeParser_Node $child)\r\n\t{\r\n\t\t$this->children[] = $child;\r\n\t\t$child->set_parent($this);\r\n\t}", "public function add($child)\r\n {\r\n if ($child instanceof tag) {\r\n if ($child->id && array_key_exists($child->id,$this->ref)) {\r\n return $this->ref[$child->id]; \r\n }\r\n $child->tagdep = abs($this->tagdep) + 1;\r\n $this->tagdep = abs($this->tagdep) * -1;\r\n }\r\n //Append child to childs repo\r\n $this->childs[] = $child;\r\n //If child isn't object return $this tag\r\n if (!is_object($child)) {\r\n return $this;\r\n }\r\n if ($child->id) {\r\n $this->ref[$child->id] =& $child;\r\n }\r\n $child->parent =& $this;\r\n return $child;\r\n }", "public function addChild(ModelInterface $child, $placeholder = null, $append = false);", "public function addChild(EntityInterface $child, $position = null);", "function addChild($key, IBabylonModel $child) : IBabylonModel;", "public function addChild(ThemeMenuItem $child)\n {\n }", "public function addChild(Node $child) {\n return $this->root->addChild($child);\n }", "function addChild($name) {\n\t\tarray_push($this->childrens, $name);\n\t}", "function addChild( $node )\n\t\t{\n\t\t$this->childs[] = $node ;\n\t\t}", "public function addChildNode( SimpleXMLElement $oChild ) \n\t\t{\n\t\t\t$oParentDOM = dom_import_simplexml( $this );\n\t\t\t$oChildDOM = dom_import_simplexml( $oChild );\n\t\t\t$oNewParentDOM = $oParentDOM->ownerDocument->importNode( $oChildDOM, true );\n\t\t\t$oParentDOM->appendChild( $oNewParentDOM );\n\t\t\n\t\t}", "public function addChildNode(\\F3\\Fluid\\Core\\Parser\\SyntaxTree\\NodeInterface $childNode);", "function publish( $parent_id = null, $post_status = null ) {\n\n\t\tglobal $wpdb;\n\t\tglobal $src_hash;\n\n\t\t// Add parent ID if specified\n\t\tif( $parent_id ) {\n\t\t\t$this->post[ 'post_parent' ] = $parent_id;\n\t\t}\n\t\t\n\t\t$this->post[ 'post_status' ] = $post_status ? $post_status : 'publish';\n\n\t\t// Create post\n\t\t$new_id = wp_insert_post( $this->post );\n\t\tif( ! $new_id ) {\n\t\t\tdie( 'Failed to insert post.' );\n\t\t}\n\n\t\t// Add template if specified\n\t\tif( 'page' == $this->post['post_type'] && $this->post_template ) {\n\t\t\tupdate_post_meta( $new_id, '_wp_page_template', $this->post_template );\n\t\t}\n\n\t\t// Add subsite root if specified\n\t\tif( $this->is_subsite_root ) {\n\t\t\tupdate_post_meta( $new_id, 'subsite_root', 1 );\n\t\t}\n\n\t\t// ACF gives every modular page a 'modules' key that corresponds to a list\n\t\t// of included modules types (or in ACF terms, layouts) in the order they\n\t\t// appear on the page.\n\t\tupdate_post_meta( $new_id, 'modules', $this->module_list );\n\t\tupdate_post_meta( $new_id, '_modules', 'field_524b16d70ce72' );\n\n\t\t// Loop through the modules, adding postmeta in the same format ACF would.\n\t\tforeach( $this->modules as $index=>$module ) {\n\n\t\t\t// Do any necessary setup (i.e. download images)\n\t\t\t$module->before_publish( $new_id );\n\n\t\t\t// Fetch postmeta for module\n\t\t\t$postmeta_rows = $module->get_postmeta_rows( $index );\n\n\t\t\t// Update in database\n\t\t\tforeach( $postmeta_rows as $key => $value ) {\n\t\t\t\tupdate_post_meta( $new_id, $key, $value );\n\t\t\t}\n\n\t\t}\n\n\t\tif( ! empty( $this->featured_image ) ) {\n\n\t\t\t// Get media ID\n\t\t\tif( $this->featured_image instanceof I2M_Module__image ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id();\n\t\t\t}\n\t\t\telse if( $this->featured_image instanceof I2M_Module__slideshow ){\n\t\t\t\t$thumbnail_id = $this->featured_image->get_media_id( $this->featured_image_slide );\n\t\t\t}\n\n\t\t\t// Set\n\t\t\tif( $thumbnail_id ){\n\t\t\t\tupdate_post_meta( $new_id, '_thumbnail_id', $thumbnail_id );\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"Error: Failed to update featured image for post \" . $new_id . \".<br />\";\n\t\t\t}\n\t\t}\n\n\t\t// Loop through and publish children\n\t\tforeach( $this->children as $child ) {\n\t\t\t$child->publish( $new_id );\n\t\t}\n\n\t\treturn $new_id;\n\n\t}", "public function addChildDocument(SolrInputDocument $child) {}", "public function AddChildElement(IElement $child)\r\n {\r\n $this->Children[] = $child->Render();\r\n }", "abstract public function addItemChild($itemName, $childName);", "public function add($child, $name = false) {\n\t\tif( $name ) {\n\t\t\t$this->childs[$name] = $child;\n\t\t} else {\n\t\t\t$this->childs[] = $child;\n\t\t}\n\t\treturn $this;\n\t}", "public function addChild(CategoryTreeNodeInterface $child);" ]
[ "0.6878146", "0.6753129", "0.67298603", "0.6534231", "0.6471426", "0.6387882", "0.6284903", "0.62809867", "0.61824405", "0.60927105", "0.6074885", "0.60194635", "0.5958614", "0.59482145", "0.59363043", "0.5885069", "0.5878206", "0.5798835", "0.5719506", "0.5694451", "0.5642159", "0.56403416", "0.56315184", "0.56263596", "0.562502", "0.56215197", "0.5612969", "0.5608004", "0.55938977", "0.5547456" ]
0.80680364
0
set_subsite_root Sets this post as the subsite root. If set, headers on child posts will inherit the title of this post.
function set_subsite_root() { $this->is_subsite_root = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRootContentType ($content_type) {\r\n $this->_rootContentType = $content_type;\r\n }", "private function applySubsiteTheme()\n {\n if (class_exists('Subsite')) {\n $config = $this->get_config();\n if ($config->SubsiteID) {\n $subsite = DataObject::get_by_id(\"Subsite\", $config->SubsiteID);\n if ($subsite && $subsite->exists() && $subsite->Theme) {\n Config::inst()->update(\"SSViewer\", \"theme\", $subsite->Theme);\n }\n }\n }\n }", "public function setRoot($root)\n {\n $this->root = $root;\n }", "public static function setRoot($prm_isroot=false)\n\t{\n global $application_is_root;\n $application_is_root = $prm_isroot;\n\t}", "public function set_pub_title( $post ){\n\t\t\n\t\t$this->pub_title = $post->post_title;\n\t\t\n\t}", "public function set_pub_subtitle( $post_meta ){\n\t\t\n\t\t$subtitle = ( ! empty( $post_meta['_cwpp_subtitle'] ) )? $post_meta['_cwpp_subtitle'][0] : '';\n\t\t\n\t\t$this->pub_subtitle = $subtitle;\n\t\t\n\t}", "public function setRoot($root)\n {\n $value = trim($root, '/');\n if ($value) {\n $value = '/' . $value;\n }\n $this->env['SCRIPT_NAME'] = $value;\n return $this;\n }", "public function setTitle($title) {\n\t\tTemplate::setSiteTitle($title);\n\t}", "function ua_webtide_resources_set_main_subheader( $subheader ) {\n\t//return get_post_meta( $jobs_page_post->ID, 'page_subheader', true );\n\treturn $subheader;\n}", "protected function setPageTitle($title, $raw = false)\n {\n $this->data[\"site\"][\"page_title\"] = $raw ? $title : config(\"site_name\") . \" - \" . $title;\n }", "public function removeSubsiteFromMenu()\n {\n if (SubsiteHelper::currentSubsiteID()) {\n CMSMenu::remove_menu_item('SilverStripe-Subsites-Admin-SubsiteAdmin');\n }\n }", "function set_root ($root)\n {\n $this->mPath = realpath($root) . '/';\n }", "public function set_pagetitle($title)\n {\n $this->pagetitle = $title;\n }", "public function setSubdomain($subdomain)\n {\n $this->subdomain = $subdomain;\n }", "function switch_site() {\n // confirm whether this is the main site, if not switch over to it\n if ( MAIN_SITE != \"\" ) {\n switch_to_blog( MAIN_SITE );\n }\n}", "public static function setDocRoot($docRoot = '')\n {\n self::$isDocRootSet = true;\n if ($docRoot) {\n $_SERVER['DOCUMENT_ROOT'] = $docRoot;\n } elseif (isset($_SERVER['SERVER_SOFTWARE'])\n && 0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/')) {\n $_SERVER['DOCUMENT_ROOT'] = substr(\n $_SERVER['SCRIPT_FILENAME']\n ,0\n ,strlen($_SERVER['SCRIPT_FILENAME']) - strlen($_SERVER['SCRIPT_NAME']));\n $_SERVER['DOCUMENT_ROOT'] = rtrim($_SERVER['DOCUMENT_ROOT'], '\\\\');\n }\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 set_root($root)\r\n\t{\r\n\t\tif (empty($root)) return;\r\n\t\tif (!is_dir($root))\r\n\t\t{\r\n\t\t\t$this->error(\"phemplate::set_root(): $root is not a directory.\", 'warning');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->root = $root;\r\n\t\treturn true;\r\n\t}", "public function withSubpage(string $title = null)\n {\n if (empty($this->admin_page)) {\n return $this;\n }\n $admin_page = $this->admin_page[0];\n\n $sub_page = array(\n [\n 'parent_slug' => $admin_page[\"menu_slug\"],\n 'page_title' => $admin_page[\"page_title\"],\n 'menu_title' => ($title) ? $title : $admin_page[\"menu_title\"],\n 'capability' => $admin_page[\"capability\"],\n 'menu_slug' => $admin_page[\"menu_slug\"],\n 'callback' => $admin_page[\"callback\"]\n\n ],\n );\n $this->admin_subpages = $sub_page;\n return $this;\n }", "public static function setRootPath($root_path)\n {\n self::$_autoloadRootPath = $root_path;\n }", "private function register_subdomain() {\n\t$host = $_SERVER['HTTP_HOST'];\n\tif ($this->config->base_domain) $this->subdomain = preg_replace('/\\.'.$this->config->base_domain.'$/i', '', $host);\n\telse {\n\t\t$parts = explode('.', $host);\n\t\t// we're going to assume a single level tld, like .com, rather than a multi level tld, like .co.uk\n\t\tarray_pop($parts);\n\t\tarray_pop($parts);\n\t\t$this->subdomain = implode('.', $parts);\n\t}\n\tif (self::$force_www && !$this->subdomain) $this->subdomain = 'www';\n}", "function tsd_change_post_subtitle_meta_key() {\n return \"post_subtitle\";\n}", "public function setSiteThemeBasepath($site_theme_basepath)\n {\n $this->site_theme_basepath = $site_theme_basepath;\n }", "public static function setRootPath($root_path)\r\n {\r\n self::$_autoloadRootPath = $root_path;\r\n }", "public function setBodyTitle($title)\n\t{\n\t\t$this->_pageData['data']['title'] = $title;\n\t}", "public static function menu_subpage_settings(){\n \t\t\n\t\t\tadd_submenu_page('edit.php?post_type='.self::$post_type, \n\t\t\t\t\t\t\t self::$page_title_settings, \n\t\t\t\t\t\t\t 'Settings', \n\t\t\t\t\t\t\t self::$capability,\n\t\t\t\t\t\t\t 'menu_settings',\n array( __CLASS__, 'menu_generator_settings'));\n\t\t\n\t\t}", "function set_subtitle($subtitle) \r\n\t{\r\n\t\t//$this->subtitle = $subtitle;\r\n\t\t$this->data['subtitle_for_layout'] = $subtitle;\r\n\t\t$this;\r\n\t}", "public static function pf_subpagetitle( &$parser /* , $title = null */ ) {\n\t\t$t = self::newTitleObject( $parser, func_get_args() );\n\t\tif ( $t === null ) {\n\t\t\treturn ''; // invalid title given\n\t\t}\n\t\treturn wfEscapeWikiText( SubpageInfo::getSubpageTitle( $t ) );\n\t}", "function register_block_core_site_title()\n {\n }", "private function create_site_root() {\n\n\t\tif ( is_dir( $this->site_root ) ) {\n\t\t\tEE::error( \"Webroot directory for site $this->site_name already exists.\" );\n\t\t}\n\n\t\tif ( ! \\EE\\Utils\\default_launch( \"mkdir $this->site_root\" ) ) {\n\t\t\tEE::error( \"Cannot create directory $this->site_root. Please check that folder permission allows easyengine to create directory there.\" );\n\t\t}\n\n\t\ttry {\n\t\t\t$this->level = 1;\n\t\t\t$whoami = EE::launch( \"whoami\", false, true );\n\n\t\t\t$terminal_username = rtrim( $whoami->stdout );\n\n\t\t\tif ( ! chown( $this->site_root, $terminal_username ) ) {\n\t\t\t\tthrow new Exception( 'Could not change ownership of the site root. Please make sure you have appropriate rights.' );\n\t\t\t}\n\t\t}\n\t\tcatch ( Exception $e ) {\n\t\t\t$this->catch_clean( $e );\n\t\t}\n\n\t\treturn true;\n\t}" ]
[ "0.5275777", "0.5143665", "0.50856966", "0.50167215", "0.4925443", "0.48494148", "0.4826631", "0.48106274", "0.47946453", "0.47863272", "0.47640988", "0.47538662", "0.47415182", "0.46758607", "0.46637848", "0.46567982", "0.4651777", "0.4597022", "0.4581904", "0.45790532", "0.45745587", "0.4569047", "0.4568014", "0.456249", "0.4539189", "0.45191902", "0.44982034", "0.4456613", "0.4454326", "0.44402725" ]
0.7612973
0
Require (once) all migration files for the supplied module.
protected function requireMigrations($module) { $path = $this->getMigrationPath($module); $migrations = $this->laravel['files']->glob($path . '*_*.php'); foreach ($migrations as $migration) { $this->laravel['files']->requireOnce($migration); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function migrate() \n {\n\n Masteryl_Migration::createOrUpdateDir(MASTERYL_MIGRATIONS_PATH, $this);\n\n if(!empty($this->modules)) {\n foreach($this->modules as $mod) {\n $dir = $mod['path'].'migrations';\n \n if(file_exists($dir))\n Masteryl_Migration::createOrUpdateDir($dir, $this);\n }\n }\n\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "protected function loadMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }", "private function setupMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "private function loadMigrations(): void\n {\n $custom_migrations = config('invite-codes.custom_migrations', false);\n\n if ($custom_migrations) {\n $this->loadMigrationsFrom(database_path('migrations/vendor/junges/invite-codes'));\n } else {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n $this->publishes([\n __DIR__.'/../database/migrations' => database_path('migrations/vendor/junges/invite-codes'),\n ], 'invite-codes-migrations');\n }", "private function registerMigrations()\n {\n $this->loadMigrationsFrom($this->migrations);\n }", "protected function registerMigrations(): void\n {\n if (Satifest::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n return;\n }\n }", "private function autoloadFiles($module)\n {\n if (isset($module['autoload'])) {\n foreach ($module['autoload'] as $file) {\n $path = poppy_path($module['slug'], $file);\n if (file_exists($path)) {\n include $path;\n }\n }\n }\n }", "public function loadMigrationFromModules()\n {\n $paths = [];\n if (!$this->modules) {\n return $paths;\n }\n $modulesCollection = collect($this->modules);\n $activeModules = $modulesCollection->get(self::MODULE_VERSION);\n\n foreach ($activeModules as $key => $moduleName) {\n $paths[] = $this->path . DIRECTORY_SEPARATOR . self::MODULE_VERSION . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'Database' . DIRECTORY_SEPARATOR . 'Migrations';\n }\n\n return $paths;\n }", "public function publishModulesMigrationsFiles()\n {\n foreach (ModulesConfig::getModulesNames() as $moduleName) {\n $this->publishModuleMigrationsFiles($moduleName);\n }\n }", "protected function getMigrations()\n {\n $finder = new Finder();\n $files = $finder->files()\n ->name('*table.php')\n ->notName('2014*')\n ->in(database_path() . '/migrations');\n\n foreach ($files as $file) {\n $this->migrations[] = $file->getRealPath() ;\n }\n }", "private function _populateMigrationTable()\n\t{\n\t\t$migrations = array();\n\n\t\t// Add the base one.\n\t\t$migration = new MigrationRecord();\n\t\t$migration->version = craft()->migrations->getBaseMigration();\n\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\t\t$migrations[] = $migration;\n\n\t\t$migrationsFolder = craft()->path->getAppPath().'migrations/';\n\t\t$migrationFiles = IOHelper::getFolderContents($migrationsFolder, false, \"(m(\\d{6}_\\d{6})_.*?)\\.php\");\n\n\t\tif ($migrationFiles)\n\t\t{\n\t\t\tforeach ($migrationFiles as $file)\n\t\t\t{\n\t\t\t\tif (IOHelper::fileExists($file))\n\t\t\t\t{\n\t\t\t\t\t$migration = new MigrationRecord();\n\t\t\t\t\t$migration->version = IOHelper::getFileName($file, false);\n\t\t\t\t\t$migration->applyTime = DateTimeHelper::currentUTCDateTime();\n\n\t\t\t\t\t$migrations[] = $migration;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach ($migrations as $migration)\n\t\t\t{\n\t\t\t\tif (!$migration->save())\n\t\t\t\t{\n\t\t\t\t\tCraft::log('Could not populate the migration table.', LogLevel::Error);\n\t\t\t\t\tthrow new Exception(Craft::t('There was a problem saving to the migrations table: ').$this->_getFlattenedErrors($migration->getErrors()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCraft::log('Migration table populated successfully.');\n\t}", "public function migrate($path = __DIR__ . \"/Resource/migrations\")\n {\n $fileSystem = new Filesystem;\n\n foreach ($fileSystem->files($path) as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $this->findClass($file);\n\n (new $migrationClass)->up();\n }\n }", "protected function registerMigrations()\n {\n if (PeriodicNoticeManager::$runsMigrations) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');\n }", "public function applyMigration()\n {\n $this->createMigrationsTable();\n $applied_migrations = $this->get_applied_migrations();\n\n $files = scandir(Application::$ROOT_DIR.'/migrations');\n $to_apply_migrations = array_diff($files, $applied_migrations);\n\n $new_migrations = [];\n\n foreach ($to_apply_migrations as $migration) {\n // skip unwanted folders\n if ($migration === '.' || $migration === '..') {\n continue;\n }\n require_once Application::$ROOT_DIR.'/migrations/'.$migration;\n\n $class_name = pathinfo($migration, PATHINFO_FILENAME);\n $instance = new $class_name();\n $instance->up();\n\n $new_migrations[] = $migration;\n }\n\n if (!empty($new_migrations)) {\n $this->saveMigration($new_migrations);\n }\n else {\n echo $this->log(\"All migrations are applied\");\n }\n }", "function runUp()\n{\n $files = scandir(LIB_ROOT . '/migrations');\n\n $db_migration_version = get_current_migration_version();\n\n $migrations = array();\n\n foreach($files as $file)\n {\n if(preg_match('/migration_([1-9][0-9]*)\\.php/i', $file, $matches))\n {\n $migration_version = $matches[1];\n\n // we only care about this migration if it has not been performed yet\n if($migration_version > $db_migration_version)\n {\n require_once LIB_ROOT . '/migrations/' . $matches[0];\n\n $migrations[$migration_version] = 'Migration_' . $migration_version;\n }\n }\n }\n\n if(count($migrations) == 0)\n echo 'There are no migrations to run; DB is already up to date (at version ' . $db_migration_version . ').' . \"\\n\\n\";\n else\n {\n // sort migrations, so that we execute them in ascending order\n ksort($migrations);\n\n $count = 0;\n\n foreach ($migrations as $id => $class_name)\n {\n $migrationClass = new $class_name();\n\n $count++;\n\n echo 'Running migration ' . $id . ' (' . $count . ' of ' . count($migrations) . ')...' . \"\\n\";\n\n try\n {\n $migrationClass->Up();\n fetch_none('UPDATE migration_version SET version=' . quote_smart($id));\n echo ' done!' . \"\\n\";\n }\n catch(Exception $e)\n {\n echo ' Encountered an exception during migration:' . \"\\n\";\n echo ' ' . $e->getMessage() . \"\\n\";\n echo ' Migration was not completed; the database may be left in a weird state.' . \"\\n\";\n if($count < count($migrations))\n {\n $remaining = (count($migrations) - $count);\n echo $remaining . ' remaining migration' . ($remaining == 1 ? '' : 's') . ' will not be run.' . \"\\n\";\n }\n echo \"\\n\";\n die();\n }\n }\n\n echo 'All done!' . \"\\n\\n\";\n }\n}", "public function requireMigrationFiles($file)\r\n\t{\r\n\t\trequire_once($this->migrationFiles . $file);\r\n\t\t$line = $this->sanitizedName($this->removeDotPhp($file));\r\n\t\t$data = $$line;\r\n\t\treturn $data;\r\n\t}", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "protected function registerMigrations()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n }", "protected static function addModuleConfigurationsToDb()\n {\n static::_addMainConfigurationEntries();\n static::_addCredentialsConfigurationEntries();\n static::_addTransactionsConfigurationEntries();\n static::_addWpfConfigurationEntries();\n static::_addOrderConfigurationEntries();\n static::_addThreedsOptions();\n static::_addScaExemptionOptions();\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "private function handleMigrations()\n {\n $this->loadMigrationsFrom(__DIR__.'/Migrations');\n\n // Optional: Publish the migrations:\n $this->publishes([\n __DIR__ . '/Migrations' => base_path('database/migrations'),\n ]);\n }", "protected function registerMigrations()\n {\n if (TwilioVerify::$runsMigrations && $this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n }\n }", "function migrate_seed(){\n\n // Pull in Seed Service Provider\n // Loop in the contents of the file specified in the Service provider\n // Run Insert query.\n\n $seedFiles = require BASEPATH.\"/migration/SeedServiceProvider.php\";\n\n //Loop the files\n foreach ( $seedFiles as $file ){\n\n $seeds = require BASEPATH . \"/migration/seed/{$file}.php\";\n\n //Loop In table for insertion\n foreach( $seeds as $table_name => $data ){\n\n insert( $table_name, $data );\n\n }\n\n }\n\n}", "public function ensureDbModuleCompat() {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('ensureDbModuleCompat', func_get_args()));\n }", "protected function defineDatabaseMigrations()\n {\n $this->loadMigrationsFrom(realpath(__DIR__.'/../database/migrations'));\n\n $this->artisan('migrate', ['--database' => 'testbench'])->run();\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback', ['--database' => 'testbench'])->run();\n });\n }", "private function require_files() {\n\t\tif ( file_exists( ABSPATH . '/wp-admin/includes/screen.php' ) ) {\n\t\t\tinclude_once ABSPATH . '/wp-admin/includes/screen.php';\n\t\t}\n\t\tinclude_once ABSPATH . '/wp-admin/includes/template.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/misc.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/class-wp-upgrader.php';\n\t\tinclude_once ABSPATH . '/wp-admin/includes/plugin.php';\n\t}", "protected function registerMigrations()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');\n }\n }", "public function initialize() {\n\t\t//$files = glob( '*.php' );\n\t\t//\n\t\t//if( ! is_array( $files ) ) {\n\t\t//\t// Error when enumerating files, can't do anything about it at this point.\n\t\t//\treturn;\n\t\t//}\n\t\t//\n\t\t//foreach( $files as $file ) {\n\t\t//\trequire_once $file;\n\t\t//}\n\n\t\tif( apply_filters( 'toolset_is_m2m_enabled', false ) ) {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/m2m.php';\n\t\t} else {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/legacy_relationships.php';\n\t\t}\n\t}" ]
[ "0.68078274", "0.663604", "0.6609619", "0.6483795", "0.6061468", "0.6035795", "0.6015691", "0.596113", "0.5951953", "0.59339964", "0.5922177", "0.5913617", "0.58970535", "0.58704877", "0.58515316", "0.58139616", "0.58044016", "0.5756215", "0.574642", "0.57312745", "0.5720909", "0.5711472", "0.5709818", "0.56639236", "0.56464624", "0.5623892", "0.5586355", "0.5571364", "0.5559119", "0.5547343" ]
0.7920751
0
Retrieve left navigation html
protected function _getLeftNavHtml() { if ($this->_request->getFullActionName() == self::CATEGORY_VIEW_ACTION_NAME) { return $this->_layout->getBlock($this->_vars['catalog_left_navigation_block'])->toHtml(); } elseif ($this->_request->getFullActionName() == self::CATALOG_SEARCH_ACTION_NAME) { return $this->_layout->getBlock($this->_vars['catalogsearch_left_navigation_block'])->toHtml(); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function leftNavPanel() {\r\n\t\tprint file_get_contents('html/leftnav.html');\r\n\t}", "public function LeftNavigation() {\n\t\t$pageId = (isset($_GET['page'])) ? (int)$_GET['page'] : 0;\n \n if(($page = DataObject::get_by_id('Page', $pageId))) {\n Director::set_current_page($page);\n }\n\n return $this->renderWith('LeftNavigation');\n }", "public function leftnav ()\n\t{\n\t}", "private function _getNavigation()\r\n\t{\r\n\t\t$input\t= dunloader( 'input', true );\r\n\t\t$action\t= $input->getVar( 'action', 'themes' );\r\n\t\t$task\t= $input->getVar( 'task', null );\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'themer' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action && $task != 'edittheme' ) {\r\n\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "public function leftNavigation()\n\t{\n\t\t// Build hierarchies\n\t\t$hierarchies = $this->_toHierarchies(Admin_Auth::getInstance()->getNavigation()->toArray());\n\t\t$navigation = new Zend_Navigation($hierarchies);\n\t\t$this->_menu = $this->view->navigation($navigation)->menu();\n\t\t$this->_menu->setUlClass('nav');\n\t\t\n\t\t// Get current url\n\t\t$currentUrl = rtrim(Zend_Controller_Front::getInstance ()->getRequest ()->getRequestUri (), '/');\n\t\t\n\t\t// If current url not match with list urls\n\t\tif (!($currentPage = $navigation->findOneByUri ( $currentUrl ))) \n\t\t{\n\t\t\t// Put each element into an array.\n\t\t\t$segments = explode('/', $currentUrl);\n\t\t\t$count = count($segments);\n\t\t\tif ($count === 0)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// Separate url to sub-url\n\t\t\tfor ($i = 1; $i < $count; $i++)\n\t\t\t{\n\t\t\t\t$segments[$i] = ($segments[$i - 1] . '/' . $segments[$i]);\n\t\t\t}\n\t\t\t\n\t\t\t// Reverse order\n\t\t\t$segments = array_reverse($segments);\n\t\t\t\n\t\t\t// Check for an exact match\n\t\t\tforeach ($segments as $segment)\n\t\t\t{\n\t\t\t\t// Break out of the loop, we've found an exact match;\n\t\t\t\tif ($currentPage = $navigation->findOneByUri ( $segment ))\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($currentPage instanceof Zend_Navigation_Page_Uri)\n\t\t{\n\t\t // Set active\n\t\t $currentPage->setActive ( true );\n\t\t \t\n\t\t // Set active flag for own parent\n\t\t $currentPage = $currentPage->getParent ();\n\t\t while ( $currentPage instanceof Zend_Navigation_Page_Uri )\n\t\t {\n\t\t $currentPage->setActive ( true );\n\t\t $currentPage = $currentPage->getParent ();\n\t\t }\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "private function left_menu()\n\t\t{\n\t\t\t $page_name = functions::get_page_name();\n\t\t\techo '\n\t\t\t\t<ul>\n\t\t\t\t\t';\n\t\t\t\t\t\n\t\t\t\t\t$content_module = array('manage_content.php', 'register_content.php', 'manage_page_content.php', 'register_page_content.php','manage_content_option.php', 'register_content_option.php'\n\t\t\t\t\t,'manage_category.php', 'register_category.php');\n\t\t\t\t\tif(in_array($page_name, $content_module))\n\t\t\t\t\t{\n\t\t\t\t\t\techo '\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t<img src=\"images/icon-content.png\" alt=\"Manage CMS\" title=\"Manage CMS\" width=\"24\" height=\"24\" />\n\t\t\t\t\t\t<a href=\"manage_content.php\">CMS</a>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li><a href=\"manage_page_content.php\">Page Content</a></li>\n\t\t\t\t\t\t<li><a href=\"manage_category.php\">Category</a></li>\n\t\t\t\t\t\t\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>';\n\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\techo '<li><img src=\"images/icon-content.png\" alt=\"Manage CMS\" title=\"Manage CMS\" width=\"24\" height=\"24\" /><a href=\"manage_content.php\" >CMS</a></li>';\n\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\techo '<li><img src=\"images/icon-member.png\" alt=\"Manage Member\" title=\"Manage Member\" width=\"24\" height=\"24\" /><a href=\"manage_member.php\" >Member</a></li>\n\t\t\t\t\t<!--<li><img src=\"images/icon-property.png\" alt=\"Manage Property Type\" title=\"Manage Property Type\" width=\"24\" height=\"24\" /><a href=\"manage_property_type.php\" >Property Type</a></li>-->\n\t\t\t\t\t\n\t\t\t\t\t<li><img src=\"images/icon-property.png\" alt=\"Manage Hotel\" title=\"Manage Hotel\" width=\"24\" height=\"24\" /><a href=\"manage_hotel.php\" >Hotel</a></li>\n\t\t\t\t\t<li><img src=\"images/icon-restaurant.jpg\" alt=\"Manage Restaurant\" title=\"Manage Restaurant\" width=\"24\" height=\"24\" /><a href=\"manage_restaurant.php\" >Restaurant</a></li>\n\t\t\t\t\t<li><img src=\"images/icon-venue.png\" alt=\"Manage Venue\" title=\"Manage Venue\" width=\"24\" height=\"24\" /><a href=\"manage_venue.php\" >Venue</a></li>\n\t\t\t\t\t';\n\t\t\t\t\t\t\n\t\techo '</ul>';\n\t\t\t\t\t\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\t\n\t\t}", "private function _getNavigation()\r\n\t{\r\n\t\tglobal $action, $whmcs;\r\n\t\t\r\n\t\t$uri\t= DunUri :: getInstance('SERVER', true );\r\n\t\t$uri->delVar( 'task' );\r\n\t\t$uri->delVar( 'submit' );\r\n\t\t\r\n\t\t$html\t= '<ul class=\"nav nav-pills\">';\r\n\t\t\r\n\t\tforeach( array( 'themes', 'config', 'license' ) as $item ) {\r\n\t\t\t\r\n\t\t\tif ( $item == $action ) {\r\n\t\t\t\tif ( array_key_exists( 'task', $whmcs->input ) ) {\r\n\t\t\t\t\tif ( $whmcs->input['task'] != 'edittheme' ) {\r\n\t\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$html .= '<li class=\"active\"><a href=\"#\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t$html .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'themer.admin.module.navbar.' . $item ) . '</a></li>';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$html\t.= '</ul>';\r\n\t\treturn $html;\r\n\t}", "function displayNav() {\n\t\t\n\t\t$menu = getList(0);\n\t\t$count = 1;\n\t\t$nav = preg_replace('/xx/', 'nav', $menu, $count);\n\t\treturn $nav;\n\t\t\n\t\t\n\t}", "public function renderNav() {\n if($this->renderNav['onoff']) {\n \n if(isset($this->renderNav['html']) && $this->renderNav['html']) {\n $content = $this->renderNav['html'];\n unset($this->renderNav['html']);\n } else {\n $ct['btnAddNav'] = $this->btnAddNav;\n $ct['btnAddMultiNav'] = $this->btnAddMultiNav;\n $ct['btnDeleteNav'] = $this->btnDeleteNav;\n $ct['btnCopyNav'] = $this->btnCopyNav;\n $result = '';\n $get = r()->get();\n foreach($ct as $key => $item) {\n if($item && isset($item['onoff']) && $item['onoff']) {\n unset($item['onoff']);\n if(isset($item['href'])) {\n $href = $item['href'];\n unset($item['href']);\n } else {\n $params = isset($get['SettingsGridSearch']['table_id']) ? $get : [];\n $params['menu_admin_id'] = $this->menu_admin_id;\n $href = UtilityUrl::createUrl($item['link_children'],$params);\n }\n $html = $item['icon'].$item['html'];unset($item['html']);unset($item['icon']);unset($item['link_children']);\n $result .= Html::a($html, $href, $item).' ';\n }\n }\n $content = '<div class=\"fr\">'.$result.'</div>';\n }\n unset($this->renderNav['onoff']);\n $html = Html::tag('div',$content.$this->renderNavLeft, $this->renderNav);\n return $html;\n } else {\n return '';\n }\n }", "function _getNav()\n {\n }", "public function getLeftMenu($data)\n {\n $nombre = mb_ucfirst($data['nombre']);\n $apellido = mb_ucfirst($data['apellido']);\n $perfil = mb_ucfirst($data['perfil']);\n $submenu = $this->getMainMenu($data['idPerfil']);\n $menu = \"\n <nav class=\\\"navbar-default navbar-static-side\\\" role=\\\"navigation\\\">\n <div class=\\\"sidebar-collapse\\\">\n <ul class=\\\"nav metismenu\\\" id=\\\"side-menu\\\">\n <li class=\\\"nav-header\\\">\n <div class=\\\"dropdown profile-element\\\">\n <a data-toggle=\\\"dropdown\\\" class=\\\"dropdown-toggle\\\" href=\\\"#\\\">\n <span class=\\\"clear\\\"> <span class=\\\"block m-t-xs\\\"> <strong class=\\\"font-bold\\\">$nombre $apellido</strong>\n </span> <span class=\\\"text-muted text-xs block\\\">$perfil <b class=\\\"caret\\\"></b></span> </span> </a>\n <ul class=\\\"dropdown-menu animated fadeInRight m-t-xs\\\">\n <li><a href=\\\"/inelcom/index.php\\\">Logout</a></li>\n </ul>\n </div>\n <div class=\\\"logo-element\\\">\n IN\n </div>\n </li>\n $submenu\n </ul>\n \n </div>\n </nav>\n \";\n\n return $menu;\n }", "public function viewLeftMenu()\n\t{\n\t\t$viewLevelResult\t= $this->manageLeftMenu('V', '0', '', '', '0', '0');\n\t\treturn $viewLevelResult;\n\t}", "public function getNav() \n {\n //@return : $stri_html : affichage du html de la navigation\n \n\t\t$stri_html =\"\";\n \n //**** START - navigation previous\n //si la page précédente > 1 alors affichage du lien sinon affichage du label (if previous page > 1 then put link else label)\n\t\t$stri_html .= ($this->int_page_prev > 0) ? $this->obj_a_prev->htmlValue() : $this->obj_lb_prev->htmlValue(); \n\t\t$stri_html .= \" | \";\n\t\t//**** END - navigation previous\n\t\t\n\t\t\n //**** DEBUT corps navigator\n\n // calcule le milieu pour les liens de page dans le but d'avoir la page courante au centre de la navigation (determine the middle of link to post courant page in middle)\n\t\t$int_middle = floor($this->int_limit_page / 2);\n\n\t\t// calcule la page minimum à afficher dans les liens (determine the min page)\n $minpage = (($this->int_page - $int_middle)<1) ? 1 : $this->int_page - $int_middle;\t\t\n\n // calcule la page maximum à afficher dans les liens (determine the max page)\n\t\t$maxpage = (($this->int_page + $int_middle)> $this->int_pages)? $this->int_pages : ($this->int_page + $int_middle);\n\n // pour chaque lien de navigation (post each page)\n\t\tforeach (range($minpage, $maxpage) as $i) \n {\n\t\t\tif ($i == $this->int_page) \n { \n // selected page\n $this->obj_lb_courant_page->setValue($i);\n\t\t\t\t$stri_html .= $this->obj_lb_courant_page->htmlValue(); \n\t\t\t} \n else \n {\n // other page\n $this->obj_a_page->setValue($i);\n $this->obj_a_page->setOnClick(\"document.form_page.start.value=\".$i.\";document.form_page.submit();\");\n \n\t\t\t\t$stri_html.=\" \".$this->obj_a_page->htmlValue().\" \";\n\t\t\t}\n\t\t}\n\n //**** END corps navigation\n \n \n //**** START - navigation next\n //si la page suivante <= nb de pages alors affichage du lien sinon affichage du label (if next page <= number of page then put link else label)\n\t\t$stri_html .= \" | \";\n\t\t$stri_html .= ($this->int_page_next <= $this->int_pages) ? $this->obj_a_next->htmlValue() : $this->obj_lb_next->htmlValue(); \n //**** END - navigation next\n\n\t\treturn $stri_html;\n\t}", "function showHTMLNavigationMenu() {\r\n\t// postavljamo polje sa navigacijskim linkovima\r\n\t$menu = array(\r\n\t\t'/bankomati_RTM1/index2.php' => 'Početna',\r\n\t\t'/bankomati_RTM1/bankomati/bankomati_prikaz.php' => 'Baza bankomata',\r\n\t\t'/bankomati_RTM1/punjenja/punjenja_prikaz.php' => 'Punjenje bankomata',\r\n\t\t'/bankomati_RTM1/punjenja_baza/punjenja_prikaz.php' => 'Baza punjenja'\r\n\t\t\r\n\t);\r\n\r\n\t// generiramo HTML linkove i spremamo ih u array\r\n\t$linkovi_arr = array();\r\n\tforeach ($menu as $link => $naslov) {\r\n\t\t$linkovi_arr[] = '<a href=\"' . $link . '\">' . $naslov . '</a>';\r\n\t}\r\n\r\n\t// sada prikažemo imlodirani array sa separatorima i horizontalkom za razdvajanje\r\n\techo implode(' || ', $linkovi_arr);\r\n\techo '<hr/>';\r\n}", "protected function getLeft()\n\t{\n\t\t$items = MenuDB::getMainMenu();\n\t\t$mainmenu = new MainMenu();\n\t\t$mainmenu->uri = $this->url_active;\n\t\t$mainmenu->items = $items;\n\t\tif ($this->auth_user) {\n\t\t\t$user_panel = new UserPanel(); //панель авт. юзера\n\t\t\t$user_panel->user = $this->auth_user;\n\t\t\t$user_panel->uri = $this->url_active;\n\t\t\t$user_panel->addItem(\"Редактировать профиль\", URL::get(\"editprofile\", \"user\"));\n\t\t\t$user_panel->addItem(\"Выход\", URL::get(\"logout\"));\n\t\t} else {\n\t\t\t$user_panel = \"\";\n\t\t}\n\t\t$poll_db = new PollDB();\n\t\t$poll_db->loadRandom();\n\t\tif ($poll_db->isSaved()) {\n\t\t\t$poll = new Poll();\n\t\t\t$poll->action = URL::get(\"poll\", \"\", array(\"id\" => $poll_db->id));\n\t\t\t$poll->title = $poll_db->title;\n\t\t\t$poll->data = PollDataDB::getAllOnPollID($poll_db->id);\n\t\t} else {\n\t\t\t$poll = \"\";\n\t\t}\n\n\t\treturn $user_panel . $mainmenu . $poll;\n\t}", "function template_navigation() {\n\t\t$_ENV['menu'] = array();\n\t\t$_ENV['menu']['Main'] = _URL_;\n\t\tModule::includes('menus');\n\t\t$_ENV['menu']['Preferences'] = '?module=prefs';\n\t\t$_ENV['menu']['Logout'] = '?logout=true';\n\n\t\t$buffer = '<ul><li><h2>';\n\t\t$buffer .= array_key_exists('Menu',$_ENV['imgs']['menu']) \n\t\t\t? '<img src=\"'.$_ENV['imgs']['menu']['Menu'].'\" border=\"0\" /> ' : ' ';\n\t\t$buffer .= ' Main Menu</h2><ul>';\n\t\tforeach ($_ENV['menu'] as $module => $items) {\n\t\t\tif (is_array($items)) {\n\t\t\t\t$buffer .= '<li><a href=\"#\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.'</a><ul>';\n\t\t\t\tforeach ($items as $label => $url) {\n\t\t\t\t\t$buffer .= '<li><a href=\"'.$url.'\">';\n\t\t\t\t\t$buffer .= array_key_exists($label,$_ENV['imgs']['menu'])\n\t\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$label].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t\t$buffer .= $label.'</a></li>';\n\t\t\t\t}\n\t\t\t\t$buffer .= '</ul></li>';\n\t\t\t} else {\n\t\t\t\t$buffer .= '<li><a href=\"'.$items.'\">';\n\t\t\t\t$buffer .= array_key_exists($module,$_ENV['imgs']['menu'])\n\t\t\t\t\t? '<img src=\"'.$_ENV['imgs']['menu'][$module].'\" border=\"0\" /> ' : ' ';\n\t\t\t\t$buffer .= $module.' </a></li>';\n\t\t\t}\t\n\t\t}\n\t\t$buffer .= '</ul></li></ul>';\n\t\treturn $buffer;\n\t}", "public function getMenu()\r\n {\r\n $auth = $this->session->get('auth');\r\n if ($auth) {\r\n $this->_headerMenu['navbar-right']['session'] = array(\r\n 'caption' => 'Log Out',\r\n 'action' => 'end'\r\n );\r\n } else {\r\n unset($this->_headerMenu['navbar-left']['invoices']);\r\n }\r\n\r\n $controllerName = $this->view->getControllerName();\r\n foreach ($this->_headerMenu as $position => $menu) {\r\n echo '<div class=\"nav-collapse\">';\r\n echo '<ul class=\"nav navbar-nav ', $position, '\">';\r\n foreach ($menu as $controller => $option) {\r\n if ($controllerName == $controller) {\r\n echo '<li class=\"active\">';\r\n } else {\r\n echo '<li>';\r\n }\r\n echo $this->tag->linkTo($controller . '/' . $option['action'], $option['caption']);\r\n echo '</li>';\r\n }\r\n echo '</ul>';\r\n echo '</div>';\r\n }\r\n\r\n }", "public function main_navigation(){\r\n\r\n echo \"<ul>\";\r\n\r\n if(isset($this->navigationSettings)){\r\n\r\n foreach((array) $this->navigationSettings as $key => $value){\r\n echo \"<li>\";\r\n echo \"<a href='$value'>$key</a>\";\r\n echo \"</li>\";\r\n }\r\n\r\n }\r\n\r\n echo \"</ul>\";\r\n\r\n }", "public function navigation() {\n\t\t$menu = $this->data['nav_menu'] ?: 'main_menu';\n\t\t$navi = (new Navi())->build($menu);\n\n\t\tif ($navi->isEmpty()) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn $navi->toArray();\n\t}", "public function buildNavigation()\r\n\t{\r\n\t\t$uri\t=\tDunUri :: getInstance( 'SERVER', true );\r\n\t\t$uri->delVars();\r\n\t\t$uri->setVar( 'module', 'intouch' );\r\n\t\t\r\n\t\t$data\t\t=\t'<ul class=\"nav nav-pills\">';\r\n\t\t$actions\t=\tarray( 'default', 'syscheck', 'groups', 'configure', 'updates', 'license' );\r\n\t\t\r\n\t\tforeach( $actions as $item ) {\r\n\t\t\tif ( $item == $this->action && in_array( $this->task, array( 'default', 'save' ) ) ) {\r\n\t\t\t\t$data .= '<li class=\"active\"><a href=\"#\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$uri->setVar( 'action', $item );\r\n\t\t\t\t$data .= '<li><a href=\"' . $uri->toString() . '\">' . t( 'intouch.admin.navbar.' . $item ) . '</a></li>';\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$data\t.= '</ul>';\r\n\t\treturn $data;\r\n\t}", "function getNavs() {\n\t$pageData = getPageData();\n\t$li = '';\n\tforeach($pageData as $k => $v) {\n\t\t$li .= '<li><a href=\"' . COVER_PAGE . '?show=' . $k .'\">' . $k . '</a></li>' . \"\\n\";\n\t}\n\treturn $li;\n}", "function app_template_navigation() {\n global $Auth, $App;\n $user = $Auth->get_user_data();\n $navigation = NULL;\n\n if ( ! empty($user) ) {\n $user_id = $user['is_super'] ? false : $user['user_id'];\n $Menu = new AdminMenu($user_id, $user['is_super']);\n $nav = $Menu->generate();\n $navigation = array(\n 'selector' \t=> $App->config('page_content_id'),\n 'pos_func' \t=> 'insertAfter',\n 'html'\t\t=> $nav['navigation'].$nav['search']\n );\n }\n return $navigation;\n}", "public function topMenuNavigation() {\n\t\t$out = '';\n\t\tif($modules = DataObject::get('WorkflowCategory', '', 'priority ASC')) {\n\t\t\tforeach ($modules as $module) {\n\t\t\t\tif (Permission::check(strtoupper(str_replace(\" \", \"_\", $module->name)))) {\n\t\t\t\t\t$icon = '';\n\t\t\t\t\tif($image = DataObject::get_by_id('Image', $module->imageID)) {\n\t\t\t\t\t\tif($smImage = $image->setSize(16,16)) {\n\t\t\t\t\t\t\t$icon = $smImage->URL;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$out .= \"\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: '{$module->name}', \n\t\t\t\t\t\ticon: '{$icon}',\n\t\t\t\t\t\tmenu: {$this->moduleItems($module->ID)}\n\t\t\t\t\t},\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public function get_navs()\n\t{\n\t\t return $this->db->get($this->_table['navigation'])->result();\n\n\t}", "function left_menu()\n {\n $query_string = \"SELECT * FROM menus where menu_position = 'Left' AND menu_published ='Yes' AND menu_status = 'Active'\";\n\n $items = $this->db->query($query_string);\n $left_menu_data =\"<ul>\";\n foreach ($items->result() as $row)\n {\n // $left_menu_data .= $row->menu_id;\n // $left_menu_data .= $row->menu_name;\n $left_menu_data .= '<li><a href=\"'. base_url().'index.php/Contact_Management_User/get_value/'.$row->menu_id.'\"> '.$row->menu_name.' </a></li>';\n \n }\n $left_menu_data .=\"</ul>\"; \n return $left_menu_data;\n }", "public function getHTML()\n {\n $config = $this->config[\"config\"];\n $items = $this->config[\"items\"];\n $itemsRight = $this->config[\"items-right\"];\n $html = \"<ul class='{$config['navbar-left-class']}'>\";\n foreach ($items as $item) {\n $html .= array_key_exists(\"dropdown-menu\", $item)\n ? $this->createDropdownItem($item, $item[\"text\"])\n : $this->createItem($item);\n }\n $html .= \"</ul>\";\n $html .= \"<ul class='{$config['navbar-right-class']}'>\";\n // Login and create account routes\n foreach ($itemsRight as $item) {\n $active = $item[\"route\"] == $this->currentRoute\n ? \"active\" : \"\";\n $route = call_user_func($this->urlCreator, $item[\"route\"]);\n $html .= \"<li class='{$active}'>\";\n // Check if user is logged in or not\n if ($item['route'] === \"login\" && $this->loggedIn) {\n if ($this->admin) {\n $route = call_user_func($this->urlCreator, \"admin\");\n } else {\n $route = call_user_func($this->urlCreator, \"profile\");\n }\n $html .= \"<a href='{$route}'>{$this->loggedIn}</a></li>\";\n } else {\n $html .= \"<a href='{$route}'>{$item['text']}</a></li>\";\n }\n }\n $html .= \"</ul>\";\n\n return $html;\n }", "public function pageNav()\n {\n $pager = $this->getPublisher()->getPagination()['pager'];\n $html = \"\\n<nav>\\n <ul class=\\\"pagination\\\">\";\n\n if ($pager['pages']['prev']) {\n $html .= \"\\n <li><a href=\\\"\".$pager['pages']['prev'].\n \"\\\" aria-label=\\\"\".$this->getConfig()->ls('ui.nav.previous').\n \"\\\"><span aria-hidden=\\\"true\\\">&laquo;</span></a><li>\";\n } else\n $html .= \"\\n <li class=\\\"disabled\\\"><span><span aria-hidden=\\\"true\\\">&laquo;</span></span></li>\";\n\n $pages = $this->getPublisher()->getPagination()['page_menu']['pages'];\n foreach($pages as $page_num => $data) {\n if ($data['url']) // not the current page\n $html .= \"\\n <li><a href=\\\"\".$data['url'].\"\\\">\".$page_num.\"</a></li>\";\n else\n $html .= \"\\n <li class=\\\"active\\\"><span>\".$page_num.\"<span class=\\\"sr-only\\\">(current)</span></span></li>\";\n }\n\n if ($pager['pages']['next']) {\n $html .= \"\\n <li><a href=\\\"\".$pager['pages']['next'].\n \"\\\" aria-label=\\\"\".$this->getConfig()->ls('ui.nav.next').\n \"\\\"><span aria-hidden=\\\"true\\\">&raquo;</span></a><li>\";\n } else\n $html .= \"\\n <li class=\\\"disabled\\\"><span><span aria-hidden=\\\"true\\\">&raquo;</span></span></li>\";\n\n $html .= \"\\n </ul>\\n</nav>\\n\\n\";\n\n return $html;\n }", "public function renderSideNavItems() {\n\t\t$out = '';\n\t\t$admin = $this->wire('pages')->get(wire('config')->adminRootPageID); \n\t\t$config = $this->wire('config'); \n\t\t$user = $this->wire('user'); \n\t\n\t\tforeach($admin->children(\"check_access=0\") as $p) {\n\t\t\tif(!$p->viewable()) continue; \n\t\t\t$out .= $this->renderSideNavItem($p);\n\t\t\t\n\t\t}\n\t\treturn $out; \n\t}", "function farmhouse_header_left_menu() {\n genesis_nav_menu(\n array(\n 'theme_location' => 'header-left',\n 'depth' => 2,\n )\n );\n}", "function minorite_nav($variables){\n return '<nav'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</nav>';\n}" ]
[ "0.7817765", "0.72904193", "0.7204154", "0.69043773", "0.68519425", "0.67965984", "0.67601603", "0.67373127", "0.66010153", "0.65632313", "0.654753", "0.6484029", "0.64832383", "0.64800173", "0.64084685", "0.63814104", "0.63656944", "0.63526964", "0.6309322", "0.6278091", "0.62715816", "0.62521654", "0.62061536", "0.6200104", "0.6197559", "0.6159594", "0.6139401", "0.6133841", "0.6117071", "0.60843986" ]
0.762449
1
Retrieve product list html
protected function _getProductListHtml() { if ($this->_request->getFullActionName() == self::CATEGORY_VIEW_ACTION_NAME) { return $this->_layout->getBlock($this->_vars['catalog_product_list_block'])->toHtml(); } elseif ($this->_request->getFullActionName() == self::CATALOG_SEARCH_ACTION_NAME) { return $this->_layout->getBlock($this->_vars['catalogsearch_product_list_block'])->toHtml(); } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_list_view_html ($product) {\n\t\t//Build HTML output for a single T-Shirt thumbnail\n\t\t$output = \"\";\n\t\t$output .= \"<li>\";\n\t\t$output .= '<a href=\"' . BASE_URL . \"shirts/\" . $product[\"sku\"] .'/\">';\n\t\t$output .= '<img src=\"' . BASE_URL . $product[\"img\"] . '\" alt=\"' . $product[\"name\"]. '\">';\n\t\t$output .= \"<p>View Details</p>\";\n\t\t$output .= \"</a>\";\n\t\t$output .= \"</li>\";\n\t\treturn $output;\n\t}", "public function listProductPage(){\n\t\t\t$sql = \"SELECT * FROM products\";\n\t\t\t$listProductPage = mysqli_query($this->connect(),$sql);\n\t\t\treturn $listProductPage;\n\t\t}", "function outputProductList()\n {\n global $application;\n\n if (empty($this -> _Prod_IDs))\n {\n $template_contents = array(\n 'ColumnNumber' => count($this -> _attrs) +\n (empty($this -> _Errors) ? 0 : 1)\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n return $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'empty.tpl.html',\n array()\n );\n }\n\n $output = '';\n foreach($this -> _Prod_IDs as $k => $v)\n {\n $prod_info = modApiFunc('Catalog_ProdInfo_Base',\n 'getProductInfo', $v);\n\n $prod_attrs = array();\n\n if (is_array($prod_info))\n foreach($prod_info as $group)\n foreach($group['attr'] as $attr)\n $prod_attrs[$attr['view_tag']] = $attr;\n unset($prod_info);\n\n $template_contents = array(\n 'ProductData' => $this -> outputProduct($k, $v, $prod_attrs),\n 'ProductError' => $this -> outputError($k, $v),\n 'ProductErrorCell' => $this -> outputErrorCell($k, $v)\n );\n $this -> _Template_Contents = $template_contents;\n $application -> registerAttributes($this -> _Template_Contents);\n $output .= $this -> mTmplFiller -> fill(\n 'catalog/product_group_edit/',\n 'product.tpl.html',\n array()\n );\n }\n\n return $output;\n }", "function __toString() {\r\n\t\t\t$out = '<div id=\"products\">';\r\n\t\t\t\r\n\t\t\tforeach($this->data['products'] as $p) {\r\n\t\t\t\t$out .= \"<div class='product'><a href='BASE_URL'><img src='{$p['photo']}' alt='{$p['shortdesc']}'/><div class='label'>{$p['name']}</div></a></div>\\n\";\r\n\t\t\t}\r\n\t\t\t$out .= \"</div>\";\r\n\t\t\treturn $out;\r\n\t\t}", "public function getProductList(){\n\n $productModel = new ProductModel();\n $products = $productModel->getProductList();\n $this->JsonCall($products);\n }", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function displayAjaxFeedProducts()\n {\n $productFeed = new ProductFeed();\n $store = (int) Tools::getValue('store', 0);\n $start = (int) Tools::getValue('start', 0);\n $rows = Tools::getValue('rows', 'all');\n $includeVariations = (bool) Tools::getValue('include_variations', false);\n\n $this->ajaxRenderJson($productFeed->get($store, $start, $rows, $includeVariations));\n }", "protected function _getListContent()\n {\n if ($route = $this->getRequest()->getParam('route')) {\n switch ($route) {\n case 'catalog':\n { # Catalog\n #-----------------------------------------------------\n if ($id = $this->getRequest()->getParam('id')) {\n\n $layer = Mage::getSingleton('catalog/layer');\n $layer->setCurrentCategory($id);\n\n $view = Mage::app()->getLayout()->createBlock('catalog/layer_view');\n /** @var Mage_Catalog_Block_Layer_View */\n if ($view) {\n $view->toHtml();\n }\n\n $list = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_list');\n\n if ($list) {\n $this->_addPriceBlock($list);\n $list->setNativeTemplate();\n\n return new Varien_Object(array(\n 'content' => $list->toHtml(),\n 'next_page' => ($list->needAjaxLoad() ? $list->getNextPageNum() : 0),\n ));\n }\n }\n\n break;\n }\n\n case 'catalogsearch':\n { # Catalog Search\n #-----------------------------------------------------\n if ($q = $this->getRequest()->getParam('q')) {\n\n\n $layer = Mage::getSingleton('catalog/layer');\n $view = Mage::app()->getLayout()->createBlock('catalogsearch/layer');\n if ($view) {\n $view->toHtml();\n }\n\n $search = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_search');\n /** @var Mage_CatalogSearch_Block_Result */\n\n $list = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_list');\n $search->setChild('search_result_list', $list);\n $search->setListOrders();\n $search->setListModes();\n $search->setListCollection();\n\n if ($list) {\n $this->_addPriceBlock($list);\n $list->setNativeTemplate();\n return new Varien_Object(array(\n 'content' => $list->toHtml(),\n 'next_page' => ($list->needAjaxLoad() ? $list->getNextPageNum() : 0),\n ));\n }\n\n } else {\n # Is Advanced Search\n\n Mage::getSingleton('catalogsearch/advanced')->addFilters($this->getRequest()->getParams());\n $layer = Mage::getSingleton('catalog/layer');\n\n\n /** @var AW_Ajaxcatalog_Block_Catalog_Product_Advancedsearch */\n $search = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_advancedsearch');\n\n\n $list = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_list');\n $search->setChild('search_result_list', $list);\n $search->setListOrders();\n $search->setListModes();\n $search->setListCollection();\n\n if ($list) {\n $this->_addPriceBlock($list);\n $list->setNativeTemplate();\n return new Varien_Object(array(\n 'content' => $list->toHtml(),\n 'next_page' => ($list->needAjaxLoad() ? $list->getNextPageNum() : 0),\n ));\n }\n }\n break;\n }\n case 'tag':\n { # Search by tag\n #-----------------------------------------------------\n if ($tagId = $this->getRequest()->getParam('tagId')) {\n\n $tag = Mage::getModel('tag/tag')->load($tagId);\n\n if (!$tag->getId() || !$tag->isAvailableInStore()) {\n $this->_forward('404');\n return;\n }\n Mage::register('current_tag', $tag);\n $layer = Mage::getSingleton('catalog/layer');\n $tagResult = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_tags');\n\n $list = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_list');\n $tagResult->setChild('search_result_list', $list);\n $tagResult->setListOrders();\n $tagResult->setListModes();\n $tagResult->setListCollection();\n\n if ($list) {\n $list->setNativeTemplate();\n return new Varien_Object(array(\n 'content' => $list->toHtml(),\n 'next_page' => ($list->needAjaxLoad() ? $list->getNextPageNum() : 0),\n ));\n }\n }\n break;\n }\n case 'awadvancedsearch':\n {\n if ($q = $this->getRequest()->getParam('q')) {\n\n $resultsHelper = Mage::helper('awadvancedsearch/results');\n $results = $resultsHelper->query($q);\n if ($results) {\n $helper = Mage::helper('awadvancedsearch/catalogsearch');\n $helper->addCatalogsearchQueryResults($q, $results);\n $helper->setResults($results);\n }\n $view = Mage::app()->getLayout()->createBlock('awadvancedsearch/layer')->setTemplate('catalog/layer/view.phtml');\n if ($view) {\n $view->toHtml();\n }\n $search = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_awadvancedsearch')->setTemplate('aw_advancedsearch/result.phtml');\n $list = Mage::app()->getLayout()->createBlock('awajaxcatalog/catalog_product_list');\n $search->setChild('search_result_catalog', $list);\n $search->setListOrders();\n $search->setListModes();\n $search->setListCollection();\n if ($list) {\n $this->_addPriceBlock($list);\n $list->setNativeTemplate();\n return new Varien_Object(array(\n 'content' => $list->toHtml(),\n 'next_page' => ($list->needAjaxLoad() ? $list->getNextPageNum() : 0),\n ));\n }\n }\n break;\n }\n # etc\n }\n }\n }", "public function getProducts($arry_product_sku){ \n $products = Mage::helper('mega/data')->getProductBySku($arry_product_sku);\n $html .= '<ul>';\n foreach($products as $product){\n $html .= '<li>';\n $html .= '<div>';\n $html .= '<a href=\"' . Mage::getBaseUrl(). $product->getUrl_path() . '\" /><img src=\"' . Mage::helper('catalog/image')->init($product, 'small_image')->resize(150) . '\" alt=\"\"></a>'; \n $html .= '<p><a href=\"' . Mage::getBaseUrl(). $product->getUrl_path() . '\">' . $product->getName() . '</a>';\n $html .= '<p>' . Mage::helper('core')->currency($product->getPrice()) . '</p>'; \n $html .= '</div>';\n $html .= '</li>';\n }\n $html .= '</ul>';\n return $html;\n }", "function sf_product_thumb_image_html($html) {\n\t\t$html = '<li>'.$html.'</li>';\n\t\treturn $html;\n\t}", "public function renderListContent() {}", "function get_list_product_price() {\n\n global $product;\n\n if ( $price_html = $product->get_price_html() ) :\n \t\n \techo '<span class=\"price uk-margin-small-bottom\" style=\"float: right\">';\n \techo $price_html;\n \techo '</span>';\n \t\n endif; \n\n }", "public function listProducts()\n \t{\n \t\t$data = LemonService::listProducts();\n\n \t\treturn View::make('displayProducts')->with('data',$data);\n\n\n\n \t}", "public function all_products()\n\t{\n\t\t$data['product_list']=$this->tbl_product->get_all_product();\n\t\t$data['page']='All Products';\n\t\t$view = 'Admin/collection/admin_all_product_list';\n\t\techo Modules::run('Template/admin_template', $view, $data);\t\n\t}", "public function displayProducts($products)\n\t {\n\t\t$output = '';\n\t\tforeach ($products as $row) {\n\t\t\t$link = '?page=detail&id=' . $row['product_id'];\n\t\t\t$output .= '<li>' . PHP_EOL;\n\t\t\t$output .= '<div class=\"image\">' . PHP_EOL;\n\t\t\t$output .= '<a href=\"<?php echo $link; ?>\">' . PHP_EOL;\n\t\t\t$output .= '<img src=\"images/' . $row['link'] . '.scale_20.JPG\" alt=\"' . $row['title'] . '\" width=\"190\" height=\"130\"/>' . PHP_EOL;\n\t\t\t$output .= '</a>' . PHP_EOL;\n\t\t\t$output .= '</div>' . PHP_EOL;\n\t\t\t$output .= '<div class=\"detail\">' . PHP_EOL;\n\t\t\t$output .= '<p class=\"name\">' . PHP_EOL;\n\t\t\t$output .= '<a href=\"' . $link . '\">' . $row['title'] . '</a></p>' . PHP_EOL;\n\t\t\t$output .= '<p class=\"view\">' . PHP_EOL;\n\t\t\t$output .= '<a href=\"' . $link. '\">purchase</a> | <a href=\"' . $link . '\">view details >></a></p>' . PHP_EOL;\n\t\t\t$output .= '</div>' . PHP_EOL;\n\t\t\t$output .= '</li>' . PHP_EOL;\n\t\t} // foreach ($products as $row)\n\t\treturn $output;\n\t }", "public function actionProductdetail()\n {\n $route = 'merchant.getProduct';\n $request = new getProductRequest();\n $request->setCustomerId($this->customer_id);\n $request->setAuthToken($this->auth_token);\n $request->setWholesalerId(33);\n $request->appendProductIds(4678);\n $result = Proxy::sendRequest($route, $request);\n $header = $result->getHeader();\n $body = getProductResponse::parseFromString($result->getPackageBody());\n return $this->render('index',[\n 'request' => $request->toArray(),\n 'route' => $route,\n 'header' => $header,\n 'body' => $body\n ]);\n }", "public function getProductList()\n {\n return $this->_call('catalog_product.list', '');\n }", "public function getlistServiceAction()\n {\n $buzz = $this->container->get('buzz');\n\n $browser = $buzz->getBrowser('dolibarr');\n $response = $browser->get('/product/list/?api_key=712f3b895ada9274714a881c2859b617');\n\n $contentList = json_decode($response->getContent());\n\n return $contentList;\n }", "function product_category_list(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\t$product_category_list = mysql_q(\"SELECT *\n\t\t\tFROM product_category\n\t\t\tORDER BY id\");\n\t\t$tpl->assign(\"product_category_list\", $product_category_list);\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_list.tpl\");\n\t\tdisplay($main);\n\t}", "public function render(): View\n {\n return view('components.catalog.product-list');\n }", "public function index_get()\n {\n $product_data = $this->Product_model->getAllProducts();\n\t\t$this->response([\n\t\t\t'status' => true,\n\t\t\t'message' => 'Product List Successfully',\n\t\t\t'data' => $product_data,\n\t\t], Restserver\\Libraries\\REST_Controller_Definitions::HTTP_CREATED); // CREATED (201) being the HTTP response code\n\t\texit;\n\t}", "function kms_pands_products_render($subtype, $conf, $args, $contexts) {\n $form = drupal_get_form('kms_pands_product_list_form');\n $block = new stdClass();\n $block->content = drupal_render($form);\n return $block;\n}", "public function showAdminproductsAction()\n {\n $productManager = new ProductManager();\n $products = $productManager->getAllProducts();\n return $this->twig->render('admin/adminproducts.html.twig', array(\n 'products' => $products\n ));\n }", "function list_products($command, $start, $link, $elems)\n{\n require 'orcl_user_passwd.php';\n $connection = oci_connect($username = $orcl_username,\n\t\t\t $password = $orcl_password,\n\t\t\t $connection_string = '//oracle.cise.ufl.edu/orcl');\n if(!$connection) {\n $e = oci_error();\n echo $e['message'];\n }\n\n /*Augument command reference: http://stackoverflow.com/questions/470542/how-do-i-limit-the-number-of-rows-returned-by-an-oracle-query\n */\n $newcommand='SELECT * FROM ( SELECT a.*, ROWNUM rnum FROM (' .$command. ')a WHERE ROWNUM <= ' .($start+$elems-1). ' ) WHERE rnum >= ' .$start;\n\n //var_dump($newcommand);\n $statement = oci_parse($connection, $newcommand);\n oci_execute($statement);\n\n $html='<div id=\"list_products\">\n <table width=\"100%\" height=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"5\">';\n $color=False;\n $count=0;\n while (($row=oci_fetch_object($statement))) {\n $count=$count+1;\n $color=!$color;\n if ($color) {\n $html .= '<tr style=\"background-color:#f5f5f5;\">';\n } else {\n $html .= '<tr style=\"background-color:#fff;\">';\n }\n $html .= '<td width=\"50px\">\n <img src=\"./graphics/products/'.$row->I.'\" width=\"50\" height=\"50\" style=\"top\">\n </td>\n <td>\n <p class=\"h1\"><a href=\"./product.php?id='.$row->ID.'\">'.$row->N.'</a> </p>\n <p class=\"h1\">'. substr($row->D,0,30).'</p>\n <p class=\"h2\">Price: <font color=#b22222>$'.$row->P.'</font> &nbsp;&nbsp;&nbsp; Customer Rating: <font color=#b8860b>'.(rand(50,100)/20).'</font></p>\n\n </td>\n </tr>';\n }\n $html .= '<tr><td colspan=\"2\" > <P align=\"center\">';\n\n if ($start >= $elems) { //populate prev\n $newstart = $start-$elems;\n $html .= '<a href=\"'.$link.$newstart.'\">Prev</a> &nbsp; |';\n }\n \n if ($count >= $elems) { //populate next\n $newstart = $start+$elems;\n $html .= '| &nbsp;<a href=\"'.$link.$newstart.'\">Next</a>';\n }\n\n $html .= '</p></td></tr></table></div>';\n\n // VERY important to close Oracle Database Connections and free statements!\n oci_free_statement($statement);\n oci_close($connection);\n return $html;\n}", "function ProductsBody()\n\t{\tparent::ProductsBody();\n\t\techo $this->product->DownloadsList();\n\t}", "public static function newArrivalsListing() {\n global $lC_Vqmod; \n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n\n $lC_Products = new lC_Products();\n $Qlisting = $lC_Products->execute();\n $cnt = 0;\n $listing = '';\n while ($Qlisting->next()) {\n $lC_Product = new lC_Product($Qlisting->valueInt('products_id'));\n $listing .= '<li>' . lc_link_object(lc_href_link(FILENAME_PRODUCTS, $lC_Product->getKeyword()), substr($lC_Product->getTitle(), 0, 20)) . '</li>';\n $cnt++;\n if ($cnt == 5) break;\n } \n \n return $listing;\n }", "public function list(): Response\n {\n /* Récupération des produits */\n // Récupération du repository\n $repository = $this->getDoctrine()->getRepository(Product::class);\n // Récupération des enregistrements\n $products = $repository->findAll();\n\n // Envoi des produits à la vue\n return $this->render(\"products/list.html.twig\", compact('products'));\n /*\n * Forme équivalente\n return $this->render(\"products/list.html.twig\", [\n \"products\" => $products\n ]);\n */\n }", "public function index()\n\t{\n\t\t$products = $this->product->getProductList();\n\t\treturn $this->response([\"data\" => $products], 200); \n\t}", "public function view_list_byproduct(){\n\t\t$emailaddress = App\\User::get_email();\n\t\t$view_data = array(\n\t\t\t\"email\" => $emailaddress,\n\t\t);\n\t\treturn view(mProvider::$view_prefix.mProvider::$view_prefix_priv.'stock_product', $view_data);\n\t}", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}" ]
[ "0.7684818", "0.68447566", "0.671349", "0.67089885", "0.65679675", "0.65413994", "0.6526645", "0.6520712", "0.6457075", "0.6429353", "0.64219385", "0.6415827", "0.63992995", "0.639633", "0.6376038", "0.63740504", "0.635681", "0.6351808", "0.6341763", "0.63122845", "0.63060874", "0.62711537", "0.6270311", "0.6265497", "0.62634003", "0.6244566", "0.62339824", "0.6233927", "0.6230602", "0.6230349" ]
0.699686
1
cline active class from next css
private function cssAut() { $this->active_class = explode(' ',$this->active_class); $this->active_class = $this->active_class[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLiActiveClass(): string;", "public function ActiveCSS() {\r\n\t\t$url = $_SERVER [\"REQUEST_URI\"];\r\n\t\t$url = htmlspecialchars ( $url );\r\n\t\t$class = str_replace ( '/', '-', $url );\r\n\t\t$class = substr ( $class, 1 );\r\n\t\t\r\n\t\t$vowels = array (\"@\", \"?\" );\r\n\t\t$pieces['request'] = str_replace ( $vowels, \"\", $class );\r\n\t\tif (empty($pieces['request'])) {\r\n\t\t\t$pieces['request'] = 'home';\r\n\t\t}\r\n\t\t\r\n\t\t$pieces['version'] = 'v1';\r\n\t\t$activecss = implode (' ', $pieces );\r\n\t\techo $activecss;\r\n\t}", "function greenfields_add_active_class($classes, $item)\n{\n if (in_array('current-menu-item', $classes)) {\n $classes[] = \"active\";\n }\n\n return $classes;\n}", "function simple_bootstrap_add_active_class($classes, $item) {\n if( in_array('current-menu-item', $classes) ) {\n $classes[] = \"active\";\n }\n \n return $classes;\n}", "function foundation_active_class($classes, $item){\n if( in_array('current-menu-item', $classes) ){\n $classes[] = 'active ';\n }\n return $classes;\n}", "public function setLiActiveClass(string $liActiveClass);", "function activeStyle()\r\n\t {\r\n\t \t$styleId = JRequest::getInt('id');\r\n\t \t$model = &$this->getModel('qrcode');\r\n\t \tif($model->changeStyle($styleId))\r\n\t \t{\r\n\t \t\t$msg = JText::_('COM_QRCODE_CONTROLLER_STYLE_ACTIVATE');\r\n\t \t}\r\n\t \telse \r\n\t \t{\r\n\t \t\t$msg = JText::_('COM_QRCODE_CONTROLLER_STYLE_NOT_ACTIVATE');\r\n\t \t}\t\r\n\t \t$link = JURI::base().'index.php?option=com_qrcode&layout=style';\r\n\t $this->setRedirect($link,$msg);\r\n\t }", "public function activate()\n {\n $this->find('css', '.filter-criteria-selector span.caret')->click();\n }", "function setActive() ;", "public static function add_class_to_saved_tabs_table() {\r\n\t\t\techo 'cptpro-savedtabs-pro-active';\r\n\t\t}", "function nav_accordion_item_class( $classes, $item, $args ) {\n\tif ( 'nav-primary' === $args->theme_location ) {\n\t\t$classes[] = 'NavAccordion_Item';\n\t\tif ( array_intersect( $classes, [ 'current-menu-item' ] ) ) {\n\t\t\t$classes[] = 'NavAccordion_Item-Active';\n\t\t}\n\t}\n\treturn $classes;\n}", "protected function controlActiveElements() {}", "function active_nav_class($classes, $item){\n\tif (in_array('current-menu-item', $classes)) {\n\t\t$classes[] = 'active';\n\t}\n\treturn $classes;\n}", "function uk_active_nav_class( $class, $item ) {\n if (in_array( 'current-menu-item', $class )) {\n $class[] = 'uk-active';\n }\n return $class;\n}", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }", "function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }", "function highlight($path, $normal = 'normal', $selected = 'youarehere') {\n\t\t$class = $normal;\n\t\t$currentPath = substr($this->Html->here, strlen($this->Html->base));\n\t\t// if there is a star in the path we need to do different checking\n\t\t$regs = array();\n\t\tif (ereg($path,$currentPath,$regs)){\n\t\t\t$class .= \" \".$selected;\n\t\t}\n\t\treturn $class;\n\t }", "function activation($in) {\n $directoryURI = $_SERVER['PHP_SELF'];\n $path = parse_url($directoryURI, PHP_URL_PATH);\n $components = explode('/', $path);\n $first_part = $components[1];\n\n if($first_part == $in) {\n echo 'class=\"active\"';\n }\n}", "function active_link($active)\n {\n return $active ? 'active' : '';\n }", "public function setActive() {}", "public function highlight($path, $normal = '', $selected = 'active') {\n\t\t$class = $normal;\n\t\t$currentPath = substr($this->request->here, strlen($this->request->base));\n\t\tif (preg_match($path, $currentPath)) {\n\t\t\t$class .= ' ' . $selected;\n\t\t}\n\t\treturn $class;\n\t}", "function isActive() ;", "function trucking_filter_active_class_menu( $classes){\n if(in_array('current-menu-item', $classes)) {\n $classes[] = 'active';\n }\n return $classes;\n}", "function set_active_nav_class ($classes, $item) {\n if (in_array('current-menu-item', $classes) ){\n $classes[] = 'activemenu ';\n }\n return $classes;\n}", "function setActive($a_active)\n\t{\n\t\t$this->active = $a_active;\n\t}", "public function renderCss()\n {\n return $this->getColumn()->getCssClass() . ' a-left';\n }", "function getActive() {return $this->_active;}", "function rwbs_add_active_class_to_nav_menu($classes) {\n if (in_array('current-menu-item', $classes, true) || in_array('current_page_item', $classes, true)) {\n $classes = array_diff($classes, array('current-menu-item', 'current_page_item', 'active'));\n $classes[] = 'active';\n }\n return $classes;\n}", "function isActivate($params, $id)\n{\t\n\tif( isset($params['named']['Search.category_id'])\n\t\t\t&&\n\t\t($params['named']['Search.category_id'] == $id)\n\t){\n\t\treturn 'class=\"active\"';\n\t}\t\n\t\n\treturn '';\n}", "function sc_mailbox_boxlink_active($parm = '')\n {\n if(!$parm) { $parm = 'inbox'; }\n\n // Check if current page is the active page\n if(e107::getParser()->filter($_GET['page']) == $parm)\n {\n return 'class=\"active\"';\n }\n\n return;\n }" ]
[ "0.59464705", "0.5940775", "0.5857766", "0.5794782", "0.5758434", "0.5466908", "0.5442385", "0.54260296", "0.5407101", "0.5365404", "0.5365324", "0.5341434", "0.5251817", "0.52303207", "0.51819265", "0.51819265", "0.5154347", "0.5144746", "0.5140333", "0.5136095", "0.51100564", "0.51090854", "0.50744426", "0.50364673", "0.5013933", "0.49625915", "0.4959397", "0.49560973", "0.49554414", "0.4948005" ]
0.64123076
0
Generate Username Take type as input of class or string and return generated username
public function generate_username($type) { $array = array_merge(range(0,9),range('A','Z'),range('a','z')); shuffle($array); $characters = implode('',array_slice($array,0,10)); if (($type instanceof Bronze_Customer)) { $this->username = self::Bronze . $characters; } else if (($type instanceof Silver_Customer)) { $this->username = self::Silver . $characters; } else if (($type instanceof Gold_Customer)) { $this->username = self::Gold . $characters; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generateUsername(){\n $this->username = strtolower(substr($this->firstname,0,1).$this->lastname.$this->id());\n }", "private function generateUsername() {\n $name = \"\";\n $name = $this->generator->generateString(4, '2346789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRTUVWXYZ');\n $table = 'participant_data';\n $conditions = array('passcode' => $name);\n $existing_users = $this->getListFromDB($table, $conditions);\n if (empty($existing_users)) {\n return $name; \n }\n else {\n return $this->generateUsername();\n }\n \n }", "function generateUsername()\n {\n $username = bcrypt($this->email);\n\n $username = preg_replace('/[.\\/]/', str_shuffle($this->name), $username) . time();\n\n return $username;\n }", "public function generate()\n {\n $parser = new Parser();\n\n $username = $parser->parse($this->fullName, $this->glue);\n\n $count = $this->countOccurances($username);\n\n $username = $username.(($count >= 1) ? $count : '');\n\n return $username;\n }", "public function generate_username($len = 10) {\n\t\t$len = ($len < 10 ? 10 : $len);\n\t\t$len = ($len > 28 ? 29 : $len);\n\t\t$validChar = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t\t$this->userName = '';\n\t\tfor ($i = 0; $i < $len - 1; $i++) {\n\t\t\t$this->userName .= $validChar[rand(0, strlen($validChar) - 1)];\n\t\t}\n\t\t$this->userName = substr(end(explode('\\\\', get_called_class())), 0, 1) . $this->userName;\n\t\treturn $this->userName;\n\t}", "abstract protected function generateName();", "private function genUser() {\r\n $random = 0;\r\n $rand78 = \"\";\r\n $randuser = \"\";\r\n $userid = \"\";\r\n $maxcount = rand( 4, 9 );\r\n if ( ($maxcount > 8) or ( $maxcount < 5) ) {\r\n do {\r\n $maxcount = rand( 4, 9 );\r\n } while ( ($maxcount > 8) or ( $maxcount < 5) );\r\n }\r\n $rand62 = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n for ( $count = 0; $count <= $maxcount; $count++ ) {\r\n $random = rand( 0, 61 );\r\n $randuser = substr( $rand62, $random, 1 );\r\n $userid = $userid . $randuser;\r\n }\r\n $userid = substr( $userid, 0, 8 ); // Just in case\r\n return($userid);\r\n }", "public function findUsername()\n {\n\n $login = request()->input('username');\n\n $fieldType = filter_var($login, FILTER_VALIDATE_EMAIL) ? 'email' : 'phone_number';\n\n request()->merge([$fieldType => $login]);\n\n return $fieldType;\n }", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername() {}", "public function getUsername(): string;", "function getUserName($us_id)\n\t{\n\t\t$func = create_function('$id',$this->UserNameFunc);\n\t\treturn $func($us_id);\n\t}", "protected function generateUserName($personObj) {\n $len = strlen($personObj->firstname);\n $found = false;\n $count = 1;\n $accessMech = I2CE::getUserAccess();\n $username = false;\n while ($count <= $len) {\n $username = preg_replace(\"/\\s+/\",'',strtolower($personObj->surname . substr($personObj->firstname,0,$count)));\n if (!$accessMech->userExists($username,false)) {\n break;\n }\n $username = false;\n $count++;\n }\n if ($username) {\n return $username; \n }\n $count =0;\n do {\n $username = preg_replace(\"/\\s+/\".'',strtolower($personObj->surname . $count));\n $count++;\n } while ($accessMech->userExists($username,false));\n return $username;\n }", "protected function GetUName() { return md5(uniqid(rand(),true)); }", "public function username() {\n\n $correctformat = $this->inputmanager;\n\n $name = $_POST['name'];\n\n return $correctformat->nameformt($name);\n\n }", "public function generateUsername( $base ) {\r\n $result = self::$database->query(\"SELECT username FROM `users` WHERE username like CONCAT('%', ?, '%') order by username desc limit 1\", strtolower($base));\r\n if ($result) {\r\n // User already exists\r\n preg_match('/'.$base.'(\\d+)/', $result[0]->username, $match);\r\n if (isset($match[1])) {\r\n $username=$base.((int)$match[1]+1);\r\n } else {\r\n $username=$base.'2';\r\n }\r\n } else {\r\n $username=$base;\r\n }\r\n $username=preg_replace('/[\\.\\/]/', \"\", stripslashes($username)); // remove dots and back/forward slashes\r\n return $username;\r\n }", "public function generateUsername($code, $id = 0) \n\t{\n\t\t//1. check existance\n\t\t$uname\t\t\t= Employee::id($id)->first();\n\n\t\tif($uname && !empty($uname['username']))\n\t\t{\n\t\t\treturn new JSend('success', ['username' => $uname['username']]);\n\t\t}\n\t\t\t\n\t\t//2. get firstname\n\t\tif(!Input::has('name'))\n\t\t{\n\t\t\treturn new JSend('error', (array)Input::all(), 'No Name');\n\t\t}\n\t\t\n\t\t$name \t\t\t= Input::get('name');\n\n\t\t$username \t \t= UsernameGenerator::generate($code, $id, $name);\n\n\t\treturn new JSend('success', ['username' => $username]);\n }", "abstract public function getTypeName();", "private function createUser($type='') {\n return $this->ec->createUser($type);\n }", "public function getUsername()\n {\n }", "public function getUsername()\n {\n }", "function gen_name($arg, $in){\n $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n $name = '';\n for ($i = 0; $i < CONFIG_RANDOM_LENGTH; $i++) {\n $name .= $chars[mt_rand(0, 60)];\n }\n switch($arg){\n case 'random':\n return $name.'.'.$in;\n break;\n case 'custom_original':\n return $name.'_'.$in;\n break;\n }\n}", "function random_username($length = 10) {\n $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $randomString .= $characters[ rand(0, $charactersLength - 1) ];\n }\n return $randomString;\n}", "public function getUserType();", "public function getUserType();", "function generateFeatureName($feature_type) {\n\twriteLog(\"generateFeatureName()\");\n\t\n\tsrand();\n\t$syllables = rand(2,4);\n\twriteLog(\"generateFeatureName(): Type: \" . $feature_type);\n\t$name = \"\";\n\t\n\tfor ($s = 0; $s < $syllables; $s++) {\n\t\t\n\t\t$consonant = \"a\";\n\t\twhile ($consonant == \"a\" || $consonant == \"e\"|| $consonant == \"i\" || $consonant == \"o\" || $consonant == \"u\") {\n\t\t\t$consonant = chr(rand(97, 122));\n\t\t}\n\t\twriteLog(\"generateFeatureName(): Consonant: \" . $consonant);\n\t\t\n\t\t$vowel = \"x\";\n\t\twhile ($vowel != \"a\" && $vowel != \"e\" && $vowel != \"i\" && $vowel != \"o\" && $vowel != \"u\") {\n\t\t\t$vowel = chr(rand(97, 122));\n\t\t}\n\t\twriteLog(\"generateFeatureName(): Vowel: \" . $vowel);\n\t\t\n\t\t$name = $name . $consonant . $vowel;\n\t\t$consonant = \"a\";\n\t\t$vowel = \"x\";\n\t\t\n\t}\n\t\n\t$name = $name . \" \" . $feature_type;\n\t\n\twriteLog(\"generateFeatureName(): Name: \" . $name);\n\t\n\treturn ucwords($name);\n\t\n}" ]
[ "0.7557174", "0.70024", "0.69090945", "0.679564", "0.6716008", "0.65790653", "0.6231332", "0.6147677", "0.606555", "0.606555", "0.606555", "0.606555", "0.606555", "0.60640657", "0.6049839", "0.60438144", "0.60366726", "0.60325634", "0.6027219", "0.6022788", "0.60082", "0.599762", "0.5997614", "0.59936565", "0.59936565", "0.5985883", "0.5971232", "0.5965435", "0.5965435", "0.5955895" ]
0.8176767
0
Callback function for the ctools content_type. Slightly adjusted version of ding_facetbrowser_content_type_render.
function breol_facetbrowser_content_type_render($subtype, $conf, $panel_args, $context) { $block_content = FALSE; $content_in_facet = FALSE; $block = new stdClass(); $block->module = 'ding_facetbrowser'; $block->delta = 'ding_facetbrowser'; $executed_search_module = 'ting_search'; $results = module_invoke($executed_search_module, 'ding_facetbrowser'); if (is_object($results)) { foreach ($results->facets as $facet) { if (count($facet->getTerms()) > 0) { $content_in_facet = TRUE; break; } } if ($content_in_facet === TRUE || $results->show_empty == TRUE) { $block_content = theme('facetbrowser', array($results->facets, (!empty($results->searchkey) ? $results->searchkey : NULL))); } } $path = drupal_get_path('module', 'ding_facetbrowser'); $block->title = t('BReol Facetbrowser'); $block->content['#markup'] = '<div class="js-facet-browser-toggle">' . $block_content . '</div>'; $block->content['#attached'] = array( 'js' => array( array( 'data' => $path . '/js/ding_facetbrowser.js', ), array( 'data' => array( 'ding_facetbrowser' => array( 'selector' => '.js-facet-browser-toggle', 'number_of_terms' => variable_get('ding_facetbrowser_number_of_terms', 5), ), ), 'type' => 'setting', ), ), 'libraries_load' => array( array('js.cookie'), ), ); return $block; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feed_content_type($type = '')\n {\n }", "public function contenttypeAction() {\n\t$resource_type = $this->_getParam('resource_type');\n\t$story_type = $this->_getParam('story_type', null);\n\t$calling_from = $this->_getParam('calling_from', null);\n\t$resource_id = $this->_getParam('resource_id', null);\n\n\t$resource_array = array();\n\tif (!empty($resource_type)) {\n\t $resource_array = Engine_Api::_()->communityad()->resource_content($resource_type, $story_type, $calling_from, $resource_id);\n\t $getModType = Engine_Api::_()->getDbTable('modules', 'communityad')->getModuleInfo($resource_type);\n\t}\n\n\t$this->view->resource_string = $resource_array;\n\t$this->view->resource_type = $resource_type;\n\tif( !empty( $getModType ) && !empty($getModType['module_title']) ) {\n\t $this->view->modTitle = $getModType['module_title'];\n\t}\n }", "function getContentType(){ return $this->_ContentType;}", "abstract public function getContentType();", "function charity_create_contenttype() {\n $content = \"\\t\";\n $content .= \"<meta http-equiv=\\\"Content-Type\\\" content=\\\"\";\n $content .= get_bloginfo('html_type'); \n $content .= \"; charset=\";\n $content .= get_bloginfo('charset');\n $content .= \"\\\" />\";\n $content .= \"\\n\\n\";\n echo apply_filters('charity_create_contenttype', $content);\n}", "function getContentType();", "public abstract function getContentType();", "public abstract function getContentType();", "public function getContentType()\n {\n return self::RENDERER_CONTENT_TYPE;\n }", "function ting_visual_relation_search_content_type_render($subtype, $conf, $args, $context) {\n $block = new stdClass();\n $content = array();\n if (!empty($context) && isset($context->data)) {\n $d3 = libraries_load('d3');\n if (!empty($d3['installed']) && version_compare($d3['version'], '3.0') > 0) {\n $search = check_plain($context->data);\n $content = array(\n '#theme' => 'ting_visual_relation_activation_area',\n '#activators' => array(),\n );\n $content['#activators'][] = array(\n '#theme' => 'ting_visual_relation_activator',\n '#type' => 'struct',\n '#text' => t('Visualize your search'),\n '#search' => $search,\n );\n ting_visual_relation_prepare_render_array($content);\n }\n }\n $block->content = $content;\n return $block;\n}", "public function get_content_type()\n {\n }", "public function getContentType()\n\t{\n\t\treturn \"text/javascript\";\n\t}", "public function getContentType() { return $this->content_type; }", "function dgu_search_dgu_search_info_content_type_render($subtype, $conf, $panel_args, $context) {\n $block = new stdClass();\n $block->module = 'apachesolr_panels';\n $block->delta = 'info';\n $block->title = '';\n $block->content = theme('dgu_search_info');\n\n return $block;\n}", "public function contenttype() {\n return $this->info['content_type'];\n }", "public function pi_set_content_type(){\n \treturn \"text/html\";\n\t}", "function theme_content($type) {\n global $theme;\n\n $id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0;\n $type = filter_var($type);\n $output = '';\n\n switch ($type) {\n\n case 'image'; // gallery image\n $image = new UN_Gallery();\n $bload = $image->load($id);\n if ($bload) {\n $output .= '<img alt=\"'.$image->origname . '\" src=\"'. LC_UPLOAD . $image->filename.'\"/>'; \n }\n break;\n\n case 'gallery': // gallery thumbnails\n $gallery = new UN_Gallery();\n $where = ' a.catid = '. $id;\n $res = $gallery->pager($pager, $numrows, null, $where);\n\n if ($res) {\n $output .= '<p>';\n while($row = $res->fetch()) {\n $url = 'popup.php?t=image&amp;id='.$row['imgid'].theme_global_url();\n $output .= '<a href=\"'.$url.'\"'.\n ' target=\"_blank\" onClick=\"openWindow(\\''.$url.'\\');return false\"><img alt=\"'.$row['origname'] .\n '\" src=\"'. LC_UPLOAD . 'thumb_'. $row['filename'].'\" border=\"0\" vspace=\"6\" hspace=\"6\"/></a>'; \n } \n $output .= '</p>';\n }\n $output .= $pager->display();\n break;\n\n case 'categories': // gallery categories\n $cat = new UN_GalleryCat();\n $aCats = $cat->getGalleryCats();\n $aTranslations = array();\n $langid = 0;\n if(isset($_REQUEST['langid'])) {\n $langid = (int)$_REQUEST['langid'];\n $tr = new UN_Translate();\n $aTranslations = $tr->getAllTexts($langid);\n }\n foreach($aCats as $catid=>$cattitle) {\n $cattitle = ($langid > 0 && isset($aTranslations[$catid]['gallerycat'])) ? \n $aTranslations[$catid]['gallerycat'] :\n $cattitle;\n $output .= '<p><a href=\"index.php?t=gallery&amp;id='. $catid . theme_global_url(). '\"> ' . $cattitle . '</a></p>';\n }\n break;\n case 'page':// content\n $page = new UN_Content();\n $bload = $page->load($id); \n if ($bload) {\n $output .= '<h2 id=\"title\">'.$page->pagetitle.'</h2>'.$page->pagedetail;\n }\n break;\n case 'news':// news\n $news = new UN_News();\n if ($id > 0) { // load specific news\n $bload = $news->load($id); \n if ($bload) {\n $output .= '<h2 id=\"title\">'.$news->newstitle.'</h2>'.$news->newsdetail;\n }\n } else {\n // load all news with paginate\n $langid = (isset($_REQUEST['langid'])) ? intval($_REQUEST['langid']) : 0;\n $where = ($langid > 0) ? ' langid='.$langid : '';\n $res = $news->pager($pager, $numrows, null, $where); \n if ($res) {\n $output .= '<h2 id=\"title\">'._('News').'</h2>';\n while($row = $res->fetch()) {\n $output .= '<p><a href=\"index.php?t=news&amp;id='. \n $row['newsid'].theme_global_url().'\">'.$row['newstitle'].'</a></p><p>' .\n truncate(clearCodes($row['newsdetail']),400) .'</p>'; \n }\n $output .= $pager->display();\n }// end res\n } // end else\n break;\n }\n return $output;\n}", "function register_content_types() {\n\n}", "function content_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Content Types', 'Taxonomy General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Content Type', 'Taxonomy Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Content Type', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'parent_item' => __( 'Parent Item', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'new_item_name' => __( 'New Item Name', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),\n\t\t'add_or_remove_items' => __( 'Add or remove items', 'text_domain' ),\n\t\t'choose_from_most_used' => __( 'Choose from the most used', 'text_domain' ),\n\t\t'popular_items' => __( 'Popular Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Items', 'text_domain' ),\n\t\t'not_found' => __( 'Not Found', 'text_domain' ),\n\t\t'no_terms' => __( 'No items', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_admin_column' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_tagcloud' => true,\n\t\t'has-archive'\t\t\t\t => true\n\t);\n\tregister_taxonomy( 'content_type', array( 'post' ), $args );\n\n}", "function realtor_set_content_type()\n{\n return \"text/html\";\n}", "private function loadContentTypes()\n\t\t{\n\t\t\t$query = $this->contentTypeQuery;\n\t\t\t$list = $this->bridge->packData($query);\n\t\t\t$this->contentTypes = $list;\n\t\t\t\n\t\t\t/*\n\t\t\t*\tgenerate new contentTypes [Folder, File]\n\n\t\t\t*/\n\n\t\t\tif (count($this->contentTypes) == 0)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'Folder', null)\n\t\t\t\t*\tINSERT INTO contentType VALUES (null, 'File', null)\n\t\t\t\t*/\n\n\t\t\t\t$qrs = array();\n\t\t\t\tarray_push($qrs, [\"'Folder'\", \"'_'\"]);\n\t\t\t\tarray_push($qrs, [\"'File'\", \"'_'\"]);\n\n\t\t\t\t$ts = $this->logContentType($qrs);\n\t\t\t\t#var_dump($ts);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$r= 1;\n\t\t\t\t#var_dump($this->contentTypes);\n\t\t\t\t#$arrayName = array(0 => [\"'Folderr'\", \"null\"], );\n\t\t\t\t#$this->logContentType($arrayName);\n\t\t\t}\t\t\t\n\t\t}", "function ctools_block_ctools_content_types() {\n return array(\n // And this is just the administrative title.\n // All our callbacks are named according to the standard pattern and can be deduced.\n 'title' => t('Block'),\n );\n}", "public static function getContentType() {}", "function register_content_type( $singular, $plural, $type, $ns = 'theme' )\n{\n // Hook into the 'init' action\n add_action( 'init', function() use ( $singular, $plural, $type, $ns ) {\n\n $labels = [\n 'name' => _x( $plural, 'Post Type General Name', $ns ),\n 'singular_name' => _x( $singular, 'Post Type Singular Name', $ns ),\n 'menu_name' => __( $plural, $ns ),\n 'parent_item_colon' => __( 'Parent ' . $singular . ':', $ns ),\n 'all_items' => __( 'All ' . $plural, $ns ),\n 'view_item' => __( 'View ' . $singular, $ns ),\n 'add_new_item' => __( 'Add New ' . $singular, $ns ),\n 'add_new' => __( 'Add New', $ns ),\n 'edit_item' => __( 'Edit ' . $singular, $ns ),\n 'update_item' => __( 'Update ' . $singular, $ns ),\n 'search_items' => __( 'Search ' . $plural, $ns ),\n 'not_found' => __( 'Not found', $ns ),\n 'not_found_in_trash' => __( 'Not found in Trash', $ns ),\n ];\n $args = [\n 'label' => __( $singular, $ns ),\n 'description' => __( $plural, $ns ),\n 'labels' => $labels,\n 'supports' => [ 'title', 'editor', 'custom-fields', 'thumbnail' ],\n 'taxonomies' => [ 'category', 'post_tag' ],\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n ];\n register_post_type( $type, $args );\n\n }, 0 );\n}", "public function getContentType()\n {\n }", "public function setContentType($content_type) {}", "public function getContentType()\n {\n return 'lfc';\n }", "function contentType()\n {\n return '';\n }", "function sandbox_demo_tester_content_type_render($subtype, $conf, $panel_args, $context = NULL) {\n\n // Load some nodes\n $variables['content'] = array();\n $offset = 0;\n $count = 5;\n\n // Load all node id's from database\n $query = \"SELECT nid FROM node ORDER BY nid ASC LIMIT $offset, $count\";\n // Execute the query and get a object\n $results = db_query($query)->fetchAll();\n // Loop object to get each result\n foreach ($results as $row) {\n // Load the node object from node id\n $node = node_load($row->nid);\n // Send the node object to a variable to be passed on\n $variables['content'][] = node_view($node, 'teaser');\n }\n\n // Pass on content variable to template file\n $variables['jannik'] = 'Hej';\n $output = theme('tester_pane', $variables);\n\n // Build the content type block.\n $block = new stdClass();\n $block->content = $output;\n\n // Add some js\n drupal_add_js(drupal_get_path('module', 'sandbox_demo') . '/js/sandbox_demo.custom.js');\n\n //drupal_add_library('sandbox_demo', 'mootools');\n\n return $block;\n}", "abstract protected function post_type();" ]
[ "0.6201178", "0.61553544", "0.61471075", "0.61397773", "0.6103038", "0.60805255", "0.60015285", "0.60015285", "0.59795314", "0.59335685", "0.5931768", "0.5831257", "0.58295244", "0.5823113", "0.57937396", "0.57706773", "0.57654685", "0.5757895", "0.57551706", "0.5753317", "0.5743221", "0.5742203", "0.57399446", "0.57334304", "0.5710859", "0.5698821", "0.56949925", "0.5694029", "0.5685669", "0.5667136" ]
0.6958056
0
same cases as in testParseNationalNumber
public function testFindNationalNumber() { $this->doTestFindInContext('033316005', RegionCode::NZ); // ("33316005", RegionCode.NZ) is omitted since the national prefix is obligatory for these // types of numbers in New Zealand. // National prefix attached and some formatting present. $this->doTestFindInContext('03-331 6005', RegionCode::NZ); $this->doTestFindInContext('03 331 6005', RegionCode::NZ); // Testing international prefixes. // Should strip country code. $this->doTestFindInContext('0064 3 331 6005', RegionCode::NZ); // Try again, but this time we have an international number with Region Code US. It should // recognize the country code and parse accordingly. $this->doTestFindInContext('01164 3 331 6005', RegionCode::US); $this->doTestFindInContext('+64 3 331 6005', RegionCode::US); $this->doTestFindInContext('64(0)64123456', RegionCode::NZ); // Check that using a "/" is fine in a phone number. // Note that real Polish numbers do *not* start with a 0. $this->doTestFindInContext('0123/456789', RegionCode::PL); $this->doTestFindInContext('123-456-7890', RegionCode::US); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUSPhoneNumber($phoneNumber){\n\t\t$input = preg_replace('/\\D/', '', $phoneNumber);\n\t\t$areaCode;\n\t\t$phone;\n\t\t//if it's not 10 or 11 in length we have an issue\n\t\tif(strlen($input) == 11){\n\t\t\t$areaCode = substr($input, 1,3);\n\t\t\t$phone = substr($input, 4,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t} else if(strlen($input) == 10){\n\t\t\t$areaCode = substr($input, 0,3);\n\t\t\t$phone = substr($input, 3,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t\t//(123)123-1234\n\t\t}\n\t\treturn false;\n\t}", "public function testContainsMoreThanOneSlashInNationalNumber()\n {\n $number = new PhoneNumber();\n $number->setCountryCode(1);\n $number->setCountryCodeSource(CountryCodeSource::FROM_DEFAULT_COUNTRY);\n $candidate = '1/05/2013';\n $this->assertTrue(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n // Here, the country code source thinks it started with a country calling code, but this is not\n // the same as the part before the slash, so it's still true.\n $number = new PhoneNumber();\n $number->setCountryCodeSource(274);\n $number->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN);\n $candidate = '27/4/2013';\n $this->assertTrue(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n // Now it should be false, because the first slash is after the country calling code.\n $number = new PhoneNumber();\n $number->setCountryCode(49);\n $number->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITH_PLUS_SIGN);\n $candidate = '49/69/2013';\n $this->assertFalse(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n $number = new PhoneNumber();\n $number->setCountryCode(49);\n $number->setCountryCodeSource(CountryCodeSource::FROM_NUMBER_WITHOUT_PLUS_SIGN);\n $candidate = '+49/69/2013';\n $this->assertFalse(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n $candidate = '+ 49/69/2013';\n $this->assertFalse(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n $candidate = '+ 49/69/20/13';\n $this->assertTrue(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n\n // Here, the first group is not assumed to be the country calling code, even though it is the\n // same as it, so this should return true.\n $number = new PhoneNumber();\n $number->setCountryCode(49);\n $number->setCountryCodeSource(CountryCodeSource::FROM_DEFAULT_COUNTRY);\n $candidate = '49/69/2013';\n $this->assertTrue(PhoneNumberMatcher::containsMoreThanOneSlashInNationalNumber($number, $candidate));\n }", "function mDIGIT(){\n try {\n // Tokenizer11.g:366:3: ( '0' .. '9' ) \n // Tokenizer11.g:367:3: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function testFindNationalNumberArgentina()\n {\n $this->doTestFindInContext('+54 9 343 555 1212', RegionCode::AR);\n $this->doTestFindInContext('0343 15 555 1212', RegionCode::AR);\n\n $this->doTestFindInContext('+54 9 3715 65 4320', RegionCode::AR);\n $this->doTestFindInContext('03715 15 65 4320', RegionCode::AR);\n\n // Test parsing fixed-line numbers of Argentina.\n $this->doTestFindInContext('+54 11 3797 0000', RegionCode::AR);\n $this->doTestFindInContext('011 3797 0000', RegionCode::AR);\n\n $this->doTestFindInContext('+54 3715 65 4321', RegionCode::AR);\n $this->doTestFindInContext('03715 65 4321', RegionCode::AR);\n\n $this->doTestFindInContext('+54 23 1234 0000', RegionCode::AR);\n $this->doTestFindInContext('023 1234 0000', RegionCode::AR);\n }", "function _splitStreetAddressNl($streetAddress) {\n $result = array();\n /*\n * do nothing if streetAddress is empty\n */\n if (!empty($streetAddress)) {\n /*\n * split into parts separated by spaces\n */\n $addressParts = explode(\" \", $streetAddress);\n $foundStreetNumber = false;\n $streetName = null;\n $streetNumber = null;\n $streetUnit = null;\n foreach($addressParts as $partKey => $addressPart) {\n /*\n * if the part is numeric, there are several possibilities:\n * - if the partKey is 0 so it is the first element, it is\n * assumed it is part of the street_name to cater for \n * situation like 2e Wormenseweg\n * - if not the first part and there is no street_number yet (foundStreetNumber\n * is false), it is assumed this numeric part contains the street_number\n * - if not the first part but we already have a street_number (foundStreetNumber\n * is true) it is assumed this is part of the street_unit\n */\n if (is_numeric($addressPart)) {\n if ($foundStreetNumber == false) {\n $streetNumber = $addressPart;\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".$addressPart;\n }\n } else {\n /*\n * if part is not numeric, there are several possibilities:\n * - if the street number is found, set the whole part to streetUnit\n * - if there is no streetNumber yet and it is the first part, set the\n * whole part to streetName\n * - if there is no streetNumber yet and it is not the first part,\n * check all digits:\n * - if the first digit is numeric, put the numeric part in streetNumber\n * and all non-numerics to street_unit\n * - if the first digit is not numeric, put the lot into streetName\n */\n if ($foundStreetNumber == true) {\n if (!empty($streetName)) {\n $streetUnit .= \" \".$addressPart;\n } else {\n $streetName .= \" \".$addressPart;\n }\n } else {\n if ($partKey == 0) {\n $streetName .= $addressPart;\n } else {\n $partLength = strlen($addressPart);\n if (is_numeric(substr($addressPart, 0, 1))) {\n for ($i=0; $i<$partLength; $i++) {\n if (is_numeric(substr($addressPart, $i, 1))) {\n $streetNumber .= substr($addressPart, $i, 1);\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".substr($addressPart, $i, 1);\n }\n }\n } else {\n $streetName .= \" \".$addressPart;\n }\n }\n }\n }\n }\n $result['street_name'] = trim($streetName);\n $result['street_number'] = $streetNumber;\n $result['street_unit'] = trim($streetUnit);\n /*\n * if we still have no street_number, add contact to checkgroup\n */\n \n }\n return $result;\n}", "public function testPhoneNumberWithLeadingOrTrailingMoneyMatches()\n {\n // the actual number from being found.\n $contexts = array();\n $contexts[] = array('$20 ', '');\n $contexts[] = array('', ' 100$');\n\n $this->findMatchesInContexts($contexts, true, true);\n }", "public function testFindNumbersMexico()\n {\n $this->doTestFindInContext('+52 (449)978-0001', RegionCode::MX);\n $this->doTestFindInContext('01 (449)978-0001', RegionCode::MX);\n $this->doTestFindInContext('(449)978-0001', RegionCode::MX);\n\n // Test parsing mobile numbers of Mexico.\n $this->doTestFindInContext('+52 1 33 1234-5678', RegionCode::MX);\n $this->doTestFindInContext('044 (33) 1234-5678', RegionCode::MX);\n $this->doTestFindInContext('045 33 1234-5678', RegionCode::MX);\n }", "public static function validateNationalIdNumber($input)\n {\n $input = trim($input);\n $prepared_input = preg_replace(\"^\\\\s^\", \"\", $input);\n if ((preg_match(\"[^\\\\d{2}-?\\\\d{6,7}-?[A-Za-z]{1}-?\\\\d{2}$]\", $prepared_input) == FALSE) || strlen($prepared_input) < 12 || strlen($prepared_input) > 16) {\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function testRegistrationValuesContainNumbers(): void { }", "abstract public function validateNumber(): bool;", "public function testEmptyDataAlphaToNumber()\n {\n // Input text parameters\n $input_alphabet =\"\";\n $expected_result = -96;\n\n // Execute test target\n $Response = Utility::alpha2num($input_alphabet);\n\n // Check result\n $this->assertEquals($expected_result, $Response);\n }", "public function testValidateStringNumber(): void\n {\n $this->assertFalse($this->validate('1'));\n }", "public function testNumber()\r\n {\r\n\r\n $testData = array(\r\n 'number' => '',\r\n 'number2' => '1337',\r\n 'number3' => 0x539,\r\n 'number4' => 02471,\r\n 'number5' => 0b10100111001,\r\n 'number6' => 1337e0,\r\n 'number7' => \"not numeric\",\r\n 'number8' => array(),\r\n 'number9' => 9.1\r\n );\r\n\r\n $validator = new Validator($testData);\r\n $validator->addRule('number', 'number', ['number']);\r\n $validator->addRule('number2', 'number2', ['required', 'number']);\r\n $validator->addRule('number3', 'number3', ['required', 'number']);\r\n $validator->addRule('number4', 'number4', ['required', 'number']);\r\n $validator->addRule('number5', 'number5', ['required', 'number']);\r\n $validator->addRule('number6', 'number6', ['required', 'number']);\r\n $validator->addRule('number7', 'number7', ['required', 'number']);\r\n $validator->addRule('number8', 'number8', ['required', 'number']);\r\n $validator->addRule('number9', 'number9', ['required', 'number']);\r\n\r\n $this->assertFalse($validator->validate());\r\n $this->assertFalse($validator->isValid());\r\n\r\n\r\n /** The field is not required, so it can be empty and contains no valid number */\r\n $this->assertFalse($validator->hasErrors('number'), $validator->getFieldError('number'));\r\n $this->assertFalse($validator->hasErrors('number2'), $validator->getFieldError('number2'));\r\n $this->assertFalse($validator->hasErrors('number3'), $validator->getFieldError('number3'));\r\n $this->assertFalse($validator->hasErrors('number4'), $validator->getFieldError('number4'));\r\n $this->assertFalse($validator->hasErrors('number5'), $validator->getFieldError('number5'));\r\n $this->assertFalse($validator->hasErrors('number6'), $validator->getFieldError('number6'));\r\n $this->assertTrue($validator->hasErrors('number7'), $validator->getFieldError('number7'));\r\n $this->assertTrue($validator->hasErrors('number8'), $validator->getFieldError('number8'));\r\n $this->assertFalse($validator->hasErrors('number9'), $validator->getFieldError('number9'));\r\n }", "function get_telephone_format($number) {\n $telephone_format = array(\n '02' => \"3,4,4\",\n '03' => \"4,3,4\",\n '05' => \"5,6\", \n '0500' => \"4,6\",\n '07' => \"5,6\",\n '08' => \"4,3,4\",\n '09' => \"4,3,4\",\n '01' => \"5,6\",\n '011' => \"4,3,4\",\n '0121' => \"4,3,4\",\n '0131' => \"4,3,4\",\n '0141' => \"4,3,4\",\n '0151' => \"4,3,4\",\n '0161' => \"4,3,4\",\n '0191' => \"4,3,4\",\n '013873' => \"6,5\", \n '015242' => \"6,5\", \n '015394' => \"6,5\",\n '015395' => \"6,5\",\n '015396' => \"6,5\",\n '016973' => \"6,5\",\n '016974' => \"6,5\",\n '017683' => \"6,5\",\n '017684' => \"6,5\",\n '017687' => \"6,5\",\n '019467' => \"6,5\",\n '0169737' => \"5,6\",\n '0169772' => \"6,4\",\n '0169773' => \"6,4\",\n '0169774' => \"6,4\"\n );\n\n // Sorts into longest key first\n uksort($telephone_format, \"sort_str_len\"); \n foreach ($telephone_format AS $key => $value) {\n if (substr($number, 0, strlen($key)) == $key) break;\n };\n return $value;\n}", "function testValidNumberFieldExpectsDataReturned() {\n\t\t$TestNumberField = new TestNumberField();\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field_one' => 2,\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestNumberField->validate($_POST['post_ID'], $TestNumberField->fields['field_one'], $validated['field_one'], array());\n\n\t\t// assert\n\t\t$expected = 2;\n\t\t$this->assertEquals(\n\t\t\t$expected,\n\t\t\t$validated['field_one'],\n\t\t\t'Numeric strings should be accepted and converted to a number.');\n\t}", "function valid_gsm_no($mobile,$formating=0)\n//Check whether a given no. is valid gsm no. or not.\n{\n\tif($formating)\n\t{\n\t\tif(strlen($mobile)==10)\n\t\t\t$mobile='91'.$mobile;\n\t}\n\tif( strlen($mobile)!=12 || !(ctype_digit($mobile)) )\n\t\treturn 0;\n\telse\n\t{\n\t\tif((substr($mobile,2,2)=='94' or substr($mobile,2,2)=='96' or substr($mobile,2,2)=='97' or substr($mobile,2,2)=='98' or substr($mobile,2,2)=='99'))\n return 1;\n\t}\n\treturn 0;\n}", "function convertNumber($num) {\n $count = 0;\n global $ones, $tens, $triplets;\n $ones = array(\n '',\n ' One',\n ' Two',\n ' Three',\n ' Four',\n ' Five',\n ' Six',\n ' Seven',\n ' Eight',\n ' Nine',\n ' Ten',\n ' Eleven',\n ' Twelve',\n ' Thirteen',\n ' Fourteen',\n ' Fifteen',\n ' Sixteen',\n ' Seventeen',\n ' Eighteen',\n ' Nineteen'\n );\n $tens = array(\n '',\n '',\n ' Twenty',\n ' Thirty',\n ' Forty',\n ' Fifty',\n ' Sixty',\n ' Seventy',\n ' Eighty',\n ' Ninety'\n );\n\n $triplets = array(\n '',\n ' Thousand',\n ' Million',\n ' Billion',\n ' Trillion',\n ' Quadrillion',\n ' Quintillion',\n ' Sextillion',\n ' Septillion',\n ' Octillion',\n ' Nonillion'\n );\n return convertNum($num);\n}", "public function testSsn() {\n $this->assertEquals('998-29-3841', Format::ssn('998293841'));\n }", "private function verifyByLuhnAlgorithm($number){ }", "public function testMaxMatchesMixed()\n {\n $numbers = '';\n for ($i = 0; $i < 100; $i++) {\n $numbers .= 'My info: 415-666-7777 123 fake street';\n }\n\n // Only matches the first 10 despite there being 100 numbers due to max matches\n $number = $this->phoneUtil->parse('+14156667777', null);\n $expected = \\array_fill(0, 10, $number);\n\n $iterable = $this->phoneUtil->findNumbers($numbers, RegionCode::US, Leniency::VALID(), 10);\n\n $actual = array();\n foreach ($iterable as $match) {\n $actual[] = $match->number();\n }\n\n $this->assertEquals($expected, $actual);\n }", "function testFormatPhone() {\n\n\t\t$ff = new Cgn_ActiveFormatter('888.123.4567');\n\t\t$phone = $ff->printAs('phone');\n\n\t\t$this->assertEquals('(888) 123-4567', $phone);\n\n setlocale(LC_ALL, 'en_US.UTF-8');\n\t\t$clean = $ff->cleanVar(utf8_encode('abc ABC 999 '.chr(0xF6) .'()()') );\n\t\t$this->assertEquals($clean, 'abc ABC 999 ');\n\n\t}", "public function testGetNumberInfo(): void\n {\n $this->assertInstanceOf(CadastralNumberInfo::class, $this->instance->getNumberInfo());\n $this->assertSame('66', $this->instance->getNumberInfo()->getRegionCode());\n $this->assertSame('41', $this->instance->getNumberInfo()->getDistrictCode());\n $this->assertSame('0105001', $this->instance->getNumberInfo()->getQuarterCode());\n $this->assertSame('3', $this->instance->getNumberInfo()->getAreaCode());\n\n $this->instance->setValue('52:25');\n $this->assertSame(\n ['region' => '52', 'district' => '25', 'quarter' => '', 'area' => ''],\n $this->instance->getNumberInfo()->getFragments()\n );\n }", "function vUSPhone( $phoneNo )\r\n\t\t{\r\n\t\t\t# Checks if number has dashes\r\n\t\t\tif( strpos( $phoneNo,'-' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[-\\s.]?\\d{3}[-\\s.]\\d{4}/x', $phoneNo);\r\n\t\t\t\t\r\n\t\t\t# Checks if number has periods\r\n\t\t\telseif( strpos( $phoneNo,'.' ) )\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?[.]?\\d{3}[.]\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t\t# Validate just numbers\t\r\n\t\t\telse\r\n\t\t\t\treturn preg_match('/\\(?\\d{3}\\)?\\d{3}\\d{4}/x', $phoneNo);\r\n\t\t\t\r\n\t\t}", "public function testUnsupportedDataAlphaToNumber()\n {\n // Input text parameters\n $input_alphabet = \"A2\";\n $expected_result = -20;\n\n // Execute test target\n $Response = Utility::alpha2num($input_alphabet);\n\n // Check result\n $this->assertEquals($expected_result, $Response);\n }", "function is_numerico($string, $min_length = 0, $max_length = 0)\r\n{\r\n //$ret = _is_valid($string, $min_length, $max_length, \"[[:digit:]]+\");\r\n //return($ret);\r\n $string=clean($string);\r\n\r\n if($min_length!=0)\r\n {\r\n if(strlen($string)<$min_length)\r\n return (false);\r\n }\r\n if($max_length!=0)\r\n {\r\n if(strlen($string)>$max_length)\r\n return (false);\r\n }\r\n for($i=0;$i<strlen($string);$i++)\r\n {\r\n if(is_digito($string{$i})==FALSE)\r\n return(false);\r\n }\r\n return(true);\r\n}", "private function correctNumbers() {\n $prefix = '+'.self::COUNTRY_CODE;\n for($i=0; $i < count($this->arNumbers); $i++) {\n if(strpos($this->arNumbers[$i], $prefix) === FALSE){\n if(strpos($this->arNumbers[$i], self::COUNTRY_CODE) === 0)\n $this->arNumbers[$i] = str_replace(self::COUNTRY_CODE, '', $this->arNumbers[$i]); \n $this->arNumbers[$i] = $prefix.$this->arNumbers[$i];\n }\n } \n }", "public function testParseCountry(): void\n {\n $result = Parser::parseCountry('ca');\n $this->assertEquals('CA', $result);\n\n $result = Parser::parseCountry('Canada');\n $this->assertEquals('CA', $result);\n\n $result = Parser::parseCountry('USA');\n $this->assertEquals('US', $result);\n\n $result = Parser::parseCountry('US');\n $this->assertEquals('US', $result);\n\n $result = Parser::parseCountry('United-States');\n $this->assertEquals('US', $result);\n\n $result = Parser::parseCountry('United-States of America');\n $this->assertEquals('US', $result);\n\n $this->assertNull(Parser::parseCountry('banana'));\n\n $this->assertEquals('UK', Parser::parseCountry('United Kingdom'));\n $this->assertEquals('UK', Parser::parseCountry('uk'));\n $this->assertEquals('UK', Parser::parseCountry('united-kingdom'));\n }", "function nip_valida($cif) {\n $cif = strtoupper($cif);\n for ($i = 0; $i < 9; $i ++)\n $num[$i] = substr($cif, $i, 1);\n//si no tiene un formato valido devuelve error\n if (!ereg('((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)', $cif))\n return 0;\n//comprobacion de NIFs estandar\n if (ereg('(^[0-9]{8}[A-Z]{1}$)', $cif))\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($cif, 0, 8) % 23, 1))\n return 1;\n else\n return -1;\n//algoritmo para comprobacion de codigos tipo CIF\n $suma = $num[2] + $num[4] + $num[6];\n for ($i = 1; $i < 8; $i += 2)\n $suma += substr((2 * $num[$i]),0,1) + substr((2 * $num[$i]),1,1);\n $n = 10 - substr($suma, strlen($suma) - 1, 1);\n//comprobacion de NIFs especiales (se calculan como CIFs)\n if (ereg('^[KLM]{1}', $cif))\n if ($num[8] == chr(64 + $n))\n return 1;\n else\n return -1;\n//comprobacion de CIFs\n if (ereg('^[ABCDEFGHJNPQRSUVW]{1}', $cif))\n if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))\n return 2;\n else\n return -2;\n//comprobacion de NIEs\n //T\n if (ereg('^[T]{1}', $cif))\n if ($num[8] == ereg('^[T]{1}[A-Z0-9]{8}$', $cif))\n return 3;\n else\n return -3;\n //XYZ\n if (ereg('^[XYZ]{1}', $cif))\n if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $cif), 0, 8) % 23, 1))\n return 3;\n else\n return -3;\n//si todavia no se ha verificado devuelve error\n return 0;\n}", "public static function parseCallNumber($callNumber);", "public function testFormat() {\n\t\t$is = $this->Numeric->format('22');\n\t\t$expected = '22,00';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 1]);\n\t\t$expected = '22,3';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -1]);\n\t\t$expected = '20';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => -2]);\n\t\t$expected = '0';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.30', ['places' => 3]);\n\t\t$expected = '22,300';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('abc', ['places' => 2]);\n\t\t$expected = '---';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t/*\n\t\t$is = $this->Numeric->format('12.2', array('places'=>'a'));\n\t\t$expected = '12,20';\n\t\t$this->assertEquals($expected, $is);\n\t\t*/\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'before' => 'EUR ']);\n\t\t$expected = 'EUR 22,30';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => ' EUR']);\n\t\t$expected = '22,30 EUR';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t$is = $this->Numeric->format('22.3', ['places' => 2, 'after' => 'x', 'before' => 'v']);\n\t\t$expected = 'v22,30x';\n\t\t$this->assertEquals($expected, $is);\n\n\t\t#TODO: more\n\n\t}" ]
[ "0.6484881", "0.6329323", "0.6162301", "0.609839", "0.58950704", "0.58746946", "0.58741057", "0.5783783", "0.573542", "0.57323104", "0.5713046", "0.5691429", "0.5675164", "0.56374824", "0.5592286", "0.5588977", "0.55550027", "0.5536587", "0.5531358", "0.55024105", "0.54725873", "0.5458182", "0.54461133", "0.5442512", "0.54413867", "0.5419816", "0.5414713", "0.5412878", "0.5412874", "0.5407806" ]
0.7553331
0
Test parsing fixedline numbers of Mexico.
public function testFindNumbersMexico() { $this->doTestFindInContext('+52 (449)978-0001', RegionCode::MX); $this->doTestFindInContext('01 (449)978-0001', RegionCode::MX); $this->doTestFindInContext('(449)978-0001', RegionCode::MX); // Test parsing mobile numbers of Mexico. $this->doTestFindInContext('+52 1 33 1234-5678', RegionCode::MX); $this->doTestFindInContext('044 (33) 1234-5678', RegionCode::MX); $this->doTestFindInContext('045 33 1234-5678', RegionCode::MX); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetLineNumber()\n {\n $this->assertEquals(' 1', $this->template->getLineNumber('1'));\n $this->assertEquals(' 21', $this->template->getLineNumber('21'));\n $this->assertEquals('321', $this->template->getLineNumber('321'));\n }", "public function testIntermediateParsePositions()\n {\n $text = 'Call 033316005 or 032316005!';\n // | | | | | |\n // 0 5 10 15 20 25\n\n // Iterate over all possible indices.\n for ($i = 0; $i <= 5; $i++) {\n $this->assertEqualRange($text, $i, 5, 14);\n }\n // 7 and 8 digits in a row are still parsed as number.\n $this->assertEqualRange($text, 6, 6, 14);\n $this->assertEqualRange($text, 7, 7, 14);\n // Anything smaller is skipped to the second instance.\n for ($i = 8; $i <= 19; $i++) {\n $this->assertEqualRange($text, $i, 19, 28);\n }\n }", "function testLine ($str) {\r\n $testLineResult = TRUE;\r\n if (strlen($str) > 88) {\r\n $testLineResult = FALSE;\r\n } else if (!preg_match('/[0-9]{16}/',$str)) {\r\n $testLineResult = FALSE;\r\n }\r\n return $testLineResult;\r\n}", "function ARFFcheck($filepath, $numLines = 100)\n{\n\t// read header section\n\t$featureType = [];\n\t$numberOfNonNumericFeatures = 0;\n\t$filehandle = fopen($filepath, \"r\");\n\t$line = '';\n\t$lineNumber = 0; // actual line numbers start at 1\n\twhile (($line = fgets($filehandle)) !== false)\n\t{\n\t\t$line = trim($line);\n\t\t$lineNumber++;\n\t\tif ($line == \"\") { }\n\t\telse if ($line[0] == '%') { }\n\t\telse if ($line[0] == '@')\n\t\t{\n\t\t\t$pos = strpos($line, \" \");\n\t\t\tif ($pos === FALSE) $pos = strlen($line);\n\t\t\t$type = strtolower(substr($line, 0, $pos));\n\t\t\tif ($type == \"@data\")\n\t\t\t{\n\t\t\t\tif ($pos != strlen($line))\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"trailing content in @data line (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if ($type == \"@relation\")\n\t\t\t{\n\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \" %\");\n\t\t\t\tif (is_string($pos))\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\t\t\t\tif ($pos != strlen($line))\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"trailing content in @relation line (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ($type == \"@attribute\")\n\t\t\t{\n\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \" %\");\n\t\t\t\tif (is_string($pos))\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\n\t\t\t\tif ($line[$pos] == '{')\n\t\t\t\t{\n\t\t\t\t\t$pos++;\n\t\t\t\t\t$values = [];\n\t\t\t\t\twhile (TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \",}%\");\n\t\t\t\t\t\tif (is_string($pos)) {\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray_push($values, $s);\n\t\t\t\t\t\tif ($line[$pos] == ',') $pos++;\n\t\t\t\t\t\telse if ($line[$pos] == '}') { $pos++; break; }\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"format error in nominal attribute declaration\" . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($featureType, $values);\n\t\t\t\t\t$numberOfNonNumericFeatures++;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \" %\");\n\t\t\t\t\tif (is_string($pos)) {\n\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t}\n\t\t\t\t\t$s = strtolower($s);\n\t\t\t\t\tif ($s == \"binary\" or $s == \"integer\" or $s == \"real\") $s = \"numeric\"; // map nonofficial types to official numeric type\n\t\t\t\t\tif ($s != \"numeric\" and $s != \"string\" and $s != \"date\")\n\t\t\t\t\t{\n\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\treturn \"unsupported attribute type: \" . $s . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t}\n\t\t\t\t\tarray_push($featureType, $s);\n\t\t\t\t}\n\n\t\t\t\tif ($pos != strlen($line))\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"trailing content in @attribute line\" . \" (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfclose($filehandle);\n\t\t\t\treturn \"unsupported header field: \" . $type . \" (l.\".$lineNumber.\")\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfclose($filehandle);\n\t\t\treturn \"invalid line in ARFF header: \" . $line . \" (l.\".$lineNumber.\")\";\n\t\t}\n\t}\n\t$p = count($featureType); // number of features\n\n\t// read up to $numLines lines of data\n\t$counter = 0;\n\t$format = \"\";\n\twhile (($line = fgets($filehandle)) !== false)\n\t{\n\t\t$line = trim($line);\n\t\t$lineNumber++;\n\n\t\tif ($line == \"\") { }\n\t\telse if ($line[0] == '%') { }\n\t\telse\n\t\t{\n\t\t\t$len = strlen($line);\n\t\t\t$s = \"\";\n\t\t\tif ($line[0] == '{')\n\t\t\t{\n\t\t\t\tif ($format == \"dense\")\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"mixing dense and sparse data lines is invalid\";\n\t\t\t\t}\n\t\t\t\t$format = \"sparse\";\n\n\t\t\t\t// sparse data\n\t\t\t\t// 1. check that all specified features have valid values\n\t\t\t\t// 2. check that all nominal features are specified explicitly\n\t\t\t\t$nonnum = 0;\n\t\t\t\t$pos = 1;\n\t\t\t\twhile ($pos < $len and $line[$pos] == ' ') $pos++;\n\t\t\t\tif ($pos < $len and $line[$pos] == '}')\n\t\t\t\t{\n\t\t\t\t\t// empty feature set is syntactically correct\n\t\t\t\t\t// as long as all features are numeric\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\twhile (TRUE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \" %\");\n\t\t\t\t\t\tif (is_string($pos)) {\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i = intval($s);\n\t\t\t\t\t\tif ($i < 0 or $i >= $p)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"invalid feature index: \" . $i . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \",}%\");\n\t\t\t\t\t\tif (is_string($pos)) {\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$n = $featureType[$i];\n\n\t\t\t\t\t\t// check validity of the value\n\t\t\t\t\t\tif ($n == \"numeric\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($s != '?' and ! is_numeric($s))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\t\treturn \"invalid value for numeric attribute: \" . $s . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($n == \"string\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// everything is allowed here\n\t\t\t\t\t\t\t$nonnum++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($n == \"date\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// date strings are non-trivial to validate, ignore\n\t\t\t\t\t\t\t$nonnum++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// check nominal attribute\n\t\t\t\t\t\t\tassert(is_array($n));\n\t\t\t\t\t\t\tif ($s != '?' and array_search($s, $n) === FALSE)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\t\treturn \"invalid value for nominal attribute: \" . $s . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$nonnum++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($pos == $len)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"closing brace missing in sparse data line \" . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($line[$pos] == '}') { $pos++; break; }\n\t\t\t\t\t\t$pos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($nonnum != $numberOfNonNumericFeatures)\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"at least one string, date, or nominal feature value is missing; this is disallowed in sparse data format \" . \" (l.\".$lineNumber.\")\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($format == \"sparse\")\n\t\t\t\t{\n\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\treturn \"mixing dense and sparse data lines is invalid\";\n\t\t\t\t}\n\t\t\t\t$format = \"dense\";\n\n\t\t\t\t// dense data\n\t\t\t\t$pos = 0;\n\t\t\t\tfor ($i=0; $i<$p; $i++)\n\t\t\t\t{\n\t\t\t\t\t$pos = ARFFparseString($line, $pos, $s, \",%\");\n\t\t\t\t\tif (is_string($pos))\n\t\t\t\t\t{\n\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\treturn $pos . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t}\n\t\t\t\t\t$n = $featureType[$i];\n\n\t\t\t\t\t// check validity of the value\n\t\t\t\t\tif ($n == 'numeric')\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($s != '?' and ! is_numeric($s))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"invalid value for numeric attribute: \" . $s . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse if ($n == 'string')\n\t\t\t\t\t{\n\t\t\t\t\t\t// everything is allowed here\n\t\t\t\t\t}\n\t\t\t\t\telse if ($n == 'date')\n\t\t\t\t\t{\n\t\t\t\t\t\t// date strings are non-trivial to validate, ignore\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// check nominal attribute\n\t\t\t\t\t\tassert(is_array($n));\n\t\t\t\t\t\tif ($s != '?' and array_search($s, $n) === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"invalid value for nominal attribute: \" . $s . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($i + 1 < $p)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($line[$pos] != ',')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfclose($filehandle);\n\t\t\t\t\t\t\treturn \"too few feature values \" . \" (l.\".$lineNumber.\")\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($pos < $len)\n\t\t\t{\n\t\t\t\tfclose($filehandle);\n\t\t\t\treturn \"trailing characters on data line \" . \" (l.\".$lineNumber.\")\";\n\t\t\t}\n\t\t}\n\t\t$counter++;\n\t\tif ($counter == $numLines) break; // for performance reasons we stop after a fixed number of data lines\n\t}\n\n\t// judged as valid\n\treturn TRUE;\n}", "function checkfor_valid_Facs_payment_line($line){\r\n\t$valid = 0;\r\n\t$recordBeginning = substr($line, 0, 2);\r\n\tif($recordBeginning == 11){\r\n\t\t$valid = 1;\r\n\t}else { $valid = 0; }\r\n\treturn $valid;\r\n}", "public function testFindNationalNumberArgentina()\n {\n $this->doTestFindInContext('+54 9 343 555 1212', RegionCode::AR);\n $this->doTestFindInContext('0343 15 555 1212', RegionCode::AR);\n\n $this->doTestFindInContext('+54 9 3715 65 4320', RegionCode::AR);\n $this->doTestFindInContext('03715 15 65 4320', RegionCode::AR);\n\n // Test parsing fixed-line numbers of Argentina.\n $this->doTestFindInContext('+54 11 3797 0000', RegionCode::AR);\n $this->doTestFindInContext('011 3797 0000', RegionCode::AR);\n\n $this->doTestFindInContext('+54 3715 65 4321', RegionCode::AR);\n $this->doTestFindInContext('03715 65 4321', RegionCode::AR);\n\n $this->doTestFindInContext('+54 23 1234 0000', RegionCode::AR);\n $this->doTestFindInContext('023 1234 0000', RegionCode::AR);\n }", "public function testLineIntrospection() {\n\t\t$backup = error_reporting();\n\t\terror_reporting(E_ALL);\n\n\t\t$result = Inspector::lines(__FILE__, [__LINE__ - 4]);\n\t\t$expected = [__LINE__ - 5 => \"\\tpublic function testLineIntrospection() {\"];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$result = Inspector::lines(__CLASS__, [18]);\n\t\t$expected = [18 => 'class InspectorTest extends \\lithium\\test\\Unit {'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$lines = 'This is the first line.' . PHP_EOL . 'And this the second.';\n\t\t$result = Inspector::lines($lines, [2]);\n\t\t$expected = [2 => 'And this the second.'];\n\t\t$this->assertEqual($expected, $result);\n\n\t\t$this->assertException('/(Missing argument 2|Too few arguments.*1 passed.*2 expected)/', function() {\n\t\t\tInspector::lines('lithium\\core\\Foo');\n\t\t});\n\t\t$this->assertNull(Inspector::lines(__CLASS__, []));\n\n\t\terror_reporting($backup);\n\t}", "public static function Parse835()\n\t{\n\n\t}", "public function getLine_numbers()\n\t{\n\t\treturn $this->getParser()->line_numbers;\n\t}", "function mDIGIT(){\n try {\n // Tokenizer11.g:366:3: ( '0' .. '9' ) \n // Tokenizer11.g:367:3: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public static function Parse837()\n\t{\n\n\t}", "function checkValidLine_Y9155a($line){\r\n\t\t$firstTwoChars = substr($line, 0, 2);\r\n\t\t$lastSevenChars = substr($line, 2, 7);\r\n\r\n\t\tif($firstTwoChars == \"CB\"){ //we're looking for \"CB\" followed by 7 digits to start populating a record\r\n\t\t\tif(is_numeric($lastSevenChars)){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t} //end if\r\n\t\t//return $valid;\r\n\t}", "function mINTEGER(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$INTEGER;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:347:3: ( ( '0' .. '9' )+ ) \n // Tokenizer11.g:348:3: ( '0' .. '9' )+ \n {\n // Tokenizer11.g:348:3: ( '0' .. '9' )+ \n $cnt6=0;\n //loop6:\n do {\n $alt6=2;\n $LA6_0 = $this->input->LA(1);\n\n if ( (($LA6_0>=$this->getToken('48') && $LA6_0<=$this->getToken('57'))) ) {\n $alt6=1;\n }\n\n\n switch ($alt6) {\n \tcase 1 :\n \t // Tokenizer11.g:348:4: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt6 >= 1 ) break 2;//loop6;\n $eee =\n new EarlyExitException(6, $this->input);\n throw $eee;\n }\n $cnt6++;\n } while (true);\n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "abstract public function parse( $line );", "public function testParseThrowsExceptionWhenInvalidFormatting(): void\n {\n $lines = ['double=equals=here'];\n\n $parser = new IniParser('');\n $parser->setFileLines($lines);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Too many equals in line: double=equals=here');\n $parser->parse();\n }", "public function testDecodeIntegerLeadingZero()\n {\n $this->expectException(ParseException::class);\n $this->expectExceptionMessage('Invalid integer format or integer overflow');\n Bencode::decode('i013e');\n }", "public function testGetFileLinesReturnsLinesFromPreviouslySetLines(): void\n {\n $lines = ['first', 'second', 'third'];\n\n $parser = new IniParser('');\n $parser->setFileLines($lines);\n\n self::assertSame($lines, $parser->getFileLines());\n }", "function it_allows_for_custom_delimeters_1_3_4()\n {\n $this->add('//;\\n1;3;4')->shouldEqual(8);\n }", "public function testDecodeIntegerFakeString()\n {\n $this->expectException(ParseException::class);\n $this->expectExceptionMessage('Invalid integer format or integer overflow');\n\n Bencode::decode('iffafwe');\n }", "function mDECIMAL(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DECIMAL;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:352:3: ( ( '0' .. '9' )+ DOT ( '0' .. '9' )* | DOT ( '0' .. '9' )+ ) \n $alt10=2;\n $LA10_0 = $this->input->LA(1);\n\n if ( (($LA10_0>=$this->getToken('48') && $LA10_0<=$this->getToken('57'))) ) {\n $alt10=1;\n }\n else if ( ($LA10_0==$this->getToken('46')) ) {\n $alt10=2;\n }\n else {\n $nvae = new NoViableAltException(\"\", 10, 0, $this->input);\n\n throw $nvae;\n }\n switch ($alt10) {\n case 1 :\n // Tokenizer11.g:353:3: ( '0' .. '9' )+ DOT ( '0' .. '9' )* \n {\n // Tokenizer11.g:353:3: ( '0' .. '9' )+ \n $cnt7=0;\n //loop7:\n do {\n $alt7=2;\n $LA7_0 = $this->input->LA(1);\n\n if ( (($LA7_0>=$this->getToken('48') && $LA7_0<=$this->getToken('57'))) ) {\n $alt7=1;\n }\n\n\n switch ($alt7) {\n \tcase 1 :\n \t // Tokenizer11.g:353:4: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt7 >= 1 ) break 2;//loop7;\n $eee =\n new EarlyExitException(7, $this->input);\n throw $eee;\n }\n $cnt7++;\n } while (true);\n\n $this->mDOT(); \n // Tokenizer11.g:353:19: ( '0' .. '9' )* \n //loop8:\n do {\n $alt8=2;\n $LA8_0 = $this->input->LA(1);\n\n if ( (($LA8_0>=$this->getToken('48') && $LA8_0<=$this->getToken('57'))) ) {\n $alt8=1;\n }\n\n\n switch ($alt8) {\n \tcase 1 :\n \t // Tokenizer11.g:353:20: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop8;\n }\n } while (true);\n\n\n }\n break;\n case 2 :\n // Tokenizer11.g:354:5: DOT ( '0' .. '9' )+ \n {\n $this->mDOT(); \n // Tokenizer11.g:354:9: ( '0' .. '9' )+ \n $cnt9=0;\n //loop9:\n do {\n $alt9=2;\n $LA9_0 = $this->input->LA(1);\n\n if ( (($LA9_0>=$this->getToken('48') && $LA9_0<=$this->getToken('57'))) ) {\n $alt9=1;\n }\n\n\n switch ($alt9) {\n \tcase 1 :\n \t // Tokenizer11.g:354:10: '0' .. '9' \n \t {\n \t $this->matchRange(48,57); \n\n \t }\n \t break;\n\n \tdefault :\n \t if ( $cnt9 >= 1 ) break 2;//loop9;\n $eee =\n new EarlyExitException(9, $this->input);\n throw $eee;\n }\n $cnt9++;\n } while (true);\n\n\n }\n break;\n\n }\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function testFindNationalNumber()\n {\n $this->doTestFindInContext('033316005', RegionCode::NZ);\n // (\"33316005\", RegionCode.NZ) is omitted since the national prefix is obligatory for these\n // types of numbers in New Zealand.\n // National prefix attached and some formatting present.\n $this->doTestFindInContext('03-331 6005', RegionCode::NZ);\n $this->doTestFindInContext('03 331 6005', RegionCode::NZ);\n // Testing international prefixes.\n // Should strip country code.\n $this->doTestFindInContext('0064 3 331 6005', RegionCode::NZ);\n // Try again, but this time we have an international number with Region Code US. It should\n // recognize the country code and parse accordingly.\n $this->doTestFindInContext('01164 3 331 6005', RegionCode::US);\n $this->doTestFindInContext('+64 3 331 6005', RegionCode::US);\n\n $this->doTestFindInContext('64(0)64123456', RegionCode::NZ);\n // Check that using a \"/\" is fine in a phone number.\n // Note that real Polish numbers do *not* start with a 0.\n $this->doTestFindInContext('0123/456789', RegionCode::PL);\n $this->doTestFindInContext('123-456-7890', RegionCode::US);\n }", "public function testParseWithTokensInSequenceForThousands(): void\n {\n $this->assertSame(4000, $this->parser->parse([Grammar::T_M, Grammar::T_M, Grammar::T_M, Grammar::T_M]));\n\n $this->assertSame(5000, $this->parser->parse([\n Grammar::T_M,\n Grammar::T_M,\n Grammar::T_M,\n Grammar::T_M,\n Grammar::T_M,\n ]));\n }", "public function testIniParseQuantityNoLeadingDigits()\n {\n error_clear_last();\n $this->assertSame(0, @ini_parse_quantity(' K '));\n $this->assertSame('Invalid quantity \" K \": no valid leading digits, interpreting as \"0\" for backwards compatibility', error_get_last()['message']);\n $this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);\n }", "public function testPhoneNumberWithLeadingOrTrailingMoneyMatches()\n {\n // the actual number from being found.\n $contexts = array();\n $contexts[] = array('$20 ', '');\n $contexts[] = array('', ' 100$');\n\n $this->findMatchesInContexts($contexts, true, true);\n }", "function it_allows_for_new_line_delimiters_and_finds_the_sum_of_1_2_4()\n {\n $this->add('1,\\n2,4')->shouldEqual(7);\n }", "public function testGetOffset(): void\n {\n $model = ProcessMemoryMap::load([\n \"offset\" => 46290,\n ], $this->container);\n\n $this->assertSame(46290, $model->getOffset());\n }", "function numberdecode($wholefile, $start)\n{\n\t$ret[0] = 0;\n\t$offset = $start;\n\n\t// Funky handling of negative numbers and zero\n\t$negative = false;\n\tif ($wholefile[$offset] == '-')\n\t{\n\t\t$negative = true;\n\t\t$offset++;\n\t}\n\tif ($wholefile[$offset] == '0')\n\t{\n\t\t$offset++;\n\t\tif ($negative)\n\t\t\treturn array(false);\n\t\tif ($wholefile[$offset] == ':' || $wholefile[$offset] == 'e')\n\t\t{\n\t\t\t$offset++;\n\t\t\t$ret[0] = 0;\n\t\t\t$ret[1] = $offset;\n\t\t\treturn $ret;\n\t\t}\n\t\treturn array(false);\n\t}\n\twhile (true)\n\t{\n\n\t\tif ($wholefile[$offset] >= '0' && $wholefile[$offset] <= '9')\n\t\t{\n\t\t\t\n\t\t\t$ret[0] *= 10;\n\t\t\t$ret[0] += ord($wholefile[$offset]) - ord(\"0\");\n\t\t\t$offset++;\n\t\t}\n\t\t// Tolerate : or e because this is a multiuse function\n\t\telse if ($wholefile[$offset] == 'e' || $wholefile[$offset] == ':')\n\t\t{\n\t\t\t$ret[1] = $offset+1;\n\t\t\tif ($negative)\n\t\t\t{\n\t\t\t\tif ($ret[0] == 0)\n\t\t\t\t\treturn array(false);\n\t\t\t\t$ret[0] = - $ret[0];\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse\n\t\t\treturn array(false);\n\t}\n\n}", "public function testParseWithFourSimpleTokensInSequence(): void\n {\n $this->expectException(ParserException::class);\n $this->expectExceptionMessage('Invalid Roman');\n $this->expectExceptionCode(ParserException::INVALID_ROMAN);\n\n $this->parser->parse([Grammar::T_I, Grammar::T_I, Grammar::T_I, Grammar::T_I]);\n }", "public function testLineaEmpresaNumero() {\n\t\t$linea = \"143 Roja\";\n\t\t$numero = 13;\n\t\t$empresa = \"Rosario Bus\";\n\n\t\t$colectivo = new Colectivo( $linea, $empresa, $numero );\n\n\t\t$this->assertEquals( $linea, $colectivo->linea() );\n\t\t$this->assertEquals( $numero, $colectivo->numero() );\n\t\t$this->assertEquals( $empresa, $colectivo->empresa() );\n\t}", "public function testMaxMatchesInvalid()\n {\n $numbers = '';\n for ($i = 0; $i < 10; $i++) {\n $numbers .= 'My address is 949-8945-0';\n }\n for ($i = 0; $i < 100; $i++) {\n $numbers .= 'My info: 415-666-7777,';\n }\n\n $iterable = $this->phoneUtil->findNumbers($numbers, RegionCode::US, Leniency::VALID(), 10);\n $iterable->next();\n $this->assertNull($iterable->current());\n }" ]
[ "0.6301832", "0.5825416", "0.53925323", "0.53776824", "0.53758085", "0.5349699", "0.53096724", "0.5289443", "0.52533185", "0.5239496", "0.52291906", "0.5160248", "0.51454484", "0.5144845", "0.5134863", "0.5117174", "0.51083636", "0.5075281", "0.5075053", "0.5073078", "0.5042897", "0.5021974", "0.50172764", "0.5001524", "0.4998196", "0.49843645", "0.4979448", "0.4974284", "0.4968062", "0.49610388" ]
0.65382975
0
Contexts with trailing characters. Leading characters are okay here since the numbers we will
public function testMatchesWithSurroundingLatinCharsAndLeadingPunctuation() { // insert start with punctuation, but trailing characters are still not allowed. $possibleOnlyContexts = array(); $possibleOnlyContexts[] = array('abc', 'def'); $possibleOnlyContexts[] = array('', 'def'); $possibleOnlyContexts[] = array('', "\xC3\x89"); // Numbers should not be considered valid, if they have trailing Latin characters, but should be // considered possible. $numberWithPlus = '+14156667777'; $numberWithBrackets = '(415)6667777'; $this->findMatchesInContexts($possibleOnlyContexts, false, true, RegionCode::US, $numberWithPlus); $this->findMatchesInContexts($possibleOnlyContexts, false, true, RegionCode::US, $numberWithBrackets); $validContexts = array(); $validContexts[] = array('abc', ''); $validContexts[] = array("\xC3\x89", ''); $validContexts[] = array("\xC3\x89", '.'); // Trailing punctuation. $validContexts[] = array("\xC3\x89", ' def'); // Trailing white space. // Numbers should be considered valid, since they start with punctuation. $this->findMatchesInContexts($validContexts, true, true, RegionCode::US, $numberWithPlus); $this->findMatchesInContexts($validContexts, true, true, RegionCode::US, $numberWithBrackets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPhoneNumberWithLeadingOrTrailingMoneyMatches()\n {\n // the actual number from being found.\n $contexts = array();\n $contexts[] = array('$20 ', '');\n $contexts[] = array('', ' 100$');\n\n $this->findMatchesInContexts($contexts, true, true);\n }", "function catalogue_format_tel($value) {\n\t$value_array = str_split($value);\n\t$value = '';\n\n\tforeach ($value_array as $char) {\n\t\tif (is_numeric($char) || $char == '+' || $char == '(' || $char == ')') {\n\t\t\t$value .= $char;\n\t\t}\n\t}\n\n\treturn $value;\n}", "public function testParsingWithTrailingPeriod(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "public function remainingChars();", "function non_breaking_phone_number() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t//print('here33495905060<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+))(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t// I am guessing; not necessary\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t} else {\r\n\t\t\t\t//print('here33495905061<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(1((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((\\.|\\-|' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$0</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7 $10</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7-$10</span>', $this->code, -1, $b);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7.$10</span>', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)((\\(?[0-9]{3}\\)?)(' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//print('here33495905062<br>');\r\n\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '$1&nbsp;$3', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(1)((' . $this->spaceRegex . ')+){0,1}(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $c);\r\n\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $a);\r\n\t//\t\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7-$10', $this->code, -1, $b);\r\n\t//\t\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7.$10', $this->code, -1, $c);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7', $this->code, -1, $e);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7', $this->code, -1, $f);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $g);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4', $this->code, -1, $h);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4', $this->code, -1, $i);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8&nbsp;$11$12', $this->code, -1, $a);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8$9', $this->code, -1, $d);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5$6', $this->code, -1, $g);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8.$11$12', $this->code, -1, $c);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8$9', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5$6', $this->code, -1, $i);\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$count = $a + $b + $c + $d + $e + $f + $g + $h + $i;\r\n\t\t//$count = $a + $b + $c;\r\n\t\t//var_dump($a, $b, $c, $d, $e);\r\n\t\t$this->logMsgIf(\"non_breaking_phone_number\", $count);\r\n\t}", "static function numeric( $st_data )\r\n {\r\n $st_data = preg_replace(\"([[:punct:]]|[[:alpha:]]| )\",'',$st_data);\r\n return $st_data; \r\n }", "function non_breaking_dollar_amounts() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '<span class=\"noWrap\">$1$2 $4</span>$5', $this->code, -1, $a);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '<span style=\"white-space: nowrap;\">$1$2 $4</span>$5', $this->code, -1, $a);\r\n\t\t\t}\r\n\t\t} else { // default to nbsp\r\n\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '$1$2&nbsp;$4$5', $this->code, -1, $b);\r\n\t\t}\r\n\t\t$count = $a + $b;\r\n\t\t$this->logMsgIf(\"non_breaking_dollar_amounts\", $count);\r\n\t}", "function commify ($str) { \n $n = strlen($str); \n if ($n <= 3) { \n $return=$str;\n }else { \n $pre=substr($str,0,$n-3); \n $post=substr($str,$n-3,3); \n $pre=number_format($pre); \n $return=\"$pre,$post\"; \n }\n return($return); \n}", "public function testParsingWithTrailingPeriodAndParseExtensions(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}/{action}/*');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something.', 'GET'));\n $this->assertSame('something.', $result['pass'][0], 'Period was chopped off');\n\n $result = Router::parseRequest($this->makeRequest('/posts/view/something. . .', 'GET'));\n $this->assertSame('something. . .', $result['pass'][0], 'Period was chopped off');\n }", "function tel_cyf($telstr)\r\n{\r\n $tel = 0; \r\n $i = 0; \r\n $len = strlen($telstr);\r\n while($i < $len)\r\n {\r\n $kr = substr($telstr, $i, 1); \r\n if(is_numeric($kr)) \r\n { \r\n $tel ++; \r\n } \r\n $i ++;\r\n }\r\n return $tel;\r\n}", "private function trailing_zero($count, $length=5) {\r\n\t\t// is numeric or not\r\n\t\tif (is_numeric($count)) {\r\n\t\t\t$num_string = \"\";\r\n\t\t\t$length -= strlen($count);\r\n\t\t\tfor ($i = 0; $i < $length; ++$i) {\t\t\t\t\r\n\t\t\t\t$num_string .= \"0\";\r\n\t\t\t}\r\n\t\t\t$num_string .= $count;\r\n\t\t\treturn $num_string;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function smarty_modifier_phone($string)\n{\n $numbers = preg_replace('/\\D/','',$string);\n \n if(strlen($numbers) == 10) {\n \n // format as US phone\n $zip = substr($numbers,0,3);\n $part1 = substr($numbers,3,3);\n $part2 = substr($numbers,6,4);\n \n return '('.$zip.')'.$part1.'-'.$part2;\n \n } else {\n \n return $string;\n \n }\n \n}", "function remove_Trailing_zeros($val)\n{\n\t$exp_arr = explode('.',$val);\n\tif(count($exp_arr)>1)\n\t{\n\t\tif ($exp_arr[1]=='00')// if the second element is array is 00 then dont return that otherwise return the decimal part as well\n\t\t\treturn $exp_arr[0];\n\t\telse \t\n\t\t\treturn $val;\n\t}\n\telse \t\n\t\treturn $val;\n}", "function escapeValue($value) {\r\n\r\n $result = \"\";\r\n \r\n for ($i=0;$i<strlen($value);$i++) {\r\n \r\n $char = substr($value,$i,1);\r\n if ($char == \"-\") $result .= \"-\";\r\n elseif ($char == \".\") $result .= \".\";\r\n elseif (($char >= \"0\") && ($char <= \"9\")) $result .= $char;\r\n \r\n }\r\n \r\n if ($result == \"\") $result = \"0\";\r\n \r\n return $result;\r\n\r\n}", "function tep_return_broken($bad_string) {\n $char_count = 35;\n $formatted_string = '';\n $countbefore = 0;\n $i = 0;\n while ($i < strlen($bad_string)) {\n $formatted_string .= $bad_string[$i];\n $countbefore ++;\n if ($countbefore > $char_count) {\n $formatted_string .= chr(13);\n $countbefore = 0;\n }\n $i ++;\n } // End of while loop on strlen of bad string\n return $formatted_string;\n}", "protected function linear_whitespace()\n {\n }", "function _fourD_analysis_trim_decimal( $d=null ) {\n $str = '0.0';\n if( $d != null && trim($d) != '' ){\n $str = number_format($d, 10);\n $str = preg_replace('/0+$/is', '', $str); // rip trailing 0's\n \n// fourD_analysis_debug('_fourD_analysis_trim_decimal('.$d.'); $str: '.$str.'; strripos($str, \".\"): ' .strripos($str, '.') .', strlen($str): '.strlen($str) );\n\n if( strripos($str, '.') == (strlen($str)-1) ){\n $str = $str.'0';\n// fourD_analysis_debug('_fourD_analysis_trim_decimal('.$d.'); $str: '.$str.'; ' .strripos($str, '.') .' == '.(strlen($str)-1) );\n }\n// fourD_analysis_debug('_fourD_analysis_trim_decimal('.$d.'); ret $str: '.$str.'; strripos($str, \".\"): ' .strripos($str, '.') .', strlen($str): '.strlen($str) );\n\n }\n return $str;\n}", "function snmp_fix_numeric($value)\n{\n if (is_numeric($value)) { return $value + 0; } // If already numeric just return value\n\n $numeric = trim($value, \" \\t\\n\\r\\0\\x0B\\\"\");\n list($numeric) = explode(' ', $numeric);\n $numeric = preg_replace('/[^0-9a-z\\-,\\.]/i', '', $numeric);\n // Some retarded devices report data with spaces and commas: STRING: \" 20,4\"\n $numeric = str_replace(',', '.', $numeric);\n if (is_numeric($numeric))\n {\n // If cleaned data is numeric return number\n return $numeric + 0;\n } else {\n // Else return original value\n return $value;\n }\n}", "function mswReverseTicketNumber($num) {\n return ltrim($num,'0');\n}", "function it_allows_for_new_line_delimiters_and_finds_the_sum_of_1_2_4()\n {\n $this->add('1,\\n2,4')->shouldEqual(7);\n }", "public function getSplittingExpression()\n\t{\n\t\treturn '[\\p{Ll}0-9]+(?=_?)';\n\t}", "public function getLeading() {}", "public function getLeading() {}", "private static function consumeNumber ($contents,&$pos) {\n\t\t/*_Some valid samples:_\n\t\t[123],[.123],[123.],[123.123],[-123.123],\n\t\t[+123.123], //The plus is not adding but simply (redundantly)denoting that it's a positive value\n\t\t[0123], //octal number (equivalent to 83 decimal)\n\t\t[0x1A], //hexadecimal number (equivalent to 26 decimal)\n\t\t[0b11111111] //binary number (equivalent to 255 decimal)*/\n\t\t$startPos=$pos;//save initial value of $pos\n\t\t//first get leading +/- if present out of the way\n\t\tif (strpos('-+', $contents[$pos]!==false))\n\t\t\t++$pos;\n\t\t\n\t\t//if a decimal point is encountered when reading non decimal then that is not part of the number,\n\t\t//but when reading decimal then one dot may be tolerated\n\t\t\n\t\t//if first character (except leading +/- if present, since already skipped) is . or 1-9(not 0) then\n\t\t//the number is decimal. if so then one decimal point in the number can be tolerated\n\t\t$tolerateDecimalPoint=strpos('123456789',$contents[$pos])!==false;\n\t\t\n\t\t//get first non 0123456789abcdefABCDEF\n\t\t//if that character was \".\" and $tolerateDecimalPoint==true then condition falls true\n\t\tif (preg_match('/[^\\da-fA-F]/',$contents,$match,0,$pos)&&$match[0]=='.'&&$tolerateDecimalPoint)\n\t\t\tpreg_match('/[^\\d]/',$contents,$match,0,$pos+=strlen($match[0]));//...and we read in the rest\n\t\t$pos+=strlen($match[0]);//now $pos should be at the first character after the number\n\t\treturn substr($contents, $startPos,$pos-$startPos);//return the number-string\n\t}", "public static function lineBreakCorrectlyTransformedOnWayToRteProvider() {}", "static function alphaNum( $st_data )\r\n {\r\n $st_data = preg_replace(\"([[:punct:]]| )\",'',$st_data);\r\n return $st_data;\r\n }", "function number_trim($str_number) {\n $str_number = \\strval($str_number);\n if (\\strpos($str_number, \".\") !== false)\n $str_number = \\rtrim(\\rtrim($str_number, \"0\"), \".\");\n $str_number = \\ltrim($str_number, \"0\");\n if ($str_number == \"\" || $str_number[0] == \".\")\n $str_number = \"0$str_number\";\n return $str_number;\n}", "public function getPhoneDelimitedByPeriods() {\n $phone = $this->phone;\n if(strlen($phone) == 10) { // 10 digits in a north american number\n return substr($phone, 0, 3) . '.' . substr($phone, 3, 3) . '.' . substr($phone, 6, 4);\n } else {\n return $phone;\n }\n }", "private function generateRowsCharacters()\n {\n $this->rowsCharacters->add([\"+\"]);\n $rowIndex = 1;\n while ($this->shapeIsNotComplete($rowIndex)) {\n $row = $this->getRow($rowIndex);\n $this->rowsCharacters->add($row);\n $rowIndex++;\n }\n }", "public function NIVEL_ED(){\n $ch12 = $this->caracteristicas->CH12;\n $ch13 = $this->caracteristicas->CH13;\n $ch10 = $this->caracteristicas->CH10;\n if($ch10 == 3)\n {\n return 0;\n }\n if ($ch12 == 1 && $ch13 == 1) {\n return 1;\n }\n if ($ch12 == 2 && $ch13 == 1) {\n return 1;\n }\n if ($ch12 == 3 && $ch13 == 1) {\n return 1;\n }\n if ($ch12 == 4 && $ch13 == 1) {\n return 1;\n }\n if ($ch12 == 5 && $ch13 == 2) {\n return 1;\n }\n if ($ch12 == 6 && $ch13 == 2) {\n return 1;\n }\n //\n if ($ch12 == 5 && $ch13 == 1) {\n return 2;\n }\n if ($ch12 == 6 && $ch13 == 1) {\n return 2;\n }\n //\n if ($ch12 == 7 && $ch13 == 2) {\n return 3;\n }\n if ($ch12 == 8 && $ch13 == 2) {\n return 3;\n }\n if ($ch12 == 9 && $ch13 == 2) {\n return 3;\n }\n if ($ch12 == 10 && $ch13 == 2) {\n return 3;\n }\n //\n if ($ch12 == 7 && $ch13 == 1) {\n return 4;\n }\n if ($ch12 == 8 && $ch13 == 1) {\n return 4;\n }\n if ($ch12 == 9 && $ch13 == 1) {\n return 4;\n }\n if ($ch12 == 10 && $ch13 == 1) {\n return 4;\n }\n //\n if ($ch12 == 11 && $ch13 == 2) {\n return 5;\n }\n if ($ch12 == 12 && $ch13 == 2) {\n return 5;\n }\n //\n if ($ch12 == 11 && $ch13 == 1) {\n return 6;\n }\n if ($ch12 == 12 && $ch13 == 1) {\n return 6;\n }\n //\n if ($ch12 == 13 && $ch13 == 2) {\n return 7;\n }\n if ($ch12 == 13 && $ch13 == 1) {\n return 8;\n }\n if ($ch13 == 9 || $ch13 == 0) {\n return 9;\n }\n }" ]
[ "0.55872035", "0.5303176", "0.52998286", "0.52274173", "0.512422", "0.5104442", "0.50981253", "0.4998915", "0.49777088", "0.49606392", "0.4805141", "0.47938642", "0.4782101", "0.4744165", "0.47171652", "0.4712604", "0.46872324", "0.46862146", "0.46850896", "0.46776575", "0.46734717", "0.46663138", "0.46655968", "0.46639386", "0.4661771", "0.46605584", "0.4655249", "0.46420816", "0.46367538", "0.46317995" ]
0.5470785
1
No whitespace found between numbers neither is found.
public function testDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace() { $text = 'Call 650-253-4561--455-234-3451'; $region = RegionCode::US; $this->assertTrue($this->hasNoMatches($this->phoneUtil->findNumbers($text, $region))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function skip_whitespace()\n {\n }", "function DOM_non_breaking() {\r\n\t\t//' ### numbers over 10 000\r\n\t\t$array_other_numbers = array(\r\n\t\t'¼', html_entity_decode('&frac14;'), '&#188;', '&#xbc;', '&frac14;',\r\n\t\t'½', html_entity_decode('&frac12;'), '&#189;', '&#xbd;', '&frac12;',\r\n\t\t'¾', html_entity_decode('&frac34;'), '&#190;', '&#xbe;', '&frac34;',\r\n\t\t);\r\n\t\t$other_number_string = implode(\"|\", $array_other_numbers);\r\n\t\t$body_text_nodes = $this->xpath->query(ReTidy::get_html_namespace() . 'body//' . ReTidy::get_html_namespace() . '*/child::text()');\r\n\t\tforeach($body_text_nodes as $node) {\r\n\t\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\t\t$node->nodeValue = preg_replace('/([0-9]+)(\\s([0-9]|(' . $other_number_string . '))+)+/s', 'XXX9o9NewTagBeginXXXspan style=\"white-space: nowrap;\"9o9XXX$0XXX9o9NewTagEndXXXspan9o9XXX', $node->nodeValue, -1, $count1);\r\n\t\t\t} else { // default\r\n\t\t\t\t$node->nodeValue = preg_replace('/([0-9])\\s([0-9]|(' . $other_number_string . '))/s', '$1XXX9o9NewEntityXXXnbsp9o9XXX$2', $node->nodeValue, -1, $count1);\r\n\t\t\t\t//$node->nodeValue = preg_replace('/([0-9])\\s([0-9]|(' . $other_number_string . '))/s', '$1&nbsp;$2', $node->nodeValue, -1, $count1);\r\n\t\t\t}\r\n\t\t\t$count += $count1;\r\n\t\t}\r\n\t\t$this->logMsgIf('([0-9])\\s([0-9])', $count);\t\r\n\t\tReTidy::DOM_phys_units();\r\n\t}", "protected function is_linear_whitespace()\n {\n }", "protected function linear_whitespace()\n {\n }", "function non_breaking_phone_number() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t//print('here33495905060<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+))(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t// I am guessing; not necessary\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t} else {\r\n\t\t\t\t//print('here33495905061<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(1((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((\\.|\\-|' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$0</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7 $10</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7-$10</span>', $this->code, -1, $b);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7.$10</span>', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)((\\(?[0-9]{3}\\)?)(' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//print('here33495905062<br>');\r\n\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '$1&nbsp;$3', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(1)((' . $this->spaceRegex . ')+){0,1}(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $c);\r\n\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $a);\r\n\t//\t\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7-$10', $this->code, -1, $b);\r\n\t//\t\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7.$10', $this->code, -1, $c);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7', $this->code, -1, $e);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7', $this->code, -1, $f);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $g);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4', $this->code, -1, $h);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4', $this->code, -1, $i);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8&nbsp;$11$12', $this->code, -1, $a);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8$9', $this->code, -1, $d);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5$6', $this->code, -1, $g);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8.$11$12', $this->code, -1, $c);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8$9', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5$6', $this->code, -1, $i);\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$count = $a + $b + $c + $d + $e + $f + $g + $h + $i;\r\n\t\t//$count = $a + $b + $c;\r\n\t\t//var_dump($a, $b, $c, $d, $e);\r\n\t\t$this->logMsgIf(\"non_breaking_phone_number\", $count);\r\n\t}", "function mDIGIT(){\n try {\n // Tokenizer11.g:366:3: ( '0' .. '9' ) \n // Tokenizer11.g:367:3: '0' .. '9' \n {\n $this->matchRange(48,57); \n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private function readWhitespace(): int\n {\n do {\n $this->position += strspn($this->data, \" \\n\\r\\t\\v\\0\", $this->position);\n $checkpoint ?? $checkpoint = $this->position;\n } while (($this->isDisabled && $this->readString('#~')) || ($this->inPreviousPart && $this->readString('#|')));\n\n return $checkpoint;\n }", "function estEntierPositif($valeur)\r\n{\r\n return preg_match('/[^0-9]/', $valeur) == 0;\r\n}", "public function testPhoneNumberWithLeadingOrTrailingMoneyMatches()\n {\n // the actual number from being found.\n $contexts = array();\n $contexts[] = array('$20 ', '');\n $contexts[] = array('', ' 100$');\n\n $this->findMatchesInContexts($contexts, true, true);\n }", "function estEntierPositif($valeur)\n{\n return preg_match('/[^0-9]/', $valeur) == 0;\n}", "function estEntierPositif($valeur) {\r\n\treturn preg_match(\"/[^0-9]/\", $valeur) == 0;\r\n\t\r\n}", "public function fnSkipSpace() \n {\n while ($this->iPos < mb_strlen($this->sInput)) {\n $iCh = Utilities::fnGetCharCodeAt($this->sInput, $this->iPos);\n switch ($iCh) {\n case 32: case 160: // ' '\n ++$this->iPos;\n break;\n case 13:\n if (Utilities::fnGetCharCodeAt($this->sInput, $this->iPos + 1) == 10) {\n ++$this->iPos;\n }\n case 10: case 8232: case 8233:\n ++$this->iPos;\n if ($this->aOptions['locations']) {\n ++$this->curLine;\n $this->iLineStart = $this->iPos;\n }\n break;\n case 47: // '/'\n switch (Utilities::fnGetCharCodeAt($this->sInput, $this->iPos + 1)) {\n case 42: // '*'\n $this->fnSkipBlockComment();\n break;\n case 47:\n $this->fnSkipLineComment(2);\n break;\n default:\n break 3;\n }\n break;\n default:\n if ($iCh > 8 && $iCh < 14 \n || $iCh >= 5760 \n && preg_match(Whitespace::nonASCIIwhitespace, Utilities::fnUnichr($iCh))) {\n ++$this->iPos;\n } else {\n break 2;\n }\n }\n }\n }", "function get_space_allowed()\n {\n }", "public function testFindNumbersWithPlusWithNoRegion()\n {\n // calculated.\n $this->doTestFindInContext('+64 3 331 6005', RegionCode::ZZ);\n // Null is also allowed for the region code in these cases.\n $this->doTestFindInContext('+64 3 331 6005', null);\n }", "function yy_r15()\n {\n $this->strip = true;\n }", "protected function _eatWhitespace()\n {\n if (preg_match(\n '/([\\t\\b\\f\\n\\r ])*/s',\n $this->_source,\n $matches,\n PREG_OFFSET_CAPTURE,\n $this->_offset\n )\n && $matches[0][1] == $this->_offset\n ) {\n $this->_offset += strlen($matches[0][0]);\n }\n }", "public function testNonPlusPrefixedNumbersNotFoundForInvalidRegion()\n {\n $iterable = $this->phoneUtil->findNumbers('1 456 764 156', RegionCode::ZZ);\n\n $iterable->next();\n $this->assertFalse($iterable->valid());\n }", "public function testWhitespace(): void\n {\n $validator = new LengthValidator(allowNewLine: false);\n $result = $validator->validate('foo\n bar\n baz');\n\n $this->assertFalse($result->isValid());\n }", "private function getAvaibleSpaces(){\n\t\t$spaces = array();\n\t\tfor ($i = 0;$i < count($this->gato[0]);++$i) {\n\t\t\tfor ($j = 0;$j < count($this->gato[0]);++$j) {\n\t\t\t\tif(strcmp($this->gato[$i][$j],'') == 0){\n\t\t\t\t\t//error_log(\"Free: \".$i.\",\".$j);\n\t\t\t\t\tarray_push($spaces, array($i,$j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $spaces;\n\t}", "function non_breaking_dollar_amounts() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '<span class=\"noWrap\">$1$2 $4</span>$5', $this->code, -1, $a);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '<span style=\"white-space: nowrap;\">$1$2 $4</span>$5', $this->code, -1, $a);\r\n\t\t\t}\r\n\t\t} else { // default to nbsp\r\n\t\t\t$this->code = preg_replace('/(\\${0,1})([0-9\\.,]+)(' . $this->spaceRegex . ')+(M|million|millions|B|billion|billions)([^a-z])/is', '$1$2&nbsp;$4$5', $this->code, -1, $b);\r\n\t\t}\r\n\t\t$count = $a + $b;\r\n\t\t$this->logMsgIf(\"non_breaking_dollar_amounts\", $count);\r\n\t}", "function wp_spaces_regexp()\n {\n }", "protected function skipSpaces() : void\n {\n while($this->pos < strlen($this->src)\n && $this->isSpace($this->src[$this->pos]))\n {\n $this->pos++;\n }\n }", "function it_allows_for_new_line_delimiters_and_finds_the_sum_of_1_2_4()\n {\n $this->add('1,\\n2,4')->shouldEqual(7);\n }", "public function hasSpaces(): bool\n\t{\n\t\treturn preg_match('/\\s/', $this->getValue());\n\t}", "public function numbers_only($value)\n{\n //return preg_match('/^([0-9]+)$/', $value);\n return ctype_digit(strval($value));\n}", "public function numericLiteralPositive(){\n try {\n // Sparql11query.g:560:3: ( INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE ) \n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('INTEGER_POSITIVE') && $this->input->LA(1)<=$this->getToken('DOUBLE_POSITIVE')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function testIniParseQuantityNoLeadingDigits()\n {\n error_clear_last();\n $this->assertSame(0, @ini_parse_quantity(' K '));\n $this->assertSame('Invalid quantity \" K \": no valid leading digits, interpreting as \"0\" for backwards compatibility', error_get_last()['message']);\n $this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);\n }", "public function testIntermediateParsePositions()\n {\n $text = 'Call 033316005 or 032316005!';\n // | | | | | |\n // 0 5 10 15 20 25\n\n // Iterate over all possible indices.\n for ($i = 0; $i <= 5; $i++) {\n $this->assertEqualRange($text, $i, 5, 14);\n }\n // 7 and 8 digits in a row are still parsed as number.\n $this->assertEqualRange($text, 6, 6, 14);\n $this->assertEqualRange($text, 7, 7, 14);\n // Anything smaller is skipped to the second instance.\n for ($i = 8; $i <= 19; $i++) {\n $this->assertEqualRange($text, $i, 19, 28);\n }\n }", "function nbsp($number=1)\n\t{\n\t\treturn $this->nontag('&nbsp;', $number);\n\t}", "function _olm_search_tab_check_numeric_value($unit_sizes) {\n $output = array();\n foreach ($unit_sizes as $unit_size) {\n if (is_numeric(trim($unit_size))) {\n $unit_size = trim($unit_size);\n $output[$unit_size] = $unit_size;\n }\n }\n return $output;\n}" ]
[ "0.61224586", "0.59042126", "0.58888805", "0.588466", "0.5707418", "0.5667351", "0.56661934", "0.54606575", "0.5456165", "0.5432275", "0.5412086", "0.5411801", "0.5346138", "0.533678", "0.5336456", "0.53267", "0.5306606", "0.53064066", "0.52410424", "0.5235622", "0.52302074", "0.52191114", "0.5206306", "0.5197251", "0.5195782", "0.5189434", "0.5178345", "0.5168902", "0.51628536", "0.511155" ]
0.67167246
0
Strings with numberlike things that should only be found up to and including the "strict_grouping" leniency level.
public function dataStrictGroupingCases() { return array( array('(415) 6667777', RegionCode::US), array('415-6667777', RegionCode::US), // Should be found by strict grouping but not exact grouping, as the last two groups are // formatted together as a block. array('0800-2491234', RegionCode::DE), // Doesn't match any formatting in the test file, but almost matches an alternate format (the // last two groups have been squashed together here). array('0900-1 123123', RegionCode::DE), array('(0)900-1 123123', RegionCode::DE), array('0 900-1 123123', RegionCode::DE), // NDC also found as part of the country calling code; this shouldn't ruin the grouping // expectations. array('+33 3 34 2312', RegionCode::FR), ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function num2words($num, $c=0) {\n $ZERO = 'zero';\n $MINUS = 'minus';\n $lowName = array(\n /* zero is shown as \"\" since it is never used in combined forms */\n /* 0 .. 19 */\n \"\", \"One\", \"Two\", \"Three\", \"Four\", \"Five\",\n \"Six\", \"Seven\", \"Eight\", \"Nine\", \"Ten\",\n \"Eleven\", \"Twelve\", \"Thirteen\", \"Fourteen\", \"Fifteen\",\n \"Sixteen\", \"Seventeen\", \"Eighteen\", \"Nineteen\");\n \n $tys = array(\n /* 0, 10, 20, 30 ... 90 */\n \"\", \"\", \"Twenty\", \"Thirty\", \"Forty\", \"Fifty\",\n \"Sixty\", \"Seventy\", \"Eighty\", \"Ninety\");\n \n $groupName = array(\n /* We only need up to a quintillion, since a long is about 9 * 10 ^ 18 */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n \"\", \"Hundred\", \"Thousand\", \"Million\", \"Billion\",\n \"Trillion\", \"Quadrillion\", \"Quintillion\");\n \n $divisor = array(\n /* How many of this group is needed to form one of the succeeding group. */\n /* American: unit, hundred, thousand, million, billion, trillion, quadrillion, quintillion */\n 100, 10, 1000, 1000, 1000, 1000, 1000, 1000) ;\n \n $num = str_replace(\",\",\"\",$num);\n $num = number_format($num,2,'.','');\n $cents = substr($num,strlen($num)-2,strlen($num)-1);\n $num = (int)$num;\n \n $s = \"\";\n \n if ( $num == 0 ) $s = $ZERO;\n $negative = ($num < 0 );\n if ( $negative ) $num = -$num;\n // Work least significant digit to most, right to left.\n // until high order part is all 0s.\n for ( $i=0; $num>0; $i++ ) {\n $remdr = (int)($num % $divisor[$i]);\n $num = $num / $divisor[$i];\n // check for 1100 .. 1999, 2100..2999, ... 5200..5999\n // but not 1000..1099, 2000..2099, ...\n // Special case written as fifty-nine hundred.\n // e.g. thousands digit is 1..5 and hundreds digit is 1..9\n // Only when no further higher order.\n if ( $i == 1 /* doing hundreds */ && 1 <= $num && $num <= 5 ){\n if ( $remdr > 0 ){\n $remdr = ($num * 10);\n $num = 0;\n } // end if\n } // end if\n if ( $remdr == 0 ){\n continue;\n }\n $t = \"\";\n if ( $remdr < 20 ){\n $t = $lowName[$remdr];\n }\n else if ( $remdr < 100 ){\n $units = (int)$remdr % 10;\n $tens = (int)$remdr / 10;\n $t = $tys [$tens];\n if ( $units != 0 ){\n $t .= \"-\" . $lowName[$units];\n }\n }else {\n $t = num2words($remdr, 0);\n }\n $s = $t.\" \".$groupName[$i].\" \".$s;\n $num = (int)$num;\n } // end for\n $s = trim($s);\n if ( $negative ){\n $s = $MINUS . \" \" . $s;\n }\n \n if ($c == 1) $s .= \" and $cents/100\";\n \n return $s;\n}", "function make_group_str($user)\n{\n $group = (int) (isset($user->group) ? $user->group : $user->power);\n $group2 = get_second_group($user);\n $group2 = $group2 < 0 ? '' : \",$group2\";\n return \"$group$group2\";\n}", "function formatLevel($level){\n\tif((int)$level == 0){\n\t\treturn C('STR_UNCERTIFIED');\n\t}\n\telseif((int)$level == 1){\n\t\treturn C('STR_LEVEL_1');\n\t}\n\telseif((int)$level == 2){\n\t\treturn C('STR_LEVEL_2');\n\t}\n\telseif((int)$level == 3){\n\t\treturn C('STR_LEVEL_3');\n\t}\n\telse return false;\n}", "public function findGradeGroup() {\n $group = false;\n\n if ($this->grade === 5 || $this->grade === 6) {\n $group = '5-6';\n } elseif ($this->grade >= 7 && $this->grade <= 9) {\n $group = 'Jr High';\n } elseif ($this->grade >= 10 && $this->grade <= 12) {\n $group = 'Sr High';\n }\n $this->group = $group;\n return (string) $group;\n\n }", "public function provideCheckGroupMatchingDigits()\n {\n return [\n [123444, false],\n [123445, 123445],\n [111222, false],\n [111122, 111122]\n ];\n }", "public function dataExactGroupingCases()\n {\n return array(\n array('4156667777', RegionCode::US),\n array('415-666-7777', RegionCode::US),\n array('4156667777', RegionCode::US),\n array('4156667777 x 123', RegionCode::US),\n array('415-666-7777', RegionCode::US),\n array('415/666-7777', RegionCode::US),\n array('415-666-7777 ext. 503', RegionCode::US),\n array('1 415 666 7777 x 123', RegionCode::US),\n array('+1 415-666-7777', RegionCode::US),\n array('+494949 49', RegionCode::DE),\n array('+49-49-34', RegionCode::DE),\n array('+49-4931-49', RegionCode::DE),\n array('04931-49', RegionCode::DE), // With National Prefix\n array('+49-494949', RegionCode::DE), // One group with country code\n array('+49-494949 ext. 49', RegionCode::DE),\n array('+49494949 ext. 49', RegionCode::DE),\n array('0494949', RegionCode::DE),\n array('0494949 ext. 49', RegionCode::DE),\n array('01 (33) 3461 2234', RegionCode::MX), // Optional NP present\n array('(33) 3461 2234', RegionCode::MX), // Optional NP omitted\n array('1800-10-10 22', RegionCode::AU), // Breakdown assistance number.\n // Doesn't match any formatting in the test file, but matches an alternate format exactly.\n array('0900-1 123 123', RegionCode::DE),\n array('(0)900-1 123 123', RegionCode::DE),\n array('0 900-1 123 123', RegionCode::DE),\n array('+33 3 34 23 12', RegionCode::FR),\n );\n }", "public function getGrouping(): string\n {\n return $this->grouping;\n }", "function buildGroup($group_name) {\n return check_plain($group_name);\n }", "private function getMultipleSupplierGroupsString(\\Doctrine_Collection $materialContexts, CompanyContextDaoInterface $companyContextDao, $verbose = false)\n {\n // every unique supplier group we find will go in the bucket\n $supplierGroupBucket = array();\n\n /** @var $materialContext \\MaterialContext */\n foreach($materialContexts as $materialContext)\n {\n /** @var $companyContext \\CompanyContext */\n $companyContext = $companyContextDao->getContext($materialContext->getParentCompanySlug(), $materialContext->getChildCompanySlug());\n\n if( $companyContext && $companyContext->hasSupplierGroup() )\n {\n $supplierGroupBucket[$companyContext->getSupplierGroupId()] = $companyContext->getSupplierGroupName();\n }\n }\n\n // if we want a verbose description\n if( $verbose )\n {\n // see if we found any\n if( $supplierGroupBucket )\n {\n $retVal = current($supplierGroupBucket);\n\n while( $supplierGroupName = next($supplierGroupBucket) )\n {\n $retVal .= ', ' . $supplierGroupName;\n }\n\n return $retVal;\n }\n\n return 'N/A';\n }\n else\n {\n // if there was only one supplier group, return the name, else the number of groups\n return count($supplierGroupBucket) === 1 ?\n current($supplierGroupBucket) :\n count($supplierGroupBucket) .' Busness Units';\n }\n }", "private function _errorNumberString($intval)\n\t{\n\t\t$errorlevels = array(\n\t\t\tE_ALL => 'E_ALL',\n\t\t\tE_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',\n\t\t\tE_STRICT => 'E_STRICT',\n\t\t\tE_USER_NOTICE => 'E_USER_NOTICE',\n\t\t\tE_USER_WARNING => 'E_USER_WARNING',\n\t\t\tE_USER_ERROR => 'E_USER_ERROR',\n\t\t\tE_COMPILE_WARNING => 'E_COMPILE_WARNING',\n\t\t\tE_COMPILE_ERROR => 'E_COMPILE_ERROR',\n\t\t\tE_CORE_WARNING => 'E_CORE_WARNING',\n\t\t\tE_CORE_ERROR => 'E_CORE_ERROR',\n\t\t\tE_NOTICE => 'E_NOTICE',\n\t\t\tE_PARSE => 'E_PARSE',\n\t\t\tE_WARNING => 'E_WARNING',\n\t\t\tE_ERROR => 'E_ERROR'\n\t\t);\n\n\t\tif (defined('E_DEPRECATED'))\n\t\t{\n\t\t\t$errorlevels[E_DEPRECATED] = 'E_DEPRECATED';\n\t\t\t$errorlevels[E_USER_DEPRECATED] = 'E_USER_DEPRECATED';\n\t\t}\n\n\t\treturn $errorlevels[$intval];\n\t}", "private function _formatSensitiveNumbers($number)\n {\n return strlen($number) - 4 > 0 ? str_repeat(\"*\", strlen($number) - 4) . substr($number, -4) : $number;\n }", "public function isGroup() : bool\n {\n $distinguishingDigit = substr($this->rawGroundWithoutSnow, 0, 1);\n\n return strcasecmp($distinguishingDigit, self::DIGIT) == 0;\n }", "private function search_not_empty_grouping_node($node) {\n if ($node->type == qtype_preg_node::TYPE_NODE_SUBEXPR\n && $node->subtype == qtype_preg_node_subexpr::SUBTYPE_GROUPING) {\n $parent = $this->get_parent_node($this->tree, $node->id);\n if ($parent !== null) {\n $group_operand = $node->operands[0];\n if ($parent->type != qtype_preg_node::TYPE_NODE_FINITE_QUANT\n && $parent->type != qtype_preg_node::TYPE_NODE_INFINITE_QUANT\n && $group_operand->type != qtype_preg_node::TYPE_LEAF_META\n && $group_operand->subtype != qtype_preg_leaf_meta::SUBTYPE_EMPTY\n && $group_operand->type != qtype_preg_node::TYPE_NODE_ALT) {\n\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n } else if (($parent->type == qtype_preg_node::TYPE_NODE_FINITE_QUANT\n || $parent->type == qtype_preg_node::TYPE_NODE_INFINITE_QUANT)\n && $group_operand->type != qtype_preg_node::TYPE_NODE_CONCAT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_ALT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_FINITE_QUANT\n && $group_operand->type != qtype_preg_node::TYPE_NODE_INFINITE_QUANT) {\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n }\n } else {\n if ($node->position != NULL) {\n $this->regex_hint_result->problem_ids[] = $node->id;\n $this->regex_hint_result->problem_type = 'qtype_preg_regex_hint_grouping_node';\n $this->regex_hint_result->problem = htmlspecialchars(get_string('simplification_equivalences_short_2_1', 'qtype_preg'));\n $this->regex_hint_result->solve = htmlspecialchars(get_string('simplification_equivalences_full_2_1', 'qtype_preg'));\n $this->regex_hint_result->problem_indfirst = $node->position->indfirst;\n $this->regex_hint_result->problem_indlast = $node->position->indlast;\n return true;\n }\n }\n }\n if ($this->is_operator($node)) {\n foreach ($node->operands as $operand) {\n if ($this->search_not_empty_grouping_node($operand)) {\n return true;\n }\n }\n }\n\n return false;\n }", "function DOM_non_breaking() {\r\n\t\t//' ### numbers over 10 000\r\n\t\t$array_other_numbers = array(\r\n\t\t'¼', html_entity_decode('&frac14;'), '&#188;', '&#xbc;', '&frac14;',\r\n\t\t'½', html_entity_decode('&frac12;'), '&#189;', '&#xbd;', '&frac12;',\r\n\t\t'¾', html_entity_decode('&frac34;'), '&#190;', '&#xbe;', '&frac34;',\r\n\t\t);\r\n\t\t$other_number_string = implode(\"|\", $array_other_numbers);\r\n\t\t$body_text_nodes = $this->xpath->query(ReTidy::get_html_namespace() . 'body//' . ReTidy::get_html_namespace() . '*/child::text()');\r\n\t\tforeach($body_text_nodes as $node) {\r\n\t\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\t\t$node->nodeValue = preg_replace('/([0-9]+)(\\s([0-9]|(' . $other_number_string . '))+)+/s', 'XXX9o9NewTagBeginXXXspan style=\"white-space: nowrap;\"9o9XXX$0XXX9o9NewTagEndXXXspan9o9XXX', $node->nodeValue, -1, $count1);\r\n\t\t\t} else { // default\r\n\t\t\t\t$node->nodeValue = preg_replace('/([0-9])\\s([0-9]|(' . $other_number_string . '))/s', '$1XXX9o9NewEntityXXXnbsp9o9XXX$2', $node->nodeValue, -1, $count1);\r\n\t\t\t\t//$node->nodeValue = preg_replace('/([0-9])\\s([0-9]|(' . $other_number_string . '))/s', '$1&nbsp;$2', $node->nodeValue, -1, $count1);\r\n\t\t\t}\r\n\t\t\t$count += $count1;\r\n\t\t}\r\n\t\t$this->logMsgIf('([0-9])\\s([0-9])', $count);\t\r\n\t\tReTidy::DOM_phys_units();\r\n\t}", "function CreateUnfriendlyHierarchyPosition($position)\n\t{\n\t\t#Change user-friendly values into padded numbers\n\t\t$tmp = '';\n \n $levels = preg_split('/\\./', $position);\n \n\t\tforeach ($levels as $onelevel)\n\t\t{\n\t\t\t$tmp .= str_pad($onelevel, 5, '0', STR_PAD_LEFT) . '.';\n\t\t}\n\t\t$tmp = rtrim($tmp, '.');\n\t\treturn $tmp;\n\t}", "private function threedigits($num)\n { if($this->discrete[substr($num,0,1)]!=\"\" && $this->twodigits(substr($num,1,2))!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred and '.$this->twodigits(substr($num,1,2));\n else if($this->discrete[substr($num,0,1)]!=\"\")\n return $this->discrete[substr($num,0,1)].' hundred';\n else\n return \"\";\n }", "function displayNumberWords($number,$preOne=\"\",$preOther=\"\",$postOne=\"\",$postOther=\"\",$decimalPlaces=0) {\r\n\r\n\tglobal $dss_numberWords;\r\n\t\r\n\tif ($number == 1) return $preOne.\" \".$dss_numberWords[$number].\" \".$postOne;\r\n\telseif ($number < 13) return $preOther.\" \".$dss_numberWords[$number].\" \".$postOther;\r\n\telse return $preOther.\" \".number_format($number,$decimalPlaces).\" \".$postOther;\r\n\t\r\n}", "public function getGroupSequence()\n {\n $groups = [self::class];\n\n if ($this->request === null) {\n $groups = ['Strict'];\n }\n\n return $groups;\n }", "function error_level_tostring($intval, $separator)\r\n{\r\n $errorlevels = array(\r\n 2047 => 'E_ALL',\r\n 1024 => 'E_USER_NOTICE',\r\n 512 => 'E_USER_WARNING',\r\n 256 => 'E_USER_ERROR',\r\n 128 => 'E_COMPILE_WARNING',\r\n 64 => 'E_COMPILE_ERROR',\r\n 32 => 'E_CORE_WARNING',\r\n 16 => 'E_CORE_ERROR',\r\n 8 => 'E_NOTICE',\r\n 4 => 'E_PARSE',\r\n 2 => 'E_WARNING',\r\n 1 => 'E_ERROR');\r\n $result = '';\r\n foreach($errorlevels as $number => $name)\r\n {\r\n if (($intval & $number) == $number) {\r\n $result .= ($result != '' ? $separator : '').$name; }\r\n }\r\n return $result;\r\n}", "function nice_names($groups){\n\n $group_array=array();\n for ($i=0; $i<$groups[\"count\"]; $i++) { //for each group\n if (isset($groups[$i])) { // Patched by SysCo/al\n $line=trim($groups[$i]);\n \n if (strlen($line)>0){ \n //more presumptions, they're all prefixed with CN= (but no more yet, patched by SysCo/al\n //so we ditch the first three characters and the group\n //name goes up to the first comma\n $bits=explode(\",\",$line);\n if (1== count($bits)) {\n $group_array[]=$bits[0]; // Patched by SysCo/al\n } else {\n $prefix_len=strpos($bits[0], \"=\"); // Patched by SysCo/al to allow also various length (not only 3)\n if (FALSE === $prefix_len) {\n $group_array[]=$bits[0];\n } else {\n $group_array[]=substr($bits[0],$prefix_len+1); // Patched by SysCo/al\n }\n }\n }\n }\n }\n return ($group_array);\t\n }", "private function get_descriptive_severity_safety( $severity ) {\n switch ( $severity ) {\n case 1: $out = 'Distress'; break;\n case 2: $out = 'Injuries'; break;\n case 3: $out = 'Serious injuries recoverable'; break;\n\t\t\tcase 4: $out = 'Permanent damage to health'; break;\n\t\t\tcase 5: $out = 'Death, lethal effects'; break;\n default: $out = 'Undefined'; break;\n }\n return $out;\n }", "function mask_format($nric) {\n if (is_numeric($nric) == 1) {\n return $nric;\n } else {\n $new_nric = substr_replace($nric, 'XXXXX', 0, 5);\n //$new_nric = substr_replace($nric,'XXXX',5); \n return $new_nric;\n }\n }", "public function getNOTASGENERALES()\r\n {\r\n return $this->NOTAS_GENERALES;\r\n }", "function non_breaking_phone_number() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t//print('here33495905060<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+))(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t// I am guessing; not necessary\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t} else {\r\n\t\t\t\t//print('here33495905061<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(1((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((\\.|\\-|' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$0</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7 $10</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7-$10</span>', $this->code, -1, $b);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7.$10</span>', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)((\\(?[0-9]{3}\\)?)(' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//print('here33495905062<br>');\r\n\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '$1&nbsp;$3', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(1)((' . $this->spaceRegex . ')+){0,1}(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $c);\r\n\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $a);\r\n\t//\t\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7-$10', $this->code, -1, $b);\r\n\t//\t\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7.$10', $this->code, -1, $c);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7', $this->code, -1, $e);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7', $this->code, -1, $f);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $g);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4', $this->code, -1, $h);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4', $this->code, -1, $i);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8&nbsp;$11$12', $this->code, -1, $a);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8$9', $this->code, -1, $d);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5$6', $this->code, -1, $g);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8.$11$12', $this->code, -1, $c);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8$9', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5$6', $this->code, -1, $i);\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$count = $a + $b + $c + $d + $e + $f + $g + $h + $i;\r\n\t\t//$count = $a + $b + $c;\r\n\t\t//var_dump($a, $b, $c, $d, $e);\r\n\t\t$this->logMsgIf(\"non_breaking_phone_number\", $count);\r\n\t}", "function CreateFriendlyHierarchyPosition($position)\n\t{\n\t\t#Change padded numbers back into user-friendly values\n\t\t$tmp = '';\n $levels = preg_split('/\\./', $position);\n \n\t\tforeach ($levels as $onelevel)\n\t\t{\n\t\t\t$tmp .= ltrim($onelevel, '0') . '.';\n\t\t}\n\t\t$tmp = rtrim($tmp, '.');\n\t\treturn $tmp;\n\t}", "public function getMaskingStringLength(): PositiveInteger;", "function _buildXMLstringLevel($object, $depth)\n\t{\n\t\t// Initialize variables\n\t\t$retval = '';\n\t\t$tab\t= '';\n\t\tfor($i=1;$i <= $depth; $i++) {\n\t\t\t$tab .= \"\\t\";\n\t\t}\n\n\t\tforeach (get_object_vars( $object ) as $key=>$item)\n\t\t{\n\t\t\tif (is_object($item))\n\t\t\t{\n\t\t\t\t$retval .= $tab.\"<group name=\\\"\".$key.\"\\\">\\n\";\n\t\t\t\t$retval .= $this->_buildXMLstringLevel($item, $depth+1);\n\t\t\t\t$retval .= $tab.\"</group>\\n\";\n\t\t\t} else {\n\t\t\t\t$retval .= $tab.\"<entry name=\\\"\".$key.\"\\\">\".$item.\"</entry>\\n\";\n\t\t\t}\n\t\t}\n\t\treturn $retval;\n\t}", "function eligibility_format() {\n\t$print = \"\";\n\t$prefix = \"\";\n\t$eligibility = get_field('eligibility');\n\tif (is_array($eligibility)) {\n\t\tif (!get_field('other') == \"\") {\n\t\t\t$eligibility[] .= get_field('other');\n\t\t}\n\t\tforeach ($eligibility as $value) {\n\n\t\t\t$print .= $prefix . $value;\n\t\t\t$prefix = ', ';\n\t\t}\n\t} else {\n\t\t$print = get_field('eligibility');\n\t}\n\treturn $print;\n}", "function privCheckFormat($p_level = 0)\n {\n }", "function _splitStreetAddressNl($streetAddress) {\n $result = array();\n /*\n * do nothing if streetAddress is empty\n */\n if (!empty($streetAddress)) {\n /*\n * split into parts separated by spaces\n */\n $addressParts = explode(\" \", $streetAddress);\n $foundStreetNumber = false;\n $streetName = null;\n $streetNumber = null;\n $streetUnit = null;\n foreach($addressParts as $partKey => $addressPart) {\n /*\n * if the part is numeric, there are several possibilities:\n * - if the partKey is 0 so it is the first element, it is\n * assumed it is part of the street_name to cater for \n * situation like 2e Wormenseweg\n * - if not the first part and there is no street_number yet (foundStreetNumber\n * is false), it is assumed this numeric part contains the street_number\n * - if not the first part but we already have a street_number (foundStreetNumber\n * is true) it is assumed this is part of the street_unit\n */\n if (is_numeric($addressPart)) {\n if ($foundStreetNumber == false) {\n $streetNumber = $addressPart;\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".$addressPart;\n }\n } else {\n /*\n * if part is not numeric, there are several possibilities:\n * - if the street number is found, set the whole part to streetUnit\n * - if there is no streetNumber yet and it is the first part, set the\n * whole part to streetName\n * - if there is no streetNumber yet and it is not the first part,\n * check all digits:\n * - if the first digit is numeric, put the numeric part in streetNumber\n * and all non-numerics to street_unit\n * - if the first digit is not numeric, put the lot into streetName\n */\n if ($foundStreetNumber == true) {\n if (!empty($streetName)) {\n $streetUnit .= \" \".$addressPart;\n } else {\n $streetName .= \" \".$addressPart;\n }\n } else {\n if ($partKey == 0) {\n $streetName .= $addressPart;\n } else {\n $partLength = strlen($addressPart);\n if (is_numeric(substr($addressPart, 0, 1))) {\n for ($i=0; $i<$partLength; $i++) {\n if (is_numeric(substr($addressPart, $i, 1))) {\n $streetNumber .= substr($addressPart, $i, 1);\n $foundStreetNumber = true;\n } else {\n $streetUnit .= \" \".substr($addressPart, $i, 1);\n }\n }\n } else {\n $streetName .= \" \".$addressPart;\n }\n }\n }\n }\n }\n $result['street_name'] = trim($streetName);\n $result['street_number'] = $streetNumber;\n $result['street_unit'] = trim($streetUnit);\n /*\n * if we still have no street_number, add contact to checkgroup\n */\n \n }\n return $result;\n}" ]
[ "0.53356874", "0.52731645", "0.52259785", "0.52258754", "0.52082115", "0.51804817", "0.5108735", "0.5056538", "0.5044563", "0.5041803", "0.49551162", "0.49152902", "0.48840627", "0.48745912", "0.48074487", "0.47987786", "0.47920606", "0.47823966", "0.47116625", "0.47102532", "0.46800992", "0.46794775", "0.46461657", "0.4640559", "0.46385744", "0.4624527", "0.4617629", "0.46173263", "0.46124756", "0.46066397" ]
0.6061382
0
Helper method which tests the contexts provided and ensures that: if isValid is true, they all find a test number inserted in the middle when leniency of matching is set to VALID; else no test number should be extracted at that leniency level if isPossible is true, they all find a test number inserted in the middle when leniency of matching is set to POSSIBLE; else no test number should be extracted at that leniency level
protected function findMatchesInContexts( $contexts, $isValid, $isPossible, $region = RegionCode::US, $number = '415-666-7777' ) { if ($isValid) { $this->doTestInContext($number, $region, $contexts, Leniency::VALID()); } else { foreach ($contexts as $context) { $text = $context[0] . $number . $context[1]; $this->assertTrue( $this->hasNoMatches($this->phoneUtil->findNumbers($text, $region)), "Should not have found a number in {$text}" ); } } if ($isPossible) { $this->doTestInContext($number, $region, $contexts, Leniency::POSSIBLE()); } else { foreach ($contexts as $context) { $text = $context[0] . $number . $context[1]; $this->assertTrue( $this->hasNoMatches($this->phoneUtil->findNumbers($text, $region)), "Should not have found a number in {$text}" ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validTestsProvider()\n\t {\n\t\treturn array(\n\t\t\t\"generating expanded document and validating it\" => array(\"valid-01\"),\n\t\t\t\"adding one hierarchy node\" => array(\"valid-02\"),\n\t\t\t\"adding three hierarchy nodes\" => array(\"valid-03\"),\n\t\t\t\"moving hierarchy node around\" => array(\"valid-04\"),\n\t\t\t\"testing absence of mandatory attribute of one of the hierarchy nodes\" => array(\"valid-05\"),\n\t\t\t\"changing placement of one of the mandatory leaves (for example, in different choice branch)\" => array(\"valid-06\"),\n\t\t\t\"one mandatory leaf element is removed from schema\" => array(\"valid-07\"),\n\t\t\t\"three mandatory leaves are deleted from schema\" => array(\"valid-08\"),\n\t\t\t\"last-level choice is first selected\" => array(\"valid-09\"),\n\t\t\t\"last-level choice is second selected\" => array(\"valid-10\"),\n\t\t\t\"three choices in a row are wrong\" => array(\"valid-11\"),\n\t\t\t\"processing non-DOMElement nodes (for example, DOMComment)\" => array(\"valid-12\"),\n\t\t\t\"two nodes with the same name have attributes with the same name\" => array(\"valid-13\"),\n\t\t\t\"elements with the same name have similar nametrace\" => array(\"valid-14\"),\n\t\t\t\"elements with the same name have similar nametrace, also the choice change occurs\" => array(\"valid-15\"),\n\t\t\t\"one or more elements in inputelements has absolute addressing\" => array(\"valid-16\"),\n\t\t\t\"all elements in inputelements have absolute addressing\" => array(\"valid-17\"),\n\t\t\t\"schema has multiple root elements\" => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"valid-18\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\"schema has attribute group for one of nodes\" => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"valid-19\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\"inserting two hierarchy levels between two elements\" => array(\"valid-20\"),\n\t\t\t\"root element attributes are processed as regular element attributes\" => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"valid-21\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ),\n\t\t\t\"choice adjacent to another element which contains another choice\" => array(\"valid-22\"),\n\t\t );\n\t }", "function compare_results(&$matcher, &$expected, &$obtained, &$ismatchpassed, &$fullpassed, &$indexfirstpassed, &$indexlastpassed, &$nextpassed, &$leftpassed) {\n $ismatchpassed = ($expected['is_match'] == $obtained['is_match']);\n $fullpassed = ($expected['full'] == $obtained['full']);\n $result = $ismatchpassed && $fullpassed;\n if ($obtained['is_match'] && $expected['is_match']) { // TODO - what if we need a character with no match?\n // checking indexes\n if ($matcher->is_supporting(preg_matcher::SUBPATTERN_CAPTURING)) {\n $indexfirstpassed = ($expected['index_first'] == $obtained['index_first']);\n $indexlastpassed = ($expected['index_last'] == $obtained['index_last']);\n } else {\n $indexfirstpassed = ($expected['index_first'][0] == $obtained['index_first'][0]);\n $indexlastpassed = ($expected['index_last'][0] == $obtained['index_last'][0]);\n }\n // checking next possible character\n if ($matcher->is_supporting(preg_matcher::NEXT_CHARACTER)) {\n $nextpassed = (($expected['next'] === '' && $obtained['next'] === '') || // both results are empty\n ($expected['next'] !== '' && $obtained['next'] !== '' && strstr($expected['next'], $obtained['next']) != false)); // expected 'next' contains obtained 'next'\n } else {\n $nextpassed = true;\n }\n // checking number of characters left\n if ($matcher->is_supporting(preg_matcher::CHARACTERS_LEFT)) {\n $leftpassed = in_array($obtained['left'], $expected['left']);\n } else {\n $leftpassed = true;\n }\n $result = $result && $indexfirstpassed && $indexlastpassed && $nextpassed && $leftpassed;\n } else {\n $indexfirstpassed = true;\n $indexlastpassed = true;\n $nextpassed = true;\n $leftpassed = true;\n }\n return $result;\n }", "public function testIsValidPassing()\n {\n $this->assertTrue($this->helper->isValid('s1', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('s2', 'wala wala bing bang'));\n $this->assertTrue($this->helper->isValid('i1', 12));\n $this->assertTrue($this->helper->isValid('i2', -11));\n $this->assertTrue($this->helper->isValid('i3', 116));\n $this->assertTrue($this->helper->isValid('i4', 916));\n $this->assertTrue($this->helper->isValid('i5', -83));\n $this->assertTrue($this->helper->isValid('i6', -99));\n $this->assertTrue($this->helper->isValid('f1', 12.53));\n $this->assertTrue($this->helper->isValid('f2', 1.5e5));\n $this->assertTrue($this->helper->isValid('f3', -22.79));\n $this->assertTrue($this->helper->isValid('b', true));\n $this->assertTrue($this->helper->isValid('b', false));\n $this->assertTrue($this->helper->isValid('a', [1, 2, 3]));\n $this->assertTrue($this->helper->isValid('m', true));\n $this->assertTrue($this->helper->isValid('m', 'false'));\n $this->assertTrue($this->helper->isValid('r', 'memberType'));\n }", "public function testMatchesWithSurroundingLatinCharsAndLeadingPunctuation()\n {\n // insert start with punctuation, but trailing characters are still not allowed.\n $possibleOnlyContexts = array();\n $possibleOnlyContexts[] = array('abc', 'def');\n $possibleOnlyContexts[] = array('', 'def');\n $possibleOnlyContexts[] = array('', \"\\xC3\\x89\");\n\n // Numbers should not be considered valid, if they have trailing Latin characters, but should be\n // considered possible.\n $numberWithPlus = '+14156667777';\n $numberWithBrackets = '(415)6667777';\n $this->findMatchesInContexts($possibleOnlyContexts, false, true, RegionCode::US, $numberWithPlus);\n $this->findMatchesInContexts($possibleOnlyContexts, false, true, RegionCode::US, $numberWithBrackets);\n\n $validContexts = array();\n $validContexts[] = array('abc', '');\n $validContexts[] = array(\"\\xC3\\x89\", '');\n $validContexts[] = array(\"\\xC3\\x89\", '.'); // Trailing punctuation.\n $validContexts[] = array(\"\\xC3\\x89\", ' def'); // Trailing white space.\n\n // Numbers should be considered valid, since they start with punctuation.\n $this->findMatchesInContexts($validContexts, true, true, RegionCode::US, $numberWithPlus);\n $this->findMatchesInContexts($validContexts, true, true, RegionCode::US, $numberWithBrackets);\n }", "public function testIsValidFailing()\n {\n $this->assertFalse($this->helper->isValid('s1', 15));\n $this->assertFalse($this->helper->isValid('s2', true));\n $this->assertFalse($this->helper->isValid('i1', 12.1));\n $this->assertFalse($this->helper->isValid('i2', 'eleven'));\n $this->assertFalse($this->helper->isValid('i3', 12.6));\n $this->assertFalse($this->helper->isValid('i4', -2));\n $this->assertFalse($this->helper->isValid('i5', 83));\n $this->assertFalse($this->helper->isValid('i6', false));\n $this->assertFalse($this->helper->isValid('f1', 12));\n $this->assertFalse($this->helper->isValid('f2', [12.67]));\n $this->assertFalse($this->helper->isValid('f3', 13.0));\n $this->assertFalse($this->helper->isValid('b', [true]));\n $this->assertFalse($this->helper->isValid('b', 0));\n $this->assertFalse($this->helper->isValid('a', 'blue'));\n $this->assertFalse($this->helper->isValid('m', 'true'));\n $this->assertFalse($this->helper->isValid('m', false));\n $this->assertFalse($this->helper->isValid('r', 'memb3rType'));\n }", "protected function findPossibleInContext($number, $defaultCountry)\n {\n $contextPairs = array();\n $contextPairs[] = array('', ''); // no content\n $contextPairs[] = array(' ', \"\\t\"); // whitespace only\n $contextPairs[] = array('Hello ', ''); // no context at end\n $contextPairs[] = array('', ' to call me!'); // no context at start\n $contextPairs[] = array('Hi there, call ', ' to reach me!'); // no context at start\n $contextPairs[] = array('Hi here, call ', \" , or don't\"); // with commas\n // Three examples without whitespace around the number\n $contextPairs[] = array('Hi call', '');\n $contextPairs[] = array('', 'forme');\n $contextPairs[] = array('Hi call', 'forme');\n // With other small numbers.\n $contextPairs[] = array(\"It's cheap! Call \", ' before 6:30');\n // With a second number later.\n $contextPairs[] = array('Call ', ' or +1800-123-4567!');\n $contextPairs[] = array('Call me on June 2 at', ''); // with a Month-Day date\n // With publication pages\n $contextPairs[] = array('As quoted by Alfonso 12-15 (2009), you may call me at ', '');\n $contextPairs[] = array('As quoted by Alfonso et al. 12-15 (2009), you may call me at ', '');\n // With dates, written in the American style.\n $contextPairs[] = array('As I said on 03/10/2011, you may call be at ', '');\n // With trailing numbers after a comma. The 45 should not be considered an extension\n $contextPairs[] = array('', ', 45 days a year');\n // When matching we don't consider semicolon along with legitimate extension symbol to indicate\n // an extension. The 7246433 should not be considered an extension.\n $contextPairs[] = array('', ';x 7246433');\n // With a postfix stripped off as it looks like the start of another number.\n $contextPairs[] = array('Call ', '/x12 more');\n\n $this->doTestInContext($number, $defaultCountry, $contextPairs, Leniency::POSSIBLE());\n }", "public function provideInputValidationTests() {\n $result = [\n [[\n 'descr' => \"Unknown tags like [foo] get ignored.\",\n 'bbcode' => \"This is [foo]a tag[/foo].\",\n 'html' => \"This is [foo]a tag[/foo].\",\n ]],\n [[\n 'descr' => \"Broken tags like [foo get ignored.\",\n 'bbcode' => \"This is [foo a tag.\",\n 'html' => \"This is [foo a tag.\",\n ]],\n [[\n 'descr' => \"Broken tags like [/foo get ignored.\",\n 'bbcode' => \"This is [/foo a tag.\",\n 'html' => \"This is [/foo a tag.\",\n ]],\n [[\n 'descr' => \"Broken tags like [] get ignored.\",\n 'bbcode' => \"This is [] a tag.\",\n 'html' => \"This is [] a tag.\",\n ]],\n [[\n 'descr' => \"Broken tags like [/ ] get ignored.\",\n 'bbcode' => \"This is [/ ] a tag.\",\n 'html' => \"This is [/ ] a tag.\",\n ]],\n [[\n 'descr' => \"Broken tags like [/ get ignored.\",\n 'bbcode' => \"This is [/ a tag.\",\n 'html' => \"This is [/ a tag.\",\n ]],\n [[\n 'descr' => \"Broken [ tags before [b]real tags[/b] don't break the real tags.\",\n 'bbcode' => \"Broken [ tags before [b]real tags[/b] don't break the real tags.\",\n 'html' => \"Broken [ tags before <b>real tags</b> don't break the real tags.\",\n ]],\n [[\n 'descr' => \"Broken [tags before [b]real tags[/b] don't break the real tags.\",\n 'bbcode' => \"Broken [tags before [b]real tags[/b] don't break the real tags.\",\n 'html' => \"Broken [tags before <b>real tags</b> don't break the real tags.\",\n ]],\n [[\n 'descr' => \"[i][b]Mis-ordered nesting[/i][/b] gets fixed.\",\n 'bbcode' => \"[i][b]Mis-ordered nesting[/i][/b] gets fixed.\",\n 'html' => \"<i><b>Mis-ordered nesting</b></i> gets fixed.\",\n ]],\n [[\n 'descr' => \"[url=][b]Mis-ordered nesting[/url][/b] gets fixed.\",\n 'bbcode' => \"[url=http://www.google.com][b]Mis-ordered nesting[/url][/b] gets fixed.\",\n 'html' => \"<a href=\\\"http://www.google.com\\\" class=\\\"bbcode_url\\\"><b>Mis-ordered nesting</b></a> gets fixed.\",\n ]],\n [[\n 'descr' => \"[i]Unended blocks are automatically ended.\",\n 'bbcode' => \"[i]Unended blocks are automatically ended.\",\n 'html' => \"<i>Unended blocks are automatically ended.</i>\",\n ]],\n [[\n 'descr' => \"Unstarted blocks[/i] have their end tags ignored.\",\n 'bbcode' => \"Unstarted blocks[/i] have their end tags ignored.\",\n 'html' => \"Unstarted blocks[/i] have their end tags ignored.\",\n ]],\n [[\n 'descr' => \"[b]Mismatched tags[/i] are not matched to each other.\",\n 'bbcode' => \"[b]Mismatched tags[/i] are not matched to each other.\",\n 'html' => \"<b>Mismatched tags[/i] are not matched to each other.</b>\",\n ]],\n [[\n 'descr' => \"[center]Inlines and [b]blocks get[/b] nested correctly[/center].\",\n 'bbcode' => \"[center]Inlines and [b]blocks get[/b] nested correctly[/center].\",\n 'html' => \"\\n<div class=\\\"bbcode_center\\\" style=\\\"text-align:center\\\">\\nInlines and <b>blocks get</b> nested correctly\\n</div>\\n.\",\n ]],\n [[\n 'descr' => \"[b]Inlines and [center]blocks get[/center] nested correctly[/b].\",\n 'bbcode' => \"[b]Inlines and [center]blocks get[/center] nested correctly[/b].\",\n 'html' => \"<b>Inlines and </b>\\n<div class=\\\"bbcode_center\\\" style=\\\"text-align:center\\\">\\nblocks get\\n</div>\\nnested correctly.\",\n ]],\n [[\n 'descr' => \"BBCode is [B]case-insensitive[/b].\",\n 'bbcode' => \"[cEnTeR][b]This[/B] is a [I]test[/i].[/CeNteR]\",\n 'html' => \"\\n<div class=\\\"bbcode_center\\\" style=\\\"text-align:center\\\">\\n<b>This</b> is a <i>test</i>.\\n</div>\\n\",\n ]],\n [[\n 'descr' => \"Plain text gets passed through unchanged.\",\n 'bbcode' => \"Plain text gets passed through unchanged. b is not a tag and i is not a tag and neither is /i and neither is (b).\",\n 'html' => \"Plain text gets passed through unchanged. b is not a tag and i is not a tag and neither is /i and neither is (b).\",\n ]],\n ];\n\n return $result;\n }", "public function provideTestFailSearch()\n {\n $cases = array();\n \n // different sizes\n $lengths = array(\n 0,\n 1,\n 10,\n IndexGenerator::getBlockSize() - 1,\n IndexGenerator::getBlockSize(),\n IndexGenerator::getBlockSize() + 1,\n IndexGenerator::getBlockSize() * 4\n );\n \n foreach ($lengths as $length) {\n // Fail searching for MIN(index) - 1\n $generator = new FixedSizeIndexGenerator();\n $generator->setIndexLength($length);\n $generator->getIndex();\n $cases[] = array(\n $generator->getIndex(),\n $generator->getMinimum() - 1\n );\n \n // Fail searching for MAX(index) + 1\n $generator = new FixedSizeIndexGenerator();\n $generator->setIndexLength($length);\n $generator->getIndex();\n $cases[] = array(\n $generator->getIndex(),\n $generator->getMaximum() + 1\n );\n \n // Fail searching for any missing key inside the index range\n $generator = new FixedSizeIndexGenerator();\n $generator->setIndexLength($length);\n $generator->setStepSize(2);\n $generator->getIndex();\n $cases[] = array(\n $generator->getIndex(),\n $generator->getMaximum() / 2 + 0.1\n );\n \n }\n \n return $cases;\n }", "public function invalidTestsProvider()\n\t {\n\t\treturn array(\n\t\t\t\"testing with added mandatory attribute of one of the hierarchy nodes\" => array(\"invalid-1\"),\n\t\t\t\"one of the non-mandatory attributes is wrong\" => array(\"invalid-2\"),\n\t\t\t\"one new mandatory leaf element is added to the schema\" => array(\"invalid-3\"),\n\t\t\t\"non-mandatory attribute of the leaf node is wrong\" => array(\"invalid-4\"),\n\t\t\t\"mandatory attribute of the leaf node has wrong value\" => array(\"invalid-5\"),\n\t\t\t\"mandatory attribute of the leaf node has wrong name\" => array(\"invalid-6\"),\n\t\t );\n\t }", "function do_assertions($matchername, $regex, $str, $obtained, $ismatchpassed, $fullpassed, $indexfirstpassed, $indexlastpassed, $nextpassed, $leftpassed, $assertionstrue = false) {\n $this->assertTrue($assertionstrue || $ismatchpassed, \"$matchername failed 'is_match' check on regex '$regex' and string '$str'\");\n if (!$ismatchpassed) {\n echo 'obtained result ' . $obtained['is_match'] . ' for \\'is_match\\' is incorrect<br/>';\n }\n $this->assertTrue($assertionstrue || $fullpassed, \"$matchername failed 'full' check on regex '$regex' and string '$str'\");\n if (!$fullpassed) {\n echo 'obtained result ' . $obtained['full'] . ' for \\'full\\' is incorrect<br/>';\n }\n if (array_key_exists('index_first', $obtained)) {\n $this->assertTrue($assertionstrue || $indexfirstpassed, \"$matchername failed 'index_first' check on regex '$regex' and string '$str'\");\n if (!$indexfirstpassed) {\n echo 'obtained result '; print_r($obtained['index_first']); echo ' for \\'index_first\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('index_last', $obtained)) {\n $this->assertTrue($assertionstrue || $indexlastpassed, \"$matchername failed 'index_last' check on regex '$regex' and string '$str'\");\n if (!$indexlastpassed) {\n echo 'obtained result '; print_r($obtained['index_last']); echo ' for \\'index_last\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('next', $obtained)) {\n $this->assertTrue($assertionstrue || $nextpassed, \"$matchername failed 'next' check on regex '$regex' and string '$str'\");\n if (!$nextpassed) {\n echo 'obtained result \\'' . $obtained['next'] . '\\' for \\'next\\' is incorrect<br/>';\n }\n }\n if (array_key_exists('left', $obtained)) {\n $this->assertTrue($assertionstrue || $leftpassed, \"$matchername failed 'left' check on regex '$regex' and string '$str'\");\n if (!$leftpassed) {\n echo 'obtained result \\'' . $obtained['left'] . '\\' for \\'left\\' is incorrect<br/>';\n }\n }\n }", "function CCValidationSolution($Number) {\r\n global $CardName, $CardNumber, $language;\r\n\r\n require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CCVAL_FUNCTION); \r\n\r\n\r\n// Get rid of spaces and non-numeric characters.\r\n $Number = OnlyNumericSolution($Number);\r\n\r\n// Do the first four digits fit within proper ranges? If so, who's the card issuer and how long should the number be?\r\n $NumberLeft = substr($Number, 0, 4);\r\n $NumberLength = strlen($Number);\r\n\r\n if ( ($NumberLeft >= 3000) && ($NumberLeft <= 3059) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3600) && ($NumberLeft <= 3699) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3800) && ($NumberLeft <= 3889) ) {\r\n $CardName = 'Diners Club';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 3400) && ($NumberLeft <= 3499) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3700) && ($NumberLeft <= 3799) ) {\r\n $CardName = 'American Express';\r\n $ShouldLength = 15;\r\n } elseif ( ($NumberLeft >= 3528) && ($NumberLeft <= 3589) ) {\r\n $CardName = 'JCB';\r\n $ShouldLength = 16;\r\n } elseif ( ($NumberLeft >= 3890) && ($NumberLeft <= 3899) ) {\r\n $CardName = 'Carte Blache';\r\n $ShouldLength = 14;\r\n } elseif ( ($NumberLeft >= 4000) && ($NumberLeft <= 4999) ) {\r\n $CardName = 'Visa';\r\n if ($NumberLength > 14) {\r\n $ShouldLength = 16;\r\n } elseif ($NumberLength < 14) {\r\n $ShouldLength = 13;\r\n }\r\n } elseif ( ($NumberLeft >= 5100) && ($NumberLeft <= 5599) ) {\r\n $CardName = 'MasterCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 5610) {\r\n $CardName = 'Australian BankCard';\r\n $ShouldLength = 16;\r\n } elseif ($NumberLeft == 6011) {\r\n $CardName = 'Discover/Novus';\r\n $ShouldLength = 16;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_UNKNOWN_CARD, $NumberLeft);\r\n return $cc_val;\r\n }\r\n\r\n// Is the number the right length?\r\n if ($NumberLength <> $ShouldLength) {\r\n $Missing = $NumberLength - $ShouldLength;\r\n if ($Missing < 0) {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n }\r\n\r\n return $cc_val;\r\n }\r\n\r\n// Does the number pass the Mod 10 Algorithm Checksum?\r\n if (Mod10Solution($Number)) {\r\n $CardNumber = $Number;\r\n return true;\r\n } else {\r\n $cc_val = sprintf(TEXT_CCVAL_ERROR_INVALID_NUMBER, $CardName, $Number);\r\n return $cc_val;\r\n }\r\n }", "public function testExample()\n {\n echo \" testing numbers \";\n $isbnNumbers = [\n \"807229654X\", \"807229654\", \"978 032 640 615-1\", \"978032640615\", \"0072296542\",\n \"176041640615766\", \"0072296552\", \"007-229-654 2\", \"2460323406152\"\n ];\n $results = [1,0,1,0,1,0,0,1,1];\n\n $evaluated = [];\n foreach ($isbnNumbers as $isbn) {\n $evaluated[$isbn] = Helpers\\ISBN::isValidISBN($isbn);\n }\n $index = 0;\n $true = true;\n\n foreach($evaluated as $number => $output) {\n $true = $true && ($results[$index] == $output['valid']);\n if(!$true) {\n echo $results[$index].\" true: \".($true? \"1 \":\"0 \");\n print_r($output);\n }\n $index++;\n }\n\n $this->assertTrue($true);\n }", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function simulateEnabledMatchSpecificConditionsSucceeds() {}", "public function process($context, &$target)\n {\n // Loop over each set\n foreach ($this->ruleSets as $ruleSet)\n {\n // Build up a list of valid sets\n if ($ruleSet->isValid($context))\n {\n $ruleSet->applyResults($target);\n }\n }\n }", "function tester($data, $parseNew)\n{\n $delimiter = ' ';\n\n // $lines = explode(\"&\", $data); //split data by new lines into an array\n\n // $lines = explode(\",\", $data);\n\n if (preg_match('/[,]/', $data)) {\n $delimiter = ',';\n } elseif (preg_match('/[&]/', $data)) {\n $delimiter = '&';\n } else {\n $delimiter = '\\n';\n }\n\n switch ($delimiter) {\n case ',':\n $lines = explode(\",\", $data);\n break;\n case '&':\n $lines = explode(\"&\", $data);\n break;\n case '\\n':\n $lines = explode(\"\\n\", $data);\n break;\n default:\n $lines = explode(\"\\n\", $data);\n break;\n }\n\n // if (count($lines) === 1) { //if there aren't any new lines, then periods are used\n // $lines = explode(\"&\", $data);\n // }\n\n // print_r($lines);\n\n $senseInfo = array(\"exp\", \"expiry\", \"cvv\", \"CVV\"); //keywords of default fields to be parsed, credit card numbers need to be searched for differently\n\n $senseInfo = array_merge($senseInfo, $parseNew); //take optional parse data types and add it to array of default credit card data types\n //checking credit card number first\n\n //=======================================\n // Credit cart number check\n //=======================================\n\n //loop through the lines and check for credit card information keywords as well as if theres any matches in $parseNew\n for ($currLine = 0; $currLine < count($lines); $currLine++) {\n\n $cardPos = strpos($lines[$currLine], \"card\"); //find \"card\" as part of Card Number\n\n if ($cardPos === false) {\n $cardPos = strpos($lines[$currLine], \"Card\");\n }\n\n if ($cardPos > 0) { //if \"card\" is in the line, we check if \"number\" is also\n $numberPos = strpos($lines[$currLine], \"Number\");\n\n // print_r($lines[$currLine]);\n\n if ($numberPos === false) {\n $numberPos = strpos($lines[$currLine], \"number\");\n }\n\n if ($numberPos > 0) {\n //Initial value length\n $numberLength = 0;\n\n $matches = array();\n preg_match_all('!\\d+!', $lines[$currLine], $matches); //grabs all numbers in the line and throws them in an array\n // print_r($lines[$currLine]);\n // print_r($matches[0]);\n\n foreach ($matches[0] as $key => $value) {\n $digits = $value; //unpack array inside matches array\n // print_r($digits);\n\n $numberLength = strlen($digits);\n\n $lines[$currLine] = str_replace($digits, str_repeat('*', $numberLength), $lines[$currLine]);\n }\n // print_r($lines[$currLine]);\n }\n }}\n\n //=======================================\n // credit card number check complete\n //=======================================\n // print_r(array_shift($senseInfo));\n for ($currLine = 0; $currLine < count($lines); $currLine++) {\n //now to check for everything else\n // print_r($lines[$currLine]);\n\n for ($i = 0; $i < count($senseInfo); $i++) {\n\n $currSenseInfo = strtolower($senseInfo[$i]); //current type of data we are looking to parse\n // print_r($currSenseInfo);\n \n // similar_text('Account_Card_Number', \"card number\", $sim);\n // print_r($sim);\n \n if (strpos(strtolower($lines[$currLine]), $currSenseInfo) > 0) { //check to see if current parsing field exists on current line\n // array_shift($senseInfo);\n preg_match_all('/\\d+\\.?\\d*/', $lines[$currLine], $matches); \n // print_r($lines[$currLine]);\n // preg_match_all('/^[:|=>|=][a-zA-Z]/', $lines[$currLine], $matches); \n // echo implode('',$matches[0]);\n // preg_match_all(\"/\\d+\\.?\\d+|\\d+|[A-Za-z]+/\", $lines[$currLine], $matches);\n // preg_match_all(\"/\\d+\\.?\\d+|\\d+|[A-Za-z]+/\", $lines[$currLine], $matches);\n // print_r($matches[0]);\n \n // print_r($currSenseInfo);\n\n // print_r($matches);\n $sensData = $matches[0]; //unpack array from within another array\n\n // print_r($sensData);\n\n for ($f = 0; $f < count($sensData); $f++) { //if we find any fields we want to parse\n $hash = str_repeat(\"*\", strlen($sensData[$f]));\n $lines[$currLine] = str_replace($sensData[$f], $hash, $lines[$currLine]);\n // print_r($lines[$currLine]);\n }\n }\n }\n }\n print_r($lines);\n}", "public function testMatches() {\n $this->assertTrue(Hash::matches($this->expanded, $this->expanded));\n $this->assertTrue(Hash::matches(array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n\n $this->assertFalse(Hash::matches($this->expanded, $this->collapsed));\n $this->assertFalse(Hash::matches(array(\n 'foo' => '123',\n 'bar' => 'baz',\n 'array' => array()\n ), array(\n 'foo' => 123,\n 'bar' => 'baz',\n 'array' => array()\n )));\n }", "public function testMaxMatchesMixed()\n {\n $numbers = '';\n for ($i = 0; $i < 100; $i++) {\n $numbers .= 'My info: 415-666-7777 123 fake street';\n }\n\n // Only matches the first 10 despite there being 100 numbers due to max matches\n $number = $this->phoneUtil->parse('+14156667777', null);\n $expected = \\array_fill(0, 10, $number);\n\n $iterable = $this->phoneUtil->findNumbers($numbers, RegionCode::US, Leniency::VALID(), 10);\n\n $actual = array();\n foreach ($iterable as $match) {\n $actual[] = $match->number();\n }\n\n $this->assertEquals($expected, $actual);\n }", "public function testPhoneNumberWithLeadingOrTrailingMoneyMatches()\n {\n // the actual number from being found.\n $contexts = array();\n $contexts[] = array('$20 ', '');\n $contexts[] = array('', ' 100$');\n\n $this->findMatchesInContexts($contexts, true, true);\n }", "protected function coreValidatorLogic()\r\n {\r\n foreach($this->filteredInputArray as $key => $urlSafeBase64Token)\r\n {\r\n if($this->testResultsArray[$key] === true) //Only check the ones that passed the PHP Filter validation.\r\n {\r\n $this->testResultsArray[$key] = $this->base64Token($urlSafeBase64Token, $this->validationMetaArray['base64Token'], $this->errorMessagesArray[$key]);\r\n }\r\n }\r\n\r\n return;\r\n }", "public function provideTestSearch()\n {\n $cases = array();\n \n $lengths = array(\n 1,\n 2,\n 10,\n IndexGenerator::getBlockSize(),\n );\n \n $steps = array(\n 1,\n 3,\n IndexGenerator::getBlockSize()\n );\n \n foreach ($lengths as $length) {\n foreach ($steps as $step) {\n $generator = new FixedSizeIndexGenerator();\n $generator->setIndexLength($length);\n $generator->setStepSize($step);\n $cases[] = array($generator);\n \n }\n }\n \n return $cases;\n }", "protected function findValidInContext($number, $defaultCountry)\n {\n $contextPairs = array();\n // With other small numbers\n $contextPairs[] = array(\"It's only 9.99! Call \", ' to buy');\n // with a number Day.Month.Year date.\n $contextPairs[] = array('Call me on 21.6.1984 at ', '');\n // With a number Month/Day date.\n $contextPairs[] = array('Call me on 06/21 at ', '');\n // With a number Day.Month date.\n $contextPairs[] = array('Call me on 21.6. at ', '');\n // With a number Month/Day/Year date.\n $contextPairs[] = array('Call me on 06/21/84 at ', '');\n\n $this->doTestInContext($number, $defaultCountry, $contextPairs, Leniency::VALID());\n }", "private function checkResult($result) {\n\t\t$success = false;\n\t\tif (empty($result['ObstacleAttributeCheck'])) {\n\t\t\treturn true;\n\t\t}\n\t\t$level = $result['Job']['level'];\n\t\tCakeLog::write('story', sprintf('Checking Level %s Obstacle: %s', $level, $result['Obstacle']['title']));\n\t\tif ($result['Obstacle']['minutes'] < $result['Obstacle']['total_length']) {\n\t\t\tCakeLog::write('story', sprintf('Working %d out of %s minutes', $result['Obstacle']['minutes'], $result['Obstacle']['total_length']));\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tforeach ($result['ObstacleAttributeCheck'] as $obstacleAttributeCheck) {\n\t\t\t$obstacleValue = $obstacleAttributeCheck['value'];\n\t\t\t$attributeId = $obstacleAttributeCheck['Attribute']['id'];\n\t\t\t$attributeTitle = $obstacleAttributeCheck['Attribute']['title'];\n\t\t\t\n\t\t\tCakeLog::write('story', sprintf('Checking Attribute %s', $attributeTitle));\n\t\t\t\n\t\t\tif (empty($result['Character'])) {\n\t\t\t\tCakeLog::write('story', 'No character is found, failing check');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//Checks each character against the Obstacle Attribute\n\t\t\tforeach ($result['Character'] as $character) {\n\t\t\t\t$characterLevel = $character['level'];\n\t\t\t\tCakeLog::write('story', sprintf('Checking Level %s Character %s for Attribute %s', \n\t\t\t\t\t$characterLevel, $character['name'], $attributeTitle));\n\t\t\t\tforeach ($character['CharacterAttribute'] as $characterAttribute) {\n\t\t\t\t\tif ($characterAttribute['attribute_id'] == $attributeId) {\n\t\t\t\t\t\t$characterValue = $characterAttribute['value'];\n\t\t\t\t\t\tCakeLog::write('story', sprintf('Attribute: %s - Obstacle: %s:%s --- Character: %s:%s', \n\t\t\t\t\t\t\t$attributeTitle,\n\t\t\t\t\t\t\t$result['Obstacle']['title'],\n\t\t\t\t\t\t\t$obstacleValue,\n\t\t\t\t\t\t\t$character['name'],\n\t\t\t\t\t\t\t$characterValue\n\t\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$characterValue = $this->getAttackValue($characterValue, array(\n\t\t\t\t\t\t\tStatMod::getLevelModifier($characterLevel)\n\t\t\t\t\t\t));\n\t\t\t\t\t\t$obstacleValue = $this->getAttackValue($obstacleValue, array(\n\t\t\t\t\t\t\tStatMod::getLevelModifier($level)\n\t\t\t\t\t\t));\n\t\t\t\t\t\t\n\t\t\t\t\t\tCakeLog::write('story', sprintf('Obstacle: %s =/= Character: %s', $obstacleValue, $characterValue));\n\t\t\t\t\t\t$success = $characterValue > $obstacleValue;\n\t\t\t\t\t\tif (!$success) {\n\t\t\t\t\t\t\tCakeLog::write('story', 'Character fails attempt');\n\t\t\t\t\t\t\tbreak 3;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tCakeLog::write('story', 'Character succeeds attempt');\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\treturn $success;\n\t}", "public function test_example()\n {\n $this->assertTrue( (new PassPhrase('abcde fghij'))->validate());\n $this->assertTrue( (new PassPhrase('a ab abc abd abf abj'))->validate());\n $this->assertTrue( (new PassPhrase('iiii oiii ooii oooi oooo'))->validate());\n $this->assertFalse( (new PassPhrase('abcde xyz ecdab'))->validate());\n $this->assertFalse( (new PassPhrase('oiii ioii iioi iiio'))->validate());\n }", "function all_valid($pairs){\n foreach($pairs as $pair){\n $value = $pair[0];\n $regex = $pair[1];\n if (!is_valid($value, $regex)){\n return false;\n }\n }\n return true;\n}", "public function provideCheckGroupMatchingDigits()\n {\n return [\n [123444, false],\n [123445, 123445],\n [111222, false],\n [111122, 111122]\n ];\n }", "public function testData() {\n\t\t// fail message, base, url, expected\n\t\t$cases = array(\n\t\t\tarray('Should return absolute URL unchanged',\n\t\t\t\t'http://example.com', 'http://example.com', 'http://example.com'),\n\n\t\t\tarray('Should return root given blank path',\n\t\t\t\t'http://example.com', '', 'http://example.com/'),\n\n\t\t\tarray('Should return input unchanged given full URL and blank path',\n\t\t\t\t'http://example.com/something', '', 'http://example.com/something'),\n\n\t\t\tarray('Should handle blank base URL',\n\t\t\t\t'', 'http://example.com', 'http://example.com'),\n\n\t\t\tarray('Should resolve fragment ID',\n\t\t\t\t'http://example.com', '#thing', 'http://example.com/#thing'),\n\n\t\t\tarray('Should resolve blank fragment ID',\n\t\t\t\t'http://example.com', '#', 'http://example.com/#'),\n\n\t\t\tarray('Should resolve same level URL',\n\t\t\t\t'http://example.com', 'thing', 'http://example.com/thing'),\n\n\t\t\tarray('Should resolve directory level URL',\n\t\t\t\t'http://example.com', './thing', 'http://example.com/thing'),\n\n\t\t\tarray('Should resolve parent level URL at root level',\n\t\t\t\t'http://example.com', '../thing', 'http://example.com/thing'),\n\n\t\t\tarray('Should resolve nested URL',\n\t\t\t\t'http://example.com/something', 'another', 'http://example.com/another'),\n\n\t\t\tarray('Should ignore query strings in base url',\n\t\t\t\t'http://example.com/index.php?url=http://example.org', '/thing', 'http://example.com/thing'),\n\n\t\t\tarray('Should resolve query strings',\n\t\t\t\t'http://example.com/thing', '?stuff=yes', 'http://example.com/thing?stuff=yes'),\n\n\t\t\tarray('Should resolve dir level query strings',\n\t\t\t\t'http://example.com', './?thing=yes', 'http://example.com/?thing=yes'),\n\n\t\t\tarray('Should resolve up one level from root domain',\n\t\t\t\t'http://example.com', 'path/to/the/../file', 'http://example.com/path/to/file'),\n\n\t\t\tarray('Should resolve up one level from base with path',\n\t\t\t\t'http://example.com/path/the', 'to/the/../file', 'http://example.com/path/to/file'),\n\n\t\t\t// Tests from webignition library\n\n\t\t\tarray('relative add host from base',\n\t\t\t\t'http://www.example.com', 'server.php', 'http://www.example.com/server.php'),\n\n\t\t\tarray('relative add scheme host pass from base',\n\t\t\t\t'http://:[email protected]', 'server.php', 'http://:[email protected]/server.php'),\n\n\t\t\tarray('relative add scheme host user pass from base',\n\t\t\t\t'http://user:[email protected]', 'server.php', 'http://user:[email protected]/server.php'),\n\n\t\t\tarray('relative base has file path',\n\t\t\t\t'http://example.com/index.html', 'example.html', 'http://example.com/example.html'),\n\n\t\t\tarray('input has absolute path',\n\t\t\t\t'http://www.example.com/pathOne/pathTwo/pathThree', '/server.php?param1=value1', 'http://www.example.com/server.php?param1=value1'),\n\n\t\t\tarray('test absolute url with path',\n\t\t\t\t'http://www.example.com/', 'http://www.example.com/pathOne', 'http://www.example.com/pathOne'),\n\n\t\t\tarray('testRelativePathIsTransformedIntoCorrectAbsoluteUrl',\n\t\t\t\t'http://www.example.com/pathOne/pathTwo/pathThree', 'server.php?param1=value1', 'http://www.example.com/pathOne/pathTwo/server.php?param1=value1'),\n\n\t\t\tarray('testAbsolutePathHasDotDotDirecoryAndSourceHasFileName',\n\t\t\t\t'http://www.example.com/pathOne/index.php', '../jquery.js', 'http://www.example.com/jquery.js'),\n\n\t\t\tarray('testAbsolutePathHasDotDotDirecoryAndSourceHasDirectoryWithTrailingSlash',\n\t\t\t\t'http://www.example.com/pathOne/', '../jquery.js', 'http://www.example.com/jquery.js'),\n\n\t\t\tarray('testAbsolutePathHasDotDotDirecoryAndSourceHasDirectoryWithoutTrailingSlash',\n\t\t\t\t'http://www.example.com/pathOne', '../jquery.js', 'http://www.example.com/jquery.js'),\n\n\t\t\tarray('testAbsolutePathHasDotDirecoryAndSourceHasFilename',\n\t\t\t\t'http://www.example.com/pathOne/index.php', './jquery.js', 'http://www.example.com/pathOne/jquery.js'),\n\n\t\t\tarray('testAbsolutePathHasDotDirecoryAndSourceHasDirectoryWithTrailingSlash',\n\t\t\t\t'http://www.example.com/pathOne/', './jquery.js', 'http://www.example.com/pathOne/jquery.js'),\n\n\t\t\tarray('testAbsolutePathHasDotDirecoryAndSourceHasDirectoryWithoutTrailingSlash',\n\t\t\t\t'http://www.example.com/pathOne', './jquery.js', 'http://www.example.com/jquery.js'),\n\n\t\t\tarray('testAbsolutePathIncludesPortNumber',\n\t\t\t\t'http://example.com:8080/index.html', '/photo.jpg', 'http://example.com:8080/photo.jpg')\n\n\t\t);\n\n\t\t// PHP 5.4 and before returns a different result, but either are acceptable\n\t\tif(PHP_MAJOR_VERSION <= 5 && PHP_MINOR_VERSION <= 4) {\n\t\t\t$cases[] = array('relative add scheme host user from base',\n\t\t\t\t'http://user:@www.example.com', 'server.php', 'http://[email protected]/server.php');\n\t\t} else {\n\t\t\t$cases[] = array('relative add scheme host user from base',\n\t\t\t\t'http://user:@www.example.com', 'server.php', 'http://user:@www.example.com/server.php');\n\t\t}\n\n\t\t// Test cases from RFC\n\t\t// http://tools.ietf.org/html/rfc3986#section-5.4\n\n\t\t$rfcTests = array(\n\t\t\tarray(\"g:h\", \"g:h\"),\n\t\t\tarray(\"g\", \"http://a/b/c/g\"),\n\t\t\tarray(\"./g\", \"http://a/b/c/g\"),\n\t\t\tarray(\"g/\", \"http://a/b/c/g/\"),\n\t\t\tarray(\"/g\", \"http://a/g\"),\n\t\t\tarray(\"//g\", \"http://g\"),\n\t\t\tarray(\"?y\", \"http://a/b/c/d;p?y\"),\n\t\t\tarray(\"g?y\", \"http://a/b/c/g?y\"),\n\t\t\tarray(\"#s\", \"http://a/b/c/d;p?q#s\"),\n\t\t\tarray(\"g#s\", \"http://a/b/c/g#s\"),\n\t\t\tarray(\"g?y#s\", \"http://a/b/c/g?y#s\"),\n\t\t\tarray(\";x\", \"http://a/b/c/;x\"),\n\t\t\tarray(\"g;x\", \"http://a/b/c/g;x\"),\n\t\t\tarray(\"g;x?y#s\", \"http://a/b/c/g;x?y#s\"),\n\t\t\tarray(\"\", \"http://a/b/c/d;p?q\"),\n\t\t\tarray(\".\", \"http://a/b/c/\"),\n\t\t\tarray(\"./\", \"http://a/b/c/\"),\n\t\t\tarray(\"..\", \"http://a/b/\"),\n\t\t\tarray(\"../\", \"http://a/b/\"),\n\t\t\tarray(\"../g\", \"http://a/b/g\"),\n\t\t\tarray(\"../..\", \"http://a/\"),\n\t\t\tarray(\"../../\", \"http://a/\"),\n\t\t\tarray(\"../../g\", \"http://a/g\")\n\t\t);\n\n\t\tforeach($rfcTests as $i=>$test) {\n\t\t\t$cases[] = array(\n\t\t\t\t'test rfc ' . $i, 'http://a/b/c/d;p?q', $test[0], $test[1]\n\t\t\t);\n\t\t}\n\n\t\treturn $cases;\n\t}", "function test_function() {\n global $ninja_forms_processing;\n $form_id = $ninja_forms_processing->get_form_ID();\n if ($form_id == 17) {\n $email_main = $ninja_forms_processing->get_field_value(367);\n $email_check = $ninja_forms_processing->get_field_value(368);\n if ($email_main !== $email_check) {\n $ninja_forms_processing->add_error('test_email_check', 'Email addresses do not match');\n $ninja_forms_processing->add_error('test_email_check_367', 'Email addresses must match', 367);\n $ninja_forms_processing->add_error('test_email_check_368', 'Email addresses must match', 368);\n }\n $school_name = $ninja_forms_processing->get_field_value(398);\n if ($school_name == 1) {\n $ninja_forms_processing->add_error('test_school_check', 'Please select a VCCS College/Agency');\n $ninja_forms_processing->add_error('test_school_check_398', 'Select a VCCS College/Agency', 398);\n }\n $list_one = $ninja_forms_processing->get_field_value(399);\n if ($list_one == 1) {\n $ninja_forms_processing->add_error('test_one_check', 'Please select from List 1');\n $ninja_forms_processing->add_error('test_one_check_399', 'Select from List 1', 399);\n }\n $list_two = $ninja_forms_processing->get_field_value(400);\n if ($list_two == 1) {\n $ninja_forms_processing->add_error('test_two_check', 'Please select from List 2');\n $ninja_forms_processing->add_error('test_two_check_400', 'Select from List 2', 400);\n }\n $list_three = $ninja_forms_processing->get_field_value(401);\n if ($list_three == 1) {\n $ninja_forms_processing->add_error('test_three_check', 'Please select from List 3');\n $ninja_forms_processing->add_error('test_three_check_401', 'Select from List 3', 401);\n }\n $value_one = $ninja_forms_processing->get_field_value(409);\n $value_two = $ninja_forms_processing->get_field_value(410);\n $total_value = $value_one + $value_two;\n if ($total_value !== 100) {\n $ninja_forms_processing->add_error('test_value_check', 'Total must equal 100%');\n $ninja_forms_processing->add_error('test_value_check_408', 'Total must equal 100%', 408);\n }\n }\n}", "public function testOneDiscipline24Courses()\n {\n $result = false;\n $student = new StudentProfile();\n for($i = 0; $i < 24; ++$i)\n {\n $course = new Course();\n $course->set(\"department\",\"MATH\");\n $course->set(\"courseNumber\",$i);\n $student->set(\"courses\",$course);\n }\n $status = check24Discipline($student);\n if(count($status[\"reason\"]) == 24 && $status[\"result\"] == true)\n $result = true;\n $this->assertEquals(true, $result);\n }", "public function providerTestValidate()\n {\n return [\n ['string', ['length' => ['min' => 0, 'max' => 10]]],\n ['string', ['length' => ['min' => 0, 'max' => 2]], false],\n ['string', ['length' => ['min' => 9, 'max' => 10]], false],\n ];\n }" ]
[ "0.58275455", "0.5501777", "0.5461934", "0.5382711", "0.52913094", "0.5206816", "0.50675666", "0.49538416", "0.49510154", "0.49448127", "0.4863639", "0.48380396", "0.48334387", "0.48324233", "0.48235565", "0.4818798", "0.4793667", "0.4778816", "0.47635105", "0.47225058", "0.4662213", "0.4660388", "0.46139982", "0.46107978", "0.46098414", "0.4595346", "0.45771658", "0.457387", "0.4570241", "0.4569026" ]
0.63406324
0
Fail on noninternational prefix if region code is null.
public function testNoMatchIfRegionIsNull() { $this->assertTrue($this->hasNoMatches($this->phoneUtil->findNumbers( 'Random text body - number is 0331 6005, see you there', null ))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testWebSearchRegion()\n {\n $this->_yahoo->webSearch('php', ['region' => 'nl']);\n try {\n $this->_yahoo->webSearch('php', ['region' => 'oops']);\n $this->fail('Expected Zend_Service_Exception not thrown');\n } catch (Zend_Service_Exception $e) {\n $this->assertStringContainsString(\"Invalid value for option 'region': oops\", $e->getMessage());\n }\n }", "public function testInvalidRegion()\n {\n $error = '';\n try {\n $this->mockEndpoint('Invalid Region supplied');\n $test = new Product(\n 'ACCESS_KEY',\n 'SECRET_KEY',\n 1\n );\n $test->addData(['SKU' => 'test123']);\n $test->send();\n } catch (Exception $e) {\n $error = $e->getMessage();\n }\n\n $this->assertEquals(\n 'Invalid Region supplied',\n $error\n );\n }", "public function testNonPlusPrefixedNumbersNotFoundForInvalidRegion()\n {\n $iterable = $this->phoneUtil->findNumbers('1 456 764 156', RegionCode::ZZ);\n\n $iterable->next();\n $this->assertFalse($iterable->valid());\n }", "abstract public function regionISOCode();", "public function testInvalidCountryCode()\n {\n $exception = null;\n $request = ['postal_code' => '75008'];\n $rules = ['postal_code' => 'postal_code:FOO'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }", "public function test_address_region_validation()\n {\n /*\n * Valid\n */\n $validRegionLocation = Location::factory()->make([\n 'addressRegion' => 'Greater Manchester',\n ]);\n $validRegionData = $validRegionLocation->toArray();\n $this->post($this->route(), $validRegionData)->assertStatus(201);\n\n /**\n * Invalid: not a string\n */\n $nonStringLocation = Location::factory()->make([\n 'addressRegion' => ['invalid'],\n ]);\n $nonStringData = $nonStringLocation->toArray();\n\n $response = $this->post($this->route(), $nonStringData);\n $response->assertStatus(400);\n $response->assertJsonPath('meta.field_errors.addressRegion', 'The address region must be a string.');\n }", "public function getDefaultRegion() : ?string;", "public function testGetLanguageByInvalidCode() {\n\n $this->localizationDao = $this->getMock('LocalizationDao');\n $this->localizationDao->expects($this->once())\n ->method('getLanguageByCode')\n ->will($this->returnValue(NULL));\n\n $this->locaizationService->setLocalizationDao($this->localizationDao);\n\n $result = $this->locaizationService->getLanguageByCode('language_code');\n $this->assertNull($result);\n }", "public function getRegionCode() : ?string\n {\n return $this->regionCode;\n }", "public function testCountryCodeWithIncorrectCasing()\n {\n $request = ['postal_code' => '12345'];\n $rules = ['postal_code' => 'postal_code:de'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertFalse($validator->fails());\n }", "public function testGetUnknownPrefix(): void\n {\n $this->expectException(DocumentManagerException::class);\n $this->registry->getPrefix('foobarbar');\n }", "public function getRegion() : ?string ;", "public function testEmptyCountryCode()\n {\n $request = ['postal_code' => '75008'];\n $rules = ['postal_code' => 'postal_code'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }", "public function getRegion(): ?string\n {\n return $this->_region;\n }", "public function getRegionName()\n {\n if (array_key_exists(\"regionName\", $this->_propDict)) {\n return $this->_propDict[\"regionName\"];\n } else {\n return null;\n }\n }", "public static function translate_region($region)\n\t{\n\t\t$region = ucwords($region);\n\n\t\t$region_library = array('AL' => \"Alabama\", 'AK' => \"Alaska\", 'AZ' => \"Arizona\", 'AR' => \"Arkansas\", 'CA' => \"California\", 'CO' => \"Colorado\", 'CT' => \"Connecticut\", 'DE' => \"Delaware\", 'FL' => \"Florida\", 'GA' => \"Georgia\", 'HI' => \"Hawaii\", 'ID' => \"Idaho\", 'IL' => \"Illinois\", 'IN' => \"Indiana\", 'IA' => \"Iowa\", 'KS' => \"Kansas\", 'KY' => \"Kentucky\", 'LA' => \"Louisiana\", 'ME' => \"Maine\", 'MD' => \"Maryland\", 'MA' => \"Massachusetts\", 'MI' => \"Michigan\", 'MN' => \"Minnesota\", 'MS' => \"Mississippi\", 'MO' => \"Missouri\", 'MT' => \"Montana\", 'NE' => \"Nebraska\", 'NV' => \"Nevada\", 'NH' => \"New Hampshire\", 'NJ' => \"New Jersey\", 'NM' => \"New Mexico\", 'NY' => \"New York\", 'NC' => \"North Carolina\", 'ND' => \"North Dakota\", 'OH' => \"Ohio\", 'OK' => \"Oklahoma\", 'OR' => \"Oregon\", 'PA' => \"Pennsylvania\", 'RI' => \"Rhode Island\", 'SC' => \"South Carolina\", 'SD' => \"South Dakota\", 'TN' => \"Tennessee\", 'TX' => \"Texas\", 'UT' => \"Utah\", 'VT' => \"Vermont\", 'VA' => \"Virginia\", 'WA' => \"Washington\", 'DC' => \"Washington D.C.\", 'WV' => \"West Virginia\", 'WI' => \"Wisconsin\", 'WY' => \"Wyoming\");\n\n\t\t// If correct 2 letter abbreviation is set, leave it\n\t\tif (isset($region_library[$region]) && !empty($region_library[$region])) {\n\t\t\treturn $region;\n\t\t}\n\n\t\t// Find state name\n\t\tforeach ($region_library as $abbrev => $name) {\n\t\t\tif ($region == $name) {\n\t\t\t\treturn $abbrev;\n\t\t\t}\n\t\t}\n\n\t\t// if the region doesn't match ones of our states, just return it\n\t\treturn $region;\n\t}", "public function is_region($region_code_or_name)\n {\n\n if (strtolower($region_code_or_name) == strtolower($this->region_code) || strtolower($region_code_or_name) == strtolower($this->region_name)) {\n $response = true;\n } else {\n $response = true;\n }\n\n return $response;\n\t}", "public function getFallbackLocaleCode() {\n return null;\n }", "function validateUSAZip($zip_code)\n\t\t\t{\n\t \t\tif(preg_match(\"/^([0-9]{5})(-[0-9]{4})?$/i\",$zip_code))\n\t \t\t\treturn true;\n\t \t\telse\n\t \t\t\t return false;\n\t\t\t}", "public function testInvalidPostalCode()\n {\n $request = ['postal_code' => 'Some arbitrary string'];\n $rules = ['postal_code' => 'postal_code:BE'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertTrue($validator->fails());\n }", "public function isRegion(){\n if($this->isBreaking_Region() || $this->isBreaking_Federal() || $this->isHF_Region() || $this->isHF_Federal() || $this->isFederal()){\n return true;\n }\n return $this->brki!=null && $this->brki->keyWord==\"Region\";\n }", "private static function checkCountryCode($countryCode) {\n $countryCode = strtolower($countryCode);\n\n if (empty($countryCode) === true || is_numeric($countryCode) === true) {\n throw new \\Exception('Invalid country code !');\n }\n\n return $countryCode;\n\n }", "private function guardAgainstInternationalLocation($location)\n {\n return 'United States' !== $location->CountryCode ||\n isset($location->CountrySubDivisionCode) &&\n in_array($location->CountrySubDivisionCode, [\n 'Northern Mariana Islands',\n 'American Samoa',\n 'Guam',\n 'Puerto Rico',\n 'Virgin Islands'\n ]);\n }", "public function beginsWithReturnsInvalidArgumentDataProvider() {}", "public function testGetInvalidLocationByLocationStreetOne() {\n\t\t// grab a location by searching for street one that does not exist\n\t\t$location = Location::getLocationByLocationStreetOne($this->getPDO(), \"That's a ghost street\");\n\t\t$this->assertCount(0, $location);\n\t}", "public function testFindNumbersWithPlusWithNoRegion()\n {\n // calculated.\n $this->doTestFindInContext('+64 3 331 6005', RegionCode::ZZ);\n // Null is also allowed for the region code in these cases.\n $this->doTestFindInContext('+64 3 331 6005', null);\n }", "private function setRegion()\n {\n if ( ! isset( $this->data['country'] ) ) {\n return;\n }\n \n if ( ! isset( $_POST['region'] ) ) {\n $this->data['error']['region'] = \"Please provide your province or state.\";\n $this->error = true;\n return;\n }\n \n $r = trim( $_POST['region'] );\n \n if ( $this->data['country'] == 'CA' ) {\n $regions = $this->regions->get('provinces');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your province.\";\n $this->error = true;\n return;\n }\n }\n elseif ( $this->data['country'] == 'US' ) {\n $regions = $this->regions->get('states');\n if ( ! array_key_exists($r, $regions ) ) {\n $this->data['error']['region'] = \"Please select your state.\";\n $this->error = true;\n return;\n }\n }\n \n $this->data['region'] = $r;\n }", "function _addresses_province_valid($country, $province) {\n if (substr($country, 0, 4) == 'top_') {\n $country = substr($country, 4);\n }\n\n // Ensure that country code provided is valid\n if (!_addresses_country_valid($country)) {\n return FALSE;\n }\n\n $provinces = _addresses_province_get($country);\n\n // If the country chosen does not contain any provinces\n if (empty($provinces)) {\n return NULL;\n }\n\n // If $province provided matches ISO-3166-2 code.\n if ($provinces[strtoupper($province)]) {\n // Province supplied is ISO-3166-2 code.\n return $province;\n }\n\n // Flip array and change to lowercase to match names in key, can not use\n // array_search() or in_array() as they are case-sensitive.\n $provinces = array_change_key_case(array_flip($provinces));\n if ($provinces[strtolower($province)]) {\n // Return the ISO-3166-2 province code.\n return $provinces[strtolower($province)];\n }\n\n // $province provided did not return any valid matches.\n return FALSE;\n}", "public function setRegion($region)\n {\n if (empty($region)) {\n throw new Exception (\"region is empty!\");\n } \n $this->region = $region;\n }", "public function testEmptyPostalCode()\n {\n $request = ['postal_code' => null];\n $rules = ['postal_code' => 'postal_code:RU'];\n $validator = $this->factory->make($request, $rules);\n\n if (version_compare($this->app->version(), '5.3.0', '<')) {\n # Before Laravel 5.3 nullable was the implicit default\n # See: https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0\n $this->markTestSkipped('Laravel won\\'t run the validation code in this instance');\n }\n\n $this->assertTrue($validator->fails());\n }" ]
[ "0.6352096", "0.62938786", "0.61947113", "0.5921518", "0.57626975", "0.56914854", "0.5674187", "0.5542727", "0.5537385", "0.5506041", "0.5445332", "0.53984964", "0.5342183", "0.5334068", "0.5292743", "0.5274058", "0.5253134", "0.5211291", "0.51728487", "0.5092505", "0.5073533", "0.5048161", "0.503722", "0.5036363", "0.50342125", "0.5028113", "0.50193155", "0.5018984", "0.49788243", "0.49728295" ]
0.65064055
0
Asserts that another number can be found in $text starting at $index, and that its corresponding range in $start to $end
protected function assertEqualRange($text, $index, $start, $end) { $sub = \mb_substr($text, $index, \mb_strlen($text) - $index); $matches = $this->phoneUtil->findNumbers($sub, RegionCode::NZ, Leniency::POSSIBLE(), PHP_INT_MAX); $matches->next(); $this->assertTrue($matches->valid()); $match = $matches->current(); $this->assertEquals($start - $index, $match->start()); $this->assertEquals($end - $index, $match->end()); $this->assertEquals(\mb_substr($sub, $match->start(), $match->end() - $match->start()), $match->rawString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIntermediateParsePositions()\n {\n $text = 'Call 033316005 or 032316005!';\n // | | | | | |\n // 0 5 10 15 20 25\n\n // Iterate over all possible indices.\n for ($i = 0; $i <= 5; $i++) {\n $this->assertEqualRange($text, $i, 5, 14);\n }\n // 7 and 8 digits in a row are still parsed as number.\n $this->assertEqualRange($text, 6, 6, 14);\n $this->assertEqualRange($text, 7, 7, 14);\n // Anything smaller is skipped to the second instance.\n for ($i = 8; $i <= 19; $i++) {\n $this->assertEqualRange($text, $i, 19, 28);\n }\n }", "public function search(string $what, int $start = 1, int $end = 1): int|false {}", "public function getElementText($start = 0, $end = -1);", "public function getText($start = 0, $end = -1);", "function find_between($string, $start, $stop, $incorexc) {\r\n $temp = split_string($string, $start, AFTER, $incorexc);\r\n return split_string($temp, $stop, BEFORE, $incorexc);\r\n}", "public static function between($str, $substr_start, $substr_end) {}", "function numberInRange($a_iStart, $a_iEnd, $a_iNumber)\n\t{\n\t\t// and starts with \"0\"\n\t\t$iStrLen = strlen($a_iNumber);\n\t\tif((substr($a_iNumber,0,1) == \"0\") && ($iStrLen > 1))\n\t\t\t$iNumber = substr($a_iNumber, 1, $iStrLen);\n\t\telse\n\t\t\t$iNumber = $a_iNumber;\n\n\t\tif($iNumber < $a_iStart)\n\t\t\treturn false;\n\t\telseif($iNumber > $a_iEnd)\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function preg_index($number)\n {\n }", "function test_range(){\n global $ID,$conf,$REV,$RANGE;\n\n $ID = 'wiki:syntax';\n $filename = $conf['datadir'].'/wiki/syntax.txt';\n $rev = filemtime($filename);\n $range = '1000-2000';\n\n $info = $this->_get_expected_pageinfo();\n $info['id'] = 'wiki:syntax';\n $info['namespace'] = 'wiki';\n $info['exists'] = true;\n $info['lastmod'] = $rev;\n $info['currentrev'] = $rev;\n $info['meta'] = p_get_metadata($ID);\n $info['filepath'] = $filename;\n\n // check $RANGE without $REV\n // expected result $RANGE unchanged\n $RANGE = $range;\n\n $this->assertEquals($info, pageinfo());\n $this->assertFalse(isset($REV));\n $this->assertEquals($range,$RANGE);\n\n // check $RANGE with $REV = current\n // expected result: $RANGE unchanged, $REV cleared\n $REV = $rev;\n $info['rev'] = '';\n\n $this->assertEquals($info, pageinfo());\n $this->assertEquals('',$REV);\n $this->assertEquals($range,$RANGE);\n\n // check with a real $REV\n // expected result: $REV and $RANGE are cleared\n $REV = $rev - 100;\n\n $this->assertEquals($info, pageinfo());\n $this->assertEquals('',$REV);\n $this->assertEquals('',$RANGE);\n }", "function ipbetweenrange($needle, $start, $end) {\n\n if((ip2long($needle) >= ip2long($start)) && (ip2long($needle) <= ip2long($end)))\n return true;\n\n return false;\n}", "public function test_it_prints() {\n // ADDED: check if the number contains the value as \"string\" (ie 13 is Fizz, 53 is Buzz etc)\n $expected = '1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz Fizz 14 FizzBuzz? 16 17 Fizz 19 Buzz Fizz 22 Fizz Fizz Buzz ';\n $this->assertEquals($expected, $this->kata->printFizzBuzzRange(1, 25));\n }", "public static function expandRange ($string, &$errorMessage)\r\n\t{\r\n\t\t# Find any matches (ending if none), and extract the first and last location number for each\r\n\t\tif (!preg_match_all ('/^([0-9]+)-([0-9]+)$/', $string, $matches, PREG_SET_ORDER)) {\r\n\t\t\t$errorMessage = 'The range you specified is not valid.';\t// e.g. caused by '1-2-3'\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t# Deal with each match\r\n\t\tforeach ($matches as $match) {\r\n\t\t\t\r\n\t\t\t# Compute the difference\r\n\t\t\t$start\t= $match[1];\r\n\t\t\t$end\t= $match[2];\r\n\t\t\t$difference = $end - $start;\r\n\t\t\t\r\n\t\t\t# If the difference is negative, and the start string is of fewer characters than the end string, then this is in the format 980-95 meaning 980-995\r\n\t\t\tif (($difference < 0) && (strlen ($start) > strlen ($end))) {\r\n\t\t\t\t\r\n\t\t\t\t# Add add on the starting figures from the start to produce the new end, e.g. '9'.'95' makes 995, and recompute the difference\r\n\t\t\t\t$addCharactersFromStart = strlen ($start) - strlen ($end);\r\n\t\t\t\t$end = substr ($start, 0, $addCharactersFromStart) . $end;\r\n\t\t\t\t$difference = $end - $start;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# If the difference is still negative, end\r\n\t\t\tif ($difference < 0) {\r\n\t\t\t\t$errorMessage = 'The range you specified must begin with a smaller number.';\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t# If there is a difference\r\n\t\t\tif ($difference) {\r\n\t\t\t\t$maximumTotal = 50;\r\n\t\t\t\tif (($difference + 1) > $maximumTotal) {\t// E.g. 12-17 is a difference of 5 but is 6 photos, hence the +1\r\n\t\t\t\t\t$errorMessage = 'Sorry, the total number of items (' . ($difference + 1) . \") in the range you specified ({$start}-{$end}) is too great; a maximum of {$maximumTotal} items in a range is allowed. Please check and try again.\";\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t$new = array ();\r\n\t\t\t\tfor ($i = $start; $i <= $end; $i++) {\r\n\t\t\t\t\t$new[] = $i;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t# Perform the substitution\r\n\t\t\t\t$string = preg_replace (\"/\\b{$match[0]}\\b/\", implode (' ', $new), $string);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t# Trim surrounding whitespace\r\n\t\t$string = trim ($string);\r\n\t\t\r\n\t\t# Return the replaced string\r\n\t\treturn $string;\r\n\t}", "public function testThrowWithOffset() {\n\t\ttry {\n\t\t\t$offset = 12;\n\t\t\tthrow new \\YapepBase\\Exception\\IndexOutOfBoundsException($offset);\n\t\t\t$this->fail('Exception not thrown!');\n\t\t} catch (\\YapepBase\\Exception\\IndexOutOfBoundsException $e) {\n\t\t\t$this->assertNotEquals(false, \\strpos($e->getMessage(), (string)$offset),\n\t\t\t\t\t'Offset ' . $offset . ' is not in message! Message was: ' . $e->getMessage());\n\t\t}\n\t}", "public function testGetPredicateRange()\n {\n // test data\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->getPredicateRange('http://p1');\n\n $this->assertEquals('http://foobar', $res);\n }", "public function testRegistrationValuesContainNumbers(): void { }", "function insidex($start, $end=\"\", $content = false) {\r\n $r = inside($start, $end, $content);\r\n if ($r) $r = $start . $r . $end;\r\n\r\n if (DEV)\r\n xlogc('insidex', $r, $start, $end, $content);\r\n\r\n return $r;\r\n}", "public function __construct( $text, $begin = '', $end = '' );", "function search($text)\n {\n // full text. The result is an array:\n // Array( <index> => <part#>, .. )\n $part_map = Array();\n reset($this->unique_parts);\n\n foreach ($this->unique_parts as $pi => $part_str) {\n $pos = strpos($text, $part_str);\n\n while ($pos !== false) {\n $part_map[$pos] = $pi;\n $pos = strpos($text, $part_str, $pos+1);\n }\n }\n\n ksort($part_map); // Sort by string index\n\n // The following code does several things simultaneously:\n // 1) Divide the indices into groups using gaps\n // larger than $this->max_err as boundaries.\n // 2) Translate the groups into strings so that\n // part# 0 = 'A', part# 1 = 'B' etc. to make\n // a low resolution approximate search possible later\n // 3) Save the string indices in the full string\n // that correspond to characters in the translated string.\n // 4) Discard groups (=part sequences) that are too\n // short to contain the approximate pattern.\n // The format of resulting array:\n // Array(\n // Array( \"<translate-string>\",\n // Array( <translated-idx> => <full-index>, ... ) ),\n // ... )\n $transf = Array();\n $transf_text = \"\";\n $transf_pos = Array();\n $last_end = 0;\n $group_len = 0;\n reset($part_map);\n\n foreach ($part_map as $i => $p) {\n if ($i - $last_end > $this->max_part_len+$this->max_err) {\n if ($group_len >= ($this->n_parts-$this->max_err)) {\n $transf[] = Array( $transf_text, $transf_pos );\n }\n\n $transf_text = \"\";\n $transf_pos = Array();\n $group_len = 0;\n }\n\n $transf_text .= chr($p + ord(\"A\"));\n $transf_pos[] = $i;\n $group_len++;\n $last_end = $i + strlen($this->parts[$p]);\n }\n\n if (strlen($transf_text) >= ($this->n_parts-$this->max_err)) {\n $transf[] = Array( $transf_text, $transf_pos );\n }\n\n unset($transf_text, $transf_pos);\n\n if (current($transf) === false) {\n return Array();\n }\n\n // Filter the remaining groups (\"approximate anagrams\"\n // of the pattern) and leave only the ones that have enough\n // parts in correct order. You can think of this last step of the\n // algorithm as a *low resolution* approximate string search.\n // The result is an array of candidate text spans to be scanned:\n // Array( Array(<full-start-idx>, <full-end-idx>), ... )\n $part_positions = Array();\n\n foreach ($transf as $idx => $matchBlock) {\n $str = $matchBlock[0];\n $pos_map = $matchBlock[1];\n// print \"|$transf_patt| - |$str|\\n\";\n $lores_matches = $this->search_short($this->transf_patt, $this->max_err, $str);\n\n foreach ($lores_matches as $tr_end => $unused) {\n $tr_start = max(0, $tr_end - $this->n_parts);\n\n if ($tr_end >= $tr_start) {\n $median_pos = $pos_map[(int)(($tr_start + $tr_end) / 2)];\n $start = $median_pos - ($this->patt_len / 2 + 1) - $this->max_err - $this->max_part_len;\n $end = $median_pos + ($this->patt_len / 2 + 1) + $this->max_err + $this->max_part_len;\n\n// print \"#\" . strtr(substr( $text, $start, $end-$start ), \"\\n\\r\", \"$$\") . \"#\\n\";\n// print_r( $this->search_short( &$this->patt, $this->max_err, &$text, $start, $end-$start ));\n\n $part_positions[] = Array($start, $end);\n }\n }\n\n unset($lores_matches);\n }\n\n unset($transf);\n\n if (current($part_positions) === false) {\n return Array();\n }\n\n // Scan the final candidates and put the matches in a new array:\n $matches = Array();\n $text_len = strlen($text);\n\n foreach ($part_positions as $idx => $partBlock) {\n $start = $partBlock[0];\n $end = $partBlock[1];\n $m = $this->search_short($this->patt, $this->max_err, $text, $start, $end - $start, $text_len);\n\n foreach ($m as $i => $cost) {\n $matches[$i] = $cost;\n }\n }\n\n unset($part_positions);\n\n return $matches;\n }", "function _kala_migrate_get_between($content, $start, $end) {\n // Explode this and let's find our stuff.\n $r = explode($start, $content);\n if (isset($r[1])){\n $r = explode($end, $r[1]);\n return $r[0];\n }\n // Return empty of nothing can be found.\n return '';\n}", "public function test_library_numbers() {\n\t\t$path = route('v2_library_numbers', [], false);\n\n\t\t$this->params['iso'] = 'arb';\n\t\t$this->params['script'] = 'Arab';\n\t\t$this->params['start'] = 1;\n\t\t$this->params['end'] = 100;\n\n\t\techo \"\\nTesting: \" . route('v2_library_numbers', $this->params);\n\t\t$response = $this->get(route('v2_library_numbers'), $this->params);\n\t\t$response->assertSuccessful();\n\t\t$response->assertJsonStructure([$this->getSchemaKeys('v4_numbers_range')]);\n\t\t// TODO: Test Custom Range on DBP\n\t\t// $this->compareToOriginal($path,[$this->getSchemaKeys('v4_numbers_range')]);\n\t}", "public function testCheckInputPasswordRange($password, $expected)\n {\n $inputRangeStart = 1;\n $inputRangeEnd = 10;\n $output = $this->VenusFuelDepot->checkInputPasswordRange($password, $inputRangeStart, $inputRangeEnd);\n $this->assertEquals(\n $expected,\n $output,\n \"When a valid input {$password} is within the defined range, the password {$password} is returned.\"\n );\n }", "function GetBetween2($content, $start, $end) {\r\n\t$r = explode($start, $content);\r\n\tif (isset($r[1])) {\r\n\t\t$rcount = count($r);\r\n\t\t// changed from -2 to -1\r\n\t\t$r = explode($end, $r[$rcount-1]);\r\n\t\treturn $r[0];\r\n\t}\r\n\treturn '';\r\n}", "function find_all($string, $start, $end) {\r\n preg_match_all (\"($start(.*)$end)siU\", $string, $matching_data);\r\n return $matching_data[0];\r\n}", "function netrics_get_string_between( $start, $stop, $content ) {\n $str = explode( $start, $content );\n\n if ( isset( $str[1] ) ) {\n $str_btwn = explode( $stop, $str[1] );\n return $str_btwn[0];\n } else {\n return false;\n }\n}", "function fiftyone_degrees_node_index_string_compare($node_index, $start_position, $value, $headers) {\n $characters = fiftyone_degrees_get_node_index_string($node_index, $headers);\n $end = count($characters) - 1;\n for ($i = $end, $v = $start_position + $end; $i >= 0; $i--, $v--) {\n $difference = $characters[$i] - $value[$v];\n if ($difference != 0)\n return $difference;\n }\n return 0;\n}", "public function testIndexOf() {\n\t\t$array = array(1, 2, 3, 4, 5);\n\t\t$result = _::indexOf($array, 4);\n\t\t$this->assertEquals(3, $result);\n\n\t\t// test not finding an element's index\n\t\t$result = _::indexOf($array, 6);\n\t\t$this->assertEquals(-1, $result);\n\t}", "function cp_intIsBetween($number,$min,$max){\r\n if(!cp_str_isInt($number)){\r\n return false;\r\n }\r\n\r\n return $number >= $min && $number <= $max;\r\n}", "public function testNonPlusPrefixedNumbersNotFoundForInvalidRegion()\n {\n $iterable = $this->phoneUtil->findNumbers('1 456 764 156', RegionCode::ZZ);\n\n $iterable->next();\n $this->assertFalse($iterable->valid());\n }", "function inside($start, $end=\"\", $content = false)\r\n{\r\n $org_content = $content;\r\n if ($content===false)\r\n $content = g('html');\r\n $r = '';\r\n if ($start) $s = strpos($content, $start);\r\n else $s=0;\r\n if ($s !== false) {\r\n $s += strlen($start);\r\n if ($end) $e = strpos($content, $end, $s);\r\n else $e = strlen($content);\r\n if ($e !== false)\r\n $r = trim(substr($content, $s, $e - $s));\r\n }\r\n\r\n if (DEV)\r\n xlogc('inside', $r, $start, $end, $org_content);\r\n\r\n return $r;\r\n}", "public function processRange($range) {\n $parts = explode($this->_range_delimiter, $range);\n\n if ( sizeof($parts) !== 2 ) {\n throw new InvalidArgumentException(\"bad range: ${range}\");\n }\n\n // sanity\n $start = $parts[0];\n $end = $parts[1];\n\n // could be roman numerals from prelim\n if ( !is_numeric($start) ) {\n\n \tif ( !$this->isPrelim($start) ) {\n \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n \t}\n\n if ( !is_numeric($end) ) {\n\n\t \tif ( !$this->isPrelim($end) ) {\n\t \t\tthrow new InvalidArgumentException(\"bad range: ${range}\");\n\t \t}\n \n return $start . $this->_range_delimiter . $end;\n\n } else if ( intval($end) > $this->_min_page ) {\n \t// way out on the edge case: second number could be arabic\n \n $end = $this->step($end);\n\n return $start . $this->_range_delimiter . $end;\n }\n }\n\n // fill out $end with leading digits of $start\n $end = $this->expandRangeEnd($start, $end);\n\n // sanity\n if ( intval($end) <= intval($start) ) {\n \tthrow new InvalidArgumentException(\"bad range: ${start} to ${end}\");\n }\n\n // does the addition/subtraction fall within this range?\n if ( intval($start) <= $this->_min_page && $this->_min_page < intval($end) ) {\n\n \t// removing pages from within a range is problematic\n \tif ( $this->_increment < 0 ) {\n \t\tthrow new InvalidArgumentException(\"Cannot remove pages from with range: ${range}\");\n \t}\n\n \t// gap this range\n \treturn $this->splitRange($start, $end);\n }\n\n $start = $this->step($start);\n $end = $this->step($end);\n\n $end = $this->collapseRangeEnd($start, $end);\n\n return $start . $this->_range_delimiter . $end;\n }" ]
[ "0.62983525", "0.5777926", "0.5431298", "0.5421564", "0.5354658", "0.5315711", "0.5296634", "0.52924395", "0.5289547", "0.5207557", "0.5196987", "0.51622915", "0.50495416", "0.504585", "0.5040655", "0.5014563", "0.49904117", "0.49635023", "0.4959943", "0.49368316", "0.49168637", "0.49060416", "0.4891482", "0.48841688", "0.48608717", "0.48605308", "0.48519623", "0.48404428", "0.48136955", "0.4791285" ]
0.77637887
0
Extracts the textual data from the provided image.
private function _getTextFromImage($encodedimage) { $image = new Imagick(); $decoded = base64_decode($encodedimage); $image->readimageblob($decoded); $textfilename = sys_get_temp_dir() . "/" . time() . uniqid(); $imagefilename = sys_get_temp_dir() . "/" . time() . uniqid() . ".png"; $image->writeImage($imagefilename); $cmdpngtotxt = self::$_tesseract . " " . $imagefilename . " " . $textfilename . " > /dev/null 2>&1"; exec($cmdpngtotxt, $output, $retval); unset($output); if ($retval !== 0) { throw new Exception( _("Error while executing shell command") . " \"" . $cmdpngtotxt . "\", " . _("status code") . ": " . $retval, EXCEPTION_CANNOT_RUN_TESSERACT ); } //end if $textfilename .= ".txt"; if (file_exists($textfilename) === true) { $text = file_get_contents($textfilename); } else { throw new Exception(_("Error while reading text file") . " " . $cmdpngtotxt, EXCEPTION_ERROR_READING_TEXT_FILE); } //end if return $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function imageToText($image) {\n\n $response = '';\n \n // Instantiates Google Vision API request\n $vision = new VisionClient([\n 'projectId' => getenv('GOOGLE_VISION_PROJECTID')\n ]);\n\n // Prepare the image to be annotated\n $image = $vision->image(file_get_contents($image), ['TEXT_DETECTION']);\n \n // Performs OCR on the image file\n $result = $vision->annotate($image);\n $resultText = $result->text();\n if(isset($resultText[0]) && !empty($resultText[0]->description())) {\n $response = $resultText[0]->description();\n }\n\n return $response;\n }", "public function stripTextFromImage($isFile = FALSE)\n\t{\n\t\t$border = '';\n\t\t$binstream = '';\n\t\t$returnIs = FALSE;\n\t\t\n\t\t// Get the border binary from the image\n\t\t$binBorder = '';\n\t\tfor ($x = 0; $x < 16; $x++)\n\t\t{\n\t\t\t$binBorder .= $this->rgbToBin(imagecolorat($this->imageSource, $x, 0));\n\t\t}\n\n\t\t// Convert border binary to border ascii\n\t\tfor ($x = 0; $x < strlen($binBorder); $x += 8)\n\t\t{\n\t\t\t$binChunk = substr($binBorder, $x, 8);\n\t\t\t$border .= $this->binaryToAscii($binChunk);\n\t\t}\n\n\t\t// Get the original data out of the image\n\t\t$startX = 16;\n\t\tfor ($y = 0; $y < $this->imageSourceSize[1]; $y++)\n\t\t{\n\t\t\tfor ($x = $startX; $x < $this->imageSourceSize[0]; $x++)\n\t\t\t{\n\t\t\t\t$binstream .= $this->rgbToBin(imagecolorat($this->imageSource, $x, $y));\n\t\t\t\t\n\t\t\t\tif (strlen($binstream) >= 8)\n\t\t\t\t{\n\t\t\t\t\t$binchar = substr($binstream, 0, 8);\n\t\t\t\t\t$this->text .= $this->binaryToAscii($binchar);\n\t\t\t\t\t$binstream = substr($binstream, 8);\n\t\t\t\t}\n\n\t\t\t\tif ($isFile === TRUE)\n\t\t\t\t{\n\t\t\t\t\tif (strpos($this->text, $border) !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->text = substr($this->text, 0, strlen($this->text) - 6);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->filename == '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->filename = $this->text;\n\t\t\t\t\t\t\t$this->text = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$returnIs = TRUE;\n\t\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t\t}\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 (strpos($this->text, $border) !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$returnIs = TRUE;\n\t\t\t\t\t\t$this->text = substr($this->text, 0, strlen($this->text) - 6);\n\t\t\t\t\t\tbreak 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$startX = 0;\n\t\t}\n\t\treturn $returnIs;\n\t}", "protected function onImageText() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$titles = post('ititle');\n\t\t$descriptions = post('idescription');\n\n\t\tforeach ($this->post->featured_images()->get() as $image) {\n\n\t\t\t$image->title = $titles[$image->id];\n\t\t\t$image->description = $descriptions[$image->id];\n\t\t\t$image->save();\n\t\t}\n\t}", "function imageProcessor($text)\r\n {\r\n $this->images = array();\r\n // если включена обработка пробелов в путях картинок\r\n if ($this->feed['params']['image_space_on']) {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n } else {\r\n $text = preg_replace_callback('|<img(.*?)src(.*?)=[\\s\\'\\\"]*(.*?)[\\'\\\"\\s](.*?)>|is', array(&$this, 'imageParser'), $text);\r\n }\r\n return $text;\r\n }", "protected function fetchFullTextImage(){\n $this->imageFullText = $this->getImageTypeFromImages('full');\n }", "function imagecustom($im, $text) {\n}", "private function generateText($image, $object) {\n // Calculate text points\n $box = imagettfbbox($object[\"size\"], 0, $object[\"path\"], $object[\"text\"]);\n $width = $box[0] + $box[2];\n $height = -1 * ($box[5] - $box[1]);\n $dx = $dy = 0;\n\n if (isset($object[\"shadow\"])) {\n $dx = $object[\"shadow\"][\"left\"];\n $dy = $object[\"shadow\"][\"top\"];\n $width += $dx * 2;\n $height += $dy * 2;\n }\n\n // Create tmp layer\n $tmp = imagecreatetruecolor($width, $height);\n // Add transparent\n $transparent = imagecolorallocatealpha($tmp, 0, 0, 0, 127);\n imagefill($tmp, 0, 0, $transparent);\n imagesavealpha($tmp, true);\n\n if (isset($object[\"shadow\"])) {\n // Create color for text shadow\n $color = sscanf($object[\"shadow\"][\"color\"], \"#%02x%02x%02x\");\n $font_color = imagecolorallocate($tmp, $color[0], $color[1], $color[2]);\n // Add text to image\n imagettftext($tmp, $object[\"size\"], 0, $object[\"shadow\"][\"left\"] - $box[0] + $dx, $object[\"shadow\"][\"top\"] - $box[7] + $dy, $font_color, $object[\"path\"], $object[\"text\"]);\n }\n // Create color for text\n $font_color = imagecolorallocate($tmp, $object[\"color\"][0], $object[\"color\"][1], $object[\"color\"][2]);\n imagettftext($tmp, $object[\"size\"], 0, - $box[0] + $dx, - $box[7] + $dy, $font_color, $object[\"path\"], $object[\"text\"]);\n\n $this->imagecopymerge_alpha($image, $tmp, $object[\"left\"], $object[\"top\"], 0, 0, $object[\"opacity\"], $object[\"rotate\"]);\n\n // Destroy temporary image\n imagedestroy($tmp);\n\n return $image;\n }", "public function fullTextImage(){\n if(isset($this->imageFullText)){\n return $this->imageFullText;\n }\n $this->fetchFullTextImage();\n return $this->imageFullText;\n }", "public function getTextContent();", "private function getRasterBlobFromImage(Imagick $im)\n {\n $blob = $im -> getimageblob();\n /* Find where header ends */\n $i = strpos($blob, \"P4\\n\") + 2;\n while ($blob[$i + 1] == '#') {\n $i = strpos($blob, \"\\n\", $i + 1);\n }\n $i = strpos($blob, \"\\n\", $i + 1);\n /* Return raster data only */\n $subBlob = substr($blob, $i + 1);\n return $subBlob;\n }", "public function getTextData()\n {\n return $this->text;\n }", "public function getAsString() {\n\t\t$image = $this->getImage();\n\t\t$string = $image->toString();\n\n\t\tif ($string === false) {\n\t\t\t$this->handleError($image);\n\t\t} else {\n\t\t\treturn $string;\n\t\t}\n\t}", "protected function extractImageFromHTML($text, $type=''){\n if(!class_exists('DOMDocument') ){\n return;\n }\n $html = new DOMDocument();\n $html->recover = true;\n $html->strictErrorChecking = false;\n $html->loadHTML($text);\n $images = array();\n foreach($html->getElementsByTagName('img') as $image) {\n $imgSrc = preg_match('/http/', $image->getAttribute('src'))? $image->getAttribute('src') : JURI::root().$image->getAttribute('src');\n $images[] = array(\n 'src' => $imgSrc,\n 'class' => $image->getAttribute('class'),\n 'type' => $type\n );\n }\n return $images;\n }", "public function getImageDetails($image) {\r\n\r\n$temp = getimagesize($this->src);\r\nif(null == $temp)\r\nthrow new Exception('Error while extracting the source image information');\r\n\r\n$this->width = $temp[0];\r\n$this->height = $temp[1];\r\n$this->type = $temp[2];\r\n}", "abstract protected function processImage (string $src): string;", "function extract_image_url($text,$pageTitle) {\r\n\t $text = trim(preg_replace(\"/<[^>]+>/\",\" \",$text));\r\n\r\n \tif (preg_match_all(\"/(\\[\\[image:)([^\\]\\|]*)(\\|[^\\]]*)?\\]\\]/i\", $text, $match)) {\r\n\t \t$name = $match[2][0];\r\n\t \tif (preg_match(\"/\\{\\{logo\\}\\}/\",$name)) {\r\n\t \t$name = ucwords(strtolower($pageTitle)).\".png\";\r\n\t }\r\n\t\t} else if (preg_match_all(\"/([a-z0-9_ -]+\\.)(?:jpe?g|png|gif)/i\", $text, $match)) {\r\n\t $name = $match[0][0];\r\n\t }\r\n\t if (!isset($name)) return null;\r\n\t\treturn $this->make_image_url($name);\r\n\t}", "public function getExtractedText()\r\n {\r\n return $this->_extractedText;\r\n }", "function kdw_row_tiles_txt_img (){ \r\n \r\n}", "public function introTextImage(){\n if(isset($this->imageIntro)){\n return $this->imageIntro;\n }\n $this->fetchIntroImage();\n return $this->imageIntro;\n }", "function textoGif($text) \r\n\t{\r\n \r\n\t\r\n\tpreg_match_all('/\\[EQ(.+?)EQ\\]|\\$\\$(.+?)\\$\\$/is', $text, $matches); \r\n for ($i=0; $i<count($matches[0]); $i++) {\r\n $texexp = $matches[1][$i] . $matches[2][$i];\r\n\t\t$texexp = str_replace('<br />','',$texexp);\r\n\t\t$texexp = str_replace('<br />','',$texexp);\r\n\t\t//$texexp = urlencode($texexp);\r\n $text = str_replace( $matches[0][$i], \"<img src=\\\"/cgi-bin/mimetex.cgi?$texexp\\\">\", $text);\r\n }\r\n\r\n\treturn $text; \r\n\t\r\n\t\r\n\t}", "private function applyTextToImage($image, $font, $date)\n {\n $interval = date_diff(\n $date['futureDate'],\n $date['now']\n );\n\n if ($date['futureDate'] < $date['now']) {\n $text = $interval->format('00:00:00:00');\n $this->loops = 1;\n } else {\n $text = $interval->format('0%a:%H:%I:%S');\n $this->loops = 0;\n }\n\n $labels = array('Days', 'Hrs', 'Mins', 'Secs');\n\n // apply the labels to the image $this->yOffset + ($this->characterHeight * 0.8)\n foreach ($labels as $key => $label) {\n imagettftext($image, 15, 0, (int) ($this->xOffset + ($this->characterWidth * $this->labelOffsets[$key])), 98, $font['color'], $font['path'], $label);\n }\n\n // apply time to new image\n imagettftext($image, $font['size'], 0, $this->xOffset, $this->yOffset, $font['color'], $font['path'], $text);\n\n ob_start();\n imagegif($image);\n $this->frames[] = ob_get_contents();\n $this->delays[] = $this->delay;\n ob_end_clean();\n\n $this->date['now']->modify('+1 second');\n\n return $image;\n }", "public function getText();", "public function getText();", "public function getText();", "function getTextContent() {\n\t\treturn $this->lobSub->lobText;\n\t}", "private function _getImageInfo($image)\n {\n return getimagesize($image); // This function doesn't only return the image size but some essential information as well.\n }", "function getImageStringFromFile($xpmfile) {\r\n $file = fopen($xpmfile,\"r\");\r\n $content = fread($file, filesize($xpmfile));\r\n // remove all \" and CR\r\n $content = str_replace(array(\"\\\"\",\"\\n\", \"\\r\"), \"\", $content);\r\n // find position of { and of } and substr between these 2\r\n $start = strpos($content, \"{\")+1; // to remove the {\r\n $stop = strpos($content, \"}\");\r\n $imgdescr = substr($content, $start, $stop - $start);\r\n // explode\r\n $xpm = explode(\",\", $imgdescr);\r\n \r\n //print_r($xpm);\r\n \r\n return getImageString($xpm);\r\n}", "public function text_bitmap($text) \r\n { \r\n $height=count($this->ascii_table[0]); \r\n $width=count($this->ascii_table[0][0]); \r\n\r\n $result=array(); \r\n $baseY=$baseX=0; \r\n for ($index=0;$index<strlen($text);++$index) \r\n { \r\n if ($text[$index]==PHP_EOL) \r\n { \r\n $baseY+=$height; \r\n $baseX=0; \r\n continue; \r\n } \r\n $ascii_entry=$this->ascii_table[ord($text[$index])]; \r\n for ($j=0;$j<$height;++$j) \r\n { \r\n for ($i=0;$i<$width;++$i) \r\n $result[$baseY+$j][$baseX+$i]=$ascii_entry[$j][$i]; \r\n $result[$baseY+$j][$baseX+$width]=1; //space between chars \r\n } \r\n $baseX+=$width; \r\n } \r\n return $result; \r\n }", "public static function widget_imagedata($data){\n wfPlugin::includeonce('wf/array');\n $data = new PluginWfArray($data);\n $app_dir = wfArray::get($GLOBALS, 'sys/app_dir');\n $element = array();\n if(wfFilesystem::fileExist($app_dir.$data->get('data/filename'))){\n $exif = PluginImageExif_v1::getImageData($data->get('data/filename'));\n foreach ($exif as $key => $value) {\n $ul = wfDocument::createHtmlElementAsObject('ul');\n foreach ($value as $key2 => $value2) {\n if(is_array($value2)){\n $value2 = json_encode($value2);\n }\n $ul->set('innerHTML/', wfDocument::createHtmlElement('li', $key2.': '.$value2));\n }\n $element[] = wfDocument::createHtmlElement('h1', $key);\n $element[] = $ul->get();\n }\n wfDocument::renderElement($element);\n }else{\n echo 'Could not find file '.$data->get('data/filename');\n }\n }", "public function extract($content);" ]
[ "0.69837564", "0.5774759", "0.575085", "0.57214445", "0.57074875", "0.55397475", "0.54725474", "0.5347983", "0.53297025", "0.5312989", "0.5306777", "0.5261299", "0.5260294", "0.5236196", "0.5202511", "0.5178821", "0.5178202", "0.5172677", "0.5168554", "0.5164934", "0.5163754", "0.50746", "0.50746", "0.50746", "0.5056328", "0.5037855", "0.5033109", "0.50329006", "0.50209355", "0.5001457" ]
0.6976827
1
Set layout root path if given in configuration
protected function setLayoutRootPath(array $conf) { // Override the default layout path via typoscript $layoutPaths = []; if (isset($conf['layoutRootPath']) || isset($conf['layoutRootPath.'])) { $layoutRootPath = isset($conf['layoutRootPath.']) ? $this->cObj->stdWrap($conf['layoutRootPath'], $conf['layoutRootPath.']) : $conf['layoutRootPath']; $layoutPaths[] = GeneralUtility::getFileAbsFileName($layoutRootPath); } if (isset($conf['layoutRootPaths.'])) { $layoutPaths = array_replace($layoutPaths, $this->applyStandardWrapToFluidPaths($conf['layoutRootPaths.'])); } if (!empty($layoutPaths)) { $this->view->setLayoutRootPaths($layoutPaths); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLayoutRootPath() {}", "protected function setInitialRootPath() {}", "function set_root ($root)\n {\n $this->mPath = realpath($root) . '/';\n }", "public function getDefaultLayoutRootPath()\r\n {\r\n return $this->getDirectoryName($this->defaultLayoutRootPath);\r\n }", "public function setLayoutRootPaths($layoutRootPaths)\n {\n $this->fluidTemplate->setLayoutRootPaths($layoutRootPaths);\n }", "public static function getDefaultLayoutPath(): string\n {\n return Path::packageCurrent(['resources/layouts']);\n }", "function layout_path($layout = '')\n { \n return extension_path(\"layouts\").($layout ? DS.$layout : $layout);\n }", "public function setLayoutRootPath($layoutRootPath)\r\n {\r\n $this->layoutRootPath = $layoutRootPath;\r\n }", "protected function defineOriginalRootPath() {}", "public function setRootPath($path);", "public static function setLayout(string $layout)\n {\n self::$LAYOUT = self::$ROOT_DIR.'/views/'.$layout;\n }", "public function setLayoutRootPath($layoutRootPath) {\n $this->layoutRootPath = $layoutRootPath;\n }", "public function getLayoutRootPaths() {}", "function set_root($root)\r\n\t{\r\n\t\tif (empty($root)) return;\r\n\t\tif (!is_dir($root))\r\n\t\t{\r\n\t\t\t$this->error(\"phemplate::set_root(): $root is not a directory.\", 'warning');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t$this->root = $root;\r\n\t\treturn true;\r\n\t}", "public function setDefaultViewBasePath($path)\n\t{\n\t\t$this->_defaultViewBasePath = $path;\n\t}", "public function testLayoutWithViewBasePath()\n {\n $layout = new Layout\\Layout(array(\n 'viewBasePath' => __DIR__ . '/_files/layouts-basepath/')\n );\n $this->assertEquals('layout inside basePath', $layout->render());\n $layout->setLayout('layout2');\n $this->assertEquals('foobar-helper-output', $layout->render());\n }", "protected function _getDefaultTargetPath(): string\n {\n return dirname(APP) . DS . 'templates' . DS . 'layout' . DS . 'TwitterBootstrap' . DS;\n }", "public static function setRoot($prm_isroot=false)\n\t{\n global $application_is_root;\n $application_is_root = $prm_isroot;\n\t}", "public function getLayoutDirectory()\n\t{\n\t\treturn ORION_APP_DIR . '/' . strtolower($this->application->getName()) . '/layouts';\n\t}", "protected function setupLayout()\n\t{\n\t\tif (!is_null($this->layout)) {\n\t\t\t$this->layout = view($this->layout);\n\t\t}\n\t}", "public function autoLayout() \n {\n $path = 'layouts/'.$_SESSION['language'].'/'.$this->params['controller_id'].'.php';\n\n if (file_exists($path))\n {\n return $path;\n }\n else \n {\n $path = 'layouts/polyglot/'.$this->params['controller_id'].'.php';\n\n if (file_exists($path))\n {\n return $path;\n }\n else\n {\n return false;\n }\n }\n\t}", "protected function setupLayout() {\n\t\tif ( ! is_null($this->layout)) {\n\n\n\t\t\t$cb_js_var = array(\n\t\t\t\t'site_url' => url('/'),\n\t\t\t\t'admin_url' => url('/admin'),\n\t\t\t\t'admin_assets_url' => asset('packages/vizioart/cookbook/'),\n\t\t\t\t'admin_api_url' => url('/admin/api')\n\t\t\t);\n\n\n\t\t\t$this->layout = View::make($this->layout, array(\n\t\t\t\t'cb_js_var' => $cb_js_var\n\t\t\t));\n\t\t}\n\t}", "public static function setRootPath($root_path)\r\n {\r\n self::$_autoloadRootPath = $root_path;\r\n }", "protected function setNonAuthenticatedPageLayout() {\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::HeaderTemplate;\n }\n\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::ContenTemplate;\n\n if (!$this->app->router->isWsCall) {\n require __ROOT__ . Enums\\ApplicationFolderName::AppsFolderName . $this->app->name() . Enums\\FileNameConst::FooterTemplate;\n }\n }", "public static function setRootPath($root_path)\n {\n self::$_autoloadRootPath = $root_path;\n }", "protected function setInitialRelativePath() {}", "public function setCleanLayout()\n {\n $this->layout = \"@app/modules/site/views/layouts/public_clean\";\n }", "function set_rootdir($dir)\n\t{\n\t\tglobal $config;\n\t\tif (!@is_dir($dir))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$dir = str_replace('\\\\', '/', $dir);\n\t\t// creating absolute path for cache\n\t\t$this->cachedir = IP_ROOT_PATH . XS_DIR_CACHE . '/';\n\t\t// creating absolute path for current template and root dir\n\t\t$this->tpldir = IP_ROOT_PATH . 'templates/';\n\t\t$this->tpldir_len = strlen($this->tpldir);\n\t\t$this->root = $dir;\n\t\t$this->tpl = $this->template_name($dir);\n\t\t// check configuration\n\t\t$this->get_config();\n\t\treturn true;\n\t}", "public function setMageRoot($value) {\n if (preg_match('/^\\/\\w*/i', $value)) {\n $mage_root = $value;\n } else {\n $mage_root = getcwd() . self::$_DS . $value;\n }\n\n $this->_mage_root = $mage_root;\n }", "public function setLayout($layout)\n {\n $layout_path = APP_ROOT . 'Views/Layouts/' . $layout . '.ptm.php';\n if ((file_exists($layout_path))) {\n $this->layout = $layout;\n } else {\n die('Layout ' . $layout . ' not exist');\n }\n $this->layout = $layout;\n }" ]
[ "0.70892435", "0.6838849", "0.6521641", "0.6495577", "0.64152163", "0.63877046", "0.63692397", "0.62902516", "0.6288645", "0.6254587", "0.62483", "0.6176403", "0.61132485", "0.6097147", "0.5965899", "0.5953479", "0.59266204", "0.59139276", "0.5876032", "0.58734936", "0.58595365", "0.58325845", "0.58145404", "0.5807127", "0.5777674", "0.5774684", "0.5772008", "0.57623535", "0.5757321", "0.5745887" ]
0.7095352
0
Applies stdWrap on Fluid path definitions
protected function applyStandardWrapToFluidPaths(array $paths) { $finalPaths = []; foreach ($paths as $key => $path) { if (StringUtility::endsWith($key, '.')) { if (isset($paths[substr($key, 0, -1)])) { continue; } $path = $this->cObj->stdWrap('', $path); } elseif (isset($paths[$key . '.'])) { $path = $this->cObj->stdWrap($path, $paths[$key . '.']); } $finalPaths[$key] = GeneralUtility::getFileAbsFileName($path); } return $finalPaths; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stdWrap($content = '', $conf = [])\n {\n $content = (string)$content;\n // If there is any hook object, activate all of the process and override functions.\n // The hook interface ContentObjectStdWrapHookInterface takes care that all 4 methods exist.\n if ($this->stdWrapHookObjects) {\n $conf['stdWrapPreProcess'] = 1;\n $conf['stdWrapOverride'] = 1;\n $conf['stdWrapProcess'] = 1;\n $conf['stdWrapPostProcess'] = 1;\n }\n\n if (!is_array($conf) || !$conf) {\n return $content;\n }\n\n // Cache handling\n if (is_array($conf['cache.'])) {\n $conf['cache.']['key'] = $this->stdWrap($conf['cache.']['key'], $conf['cache.']['key.']);\n $conf['cache.']['tags'] = $this->stdWrap($conf['cache.']['tags'], $conf['cache.']['tags.']);\n $conf['cache.']['lifetime'] = $this->stdWrap($conf['cache.']['lifetime'], $conf['cache.']['lifetime.']);\n $conf['cacheRead'] = 1;\n $conf['cacheStore'] = 1;\n }\n // The configuration is sorted and filtered by intersection with the defined stdWrapOrder.\n $sortedConf = array_keys(array_intersect_key($this->stdWrapOrder, $conf));\n // Functions types that should not make use of nested stdWrap function calls to avoid conflicts with internal TypoScript used by these functions\n $stdWrapDisabledFunctionTypes = 'cObject,functionName,stdWrap';\n // Additional Array to check whether a function has already been executed\n $isExecuted = [];\n // Additional switch to make sure 'required', 'if' and 'fieldRequired'\n // will still stop rendering immediately in case they return FALSE\n $this->stdWrapRecursionLevel++;\n $this->stopRendering[$this->stdWrapRecursionLevel] = false;\n // execute each function in the predefined order\n foreach ($sortedConf as $stdWrapName) {\n // eliminate the second key of a pair 'key'|'key.' to make sure functions get called only once and check if rendering has been stopped\n if (!$isExecuted[$stdWrapName] && !$this->stopRendering[$this->stdWrapRecursionLevel]) {\n $functionName = rtrim($stdWrapName, '.');\n $functionProperties = $functionName . '.';\n $functionType = $this->stdWrapOrder[$functionName];\n // If there is any code on the next level, check if it contains \"official\" stdWrap functions\n // if yes, execute them first - will make each function stdWrap aware\n // so additional stdWrap calls within the functions can be removed, since the result will be the same\n if (!empty($conf[$functionProperties]) && !GeneralUtility::inList($stdWrapDisabledFunctionTypes, $functionType)) {\n if (array_intersect_key($this->stdWrapOrder, $conf[$functionProperties])) {\n $conf[$functionName] = $this->stdWrap($conf[$functionName], $conf[$functionProperties]);\n }\n }\n // Check if key is still containing something, since it might have been changed by next level stdWrap before\n if ((isset($conf[$functionName]) || $conf[$functionProperties]) && ($functionType !== 'boolean' || $conf[$functionName])) {\n // Get just that part of $conf that is needed for the particular function\n $singleConf = [\n $functionName => $conf[$functionName],\n $functionProperties => $conf[$functionProperties]\n ];\n // In this special case 'spaceBefore' and 'spaceAfter' need additional stuff from 'space.''\n if ($functionName === 'spaceBefore' || $functionName === 'spaceAfter') {\n $singleConf['space.'] = $conf['space.'];\n }\n // Hand over the whole $conf array to the stdWrapHookObjects\n if ($functionType === 'hook') {\n $singleConf = $conf;\n }\n // Add both keys - with and without the dot - to the set of executed functions\n $isExecuted[$functionName] = true;\n $isExecuted[$functionProperties] = true;\n // Call the function with the prefix stdWrap_ to make sure nobody can execute functions just by adding their name to the TS Array\n $functionName = 'stdWrap_' . $functionName;\n $content = $this->{$functionName}($content, $singleConf);\n } elseif ($functionType === 'boolean' && !$conf[$functionName]) {\n $isExecuted[$functionName] = true;\n $isExecuted[$functionProperties] = true;\n }\n }\n }\n unset($this->stopRendering[$this->stdWrapRecursionLevel]);\n $this->stdWrapRecursionLevel--;\n\n return $content;\n }", "function venus_init_structural_wrap() {\n\n\t$structural_wraps = array(\n\t\t'header',\n\t\t'menu-secondary',\n\t\t'footer-widgets',\n\t\t'footer'\n\t);\n\n\t$structural_wraps_with_col12 = array(\n\t\t'header'\n\t);\n\n\tadd_theme_support( 'genesis-structural-wraps', $structural_wraps );\n\n\tforeach( $structural_wraps as $wrap ) {\n\t\tadd_filter( \"genesis_structural_wrap-{$wrap}\", 'venus_structural_wrap', 15, 2 );\n\t}\n\n\tforeach( $structural_wraps_with_col12 as $wrap ) {\n\t\tadd_filter( \"genesis_structural_wrap-{$wrap}\", 'venus_structural_wrap_col12', 16, 2);\n\t}\n}", "function venus_structural_wrap( $output, $original_output ) {\n\n\tswitch ( $original_output ) {\n\t\tcase 'open':\n\t\t\t$output = '<div class=\"container\"><div class=\"row\">';\n\t\t\tbreak;\n\t\tcase 'close':\n\t\t\t$output = '</div></div>';\n\t\t\tbreak;\n\t}\n\n\treturn $output;\n}", "private function renderInWrapper () {\n\t\t//open the generic application wrapper template\n\t\t/*\n\t\t$C = __CLASS__;\n\t\t$st = new $C();\n\t\t$st->init(null, \"wrapper\");\n\t\t$st->set(\"content\", $this->fetch());\n\t\t$st->render(true);\n\t\t*/\n\t}", "public function stdWrap_stdWrap($content = '', $conf = [])\n {\n return $this->stdWrap($content, $conf['stdWrap.']);\n }", "protected function get_wrapper() {\n\t\tif ( ! $this->wrapper ) {\n\t\t\t$this->wrapper = \\apply_filters( 'wpseo_breadcrumb_output_wrapper', 'span' );\n\t\t\t$this->wrapper = \\tag_escape( $this->wrapper );\n\t\t\tif ( ! \\is_string( $this->wrapper ) || $this->wrapper === '' ) {\n\t\t\t\t$this->wrapper = 'span';\n\t\t\t}\n\t\t}\n\n\t\treturn $this->wrapper;\n\t}", "function rewrapHTMLCallback($match) {\n $width = 80;\n $break = '<span class=\"allowWrap\"> </span>';\n $words = preg_split('~(\\r\\n|\\n\\r|[\\r\\n\\s])~', $match[2]);\n $systemIncludePath = dirname(dirname(__FILE__));\n if (is_array($words)) {\n $result = '';\n foreach ($words as $word) {\n if (0 === strpos($word, PAPAYA_INCLUDE_PATH)) {\n $partWord = substr($word, strlen(PAPAYA_INCLUDE_PATH));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>/'.$partWord;\n }\n } elseif (isset($_SERVER['DOCUMENT_ROOT']) &&\n 0 === strpos($word, $_SERVER['DOCUMENT_ROOT'])) {\n $partWord = substr($word, strlen($_SERVER['DOCUMENT_ROOT']));\n if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') {\n $addSlash = '/';\n } else {\n $addSlash = '';\n }\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{DOCUMENT_ROOT}</em>'.$addSlash.$partWord;\n }\n } elseif (0 === strpos($word, $systemIncludePath)) {\n $partWord = substr($word, strlen($systemIncludePath));\n if (papaya_strings::strlen($partWord) > $width) {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.\n wordwrap($partWord, $width, $break, TRUE);\n } else {\n $result .= ' <em>{PAPAYA_INCLUDE_PATH}</em>'.$partWord;\n }\n } elseif (papaya_strings::strlen($word) > $width) {\n $result .= ' '.wordwrap($word, $width, $break, TRUE);\n } else {\n $result .= ' '.$word;\n }\n }\n return $match[1].substr($result, 1);\n } else {\n return $match[0];\n }\n }", "function wpwq_wrapper_add_type(){\r\n\tglobal $wpwq_wrapper_types;\r\n\t$wpwq_wrapper_types->add_type( array(\r\n\t\t'wpwq_wrapper' => array(\r\n\t\t\t'desc' => __('Following arguments will work with all wrappers.<br><br>\r\n\t\t\t\tExample: You want to strip all tags and shortcodes from the content and limit it to 55 characters? Paste this attribute in the [wrap_query] shortcode:<br>\r\n\t\t\t\twrapper_args=\\'{\"content_strip\":\"full\",\"content_limit\":\"55\"}\\'','wpwq'),\r\n\t\t\t'args' => array(\r\n\t\t\t\t'count_total' => array(\r\n\t\t\t\t\t'accepts' => 'int',\r\n\t\t\t\t\t'default' => '',\r\n\t\t\t\t\t'desc' => __('set by class','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content' => array(\r\n\t\t\t\t\t'accepts' => '\"none\"|\"excerpt\"|\"full\"',\r\n\t\t\t\t\t'default' => 'excerpt', \r\n\t\t\t\t\t'desc' => __('Whats the content?','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content_strip' => array(\r\n\t\t\t\t\t'accepts' => 'string|\"full\"',\r\n\t\t\t\t\t'default' => '\"shortcodes\"',\r\n\t\t\t\t\t'desc' => __('Accepts a string with comma seperated values: , \"none\", \"shortcodes\", \"style\", \"tags\".<br>\r\n\t\t\t\t\t\tOr a string with sinlge value \"full\" to strip all three.<br>\r\n\t\t\t\t\t\tNotice: Even when unstripped (\"none\"), the [wrap_query] shortcode will be stripped.','wpwq')\r\n\t\t\t\t\t),\r\n\t\t\t\t'content_limit' => array(\r\n\t\t\t\t\t'accepts' => 'false|int',\r\n\t\t\t\t\t'default' => 'false', \r\n\t\t\t\t\t'desc' => __('Number of characters in content. HTML tags will not be counted and the HTML Structure will be preserved.','wpwq')\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);\r\n}", "function minorite_aside($variables){\n return '<aside'.drupal_attributes($variables['elements']['#wrapper_attributes']).'>'.$variables['elements']['#children'].'</aside>';\n}", "function flawless_wrapper_class( $custom_class = '' ) {\r\n global $wp_query, $flawless;\r\n\r\n $classes = array( $custom_class );\r\n $classes[] = 'container';\r\n $classes[] = 'content_wrapper';\r\n $classes[] = 'row-fluid';\r\n\r\n //** Prevent classes from being blanked out */\r\n $maybe_classes = apply_filters( 'flawless::wrapper_class', $classes );\r\n\r\n if ( !empty( $maybe_classes ) ) {\r\n $classes = $maybe_classes;\r\n }\r\n\r\n //** Remove blanks */\r\n $classes = array_filter( ( array ) $classes );\r\n\r\n //** Remove duplicates */\r\n $classes = array_unique( ( array ) $classes );\r\n\r\n $flawless[ 'wrapper_class' ] = !empty( $classes ) ? $classes : array();\r\n\r\n echo implode( ' ', $classes );\r\n\r\n }", "public function initWrappers()\n {\n $act = Input::get('act');\n\n if ('' == $act || 'select' === $act) {\n $GLOBALS['TL_WRAPPERS'] = array(\n 'start' => array('group'),\n 'separator' => array(),\n 'stop' => array(),\n 'single' => array()\n );\n }\n }", "public function stdWrap_wrap($content = '', $conf = [])\n {\n return $this->wrap($content, $conf['wrap'], $conf['wrap.']['splitChar'] ? $conf['wrap.']['splitChar'] : '|');\n }", "public function stdWrap_stdWrapProcess($content = '', $conf = [])\n {\n foreach ($this->stdWrapHookObjects as $hookObject) {\n /** @var ContentObjectStdWrapHookInterface $hookObject */\n $content = $hookObject->stdWrapProcess($content, $conf, $this);\n }\n return $content;\n }", "function fanwood_layouts() {\n\n\tif ( current_theme_supports( 'theme-layouts' ) ) {\n\n\t\t$global_layout = hybrid_get_setting( 'fanwood_global_layout' );\n\t\t$bbpress_layout = hybrid_get_setting( 'fanwood_bbpress_layout' );\n\t\t$jigoshop_layout = hybrid_get_setting( 'fanwood_jigoshop_layout' );\n\t\t$layout = theme_layouts_get_layout();\n\n\t\tif ( !is_singular() && $global_layout !== 'layout_default' && function_exists( \"fanwood_{$global_layout}\" ) ) {\n\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $global_layout );\n\t\t}\n\t\t\n\t\tif ( is_singular() && $layout == 'layout-default' && $global_layout !== 'layout_default' && function_exists( \"fanwood_{$global_layout}\" ) ) {\n\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $global_layout );\n\t\t}\n\t\t\n\t\tif ( function_exists ( 'bbp_loaded' ) ) {\n\t\t\tif ( is_bbpress() && !is_singular() && $bbpress_layout !== 'layout_default' && function_exists( \"fanwood_{$bbpress_layout}\" ) ) {\n\t\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $bbpress_layout );\n\t\t\t}\n\t\t\telseif ( is_bbpress() && is_singular() && $layout == 'layout-default' && $bbpress_layout !== 'layout_default' && function_exists( \"fanwood_{$bbpress_layout}\" ) ) {\n\t\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $bbpress_layout );\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( function_exists ( 'is_jigoshop' ) ) {\n\t\t\tif ( is_jigoshop() && !is_singular() && $jigoshop_layout !== 'layout_default' && function_exists( \"fanwood_{$jigoshop_layout}\" ) ) {\n\t\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $jigoshop_layout );\n\t\t\t}\n\t\t\telseif ( is_jigoshop() && is_singular() && $layout == 'layout-default' && $jigoshop_layout !== 'layout_default' && function_exists( \"fanwood_{$jigoshop_layout}\" ) ) {\n\t\t\t\tadd_filter( 'get_theme_layout', 'fanwood_' . $jigoshop_layout );\n\t\t\t}\n\t\t}\n\n\t}\n\t\n}", "function master_sidebar_render_template_hierarchy_meta_box() {\n\n\t// Make sure user has the required access level\n\tif ( ! current_user_can( 'edit_theme_options' ) )\n\t\twp_die( -1 );\n\n\t// Create array to hold template hierachy items\n\t$template_items = array();\n\t$checklist_output = '';\n\t$db_id = -1111;\n\n\t// Add 404 page\n\t$template_items[] = array(\n\t\t'menu-item-db-id' => $db_id,\n\t\t'menu-item-title' => __( '404 - Page Not Found', 'theme-translate' ),\n\t\t'menu-item-object' => '404',\n\t\t'menu-item-parent-id' => $db_id,\n\t\t'menu-item-type' => 'template_hierarchy',\n\t\t'menu-item-url' => '#'\t\n\t);\n\t$db_id++;\n\n\t// Add author archive\n\t$template_items[] = array(\n\t\t'menu-item-db-id' => $db_id,\n\t\t'menu-item-title' => __( 'Author Archive', 'theme-translate' ),\n\t\t'menu-item-object' => 'author_archive_all',\n\t\t'menu-item-parent-id' => $db_id,\n\t\t'menu-item-type' => 'template_hierarchy',\n\t\t'menu-item-url' => '#'\n\t);\n\t$db_id++;\n\t\n\t// Add index page\n\t$template_items[] = array(\n\t\t'menu-item-db-id' => $db_id,\n\t\t'menu-item-title' => __( 'Blog Index Page', 'theme-translate' ),\n\t\t'menu-item-object' => 'index_page',\n\t\t'menu-item-parent-id' => $db_id,\n\t\t'menu-item-type' => 'template_hierarchy',\n\t\t'menu-item-url' => '#'\n\t);\n\t$db_id++;\n\n\t// Add date archive\n\t$template_items[] = array(\n\t\t'menu-item-db-id' => $db_id,\n\t\t'menu-item-title' => __( 'Date Archive', 'theme-translate' ),\n\t\t'menu-item-object' => 'date_archive',\n\t\t'menu-item-parent-id' => $db_id,\n\t\t'menu-item-type' => 'template_hierarchy',\n\t\t'menu-item-url' => '#'\n\t);\n\t$db_id++;\n\n\t// Add page templates \n\t$page_templates = wp_get_theme()->get_page_templates();\n\n\tforeach ( $page_templates as $template_name => $template_filename ) {\n\t\t//echo \"$template_name ($template_filename)<br />\";\n\t\t$template_items[] = array(\n\t\t\t'menu-item-db-id' => $db_id,\n\t\t\t'menu-item-title' => sprintf( __( 'Page Template: %s', 'theme-translate' ), $template_filename ),\n\t\t\t'menu-item-object' => 'page-template',\n\t\t\t'menu-item-parent-id' => $db_id,\n\t\t\t'menu-item-type' => 'template_hierarchy',\n\t\t\t'menu-item-url' => '#'\t\t\t\t\n\t\t);\n\t\t$db_id++;\n\t}\n\n\t// Add index page\n\t$template_items[] = array(\n\t\t'menu-item-db-id' => $db_id,\n\t\t'menu-item-title' => __( 'Search Results', 'theme-translate' ),\n\t\t'menu-item-object' => 'search_results',\n\t\t'menu-item-parent-id' => $db_id,\n\t\t'menu-item-type' => 'template_hierarchy',\n\t\t'menu-item-url' => '#'\n\t);\n\t$db_id++;\n\n\t?>\n\t<div id=\"master-page-hierachy\" class=\"posttypediv\">\n\t\t\n\t\t<!-- Tabs -->\n\t\t<ul id=\"template-hierarchy-tabs\" class=\"posttype-tabs add-menu-item-tabs\">\n\t\t\t<li class=\"tabs\"><a href=\"#tabs-panel-post_tag-all\" class=\"nav-tab-link\"><?php _e( 'View All', 'theme-translate' ); ?></a></li>\n\t\t</ul><!-- END #template-hierarchy-tabs -->\n\n\t\t<!-- Panels -->\n\t\t<div id=\"master-page-hierachy\" class=\"tabs-panel tabs-panel-view-all tabs-panel-active\">\n\t\t\t\n\t\t\t<ul class=\"categorychecklist form-no-clear\" data-wp-lists=\"list:testimonials\" id=\"testimonialschecklist\">\n\t\t\t\t<!-- All Post Type Checkbox -->\n\t\t\t\t<?php foreach ( $template_items as $template_item ) : ?>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<label class=\"menu-item-title\">\n\t\t\t\t\t\t\t<input type=\"checkbox\" value =\"1\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-object-id]\" class=\"menu-item-checkbox\"> <?php echo $template_item['menu-item-title']; ?>\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t<input class=\"menu-item-db-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-db-id]\">\n\t\t\t\t\t\t<input class=\"menu-item-object\" type=\"hidden\" value=\"<?php echo $template_item['menu-item-object']; ?>\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-object]\">\n\t\t\t\t\t\t<input class=\"menu-item-parent-id\" type=\"hidden\" value=\"0\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-parent-id]\">\n\t\t\t\t\t\t<input class=\"menu-item-type\" type=\"hidden\" value=\"<?php echo $template_item['menu-item-type']; ?>\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-type]\">\n\t\t\t\t\t\t<input class=\"menu-item-title\" type=\"hidden\" value=\"<?php echo $template_item['menu-item-title']; ?>\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-title]\">\n\t\t\t\t\t\t<input class=\"menu-item-url\" type=\"hidden\" value=\"<?php echo $template_item['menu-item-url']; ?>\" name=\"menu-item[<?php echo $template_item['menu-item-db-id']; ?>][menu-item-url]\">\n\t\t\t\t\t</li>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</ul>\n\t\t</div><!-- END .tabs-panel -->\n\n\t\t<p class=\"button-controls\">\n\t\t\t<span class=\"list-controls\">\n\t\t\t\t<a href=\"#\" class=\"select-all\"><?php _e( 'Select All', 'theme-translate' ); ?></a>\n\t\t\t</span>\n\n\t\t\t<span class=\"add-to-menu\">\n\t\t\t\t<input type=\"submit\" class=\"button-secondary submit-add-to-menu right\" value=\"<?php esc_attr_e('Add to Sidebar', 'theme-translate' ); ?>\" name=\"add-page-heirachy-item\" id=\"master-submit-page-hierachy\" />\n\t\t\t\t<span class=\"spinner\"></span>\n\t\t\t</span>\n\t\t</p>\n\n\t</div><!-- END #template-hierarchy -->\n\n\t<?php\n}", "protected function makeWrapper()\n {\n parent::makeWrapper();\n }", "function attemptWideLinkFix() {\n\t\t$ref = array();\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\t$lft = $asset->lft;\n\t\t\t$rgt = $asset->rgt;\n\t\t\tif ($rgt > $lft) {\n\t\t\t\tfor ($i=($lft+1); $i<=$rgt; $i++) {\n\t\t\t\t\t$ref[$i][] = $asset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\tif ((!isset($asset->parent_asset)) && ($asset->errors)) {\n\t\t\t\tif (isset($ref[$asset->lft])) {\n\t\t\t\t\t$widths = array();\n\t\t\t\t\tforeach ($ref[$asset->lft] as $tgt) {\n\t\t\t\t\t\t$wdt = $tgt->rgt - $tgt->lft;\n\t\t\t\t\t\t$widths[$wdt][] = $asset;\n\t\t\t\t\t}\n\t\t\t\t\tksort($widths);\n\t\t\t\t\t$sel = array_shift($widths);\n\t\t\t\t\t$sel = $sel[0]; // If width is same, just go by random\n\t\t\t\t\t$asset->parent_asset = $sel[0];\n\t\t\t\t\t$asset->parent_asset->addChild($asset);\n\t\t\t\t\t$asset->fixes[] = 'Parent assigned by attemptWideLinkFix';\n\t\t\t\t\t$this->removeRoot($asset->id);\n\t\t\t\t\t$this->fixed[] = $asset;\n\t\t\t\t} else {\n//\t\t\t\t\tprint 'No ref for '.$asset->lft.\"\\n\"; if (@$ccc++ > 5) die();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\n\t}", "public function useWrapperClassesInHeading()\n {\n return $this->withMeta(['useWrapperClassesInHeading' => true]);\n }", "function be_dps_template_part( $output, $original_atts ) {\n\t// Return early if our \"layout\" attribute is not specified\n\tif( empty( $original_atts['layout'] ) )\n\t\treturn $output;\n\tob_start();\n\tget_template_part( 'partials/dps', $original_atts['layout'] );\n\t$new_output = ob_get_clean();\n\tif( !empty( $new_output ) )\n\t\t$output = $new_output;\n\treturn $output;\n}", "private function get_filterItemValueStdWrap( $conf_name, $conf_array, $uid, $value )\n {\n static $firstLoop = true;\n\n // Get the stdWrap for the value\n // SWITCH first item\n switch ( true )\n {\n case( $uid == $conf_array[ 'first_item.' ][ 'option_value' ] ):\n $stdWrap = $conf_array[ 'first_item.' ][ 'value_stdWrap.' ];\n break;\n default:\n $stdWrap = $conf_array[ 'wrap.' ][ 'item.' ][ 'wraps.' ][ 'value.' ][ 'stdWrap.' ];\n break;\n }\n // SWITCH first item\n // Get the stdWrap for the value\n // stdWrap the current value\n $item = $this->pObj->local_cObj->stdWrap( $value, $stdWrap );\n\n // Prepend or append hits\n $item = $this->set_hits( $uid, $item, $this->rows[ $uid ] );\n\n // stdWrap the current item\n $stdWrap = $conf_array[ 'wrap.' ][ 'item.' ][ 'wraps.' ][ 'item.' ][ 'stdWrap.' ];\n $item = $this->pObj->local_cObj->stdWrap( $item, $stdWrap );\n // stdWrap the current item\n // DRS :TODO:\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'Check maxItemsPerRow!';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n\n $item = $this->get_maxItemsTagEndBegin( $item );\n\n // Item class\n // #41753.01, 121010, dwildt, 4-\n// if($conf_name == 'CATEGORY_MENU')\n// {\n// $conf_array = $this->pObj->objJss->class_onchange($conf_name, $conf_array, $this->row_number);\n// }\n // #41753.01, 121010, dwildt, 10+\n switch ( true )\n {\n case( $conf_name == 'CATEGORY_MENU' ):\n case( $conf_name == 'TREEVIEW' ):\n $conf_array = $this->pObj->objJss->class_onchange( $conf_name, $conf_array, $this->row_number );\n break;\n default:\n // Follow the workflow\n break;\n }\n\n // DRS :TODO:\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'Check AJAX ###ONCHANGE###';\n t3lib_div::devlog( '[INFO/TODO] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS :TODO:\n $item = $this->replace_itemClass( $conf_array, $item );\n // Item class\n // Item style\n $item = $this->replace_itemStyle( $conf_array, $item );\n // Item title\n $item = $this->replace_itemTitle( $item );\n // Item uid\n $item = $this->replace_itemUid( $uid, $item );\n // Item URL\n $item = $this->replace_itemUrl( $conf_array, $uid, $item );\n // Item selected\n $item = $this->replace_itemSelected( $conf_array, $uid, $value, $item );\n\n // Workaround: remove ###ONCHANGE###\n $item = str_replace( ' class=\" ###ONCHANGE###\"', null, $item );\n if ( $firstLoop && $this->pObj->b_drs_devTodo )\n {\n $prompt = 'class=\" ###ONCHANGE###\" is removed. Check the code!';\n t3lib_div::devlog( '[WARN/TODO] ' . $prompt, $this->pObj->extKey, 2 );\n }\n // Workaround: remove ###ONCHANGE###\n\n $firstLoop = false;\n\n return $item;\n }", "function lightseek_template_wrapper_start(){\n ?>\n <div id=\"primary\" class=\"content-area\">\n <main id=\"main\" class=\"site-main\" role=\"main\">\n <div class=\"container\">\n <?php\n}", "protected function setUpFilesystem() {\n $module_a_provided_layout = <<<'EOS'\nmodule_a_provided_layout:\n label: 1 column layout\n category: 'Columns: 1'\n description: 'A module provided layout'\n theme_hook: onecol\n path: layouts\n library: module_a/onecol\n regions:\n top:\n label: Top region\n bottom:\n label: Bottom region\nmodule_a_derived_layout:\n deriver: \\Drupal\\Tests\\Core\\Layout\\LayoutDeriver\n invalid_provider: true\nEOS;\n $theme_a_provided_layout = <<<'EOS'\ntheme_a_provided_layout:\n class: '\\Drupal\\Core\\Layout\\LayoutDefault'\n label: 2 column layout\n category: 'Columns: 2'\n description: 'A theme provided layout'\n template: twocol\n path: templates\n library: theme_a/twocol\n default_region: right\n regions:\n left:\n label: Left region\n right:\n label: Right region\nEOS;\n $plugin_provided_layout = <<<'EOS'\n<?php\nnamespace Drupal\\Core\\Plugin\\Layout;\nuse Drupal\\Core\\Layout\\LayoutDefault;\n/**\n * @Layout(\n * id = \"plugin_provided_layout\",\n * label = @Translation(\"Layout plugin\"),\n * category = @Translation(\"Columns: 1\"),\n * description = @Translation(\"Test layout\"),\n * path = \"core/lib/Drupal/Core\",\n * template = \"templates/plugin-provided-layout\",\n * regions = {\n * \"main\" = {\n * \"label\" = @Translation(\"Main Region\", context = \"layout_region\")\n * }\n * }\n * )\n */\nclass TestLayout extends LayoutDefault {}\nEOS;\n vfsStream::setup('root');\n vfsStream::create([\n 'modules' => [\n 'module_a' => [\n 'module_a.layouts.yml' => $module_a_provided_layout,\n ],\n ],\n ]);\n vfsStream::create([\n 'themes' => [\n 'theme_a' => [\n 'theme_a.layouts.yml' => $theme_a_provided_layout,\n ],\n ],\n ]);\n vfsStream::create([\n 'core' => [\n 'lib' => [\n 'Drupal' => [\n 'Core' => [\n 'Plugin' => [\n 'Layout' => [\n 'TestLayout.php' => $plugin_provided_layout,\n ],\n ],\n ],\n ],\n ],\n ],\n ]);\n }", "public function add_two_step_second_step_wrapper() {\n\t\t\techo \"<div class='ast-two-step-wrap'> \";\n\t\t}", "function wrapper ($template, $out) {\n\tglobal $CFG,$STD;\n\t\n\t$output = $template->html_head();\n\t$output .= $template->site_header( $CFG['root_url'].'/index.php' );\n\t\n\t$output .= $template->site_menu( $STD->global_template_ui->modq_menu() );\n\t$output .= $template->content_header();\n\t\n\t$output .= $out;\n\t\n\t$output .= $template->content_footer();\n\t$output .= $template->site_footer();\n\t\n\treturn $output;\n}", "protected function renderFluidView() {}", "public function stdWrap_required($content = '')\n {\n if ((string)$content === '') {\n $content = '';\n $this->stopRendering[$this->stdWrapRecursionLevel] = true;\n }\n return $content;\n }", "function wsunews_sides() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Cover Sidebar',\n\t\t'id' => 'side-cover',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header>',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Local Sidebar',\n\t\t'id' => 'side-local',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Events Sidebar',\n\t\t'id' => 'side-events',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '<header>',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Athletics Sidebar',\n\t\t'id' => 'side-athletics',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Athletics Section',\n\t\t'id' => 'section-athletics',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'People Sidebar',\n\t\t'id' => 'side-people',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\n}", "protected function renderElseChild() {}", "function ft_hook_sidebar() {}", "private function wrap($html){\n return ($this->ie->is_active()) ? $this->ie->wrap($html) : $html;\n }" ]
[ "0.53453046", "0.5327959", "0.4954219", "0.4802933", "0.47377047", "0.47180414", "0.4620347", "0.45653084", "0.45494395", "0.44770092", "0.4452417", "0.44387215", "0.4431035", "0.4424365", "0.44198826", "0.4382289", "0.4362068", "0.43347326", "0.43270668", "0.4326199", "0.4318346", "0.43129298", "0.43112013", "0.43092567", "0.428265", "0.42690194", "0.42624778", "0.42559177", "0.42544943", "0.42282048" ]
0.57048225
0
Parse paramter code by type and value and convert value by type
protected function parseType ( $paramCode ) { // Paramater ([type|null], value) $param = array (); // Split by Space (never split between quotes) preg_match_all ( '/("|\')(?:\\\\.|[^\\\\"\'])*\1|\S+/', $paramCode, $param ); // Get the first group (Type, Value) $param = $param[0]; // if nothing, return null if ( !count($param) ) return null; // If given Type, Value, ***, throw error if ( count ( $param ) > 2 ) { // Error: Invalid parameter. return new TakteeErrorInternal ( 58 ); } // if type and value found. $lpparam = count ( $param ) == 2 // Set value, type ? new TakteeParameterTypes ( $param[1], $param[0] ) // Set value : new TakteeParameterTypes ( $param[0] ); // Return param value with type return $lpparam->toValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _toType($value) {\n\tif (preg_match('/^(\"(.*)\"|\\'(.*)\\')/',$value,$matches)) {\n\t$value = (string)preg_replace('/(\\'\\'|\\\\\\\\\\')/',\"'\",end($matches));\n\t$value = preg_replace('/\\\\\\\\\"/','\"',$value);\n\t} elseif (preg_match('/^\\\\[(.+)\\\\]$/',$value,$matches)) {\n\t\t// Inline Sequence\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$value = array();\n\t\tforeach ($explode as $v) {\n\t\t$value[] = $this->_toType($v);\n\t\t}\n\t} elseif (strpos($value,': ')!==false && !preg_match('/^{(.+)/',$value)) {\n\t\t// It's a map\n\t\t$array = explode(': ',$value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ',$array));\n\t\t$value = $this->_toType($value);\n\t\t$value = array($key => $value);\n\t} elseif (preg_match(\"/{(.+)}$/\",$value,$matches)) {\n\t\t// Inline Mapping\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$array = array();\n\t\tforeach ($explode as $v) {\n\t\t$array = $array + $this->_toType($v);\n\t\t}\n\t\t$value = $array;\n\t} elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {\n\t\t$value = NULL;\n\t} elseif (preg_match ('/^[0-9]+$/', $value)) {\n\t// Cheeky change for compartibility with PHP < 4.2.0\n\t\t$value = (int)$value;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('true', 'on', '+', 'yes', 'y'))) {\n\t\t$value = true;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('false', 'off', '-', 'no', 'n'))) {\n\t\t$value = false;\n\t} elseif (is_numeric($value)) {\n\t\t$value = (float)$value;\n\t} else {\n\t\t// Just a normal string, right?\n\t\t$value = trim(preg_replace('/#(.+)$/','',$value));\n\t}\n\n\treturn $value;\n\t}", "function parseValue($value);", "abstract public function parse($value);", "abstract public static function parse($value);", "public function parseValue();", "private static function doConvertType($value, $type) {\n switch ($type) {\n case 'def' :\n $newValue = self::convertTextContent($value);\n break;\n case 'int' :\n $newValue = (int) $value;\n break;\n case 'array':\n return $value;\n break;\n case 'double' :\n $value = str_replace('.', '', $value);\n $value = str_replace(',', '.', $value);\n $newValue = doubleval($value);\n break;\n case 'currency_format' :\n $newValue = self::currency_format($value);\n break;\n default :\n if (get_magic_quotes_gpc() == 0) {\n $value = addslashes($value);\n }\n $newValue = htmlspecialchars($value);\n break;\n }\n return $newValue;\n }", "protected function mapType(Param $param) {\n switch($param->type) {\n case 'gboolean':\n $param->zppSpec = 'b';\n $param->zppType = 'zend_bool';\n $param->ztype = 'bool';\n return;\n case 'guint':\n case 'guint64': // NOTE: may need to do this as a string!\n case 'glong':\n case 'gsize':\n case 'guint8':\n case 'gssize':\n case 'gint64':\n case 'guint32':\n case 'gdouble':\n case 'gulong':\n case 'gint32':\n case 'gint':\n $param->zppSpec = 'l';\n $param->zppType = 'long';\n $param->ztype = 'int';\n return;\n case 'utf8':\n case 'gchar':\n $param->zppSpec = 's';\n $param->zppType = ['char *', 'int'];\n return;\n case 'gpointer':\n echo \"have no idea what to do with gpointer omg\\n\";\n return;\n case 'DestroyNotify':\n case 'CompareFunc':\n case 'CompareDataFunc':\n case 'HRFunc':\n case 'HFunc':\n case 'HashFunc':\n case 'EqualFunc':\n case 'HookFindFunc':\n case 'HookCompareFunc':\n case 'HookMarshaller':\n case 'HookCheckMarshaller':\n case 'Func':\n case 'SourceFuncs':\n case 'SourceFunc':\n case 'PollFunc':\n case 'NodeForeachFunc':\n case 'CopyFunc':\n case 'NodeTraverseFunc':\n case 'ThreadFunc':\n case 'TranslateFunc':\n case 'OptionErrorFunc':\n case 'OptionParseFunc':\n case 'RegexEvalCallback':\n case 'SequenceIterCompareFunc':\n case 'SourceCallbackFuncs':\n case 'TraverseFunc':\n case 'Variant':\n echo \"I believe this is a callback - that'll be fun\\n\";\n return;\n case 'TimeVal':\n case 'Bytes':\n case 'ChecksumType':\n case 'Mutex':\n case 'Date':\n case 'DateDay':\n case 'DateMonth':\n case 'DateYear':\n case 'Time':\n case 'DateWeekday':\n case 'TimeSpan':\n case 'DateTime':\n case 'TimeZone':\n case 'Quark':\n case 'GLib.HashTable':\n case 'Hook':\n case 'HookList':\n case 'String':\n case 'GLib.List':\n case 'MarkupParser':\n case 'Node':\n case 'OptionGroup':\n case 'OptionEntry':\n case 'PatternSpec':\n case 'MatchInfo':\n case 'GLib.SList':\n case 'ScannerConfig':\n case 'SequenceIter':\n case 'Source':\n case 'MainContext':\n case 'TestCase':\n case 'TestSuite':\n case 'TrashStack':\n echo \"and I think this is an object\\n\";\n return;\n case 'filename':\n echo \"no clue at all what THIS is\\n\";\n return;\n case 'gunichar':\n echo \"hmm, this one is weird\\n\";\n return;\n case 'SeekType':\n case 'IOFlags':\n case 'KeyFileFlags':\n case 'PollFD':\n case 'Cond':\n case 'MarkupParseFlags':\n case 'TraverseFlags':\n case 'TraverseType':\n case 'RegexMatchFlags':\n case 'RegexCompileFlags':\n case 'TokenType':\n case 'TimeType':\n case 'VariantType':\n echo \"this might be an enum!\\n\";\n return;\n case 'va_list':\n echo \"this one is going to be fun *\\n\";\n return;\n default:\n throw new UnknownTypeException($param->type . $param->identifer);\n }\n }", "public function parse($value,$type)\n\t{\n\t\t$method='parse'.$type;\n\t\tif(method_exists($this,$method))\n\t\t\treturn $this->$method($value);\n\t\telse\n\t\t\tthrow new CException(Yii::t('yii','Unknown type \"{type}\".',array('{type}'=>$type)));\n\t}", "function checkType($instruction)\n{ // INSTRUKCE S JEDNIM ARGUMENTEM\n if (count($instruction) == 2)\n {\n // kontrola int\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola bool\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola string\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola type\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n // kontrola var\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n // kontrola nil\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n paramsValidateOne($instruction, $first_arg);\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n // ostatni ...@neco filtrovat jako chybu\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n // kontrola label\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n paramsValidateOne($instruction, $first_arg);\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n\n else if (count($instruction) == 3)\n { // INSTRUKCE S DVEMA ARGUMENTY\n //////////////////////////////////// prvni argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// druhy argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[2])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[2]))))\n {\n $sec_arg = \"int\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = ltrim(($instruction[2]),\"int@\");\n echo \" <arg2 type=\\\"int\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^bool@true$/', ($instruction[2])))\n {\n $sec_arg = \"bool_t\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"bool\\\">true</arg2>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[2])))\n {\n $sec_arg = \"bool_f\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"bool\\\">false</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = substr(($instruction[2]),7);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[2])))\n {\n $sec_arg = \"type\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"type\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[2]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[2])))\n {\n $sec_arg = \"var\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"var\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[2])))\n {\n $sec_arg = \"nil\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n $instruction[2] = substr(($instruction[2]),4);\n echo \" <arg2 type=\\\"nil\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[2])))\n {\n $sec_arg = \"label\";\n paramsValidateTwo($instruction, $first_arg, $sec_arg);\n echo \" <arg2 type=\\\"label\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n\n }\n\n else if (count($instruction) == 4)\n { // INSTRUKCE S TREMI ARGUMENTY\n //////////////////////////////////// prvni argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[1])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[1]))))\n {\n $first_arg = \"int\";\n $instruction[1] = ltrim(($instruction[1]),\"int@\");\n echo \" <arg1 type=\\\"int\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^bool@true$/', ($instruction[1])))\n {\n $first_arg = \"bool_t\";\n echo \" <arg1 type=\\\"bool\\\">true</arg1>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[1])))\n {\n $first_arg = \"bool_f\";\n echo \" <arg1 type=\\\"bool\\\">false</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[1])))\n {\n $first_arg = \"string\";\n $instruction[1] = substr(($instruction[1]),7);\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[1])))\n {\n $first_arg = \"string\";\n echo \" <arg1 type=\\\"string\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[1])))\n {\n $first_arg = \"type\";\n echo \" <arg1 type=\\\"type\\\">{$instruction[1]}</arg1>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[1]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[1])))\n {\n $first_arg = \"var\";\n $instruction[1] = preg_replace('/&/', \"&amp;\", $instruction[1]);\n $instruction[1] = preg_replace('/</', \"&lt;\", $instruction[1]);\n $instruction[1] = preg_replace('/>/', \"&gt;\", $instruction[1]);\n echo \" <arg1 type=\\\"var\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[1])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[1])))\n {\n $first_arg = \"nil\";\n $instruction[1] = substr(($instruction[1]),4);\n echo \" <arg1 type=\\\"nil\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[1])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[1])))\n {\n $first_arg = \"label\";\n echo \" <arg1 type=\\\"label\\\">{$instruction[1]}</arg1>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// druhy argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[2])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[2]))))\n {\n $sec_arg = \"int\";\n $instruction[2] = ltrim(($instruction[2]),\"int@\");\n echo \" <arg2 type=\\\"int\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^bool@true$/', ($instruction[2])))\n {\n $sec_arg = \"bool_t\";\n echo \" <arg2 type=\\\"bool\\\">true</arg2>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[2])))\n {\n $sec_arg = \"bool_f\";\n echo \" <arg2 type=\\\"bool\\\">false</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n $instruction[2] = substr(($instruction[2]),7);\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[2])))\n {\n $sec_arg = \"string\";\n echo \" <arg2 type=\\\"string\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[2])))\n {\n $sec_arg = \"type\";\n echo \" <arg2 type=\\\"type\\\">{$instruction[2]}</arg2>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[2]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[2])))\n {\n $sec_arg = \"var\";\n $instruction[2] = preg_replace('/&/', \"&amp;\", $instruction[2]);\n $instruction[2] = preg_replace('/</', \"&lt;\", $instruction[2]);\n $instruction[2] = preg_replace('/>/', \"&gt;\", $instruction[2]);\n echo \" <arg2 type=\\\"var\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[2])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[2])))\n {\n $sec_arg = \"nil\";\n $instruction[2] = substr(($instruction[2]),4);\n echo \" <arg2 type=\\\"nil\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[2])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[2])))\n {\n $sec_arg = \"label\";\n echo \" <arg2 type=\\\"label\\\">{$instruction[2]}</arg2>\\n\";\n }\n else\n {\n Err();\n }\n //////////////////////////////////// treti argument instrukce /////////////////////////////////////////////////////\n if (preg_match('/^int@.*$/', strtolower($instruction[3])))\n {\n if ((preg_match('/^int@[-+]?\\d+$/', ($instruction[3]))))\n {\n $th_arg = \"int\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = ltrim(($instruction[3]),\"int@\");\n echo \" <arg3 type=\\\"int\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^bool@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^bool@true$/', ($instruction[3])))\n {\n $th_arg = \"bool_t\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"bool\\\">true</arg3>\\n\";\n }\n else if (preg_match('/^bool@false$/', ($instruction[3])))\n {\n $th_arg = \"bool_f\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"bool\\\">false</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^string@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^^string@(([a-zA-Z\\x{0021}\\x{0022}\\x{0024}-\\x{005B}\\x{005D}-\\x{FFFF}])|(\\\\\\\\[0-9][0-9][0-9]))*$/', ($instruction[3])))\n {\n $th_arg = \"string\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = substr(($instruction[3]),7);\n $instruction[3] = preg_replace('/&/', \"&amp;\", $instruction[3]);\n $instruction[3] = preg_replace('/</', \"&lt;\", $instruction[3]);\n $instruction[3] = preg_replace('/>/', \"&gt;\", $instruction[3]);\n echo \" <arg3 type=\\\"string\\\">{$instruction[3]}</arg3>\\n\";\n }\n else if (preg_match('/^string@[^\\u0000-\\u007F]+/', ($instruction[3])))\n {\n $th_arg = \"string\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"string\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^(int|bool|string)$/', ($instruction[3])))\n {\n $th_arg = \"type\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"type\\\">{$instruction[3]}</arg3>\\n\";\n }\n else if ((preg_match('/^(GF|LF|TF)@.*$/', strtoupper($instruction[3]))))\n {\n if (preg_match('/^(GF|LF|TF)@([[:alpha:]]|(_|-|\\$|&|\\?|!|%|\\*))([[:alnum:]]|(_|-|\\$|&|\\?|!|%|\\*))*/', ($instruction[3])))\n {\n $th_arg = \"var\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = preg_replace('/&/', \"&amp;\", $instruction[3]);\n $instruction[3] = preg_replace('/</', \"&lt;\", $instruction[3]);\n $instruction[3] = preg_replace('/>/', \"&gt;\", $instruction[3]);\n echo \" <arg3 type=\\\"var\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil@.*$/', strtolower($instruction[3])))\n {\n if (preg_match('/^nil@nil$/', ($instruction[3])))\n {\n $th_arg = \"nil\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n $instruction[3] = substr(($instruction[3]),4);\n echo \" <arg3 type=\\\"nil\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n }\n else if (preg_match('/^nil$/', strtolower($instruction[3])))\n {\n Err();\n }\n else if (preg_match('/[[:alnum:]]@.*$/', ($instruction[3])))\n {\n Err();\n }\n else if (preg_match('/^([[:alpha:]]|(_|-|\\$|&|%|\\*))((_|-|\\$|&|%|\\*)|[[:alnum:]])*/', ($instruction[3])))\n {\n $th_arg = \"label\";\n paramsValidateThree($instruction, $first_arg, $sec_arg, $th_arg);\n echo \" <arg3 type=\\\"label\\\">{$instruction[3]}</arg3>\\n\";\n }\n else\n {\n Err();\n }\n\n }\n\n}", "abstract public function convertFromRawValue($value);", "protected function parseValue($value)\n {\n $catchFn = explode('::', $value);\n if (isset($catchFn[1])) {\n $fn = $catchFn[1];\n\n switch ($fn)\n {\n case 'hash': $value = $this->app->call('security')->encrypt($catchFn[0]); \n break;\n case 'int': $value = (int) $catchFn[0];\n break;\n }\n }\n return $value;\n }", "#[Pure]\n public static function convertParameterType(string $type, mixed $value): string|int|bool|null\n {\n return match ($type) {\n 'string' => (string)$value,\n 'int' => (int)$value,\n 'bool' => $value === true || $value === '1' || $value === 'true',\n default => null\n };\n }", "private function _toType($value) {\n\t//--\n\tif($value === '') {\n\t\treturn null;\n\t} //end if\n\t//--\n\t$first_character = $value[0];\n\t$last_character = substr($value, -1, 1);\n\t//--\n\t$is_quoted = false;\n\tdo {\n\t\tif(!$value) {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($first_character != '\"' && $first_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($last_character != '\"' && $last_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$is_quoted = true;\n\t} while (0);\n\t//--\n\tif($is_quoted) {\n\t\treturn strtr(substr($value, 1, -1), array ('\\\\\"' => '\"', '\\'\\'' => '\\'', '\\\\\\'' => '\\''));\n\t} //end if\n\t//--\n\tif(strpos($value, ' #') !== false && !$is_quoted) {\n\t\t$value = preg_replace('/\\s+#(.+)$/','',$value);\n\t} //end if\n\t//--\n\tif(!$is_quoted) {\n\t\t$value = str_replace('\\n', \"\\n\", $value);\n\t} //end if\n\t//--\n\tif($first_character == '[' && $last_character == ']') {\n\t\t// Take out strings sequences and mappings\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$value = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$value[] = $this->_toType($v);\n\t\t} //end foreach\n\t\treturn $value;\n\t} //end if\n\t//--\n\tif(strpos($value, ': ') !== false && $first_character != '{') {\n\t\t$array = explode(': ', $value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ', $array));\n\t\t$value = $this->_toType($value);\n\t\treturn array($key => $value);\n\t} //end if\n\t//--\n\tif($first_character == '{' && $last_character == '}') {\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t// Inline Mapping\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$array = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$SubArr = $this->_toType($v);\n\t\t\tif(empty($SubArr)) {\n\t\t\t\tcontinue;\n\t\t\t} //end if\n\t\t\tif(is_array ($SubArr)) {\n\t\t\t\t$array[key($SubArr)] = $SubArr[key($SubArr)]; continue;\n\t\t\t} //end if\n\t\t\t$array[] = $SubArr;\n\t\t} //end foreach\n\t\treturn $array;\n\t} //end if\n\t//--\n\tif((string)$value == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(strtolower($value) == 'null' || $value == '~') {\n\t\treturn null;\n\t} //end if\n\t//--\n\tif(is_numeric($value) && preg_match('/^(-|)[1-9]+[0-9]*$/', $value)){\n\t\t$intvalue = (int)$value;\n\t\tif($intvalue != PHP_INT_MAX) {\n\t\t\t$value = $intvalue;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\t/* this was added in v.0.5.1 but is unsafe !!\n\tif(is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {\n\t\t// Hexadecimal value.\n\t\treturn hexdec($value);\n\t} //end if\n\t*/\n\t//--\n\tif(in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y'))) {\n\t\treturn true;\n\t} //end if\n\t//--\n\tif(in_array(strtolower($value), array('false', 'off', '-', 'no', 'n'))) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(is_numeric($value)) {\n\t\tif((string)$value == '0') {\n\t\t\treturn 0;\n\t\t} //end if\n\t\tif(rtrim($value, 0) === $value) {\n\t\t\t$value = (float)$value;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\treturn $value;\n\t//-- $k\n}", "function convertTo ($type, $value) {\n assert(count(func_get_args()) == 2);\n if ($type == 'bool')\n return toBool($value);\n if ($type == 'float')\n return toFloat($value);\n if ($type == 'int')\n return toInt($value);\n if ($type == 'string')\n return toString($value);\n if (is_a($value, $type))\n return $value;\n throw new RuntimeException('Unable to convert to *' . $type . '*.');\n}", "private function _convertType(&$value='', $type='string')\n {\n switch($type){\n case 'string':\n default:\n $this->toString($value);\n break;\n case 'datetime':\n $this->toDateTime($value);\n break;\n case 'int':\n case 'integer':\n $this->toInteger($value);\n break;\n }\n }", "function smarty_function_get_type_value($params, $smarty) {\n\n if (is_bool($params['value'])) {\n $smarty->assign($params['assign'], 'bool');\n return;\n }\n if (is_float($params['value'])) {\n $smarty->assign($params['assign'], 'float');\n return ;\n }\n if (is_int($params['value'])) {\n $smarty->assign($params['assign'], 'int');\n return ;\n }\n if (is_string($params['value'])) {\n $smarty->assign($params['assign'], 'string');\n return ;\n }\n\n}", "public function process_value( $type, $value ) {\n\n\t\tswitch ( $type ) {\n\t\t\tdefault:\n\t\t\t\treturn $value;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn $value;\n\n\t}", "abstract public function parse($data, $type);", "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 parse(string $value);", "function test_value($text, $type){\n global $varregex, $labelregex, $intregex, $stringregex, $boolregex, $typeregex;\n if($type == 'var'){\n if(preg_match($varregex, $text)) {\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu var.\\n\", 21));\n }\n elseif ($type == 'label') {\n if(preg_match($labelregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu label.\\n\", 21));\n }\n elseif ($type == 'int') {\n if(preg_match($intregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu int.\\n\", 21));\n }\n elseif ($type == 'string') {\n if(preg_match($stringregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu string.\\n\", 21));\n }\n elseif ($type == 'bool') {\n if(preg_match($boolregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu bool.\\n\", 21));\n }\n elseif ($type == 'type') {\n if(preg_match($typeregex, $text)){\n return $text;\n }\n else exit(calls::call_error(\"Error: Chybný tvar argumentu typu type.\\n\", 21));\n }\n }", "private static function valueFromType($value, $type)\n {\n if ($value === null)\n {\n return null;\n }\n \n switch ($type)\n {\n case 'bool':\n case 'boolean':\n return (bool) $value;\n \n case 'int':\n case 'integer':\n return (int) $value;\n \n case 'lob':\n return stream_get_contents($value);\n \n case 'base64':\n return base64_decode($value);\n \n case 'date':\n case 'time':\n case 'timestamp':\n return strtotime($value);\n \n case 'string':\n case 'istring':\n default:\n return (string) $value;\n }\n }", "protected function parseParameter() {\n $reader = $this->reader; // alias in local\n\n $param = new Param;\n $param->name = $reader->getAttribute('name');\n $param->transfer = $reader->getAttribute('transfer-ownership');\n // get rid of \"floating\" transfer\n if($param->transfer == 'floating') {\n $param->transfer == 'none';\n }\n if($dir = $reader->getAttribute('direction')) {\n $param->direction = $dir;\n }\n\n do {\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'array') {\n $param->container = $reader->getAttribute('c:type');\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'type') {\n $param->nativeType = $reader->getAttribute('c:type');\n $param->type = $reader->getAttribute('name');\n $this->mapType($param);\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $param->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'parameter') {\n break;\n }\n } while($reader->read());\n\n return $param;\n }", "function parseParameterValues($source) {\n\t$parameterValues = array();\n\t$parameter = preg_split(\"/<br>/\", $source); // get array from the source string\n\t\n\tfor ($i = 0; $i < count($parameter); $i++) {\n\t\t$parameter[$i] = preg_replace(\"/(<p)+[^<]+/\", \"\", $parameter[$i]); // rip off <p> tag\n\t\t$parameter[$i] = preg_replace(\"/<\\/p>/\", \"\", $parameter[$i]); // rip of </p> tag\n\t\t$list = preg_split(\"/=/\", $parameter[$i]);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\" && $paramName != \"delay\" && $paramName != null) {\n\t\t\tarray_push($parameterValues, $paramVal); // push to the parameter value array;\n\t\t}\n\t}\n\t\n\tif (count($parameterValues) > 0) {\n\t\t$result = \"<param name=\\\"information\\\">\". join($parameterValues, \"^\") . \"</param>\"; // create parameter value string\n\t}\n\t\n\t/*\n\tforeach ($parameter as $item) {\n\t\techo $item;exit;\n\t\t\n\t\t\n\t\t$list = preg_split(\"/=/\", $item);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif (sizeof($parameter) > 0) {\n\t\t\t$result = $result;\n\t\t}\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\") { // filter out non-parameter name\n\t\t\t\n\t\t}\n\t}*/\n\treturn $result;\n}", "private static function parseValue($val)\n {\n $parsedVal = null;\n\n // Cleanup\n $val = trim($val);\n\n if($val === '')\n {\n throw new Exception('Empty value not allowed');\n }\n\n // Boolean\n if($val == 'true' || $val == 'false')\n {\n $parsedVal = ($val == 'true');\n }\n // Literal multi-line string\n elseif(substr($val, 0, 3) == \"'''\" && substr($val, -3) == \"'''\")\n {\n $parsedVal = substr($val, 3, -3);\n\n // Trim first newline on multi-line string definition\n if($parsedVal[0] == \"\\n\")\n {\n $parsedVal = substr($parsedVal, 1);\n }\n }\n // Literal string\n elseif($val[0] == \"'\" && substr($val, -1) == \"'\")\n {\n // No newlines allowed\n if(strpos($val, \"\\n\") !== false)\n {\n throw new Exception('New lines not allowed on single line string literals.');\n }\n\n $parsedVal = substr($val, 1, -1);\n }\n // Multi-line string\n elseif(substr($val, 0, 3) == '\"\"\"' && substr($val, -3) == '\"\"\"')\n {\n $parsedVal = substr($val, 3, -3);\n\n // Trim first newline on multi-line string definition\n if($parsedVal[0] == \"\\n\")\n {\n $parsedVal = substr($parsedVal, 1);\n }\n\n // Use json_decode to finally parse the string.\n $parsedVal = json_decode('\"' . str_replace(\"\\n\", '\\n', $parsedVal) . '\"');\n }\n // String\n elseif($val[0] == '\"' && substr($val, -1) == '\"')\n {\n // TOML's specification says it's the same as for JSON format... so\n $parsedVal = json_decode($val);\n }\n // Numbers\n elseif(is_numeric(str_replace('_', '', $val)))\n {\n $val = str_replace('_', '', $val);\n\n $intVal = filter_var($val, FILTER_VALIDATE_INT);\n if($intVal !== false)\n {\n $parsedVal = $intVal;\n }\n else\n {\n $parsedVal = (float) $val;\n }\n }\n // Datetime. Parsed to UNIX time value.\n elseif(self::isISODate($val))\n {\n $parsedVal = new DateTime($val);\n }\n // Single line array (normalized)\n elseif($val[0] == '[' && substr($val, -1) == ']')\n {\n $parsedVal = self::parseArray($val);\n }\n // Inline table (normalized)\n elseif($val[0] == '{' && substr($val, -1) == '}')\n {\n $parsedVal = self::parseInlineTable($val);\n }\n else\n {\n throw new Exception('Unknown value type: ' . $val);\n }\n\n return $parsedVal;\n }", "private function castValue($type, $value)\n {\n switch ($type) {\n case 'number':\n $value = (int) $value;\n break;\n case 'boolean':\n $value = boolval($value);\n break;\n case 'map':\n case 'object':\n $value = json_decode($value);\n break;\n default:\n break;\n }\n\n return $value;\n }", "function parseMethodArg($data) {\n\t\tpreg_match('/(.*?)\\s*([^\\s\\*\\&]*)(\\s)*$/', $data, $data);\n\t\t$argType = NULL;\n\t\t$argName = NULL;\n\n\t\tif (in_array($data[2],$this->dataTypes)) {\n\t\t\t$argType = $data[0]; // Jen typ\n\t\t} else {\n\t\t\tif ((strpos($data[0], \"*\") || strpos($data[0], \"&\"))) {\n\t\t\t\tif (empty($data[2])) {\n\t\t\t\t\t$argType = $data[1]; // Typ + reference/dereference\n\n\t\t\t\t} else {\n\t\t\t\t\t$argType = $data[1];\n\t\t\t\t\t$argName = $data[2]; // Typ + promenna + */&\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!empty($data[0])) {\n\t\t\t\t$argType = $data[1]; // Typ + promenna\n\t\t\t\t$argName = $data[2];\n\t\t\t}\n\t\t}\n\n\t\t$argType = str_replace(\"*\", \" *\", $argType);\n\t\t$argType = preg_replace('/\\s+/', ' ', trim($argType));\n\t\treturn array($argType, trim($argName));\n\t}", "private function _parse($value)\n\t{\n\t\tif (is_object($value)) {\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (is_array($value)) {\n\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t$value[$k] = $this->_parse($v);\n\t\t\t}\n\t\t\treturn $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+$/\", $value)) {\n\t\t\treturn (int) $value;\n\t\t}\n\t\t\n\t\tif (preg_match(\"/^[0-9]+\\.[0-9]+$/\", $value)) {\n\t\t\treturn (float) $value;\n\t\t}\n\t\t\n\t\treturn $value;\n\t}", "function _getTypeValue($type, $value)\n\t{\n\t\t$value = trim($value);\n\t\tif(!isset($value))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'homepage' :\n\t\t\t\tif($value && !preg_match('/^([a-z]+):\\/\\//i', $value))\n\t\t\t\t{\n\t\t\t\t\t$value = 'http://' . $value;\n\t\t\t\t}\n\t\t\t\treturn htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);\n\n\t\t\tcase 'tel' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, ',') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode(',', $value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\tcase 'checkbox' :\n\t\t\tcase 'radio' :\n\t\t\tcase 'select' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, ',') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$values = explode(',', $value);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$values = array($value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\tcase 'kr_zip' :\n\t\t\t\tif(is_array($value))\n\t\t\t\t{\n\t\t\t\t\t$values = $value;\n\t\t\t\t}\n\t\t\t\telseif(strpos($value, '|@|') !== false)\n\t\t\t\t{\n\t\t\t\t\t$values = explode('|@|', $value);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$values = array($value);\n\t\t\t\t}\n\n\t\t\t\t$values = array_values($values);\n\t\t\t\tfor($i = 0, $c = count($values); $i < $c; $i++)\n\t\t\t\t{\n\t\t\t\t\t$values[$i] = trim(htmlspecialchars($values[$i], ENT_COMPAT | ENT_HTML401, 'UTF-8', false));\n\t\t\t\t}\n\t\t\t\treturn $values;\n\n\t\t\t//case 'date' :\n\t\t\t//case 'email_address' :\n\t\t\t//case 'text' :\n\t\t\t//case 'textarea' :\n\t\t\tdefault :\n\t\t\t\treturn htmlspecialchars($value, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);\n\t\t}\n\t}", "function rest_parse_request_arg($value, $request, $param)\n {\n }" ]
[ "0.63930905", "0.62760043", "0.62494653", "0.60486805", "0.6017503", "0.5936583", "0.58935225", "0.5879583", "0.5865281", "0.58402836", "0.58261275", "0.5804474", "0.57770395", "0.5760331", "0.57292205", "0.56601804", "0.56528455", "0.5624212", "0.5618019", "0.5577488", "0.5503879", "0.54834014", "0.5469053", "0.54352707", "0.5420685", "0.54099184", "0.53919375", "0.5295675", "0.52855676", "0.5271854" ]
0.6803307
0
Execute the hook displayOrderConfirmation
public function displayOrderConfirmation() { if (Validate::isUnsignedId($this->id_order)) { $params = array(); $order = new Order($this->id_order); $currency = new Currency($order->id_currency); if (Validate::isLoadedObject($order)) { $params['total_to_pay'] = $order->getOrdersTotalPaid(); $params['currency'] = $currency->sign; $params['objOrder'] = $order; $params['currencyObj'] = $currency; return Hook::exec('displayOrderConfirmation', $params); } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hookDisplayOrderConfirmation($params)\n\t{\n\t\t$order = $params['objOrder'];\n\t\t$products = $order->getProducts();\n\n\t\t$productArray = array();\n\n\t\tforeach ($products as $product) {\n\t\t\t$productArray[] = array(\n\t\t\t\t'id' => $product['id_product'],\n\t\t\t\t'quantity' => $product['product_quantity'],\n\t\t\t\t'price' => $product['product_price_wt'],\n\t\t\t);\n\t\t}\n\n\t\t$this->context->smarty->assign(\n\t\t\tarray(\n\t\t\t\t'clerk_order_id' => $order->id,\n\t\t\t\t'clerk_customer_email' => $this->context->customer->email,\n\t\t\t\t'clerk_products' => json_encode($productArray),\n\t\t\t)\n\t\t);\n\n\t\treturn $this->display(__FILE__, 'sales_tracking.tpl');\n\t}", "public function hookOrderConfirmation($params)\r\n\t{\r\n\t\tif (isset($params['objOrder']) && Validate::isLoadedObject($params['objOrder']) && isset($params['objOrder']->valid) &&\r\n\t\t\t\tversion_compare(_PS_VERSION_, '1.5', '>=') && isset($params['objOrder']->reference))\r\n\t\t{\r\n\t\t\t$this->smarty->assign('paypal_usa_order', array('id' => $params['objOrder']->id, 'reference' => $params['objOrder']->reference, 'valid' => $params['objOrder']->valid));\r\n\r\n\t\t\treturn $this->display(__FILE__, 'views/templates/hooks/order-confirmation.tpl');\r\n\t\t}\r\n\t}", "public function actionDisplayOrder()\n\t{\n\t\t$order = $this->_input->filterSingle('order', XenForo_Input::ARRAY_SIMPLE);\n\t\t\n\t\t$this->_assertPostOnly();\n\t\t$this->_getFieldModel()->massUpdateDisplayOrder($order);\n\t\t\n\t\treturn $this->responseRedirect(\n\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\tXenForo_Link::buildAdminLink('smilies')\n\t\t);\n\t}", "public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }", "public static function geoCart_process_orderDisplay()\n {\n $cart = geoCart::getInstance();\n\n self::_successFailurePage(true, $cart->order->getStatus(), true, $cart->order->getInvoice());\n\n //send email to admin if he wants it\n if ($cart->db->get_site_setting('user_set_hold_email')) {\n //echo $item_sell_class->db->get_site_setting('user_set_hold_email').\" is the setting for hold email<br />\";\n //echo \"email should be sent for ad on hold<br />\";\n $subject = \"An order has been placed!!\";\n $message = \"Admin,\\n\\n\";\n $message .= \"An order has been placed and is on hold because a \" . self::gateway_name . \" type was chosen. See the unapproved orders section of the admin.\\n\\n\";\n $message .= \"Additional orders may be in the unapproved ads section that you were not sent an email. These will be failed auto pay attempts or if you are approving all ads.\\n\\n\";\n geoEmail::sendMail($cart->db->get_site_setting('site_email'), $subject, $message);\n }\n\n //gateway is last thing to be called, so it needs to be the one that clears the session...\n $cart->removeSession();\n }", "public function confirmAction()\n {\n try {\n $orderId = (int) $this->getRequest()->getParam('order_id');\n $hash = $this->getRequest()->getParam('hash');\n $this->loadValidOrder($orderId, $hash);\n\n //Load and render basic layout\n $this->loadLayout();\n\n // set page title\n $title = $this->getLayout()->getBlock('dhlonlineretoure_customer_address_edit')->getTitle();\n $this->getLayout()->getBlock('head')->setTitle($this->__($title));\n\n // set current navigation entry\n $navigationBlock = $this->getLayout()->getBlock('customer_account_navigation');\n if ($navigationBlock) {\n $navigationBlock->setActive('sales/order/history');\n }\n\n $this->renderLayout();\n } catch (Exception $e) {\n //Show error message to user\n Mage::getSingleton('core/session')->addError($e->getMessage());\n Mage::helper(\"dhlonlineretoure/data\")->log($e->getMessage());\n\n $this->_redirect('*/*/error');\n }\n }", "private function ConfirmOrder()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// The current quote cannot be finalized - don't let it proceed\n\t\tif(!$this->getQuote()->canBeFinalized()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// ensure that the applied coupon still valid\n\t\ttry {\n\t\t\t$this->getQuote()->reapplyCoupons(true);\n\t\t}\n\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t}\n\n\t\t$GLOBALS['EnterCouponCode'] = isc_html_escape(GetLang('EnterCouponCode'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . \" - \" . GetLang('ConfirmYourOrder'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"checkout_confirm\");\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "function lb_show_order_complete_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'order-complete',\n\t\t\t'order_complete' => lb_get_order_from_orders_table_by_id( esc_html( $_GET['order_id'] ) ),\n\t\t)\n\t);\n}", "function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }", "public function displayContent()\n\t{\n\t\t$id_order = (int)Tools::getValue('id_order');\n\t\t$order = PayPalOrder::getOrderById($id_order);\n\t\t$price = Tools::displayPrice($order['total_paid'], $this->context->currency);\n\t\t\n\t\t$this->context->smarty->assign(array(\n\t\t\t'order' => $order,\n\t\t\t'price' => $price\n\t\t));\n\n\t\techo $this->context->smarty->fetch(_PS_MODULE_DIR_.'/paypal/views/templates/front/order-confirmation.tpl');\n\t}", "public function confirmOrder()\n {\n return view('frontend.OrderConfirmationDetails.order-confirmation-detail');\n }", "public function hookDisplayAdminOrderTabOrder($params)\n {\n if (Eticket::getEticketsFromIds(Eticket::getIdsFromOrder($params['order']->id))) {\n return $this->display(__FILE__, 'adminOrderTabOrder.tpl');\n }\n }", "public function confirmAction()\n {\n if (!$this->_isActive()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n if ($orderData = $this->getRequest()->getPost('order')) {\n $customerComment = (isset($orderData['customer_comment']) ? $orderData['customer_comment'] : '');\n $this->getOnepage()->getQuote()->setCustomerComment($customerComment);\n }\n\n $this->loadLayout();\n $this->renderLayout();\n }", "private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}", "public function finishAction() {\r\n if ($this->Request()->getParam('sUniqueID') && !empty($this->session['sOrderVariables'])) {\r\n $sql = '\r\n SELECT transactionID as sTransactionumber, ordernumber as sOrderNumber\r\n FROM s_order\r\n WHERE temporaryID=? AND userID=?\r\n ';\r\n\r\n $order = Shopware()->Db()->fetchRow($sql, array($this->Request()->getParam('sUniqueID'), Shopware()->Session()->sUserId));\r\n if (!empty($order)) {\r\n $this->View()->assign($order);\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $orderVariables = $this->session['sOrderVariables']->getArrayCopy();\r\n\r\n $userData = $this->View()->sUserData;\r\n $userData[\"billingaddress\"]['country'] = $this->getCountryById($userData[\"billingaddress\"][\"countryID\"]);\r\n $userData[\"shippingaddress\"]['country'] = $this->getCountryById($userData[\"shippingaddress\"][\"countryID\"]);\r\n $this->View()->sUserData = $userData;\r\n\r\n $orderVariables['sAddresses']['billing'] = $this->View()->sUserData[\"billingaddress\"];\r\n $orderVariables['sAddresses']['shipping'] = $this->View()->sUserData[\"shippingaddress\"];\r\n $orderVariables['sAddresses']['equal'] = $this->areAddressesEqual($orderVariables['sAddresses']['billing'], $orderVariables['sAddresses']['shipping']);\r\n\r\n $this->View()->assign($orderVariables);\r\n } else {\r\n $this->View()->assign($this->session['sOrderVariables']->getArrayCopy());\r\n }\r\n return;\r\n }\r\n }\r\n\r\n if (empty($this->session['sOrderVariables'])||$this->getMinimumCharge()||$this->getEsdNote()||$this->getDispatchNoOrder()) {\r\n return $this->forward('confirm');\r\n }\r\n\r\n $checkQuantities = $this->basket->sCheckBasketQuantities();\r\n if (!empty($checkQuantities['hideBasket'])) {\r\n return $this->forward('confirm');\r\n }\r\n\r\n if(Shopware()->Plugins()->Backend()->sKUZOOffer()->assertMinimumVersion(\"5.2\")){\r\n $orderVariables = $this->session['sOrderVariables']->getArrayCopy();\r\n\r\n $userData = $this->View()->sUserData;\r\n $userData[\"billingaddress\"]['country'] = $this->getCountryById($userData[\"billingaddress\"][\"countryID\"]);\r\n $userData[\"shippingaddress\"]['country'] = $this->getCountryById($userData[\"shippingaddress\"][\"countryID\"]);\r\n $this->View()->sUserData = $userData;\r\n\r\n $orderVariables['sAddresses']['billing'] = $this->View()->sUserData[\"billingaddress\"];\r\n $orderVariables['sAddresses']['shipping'] = $this->View()->sUserData[\"shippingaddress\"];\r\n $orderVariables['sAddresses']['equal'] = $this->areAddressesEqual($orderVariables['sAddresses']['billing'], $orderVariables['sAddresses']['shipping']);\r\n $this->View()->assign($orderVariables);\r\n } else {\r\n $this->View()->assign($this->session['sOrderVariables']->getArrayCopy());\r\n }\r\n\r\n if ($this->basket->sCountBasket()>0\r\n && empty($this->View()->sUserData['additional']['payment']['embediframe'])) {\r\n if ($this->Request()->getParam('sNewsletter')!==null) {\r\n $this->session['sNewsletter'] = $this->Request()->getParam('sNewsletter') ? true : false;\r\n }\r\n //if ($this->Request()->getParam('sComment')!==null) {\r\n $this->session['sComment'] = trim(strip_tags($this->Request()->getParam('sComment')));\r\n //}\r\n if (!empty($this->session['sNewsletter'])) {\r\n $this->admin->sUpdateNewsletter(true, $this->admin->sGetUserMailById(), true);\r\n }\r\n $orderVariables = $this->saveOffer();\r\n }\r\n $this->View()->assign('sKUZOOffer', true);\r\n\r\n $this->View()->assign($orderVariables->getArrayCopy());\r\n }", "function order_success()\n{\n\n}", "public function BuildOrderConfirmation()\n\t{\n\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\t\tif(!GetConfig('ShowMailingListInvite')) {\n\t\t\t$GLOBALS['HideMailingListInvite'] = 'none';\n\t\t}\n\n\t\t// Do we need to show the special offers & discounts checkbox and should they\n\t\t// either of the newsletter checkboxes be ticked by default?\n\t\tif (GetConfig('MailAutomaticallyTickNewsletterBox')) {\n\t\t\t$GLOBALS['NewsletterBoxIsTicked'] = 'checked=\"checked\"';\n\t\t}\n\n\t\tif (ISC_EMAILINTEGRATION::doOrderAddRulesExist()) {\n\t\t\tif (GetConfig('MailAutomaticallyTickOrderBox')) {\n\t\t\t\t$GLOBALS['OrderBoxIsTicked'] = 'checked=\"checked\"';\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideOrderCheckBox'] = \"none\";\n\t\t}\n\n\t\tif(isset($_REQUEST['ordercomments'])) {\n\t\t\t$GLOBALS['OrderComments'] = $_REQUEST['ordercomments'];\n\t\t}\n\n\t\t// Now we check if we have an incoming coupon or gift certificate code to apply\n\t\tif (isset($_REQUEST['couponcode']) && $_REQUEST['couponcode'] != '') {\n\t\t\t$code = trim($_REQUEST['couponcode']);\n\n\t\t\t// Were we passed a gift certificate code?\n\t\t\tif (self::isCertificateCode($code)) {\n\t\t\t\ttry {\n\t\t\t\t\t$this->getQuote()->applyGiftCertificate($code);\n\n\t\t\t\t\t// If successful show a message\n\t\t\t\t\t$GLOBALS['CheckoutSuccessMsg'] = GetLang('GiftCertificateAppliedToCart');\n\t\t\t\t}\n\t\t\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise, it must be a coupon code\n\t\t\telse {\n\t\t\t\ttry {\n\t\t\t\t\t$this->getQuote()->applyCoupon($code);\n\n\t\t\t\t\t// Coupon code applied successfully\n\t\t\t\t\t$GLOBALS['CheckoutSuccessMsg'] = GetLang('CouponAppliedToCart');\n\t\t\t\t}\n\t\t\t\tcatch(ISC_QUOTE_EXCEPTION $e) {\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['ISC_CLASS_ACCOUNT'] = GetClass('ISC_ACCOUNT');\n\n\t\t// Determine what we'll be showing for the redeem gift certificate/coupon code box\n\t\tif (gzte11(ISC_LARGEPRINT)) {\n\t\t\t$GLOBALS['RedeemTitle'] = GetLang('RedeemGiftCertificateOrCoupon');\n\t\t\t$GLOBALS['RedeemIntro'] = GetLang('RedeemGiftCertificateorCouponIntro');\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['RedeemTitle'] = GetLang('RedeemCouponCode');\n\t\t\t$GLOBALS['RedeemIntro'] = GetLang('RedeemCouponCodeIntro');\n\t\t}\n\n\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t$GLOBALS['HideUseCoupon'] = '';\n\t\t$checkoutProviders = array();\n\n\t\t// if the provider list html is set in session then use it as the payment provider options.\n\t\t// it's normally set in payment modules when it's required.\n\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"\";\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t\t$GLOBALS['PaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];\n\t\t\t$GLOBALS['StoreCreditPaymentProviders'] = $_SESSION['CHECKOUT']['ProviderListHTML'];\n\t\t\t$GLOBALS['CheckoutWith'] = \"\";\n\t\t} else {\n\t\t\t// Get a list of checkout providers\n\t\t\t$checkoutProviders = GetCheckoutModulesThatCustomerHasAccessTo(true);\n\n\n\t\t\t// If no checkout providers are set up, send an email to the store owner and show an error message\n\t\t\tif (empty($checkoutProviders)) {\n\t\t\t\t$GLOBALS['HideConfirmOrderPage'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = GetLang('NoCheckoutProviders');\n\t\t\t\t$GLOBALS['NoCheckoutProvidersError'] = sprintf(GetLang(\"NoCheckoutProvidersErrorLong\"), $GLOBALS['ShopPath']);\n\n\t\t\t\t$GLOBALS['EmailHeader'] = GetLang(\"NoCheckoutProvidersSubject\");\n\t\t\t\t$GLOBALS['EmailMessage'] = sprintf(GetLang(\"NoCheckoutProvidersErrorLong\"), $GLOBALS['ShopPath']);\n\n\t\t\t\t$emailTemplate = FetchEmailTemplateParser();\n\t\t\t\t$emailTemplate->SetTemplate(\"general_email\");\n\t\t\t\t$message = $emailTemplate->ParseTemplate(true);\n\n\t\t\t\trequire_once(ISC_BASE_PATH . \"/lib/email.php\");\n\t\t\t\t$obj_email = GetEmailClass();\n\t\t\t\t$obj_email->Set('CharSet', GetConfig('CharacterSet'));\n\t\t\t\t$obj_email->From(GetConfig('OrderEmail'), GetConfig('StoreName'));\n\t\t\t\t$obj_email->Set(\"Subject\", GetLang(\"NoCheckoutProvidersSubject\"));\n\t\t\t\t$obj_email->AddBody(\"html\", $message);\n\t\t\t\t$obj_email->AddRecipient(GetConfig('AdminEmail'), \"\", \"h\");\n\t\t\t\t$email_result = $obj_email->Send();\n\t\t\t}\n\n\t\t\t// We have more than one payment provider, hide the top button and build a list\n\t\t\telse if (count($checkoutProviders) > 1) {\n\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t}\n\n\t\t\t// There's only one payment provider - hide the list\n\t\t\telse {\n\t\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t\t$GLOBALS['HidePaymentOptions'] = \"none\";\n\t\t\t\tlist(,$provider) = each($checkoutProviders);\n\t\t\t\tif(method_exists($provider['object'], 'ShowPaymentForm') && !isset($_SESSION['CHECKOUT']['ProviderListHTML'])) {\n\t\t\t\t\t$GLOBALS['ExpressCheckoutLoadPaymentForm'] = 'ExpressCheckout.ShowSingleMethodPaymentForm();';\n\t\t\t\t}\n\t\t\t\tif ($provider['object']->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE) {\n\t\t\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton();\";\n\t\t\t\t}\n\t\t\t\t$GLOBALS['CheckoutWith'] = $provider['object']->GetDisplayName();\n\t\t\t}\n\n\t\t\t// Build the list of payment provider options\n\t\t\t$GLOBALS['PaymentProviders'] = $GLOBALS['StoreCreditPaymentProviders'] = \"\";\n\t\t\tforeach ($checkoutProviders as $provider) {\n\t\t\t\t$GLOBALS['ProviderChecked'] = '';\n\t\t\t\tif(count($checkoutProviders) == 1) {\n\t\t\t\t\t$GLOBALS['ProviderChecked'] = 'checked=\"checked\"';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ProviderId'] = $provider['object']->GetId();\n\t\t\t\t$GLOBALS['ProviderName'] = isc_html_escape($provider['object']->GetDisplayName());\n\t\t\t\t$GLOBALS['ProviderType'] = $provider['object']->GetPaymentType(\"text\");\n\t\t\t\tif(method_exists($provider['object'], 'ShowPaymentForm')) {\n\t\t\t\t\t$GLOBALS['ProviderPaymentFormClass'] = 'ProviderHasPaymentForm';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['ProviderPaymentFormClass'] = '';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['PaymentFieldPrefix'] = '';\n\t\t\t\t$GLOBALS['PaymentProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutProviderOption\");\n\t\t\t\t$GLOBALS['PaymentFieldPrefix'] = 'credit_';\n\t\t\t\t$GLOBALS['StoreCreditPaymentProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutProviderOption\");\n\t\t\t}\n\n\t\t}\n\n\t\t// Are we coming back to this page for a particular reason?\n\t\tif (isset($_SESSION['REDIRECT_TO_CONFIRMATION_MSG'])) {\n\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t\t$GLOBALS['CheckoutErrorMsg'] = $_SESSION['REDIRECT_TO_CONFIRMATION_MSG'];\n\t\t\tunset($_SESSION['REDIRECT_TO_CONFIRMATION_MSG']);\n\t\t}\n\n\t\t$displayIncludingTax = false;\n\t\tif(getConfig('taxDefaultTaxDisplayCart') != TAX_PRICES_DISPLAY_EXCLUSIVE) {\n\t\t\t$displayIncludingTax = true;\n\t\t}\n\n\t\t$items = $this->getQuote()->getItems();\n\n\t\t// Start building the summary of all of the items in the order\n\t\t$GLOBALS['SNIPPETS']['CartItems'] = '';\n\t\tforeach ($items as $item) {\n\t\t\t$GLOBALS['ProductQuantity'] = $item->getQuantity();\n\n\t\t\t$price = $item->getPrice($displayIncludingTax);\n\t\t\t$total = $item->getTotal($displayIncludingTax);\n\t\t\t$GLOBALS['ProductPrice'] = currencyConvertFormatPrice($price);\n\t\t\t$GLOBALS['ProductTotal'] = currencyConvertFormatPrice($total);\n\n\t\t\tif($item instanceof ISC_QUOTE_ITEM_GIFTCERTIFICATE) {\n\t\t\t\t$GLOBALS['GiftCertificateName'] = isc_html_escape($item->getName());\n\t\t\t\t$GLOBALS['GiftCertificateTo'] = isc_html_escape($item->getRecipientName());\n\t\t\t\t$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutCartItemGiftCertificate\");\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$GLOBALS['ProductAvailability'] = $item->getAvailability();\n\t\t\t$GLOBALS['ItemId'] = $item->getProductId();\n\n\t\t\t// Is this product a variation?\n\t\t\t$GLOBALS['ProductOptions'] = '';\n\t\t\t$options = $item->getVariationOptions();\n\t\t\tif(!empty($options)) {\n\t\t\t\t$GLOBALS['ProductOptions'] .= \"<br /><small>(\";\n\t\t\t\t$comma = '';\n\t\t\t\tforeach($options as $name => $value) {\n\t\t\t\t\tif(!trim($name) || !trim($value)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ProductOptions'] .= $comma.isc_html_escape($name).\": \".isc_html_escape($value);\n\t\t\t\t\t$comma = ', ';\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ProductOptions'] .= \")</small>\";\n\t\t\t}\n\t\t\t$GLOBALS['EventDate'] = '';\n\t\t\t$eventDate = $item->getEventDate(true);\n\t\t\tif(!empty($eventDate)) {\n\t\t\t\t$GLOBALS['EventDate'] = '\n\t\t\t\t\t<div style=\"font-style: italic; font-size:10px; color:gray\">(' .\n\t\t\t\t\t\t$item->getEventName() . ': ' . isc_date('M jS Y', $eventDate) .\n\t\t\t\t\t')</div>';\n\t\t\t}\n\n\t\t\t$GLOBALS['HideGiftWrapping'] = 'display: none';\n\t\t\t$GLOBALS['GiftWrappingName'] = '';\n\t\t\t$GLOBALS['GiftMessagePreview'] = '';\n\t\t\t$GLOBALS['HideGiftMessagePreview'] = 'display: none';\n\n\t\t\t$wrapping = $item->getGiftWrapping();\n\t\t\tif($wrapping !== false) {\n\t\t\t\t$GLOBALS['HideGiftWrapping'] = '';\n\t\t\t\t$GLOBALS['GiftWrappingName'] = isc_html_escape($wrapping['wrapname']);\n\t\t\t\tif(!empty($wrapping['wrapmessage'])) {\n\t\t\t\t\tif(isc_strlen($wrapping['wrapmessage']) > 30) {\n\t\t\t\t\t\t$wrapping['wrapmessage'] = substr($wrapping['wrapmessage'], 0, 27).'...';\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = isc_html_escape($wrapping['wrapmessage']);\n\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//create configurable product fields on order confirmation page with the data posted from add to cart page\n\t\t\t$GLOBALS['CartProductFields'] = '';\n\t\t\t$configuration = $item->getConfiguration();\n\t\t\tif (!empty($configuration)) {\n\t\t\t\trequire_once ISC_BASE_PATH.'/includes/display/CartContent.php';\n\t\t\t\tISC_CARTCONTENT_PANEL::GetProductFieldDetails($configuration, $item->getId());\n\t\t\t}\n\n\t\t\t$GLOBALS['ProductName'] = isc_html_escape($item->getName());\n\t\t\t$GLOBALS['ProductImage'] = imageThumb($item->getThumbnail(), prodLink($item->getName()));\n\n\t\t\t$GLOBALS['HideExpectedReleaseDate'] = 'display: none;';\n\t\t\tif($item->isPreOrder()) {\n\t\t\t\t$GLOBALS['ProductExpectedReleaseDate'] = $item->getPreOrderMessage();\n\t\t\t\t$GLOBALS['HideExpectedReleaseDate'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CheckoutCartItem\");\n\t\t}\n\n\t\t// Do we have a shipping price to show?\n\t\tif(!$this->getQuote()->isDigital()) {\n\t\t\t$shippingAddresses = $this->getQuote()->getShippingAddresses();\n\t\t\t$numShippingAddresses = count($shippingAddresses);\n\t\t\tif($numShippingAddresses == 1) {\n\t\t\t\t$shippingAddress = $this->getQuote()->getShippingAddress();\n\t\t\t\t$GLOBALS['ShippingAddress'] = $GLOBALS['ISC_CLASS_ACCOUNT']->FormatShippingAddress($shippingAddress->getAsArray());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['ShippingAddress'] = '<em>(Order will be shipped to multiple addresses)</em>';\n\t\t\t}\n\n\t\t\t// Show the shipping details\n\t\t\t$GLOBALS['HideShippingDetails'] = '';\n\t\t}\n\t\t// This is a digital order - no shipping applies\n\t\telse {\n\t\t\t$GLOBALS['HideShippingDetails'] = 'display: none';\n\t\t\t$GLOBALS['HideShoppingCartShippingCost'] = 'none';\n\t\t\t$GLOBALS['ShippingAddress'] = GetLang('NotRequiredForDigitalDownloads');\n\t\t\t$GLOBALS['ShippingMethod'] = GetLang('ShippingImmediateDownload');\n\t\t}\n\n\t\t$billingAddress = $this->getQuote()->getBillingAddress();\n\t\t$GLOBALS['BillingAddress'] = getClass('ISC_ACCOUNT')\n\t\t\t->formatShippingAddress($billingAddress->getAsArray());\n\n\t\t$totalRows = self::getQuoteTotalRows($this->getQuote());\n\t\t$templateTotalRows = '';\n\t\tforeach($totalRows as $id => $totalRow) {\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('label', $totalRow['label']);\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('classNameAppend', ucfirst($id));\n\t\t\t$value = currencyConvertFormatPrice($totalRow['value']);\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('value', $value);\n\t\t\t$templateTotalRows .= $GLOBALS['ISC_CLASS_TEMPLATE']->getSnippet('CheckoutCartTotal');\n\t\t}\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->assign('totals', $templateTotalRows);\n\n\t\t$grandTotal = $this->getQuote()->getGrandTotal();\n\t\t$GLOBALS['GrandTotal'] = formatPrice($grandTotal);\n\t\tif($grandTotal == 0) {\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"none\";\n\t\t\t$GLOBALS['HideUseCoupon'] = 'none';\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton(); ExpressCheckout.UncheckPaymentProvider();\";\n\t\t}\n\n\t\t// Does the customer have any store credit they can use?\n\t\t$GLOBALS['HideUseStoreCredit'] = \"none\";\n\t\t$GLOBALS['HideRemainingStoreCredit'] = \"none\";\n\t\t$customer = $GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerDataByToken();\n\t\tif ($customer['custstorecredit'] > 0) {\n\t\t\t$GLOBALS['HidePaymentOptions'] = \"\";\n\t\t\t$GLOBALS['StoreCredit'] = CurrencyConvertFormatPrice($customer['custstorecredit']);\n\t\t\t$GLOBALS['HideUseStoreCredit'] = \"\";\n\t\t\t$GLOBALS['HidePaymentProviderList'] = \"none\";\n\t\t\t// The customer has enough store credit to pay for the entirity of this order\n\t\t\tif ($customer['custstorecredit'] >= $grandTotal) {\n\t\t\t\t$GLOBALS['PaymentButtonSwitch'] = \"ShowContinueButton();\";\n\t\t\t\t$GLOBALS['HideLimitedCreditWarning'] = \"none\";\n\t\t\t\t$GLOBALS['HideLimitedCreditPaymentOption'] = \"none\";\n\t\t\t\t$GLOBALS['HideCreditPaymentMethods'] = \"none\";\n\t\t\t\t$GLOBALS['RemainingCredit'] = $customer['custstorecredit'] - $grandTotal;\n\t\t\t\tif ($GLOBALS['RemainingCredit'] > 0) {\n\t\t\t\t\t$GLOBALS['HideRemainingStoreCredit'] = '';\n\t\t\t\t\t$GLOBALS['RemainingCredit'] = CurrencyConvertFormatPrice($GLOBALS['RemainingCredit']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Customer doesn't have enough store credit to pay for the order\n\t\t\telse {\n\t\t\t\t$GLOBALS['Remaining'] = CurrencyConvertFormatPrice($grandTotal-$customer['custstorecredit']);\n\n\t\t\t\tif(count($checkoutProviders) == 1) {\n\t\t\t\t\t$GLOBALS['CheckoutStoreCreditWarning'] = sprintf(GetLang('CheckoutStoreCreditWarning2'), $GLOBALS['Remaining'], $GLOBALS['CheckoutWith']);\n\t\t\t\t\t$GLOBALS['HideLimitedCreditPaymentOption'] = \"none\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['CheckoutStoreCreditWarning'] = GetLang('CheckoutStoreCreditWarning');\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ISC_LANG']['CreditPaymentMethod'] = sprintf(GetLang('CreditPaymentMethod'), $GLOBALS['Remaining']);\n\t\t\t}\n\n\t\t\tif (count($checkoutProviders) > 1) {\n\t\t\t\t$GLOBALS['CreditAlt'] = GetLang('CheckoutCreditAlt');\n\t\t\t}\n\t\t\telse if (count($checkoutProviders) <= 1 && isset($GLOBALS['CheckoutWith'])) {\n\t\t\t\t$GLOBALS['CreditAlt'] = sprintf(GetLang('CheckoutCreditAltOneMethod'), $GLOBALS['CheckoutWith']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($customer['custstorecredit'] >= $grandTotal) {\n\t\t\t\t\t$GLOBALS['HideCreditAltOptionList'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideConfirmOrderPage'] = \"\";\n\t\t\t\t\t$GLOBALS['HideTopPaymentButton'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t\t\t\t$GLOBALS['CheckoutErrorMsg'] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Customer has hit this page before. Delete the existing pending order\n\t\t// The reason we do a delete is if they're hitting this page again, something\n\t\t// has changed with their order or something has become invalid with it along the way.\n\t\tif (isset($_COOKIE['SHOP_ORDER_TOKEN']) && IsValidPendingOrderToken($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t$query = \"\n\t\t\t\tSELECT orderid\n\t\t\t\tFROM [|PREFIX|]orders\n\t\t\t\tWHERE ordtoken='\".$GLOBALS['ISC_CLASS_DB']->Quote($_COOKIE['SHOP_ORDER_TOKEN']).\"' AND ordstatus=0\n\t\t\t\";\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile($order = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$entity = new ISC_ENTITY_ORDER();\n\t\t\t\t/** @todo ISC-1141 check to see if this needs changing to ->purge() */\n\t\t\t\t/** @todo ISC-860 this is relying on another bugfix, I'm leaving this as ->delete() for now so that orders remain in the db somewhere at least -gwilym */\n\t\t\t\tif ($entity->delete($order['orderid'], true)) {\n\t\t\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemNotice('general', GetLang('OrderDeletedAutomatically', array('order' => $order['orderid'])));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Are we showing an error message?\n\t\tif (isset($GLOBALS['CheckoutErrorMsg']) && $GLOBALS['CheckoutErrorMsg'] != '') {\n\t\t\t$GLOBALS['HideCheckoutError'] = '';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideCheckoutError'] = \"none\";\n\t\t}\n\n\t\t// Is there a success message to show?\n\t\tif (isset($GLOBALS['CheckoutSuccessMsg']) && $GLOBALS['CheckoutSuccessMsg'] != '') {\n\t\t\t$GLOBALS['HideCheckoutSuccess'] = '';\n\t\t}\n\t\telse {\n\t\t\t$GLOBALS['HideCheckoutSuccess'] = \"none\";\n\t\t}\n\n\t\tif(GetConfig('EnableOrderComments') == 1) {\n\t\t\t$GLOBALS['HideOrderComments'] = \"\";\n\t\t} else {\n\t\t\t$GLOBALS['HideOrderComments'] = \"none\";\n\t\t}\n\n\t\tif(GetConfig('EnableOrderTermsAndConditions') == 1) {\n\n\t\t\t$GLOBALS['HideOrderTermsAndConditions'] = \"\";\n\n\t\t\tif(GetConfig('OrderTermsAndConditionsType') == \"link\") {\n\t\t\t\t$GLOBALS['AgreeTermsAndConditions'] = GetLang('YesIAgree');\n\n\t\t\t\t$GLOBALS['TermsAndConditionsLink'] = \"<a href='\".GetConfig('OrderTermsAndConditionsLink').\"' target='_BLANK'>\".strtolower(GetLang('TermsAndConditions')).\"</a>.\";\n\n\t\t\t\t$GLOBALS['HideTermsAndConditionsTextarea'] = \"display:none;\";\n\n\t\t\t} else {\n\t\t\t\t$GLOBALS['HideTermsAndConditionsTextarea']= '';\n\t\t\t\t$GLOBALS['OrderTermsAndConditions'] = GetConfig('OrderTermsAndConditions');\n\t\t\t\t$GLOBALS['AgreeTermsAndConditions'] = GetLang('AgreeTermsAndConditions');\n\t\t\t\t$GLOBALS['TermsAndConditionsLink'] = '';\n\t\t\t}\n\t\t} else {\n\t\t\t$GLOBALS['HideOrderTermsAndConditions'] = \"display:none;\";\n\t\t}\n\n\t\t// BCSIXBETA-372 - mail format preferences removed/disabled for now\n\t\t// %%SNIPPET_CheckoutMailFormatPreference%% references also need to be added back into the checkout panels/snippets to re-enable this if needed\n//\t\t$GLOBALS['MailFormatPreferenceOptions'] = $this->GenerateMailFormatPreferenceOptions();\n//\t\t$GLOBALS['SNIPPETS']['CheckoutMailFormatPreference'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CheckoutMailFormatPreference');\n\t}", "public function display_order_pending()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'Failed payment list';\n\t\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\t\tif ($rep_code != '') {\n\t\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t\t} else {\n\t\t\t\t$condition = '';\n\t\t\t}\n\t\t\t$this->data['orderList'] = $this->order_model->view_order_details('Pending', $condition, $rep_code);\n\t\t\t//echo $this->db->last_query(); exit;\n\t\t\t$this->load->view('admin/order/display_orders_pending', $this->data);\n\t\t}\n\t}", "public function hookorderConfirmation($params)\n {\n // For order confirmation\n $isActivate = $this->isRulesetActive('order_confirmation');\n if ($isActivate != null && $isActivate != '' && $this->smsAPI != null && $this->smsAPI != '') {\n $param = $params['objOrder'];\n $order = new Order((int)$param->id);\n \n if ($order) {\n $address = new Address((int)$order->id_address_delivery);\n $legendstemp = $this->replaceOrderLegends(\n $isActivate[0]['template'],\n $order,\n $address\n );\n // Use send SMS API here\n $legendstemp = preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $legendstemp);\n $postAPIdata = array(\n 'label' => $isActivate[0]['label'],\n 'sms_text' => $legendstemp,\n 'source' => '21000',\n 'sender_id' => $isActivate[0]['senderid'],\n 'mobile_number' => $address->phone_mobile\n );\n $this->sendSMSByAPI($postAPIdata);\n Onehopsmsservice::onehopSaveLog('Confirmed', $legendstemp, $address->phone_mobile);\n $productArray = $order->getProducts();\n if ($productArray) {\n foreach ($productArray as $product) {\n $this->productOutofOrderProcess($product['product_id']);\n }\n }\n }\n }\n }", "public function hookDisplayAdminOrder($params)\n {\n $id_order = (int)$params['id_order'];\n $order = new Order($id_order);\n if (Validate::isLoadedObject($order)) {\n $payment_transaction = PaymentTransaction::getInstanceByOrder(\n $order->id\n );\n if ($payment_transaction) {\n $this->context->smarty->assign(\n 'payment_transaction',\n $payment_transaction\n );\n return $this->display(__FILE__, 'order_detail_payment_transaction.tpl');\n }\n }\n return '';\n }", "function show() {\n global $_SERVER;\n global $lang;\n global $theme;\n global $_SESSION;\n global $__order_register;\n global $__order_register_tab;\n global $_REQUEST;\n global $sess;\n \n // odczytaj jakie sa ustawienia sortowania obecnie\n if (! empty($_SESSION[\"__order_register_set\"])){\n $tab=$_SESSION[\"__order_register_set\"];\n } else {\n $tab['partner']=0;\n $tab['amount']=0;\n $tab['rake_off']=0;\n }\n\n if (! empty($_REQUEST['order'])) {\n $order=$_REQUEST['order']; $set=false; \n $order=intval($order);\n \n switch ($order) {\n case \"1\":$tab['partner']=-1; $set=true; // zmien \"strzalke\" (kierunek sortowania)\n break;\n case \"2\":$tab['amount']=-1; $set=true;\n break;\n case \"3\":$tab['rake_off']=-1; $set=true;\n break;\n case \"-1\":$tab['partner']=1; $set=true;\n break;\n case \"-2\":$tab['amount']=1; $set=true;\n break;\n case \"-3\":$tab['rake_off']=1; $set=true;\n break;\n default:$tab['partner']=-1; $set=true;\n break;\n } // end switch\n \n } // end if\n\n // start: sprawdz czy wybrano jakiekolwiek sortowanie, jesli nie to wstaw sortowanie wg ceny od najmniejszej\n // chyba ze jest to wyszukiwanie wedlug slowa, wtedy wstaw sortowanie wedlug dopasowania\n if (@$set!=true) {\n $tab['partner']=-1;\n } \n // end:\n\n // zapamietaj tablice sortowania w sesji\n $__order_main_tab_register=&$tab;\n $sess->register(\"__order_register_tab\",$order_register_tab);\n $__order_main_register=&$order;\n $sess->register(\"__order_register\",$__order_register);\n\n $url=$_SERVER['REQUEST_URI'];\n \n // pomin sesje, uniknij duplikacji zmiennej sesji\n $url=preg_replace(\"/&session_id=[a-z0-9]+$/\",\"\",$url);\n $url=ereg_replace(\"\\?order=[0-9-]+$\",\"\",$url);\n \n // sortowanie wg nazwy\n if ($tab['partner']==1) {\n print \"<a href=$url?order=1><u>\".$lang->order_by['partner'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \";\n } elseif ($tab['partner']==-1) {\n print \"<a href=$url?order=-1><u>\".$lang->order_by['partner'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \";\n } else {\n print \"<a href=$url?order=1><u>\".$lang->order_by['partner'].\"</u></a> &nbsp;\";\n }\n\n // sortowanie wg ceny\n if ($tab['amount']==1) {\n print \"<a href=$url?order=2><u>\".$lang->order_by['amount'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \"; \n } elseif ($tab['amount']==-1) {\n print \"<a href=$url?order=-2><u>\".$lang->order_by['amount'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \"; \n } else {\n print \"<a href=$url?order=2><u>\".$lang->order_by['amount'].\"</u></a> &nbsp; \";\n } \n\n // sortowanie wg producenta\n if ($tab['rake_off']==1) {\n print \"<a href=$url?order=3><u>\".$lang->order_by['rake_off'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/up.png\"); print \"> \";\n } elseif ($tab['rake_off']==-1) {\n print \"<a href=$url?order=-3><u>\".$lang->order_by['rake_off'].\"</u></a> \";\n print \"<img src=\";$theme->img(\"_img/down.png\"); print \"> \";\n } else {\n print \"<a href=$url?order=3><u>\".$lang->order_by['rake_off'].\"</u></a> &nbsp;\";\n }\n\n return;\n }", "public static function geoCart_process_orderDisplay()\n {\n //use to display some success/failure page, if that applies to this type of gateway.\n\n\n //build response for user\n $cart = geoCart::getInstance();\n $db = DataAccess::getInstance();\n $messages = $db->get_text(true, 180);\n\n $tpl = new geoTemplate('system', 'payment_gateways');\n $tpl->assign($cart->getCommonTemplateVars());\n $tpl->assign('page_title', $messages[3142]);\n $tpl->assign('page_desc', $messages[3143]);\n $tpl->assign('success_failure_message', $messages[3167]);\n $tpl->assign('my_account_url', $db->get_site_setting('classifieds_file_name') . '?a=4&amp;b=3');\n $tpl->assign('my_account_link', $messages[3169]);\n\n $invoice = $cart->order->getInvoice();\n if (is_object($invoice) && $invoice->getId()) {\n $tpl_vars['invoice_url'] = geoInvoice::getInvoiceLink($invoice->getId(), false, defined('IN_ADMIN'));\n }\n\n $html = $tpl->fetch('shared/transaction_approved.tpl');\n $cart->site->body .= $html;\n $cart->site->display_page();\n\n return $html;\n }", "public function display_account_order_details( ){\n\t\tif( $this->is_page_visible( \"order_details\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_order_details.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_order_details.php' );\n\t\t}\n\t}", "function confirm()\n\t{\n\t\t$orderdetail = $this->Order_mdl->orderdetail();\n\t\t$voucher = $orderdetail['orderdetails_voucherno'];\n\t\t//---------------------------------\n\n\t\t// Second - Get session userid\n\t\t$sessiondata = $this->session->userdata('logged_in');\n\t\t$sessionid = $sessiondata['id'];\n\t\t//---------------------------------\n\n\t\t$data['orders'] = $this->Order_mdl->orderconfirm($voucher, $sessionid);\n\t\t\n\n\t\t$data['total'] = $orderdetail['orderdetails_total'];\n\t\t$data['voucher'] = $voucher;\n\n\n\t\t$data['session'] = $this->session->userdata('logged_in');\n\t\t$data['authors'] = $this->Author_mdl->list();\n\t\t$data['genres'] = $this->Genre_mdl->list();\n\n\t\t$data['innerdata'] = 'frontend/confirm';\n\n\t\t$this->load->view('include/frontendtemplate',$data);\n\n\n\t}", "public function actualize()\n {\n\n $orders = $this->gdaxService->getOpenOrders();\n if (count($orders)) {\n $this->msg[] = $this->timestamp . ' .... <info>actualize orders</info>';\n $this->orderService->fixUnknownOrdersFromGdax($orders);\n }\n }", "function confirmation() {\r\n global $order;\r\n $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,\r\n 'field' => $_POST['authorizenet_echeck_bank_name']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ROUTING_CODE,\r\n 'field' => $_POST['authorizenet_echeck_bank_aba_code']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_TYPE,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_type']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_NUM,\r\n 'field' => $_POST['authorizenet_echeck_bank_acct_num']),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_TITLE,\r\n 'field' => sprintf(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHORIZATION_NOTICE, strtolower(zen_db_prepare_input($_POST['authorizenet_echeck_bank_acct_type'])), zen_date_short(date(\"Y-m-d\")), $order->info['total']))\r\n ));\r\n return $confirmation;\r\n }", "public function hookAdminOrder($params)\r\n {\r\n\r\n $output = '';\r\n $order = new Order((int) $params['id_order']);\r\n $carrier = new Carrier((int) $order->id_carrier);\r\n\r\n $this->initializeShippings();\r\n\r\n $config = $this->getTipsaConfiguration();\r\n $cashondelivery_modules = explode(',', $config['cashondelivery_modules']);\r\n\r\n if (in_array($order->module, $cashondelivery_modules)) {\r\n $contrarreembolso = $order->total_paid_real;\r\n } else {\r\n $contrarreembolso = 0;\r\n }\r\n\r\n if ($carrier->external_module_name == 'tipsacarrier') {\r\n $codageyp = Db::getInstance()->getValue('SELECT `codageyp` FROM `' . _DB_PREFIX_ . 'tipsa_address` WHERE `id_order` =' . (int) $order->id);\r\n $sql = 'SELECT `codigo_barras` '\r\n . 'FROM `' . _DB_PREFIX_ . 'tipsa_envios`'\r\n . 'WHERE `id_envio_order` = ' . (int) $order->id . ' AND `codigo_barras` IS NOT NULL ';\r\n $showLabelButton = (bool) Db::getInstance()->getValue($sql);\r\n $linkLabel = Db::getInstance()->getValue($sql);\r\n\r\n if (Tools::isSubmit('generateLabeltipsa_envios') || Tools::isSubmit('updateBultostipsa_envios')) {\r\n Db::getInstance()->update('tipsa_envios', array('bultos' => (int) Tools::getValue('packages'), 'observation' => Tools::getValue('observation_carrier')), 'id_envio = ' . Tools::getValue('TIPSA_ID_ENVIO'));\r\n $output .= $this->displayConfirmation($this->l('Status Updated.'));\r\n }\r\n\r\n if (Tools::isSubmit('generateLabeltipsa_envios') && !$showLabelButton) {\r\n $this->printLabel((int) Tools::getValue('TIPSA_ID_ENVIO'));\r\n $showLabelButton = true;\r\n $output .= $this->displayConfirmation($this->l('Label has been created.'));\r\n }\r\n\r\n $delivery = new Address((int) $order->id_address_delivery);\r\n $messageList = Message::getMessagesByOrderId((int) $order->id);\r\n\r\n $config = $this->getTipsaConfiguration();\r\n\r\n $this->context->smarty->assign(\r\n array(\r\n 'TIPSA_CODAGE' => $config['tipsa_codage'],\r\n 'TIPSA_CODCLI' => $config['tipsa_codcli'],\r\n 'base_url' => _PS_BASE_URL_ . __PS_BASE_URI__,\r\n 'module_name' => $this->name,\r\n 'TIPSACARRIER_ID_ENVIO' => (int) Db::getInstance()->getValue('SELECT `id_envio` FROM `' . _DB_PREFIX_ . 'tipsa_envios` WHERE `id_envio_order` = ' . (int) $order->id),\r\n 'TIPSACARRIER_PACKAGES' => (int) Db::getInstance()->getValue('SELECT `bultos` FROM `' . _DB_PREFIX_ . 'tipsa_envios` WHERE `id_envio_order` = ' . (int) $order->id),\r\n 'ps_version' => _PS_VERSION_,\r\n 'showLabelButton' => !$showLabelButton,\r\n 'linkLabel' => $linkLabel,\r\n 'TIPSACARRIER_REFERENCE' => $order->reference,\r\n 'TIPSACARRIER_SHOPNAME' => Configuration::get('PS_SHOP_NAME'),\r\n 'TIPSACARRIER_SHOPPHONE' => Configuration::get('PS_SHOP_PHONE'),\r\n 'TIPSACARRIER_CP' => Configuration::get('PS_SHOP_CODE'),\r\n 'TIPSACARRIER_CITY' => Configuration::get('PS_SHOP_CITY'),\r\n 'TIPSACARRIER_ADDRESS' => Configuration::get('PS_SHOP_ADDR1'),\r\n 'TIPSACARRIER_ORDER_COMMENTS' => (isset($messageList['0']) && $messageList['0']['id_customer'] > 0) ? $messageList['0']['message'] : '',\r\n 'TIPSACARRIER_DEST_CONTACT_INFO' => $delivery->firstname . ' ' . $delivery->lastname,\r\n 'TIPSACARRIER_DEST_PHONE' => $delivery->phone . ' - ' . $delivery->phone_mobile,\r\n 'TIPSACARRIER_DEST_CP' => $delivery->postcode,\r\n 'TIPSACARRIER_DEST_CITY' => $delivery->city,\r\n 'TIPSACARRIER_DEST_ADDRESS' => $delivery->address1,\r\n 'TIPSACARRIER_DEST_COD' => $contrarreembolso,\r\n 'TIPSA_CODAGE_YP' => $codageyp,\r\n 'TIPSACARRIER_ORDER_COMMENTS_CARRIER' => Db::getInstance()->getValue('SELECT `observation` FROM `' . _DB_PREFIX_ . 'tipsa_envios` WHERE `id_envio_order` = ' . (int) $order->id),\r\n )\r\n );\r\n $output .= $this->display(__FILE__, 'views/templates/admin/orders_confirmation.tpl');\r\n }\r\n return $output;\r\n }", "public function orderSuccess() {\n //\n return view('product.notify',[\n \n ]);\n }", "public function display_account_orders( ){\n\t\tif( $this->is_page_visible( \"orders\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_orders.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_orders.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_orders.php' );\n\t\t}\n\t}", "function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}" ]
[ "0.7468301", "0.73247045", "0.6828955", "0.6759842", "0.67215604", "0.66631645", "0.66513056", "0.6542252", "0.65214217", "0.6513991", "0.64891934", "0.6488919", "0.64647716", "0.6400064", "0.63607323", "0.63209456", "0.6304609", "0.6293105", "0.6284362", "0.6266437", "0.6257834", "0.6196972", "0.61497813", "0.6149256", "0.6113151", "0.60935473", "0.60910153", "0.6055367", "0.60475284", "0.59281784" ]
0.7667244
0
Returns whether or not the menu is available for anonymous users
public function isMenuAvailableAnonymously() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "public static function canDisplayAttorneysMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ATTORNEY);\n\t}", "function visible () {\n\t\treturn isadmin();\n\t}", "protected function viewMenu(){\n\t\t$userStatus = $_SESSION[\"user_status\"];\n\t\t\n\t\t// menus\n\t\t$menu = false;\n\t\tif ($userStatus > 2){\n\t\t\t$menu = true;\n\t\t}\n\t\treturn $menu;\n\t}", "public function has_menu()\r\n {\r\n return false;\r\n }", "public function isAvailableForUser()\n {\n $c_user = fx::user();\n $ib_visibility = isset($this['scope']['visibility']) ? $this['scope']['visibility'] : null;\n if (!$ib_visibility || $ib_visibility === 'all') {\n return true;\n }\n if ($ib_visibility === 'nobody') {\n return false;\n }\n if ($ib_visibility === 'admin' && !$c_user->isAdmin()) {\n return false;\n }\n if ($ib_visibility === 'user' && $c_user->isGuest()) {\n return false;\n }\n if ($ib_visibility === 'guest' && !$c_user->isGuest()) {\n return false;\n }\n return true;\n }", "public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "public function isCurrentlyLoggedIn() {}", "public function isLoggedIn(): bool\n {\n return $this->getRights() > self::GUEST;\n }", "function AllowAnonymousUser() {\n\t\tswitch (EW_PAGE_ID) {\n\t\t\tcase \"add\":\n\t\t\tcase \"register\":\n\t\t\tcase \"addopt\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"edit\":\n\t\t\tcase \"update\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"delete\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"view\":\n\t\t\t\treturn FALSE;\n\t\t\tcase \"search\":\n\t\t\t\treturn FALSE;\n\t\t\tdefault:\n\t\t\t\treturn FALSE;\n\t\t}\n\t}", "function isAuthorized_menu($strUsers, $strGroups, $UserName, $UserGroup) { \n // For security, start by assuming the visitor is NOT authorized. \n $isValid = False; \n\n // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. \n // Therefore, we know that a user is NOT logged in if that Session variable is blank. \n if (!empty($UserName)) { \n // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. \n // Parse the strings into arrays. \n $arrUsers = Explode(\",\", $strUsers); \n $arrGroups = Explode(\",\", $strGroups); \n if (in_array($UserName, $arrUsers)) { \n $isValid = true; \n } \n // Or, you may restrict access to only certain users based on their username. \n if (in_array($UserGroup, $arrGroups)) { \n $isValid = true; \n } \n if (($strUsers == \"\") && true) { \n $isValid = true; \n } \n } \n return $isValid; \n}", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "public static function show(){\n return Auth::check() && Auth::user()->isAdmin();\n }", "private function showAdminMenu() : bool\n {\n return \\apply_filters(self::FILTER_SHOW_ADMIN_MENU, true) === true;\n }", "public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }", "protected function _canShowForUnregisteredUsers()\n {\n return $this->_objectManager->get(\n \\Magento\\Customer\\Model\\Session::class\n )->isLoggedIn() || $this->getRequest()->getActionName() == 'index' || $this->_objectManager->get(\n \\Magento\\Checkout\\Helper\\Data::class\n )->isAllowedGuestCheckout(\n $this->getOnepage()->getQuote()\n ) || !$this->_objectManager->get(\n \\Magento\\Checkout\\Helper\\Data::class\n )->isCustomerMustBeLogged();\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "public function getIsLoggedIn()\n {\n return !$this->getIsGuest();\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "public function should_display_sandwitch_menu() {\n if ($this->page->pagelayout == 'frontpage' || !isloggedin() || isguestuser()) {\n return false;\n }\n return true;\n }", "public static function canDisplayAccountsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ACCOUNT);\n\t}", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "protected function isUserLoggedIn() {}", "protected function isUserLoggedIn() {}" ]
[ "0.7477891", "0.70917064", "0.7042298", "0.7042298", "0.7014701", "0.70025444", "0.6973911", "0.6931351", "0.6844492", "0.6793678", "0.678821", "0.67747253", "0.6774348", "0.6767565", "0.67589927", "0.67247564", "0.6705326", "0.66838944", "0.6675412", "0.66555166", "0.6645197", "0.66421854", "0.6638233", "0.6631367", "0.66245943", "0.66182065", "0.6616873", "0.6593514", "0.6592903", "0.6592903" ]
0.7869106
0
Build control characters array
private static function buildControlCharacters() { for ($i = 0; $i <= 19; ++$i) { if ($i != 9 && $i != 10 && $i != 13) { $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_'; $replace = chr($i); self::$controlCharacters[$find] = $replace; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function buildControlCharacters()\n {\n for ($i = 0; $i <= 31; ++$i) {\n if ($i != 9 && $i != 10 && $i != 13) {\n $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_';\n $replace = chr($i);\n self::$controlCharacters[$find] = $replace;\n }\n }\n }", "public function get_character_patterns_menu() {\n $patterns = array(\n '9' => 'tab',\n '10' => 'new line'\n );\n\n return $patterns;\n }", "public function setCharacters(){\r\n\t\t$chars = array('upper' => $this->upper, 'lower' => $this->lower, 'numbers' => $this->numbers, 'symbols' => $this->symbols);\r\n\t\t//The $char_table may be edited to your liking for more complex password pattern/encryption\r\n\t\t$char_table = array(\r\n\t\t\t'lower' => array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'),\r\n\t\t\t'upper' => array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'),\r\n\t\t\t'numbers' => array('0','1','2','3','4','5','6','7','8','9'),\r\n\t\t\t'symbols' => array(\"!\",\"@\",\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"(\",\")\",\"_\",\"-\",\"+\",\"=\")\r\n\t\t);\r\n\t\t$characters = array();\r\n\t\tforeach ($chars as $key => $value) {\r\n\t\t\tif($value){\r\n\t\t\t\t$characters = array_merge($characters, $char_table[$key]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $characters;\r\n\t}", "public function chars()\n {\n // init\n $chars = array();\n $l = $this->length();\n\n for ($i = 0; $i < $l; $i++) {\n $chars[] = $this->at($i)->str;\n }\n\n return $chars;\n }", "protected function _getCharCodesTable() {}", "protected function _getCharCodesTable() {}", "protected static function charsArray(): array\n {\n static $charsArray;\n\n if (isset($charsArray)) {\n return $charsArray;\n }\n\n return $charsArray = [\n '0' => ['°', '₀', '۰', '0'],\n '1' => ['¹', '₁', '۱', '1'],\n '2' => ['²', '₂', '۲', '2'],\n '3' => ['³', '₃', '۳', '3'],\n '4' => ['⁴', '₄', '۴', '٤', '4'],\n '5' => ['⁵', '₅', '۵', '٥', '5'],\n '6' => ['⁶', '₆', '۶', '٦', '6'],\n '7' => ['⁷', '₇', '۷', '7'],\n '8' => ['⁸', '₈', '۸', '8'],\n '9' => ['⁹', '₉', '۹', '9'],\n 'a' => [\n 'à',\n 'á',\n 'ả',\n 'ã',\n 'ạ',\n 'ă',\n 'ắ',\n 'ằ',\n 'ẳ',\n 'ẵ',\n 'ặ',\n 'â',\n 'ấ',\n 'ầ',\n 'ẩ',\n 'ẫ',\n 'ậ',\n 'ā',\n 'ą',\n 'å',\n 'α',\n 'ά',\n 'ἀ',\n 'ἁ',\n 'ἂ',\n 'ἃ',\n 'ἄ',\n 'ἅ',\n 'ἆ',\n 'ἇ',\n 'ᾀ',\n 'ᾁ',\n 'ᾂ',\n 'ᾃ',\n 'ᾄ',\n 'ᾅ',\n 'ᾆ',\n 'ᾇ',\n 'ὰ',\n 'ά',\n 'ᾰ',\n 'ᾱ',\n 'ᾲ',\n 'ᾳ',\n 'ᾴ',\n 'ᾶ',\n 'ᾷ',\n 'а',\n 'أ',\n 'အ',\n 'ာ',\n 'ါ',\n 'ǻ',\n 'ǎ',\n 'ª',\n 'ა',\n 'अ',\n 'ا',\n 'a',\n 'ä',\n ],\n 'b' => ['б', 'β', 'ب', 'ဗ', 'ბ', 'b'],\n 'c' => ['ç', 'ć', 'č', 'ĉ', 'ċ', 'c'],\n 'd' => ['ď', 'ð', 'đ', 'ƌ', 'ȡ', 'ɖ', 'ɗ', 'ᵭ', 'ᶁ', 'ᶑ', 'д', 'δ', 'د', 'ض', 'ဍ', 'ဒ', 'დ', 'd'],\n 'e' => [\n 'é',\n 'è',\n 'ẻ',\n 'ẽ',\n 'ẹ',\n 'ê',\n 'ế',\n 'ề',\n 'ể',\n 'ễ',\n 'ệ',\n 'ë',\n 'ē',\n 'ę',\n 'ě',\n 'ĕ',\n 'ė',\n 'ε',\n 'έ',\n 'ἐ',\n 'ἑ',\n 'ἒ',\n 'ἓ',\n 'ἔ',\n 'ἕ',\n 'ὲ',\n 'έ',\n 'е',\n 'ё',\n 'э',\n 'є',\n 'ə',\n 'ဧ',\n 'ေ',\n 'ဲ',\n 'ე',\n 'ए',\n 'إ',\n 'ئ',\n 'e',\n ],\n 'f' => ['ф', 'φ', 'ف', 'ƒ', 'ფ', 'f'],\n 'g' => ['ĝ', 'ğ', 'ġ', 'ģ', 'г', 'ґ', 'γ', 'ဂ', 'გ', 'گ', 'g'],\n 'h' => ['ĥ', 'ħ', 'η', 'ή', 'ح', 'ه', 'ဟ', 'ှ', 'ჰ', 'h'],\n 'i' => [\n 'í',\n 'ì',\n 'ỉ',\n 'ĩ',\n 'ị',\n 'î',\n 'ï',\n 'ī',\n 'ĭ',\n 'į',\n 'ı',\n 'ι',\n 'ί',\n 'ϊ',\n 'ΐ',\n 'ἰ',\n 'ἱ',\n 'ἲ',\n 'ἳ',\n 'ἴ',\n 'ἵ',\n 'ἶ',\n 'ἷ',\n 'ὶ',\n 'ί',\n 'ῐ',\n 'ῑ',\n 'ῒ',\n 'ΐ',\n 'ῖ',\n 'ῗ',\n 'і',\n 'ї',\n 'и',\n 'ဣ',\n 'ိ',\n 'ီ',\n 'ည်',\n 'ǐ',\n 'ი',\n 'इ',\n 'ی',\n 'i',\n ],\n 'j' => ['ĵ', 'ј', 'Ј', 'ჯ', 'ج', 'j'],\n 'k' => ['ķ', 'ĸ', 'к', 'κ', 'Ķ', 'ق', 'ك', 'က', 'კ', 'ქ', 'ک', 'k'],\n 'l' => ['ł', 'ľ', 'ĺ', 'ļ', 'ŀ', 'л', 'λ', 'ل', 'လ', 'ლ', 'l'],\n 'm' => ['м', 'μ', 'م', 'မ', 'მ', 'm'],\n 'n' => ['ñ', 'ń', 'ň', 'ņ', 'ʼn', 'ŋ', 'ν', 'н', 'ن', 'န', 'ნ', 'n'],\n 'o' => [\n 'ó',\n 'ò',\n 'ỏ',\n 'õ',\n 'ọ',\n 'ô',\n 'ố',\n 'ồ',\n 'ổ',\n 'ỗ',\n 'ộ',\n 'ơ',\n 'ớ',\n 'ờ',\n 'ở',\n 'ỡ',\n 'ợ',\n 'ø',\n 'ō',\n 'ő',\n 'ŏ',\n 'ο',\n 'ὀ',\n 'ὁ',\n 'ὂ',\n 'ὃ',\n 'ὄ',\n 'ὅ',\n 'ὸ',\n 'ό',\n 'о',\n 'و',\n 'θ',\n 'ို',\n 'ǒ',\n 'ǿ',\n 'º',\n 'ო',\n 'ओ',\n 'o',\n 'ö',\n ],\n 'p' => ['п', 'π', 'ပ', 'პ', 'پ', 'p'],\n 'q' => ['ყ', 'q'],\n 'r' => ['ŕ', 'ř', 'ŗ', 'р', 'ρ', 'ر', 'რ', 'r'],\n 's' => ['ś', 'š', 'ş', 'с', 'σ', 'ș', 'ς', 'س', 'ص', 'စ', 'ſ', 'ს', 's'],\n 't' => ['ť', 'ţ', 'т', 'τ', 'ț', 'ت', 'ط', 'ဋ', 'တ', 'ŧ', 'თ', 'ტ', 't'],\n 'u' => [\n 'ú',\n 'ù',\n 'ủ',\n 'ũ',\n 'ụ',\n 'ư',\n 'ứ',\n 'ừ',\n 'ử',\n 'ữ',\n 'ự',\n 'û',\n 'ū',\n 'ů',\n 'ű',\n 'ŭ',\n 'ų',\n 'µ',\n 'у',\n 'ဉ',\n 'ု',\n 'ူ',\n 'ǔ',\n 'ǖ',\n 'ǘ',\n 'ǚ',\n 'ǜ',\n 'უ',\n 'उ',\n 'u',\n 'ў',\n 'ü',\n ],\n 'v' => ['в', 'ვ', 'ϐ', 'v'],\n 'w' => ['ŵ', 'ω', 'ώ', 'ဝ', 'ွ', 'w'],\n 'x' => ['χ', 'ξ', 'x'],\n 'y' => ['ý', 'ỳ', 'ỷ', 'ỹ', 'ỵ', 'ÿ', 'ŷ', 'й', 'ы', 'υ', 'ϋ', 'ύ', 'ΰ', 'ي', 'ယ', 'y'],\n 'z' => ['ź', 'ž', 'ż', 'з', 'ζ', 'ز', 'ဇ', 'ზ', 'z'],\n 'aa' => ['ع', 'आ', 'آ'],\n 'ae' => ['æ', 'ǽ'],\n 'ai' => ['ऐ'],\n 'ch' => ['ч', 'ჩ', 'ჭ', 'چ'],\n 'dj' => ['ђ', 'đ'],\n 'dz' => ['џ', 'ძ'],\n 'ei' => ['ऍ'],\n 'gh' => ['غ', 'ღ'],\n 'ii' => ['ई'],\n 'ij' => ['ij'],\n 'kh' => ['х', 'خ', 'ხ'],\n 'lj' => ['љ'],\n 'nj' => ['њ'],\n 'oe' => ['ö', 'œ', 'ؤ'],\n 'oi' => ['ऑ'],\n 'oii' => ['ऒ'],\n 'ps' => ['ψ'],\n 'sh' => ['ш', 'შ', 'ش'],\n 'shch' => ['щ'],\n 'ss' => ['ß'],\n 'sx' => ['ŝ'],\n 'th' => ['þ', 'ϑ', 'ث', 'ذ', 'ظ'],\n 'ts' => ['ц', 'ც', 'წ'],\n 'ue' => ['ü'],\n 'uu' => ['ऊ'],\n 'ya' => ['я'],\n 'yu' => ['ю'],\n 'zh' => ['ж', 'ჟ', 'ژ'],\n '(c)' => ['©'],\n 'A' => [\n 'Á',\n 'À',\n 'Ả',\n 'Ã',\n 'Ạ',\n 'Ă',\n 'Ắ',\n 'Ằ',\n 'Ẳ',\n 'Ẵ',\n 'Ặ',\n 'Â',\n 'Ấ',\n 'Ầ',\n 'Ẩ',\n 'Ẫ',\n 'Ậ',\n 'Å',\n 'Ā',\n 'Ą',\n 'Α',\n 'Ά',\n 'Ἀ',\n 'Ἁ',\n 'Ἂ',\n 'Ἃ',\n 'Ἄ',\n 'Ἅ',\n 'Ἆ',\n 'Ἇ',\n 'ᾈ',\n 'ᾉ',\n 'ᾊ',\n 'ᾋ',\n 'ᾌ',\n 'ᾍ',\n 'ᾎ',\n 'ᾏ',\n 'Ᾰ',\n 'Ᾱ',\n 'Ὰ',\n 'Ά',\n 'ᾼ',\n 'А',\n 'Ǻ',\n 'Ǎ',\n 'A',\n 'Ä',\n ],\n 'B' => ['Б', 'Β', 'ब', 'B'],\n 'C' => ['Ç', 'Ć', 'Č', 'Ĉ', 'Ċ', 'C'],\n 'D' => ['Ď', 'Ð', 'Đ', 'Ɖ', 'Ɗ', 'Ƌ', 'ᴅ', 'ᴆ', 'Д', 'Δ', 'D'],\n 'E' => [\n 'É',\n 'È',\n 'Ẻ',\n 'Ẽ',\n 'Ẹ',\n 'Ê',\n 'Ế',\n 'Ề',\n 'Ể',\n 'Ễ',\n 'Ệ',\n 'Ë',\n 'Ē',\n 'Ę',\n 'Ě',\n 'Ĕ',\n 'Ė',\n 'Ε',\n 'Έ',\n 'Ἐ',\n 'Ἑ',\n 'Ἒ',\n 'Ἓ',\n 'Ἔ',\n 'Ἕ',\n 'Έ',\n 'Ὲ',\n 'Е',\n 'Ё',\n 'Э',\n 'Є',\n 'Ə',\n 'E',\n ],\n 'F' => ['Ф', 'Φ', 'F'],\n 'G' => ['Ğ', 'Ġ', 'Ģ', 'Г', 'Ґ', 'Γ', 'G'],\n 'H' => ['Η', 'Ή', 'Ħ', 'H'],\n 'I' => [\n 'Í',\n 'Ì',\n 'Ỉ',\n 'Ĩ',\n 'Ị',\n 'Î',\n 'Ï',\n 'Ī',\n 'Ĭ',\n 'Į',\n 'İ',\n 'Ι',\n 'Ί',\n 'Ϊ',\n 'Ἰ',\n 'Ἱ',\n 'Ἳ',\n 'Ἴ',\n 'Ἵ',\n 'Ἶ',\n 'Ἷ',\n 'Ῐ',\n 'Ῑ',\n 'Ὶ',\n 'Ί',\n 'И',\n 'І',\n 'Ї',\n 'Ǐ',\n 'ϒ',\n 'I',\n ],\n 'J' => ['J'],\n 'K' => ['К', 'Κ', 'K'],\n 'L' => ['Ĺ', 'Ł', 'Л', 'Λ', 'Ļ', 'Ľ', 'Ŀ', 'ल', 'L'],\n 'M' => ['М', 'Μ', 'M'],\n 'N' => ['Ń', 'Ñ', 'Ň', 'Ņ', 'Ŋ', 'Н', 'Ν', 'N'],\n 'O' => [\n 'Ó',\n 'Ò',\n 'Ỏ',\n 'Õ',\n 'Ọ',\n 'Ô',\n 'Ố',\n 'Ồ',\n 'Ổ',\n 'Ỗ',\n 'Ộ',\n 'Ơ',\n 'Ớ',\n 'Ờ',\n 'Ở',\n 'Ỡ',\n 'Ợ',\n 'Ø',\n 'Ō',\n 'Ő',\n 'Ŏ',\n 'Ο',\n 'Ό',\n 'Ὀ',\n 'Ὁ',\n 'Ὂ',\n 'Ὃ',\n 'Ὄ',\n 'Ὅ',\n 'Ὸ',\n 'Ό',\n 'О',\n 'Θ',\n 'Ө',\n 'Ǒ',\n 'Ǿ',\n 'O',\n 'Ö',\n ],\n 'P' => ['П', 'Π', 'P'],\n 'Q' => ['Q'],\n 'R' => ['Ř', 'Ŕ', 'Р', 'Ρ', 'Ŗ', 'R'],\n 'S' => ['Ş', 'Ŝ', 'Ș', 'Š', 'Ś', 'С', 'Σ', 'S'],\n 'T' => ['Ť', 'Ţ', 'Ŧ', 'Ț', 'Т', 'Τ', 'T'],\n 'U' => [\n 'Ú',\n 'Ù',\n 'Ủ',\n 'Ũ',\n 'Ụ',\n 'Ư',\n 'Ứ',\n 'Ừ',\n 'Ử',\n 'Ữ',\n 'Ự',\n 'Û',\n 'Ū',\n 'Ů',\n 'Ű',\n 'Ŭ',\n 'Ų',\n 'У',\n 'Ǔ',\n 'Ǖ',\n 'Ǘ',\n 'Ǚ',\n 'Ǜ',\n 'U',\n 'Ў',\n 'Ü',\n ],\n 'V' => ['В', 'V'],\n 'W' => ['Ω', 'Ώ', 'Ŵ', 'W'],\n 'X' => ['Χ', 'Ξ', 'X'],\n 'Y' => ['Ý', 'Ỳ', 'Ỷ', 'Ỹ', 'Ỵ', 'Ÿ', 'Ῠ', 'Ῡ', 'Ὺ', 'Ύ', 'Ы', 'Й', 'Υ', 'Ϋ', 'Ŷ', 'Y'],\n 'Z' => ['Ź', 'Ž', 'Ż', 'З', 'Ζ', 'Z'],\n 'AE' => ['Æ', 'Ǽ'],\n 'Ch' => ['Ч'],\n 'Dj' => ['Ђ'],\n 'Dz' => ['Џ'],\n 'Gx' => ['Ĝ'],\n 'Hx' => ['Ĥ'],\n 'Ij' => ['IJ'],\n 'Jx' => ['Ĵ'],\n 'Kh' => ['Х'],\n 'Lj' => ['Љ'],\n 'Nj' => ['Њ'],\n 'Oe' => ['Œ'],\n 'Ps' => ['Ψ'],\n 'Sh' => ['Ш'],\n 'Shch' => ['Щ'],\n 'Ss' => ['ẞ'],\n 'Th' => ['Þ'],\n 'Ts' => ['Ц'],\n 'Ya' => ['Я'],\n 'Yu' => ['Ю'],\n 'Zh' => ['Ж'],\n ' ' => [\n \"\\xC2\\xA0\",\n \"\\xE2\\x80\\x80\",\n \"\\xE2\\x80\\x81\",\n \"\\xE2\\x80\\x82\",\n \"\\xE2\\x80\\x83\",\n \"\\xE2\\x80\\x84\",\n \"\\xE2\\x80\\x85\",\n \"\\xE2\\x80\\x86\",\n \"\\xE2\\x80\\x87\",\n \"\\xE2\\x80\\x88\",\n \"\\xE2\\x80\\x89\",\n \"\\xE2\\x80\\x8A\",\n \"\\xE2\\x80\\xAF\",\n \"\\xE2\\x81\\x9F\",\n \"\\xE3\\x80\\x80\",\n \"\\xEF\\xBE\\xA0\",\n ],\n ];\n }", "private function escapes() {\n return [\n ['r', \"\\x0d\"],\n ['n', \"\\x0a\"],\n ['t', \"\\x09\"],\n ['b', \"\\x08\"],\n ['f', \"\\x0c\"],\n ['\\\\', \"\\x5c\"]\n ];\n }", "public function getControlCharacters(?string $type = null): array\n {\n $defaults = self::getControlCharactersDefault();\n $characters = self::getControlCharactersDefault();\n\n if (! is_null($type)) {\n throw_if(! array_key_exists($type, $characters),\n 'Control characters do not exist for $type: \"'.(empty($type) ? '(empty)' : $type).'\".');\n\n return $characters[$type];\n }\n\n return $characters;\n }", "public function getCharKeys()\n {\n return array_fill_keys(array_values($this->bidiordarr), true);\n }", "public function getRegisteredChars() {}", "private static function buildSYLKCharacters()\n {\n self::$SYLKCharacters = array(\n \"\\x1B 0\" => chr(0),\n \"\\x1B 1\" => chr(1),\n \"\\x1B 2\" => chr(2),\n \"\\x1B 3\" => chr(3),\n \"\\x1B 4\" => chr(4),\n \"\\x1B 5\" => chr(5),\n \"\\x1B 6\" => chr(6),\n \"\\x1B 7\" => chr(7),\n \"\\x1B 8\" => chr(8),\n \"\\x1B 9\" => chr(9),\n \"\\x1B :\" => chr(10),\n \"\\x1B ;\" => chr(11),\n \"\\x1B <\" => chr(12),\n \"\\x1B :\" => chr(13),\n \"\\x1B >\" => chr(14),\n \"\\x1B ?\" => chr(15),\n \"\\x1B!0\" => chr(16),\n \"\\x1B!1\" => chr(17),\n \"\\x1B!2\" => chr(18),\n \"\\x1B!3\" => chr(19),\n \"\\x1B!4\" => chr(20),\n \"\\x1B!5\" => chr(21),\n \"\\x1B!6\" => chr(22),\n \"\\x1B!7\" => chr(23),\n \"\\x1B!8\" => chr(24),\n \"\\x1B!9\" => chr(25),\n \"\\x1B!:\" => chr(26),\n \"\\x1B!;\" => chr(27),\n \"\\x1B!<\" => chr(28),\n \"\\x1B!=\" => chr(29),\n \"\\x1B!>\" => chr(30),\n \"\\x1B!?\" => chr(31),\n \"\\x1B'?\" => chr(127),\n \"\\x1B(0\" => '€', // 128 in CP1252\n \"\\x1B(2\" => '‚', // 130 in CP1252\n \"\\x1B(3\" => 'ƒ', // 131 in CP1252\n \"\\x1B(4\" => '„', // 132 in CP1252\n \"\\x1B(5\" => '…', // 133 in CP1252\n \"\\x1B(6\" => '†', // 134 in CP1252\n \"\\x1B(7\" => '‡', // 135 in CP1252\n \"\\x1B(8\" => 'ˆ', // 136 in CP1252\n \"\\x1B(9\" => '‰', // 137 in CP1252\n \"\\x1B(:\" => 'Š', // 138 in CP1252\n \"\\x1B(;\" => '‹', // 139 in CP1252\n \"\\x1BNj\" => 'Œ', // 140 in CP1252\n \"\\x1B(>\" => 'Ž', // 142 in CP1252\n \"\\x1B)1\" => '‘', // 145 in CP1252\n \"\\x1B)2\" => '’', // 146 in CP1252\n \"\\x1B)3\" => '“', // 147 in CP1252\n \"\\x1B)4\" => '”', // 148 in CP1252\n \"\\x1B)5\" => '•', // 149 in CP1252\n \"\\x1B)6\" => '–', // 150 in CP1252\n \"\\x1B)7\" => '—', // 151 in CP1252\n \"\\x1B)8\" => '˜', // 152 in CP1252\n \"\\x1B)9\" => '™', // 153 in CP1252\n \"\\x1B):\" => 'š', // 154 in CP1252\n \"\\x1B);\" => '›', // 155 in CP1252\n \"\\x1BNz\" => 'œ', // 156 in CP1252\n \"\\x1B)>\" => 'ž', // 158 in CP1252\n \"\\x1B)?\" => 'Ÿ', // 159 in CP1252\n \"\\x1B*0\" => ' ', // 160 in CP1252\n \"\\x1BN!\" => '¡', // 161 in CP1252\n \"\\x1BN\\\"\" => '¢', // 162 in CP1252\n \"\\x1BN#\" => '£', // 163 in CP1252\n \"\\x1BN(\" => '¤', // 164 in CP1252\n \"\\x1BN%\" => '¥', // 165 in CP1252\n \"\\x1B*6\" => '¦', // 166 in CP1252\n \"\\x1BN'\" => '§', // 167 in CP1252\n \"\\x1BNH \" => '¨', // 168 in CP1252\n \"\\x1BNS\" => '©', // 169 in CP1252\n \"\\x1BNc\" => 'ª', // 170 in CP1252\n \"\\x1BN+\" => '«', // 171 in CP1252\n \"\\x1B*<\" => '¬', // 172 in CP1252\n \"\\x1B*=\" => '­', // 173 in CP1252\n \"\\x1BNR\" => '®', // 174 in CP1252\n \"\\x1B*?\" => '¯', // 175 in CP1252\n \"\\x1BN0\" => '°', // 176 in CP1252\n \"\\x1BN1\" => '±', // 177 in CP1252\n \"\\x1BN2\" => '²', // 178 in CP1252\n \"\\x1BN3\" => '³', // 179 in CP1252\n \"\\x1BNB \" => '´', // 180 in CP1252\n \"\\x1BN5\" => 'µ', // 181 in CP1252\n \"\\x1BN6\" => '¶', // 182 in CP1252\n \"\\x1BN7\" => '·', // 183 in CP1252\n \"\\x1B+8\" => '¸', // 184 in CP1252\n \"\\x1BNQ\" => '¹', // 185 in CP1252\n \"\\x1BNk\" => 'º', // 186 in CP1252\n \"\\x1BN;\" => '»', // 187 in CP1252\n \"\\x1BN<\" => '¼', // 188 in CP1252\n \"\\x1BN=\" => '½', // 189 in CP1252\n \"\\x1BN>\" => '¾', // 190 in CP1252\n \"\\x1BN?\" => '¿', // 191 in CP1252\n \"\\x1BNAA\" => 'À', // 192 in CP1252\n \"\\x1BNBA\" => 'Á', // 193 in CP1252\n \"\\x1BNCA\" => 'Â', // 194 in CP1252\n \"\\x1BNDA\" => 'Ã', // 195 in CP1252\n \"\\x1BNHA\" => 'Ä', // 196 in CP1252\n \"\\x1BNJA\" => 'Å', // 197 in CP1252\n \"\\x1BNa\" => 'Æ', // 198 in CP1252\n \"\\x1BNKC\" => 'Ç', // 199 in CP1252\n \"\\x1BNAE\" => 'È', // 200 in CP1252\n \"\\x1BNBE\" => 'É', // 201 in CP1252\n \"\\x1BNCE\" => 'Ê', // 202 in CP1252\n \"\\x1BNHE\" => 'Ë', // 203 in CP1252\n \"\\x1BNAI\" => 'Ì', // 204 in CP1252\n \"\\x1BNBI\" => 'Í', // 205 in CP1252\n \"\\x1BNCI\" => 'Î', // 206 in CP1252\n \"\\x1BNHI\" => 'Ï', // 207 in CP1252\n \"\\x1BNb\" => 'Ð', // 208 in CP1252\n \"\\x1BNDN\" => 'Ñ', // 209 in CP1252\n \"\\x1BNAO\" => 'Ò', // 210 in CP1252\n \"\\x1BNBO\" => 'Ó', // 211 in CP1252\n \"\\x1BNCO\" => 'Ô', // 212 in CP1252\n \"\\x1BNDO\" => 'Õ', // 213 in CP1252\n \"\\x1BNHO\" => 'Ö', // 214 in CP1252\n \"\\x1B-7\" => '×', // 215 in CP1252\n \"\\x1BNi\" => 'Ø', // 216 in CP1252\n \"\\x1BNAU\" => 'Ù', // 217 in CP1252\n \"\\x1BNBU\" => 'Ú', // 218 in CP1252\n \"\\x1BNCU\" => 'Û', // 219 in CP1252\n \"\\x1BNHU\" => 'Ü', // 220 in CP1252\n \"\\x1B-=\" => 'Ý', // 221 in CP1252\n \"\\x1BNl\" => 'Þ', // 222 in CP1252\n \"\\x1BN{\" => 'ß', // 223 in CP1252\n \"\\x1BNAa\" => 'à', // 224 in CP1252\n \"\\x1BNBa\" => 'á', // 225 in CP1252\n \"\\x1BNCa\" => 'â', // 226 in CP1252\n \"\\x1BNDa\" => 'ã', // 227 in CP1252\n \"\\x1BNHa\" => 'ä', // 228 in CP1252\n \"\\x1BNJa\" => 'å', // 229 in CP1252\n \"\\x1BNq\" => 'æ', // 230 in CP1252\n \"\\x1BNKc\" => 'ç', // 231 in CP1252\n \"\\x1BNAe\" => 'è', // 232 in CP1252\n \"\\x1BNBe\" => 'é', // 233 in CP1252\n \"\\x1BNCe\" => 'ê', // 234 in CP1252\n \"\\x1BNHe\" => 'ë', // 235 in CP1252\n \"\\x1BNAi\" => 'ì', // 236 in CP1252\n \"\\x1BNBi\" => 'í', // 237 in CP1252\n \"\\x1BNCi\" => 'î', // 238 in CP1252\n \"\\x1BNHi\" => 'ï', // 239 in CP1252\n \"\\x1BNs\" => 'ð', // 240 in CP1252\n \"\\x1BNDn\" => 'ñ', // 241 in CP1252\n \"\\x1BNAo\" => 'ò', // 242 in CP1252\n \"\\x1BNBo\" => 'ó', // 243 in CP1252\n \"\\x1BNCo\" => 'ô', // 244 in CP1252\n \"\\x1BNDo\" => 'õ', // 245 in CP1252\n \"\\x1BNHo\" => 'ö', // 246 in CP1252\n \"\\x1B/7\" => '÷', // 247 in CP1252\n \"\\x1BNy\" => 'ø', // 248 in CP1252\n \"\\x1BNAu\" => 'ù', // 249 in CP1252\n \"\\x1BNBu\" => 'ú', // 250 in CP1252\n \"\\x1BNCu\" => 'û', // 251 in CP1252\n \"\\x1BNHu\" => 'ü', // 252 in CP1252\n \"\\x1B/=\" => 'ý', // 253 in CP1252\n \"\\x1BN|\" => 'þ', // 254 in CP1252\n \"\\x1BNHy\" => 'ÿ', // 255 in CP1252\n );\n }", "public function getCharsByCharCodes($charCodes, $encoding = 'UTF-8', $asArray = true) {}", "abstract protected function _getCharCodesTable();", "public function getCharsByCharCodes($charCodes, $encoding = 'UTF-8', $asArray = true) {}", "public function getCharsByCharCodes($charCodes, $encoding = 'UTF-8', $asArray = true) {}", "static function getCharacters()\n {\n return '\\x{00E5}\\x{00E4}\\x{00F6}';\n }", "private static function base32LookupTable() : array\n {\n return [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7\n 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23\n 'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31\n '=' // padding char\n ];\n }", "function chars($options = array()){\n\t\t$options += array(\n\t\t\t\"stringify\" => false,\n\t\t);\n\n\t\tif($this->length()===0){ return array(); }\n\n\t\t$u = $this->getEncoding(true)===\"utf8\" ? \"u\" : \"\";\n\t\t$chars = preg_split(\"//s$u\",$this->_String4,-1,PREG_SPLIT_NO_EMPTY);\n\t\tif($chars === false){\n\t\t\t$chars = str_split($this->_String4);\n\t\t}\n\n\t\tif($options[\"stringify\"]){\n\t\t\treturn $chars;\n\t\t}\n\n\t\t$out = array();\n\t\tforeach($chars as $ch){\n\t\t\t$out[] = $this->_copy($ch);\n\t\t}\n\t\treturn $out;\n\t}", "public static function ascii() {}", "public function constructData()\n\t{\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tarray('lineend' => \"\\12\"),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t\t'language' => 'en-gb',\n\t\t\t\t\t'direction' => 'ltr',\n\t\t\t\t\t'tab' => \"\\11\",\n\t\t\t\t\t'link' => '',\n\t\t\t\t\t'base' => ''\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('charset' => \"euc-jp\", 'mediaversion' => '1a2b3c4d'),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'euc-jp',\n\t\t\t\t\t'language' => 'en-gb',\n\t\t\t\t\t'direction' => 'ltr',\n\t\t\t\t\t'tab' => \"\\11\",\n\t\t\t\t\t'link' => '',\n\t\t\t\t\t'base' => '',\n\t\t\t\t 'mediaversion' => '1a2b3c4d'\n\t\t\t\t)\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tarray('language' => \"de-de\", 'direction' => 'rtl',\n\t\t\t\t\t'tab' => 'Crazy Tab', 'link' => 'http://joomla.org',\n\t\t\t\t\t'base' => 'http://base.joomla.org/dir'),\n\t\t\t\tarray(\n\t\t\t\t\t'lineend' => \"\\12\",\n\t\t\t\t\t'charset' => 'utf-8',\n\t\t\t\t\t'language' => 'de-de',\n\t\t\t\t\t'direction' => 'rtl',\n\t\t\t\t\t'tab' => \"Crazy Tab\",\n\t\t\t\t\t'link' => 'http://joomla.org',\n\t\t\t\t\t'base' => 'http://base.joomla.org/dir'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}", "private function generateAlphabet(){\n $letters = array();\n $letter = 'A';\n while ($letter !== 'AAA') {\n $letters[] = $letter++;\n }\n return $letters;\n }", "protected function arrayBigLetters(): array\n {\n return ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',\n 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U',\n 'V', 'W', 'X', 'Y', 'Z'];\n }", "public static function chars()\n {\n return self::choose(0, 255)->fmap('chr');\n }", "public static function asciiChars()\n {\n return self::choose(32, 126)->fmap('chr');\n }", "public function setUpCharacterStrings() {}", "function getLettersArray()\n{\n return [\n 'a' => true,\n 'b' => true,\n 'c' => true,\n 'd' => true,\n 'e' => true,\n 'f' => true,\n 'g' => true,\n 'h' => true,\n 'i' => true,\n 'j' => true,\n 'k' => true,\n 'l' => true,\n 'm' => true,\n 'n' => true,\n 'o' => true,\n 'p' => true,\n 'q' => true,\n 'r' => true,\n 's' => true,\n 't' => true,\n 'u' => true,\n 'v' => true,\n 'w' => true,\n 'x' => true,\n 'y' => true,\n 'z' => true,\n ];\n}", "public function charset()\n\t{\n\t\treturn [\n\t\t\t'from' => $this->from,\n\t\t\t'to' => $this->to,\n\t\t];\n\t}", "function getCharacters();", "static function _utf2AsciiMap(): array {\n $map = [];\n foreach (\\hbc\\core\\StrX::charsArray() as $to => $from) {\n foreach ($from as $f) {\n $map[$f] = $to;\n }\n }\n\n return $map;\n }" ]
[ "0.7846227", "0.5800362", "0.5673072", "0.55621445", "0.5498176", "0.5498176", "0.5483436", "0.5453977", "0.5423068", "0.5364919", "0.5325127", "0.5298634", "0.5277191", "0.52769643", "0.5276229", "0.52758384", "0.52731127", "0.52226985", "0.5216911", "0.52038276", "0.51808524", "0.51675093", "0.5148349", "0.51460946", "0.5140236", "0.5128005", "0.510671", "0.50985813", "0.50984275", "0.50510347" ]
0.78220785
1
Convert from PHP control character to OpenXML escaped control character Excel 2007 team: That's correct, control characters are stored directly in the sharedstrings table. We do encode characters that cannot be represented in XML using the following escape sequence: _xHHHH_ where H represents a hexadecimal character in the character's value... So you could end up with something like _x0008_ in a string (either in a cell value () element or in the shared string element.
public static function controlCharacterPHP2OOXML($value = '') { if (empty(self::$controlCharacters)) { self::buildControlCharacters(); } return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function buildControlCharacters()\n {\n for ($i = 0; $i <= 19; ++$i) {\n if ($i != 9 && $i != 10 && $i != 13) {\n $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_';\n $replace = chr($i);\n self::$controlCharacters[$find] = $replace;\n }\n }\n }", "private static function buildControlCharacters()\n {\n for ($i = 0; $i <= 31; ++$i) {\n if ($i != 9 && $i != 10 && $i != 13) {\n $find = '_x' . sprintf('%04s', strtoupper(dechex($i))) . '_';\n $replace = chr($i);\n self::$controlCharacters[$find] = $replace;\n }\n }\n }", "public static function controlCharacterOOXML2PHP($value = '')\n {\n if (empty(self::$controlCharacters)) {\n self::buildControlCharacters();\n }\n\n return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value);\n }", "function xml_special_char($t_data){\n\n if(preg_match(\"/\\\"/\", $t_data)) str_replace(\"\\\"\", \"&quot\", $t_data);\n elseif(preg_match(\"/'/\", $t_data)) str_replace(\"\\'\", \"&quot\", $t_data);\n elseif(preg_match(\"/&/\", $t_data)) str_replace(\"&\", \"&amp\", $t_data);\n elseif(preg_match(\"/</\", $t_data)) str_replace(\"<\", \"&lt\", $t_data);\n elseif(preg_match(\"/>/\", $t_data)) str_replace(\">\", \"&gt\", $t_data);\n\n return $t_data;\n }", "function NCRx_UTF8($str){\n\t\t$len = strlen($str);\n\t\t$result = '';\n\t\t$ln=0;\n\t\tfor($i=0;$i<$len;$i++){\n\t\t\t$n = '';\n\t\t\tif ($str[$i] == '-'){\n\t\t\t\t$k = $i+1;\n\t\t\t\tif ($k < $len && $str[$k] == '-'){\n\t\t\t\t\t$k++;\n\t\t\t\t\twhile ($k < $len && is_numeric($str[$k]))\n\t\t\t\t\t\t$n .= $str[$k++];\n\t\t\t\t\tif ($k < $len && $str[$k]==';')\n\t\t\t\t\t\t$i = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($n!=''){\n\t\t\t\t$n = intval($n);\n\t\t\t\tif ($n==13 || $n==10){\n\t\t\t\t\t$result .= $ln?'':'<br>';\n\t\t\t\t\t$ln = 1;\n\t\t\t\t}elseif ($n<128){\n\t\t\t\t\t$result .= chr($n);\n\t\t\t\t\t$ln = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$s = '';\n\t\t\t\t\t$first = 0;\n\t\t\t\t\t$mask = 0x80;\n\t\t\t\t\twhile ($n>0){\n\t\t\t\t\t\t$byte = $n & 0x3F; //00111111\n\t\t\t\t\t\t$n = $n >> 6;\n\t\t\t\t\t\tif ($n) $s = chr($byte | 0x80).$s;\n\t\t\t\t\t\t$first = $first | $mask;\n\t\t\t\t\t\t$mask = $mask >> 1;\n\t\t\t\t\t}\n\t\t\t\t\t$s = chr($first | $byte).$s;\n\t\t\t\t\t$result .= $s;\n\t\t\t\t\t$ln = 0;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$result .= $str[$i];\n\t\t\t\t$ln = 0;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "function escByteA($binData) {\n\t\t/**\n\t\t* \\134 = 92 = backslash, \\000 = 00 = NULL, \\047 = 39 = Single Quote\n\t\t*\n\t\t* str_replace() replaces the searches array in order.\n\t\t* Therefore, we must\n\t\t* process the 'backslash' character first. If we process it last, it'll\n\t\t* replace all the escaped backslashes from the other searches that came\n\t\t* before. tomATminnesota.com\n\t\t*/\n\t\t$search = array(chr(92), chr(0), chr(39));\n\t\t$replace = array('\\\\\\134', '\\\\\\000', '\\\\\\047');\n\t\t$binData = str_replace($search, $replace, $binData);\n\t\treturn $binData;\n\t}", "public function testEncodeImmuneCharsForXML()\n {\n $immune = array();\n $this->assertEquals(\n 'testTEST0123&#x2c;&#x2e;&#x2d;&#x5f;&#x20;',\n $this->_xmlEntityCodec->encode(\n $immune,\n 'testTEST0123,.-_ '\n )\n );\n }", "function wxr_cdata( $str ) {\n\t\tif ( seems_utf8( $str ) == false )\n\t\t\t$str = utf8_encode( $str );\n\n\t\t// $str = ent2ncr(esc_html($str));\n\t\t$str = \"<![CDATA[$str\" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>';\n\n\t\treturn $str;\n\t}", "protected function escapeCharacter () : string {\n return '\\\\';\n }", "protected static function escapeCSSChar($matches) {\n $char = $matches[0];\n if(str::length($char) == 1) {\n $ord = ord($char);\n } else {\n $char = static::convertEncoding($char);\n $ord = hexdec(bin2hex($char));\n }\n return sprintf('\\\\%X ', $ord);\n }", "function corriger_caracteres_windows($texte, $charset='AUTO') {\n\tstatic $trans;\n\n\tif ($charset=='AUTO') $charset = $GLOBALS['meta']['charset'];\n\tif ($charset == 'utf-8') {\n\t\t$p = chr(194);\n\t} else if ($charset == 'iso-8859-1') {\n\t\t$p = '';\n\t} else\n\t\treturn $texte;\n\n\tif (!isset($trans[$charset])) {\n\t\t$trans[$charset] = array(\n\t\t\t$p.chr(128) => \"&#8364;\",\n\t\t\t$p.chr(129) => ' ', # pas affecte\n\t\t\t$p.chr(130) => \"&#8218;\",\n\t\t\t$p.chr(131) => \"&#402;\",\n\t\t\t$p.chr(132) => \"&#8222;\",\n\t\t\t$p.chr(133) => \"&#8230;\",\n\t\t\t$p.chr(134) => \"&#8224;\",\n\t\t\t$p.chr(135) => \"&#8225;\",\n\t\t\t$p.chr(136) => \"&#710;\",\n\t\t\t$p.chr(137) => \"&#8240;\",\n\t\t\t$p.chr(138) => \"&#352;\",\n\t\t\t$p.chr(139) => \"&#8249;\",\n\t\t\t$p.chr(140) => \"&#338;\",\n\t\t\t$p.chr(141) => ' ', # pas affecte\n\t\t\t$p.chr(142) => \"&#381;\",\n\t\t\t$p.chr(143) => ' ', # pas affecte\n\t\t\t$p.chr(144) => ' ', # pas affecte\n\t\t\t$p.chr(145) => \"&#8216;\",\n\t\t\t$p.chr(146) => \"&#8217;\",\n\t\t\t$p.chr(147) => \"&#8220;\",\n\t\t\t$p.chr(148) => \"&#8221;\",\n\t\t\t$p.chr(149) => \"&#8226;\",\n\t\t\t$p.chr(150) => \"&#8211;\",\n\t\t\t$p.chr(151) => \"&#8212;\",\n\t\t\t$p.chr(152) => \"&#732;\",\n\t\t\t$p.chr(153) => \"&#8482;\", \n\t\t\t$p.chr(154) => \"&#353;\",\n\t\t\t$p.chr(155) => \"&#8250;\",\n\t\t\t$p.chr(156) => \"&#339;\",\n\t\t\t$p.chr(157) => ' ', # pas affecte\n\t\t\t$p.chr(158) => \"&#382;\",\n\t\t\t$p.chr(159) => \"&#376;\",\n\t\t);\n\t}\n\treturn strtr($texte, $trans[$charset]);\n}", "function RSC($txt){\n\t$txt = str_replace(\"'\",\"&#39;\",$txt);\n\t$txt = str_replace(\"!\",\"&#33;\",$txt);\n\t$txt = str_replace(\"’\",\"&rsquo;\",$txt);\n\t$txt = str_replace(\"‘\",\"&lsquo;\",$txt);\n\t$txt = str_replace('“',\"&ldquo;\",$txt);\n\t$txt = str_replace('”',\"&rdquo;\",$txt);\n\n\treturn $txt;\n}", "function uw($x) {\r\n return utf2win($x,true);\r\n}", "function utf8_code($c) {\n return 'U+' . sprintf('%04X', utf8_ord($c));\n}", "function PrepareForExcel($ret)\n{\n\tif (substr($ret,0,1)== \"=\") \n\t\t$ret = \"&#61;\".substr($ret,1);\n\treturn $ret;\n\n}", "static function getCharacters()\n {\n return '\\x{00E5}\\x{00E4}\\x{00F6}';\n }", "public static function ascii() {}", "function mswConvertSmartQuotes($string) {\n return $string;\n //$search = array(chr(145),chr(146),chr(147),chr(148),chr(151));\n //$replace = array(\"'\",\"'\",'\"','\"','-');\n //return str_replace($search,$replace,$string);\n}", "public function testSpecialChar()\n\t{\n\t\t$special = array(\n\t\t\t'symbol' => '! @ # $ % ^ & * ( ) _ + - = [ ] \\ { } | ; \\' : \" , . / < > ? &amp; &lt; &#039;',\n\t\t\t'html' => '<body><a href=\"http://example.com\">click</a></body>',\n\t\t\t'space' => \"white \\t\\n space\", // no cdata tag for this\n\t\t\t'raw' => '<span>comm]]>ent</span>', // premature end cdata tag will be escaped\n\t\t);\n\n\t\t$xml = $this->getDataElement();\n\t\tInterspire_Xml::addArrayToXML($xml, $special);\n\t\t$out = Interspire_Xml::prettyIndent($xml);\n\n\t\t$expected = Interspire_Xml::getDeclaration();\n\t\t$expected .= '\n<data>\n <symbol><![CDATA['.$special['symbol'].']]></symbol>\n <html><![CDATA['.$special['html'].']]></html>\n <space>'.$special['space'].'</space>\n <raw><![CDATA[<span>comm]]]]><![CDATA[>ent</span>]]></raw>\n</data>\n';\n\t\t$this->assertTrue(Interspire_Xml::validateXMLString($out));\n\t\t$this->assertEquals($expected, $out);\n\n\t\t// reverse\n\t\t$xml = simplexml_load_string($out);\n\t\t$result = Interspire_Xml::xml2array($xml);\n\t\t$this->assertEquals($special, $result);\n\n\t\t// test all html entities\n\t\t$entities = array();\n\t\tforeach (get_html_translation_table(HTML_ENTITIES) as $entity => $encode) {\n\t\t\t$key = str_replace(array('&', ';'), '', $encode);\n\t\t\t$entities[$key] = $encode;\n\t\t}\n\n\t\t$xml = $this->getDataElement();\n\t\tInterspire_Xml::addArrayToXML($xml, $entities);\n\t\t$out = Interspire_Xml::prettyIndent($xml);\n\n\t\t$this->assertTrue(Interspire_Xml::validateXMLString($out));\n\t\t$xml = simplexml_load_string($out);\n\t\t$result = Interspire_Xml::xml2array($xml);\n\t\t$this->assertEquals($entities, $result);\n\t}", "public function getAsciiReplace();", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "public function testEncodeInvalidCharsReplacedBySpace()\n {\n $this->assertEquals(\n 'a b c d e f&#x9;g',\n $this->_xmlEntityCodec->encode(\n $this->_immune_xml,\n 'a' . chr(0) . 'b' . chr(4) . 'c' . chr(128) . 'd' .\n chr(150) . 'e' . chr(159) . 'f' . chr(9) . 'g'\n )\n );\n }", "function GetAnsiEncoding() { return 'windows-1252'; }", "public function getEscapeCharacter()\n {\n return $this->escape_character;\n }", "function encodeXSString($string) {\n // Remove dead space.\n $string = trim($string);\n\n // Prevent potential Unicode codec problems.\n $string = utf8_decode($string);\n\n // HTMLize HTML-specific characters.\n $string = htmlentities($string, ENT_QUOTES);\n $string = str_replace(\"#\", \"&#35;\", $string);\n $string = str_replace(\"%\", \"&#37;\", $string);\n\n return $string;\n }", "function utf8_to_win1252($data){\r\n\treturn iconv(\"UTF-8\", \"Windows-1252\", $data);\r\n}", "function utf8_chr($num) {\n if ($num < 0 or $num > 0x10FFFF) {\n return false;\n }\n if ($num <= 0x7F) return chr($num);\n if ($num <= 0x7FF) return chr(($num >> 6) | 0xC0) . chr(($num & 0x3F) | 0x80);\n if ($num <= 0xFFFF) return chr(($num >> 12) | 0xE0) . chr((($num >> 6) & 0x3F) | 0x80) . chr(($num & 0x3F) | 0x80);\n if ($num <= 0x10FFFF) return chr(($num >> 18) | 0xF0) . chr((($num >> 12) & 0x3F) | 0x80) . chr((($num >> 6) & 0x3F) | 0x80) . chr(($num & 0x3F) | 0x80);\n}", "function htmlspecialcharsbx($string, $flags = ENT_COMPAT)\r\n\t{\r\n\t\treturn htmlspecialchars($string, $flags, \"ISO-8859-1\");\r\n\t}", "function xml_escape($value)\n{\n return htmlspecialchars(preg_replace('#[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]+#', '',\n $value), ENT_QUOTES);\n}", "public function fnReadEscapedChar($bInTemplate) \n {\n $iCh = Utilities::fnGetCharAt($this->sInput, ++$this->iPos);\n \n ++$this->iPos;\n \n switch ($iCh) {\n case 110: return \"\\n\"; // 'n' -> '\\n'\n case 114: return \"\\r\"; // 'r' -> '\\r'\n case 120: return Utilities::fnUnichr($this->fnReadHexChar(2)); // 'x'\n case 117: return $this->fnCodePointToString($this->fnReadCodePoint()); // 'u'\n case 116: return \"\\t\"; // 't' -> '\\t'\n case 98: return \"\\b\"; // 'b' -> '\\b'\n case 118: return \"\\x{000b}\"; // 'v' -> '\\u000b'\n case 102: return \"\\f\"; // 'f' -> '\\f'\n case 13: \n if (Utilities::fnGetCharAt($this->sInput, $this->iPos) == 10) \n ++$this->iPos; // '\\r\\n'\n case 10: // ' \\n'\n if ($this->aOptions['locations']) { \n $this->iLineStart = $this->iPos;\n ++$this->iCurLine;\n }\n return \"\";\n default:\n if ($iCh >= 48 && $iCh <= 55) {\n preg_match(\"/^[0-7]+/\", mb_substr($this->sInput, $this->iPos - 1, 3), $aMatches);\n $sOctalStr = $aMatches[0];\n $iOctal = intval($sOctalStr, 8);\n if ($iOctal > 255) {\n $sOctalStr = mb_substr($sOctalStr, 0, mb_strlen($sOctalStr)-1);\n $iOctal = intval($sOctalStr, 8);\n }\n $this->iPos += mb_strlen($sOctalStr) - 1;\n $iCh = Utilities::fnGetCharAt($this->sInput, $this->iPos);\n if (($sOctalStr != \"0\" || $iCh == 56 || $iCh == 57) && ($this->bStrict || $bInTemplate)) {\n $this->fnInvalidStringToken(\n $this->iPos - 1 - mb_strlen($sOctalStr),\n $bInTemplate\n ? \"Octal literal in template string\"\n : \"Octal literal in strict mode\"\n );\n }\n return Utilities::fnUnichr($iOctal);\n }\n return Utilities::fnUnichr($iCh);\n }\n }" ]
[ "0.6308389", "0.62913984", "0.6259684", "0.60764503", "0.6049679", "0.5932261", "0.5793625", "0.57131314", "0.5650458", "0.5584737", "0.55737597", "0.55729944", "0.55428475", "0.5530613", "0.5517697", "0.5487727", "0.5457574", "0.544922", "0.5448534", "0.5443143", "0.54394305", "0.54263824", "0.53999376", "0.5396984", "0.538755", "0.5383514", "0.5379005", "0.5373669", "0.53697103", "0.5358642" ]
0.65212756
0
Determine whether the current response being served as AMP.
public function is_amp() { if ( is_singular( Story_Post_Type::POST_TYPE_SLUG ) ) { return true; } // Check for `amp_is_request()` first since `is_amp_endpoint()` is deprecated. if ( function_exists( '\amp_is_request' ) ) { return amp_is_request(); } if ( function_exists( '\is_amp_endpoint' ) ) { return is_amp_endpoint(); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function is_amp() {\n\n\t\tstatic $cache;\n\n\t\tif ( isset( $cache ) )\n\t\t\treturn $cache;\n\n\t\treturn $cache = defined( 'AMP_QUERY_VAR' ) && \\get_query_var( AMP_QUERY_VAR, false ) !== false;\n\t}", "public function supportsAmp()\r\n\t{\r\n\t\treturn 1 === (int) Mage::getStoreConfig('ec/amp/enable');\r\n\t}", "public function force_amp_request( $is_amp_request ) {\n\t\tif ( ! is_singular( Story_Post_Type::POST_TYPE_SLUG ) ) {\n\t\t\treturn $is_amp_request;\n\t\t}\n\t\treturn true;\n\t}", "public function isResponse(): bool {\n return $this->options['response'] ?? false;\n }", "public function isIntended()\n {\n return $this->isGet() || $this->isPost();\n }", "public function is_current_requested() {\n\t\treturn $this->is_interstitial_requested( $this->get_current_interstitial() );\n\t}", "static function is_requested()\n {\n $retval = FALSE;\n if (self::is_requested_page()) {\n $retval = self::is_requested_page();\n } elseif (self::is_requested_post_type()) {\n $retval = self::is_requested_post_type();\n }\n return apply_filters('is_ngg_admin_page', $retval);\n }", "public function hasResponse()\n {\n return null !== $this->response;\n }", "protected function isPageSliderContext()\n\t{\n\t\treturn $this->request->get('IFRAME') === 'Y';\n\t}", "public function hasResponse(): bool\n {\n return $this->response !== null;\n }", "public function hasResponse(): bool\n {\n return null !== $this->response;\n }", "protected function requestIsConditional()\n {\n return $this->getCurrentRoute()->requestIsConditional();\n }", "public function isXHR()\n {\n return isset($this->server['HTTP_X_REQUESTED_WITH']);\n }", "public function isValidResponse(){\n\t\treturn $this->isLoaded(); \n\t}", "public function hasResponse(): bool\n {\n return ! ($this->response === null);\n }", "public static function isRequest() {\n\t return http_response_code()!==FALSE;\n\t}", "public function isAdoptable() {\n return $this->shareData[\"adoptable\"];\n }", "protected function hasApc()\n {\n return function_exists('apc_cache_info') && @apc_cache_info();\n }", "public function CookieConsentIsInXHRMode()\n {\n $controller = Controller::curr();\n $securiy = $controller ? $controller instanceof Security : false;\n $cookiePolicy = $controller ? $controller instanceof CookiePolicyPageController : false;\n return !$securiy && !$cookiePolicy && CookieConsent::config()->get('xhr_mode');\n }", "public function hasACacheableContentType()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n foreach ($this->headersList() as $_key => $_header) {\n if (mb_stripos($_header, 'content-type:') === 0) {\n $content_type = $_header;\n } // Use last content-type header.\n } // unset($_key, $_header); // Housekeeping.\n\n if (isset($content_type[0]) && mb_stripos($content_type, 'html') === false\n && mb_stripos($content_type, 'xml') === false && mb_stripos($content_type, GLOBAL_NS) === false) {\n return $is = false; // Do NOT cache data sent by scripts serving other MIME types.\n }\n return $is = true;\n }", "private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function isRespond()\n {\n return null !== $this->accepted;\n }", "public function is_render_partials_request()\n {\n }", "public function IsHtmlRequested(){\r\n\t\treturn $this->ForceOutputHtml||(strlen(file_get_contents('php://input'))<1&&!$this->ForceNotOutputHtml);\r\n\t}", "public function isPreflightRequest(): bool;", "function ajan_use_embed_in_activity() {\n\treturn apply_filters( 'ajan_use_oembed_in_activity', !defined( 'AJAN_EMBED_DISABLE_ACTIVITY' ) || !AJAN_EMBED_DISABLE_ACTIVITY );\n}", "public function isPartialRequest(): bool\n {\n return $this->partialRequest;\n }", "public static function hasOutput()\n {\n $session = self::getSession();\n return isset($session->content);\n }", "function has_landing_page() {\n\n\tif ( is_archive() || is_tax() || is_category() || is_tag()) {\n\n\t\tif ( is_date() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$page = get_landing_page();\n\n\t\tif ($page) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\n\treturn false;\n}", "public static function is_request()\n\t{\n\t\treturn self::$is_server;\n\t}" ]
[ "0.74825", "0.6478409", "0.61457837", "0.59924597", "0.5814044", "0.5617582", "0.5569277", "0.5517232", "0.5486055", "0.54583967", "0.5448466", "0.5428127", "0.541923", "0.5405955", "0.54006267", "0.5377888", "0.5338172", "0.5326295", "0.5324532", "0.52851826", "0.52842313", "0.5277626", "0.5266976", "0.5240281", "0.52396953", "0.52156293", "0.5210811", "0.5198652", "0.5192158", "0.5181514" ]
0.73642004
1
curl calls the pageview pixel
protected function pixelPageView() { $url = $GLOBALS['ccttsUrl'] .'cctts_inc/ajax/ccReg.php'; $paramsArr = array('method=pixelPageView'); foreach ($this->ccttsParams as $key => $val) $paramsArr[] = "$key=$val"; $paramsStr = implode('&', $paramsArr); $result = $this->curlIt($url, $paramsStr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "function getPageContent($url) {\r\n // create curl variable\r\n $curl = curl_init(); \r\n // set the url\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n // return the transfer as a resource\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n // $output contains the output string\r\n $output = curl_exec($curl);\r\n // close curl resource to free up system memory\r\n curl_close($curl);\r\n // return the output of the curl\r\n return $output;\r\n}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 }", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 }", "private function executeGet(Visio\\Http\\CurlRequest $curl) {\n $this->doExecute($curl);\n }", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 }", "function funInitCurl(){\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 20);\n\n return $ch;\n}", "function download_image2($image_url){\n $ch = curl_init($image_url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 40);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');\n curl_setopt($ch, CURLOPT_WRITEFUNCTION, \"curl_callback\");\n // curl_setopt($ch, CURLOPT_VERBOSE, true); // Enable this line to see debug prints\n curl_exec($ch);\n curl_close($ch); \n}", "function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}", "public function curlAction()\n {\n $curl = $this->getCurlService();\n $result = $curl->get('http://www.baidu.com');\n echo $result;\n exit;\n }", "function getPage($url) {\n debug($url, 'json');\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_TIMEOUT, 90);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.5 Safari/537.17\");\n $page = curl_exec($ch);\n if (curl_errno($ch)) {\n echo '<font color=red> Database temporarily unavailable: ';\n echo curl_errno($ch) . ' ' . curl_error($ch);\n if (isDebug()) {\n echo $url;\n }\n echo '</font><br>';\n }\n curl_close($ch);\n debug(print_r($page, true), 'json');\n return $page;\n}", "function cap($url,$path_to_file){\n\tglobal $phantom;\n\tglobal $raster;\n\t\t//echo \"capturing $url to $path_to_file\\n\";\n\t\t$cmd = \"$phantom {$raster} $url $path_to_file\";\n\t\techo $cmd;\n\t\t$s = cmd_exec($cmd,&$code);\n\t\t//echo $s;\n\t\t//echo $code;\n}", "public function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt( $ch, CURLOPT_USERAGENT, \"MyUserAgent\" );\n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url);\n\n // $output contains the output string \n $result = curl_exec($ch); \n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n // Check if any error occurred\n if(curl_errno($ch))\n {\n echo 'Curl error: ' . curl_error($ch);\n }\n // close curl resource to free up system resources \n curl_close($ch); \n\n return $result;\n}", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "private function _getImage($url) {\n //$headers[] = 'Connection: Keep-Alive'; \n //$headers[] = 'Content-type: application/x-www-form-urlencoded;charset=UTF-8'; \n $user_agent = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.04 Chromium/16.0.912.77 Chrome/16.0.912.77 Safari/535.7'; \n //$user_agent = 'Mozilla';\n //$process = curl_init($url); \n //curl_setopt($this->_ch, CURLOPT_HTTPHEADER, $headers); \n curl_setopt($this->_ch, CURLOPT_URL, $url);\n curl_setopt($this->_ch, CURLOPT_HEADER, 0);\n curl_setopt($this->_ch, CURLOPT_NOBODY, 0);\n curl_setopt($this->_ch, CURLOPT_USERAGENT, $user_agent); \n curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt($this->_ch, CURLOPT_FOLLOWLOCATION, 1); \n curl_setopt($this->_ch, CURLOPT_TIMEOUT, 30);\n //$return = curl_exec($this->_ch); \n //curl_close($process); \n return curl_exec($this->_ch); \n }", "function updateCurl($url,$method){\r\n \r\n $curl = curl_init();\r\n // Set some options - we are passing in a useragent too here\r\n curl_setopt_array($curl, array(\r\n CURLOPT_RETURNTRANSFER => 1,\r\n CURLOPT_URL => $url,\r\n CURLOPT_USERAGENT => 'Codular Sample cURL Request'\r\n ));\r\n // Send the request & save response to $resp\r\n $resp = curl_exec($curl);\r\n // Close request to clear up some resources\r\n curl_close($curl);\r\n return $resp;\r\n \r\n \r\n}", "public function curl_scrap() {\n\t\tif (!isset($this->url)) return false;\n\n\t\t$curl_session = curl_init($this->url);\n\n\t\t// CURLOPT_RETURNTRANSFER this option means that the curl_exec must put the output in a var instead of only printing it.\n\t\tcurl_setopt($curl_session, CURLOPT_RETURNTRANSFER, true);\n\n\t\t// CURLOPT_FILETIME this option means that the scraping will occur whilst retrieving the modification time of the remote file scrapped\n\t\tcurl_setopt($curl_session, CURLINFO_FILETIME, true);\n\t\t\n\t\t$scrapped_page = curl_exec($curl_session);\n\t\tif (curl_errno($curl_session))\n\t\t\t//kill the script and throw an error if there is an error in curl_exec;\n\t\t\tdie('An error occured while scraping: '.$this->url.' ERROR::'. curl_error($curl_session).\"\\n\");\n\n\t\t$filetime = curl_getinfo($curl_session, CURLINFO_FILETIME); //unix time or -1 if undef\n\t\tcurl_close($curl_session);\n\n\t\treturn $scrapped_page? array(\n\t\t\t\t\t'scrapped_page' => $scrapped_page,\n\t\t\t\t\t'filetime' => $filetime,\n\t\t\t\t):\n\t\t\t\tfalse;\n\t}", "function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }", "function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}", "function myCurl($url)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $httpCode;\n }", "function getCurlData($url)\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($curl, CURLOPT_TIMEOUT, 10);\ncurl_setopt($curl, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16\");\n$curlData = curl_exec($curl);\ncurl_close($curl);\nreturn $curlData;\n}", "function doGet($url)\n{\n $return = curlExecute($url);\n return $return;\n}", "function CUSTOM_OpenViaCurl($local_url){\r\r\n\t$local_result = '';\r\r\n\t// Open connection\r\r\n\t$ch = curl_init();\r\r\n\t// Set the parameters\r\r\n\tcurl_setopt($ch, CURLOPT_URL, $local_url);\r\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\r\n\tcurl_setopt($ch, CURLOPT_RANGE, '0-20000');\r\r\n\t// Execute request\r\r\n\tif (!$local_result = curl_exec($ch))\r\r\n\t\t$local_result = '';\r\r\n\t// Close connection\r\r\n\tcurl_close($ch);\r\r\n\treturn $local_result;\t\t\r\r\n}", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "private function scrapeWithCurl($url) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt(\n $ch,\n CURLOPT_USERAGENT,\n 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)'\n );\n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n }", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "function execCurl($url) {\n\t//echo \"<br> URL: $url <br>\";\n\t\n\t$curl = curl_init();\n\t\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_RETURNTRANSFER => true,\n\t\tCURLOPT_HEADER => false)\n\t);\n\t\n\t$curl_response = curl_exec($curl);\n\t\n\t$curl_errno = curl_errno($curl);\n $curl_error = curl_error($curl);\n\t\n\tif (curl_error($curl) || $curl_response === false || $curl_errno > 0)\n {\n $info = curl_getinfo($curl);\n echo 'error occured during curl exec - ' . var_export($info) ;\n echo '<br> error -----------> '. $curl_error; \n curl_close($curl);\n }\n \n curl_close($curl);\n\treturn $curl_response;\n}", "public function run()\r\n\t\t\t {\r\n $ch = curl_init();\r\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt ($ch, CURLOPT_URL, $this->url);\r\n curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 20);\r\n curl_setopt ($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');\r\n curl_setopt($ch, CURLOPT_HEADER, true); // header will be at output\r\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD'); // HTTP request is 'HEAD'\r\n $this->headers = curl_exec ($ch);\r\n curl_close ($ch);\r\n\t\t\t }" ]
[ "0.7006525", "0.6655005", "0.62618554", "0.618339", "0.6107177", "0.6098522", "0.6085033", "0.60667557", "0.6047157", "0.60410106", "0.60356313", "0.6004025", "0.5994087", "0.5959059", "0.5930127", "0.59033585", "0.5869796", "0.5861847", "0.58521724", "0.5848825", "0.58118093", "0.5807704", "0.577739", "0.57764286", "0.5768183", "0.57644033", "0.57298094", "0.57230896", "0.57191193", "0.5717339" ]
0.74830407
0
curl calls the path click pixel
public function pixelPathClick($clickParamsStr) { $url = $GLOBALS['ccttsUrl'] .'cctts_inc/ajax/ccReg.php'; $paramsArr = array('method=pixelPathClick', 'clickParams='.$clickParamsStr); foreach ($this->ccttsParams as $key => $val) $paramsArr[] = "$key=$val"; $paramsStr = implode('&', $paramsArr); $result = $this->curlIt($url, $paramsStr); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funSetCurlPath($ch, $path){\n curl_setopt($ch, CURLOPT_URL, $path);\n\n return $ch;\n}", "function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}", "function cap($url,$path_to_file){\n\tglobal $phantom;\n\tglobal $raster;\n\t\t//echo \"capturing $url to $path_to_file\\n\";\n\t\t$cmd = \"$phantom {$raster} $url $path_to_file\";\n\t\techo $cmd;\n\t\t$s = cmd_exec($cmd,&$code);\n\t\t//echo $s;\n\t\t//echo $code;\n}", "protected function pixelPageView() {\n\t\t$url = $GLOBALS['ccttsUrl'] .'cctts_inc/ajax/ccReg.php';\n\t\t$paramsArr = array('method=pixelPageView');\n\t\tforeach ($this->ccttsParams as $key => $val)\n\t\t\t$paramsArr[] = \"$key=$val\";\n\t\t\n\t\t$paramsStr = implode('&', $paramsArr);\n\t\t$result = $this->curlIt($url, $paramsStr);\n\t}", "public function curlAction()\n {\n $curl = $this->getCurlService();\n $result = $curl->get('http://www.baidu.com');\n echo $result;\n exit;\n }", "function updateCurl($url,$method){\r\n \r\n $curl = curl_init();\r\n // Set some options - we are passing in a useragent too here\r\n curl_setopt_array($curl, array(\r\n CURLOPT_RETURNTRANSFER => 1,\r\n CURLOPT_URL => $url,\r\n CURLOPT_USERAGENT => 'Codular Sample cURL Request'\r\n ));\r\n // Send the request & save response to $resp\r\n $resp = curl_exec($curl);\r\n // Close request to clear up some resources\r\n curl_close($curl);\r\n return $resp;\r\n \r\n \r\n}", "function tsuiseki_tracking_click($data) {\n if (!empty($data)) {\n $t_data = (string)(trim($data));\n // We need to cut the first \"ref=\" as it comes from the javascript part\n // and may overlay the partner field.\n if (preg_match('/^ref=.*/', $t_data)) {\n $t_data = mb_substr($t_data, mb_strpos($t_data, '=') + 1);\n }\n $t_parts = preg_split('/;;/', $t_data);\n $src_url = (string)(trim($t_parts[0]));\n $width = (string)(trim($t_parts[1]));\n $height = (string)(trim($t_parts[2]));\n $mousex = (string)(trim($t_parts[3]));\n $mousey = (string)(trim($t_parts[4]));\n $browser = (string)(trim($t_parts[5]));\n $browser_version = (string)(trim($t_parts[6]));\n $referer = (string)(trim($t_parts[7]));\n if (!empty($referer)) {\n // Wir extrahieren nur die Domain!\n $r_parts = array();\n preg_match('/[a-z]{3,5}:\\/\\/(.+?)[\\/?:]/', $referer, $r_parts);\n if (!empty($r_parts[1])) {\n $referer = 'referer='. (string)trim($r_parts[1]);\n }\n }\n $click_type = (string)(trim($t_parts[8]));\n $click_bits = (string)trim($t_parts[9]);\n }\n\n $key = (string)trim($_SESSION['TSUISEKI_TRACKER_KEY']);\n if (!empty($src_url) && !empty($key)) {\n $ref = urldecode($src_url);\n $data = (string)(trim(tsuiseki_tracking_get_data($ref)));\n $data .= '&'. $width .'&'. $height .'&'. $mousex .'&'. $mousey .'&'. $browser .'&'. $browser_version .'&'. $click_bits .'&'. $referer .'&'. $click_type;\n $data = urlencode($data);\n $ip = ip2long($_SERVER['REMOTE_ADDR']);\n $url = \"http://tracker.tsuiseki.com/tsuiseki.php?q=$key;1;$ip;$data&ajax=1\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERAGENT, (string)trim($_SERVER['HTTP_USER_AGENT']));\n curl_setopt($ch, CURLOPT_REFERER, $src_url);\n $result = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n trigger_error(curl_error($ch), curl_errno($ch));\n }\n curl_close($ch);\n }\n // generate the response\n $response = json_encode( array( 'success' => true ) );\n // response output\n header( \"Content-Type: application/json\" );\n echo $response;\n exit;\n //return 0;\n}", "function Curl_Call($url, $args) {\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $args);\n\t\t$data = curl_exec($ch);\n\n\t\t//echo \"<pre>\".print_r(curl_getinfo($ch));\n\n\t\treturn $data;\n\t}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}", "function download_image2($image_url){\n $ch = curl_init($image_url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 40);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');\n curl_setopt($ch, CURLOPT_WRITEFUNCTION, \"curl_callback\");\n // curl_setopt($ch, CURLOPT_VERBOSE, true); // Enable this line to see debug prints\n curl_exec($ch);\n curl_close($ch); \n}", "private function executeGet(Visio\\Http\\CurlRequest $curl) {\n $this->doExecute($curl);\n }", "private function sendQueryByCurl() {\n $this->curl = curl_init();\n\n // JSON data request\n $jsonData = $this->getJsonData();\n\n // some params\n $urlParams = $this->getParamsUrlFormat();\n\n $this->setCurlOpts($this->curl, $jsonData, $urlParams);\n $this->setResult(curl_exec($this->curl));\n $this->setHttpCode(curl_getinfo($this->curl, CURLINFO_HTTP_CODE));\n\n curl_close($this->curl);\n }", "public function clickFinger()\n {\n }", "private function download_page($path){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$path);\n\tcurl_setopt($ch, CURLOPT_FAILONERROR,1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 15);\n\t$retValue = curl_exec($ch);\t\t\t \n\tcurl_close($ch);\n\treturn $retValue;\n}", "function screenshotlayer($url, $args) \n {\n // set access key\n $access_key = \"3e2fb89a508890b8ee36657091d275e7\";\n \n // set secret keyword (defined in account dashboard)\n $secret_keyword = \"helloworld114\";\n \n // encode target URL\n $params['url'] = urlencode($url);\n \n $params += $args;\n \n // create the query string based on the options\n foreach($params as $key => $value) { $parts[] = \"$key=$value\"; }\n \n // compile query string\n $query = implode(\"&\", $parts);\n \n // generate secret key from target URL and secret keyword\n $secret_key = md5($url . $secret_keyword);\n\n return \"https://api.screenshotlayer.com/api/capture?access_key=$access_key&secret_key=$secret_key&$query\";\n }", "private function _get($path)\n {\n $this->_logIn();\n\n // @TODO we can access beyond page 1 by adding ?page=pX where X is the number\n // of the page requested\n $this->_curlUrl = self::GV_SERVER_URL . $path;\n \n // Send HTTP POST request.\n curl_setopt($this->_ch, CURLOPT_URL, $this->_curlUrl);\n curl_setopt($this->_ch, CURLOPT_POST, false);\n curl_setopt($this->_ch, CURLOPT_RETURNTRANSFER, true);\n\n $this->_result = curl_exec($this->_ch);\n \n return $this->_result;\n }", "private function postHop () {\n\t\t$this->result = curl_exec ( $this->ch );\n\t\tcurl_close ( $this->ch );\n\t}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 }", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 }", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\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 function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt( $ch, CURLOPT_USERAGENT, \"MyUserAgent\" );\n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url);\n\n // $output contains the output string \n $result = curl_exec($ch); \n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n // Check if any error occurred\n if(curl_errno($ch))\n {\n echo 'Curl error: ' . curl_error($ch);\n }\n // close curl resource to free up system resources \n curl_close($ch); \n\n return $result;\n}", "function api_test_curl()\r\n\t{\r\n\t\techo \"true\";\r\n\t}", "function do_fetch($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git fetch' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "function funExecuteCurl($ch){\n return curl_exec($ch);\n\n}", "public function act($path, array $path_args, $query_string) /*: Response */;", "function make_call($url)\n {\n echo \"API Call:<br /><textarea id='orig' rows='4' cols='150'>$url</textarea><br />\";\n $ch = curl_init();\n $timeout = 20;\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n\n $data = curl_exec($ch);\n\n if (curl_errno($ch)) {\n print curl_error($ch);\n } else {\n curl_close($ch);\n }\n echo htmlentities($data) . \"<br />\";\n return $data;\n }", "function image_upload($img_path)\n{\n $pvars = array(\"content_type\" => 1, \"img\" => \"@\".$img_path);\n\n // initialize curl and set parameters\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, 'http://www.pixhost.org/api');\n curl_setopt($curl, CURLOPT_TIMEOUT, 30);\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n // execute, get information and close connection\n $response = curl_exec($curl);\n $info = curl_getinfo($curl);\n curl_close ($curl);\n\n // check if the http-code is 200\n if($info['http_code'] != 200) {\n exit(\"OAuth error: \".$response);\n }\n\n // decode the json-encoded response\n $response_array = json_decode($response);\n\n return $response_array;\n}" ]
[ "0.60479814", "0.60446954", "0.5755189", "0.5702173", "0.5575755", "0.5544913", "0.5502019", "0.5447376", "0.5376327", "0.5327401", "0.5322306", "0.523604", "0.51909715", "0.51493627", "0.51443994", "0.51271814", "0.5119548", "0.5095666", "0.5086936", "0.5086558", "0.50574887", "0.5035981", "0.5035508", "0.5011032", "0.49999285", "0.4990156", "0.49779442", "0.4962452", "0.49610746", "0.49530643" ]
0.62934214
0
Assert the view name.
public function assertViewIs($name) { $this->assertEquals($name, $this->response->original->getName()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testInvalidView() {\n $renderer = $this->container->get('renderer');\n $render_element = [\n '#type' => 'view',\n '#name' => 'invalid_view_name',\n '#embed' => FALSE,\n ];\n $this->expectException(ViewRenderElementException::class);\n $this->expectExceptionMessage(\"Invalid View name ({$render_element['#name']}) given.\");\n $renderer->renderRoot($render_element);\n }", "public function testFileName()\n\t{\n\t\t$this->assertEquals(\"BaseView.mustache\", $this->view->getFile());\n\t}", "protected function viewsName()\n {\n return $this->argument('name');\n }", "public function testGetName() {\r\n $action = $this->_action->setName('name');\r\n $this->assertEquals('name', $action->getName());\r\n }", "public function verifyTemplate($view_name)\n {\n if (!file_exists('view/' . $view_name . '.tpl.php')) {\n echo \"No such controller\";\n exit;\n }\n }", "public function testGetNameFail() {\r\n $this->_action->getName();\r\n }", "protected function resolveViewObjectName() {}", "private function assertValidName() : void\n {\n InvalidDescriptorArgumentException::assertIsNotEmpty(\n $this->name,\n '#[Route.name] must contain a non-empty string.'\n );\n }", "public function isView( $name ) {\n\t\tthrow new MWException( 'DatabaseBase::isView is not implemented in descendant class' );\n\t}", "public function testGetSet()\n\t{\n\t\t$this->view->name = \"Nicholas\";\n\t\t$this->assertEquals(\"Nicholas\", $this->view->name);\n\t}", "public function getName()\n {\n return $this->view;\n }", "public function getName()\n {\n return $this->view;\n }", "public function getViewName()\n\t{\n\t\treturn $this->viewName;\n\t}", "public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n $this->assertFalse($this->Request->is($action));\n }\n\n $this->assertTrue($this->Request->is('add'));\n $this->assertTrue($this->Request->is(['add', 'edit']));\n $this->assertFalse($this->Request->is(['delete', 'edit']));\n }", "public function testView()\n {\n $this->assertEquals($this->render('directives.breakpoint'), '');\n }", "public function testRouteSetsName()\n {\n $route = new \\Slim\\Route('/foo/bar', function () {});\n $route->name('foo');\n $this->assertEquals('foo', $route->getName());\n }", "public function viewExists($viewName, $schemaName=null){ }", "public function getName()\n\t{\n\t\tif (empty($this->_name))\n\t\t{\n\t\t\t$classname = get_class($this);\n\t\t\t$viewpos = strpos($classname, 'View');\n\n\t\t\tif ($viewpos === false)\n\t\t\t{\n\t\t\t\tthrow new Exception(JText::_('JLIB_APPLICATION_ERROR_VIEW_GET_NAME'), 500);\n\t\t\t}\n\n\t\t\t$lastPart = substr($classname, $viewpos + 4);\n\t\t\t$pathParts = explode(' ', JStringNormalise::fromCamelCase($lastPart));\n\n\t\t\tif (!empty($pathParts[1]))\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($pathParts[0]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->_name = strtolower($lastPart);\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_name;\n\t}", "public function setNameView($name = NULL ){\n\t\t$this->nameView = $name ? $name : \"Ver \".$this->name;\n\t}", "public function isValidViewModeName($value) {\n return TRUE;\n }", "public function setNameCorrectlySetsRouteName()\n {\n $this->route->setName('SomeName');\n\n self::assertSame('SomeName', $this->route->getName());\n }", "public function testHomeView()\n\t{\n\t\t$response = $this->call('GET', '/');\n\t\t$view = $response->original;\n\t\t\n\t\t$this->assertEquals('home.index', $view['name']);\n\t}", "public function checkViewExists($view);", "private function checkForView($name)\n {\n $viewFile = $this->config['views'] . '/' . $name . '.blade.php';\n if (!file_exists($viewFile)) {\n return false;\n }\n\n return true;\n }", "public function testArgumentValidateUserName() {\n $view = Views::getView('test_view_argument_validate_username');\n $this->executeView($view);\n\n $this->assertTrue($view->argument['null']->validateArgument($this->account->getAccountName()));\n // Reset argument validation.\n $view->argument['null']->argument_validated = NULL;\n // Fail for a valid string, but for a user that doesn't exist\n $this->assertFalse($view->argument['null']->validateArgument($this->randomMachineName()));\n }", "function view($name_view){\n return new View($name_view);\n}", "public function testRouteNameCasing(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/articles/{id}', ['controller' => 'Articles', 'action' => 'view']);\n $routes->connect('/{controller}/{action}/*', [], ['routeClass' => 'InflectedRoute']);\n $result = Router::url(['controller' => 'Articles', 'action' => 'view', 'id' => 10]);\n $expected = '/articles/10';\n $this->assertSame($expected, $result);\n }", "public function testNSView()\n {\n $data['title']=\"NS View\";\n echo view('Example\\Blog\\Views\\BlogView', $data);\n }", "public function testName()\n {\n $this->assertEquals('homepage_url', (new UrlField('homepage_url'))->getName());\n }", "public function testGetName(): void\n {\n $this->assertSame('travis', $this->context->getName());\n }" ]
[ "0.67567545", "0.65808785", "0.6307293", "0.62265104", "0.62031525", "0.6196195", "0.6195967", "0.6167261", "0.61331224", "0.6097434", "0.6087623", "0.6087623", "0.6065636", "0.5949181", "0.5918191", "0.5901509", "0.5896921", "0.5895136", "0.5869114", "0.5869114", "0.5834284", "0.5815379", "0.5808412", "0.580244", "0.5802335", "0.57994705", "0.57602537", "0.5750647", "0.5742438", "0.57399994" ]
0.80080056
0
Render the opening tags for the pagination
protected function _renderPaginationStart() { return '<div id="ZVHPContainer"><ul id="ZVHPList">'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaginationHtml();", "public function render()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$pagination = $this->template['wrapper_start'];\n\t\t$pagination .= $this->prev_link(Lang::get('pagination.previous'));\n\t\t$pagination .= $this->page_links();\n\t\t$pagination .= $this->next_link(Lang::get('pagination.next'));\n\t\t$pagination .= $this->template['wrapper_end'];\n\n\t\treturn $pagination;\n\t}", "public function view()\n {\n $pages = explode(' ', $this->list);\n\n if ($this->current_page < 1 || $this->current_page > $this->total_pages) {\n $this->current_page = 1;\n }\n $output = null;\n\n $output .= '<ul class=\"pagination\">';\n $output .= $this->beginning();\n $output .= $this->middle($pages);\n $output .= $this->ending();\n $output .= '</ul>';\n \n return $output;\n }", "public function render()\n {\n if ($this->hasPages())\n {\n return sprintf(\n '<ul class=\"pagination\">%s %s %s</ul>',\n $this->getPreviousButton(),\n $this->getLinks(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "public function render()\n {\n if ($this->hasPages()) {\n return sprintf(\n '<ul class=\"pagination\">%s %s</ul>',\n $this->getPreviousButton(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "public function render()\n {\n // The hard-coded thirteen represents the minimum number of pages we need to\n // be able to create a sliding page window. If we have less than that, we\n // will just render a simple range of page links insteadof the sliding.\n if ($this->lastPage < 13) {\n $content = $this->getPageRange(1, $this->lastPage);\n } else {\n $content = $this->getPageSlider();\n }\n\n if (\\Config::get('pagination::show_first_last') === true) {\n return $this->getFirst().$this->getPrevious().$content.$this->getNext().$this->getLast();\n }\n\n return $this->getPrevious().$content.$this->getNext();\n }", "public function render()\n {\n if ($this->hasPages()) {\n return new HtmlString(sprintf(\n '<ul class=\"pagination\">%s %s %s</ul>',\n $this->getPreviousButton(),\n $this->getLinks(),\n $this->getNextButton()\n ));\n }\n\n return '';\n }", "protected function buildPagination() {}", "protected function buildPagination() {}", "protected function _renderPaginationEnd()\n {\n return '</ul></div>';\n }", "function render_block_core_query_pagination($attributes, $content)\n {\n }", "function renderNext($tag = '&gt;&gt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}", "public function render()\n {\n $items = $this->getAllLinksRender($this->list);\n $output = str_replace('{paginationContent}', $items, $this->htmlContainer);\n\n return (string) $output;\n }", "public function links()\n\t{\n\t\tif ($this->last <= 1) return '';\n\n\t\t// Each pagination element is created by an element method. This allows\n\t\t// us to keep this class clean and simple, because pagination code can\n\t\t// become a mess. We would rather keep it simple and beautiful.\n\t\tforeach ($this->elements as $element)\n\t\t{\n\t\t\t$elements[] = $this->$element(Lang::line(\"pagination.{$element}\")->get());\n\t\t}\n\n\t\treturn '<div class=\"pagination\">'.implode(' ', $elements).'</div>'.PHP_EOL;\n\t}", "public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\">&lt;</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">&gt;</a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }", "function renderFullNav() {\r\n\t\treturn \"<table class='paglink' ><tr><td>\".$this->renderFirst() . '&nbsp;' . $this->renderPrev() . '&nbsp;' . $this->renderNav() . '&nbsp;' . $this->renderNext() . '&nbsp;' . $this->renderLast().\"</td></tr></table>\";\r\n\t}", "function pagination(){}", "protected function renderListNavigation()\n {\n $totalPages = ceil($this->totalItems / $this->iLimit);\n\n $content = '';\n\n // Show page selector if not all records fit into one page\n if ($totalPages > 1) {\n $first = $previous = $next = $last = '';\n $listURL = $this->listURL('', $this->table);\n\n // 1 = first page\n $currentPage = floor(($this->firstElementNumber + 1) / $this->iLimit) + 1;\n\n // Compile first, previous, next, last and refresh buttons\n if ($currentPage > 1) {\n $labelFirst = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:first');\n\n $first = '<a href=\"' . $listURL . '&pointer=0\"><img' . IconFactory::skinImg('control_first.gif')\n . 'alt=\"' . $labelFirst . '\" title=\"' . $labelFirst . '\" /></a>';\n } else {\n $first = '<img' . IconFactory::skinImg('control_first_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if (($currentPage - 1) > 0) {\n $labelPrevious = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:previous');\n\n $previous = '<a href=\"' . $listURL . '&pointer=' . (($currentPage - 2) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_previous.gif')\n . 'alt=\"' . $labelPrevious . '\" title=\"' . $labelPrevious . '\" /></a>';\n } else {\n $previous = '<img' . IconFactory::skinImg('control_previous_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if (($currentPage + 1) <= $totalPages) {\n $labelNext = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:next');\n\n $next = '<a href=\"' . $listURL . '&pointer=' . (($currentPage) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_next.gif')\n . 'alt=\"' . $labelNext . '\" title=\"' . $labelNext . '\" /></a>';\n } else {\n $next = '<img' . IconFactory::skinImg('control_next_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n if ($currentPage != $totalPages) {\n $labelLast = $GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:last');\n\n $last = '<a href=\"' . $listURL . '&pointer=' . (($totalPages - 1) * $this->iLimit) . '\"><img' . IconFactory::skinImg('control_last.gif')\n . 'alt=\"' . $labelLast . '\" title=\"' . $labelLast . '\" /></a>';\n } else {\n $last = '<img' . IconFactory::skinImg('control_last_disabled.gif') . 'alt=\"\" title=\"\" />';\n }\n\n $pageIndicator = sprintf($GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:pageIndicator'),\n $currentPage, $totalPages);\n\n if ($this->totalItems > ($this->firstElementNumber + $this->iLimit)) {\n $lastElementNumber = $this->firstElementNumber + $this->iLimit;\n } else {\n $lastElementNumber = $this->totalItems;\n }\n $rangeIndicator = '<span class=\"pageIndicator\">'\n . sprintf($GLOBALS['LANG']->sL('LLL:EXT:tt_news/Classes/Module/locallang.xml:rangeIndicator'),\n $this->firstElementNumber + 1, $lastElementNumber, $this->totalItems)\n . '</span>';\n\n $content .= '<div class=\"ttnewsadmin-pagination\">'\n . $first . $previous\n . '&nbsp;'\n . $rangeIndicator . '&nbsp;('\n . $pageIndicator . ')&nbsp;'\n . $next . $last\n . '</div>';\n } // end of if pages > 1\n\n $data = Array();\n $titleColumn = $this->fieldArray[0];\n $data[$titleColumn] = $content;\n\n return ($this->addElement(1, '', $data));\n }", "function printTags(){\n\n\t\t/* Start HTML */\n\t\t$output = '<ul class=\"taglist\">';\n\t\t$tags = explode(',',$this->tags);\n\t\tforeach($tags as $tag){\n\t\t\t$output .= '<li class=\"tag\"><a href=\"#!/search&tags='.urlencode(strtolower(str_replace(' ','',$tag))).'\">'.$tag.'</a></li>';\n\t\t}\n\t\t$output .= '</ul>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}", "public function render() {\r\n\t\t// be able to create a sliding page window. If we have less than that, we\r\n\t\t// will just render a simple range of page links insteadof the sliding.\r\n\t\t/*------------------------------------------------\r\n\t\t| >>beststrelok<<\r\n\t\t------------------------------------------------*/\r\n\t\t// https://gist.github.com/beststrelok/17a6328d75da5492860d/revisions\r\n\t\t// http://laravel.com/docs/4.2/pagination#custom-presenters\r\n\t\t/*----------------------------------------------*/\r\n\t\tif ($this->lastPage < 7)\r\n\t\t{\r\n\t\t\t$content = $this->getPageRange(1, $this->lastPage);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$content = $this->getPageSlider();\r\n\t\t}\r\n\r\n\t\treturn $content;\r\n\t}", "function render_block_core_query_pagination_numbers($attributes, $content, $block)\n {\n }", "public function render()\n {\n // Initialize the output with the opening tags for the navigation and list elements\n $output = $this->tags['navopen'];\n $output .= $this->tags['olopen'];\n\n // Determine the number of breadcrumbs in the array\n $count = count($this->breadcrumbs) - 1;\n\n // Iterate through each breadcrumb and add it to the output\n foreach ($this->breadcrumbs as $index => $breadcrumb) {\n // If this is the last breadcrumb in the array, don't include a link\n if ($index == $count) {\n $output .= $this->tags['liopen'];\n $output .= $breadcrumb['crumb'];\n $output .= $this->tags['liclose'];\n }\n // For all other breadcrumbs, include a link\n else {\n $output .= $this->tags['liopen'];\n // Use the site_url() function instead of base_url() for better security\n $output .= '<a href=\"' . site_url($breadcrumb['href']) . '\">';\n $output .= $breadcrumb['crumb'];\n $output .= '</a>';\n $output .= $this->tags['liclose'];\n }\n }\n\n // Close the list and navigation elements\n $output .= $this->tags['olclose'];\n $output .= $this->tags['navclose'];\n\n return $output;\n }", "function firstArrow(){\n\t\tglobal $paged;\n\n\t\t\n\t\t// This firs set of if's ads the arrows to the pagination\n // if there are more than 2 pages and the page is outside the range, before show the <<\n\t\t \n if($paged > 2 && $paged > $this->range+1 && $this->count < $this->pages) \n\t\t {\n\t\t\t $this->content .= \"<li><a href='\".get_pagenum_link($page).\"'>&laquo;</a></li>\";\n\t\t }\n\t\t\t\t \n\t\t\n\t}", "public function render($range = null)\n {\n if ($range == null) {\n $range = $this->_range;\n }\n\n $this->_setUp();\n $pager = $this->getPager();\n $pagerRange = $pager->getRange(\n 'Sliding',\n array(\n 'chunk' => (int) $range\n )\n );\n $pages = $pagerRange->rangeAroundPage();\n\n $html = '<div class=\"pager\">';\n\n if ($pager->haveToPaginate()) {\n $html .= '<div class=\"pagination\"><ul>';\n\n if (!in_array(1, $pages)) {\n $html .= '<li class=\"first\">' . $this->getLink(1, '&lt;&lt;') . '</li>';\n }\n\n foreach ($pages as $page) {\n $class = ($pager->getPage() == $page) ? ' class=\"active\"' : '';\n $html .='<li' . $class . '>' . $this->getLink($page) . '</li>';\n }\n\n $next = $pager->getNextPage();\n\n if (!in_array($pager->getLastPage(), $pages)) {\n $html .= '<li class=\"last\">' . $this->getLink($pager->getLastPage(), '&gt;&gt;') . '</li>';\n }\n\n $html .= '</ul></div>';\n }\n\n $html .= $this->getCounter();\n '</div>';\n return $html;\n }", "private function beginning()\n {\n if ($this->current_page - 1 >= 1) {\n return '<li><a href=\"' . ($this->current_page - 1) . '\">«</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">«</a></li>';\n }\n }", "function renderPrev($tag = '&lt;&lt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page > 1) {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page - 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn \" $tag\";\r\n\t\t}\r\n\t}", "function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>]&nbsp;&nbsp;\";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev]&nbsp;&nbsp;\";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \"&nbsp;&nbsp;[Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }", "public function page_list() {\n\n\t\t\t$output = \"\";\n\t\t\t$cur_page = $this->current_page;\n\t\t\t$tot_page = $this->total_pages();\n\n\t\t\tif( $cur_page <= $tot_page ) {\n\t\t\t\t$output .= \"<h3 class=\\\"pagelist\\\">Page {$cur_page} of \" ;\n\t\t\t\t$output .= \"{$tot_page}</h3>\";\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\n\t\t}", "function render_block_core_comments_pagination($attributes, $content)\n {\n }", "function pagination() {\n echo '<div class=\"pagination\">';\n posts_nav_link(' ', '<< ', ' >>'); \n echo '</div>';\n}" ]
[ "0.67429775", "0.6573233", "0.64367545", "0.6428668", "0.64208305", "0.64119077", "0.6326776", "0.6320106", "0.6320106", "0.62880284", "0.62034434", "0.6200449", "0.6181416", "0.61058944", "0.60937977", "0.60785395", "0.6064453", "0.6060139", "0.60195214", "0.59847456", "0.5965293", "0.59249943", "0.5903421", "0.5894958", "0.5880802", "0.5880044", "0.5880004", "0.5829046", "0.58051634", "0.5800839" ]
0.7407296
0
Render the closing tags for the pagination
protected function _renderPaginationEnd() { return '</ul></div>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function end()\n\t{\n\t\treturn '\n\t\t</div>\n\t</div>\n</div>\n<!-- CE: End Pagination -->\n';\n\t}", "private function ending()\n {\n if ($this->current_page + 1 <= $this->total_pages) {\n return '<li><a href=\"' . ($this->current_page + 1) . '\">»</a></li>';\n } else {\n return '<li class=\"disabled\"><a href=\"#\">»</a></li>';\n }\n }", "function render_page_container_end()\n\t\t{\n\t\t\t$output = '</div>'; \n\t\t\treturn $output;\n\t\t}", "public function getFooter($paginate) {\n\n return \"\n <!-- Pagination Items !-->\n <div class='center'>\n <div class='pagination pagination-centered'>\n <li> <a class='pag' href='\" . $this->getListPath() . \"'>\" . _(\"First\") . \"</a></li>\n <li> <a href='\" . $this->getListPath($paginate->before) . \"'>\" . _(\"Previous\") . \"</a></li>\n <li> <a href='\" . $this->getListPath($paginate->next) . \"'>\" . _(\"Next\") . \"</a></li>\n <li> <a href='\" . $this->getListPath($paginate->last) . \"'>\" . _(\"Last\") . \"</a></li>\n </div>\n <div>\n \" . sprintf(_(\"You are in page %s of %s\"), $paginate->current, $paginate->total_pages) . \" \n </div>\n </div>\";\n }", "public function render()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t$pagination = $this->template['wrapper_start'];\n\t\t$pagination .= $this->prev_link(Lang::get('pagination.previous'));\n\t\t$pagination .= $this->page_links();\n\t\t$pagination .= $this->next_link(Lang::get('pagination.next'));\n\t\t$pagination .= $this->template['wrapper_end'];\n\n\t\treturn $pagination;\n\t}", "public function close() {\n\t\t\n\t\t// Render close tag\n\t\t\n\t\t$this->_post_render();\n\t\t\n\t\techo true === $this->options['render_tag'] ? $this->_render_tag( true ) : '';\n\t\t\n\t\techo $this->options['after'];\n\t\t\n\t}", "public function render()\n {\n if ($this->hasPages()) {\n return sprintf(\n '<ul class=\"pagination\">%s %s</ul>',\n $this->getPreviousButton(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "function renderNext($tag = '&gt;&gt;') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page < $this->max_pages) {\r\n\t\t\treturn '<a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . ($this->page + 1) . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t} else {\r\n\t\t\treturn $tag;\r\n\t\t}\r\n\t}", "public function render()\n {\n if ($this->hasPages())\n {\n return sprintf(\n '<ul class=\"pagination\">%s %s %s</ul>',\n $this->getPreviousButton(),\n $this->getLinks(),\n $this->getNextButton()\n );\n }\n\n return '';\n }", "public function getPaginationHtml();", "public static function template_container_end() {\n\t\techo '</div>';\n\t}", "public function render()\n {\n if ($this->hasPages()) {\n return new HtmlString(sprintf(\n '<ul class=\"pagination\">%s %s %s</ul>',\n $this->getPreviousButton(),\n $this->getLinks(),\n $this->getNextButton()\n ));\n }\n\n return '';\n }", "function page_end() {\n\t\t$this->tag= \"</body></html>\";\n\t\treturn $this -> tag;\n\t}", "protected function end_section_list() {\n\n $html = html_writer::end_tag('div');\n $html .= html_writer::end_tag('div');\n return $html;\n }", "public function render()\n {\n // The hard-coded thirteen represents the minimum number of pages we need to\n // be able to create a sliding page window. If we have less than that, we\n // will just render a simple range of page links insteadof the sliding.\n if ($this->lastPage < 13) {\n $content = $this->getPageRange(1, $this->lastPage);\n } else {\n $content = $this->getPageSlider();\n }\n\n if (\\Config::get('pagination::show_first_last') === true) {\n return $this->getFirst().$this->getPrevious().$content.$this->getNext().$this->getLast();\n }\n\n return $this->getPrevious().$content.$this->getNext();\n }", "public function closeTag()\n {\n return '</span>';\n }", "public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }", "public function renderContentEnd()\n {\n echo CHtml::closeTag('div');\n }", "protected function _renderPaginationStart()\n {\n return '<div id=\"ZVHPContainer\"><ul id=\"ZVHPList\">';\n }", "function renderLast($tag = 'Last') {\r\n\t\tif ($this->total_rows == 0)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\tif ($this->page == $this->max_pages) {\r\n\t\t\treturn '<b style=\" float:none;\" class=\"page_link\">'.$tag.'</b>';\r\n\t\t} else {\r\n\t\t\treturn ' <a style=\" float:none;\" href=\"' . $this->php_self . '?page=' . $this->max_pages . '' . $this->append . '\">' . $tag . '</a>';\r\n\t\t}\r\n\t}", "function listcontent_close() {\n $this->doc .= '</div>'.DOKU_LF;\n }", "public function render()\n {\n $items = $this->getAllLinksRender($this->list);\n $output = str_replace('{paginationContent}', $items, $this->htmlContainer);\n\n return (string) $output;\n }", "function _renderEnd()\n {\n echo '</div>' . $this->_varRenderer->renderEnd();\n }", "public function links()\n\t{\n\t\tif ($this->last <= 1) return '';\n\n\t\t// Each pagination element is created by an element method. This allows\n\t\t// us to keep this class clean and simple, because pagination code can\n\t\t// become a mess. We would rather keep it simple and beautiful.\n\t\tforeach ($this->elements as $element)\n\t\t{\n\t\t\t$elements[] = $this->$element(Lang::line(\"pagination.{$element}\")->get());\n\t\t}\n\n\t\treturn '<div class=\"pagination\">'.implode(' ', $elements).'</div>'.PHP_EOL;\n\t}", "function CloseTag() {\n\t\tif (!empty($this->tag)) {\n\t\t\tfor ($in=0;$in<$this->indent; $in++) {\n\t\t\t\t$this->outputCode.=\"\";\n\t\t\t}\n\t\t\tif (!empty($this->tag))\n\t\t\t$this->outputCode.=\"</\".$this->tag.\">\";\n\t\t}\n\t\t//$this->outputCode.=\"\\n\";\n\t\t$this->indent--;\n\t}", "public function getCloseTagWrapper()\n {\n }", "public function closeTag()\n {\n return '</form> </div></div>';\n }", "public function close_load_more_wrapper() {\n\t\techo '</div>';\n\t}", "function end_tag() {\r\n\t\t$this->push_nodelist();\r\n\t\t\r\n\t}", "protected function buildPagination() {}" ]
[ "0.7763915", "0.67816484", "0.6739548", "0.65645903", "0.6520972", "0.6472476", "0.645223", "0.64378923", "0.64345294", "0.64336985", "0.6331773", "0.6328169", "0.62717104", "0.621351", "0.6195916", "0.61754215", "0.6162652", "0.6162652", "0.61520517", "0.61456704", "0.60894287", "0.60783184", "0.60717297", "0.6058376", "0.6042969", "0.60411817", "0.60279053", "0.59956217", "0.59678495", "0.59650546" ]
0.8377676
0
Render the active list item
protected function _renderActiveListItem(array $location, $text) { return sprintf('<li id="ZVHPActiveItem"><a href="%s" id="ZVHPCurrent">%s</a></li>', $this->_view->url($location, null, true), $text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderItems()\n {\n $html = '';\n foreach ($this->items as $n => $item) {\n if ($item['active']) {\n $this->options['selected'] = $n;\n unset($item['active']);\n }\n $html .= Tab::widget($item);\n }\n return $html;\n }", "protected static function renderItem($content, $active = false)\n {\n $item = Element::li($content);\n $separator = Helpers::getContainer('config')->get('bootstrapper::breadcrumbs_separator');\n $separator = Element::span($separator)->addClass('divider');\n\n // If the link is not active it's the last one, don't append separator\n if (!$active) $item->nest($separator);\n else $item->addClass('active');\n return $item;\n }", "public function activelistAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findByCompleted(false);\n \n return $this->render('todo/active-index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function render()\n\t{\n\t\treturn '<li>'.$this->html->link($this->link, $this->title, $this->attributes).$this->renderNestedMenu().'</li>';\n\t}", "public static function render_edit_showroom($item, $page_name, $active)\n\t{\n\t\treturn ' <li id=\"item_' . $item->id . '\"><span><a href=\"#\" id=\"cat_' . $item->id . '\" rel=\"' . $item->id . '\">' . $item->name . '</a></span>'; \n\t}", "public static function render_node_showroom($item, $page_name, $active)\n\t{\n\t\tif(empty($active))\n\t\t\t$active = '_234-2348022-';\n\t\t\t\n\t\t$active = is_numeric($active)\n\t\t\t\t? (($item->id == $active) ? 'active' : '')\n\t\t\t\t: (($item->url === $active) ? 'active' : '');\t\t\n\t\treturn ' <li rel=\"'. $item->id .'\" id=\"item_' . $item->id . '\"><span><a href=\"/'. $page_name .'/'. $item->id .'/'. $item->url .'\" class=\"loader '. $active .'\">' . $item->name . '</a></span>'; \n\t}", "public function getLiActiveClass(): string;", "public function active() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), 1); // Approved\n $data['title'] = \"Active Properties\";\n \n $this->render('admin/property/active', $data);\n }", "public function render() {\n\t\t$hidemainmenu = $this->app->request->getVar('hidemainmenu');\n\t\t$html = array('<li '.JArrayHelper::toString($this->_attributes).'>');\n\t\t$icon = $this->getAttribute('icon') ? '<i class=\"uk-icon-'.$this->getAttribute('icon').'\">&#160;</i>' : '';\n\t\t$has_children = count($this->getChildren());\n\n\t\tif (!$hidemainmenu) {\n\t\t\t$html[] = '<a href=\"'.JRoute::_($this->_link).'\">'.$icon.$this->getName().($has_children ? '&#160;<i class=\"uk-icon-caret-down\">&#160;</i>' : '').'</a>';\n\t\t} else {\n\t\t\t$html[] = '<span>'.$this->getName().'</span>';\n\t\t}\n\n\t\tif ($has_children && !$hidemainmenu) {\n\t\t\t$html[] = '<div class=\"uk-dropdown uk-dropdown-navbar\"><ul>';\n\t\t\tforeach ($this->getChildren() as $child) {\n\t\t\t\t$html[] = $child->render();\n\t\t\t}\n\t\t\t$html[] = '</ul></div>';\n\t\t}\n\n\t\t$html[] = '</li>';\n\n\t\treturn implode(\"\\n\", $html);\n\t}", "public function renderListContent() {}", "private function renderItem($i, $itemClass, $activeClass, $linkClass)\n {\n $html = '<li class=\"' . $itemClass . ' ';\n $html.= ($i == $this->currentPage) ? $activeClass : '';\n $html.= '\">';\n $html.= '<a class=\"' . $linkClass . '\" href=\"';\n $html.= $this->url . $i;\n $html.= '\">' . $i . '</a></li>';\n \n return $html;\n }", "protected function render() {\n\t\t$args = $this->get_settings_for_display();\n\t\t$args['url'] = $args['url']['url'];\n\t\t$args['disabled'] = $args['disabled'] == 'yes' ? true : false;\n\t\t$args['top_border'] = $args['top_border'] == 'yes' ? true : false;\n\n\t\techo list_item_shortcode($args);\n\t}", "function theme_task_list($items, $active = NULL) {\n $done = isset($items[$active]) || $active == NULL;\n $output = '<ol class=\"task-list\">';\n foreach ($items as $k => $item) {\n if ($active == $k) {\n $class = 'active';\n $done = false;\n }\n else {\n $class = $done ? 'done' : '';\n }\n $output .= '<li class=\"'. $class .'\">'. $item .'</li>';\n }\n $output .= '</ol>';\n return $output;\n}", "protected function renderItems()\n {\n $html = '';\n foreach ($this->items as $n => $item) {\n if ($item['selected']) {\n $this->options['selected'] = $n;\n unset($item['selected']);\n }\n $html .= Item::widget($item);\n }\n return $html;\n }", "function display_list_emp($employees)\n{\n $li_out = null;\n foreach ($employees as $id => $name) {\n $li_out = \"<a class='list-group-item \";\n if (isset($_GET['id']) && $_GET['id'] == $id) {\n $li_out .= \"active\";\n }\n $li_out .= \"' href='angajati.php?id=$id'>$name</a>\";\n echo $li_out;\n }\n return;\n}", "protected function render() {\n\t\t\t$bkgrndcolor = ! empty( $this->backgroundcolor ) ? esc_attr( $this->backgroundcolor ) : '#fff';\n\t\t\t$color = ! empty( $this->textcolor ) ? esc_attr( $this->textcolor ) : '#555d66';\n\t\t\t?>\n\t\t\t<li id=\"accordion-section-<?php echo esc_attr( $this->id ); ?>\" class=\"mtm_upsell_section accordion-section control-section control-section-<?php echo esc_attr( $this->id ); ?> cannot-expand\">\n\t\t\t\t<h3 class=\"upsell-section-title\" <?php echo ' style=\"color:' . esc_attr( $color ) . ';border-left-color:' . esc_attr( $bkgrndcolor ) . ';border-right-color:' . esc_attr( $bkgrndcolor ) . ';\"'; ?>>\n\t\t\t\t\t<a href=\"<?php echo esc_url( $this->url ); ?>\" target=\"_blank\"<?php echo ' style=\"background-color:' . esc_attr( $bkgrndcolor ) . ';color:' . esc_attr( $color ) . ';\"'; ?>><?php echo esc_html( $this->title ); ?></a>\n\t\t\t\t</h3>\n\t\t\t</li>\n\t\t\t<?php\n\t\t}", "protected function getTopmenuActiveItem() {\n return 0;\n }", "protected function renderActionList() {}", "protected function getCurrentDashbaordItem() {\n\t\t\n\t\treturn \"home\";\n\t}", "function render_nav_item( \\WP_Post $page ) {\n\n\t$classes = ['NavAccordion_Item'];\n\n\tif ( 'private' === get_post_status( $page->ID ) ) {\n\t\t$classes[] = 'Nav_Item-Private';\n\t}\n\n\tif ( is_nav_item_current( $page ) ) {\n\t\t$classes[] = 'NavAccordion_Item-Active';\n\t}\n\n\tprintf(\n\t\t'<li class=\"%s\"><a href=\"%s\" class=\"NavAccordion_Anchor\">%s</a>',\n\t\tesc_attr( implode( ' ', array_map( 'sanitize_html_class', $classes ) ) ),\n\t\tesc_url( get_permalink( $page->ID ) ),\n\t\tesc_html( $page->post_title )\n\t);\n\n\trender_nav_list( $page->ID );\n\n\techo '</li>';\n}", "public function activeCollectionsAction()\r\n {\r\n $em = $this->getDoctrine()\r\n ->getManager()\r\n ->getRepository('NiftyThriftyShopBundle:Collection');\r\n\t\t$totalcollections = $em->findCountAllActive();\r\n\t\t$activecollections = $totalcollections-7;\r\n $activecollections = 11;\r\n $collections = $em->findAllActive($activecollections, $orderBy=\"collectionDateEnd\", $direction=\"DESC\");\r\n return $this->render('NiftyThriftyShopBundle:Navigation:_itemList.html.twig',\r\n array('title' => 'Current Sales',\r\n 'prefix' => 'coll',\r\n 'items' => $collections,\r\n 'path_name' => 'show_collection'));\r\n }", "public function setLiActiveClass(string $liActiveClass);", "function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {\n $search = ['°'];\n $replace = ['°'];\n $id = (isset( $args->post_id )) ? (int)$args->post_id : false;\n $byID = $id ? ($id != $item->object_id) : false;\n if ( $byID ){\n $output .= sprintf( \"\\n<li><a href='%s'%s title='%s' >%s</a>\\n\",\n $item->url,\n ( $item->object_id === get_the_ID() ) ? ' class=\"current\"' : '',\n\t\t\t\t\t\tucfirst($item->title),\n strtoupper($item->title)\n );\n }\n \n }", "public function render()\n {\n return view('components.stock-li-item');\n }", "public function render()\n {\n if ($this->shown) {\n return view('components.navigation-item');\n }\n return '';\n }", "abstract protected function renderItems(): string;", "public function render() {\n\t\t$this->addJavascriptToBackend();\n\t\t$this->addCssToBackend();\n\t\t$title = $GLOBALS['LANG']->getLL('toolbaritem', true);\n\n\t\t\t// toolbar item icon\n\t\t$menu[] = '<a href=\"#\" class=\"toolbar-item\"\">';\n\t\t$menu[] = '<input type=\"text\" id=\"tx-newspaper-role-role\" disabled=\"disabled\" value=\"' . tx_newspaper_Workflow::getRoleTitle(tx_newspaper_workflow::getRole()) . '\" />';\n\t\t$menu[] = '<input type=\"text\" id=\"tx-newspaper-role-counter\" disabled=\"disabled\" value=\"' . $this->docsAssignedToRole . '\" />';\n\t\t$menu[] = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], t3lib_extMgm::extRelPath($this->extkey) . '/mod_role/newspaper.png', 'width=\"23\" height=\"16\"').' alt=\"' . $title . '\" title=\"' . $title . '\" /></a>';\n\t\t$menu[] = '</a>';\n\n\t\t\t// toolbar item menu and initial content\n\t\t$menu[] = '<div class=\"toolbar-item-menu\" style=\"display: none;\">';\n\t\t$menu[] = $this->renderMenu();\n\t\t$menu[] = '</div>';\n\n\t\treturn implode(\"\\n\", $menu);\n\t}", "public static function render_node_navigation($item, $page_name, $active)\n\t{\n\t\t$type = (empty($item->type)) ? 'none' : $item->type;\n\n\t\tswitch($type)\n\t\t{\n\t\t\tcase 'none':\n\t\t\t\t$entry = $item->display_name; \n\t\t\t\tbreak;\n\t\t\tcase 'page':\n\t\t\t\t$entry = '<a href=\"'. url::site($item->data) .'\">' . $item->display_name . '</a>'; \t\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase 'url':\n\t\t\t\t$entry = \"<a href=\\\"http://$item->data\\\">$item->display_name</a>\"; \t\n\t\t\t\tbreak;\t\n\t\t\tcase 'email':\n\t\t\t\t$entry = \"<a href=\\\"mailto:$item->data\\\">$item->display_name</a>\"; \n\t\t\t\tbreak;\t\t\t\t\t\n\t\t}\t\n\t\treturn \"<li id=\\\"item_$item->id\\\"><span>$entry</span>\";\n\t}", "function printItemNavbar( $text, $link, $actual, $index ) {\n\n // seta a classe\n $cl = $index == $actual ? 'active' : '';\n\n // imprime o item\n echo \"<a href='\".site_url( $link ).\"' class='nav-link $cl'>$text</a>\"; \n}", "public function activeAction()\n {\n $this->initialize();\n\n $all = $this->users->query()\n ->where('active IS NOT NULL')\n ->andWhere('deleted is NULL')\n ->execute();\n \n $this->theme->setTitle(\"Users that are active\");\n $this->views->add('users/list-all', [\n 'users' => $all,\n 'title' => \"Users that are active\",\n ]);\n }" ]
[ "0.65423393", "0.6462404", "0.63651174", "0.60954696", "0.60949975", "0.6068102", "0.6038851", "0.602935", "0.6013824", "0.5996476", "0.5994431", "0.5927432", "0.5859668", "0.58056355", "0.58056086", "0.5805506", "0.57891077", "0.5759542", "0.5739864", "0.57368904", "0.57243574", "0.566291", "0.56390953", "0.56217647", "0.5606119", "0.55893606", "0.55729246", "0.55690575", "0.5548593", "0.55430156" ]
0.6504365
1
return callback url value
public function get_callback_url(){ return $this->callback_url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCallBackUrl()\r\n {\r\n \r\n }", "public function getCallbackUrl()\r\n {\r\n return $this->callback_url;\r\n }", "public function getApiCallback()\n {\n return $this->_callbackurl;\n }", "public function getCallbackUrl()\n {\n return $this->callback_url;\n }", "public function getCallbackUrl()\n {\n return $this->callbackUrl;\n }", "public function getCallbackUrl()\n {\n return $this->getParameter('callbackUrl');\n }", "protected abstract function getButtonCallbackURL();", "public function getHttpCallbackUrl()\n {\n return $this->httpCallbackUrl;\n }", "private function getProcessCallbackUrl()\n {\n return Context::getContext()->link->getModuleLink('doofinder', 'callback', []);\n }", "private function getCallbackURL()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'ssl://sandbox.payfast.co.za';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'ssl://www.payfast.co.za';\n\t\t}\n\t}", "public function callBackUrl()\r\n\t{\r\n\t\treturn Mage::getUrl('ezloginlite/social/callBack');\r\n\t}", "public function getCallbackUri()\n {\n if (array_key_exists(\"callbackUri\", $this->_propDict)) {\n return $this->_propDict[\"callbackUri\"];\n } else {\n return null;\n }\n }", "abstract public function getCallUrl();", "function cjpopups_callback_url($callback = null){\n\t$text_domain = cjpopups_item_info('text_domain');\n\t$callback = (isset($_GET['callback']) && is_null($callback)) ? $_GET['callback'] : $callback;\n\tif(!is_null($callback)){\n\t\treturn admin_url('admin.php?page=').cjpopups_item_info('page_slug').'&callback='.$callback;\n\t}else{\n\t\treturn admin_url('admin.php?page=').cjpopups_item_info('page_slug');\n\t}\n}", "public function getCallbackUrl(): ?string\n {\n return $this->callback_url;\n }", "function callback_url(array $args)\n {\n }", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function getLocalCallbackUrl(): string\n {\n return $this->getIntegrationSetup()->getLocalCallbackUrl();\n }", "public function getCallback() {\r\n\t\treturn $this->options ['callback'];\r\n\t}", "public function getSuccessUrl();", "function get_url()\n {\n }", "public function getCallback() {\n return $this->callback;\n }", "public function get_url();", "public function getCallback()\n\t{\n\t\treturn $this->callback;\n\t}", "public function getCallback()\n\t{\n\t\treturn $this->callback;\n\t}", "function getCallback()\n {\n return $this->callback;\n }", "public function getCallback()\n {\n return $this->callback;\n }", "public function getCallback()\n {\n return $this->callback;\n }", "public function getCallback()\n {\n return $this->callback;\n }", "public function getCallback()\n {\n return $this->callback;\n }" ]
[ "0.8278884", "0.7945665", "0.79227114", "0.7872659", "0.78251344", "0.7812323", "0.7709388", "0.76708376", "0.7441923", "0.73939335", "0.73905784", "0.7359126", "0.73215866", "0.7251271", "0.72348106", "0.7228135", "0.7199162", "0.71159065", "0.70583963", "0.6904662", "0.6899867", "0.6844063", "0.68398154", "0.6815659", "0.6815659", "0.67424494", "0.6721698", "0.6721698", "0.6721698", "0.6721698" ]
0.83768684
0
set token storage type
public function set_token_storage_type( $type = 'file' ){ $this->token_storage = $type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTokenMode($value)\n {\n $this->_props['TokenMode'] = $value;\n }", "public function setToken($token);", "public function set($token);", "public function setToken(string $token): void;", "public function setToken($token, $token_secret, $type = 'access', $session_store = false)\n {\n $this->_token = $token;\n $this->_token_secret = $token_secret;\n\n if ($session_store) {\n $_SESSION[\"{$type}_token\"] = $token;\n $_SESSION[\"{$type}_token_secret\"] = $token_secret;\n }\n\n return true;\n }", "function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token){\n $this->token = $token;\n }", "public function setToken($config)\n {\n $this->_token = Yii::createObject($config);\n }", "private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}", "public static function store(string $token): void\n\t{\n\t\tself::$token = $token;\n\t}", "public function setRememberToken($value)\n {\n $_token = $value;\n }", "public function setRememberToken($value){\n $this->token=$value;\n }", "protected function set_type() {\n\n\t\t\t$this->type = 'kirki-editor';\n\n\t\t}", "function getType ()\n\t{\n\t\tswitch ( $this->get () )\n\t\t{\n\t\t\tcase self::DB_TOKEN:\n\t\t\t\treturn self::DB_TOKEN ;\n\n\t\t\tcase self::SERVICES_TOKEN:\n\t\t\t\treturn self::SERVICES_TOKEN ;\n\n\t\t\tcase self::REST_TOKEN:\n\t\t\t\treturn self::REST_TOKEN ;\n\n\t\t\tcase self::DEV_TOKEN:\n\t\t\t\treturn self::DEV_TOKEN ;\n\t\t}\n\n\t\treturn null ;\n\t}", "public function setToken($token, $token_secret) {}", "public static function setToken($token)\n {\n self::$_data[self::KEY_TOKEN] = $token;\n }", "public function setToken(string $token): void\n {\n $this->token = $token;\n }", "public function tokenType()\n {\n return $this->tokenType;\n }", "public function setToken($token): void\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function setToken($token)\n {\n $this->token = $token;\n }", "public function tokenType()\n {\n return $this->token['token_type'] ?? null;\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => '[email protected]',\n 'password' => 'secret',\n ]);\n\n }", "public function setRememberToken(string $value);", "public function setaccess_token($value);", "public function setRememberToken($value)\n {\n \t$this->setGuarded($this->getRememberTokenName(), $value);\n }", "public static function setToken($token, $iswebhook=false)\n {\n self::$_token = $token;\n self::$_iswebhook = $iswebhook;\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 }", "public function store(string $key, Token $token): void;", "public function get_token( $type = 'access_token' ){\n\t\t$token = NULL;\n\t\tif( $this->token_storage == 'file' ){\n\t\t\tif( is_file($this->token_files[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( file_get_contents($this->token_files[$type]) );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t// add method to get token from cookie\n\t\t\tif( !empty($_COOKIE[$type]) ){\n\t\t\t\t$_token = OAuthToken::from_string( $_COOKIE[$type] );\n\t\t\t\tif( !empty($_token->key) ){\n\t\t\t\t\t$token = $_token;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}" ]
[ "0.6489146", "0.64774925", "0.64372987", "0.63860774", "0.6230153", "0.6160425", "0.61600304", "0.61478716", "0.61260897", "0.61219597", "0.61053824", "0.6061577", "0.604415", "0.60233194", "0.6013377", "0.60046047", "0.60017633", "0.5990302", "0.5976001", "0.5935093", "0.5935093", "0.5885381", "0.58774936", "0.5830756", "0.58073807", "0.5800746", "0.57698053", "0.57517177", "0.5735748", "0.57115954" ]
0.8336535
0
get link to bitbucket auth form. for this we need generate unauth access token and generate link using oauth class
public function get_bitbucket_auth_url(){ if( empty($this->unauth_token) ){ $this->request_unauth_token(); } $auth_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, "GET", $this->oauth_urls['login']); $auth_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token); return $auth_req->to_url(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getTokenUrl()\n {\n return 'https://bitbucket.org/site/oauth2/access_token';\n }", "function accessTokenURL() { return 'https://www.dropbox.com/1/oauth/access_token'; }", "public function bitbucket() {\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$pass = '';\n\t\tif(isset($this->request->get['pass'])){\n\t\t\t$pass = $this->request->get['pass'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\t$owner = '';\n\t\tif(isset($this->request->get['owner'])){\n\t\t\t$owner = $this->request->get['owner'];\n\t\t}\n\n\t\tnew d_shopunity\\Bitbucket($user, $pass, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch, $owner);\n\t}", "protected function getAuthUrl($state)\n {\n return $this->buildAuthUrlFromBase('https://bitbucket.org/site/oauth2/authorize', $state);\n }", "public function getAuthUrl();", "abstract protected function auth_url();", "public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}", "function authenticateURL() { return 'http://www.tumblr.com/oauth/authorize'; }", "public function get_revoke_url() {\n\n $url = new moodle_url('/repository/repository_callback.php');\n $url->param('callback', 'yes');\n $url->param('repo_id', $this->id);\n $url->param('revoke', 'yes');\n $url->param('reloadparentpage', true);\n $url->param('sesskey', sesskey());\n return '<a target=\"_blank\" href=\"'.$url->out(false).'\">'.get_string('revokeyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "abstract protected function token_url();", "function buildAuthUrl($frob ='', $key = '', $secret = '', $perms = 'delete') {\n\t\t$params = array();\n if ($frob != '') {\n $params['frob'] = $frob;\n }\n\t\tif ($key == '') {\n\t\t\t$key = $this->modx->getOption('xflickr.api_key');\n\t\t}\n\t\tif ($secret == '') {\n\t\t\t$secret = $this->modx->getOption('xflickr.api_secret');\n\t\t}\n\t\t$params['api_key'] = $key;\n\t\t$params['perms'] = $perms;\n //return 'http://flickr.com/services/auth/?'.$this->signParams($params);\n $signing = '';\n $values = array();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return 'http://flickr.com/services/auth/?'.implode('&', $values);\n }", "function accessTokenURL() { return 'https://api.twitter.com/oauth/access_token'; }", "abstract public function getAuthorizeUrl(): string;", "public function getBaseAuthorizationUrl()\n {\n return \"https://api.weibo.com/oauth2/authorize\";\n }", "public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' => urlencode( $this->config['access_type'] ),\n\t\t\t'approval_prompt' => urlencode( $this->config['approval_prompt'] )\n\t\t);\n\n\t\treturn self::OAUTH2_AUTH_ENDPOINT . \"?\" . http_build_query( $params );\n\t}", "function get_reddit_oauth_url()\n{\n\t$state = sprintf(\"%s,%s\", time(), hash_hmac('sha256', strval(time()), REDDIT_OAUTH_CLIENT_SECRET));\n\treturn sprintf(\"https://www.reddit.com/api/v1/authorize?client_id=%s&response_type=code&state=%s&redirect_uri=%s&duration=temporary&scope=identity,read,mysubreddits\",\n\t\tREDDIT_OAUTH_CLIENT_ID,\n\t\t$state,\n\t\tget_reddit_redirect_uri()\n\t);\n}", "public function request_access_token( $oauth_verifier, $oauth_token ){\n\t\t// check that values given is not empty\n\t\tif( empty($oauth_token) || empty($oauth_verifier) ){\n\t\t\tthrow new BitBucketException(\"Error getting access token: empty verifier and token\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// check that token is the same as we have\n\t\tif( empty($this->unauth_token) || strcmp($this->unauth_token->key, $oauth_token) != 0 ){\n\t\t\t// we have bad tokens. clean all and generate error\n\t\t\t$this->reset_tokens();\n\t\t\t\n\t\t\tthrow new BitBucketException(\"Error getting access token: wrong unregistered access token.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// request access token\n\t\t$access_token_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['access_token']);\n\t\t$access_token_req->set_parameter('oauth_verifier', $oauth_verifier);\n\t\t$access_token_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\t//pa($access_token_req,1);\n\t\t$access_token_response = $this->curl( $access_token_req->to_url() );\n\t\tif( $access_token_response['status'] != 200 ){\n\t\t\tthrow new BitBucketException(\"BitBucket OAuth: \".$access_token_response['response']);\n\t\t\treturn;\n\t\t}\n\t\n\t\t$token = OAuthToken::from_string( $access_token_response['response'] );\n\t\t\n\t\t//$this->set_token( $token );\n return $token;\n\t}", "public function get_access_token_url() {\n\t\t$access_token_url = self::$_access_token_url;\n\n\t\t/**\n\t\t * Filter access_token_url\n\t\t *\n\t\t * @since 1.3\n\t\t *\n\t\t * @param string $access_token_url\n\t\t */\n\t\t$access_token_url = apply_filters( 'forminator_addon_aweber_oauth_access_token_url', $access_token_url );\n\n\t\treturn $access_token_url;\n\t}", "public function get_login_url() {\n\n $returnurl = new moodle_url('/repository/repository_callback.php');\n $returnurl->param('callback', 'yes');\n $returnurl->param('repo_id', $this->id);\n $returnurl->param('sesskey', sesskey());\n $returnurl->param('reloadparentpage', true);\n\n $url = new moodle_url($this->client->createAuthUrl());\n $url->param('state', $returnurl->out_as_local_url(false));\n return '<a target=\"repo_auth\" href=\"'.$url->out(false).'\">'.get_string('connectyourgoogleaccount', 'repository_googledrive').'</a>';\n }", "abstract protected function getTokenUrl();", "abstract public function url_access_token();", "abstract protected function getAuthUrl($state);", "private function getAuthURL() : string {\n $payload = [\n \"client_id\" => $this->client_data->getClientId(),\n \"scope\" => $this->scope->toString(),\n ];\n\n if ($this->with_redirect) {\n $redirect = $this->client_data->getRedirectUri(1);\n $payload['response_type'] = self::RESPONSE_TYPE_TOKEN;\n } else {\n $redirect = $this->client_data->getRedirectUri(0);\n $payload['response_type'] = self::RESPONSE_TYPE_CODE;\n }\n\n $payload[\"redirect_uri\"] = (empty($this->redirect_params)) ?\n $redirect : $redirect.'?'.http_build_query($this->redirect_params);\n return $this->client_data->getAuthURI(). '?'. http_build_query($payload);\n }", "abstract protected function getTokenUrl(): string;", "public static function build_oauth_url() {\n\n\t\t$response = \"https://login.live.com/oauth20_authorize.srf?client_id=\".client_id.\"&scope=wl.signin%20wl.offline_access%20wl.skydrive_update%20wl.basic&response_type=code&redirect_uri=\".urlencode(callback_uri);\n\n\t\treturn $response;\n\n\t}", "function fsl_gauth_getauthurl()\n\t{\n\t\n\t$gClient = new Google_Client();\n $gClient->setApplicationName('Login');\n $gClient->setClientId(option('clientId'));\n $gClient->setClientSecret(option('clientSecret'));\n $gClient->setRedirectUri(option('redirectURL')); \n\t//\t$gClient->setHd(option('hd')); \n $google_oauthV2 = new Google_Oauth2Service($gClient);\n $authUrl = $gClient->createAuthUrl();\n return $authUrl;\n}", "public function getOAuth()\n {\n }", "public function get_uploaded_url(){\n\t\t$api_url \t= \"https://api002.backblazeb2.com\"; // From b2_authorize_account call\n\t\t$auth_token = \"4_002147cd01b5a680000000000_018d4c36_d47af5_acct_8SQ4r2LRCypwp1wl0rPo1ySwDm4=\"; // From b2_authorize_account call\n\t\t$bucket_id \t= \"d184771c8d50b17b65ba0618\"; // The ID of the bucket you want to upload to\n\n\t\t$session = curl_init($api_url . \"/b2api/v2/b2_get_upload_url\");\n\n\t\t// Add post fields\n\t\t$data = array(\"bucketId\" => $bucket_id);\n\t\t$post_fields = json_encode($data);\n\t\tcurl_setopt($session, CURLOPT_POSTFIELDS, $post_fields); \n\n\t\t// Add headers\n\t\t$headers = array();\n\t\t$headers[] = \"Authorization: \" . $auth_token;\n\t\tcurl_setopt($session, CURLOPT_HTTPHEADER, $headers); \n\n\t\tcurl_setopt($session, CURLOPT_POST, true); // HTTP POST\n\t\tcurl_setopt($session, CURLOPT_RETURNTRANSFER, true); // Receive server response\n\t\t$server_output = curl_exec($session); // Let's do this!\n\t\tcurl_close ($session); // Clean up\n\t\techo ($server_output); // Tell me about the rabbits, George!\n\n\t\t/*\n\t\t{ \t\n\t\t\t\"authorizationToken\": \"4_002147cd01b5a680000000000_018d4c4a_2690fb_upld_YoK-yBz17Mj5QQS60UQ1bVwRtXw=\", \n\t\t\t\"bucketId\": \"d184771c8d50b17b65ba0618\", \n\t\t\t\"uploadUrl\": \"https://pod-000-1126-02.backblaze.com/b2api/v2/b2_upload_file/d184771c8d50b17b65ba0618/c002_v0001126_t0048\" \n\t\t} \n\t\t*/\n\t}", "public function oauth_access() {\n if ( !empty( $_GET[ 'yith-wcbk-google-auth' ] ) && !empty( $_GET[ 'code' ] ) ) {\n $code = $_GET[ 'code' ];\n $data = array(\n 'code' => $code,\n 'client_id' => $this->get_client_id(),\n 'client_secret' => $this->get_client_secret(),\n 'redirect_uri' => $this->redirect_uri,\n 'grant_type' => 'authorization_code',\n );\n\n $params = array(\n 'body' => http_build_query( $data ),\n 'sslverify' => false,\n 'timeout' => 60,\n 'headers' => array(\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ),\n );\n\n $response = wp_remote_post( $this->oauth_url . 'token', $params );\n\n if ( !is_wp_error( $response ) && 200 == $response[ 'response' ][ 'code' ] && 'OK' == $response[ 'response' ][ 'message' ] ) {\n $body = json_decode( $response[ 'body' ] );\n $access_token = sanitize_text_field( $body->access_token );\n $expires_in = isset( $body->expires_in ) ? absint( $body->expires_in ) : HOUR_IN_SECONDS;\n $expires_in -= 100;\n\n $this->set_option( 'refresh-token', $body->refresh_token );\n\n set_transient( 'yith-wcbk-gcal-access-token', $access_token, $expires_in );\n\n $this->debug( 'Access Token generated successfully', compact( 'access_token', 'expires_in', 'body' ) );\n\n $redirect_url = add_query_arg( array( 'page' => 'yith_wcbk_panel', 'tab' => 'google-calendar', ), admin_url( 'admin.php' ) );\n wp_safe_redirect( $redirect_url );\n exit();\n } else {\n $this->error( 'Error while generating Access Token: ', $response );\n }\n }\n }", "public function getAuthURL() {\n\t\treturn $this->authorization_url.\"?response_type=code&client_id=\".$this->clientID.\"&state=\".$this->state.\"&scope=\".$this->scope;\n\t}" ]
[ "0.7426424", "0.64768296", "0.64619845", "0.6458924", "0.6198116", "0.6127109", "0.61120576", "0.6102334", "0.6066051", "0.60398996", "0.6015153", "0.60032076", "0.59596413", "0.5955512", "0.59364957", "0.59046227", "0.59030384", "0.58796096", "0.58597445", "0.58478796", "0.5845561", "0.58334786", "0.5817017", "0.57863873", "0.57796556", "0.57704353", "0.5740738", "0.5731825", "0.572744", "0.5715062" ]
0.79798084
0
get full list of repositories
public function get_repositories(){ $repos = array(); $res = $this->request_api('GET', 'user/repositories', $params = array()); if( !empty($res['response']) ){ $repos = json_decode($res['response']); } //pa($repos,1); return $repos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_repos(){\n\n\t\t\treturn $this->get_github_data( 'all_repos' );\n\n\t\t}", "public function getRepositories()\n {\n return $this->repositories;\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function getRepos()\n {\n return $this->repos;\n }", "public function getRepos()\n {\n return $this->repos;\n }", "function pkg_list_repos() {\n\tglobal $g;\n\n\t$repo_base = \"{$g['pkg_repos_path']}/{$g['product_name']}-repo\";\n\t$result = array();\n\t$name_files = glob(\"{$repo_base}-*.name\");\n\tforeach ($name_files as $name_file) {\n\t\t$repo_name = file_get_contents($name_file);\n\t\tif ($repo_name == false || strlen($repo_name) <= 1) {\n\t\t\tcontinue;\n\t\t}\n\t\t$repo_name_base = \"{$repo_base}-{$repo_name}\";\n\t\t$descr_file = \"{$repo_name_base}.descr\";\n\t\tif (file_exists($descr_file)) {\n\t\t\t$descr = file_get_contents($descr_file);\n\t\t\tif ($descr == false) {\n\t\t\t\t$descr = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$descr = 'Unknown';\n\t\t}\n\t\t$entry = array(\n\t\t 'name' => $repo_name,\n\t\t 'path' => \"{$repo_name_base}.conf\",\n\t\t 'descr' => $descr\n\t\t);\n\t\tif (file_exists(\"{$repo_name_base}.default\")) {\n\t\t\t$entry['default'] = true;\n\t\t}\n\t\t$result[] = $entry;\n\t}\n\n\treturn $result;\n}", "public function listAction()\n {\n $dashboardApi = $this->objectManager->get('Eww\\\\SubhhOaDashboard\\\\Service\\\\DashboardApi');\n $repositories = json_decode($dashboardApi->listRepos());\n $this->view->assign('repositories', $repositories);\n }", "function get_repos() {\n\t\tadd_filter( 'use_fsockopen_transport', '__return_false' );\n\t\tadd_filter( 'use_fopen_transport', '__return_false' );\n\t\tadd_filter( 'use_streams_transport', '__return_false' );\n\t\tadd_filter( 'use_http_extension_transport', '__return_false' );\n\t\t\n\t\t// list all repos\n\t\t$url = 'https://api.github.com/users/' . $this->github_user . '/repos';\n\t\t\n\t\t$args = array(\n\t\t\t'method' => 'GET',\n\t\t\t'sslverify' => false\n\t\t);\n\n\t\t$github = wp_remote_request( $url, $args );\n\t\t\n\t\t// exit on error..\n\t\tif( empty( $github ) || ! empty( $github->errors ) ) {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t\t$github_datas = $github['body'];\n\n\t\t$gits = json_decode( $github_datas );\n\t\t$sort_by = array();\n\t\t\n\t\tif ( is_array( $gits ) ) {\n\n\t\t\tforeach( $gits as $git ) {\n\t\t\t\t$this->repos[] = array( \n\t\t\t\t\t'name' => $git->name,\n\t\t\t\t\t'description' => $git->description,\n\t\t\t\t\t'url' => $git->html_url,\n\t\t\t\t\t'download' => trailingslashit( $git->html_url ) . 'archive/master.zip',\n\t\t\t\t\t'last_update' => $git->updated_at,\n\t\t\t\t\t'stargazers' => $git->stargazers_count,\n\t\t\t\t\t'watchers' => $git->watchers_count\n\t\t\t\t);\n\n\t\t\t\t$sort_by[] = $git->updated_at;\n\t\t\t}\n\n\t\t\tif ( ! empty( $sort_by ) )\n\t\t\t\tarray_multisort( $sort_by, SORT_DESC, $this->repos );\n\n\t\t// Github is not reachable rate limit exceeded\n\t\t} else {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t}", "public function listAction()\n {\n $user = $this->get('security.context')->getToken()->getUser();\n $repositories = $user->getRepositorys();\n\n return array(\n 'name' => $user->getUsernameCanonical(),\n 'repositories' => $repositories\n );\n }", "function getRepositories()\n{\n $repositories = apc_fetch('repositories');\n\n if (empty($features)) {\n $repositories = array(\n \"platform-ui\" => \"PLF UI\",\n \"commons\" => \"Commons\",\n \"ecms\" => \"ECMS\",\n \"social\" => \"Social\",\n \"wiki\" => \"Wiki\",\n \"forum\" => \"Forum\",\n \"calendar\" => \"Calendar\",\n \"integration\" => \"Integration\",\n \"platform\" => \"Platform\",\n \"platform-public-distributions\" => \"PLF Public Dist\",\n \"platform-private-distributions\" => \"PLF Private Dist\");\n apc_store('repositories', $repositories);\n }\n return $repositories;\n}", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function getRepositories() {\n\t\tthrow new CmisNotImplementedException(\"getRepositories\");\n\t}", "public function all(): array\n {\n return $this->repository;\n }", "public function listRepositories($user = null)\n {\n // TODO: Implement listRepositories() method.\n }", "public static function getRepos()\n\t{ return array_keys(self::$__CLASS_REPOS); }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function get_repo_data(){\n\n\t\t\treturn $this->get_repo();\n\n\t\t}", "public function getAllRepositories(Project $project) {\n $repositories = array();\n $repository_list = $this->dao->getProjectRepositoryList($project->getID(), false, false);\n foreach ($repository_list as $row) {\n $repository = new GitRepository();\n $this->dao->hydrateRepositoryObject($repository, $row);\n $repositories[] = $repository;\n }\n return $repositories;\n }", "private function _getRemotes()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$remotes = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'remote ') === 0)\n\t\t\t{\n\t\t\t\t$remotes[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $remotes;\n\t}", "protected function pickRepos(InputInterface $input, OutputInterface $output) {\n $repos = [];\n if ($feedUrl = $input->getOption('git-feed')) {\n $schemes = preg_match(';^file://;', $feedUrl)\n ? ['https', 'http', 'git', 'file']\n : ['https', 'http', 'git'];\n $repos = array_merge($repos, $this->getFilteredFeed($output, $feedUrl, 'ready', $schemes));\n }\n if ($repoDirs = $input->getArgument('git-repos')) {\n $repos = array_merge($repos, $this->getRepos($output, $repoDirs));\n }\n usort($repos, function ($a, $b) {\n return strcmp($a['key'], $b['key']);\n });\n if ($input->getOption('limit')) {\n $repos = array_slice($repos, 0, $input->getOption('limit'));\n return $repos;\n }\n return $repos;\n }", "public function getRepository();", "public function getRepositoryManagers()\n {\n return $this->repositoryManagers;\n }", "public function repositories($team)\n {\n return $this->getClient()->setApiVersion('2.0')->get(\n sprintf('/teams/%s/permissions/repositories', $team)\n );\n }", "public abstract function getRepository();", "public function renderRepos()\n {\n $return = '';\n foreach ($this->getRepos() as $repo) {\n $return .= $repo->render();\n }\n return $return;\n }", "public function getObjectsRepository()\n {\n return $this->objectsRepository;\n }", "abstract public function getRepository();", "abstract public function getRepository();", "public function getContributors()\n {\n $headers = $this->getDefaultHeaders();\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/contributors\",\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;\n }\n\n return array();\n }", "protected function getRepository() {}" ]
[ "0.7705626", "0.76418203", "0.7492119", "0.7314654", "0.7314654", "0.7239375", "0.7146293", "0.7019406", "0.69079113", "0.6827054", "0.6802105", "0.67963254", "0.6763853", "0.6613986", "0.64723444", "0.6465746", "0.64224356", "0.6420928", "0.6393164", "0.6307987", "0.6298603", "0.6235322", "0.61732924", "0.6160522", "0.6139095", "0.6126567", "0.6108943", "0.6108943", "0.6085543", "0.60789937" ]
0.80639696
0
return latest request data object
public function get_last_request(){ return $this->request_data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRequestInfo() {\n\t\treturn $this->_lastInfo;\n\t}", "public function getRequestData();", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "public function getLastRequest()\n\t{\n\t\treturn $this->request;\n\t}", "public function getLastRequestDetails(){\n return $this->lastRequest;\n }", "public function getLastRequest()\n {\n return $this->api->getRequest();\n }", "public function __getLastRequest()\n {\n return $this->lastRequest;\n }", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function lastRequest()\n\t{\n\t\treturn $this->_source->lastRequest();\n\t}", "public function getLastRequest() {\n\t\treturn $this->_lastRequest;\n\t}", "public function getLastRequest() {\n\t\treturn $this->lastRequest;\n\t}", "public function getCurrentObjectData() {}", "public function getRequestData()\n {\n return json_decode($this->requestData);\n }", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "public function getLastRequest()\n {\n return $this->__getLastRequest();\n }", "function get_data() {\r\n return $this->data;\r\n }", "public function getLastRequest()\n {\n return $this->lastRequest;\n }", "public function getLastRequest()\n {\n return $this->lastRequest;\n }", "function get_http_request() {\n\n return $this->last_request;\n\n}", "public function getRequest()\n {\n return $this->data->request;\n }", "private function getRequest() {\n return json_decode(request()->getContent(), true);\n }", "public function getInfo() \n {\n return $this->requestInfo;\n }", "public function get_last_response(){\n\t\treturn $this->response_data;\n\t}", "function getData() {\n return $this->body->getResponse();\n }", "function fetch_data_new()\n\t{\n\t\treturn $this->data_new;\n\t}", "protected function getRequestData()\n {\n return \\Includes\\Utils\\ArrayManager::filterByKeys(\n \\XLite\\Core\\Request::getInstance()->getData(),\n array('paymentStatus', 'shippingStatus', 'adminNotes')\n );\n }" ]
[ "0.69530255", "0.67911565", "0.66613835", "0.6658175", "0.65849525", "0.64678776", "0.64452755", "0.6433375", "0.6411604", "0.6396211", "0.6328266", "0.6296001", "0.62485504", "0.62413526", "0.62413526", "0.62413526", "0.62413526", "0.62413526", "0.62210417", "0.62132514", "0.6205248", "0.6205248", "0.61963737", "0.61886317", "0.6160298", "0.61502564", "0.6147321", "0.6123985", "0.61160207", "0.61109346" ]
0.7578701
0
return latest response data object
public function get_last_response(){ return $this->response_data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "abstract protected function getReponseData() ;", "function last_response() {\n\t\treturn $this->last_response;\n\t}", "public function getLastResponse()\n\t{\n\t\treturn $this->response;\n\t}", "public function getLastResponse() {}", "function getData() {\n return $this->body->getResponse();\n }", "public function getResponseData();", "public function getLastResponseInfo() {}", "public function getLastResponse() {\n\t\treturn $this -> data['lastResponse'];\n\t}", "public function lastResponse()\n\t{\n\t\treturn $this->_source->lastResponse();\n\t}", "public function getResponse()\n {\n return $this->lastResponse;\n }", "public function getData()\n {\n return (object) $this->_response;\n }", "public function __getLastResponse()\n {\n return $this->lastResponse;\n }", "function get_response() {\n return $this->response;\n }", "public function get_response_object()\n {\n }", "public function get_last_request(){\n\t\treturn $this->request_data;\n\t}", "public function lastResponse(): Response\n\t{\n\t\treturn $this->lastResponse;\n\t}", "public function _getLastdateResponse() {\n\t\treturn $this->_lastdateResponse;\n\t}", "function get_http_response() {\n\n return $this->last_response;\n\n}", "public function getLastParsedResponse()\n {\n return $this->_lastParsedResponse;\n }", "public function getLastParsedResponse()\n\t{\n\t\treturn $this->_lastParsedResponse;\n\t}", "public function getResponseData()\n {\n return $this->responseData;\n }", "public function getResponseData()\n {\n if($this->getHttpStatusCode() === 200){\n try{\n $resp = $this->getResponse();\n if(isset($resp->data)){\n $this->responseData = $resp->data;\n }\n }catch (Exception $e){\n\n }\n }\n return $this->responseData;\n }", "public function getLastResponse() {\n\t\treturn $this->_lastResponse;\n\t}", "public function getLastResponse() {\n\t\treturn $this->_lastResponse;\n\t}", "public function getLastResponse()\r\n\t{\r\n\t\treturn array('headers' => $this->response_headers[count($this->response_headers)-1],\r\n\t\t'content' => $this->response_content);\r\n\t}" ]
[ "0.72404695", "0.72404695", "0.72404695", "0.72404695", "0.72404695", "0.69836754", "0.6947016", "0.6891599", "0.6862214", "0.6814671", "0.68006873", "0.6797456", "0.6758123", "0.67487186", "0.672967", "0.672017", "0.6708467", "0.66864026", "0.66295123", "0.6601303", "0.6575829", "0.65647554", "0.6562489", "0.65475136", "0.65342236", "0.6532228", "0.65179956", "0.6514714", "0.6514714", "0.6512921" ]
0.7674824
0
Get data mapper lazy load Model_TagMapper instance if no mapper registered
public function getMapper() { if (null === $this->_mapper) { $this->setMapper(new Model_TagMapper()); } return $this->_mapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getMapper()\n {\n if (is_null($this->_mapper)) {\n $this->_mapper = new TagsMapper($this->db());\n }\n\n return $this->_mapper;\n }", "public function getMapper()\n {\n if ($this->_mapper === null) {\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true);\n\n if (class_exists('\\Atezate\\Mapper\\Sql\\Tipos')) {\n\n $this->setMapper(new \\Atezate\\Mapper\\Sql\\Tipos);\n\n } else {\n\n Throw new \\Exception(\"Not a valid mapper class found\");\n }\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(false);\n }\n\n return $this->_mapper;\n }", "public function getMapper(){ \n $mapper = new Wf_Model_WfProcesso_Mapper();\n return $mapper;\n }", "protected function getMapper()\n {\n return $this->mapper;\n }", "public function getMapper(){ \n $mapper = new Profile_Model_ObjectView_Mapper();\n return $mapper;\n }", "public function getMapper()\n \t{ \n \t if (null === $this->_mapper) {\n \t \tif (isset($this->_mapperClass)) {\n \t \t\t$mapper_class = $this->_mapperClass;\n \t \t} else {\n\t \t\t\t\t$mapper_class = get_class($this).\"Mapper\";\n \t }\n \t $this->setMapper(new $mapper_class());\n \t }\n \t return $this->_mapper;\n \t}", "public function getMapper()\n {\n if ($this->_mapper === null) {\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true);\n\n if (class_exists('\\Klikasi\\Mapper\\Sql\\Newsletter')) {\n\n $this->setMapper(new \\Klikasi\\Mapper\\Sql\\Newsletter);\n\n } else {\n\n new \\Exception(\"Not a valid mapper class found\");\n }\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(false);\n }\n\n return $this->_mapper;\n }", "function get_mapper()\n {\n return $this->_mapper;\n }", "function getMapper() {\n return $this->mapper;\n }", "public function getMapper(){ \n $mapper = new Ca_Model_Cidade_Mapper();\n return $mapper;\n }", "private function _getMapper()\n {\n if (is_null($this->_mapper)) {\n $this->_mapper = new CommentMapper($this->db());\n }\n\n return $this->_mapper;\n }", "public function getMapper()\r\n {\r\n if (null === $this->_mapper) {\r\n $className = get_class($this);\r\n if(preg_match(\"/^TrustCare_Model_(.*)$/\", $className, $matches)) {\r\n $mapperClassName = \"TrustCare_Model_Mapper_\" . $matches[1];\r\n $this->setMapper(new $mapperClassName($this->_mapperOptions));\r\n }\r\n }\r\n return $this->_mapper;\r\n }", "public function getMapper()\n {\n if ($this->_mapper === null) {\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true);\n\n if (class_exists('\\Klikasi\\Mapper\\Sql\\Kanpaina')) {\n\n $this->setMapper(new \\Klikasi\\Mapper\\Sql\\Kanpaina);\n\n } else {\n\n new \\Exception(\"Not a valid mapper class found\");\n }\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(false);\n }\n\n return $this->_mapper;\n }", "public function getMapper() {\n if (null === $this->_mapper) {\n $this->setMapper(new Application_Model_CategoryMapper());\n }\n return $this->_mapper;\n }", "public function getMapper()\n {\n if ($this->_mapper === null) {\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true);\n\n if (class_exists('\\Atezate\\Mapper\\Sql\\Cubos')) {\n\n $this->setMapper(new \\Atezate\\Mapper\\Sql\\Cubos);\n\n } else {\n\n new \\Exception(\"Not a valid mapper class found\");\n }\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(false);\n }\n\n return $this->_mapper;\n }", "public function getMapper()\n {\n if (!$this->mapper) {\n if ($this->hasOption('mapper')) {\n $this->mapper = $this->getOption('mapper');\n\n } else {\n\t $className = $this->getClassName();\n\t if (!$className) {\n \t throw new Zeal_Model_Exception('Unable to retrieve mapper for association \\''.htmlspecialchars($className).'\\' as the class name has not been set');\n\t }\n\n\t $this->mapper = Zeal_Orm::getMapper($className);\n }\n }\n\n return $this->mapper;\n }", "public function getMapper ()\r\n {\r\n if (null === $this->_mapper) {\r\n $this->setMapper(new Tnp_Model_Mapper_Company());\r\n }\r\n return $this->_mapper;\r\n }", "public function mapper() {\n\t\tif(is_null($this -> _mapper)){\n\t\t\t$config = array(\n\t\t\t\t'db' => $this -> getAdapter(),\n\t\t\t\t'table' => $this -> _name,\n\t\t\t\t'map' => $this -> _referenceMap\n\t\t\t);\n\t\t\tif(!class_exists($this -> _mapperClass)){\n\t\t\t\tthrow new Lionite_Db_Exception('mapper class \"' . $this -> _mapperClass . \"' does not exists\");\n\t\t\t} else {\n\t\t\t\t$this -> _mapper = new $this -> _mapperClass($config);\n\t\t\t}\n\t\t}\n\t\treturn $this -> _mapper;\n\t}", "public function getMapper(){ \n $mapper = new Frota_Model_Veiculo_Mapper();\n return $mapper;\n }", "public function getMappedObject()\n {\n if ($this->_mappedObject === null) {\n $model = EmailTagObjectMap::model()->with('tag')->find(\n 'tag.layout_id = :layout_id', array(\n ':layout_id' => $this->id\n ));\n if ($model) {\n $this->_mappedObject = $model->object;\n }\n }\n\n return $this->_mappedObject;\n }", "abstract protected function getMapper(): MapperInterface;", "public function getMapper()\n {\n if (null === $this->_mapper) {\n $this->setMapper(new Petolio_Model_PoFilesMapper());\n }\n return $this->_mapper;\n }", "public function dataMapper(): DataMapperInterface {\n\n if (null == $this->dataMapper) {\n $this->dataMapper = new CommentDislikeMapper();\n }\n return $this->dataMapper;\n }", "public function getMapper(){ \n $mapper = new Ca_Model_RegraContrato_Mapper();\n return $mapper;\n }", "public function getDataMapper() {}", "public function getMapper()\n {\n if (null === $this->_mapper) {\n $this->setMapper(new Maerdo_Model_Mappers_Page());\n }\n return $this->_mapper;\n }", "public static function mapper(){\n return new Mapper;\n }", "public function getMapper()\n {\n if ($this->_mapper === null) {\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(true);\n\n if (class_exists('\\Atezate\\Mapper\\Sql\\Mensajes')) {\n\n $this->setMapper(new \\Atezate\\Mapper\\Sql\\Mensajes);\n\n } else {\n\n Throw new \\Exception(\"Not a valid mapper class found\");\n }\n\n \\Zend_Loader_Autoloader::getInstance()->suppressNotFoundWarnings(false);\n }\n\n return $this->_mapper;\n }", "public function dataMapper(): DataMapperInterface {\n\n if (null == $this->dataMapper) {\n $this->dataMapper = new VideoMapper();\n }\n return $this->dataMapper;\n }", "public function getMapper()\n\t{\n\t\t\n\t\treturn $this->__mapper;\n\t\t\n\t}" ]
[ "0.80331016", "0.6673173", "0.660674", "0.656376", "0.6533292", "0.6515496", "0.64915866", "0.64575076", "0.6437719", "0.6420881", "0.6413027", "0.6396896", "0.6395061", "0.6377777", "0.6352423", "0.6328168", "0.6325328", "0.6277779", "0.6263647", "0.6223011", "0.6216759", "0.613905", "0.61075455", "0.60896623", "0.6053304", "0.604934", "0.6041324", "0.6027746", "0.60003245", "0.59748536" ]
0.7833199
1
Check to see if a cookie with the specified name is set to be sent with the resource.
public function has_cookie($name) { if (isset($this->_cookies[$name])) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasCookie($name)\n {\n // check if request has specific cookie\n return (isset($this->cookies[$name]) && $this->cookies[$name]->getName() === $name);\n }", "public static function has(string $name): bool\n {\n return isset($_COOKIE[$name]);\n }", "public function has($name)\n\t{\n\t\tif (isset($this->cookies[$name])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tif (isset($_COOKIE[\"{$this->prefix}$name\"])) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public static function exists($name){\n\t\treturn isset($_COOKIE[$name]);\n\t}", "public static function exists($name){\n return (isset($_COOKIE[$name])) ? true : false;\n }", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}", "public static function exists($name) {\n\t\t\treturn (isset($_COOKIE[$name])) ? true : false;\n\t\t}", "public static function exists($name) {\n return (isset($_COOKIE[$name])) ? true : false;\n }", "public static function exists(string $name) : bool {\n\n\t\t\treturn isset($_COOKIE[$name]);\n\t\t}", "protected function _hasCookie($cookie_name)\n {\n\n if (!$this->request->hasCookie($cookie_name))\n {\n Cookie::queue(Cookie::forever($cookie_name, 1)); //Cookie::forever($cookie_name, '1');\n return false;\n }\n else\n {\n return true;\n }\n\n }", "public static function exists($name){\n\t\treturn (isset($_COOKIE[$name])) ? true : false;\t\t\t\t// Returns similar to the session method for the name we have defined and see if the cookie has been set.\n\t}", "public function isCookieSet() {}", "public function is_cookie_set()\n {\n }", "public function hasCookie($name)\n {\n return (bool) $this->getCookie($name);\n }", "public function cookie($name);", "public static function exists($name)\r\n\t{\r\n\t\t$name = \\Filter::systemID($name);\r\n\t\treturn (array_key_exists($name, $_COOKIE) ? true : false);\r\n\t}", "public function cookieIsset() {\n\t\tif(isset($_COOKIE[$this->cookieName])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function get_cookie($name) {\n if (isset($this->_cookies[$name])) {\n return $this->_cookies[$name];\n } else {\n return false;\n }\n }", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function cookie($name) {\n return isset($this->cookies[$name])? $this->cookies[$name] : null;\n }", "public function cookieExists() {\n if (isset($_COOKIE[$this->cookie['name']])){\n return true;\n }\n\n return false;\n }", "public function getCookie($name)\n {\n\n }", "public function iShouldSeeCookie($cookie_name) {\n if($this->getSession()->getCookie('welcome_info_name') == $cookie_name) {\n return TRUE;\n } else {\n throw new Exception('Cookie not found');\n }\n }", "function wpgplus_get_cookie($name) {\n\t$my_cookie = get_transient('wpgplus_cookie_'. $name);\n\t// wpgplus_debug(\"\\nCookie is \" . print_r($my_cookie,true) . \"\\n\");\n\t// Cookies which have an expiration date and it is passed should not be returned\n\tif(!$my_cookie || ((!empty($my_cookie->expires)) && ($my_cookie->expires < time()))) {\n\t\t//wpgplus_debug(\"\\nNo cookies found for \". $name . \"\\n\");\n\t\treturn false;\n\t} else {\n\t\t//wpgplus_debug(\"\\nGetting cookie for \". $my_cookie->name . \"\\n\");\n\t\treturn $my_cookie;\n\t}\n}", "function isCookieSet (){\n if (empty ($_COOKIE['id'])){\n header (\"location: error.php\");\n }\n}", "public static function getCookie($name)\r\n\t{\r\n\t\t$name = \\Filter::systemID($name);\r\n\t\tif(!self::exists($name))\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn $_COOKIE[$name];\r\n\t}", "function check_cookie($p)\n{\n\tif(isset($_COOKIE['star_'.$p])) \n\t{ \n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t} \n}", "public function get_cookie($name){\n\t\t$this->load->helper('cookie');\n\t\tif ($this->input->cookie($name,true)!=NULL) {\n\t\t\techo $this->input->cookie($name,true);\n\t\t}else{\n\t\t\techo \"no cookie\";\n\t\t}\n\t}", "public static function kapee_cookikapee_accepted() {\n\t\treturn ( isset( $_COOKIE[self::$cookie['name']] ) && strtoupper( $_COOKIE[self::$cookie['name']] ) === self::$cookie['value'] );\n\t}", "public static function exists (string $cookie_name)\n {\n if (isset($_COOKIE[$cookie_name])){\n return true;\n }\n return false;\n }" ]
[ "0.76351297", "0.7617596", "0.74578816", "0.73894846", "0.7386277", "0.73257315", "0.73257315", "0.7323662", "0.7298472", "0.7285768", "0.72560036", "0.712839", "0.7117388", "0.70660734", "0.7065507", "0.6981492", "0.696424", "0.6844268", "0.67810225", "0.6754813", "0.67236423", "0.6675621", "0.6674017", "0.6596786", "0.6575303", "0.6561005", "0.64904875", "0.64717317", "0.64717096", "0.64398664" ]
0.77164847
0
Returns method detail by given param Priority: $id > $cam > $tag
public function get_detail($id, $cam, $tag) { $method = new Methods($id); if(!$method->id) { $method = $method->where('CAM', $cam ? $cam : "NONSENSE!@#")->get_one(); if(!$method->id) { $method = $method->where('idTag', $tag ? $tag : "NONSENSE!@#")->get_one(); } if(!$method->id) { ResponseBuilder::not_found('Method not found.'); } } $result = array ( 'id' => $method->id, 'name' => $method->name, 'keywords' => $method->keywords, 'description' => $method->description, 'reference' => $method->references, 'CAM' => $method->CAM, 'created' => $method->createDateTime ); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tagDetails($id);", "public function getDetail(int $id)\n {\n }", "public function get_method();", "public function getDetail();", "public function info($id)\r\n {\r\n }", "function getOrderDetails($id)\n {\n }", "public function methodName($id = null)\n {\n if(!$id) return;\n\n return $this->methods()->groupBy('id')->get($id)->first();\n }", "public function get_method()\n {\n }", "public function get_detail_only_tag($param){\n $tag_relation = $this->_get_relation_list($param);\n\n\n $result = array();\n if($tag_relation && ! empty($tag_relation)){\n foreach( (array) $tag_relation as $item ){\n $tag_id = $item['tag_id'];\n $result[] = $this->get_single_detail($tag_id);\n }\n return $result;\n }\n\n return false;\n\n }", "public function returnDetailFindByPK($id);", "public function detail($id)\n {\n //\n }", "function tag($id)\n{\n global $app;\n\n $details = $app->calibre->tagDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug(\"no tag\");\n $app->notFound();\n }\n $app->render('tag_detail.html', [\n 'page' => mkPage(getMessageString('tag_details'), 4, 3),\n 'tag' => $details['tag'],\n 'books' => $details['books']]);\n}", "function getPriority() ;", "function getPriority() ;", "function getPriority() ;", "function getPriority() ;", "function getPriority() ;", "function getPriority() ;", "function getPriority() ;", "function actionsForGetMethod()\n {\n if (isset($this->id)) { /* If the variable id exists, it request to the model for the specific element */\n $data = $this->api->get($this->id);\n } else { /* If it does not exist, request all the elements */\n $data = $this->api->get();\n }\n\n /* It eliminates the last element of the array $ data, since usually, it usually brings two elements,\n one with the information, and another NULL which is not needed */\n array_pop($data);\n\n if (count($data) == 0) {\n /* If the variable id exists but the array of $ data does not produce a result,\n it means that the element does not exist */\n if (isset($this->id)) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n /* But if the variable id exists and does not bring $ data, since we do not look for a specific\n element, it means that the entity has no elements to show */\n $this->print_json(204, \"Not Content\", null);\n }\n } else {\n $this->print_json(200, \"OK\", $data); /* Print the requested information */\n }\n }", "public function methodAction() {\n\tif($this->_getParam('id',false)) {\n\t$methods = new DiscoMethods();\n\t$this->view->methods = $methods->getDiscmethodInformation($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function getPriority();", "public function getPriority();", "public function getPriority();", "public function getPriority();", "public function getPriority();", "public function getPriority();", "public function getPriority();", "abstract public function getDetails();", "public function readInfoById() {\t\t\n\t\t$fnName = \"getId\";\n\t\t$_id = -1;\n\t\t\n\t\t$_nombre = get_class( $this ) ;\n\t\t$result = null;\n\t\t$params = array();\n\t\t\n\t\tforeach(get_class_methods( $this ) as $id => $vl){\n\t\t\tif( strtolower( $vl ) == strtolower( $fnName ) ){\n\t\t\t\t$_id = $this->$fnName();\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( $_id > 0 ){\n\t\t\t$stmt = null;\n\t\t\t\n\t\t\t$query = \"SELECT * FROM \" . strtolower( $_nombre ) . \" WHERE id = ?\";\n\t\t\tif ($stmt = self::$lnk->prepare($query)) {\n\t\t\t\t$stmt->bind_param(\"i\", $_id);\n\t\t\t $stmt->execute();\n\t\t\t \n\t\t\t\t$meta = $stmt->result_metadata(); \n\t\t\t while ($field = $meta->fetch_field()) {\n\t\t\t \t$params[] = &$row[ $field->name ]; \n\t\t\t } \n\t\t\t\n\t\t\t call_user_func_array(array($stmt, 'bind_result'), $params); \n\t\t\t \n\t\t\t while ($stmt->fetch()) {\n\t\t\t \t$o = new $_nombre();\n\t\t\t foreach($row as $key => $val) {\n\t\t\t $o->{ \"set\" . Singleton::toCap($key)}( $val );\n\t\t\t } \n\t\t\t $result = $o;\t\t\t \n\t\t\t }\n\t\t\t $stmt->close();\n\t\t\t}else{\n\t\t\t\t$this->mensaje_error = self::$lnk->error;\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn $result;\n\t\t\n\t}" ]
[ "0.5922491", "0.529967", "0.5266663", "0.5235761", "0.523121", "0.5224706", "0.51889694", "0.51374996", "0.51306504", "0.50790787", "0.5074722", "0.50576276", "0.5018995", "0.5018995", "0.5018995", "0.5017898", "0.5016821", "0.5016821", "0.5016821", "0.5016273", "0.50147784", "0.5013813", "0.5013813", "0.5013813", "0.5013813", "0.5013813", "0.5013813", "0.5013813", "0.5011704", "0.49830067" ]
0.65500635
0
Init route flags value for controller with absolute namespace.
protected function initCtrlHasAbsNamespace () { if (mb_strpos($this->controller, '//') === 0) $this->flags |= static::FLAG_CONTROLLER_ABSOLUTE_NAMESPACE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __di_init_service_route () {\n $this->route = $this->constant(new GoDiService_Route_Property($this));\n }", "public function __construct()\n {\n $this->routes = array();\n }", "private function init_route(){\n if(array_key_exists ( $this->uri_request , $this->web )){\n /*\n * check controller folder exist\n */\n if(is_dir(_CONTROLLER)){\n\n if(is_file(_CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'])){\n $this->controller_path = _CONTROLLER.\"/\".$this->web[$this->uri_request]['controller'];\n $this->controller = basename(explode(\".\",$this->controller_path)[0]);\n $this->method = $this->web[$this->uri_request]['method'];\n }\n else{\n $ERROR = \"Controller not found!\";\n }\n\n }\n else{\n $ERROR = \"Controller path not set properly!\";\n }\n\n\n }\n else{\n $ERROR = \"route not found!\";\n }\n\n // echo $controller;\n\n }", "public function __construct()\n {\n if (Registry::isKeySet('route')) {\n\n $this->route = Registry::get('route');\n\n }\n\n }", "protected function init() {\n\t\t$routes = $this->routePluginManager;\n\t\tforeach ( array (\n\t\t\t\t'hostname' => __NAMESPACE__ . '\\Hostname',\n\t\t\t\t'literal' => __NAMESPACE__ . '\\Literal',\n\t\t\t\t'part' => __NAMESPACE__ . '\\Part',\n\t\t\t\t'regex' => __NAMESPACE__ . '\\Regex',\n\t\t\t\t'scheme' => __NAMESPACE__ . '\\Scheme',\n\t\t\t\t'segment' => __NAMESPACE__ . '\\Segment',\n\t\t\t\t'wildcard' => __NAMESPACE__ . '\\Wildcard',\n\t\t\t\t'query' => __NAMESPACE__ . '\\Query',\n\t\t\t\t'method' => __NAMESPACE__ . '\\Method' \n\t\t) as $name => $class ) {\n\t\t\t$routes->setInvokableClass ( $name, $class );\n\t\t}\n\t\t;\n\t}", "function init(){\n\t\t//$uri = str_replace(BASE_URL,\"\",\"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t$uri = str_replace(BASE_URL,\"\",\"//\" . HOST . REQUEST);\n\t\t$this->route($uri);\n\t}", "public function initialize() {\n $this->setPaths(\n [\n 'namespace' => 'ReIndex\\Controller',\n 'controller' => 'footer'\n ]);\n\n $this->setHostname(Di::getDefault()['config']['application']['domainName']);\n\n $this->addGet('/tour/', ['action' => 'tour']);\n $this->addGet('/help/', ['action' => 'help']);\n $this->addGet('/legal/', ['action' => 'legal']);\n $this->addGet('/privacy/', ['action' => 'privacy']);\n $this->addGet('/careers/', ['action' => 'career']);\n $this->addGet('/advertising/', ['action' => 'advertising']);\n $this->addGet('/contacts/', ['action' => 'contact']);\n $this->addGet('/info/', ['action' => 'info']);\n }", "abstract public function getRoutePrefix();", "private function routeConfiguration()\n {\n return [\n 'domain' => null,\n 'namespace' => 'SquareetLabs\\LaravelSmsUp\\Http\\Controllers',\n 'prefix' => 'smsup'\n ];\n }", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}", "public function _set_routing()\n\t{\n\t\t// Load the routes.php file.\n\t\t$route = $this->CI->config->get('routes.php', 'route');\n\n\t\t// Set route remapping\n\t\t$this->routes = is_array($route) ? $route : array();\n\t\tunset($route);\n\n\t\t// Set the default controller so we can display it in the event\n\t\t// the URI doesn't correlate to a valid controller.\n\t\t$this->default_controller = empty($this->routes['default_controller'])\n\t\t\t? FALSE : strtolower($this->routes['default_controller']);\n\n\t\t// Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n\t\t// since URI segments are more search-engine friendly, but they can optionally be used.\n\t\t// If this feature is enabled, we will gather the directory/class/method a little differently\n\t\t$ctl_trigger = $this->CI->config->item('controller_trigger');\n\t\tif ($this->CI->config->item('enable_query_strings') === TRUE && isset($_GET[$ctl_trigger]))\n\t\t{\n\t\t\t$segments = array();\n\n\t\t\t// Add directory segment if provided\n\t\t\t$dir_trigger = $this->CI->config->item('directory_trigger');\n\t\t\tif (isset($_GET[$dir_trigger]))\n\t\t\t{\n\t\t\t\t$segments[] = trim($this->CI->uri->_filter_uri($_GET[$dir_trigger]));\n\t\t\t}\n\n\t\t\t// Add controller segment - this was qualified above\n\t\t\t$class = trim($this->CI->uri->_filter_uri($_GET[$ctl_trigger]));\n\t\t\t$segments[] = $class;\n\n\t\t\t// Add function segment if provided\n\t\t\t$fun_trigger = $this->CI->config->item('function_trigger');\n\t\t\tif (isset($_GET[$fun_trigger]))\n\t\t\t{\n\t\t\t\t$segments[] = trim($this->CI->uri->_filter_uri($_GET[$fun_trigger]));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Fetch the complete URI string, remove the suffix, and explode\n\t\t\t$this->CI->uri->_fetch_uri_string();\n\t\t\t$this->CI->uri->_remove_url_suffix();\n\t\t\t$this->CI->uri->_explode_segments();\n\t\t\t$segments = $this->CI->uri->segments;\n\t\t}\n\n\t\t// Set the route stack\n\t\t$this->_set_request($segments);\n\t}", "public function getSystemRoutes();", "protected function _set_routing()\n {\n // Load the routes.php file. It would be great if we could\n // skip this for enable_query_strings = TRUE, but then\n // default_controller would be empty ...\n if (file_exists(APPPATH.'config/routes.php'))\n {\n include(APPPATH.'config/routes.php');\n }\n\n if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/routes.php'))\n {\n include(APPPATH.'config/'.ENVIRONMENT.'/routes.php');\n }\n\n // Validate & get reserved routes\n if (isset($route) && is_array($route))\n {\n /*\n * Updated for codefight cms\n * to be @deprecated as now we have custom router files\n * see @ apppath / modules / routes\n */\n //$this->routes = $route;\n //$_route = $this->_generate_auto_routes();\n //$route = array_merge($_route, $route);\n /*---END---*/\n\n\n isset($route['default_controller']) && $this->default_controller = $route['default_controller'];\n isset($route['translate_uri_dashes']) && $this->translate_uri_dashes = $route['translate_uri_dashes'];\n unset($route['default_controller'], $route['translate_uri_dashes']);\n $this->routes = $route;\n }\n\n // Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n // since URI segments are more search-engine friendly, but they can optionally be used.\n // If this feature is enabled, we will gather the directory/class/method a little differently\n if ($this->enable_query_strings)\n {\n // If the directory is set at this time, it means an override exists, so skip the checks\n if ( ! isset($this->directory))\n {\n $_d = $this->config->item('directory_trigger');\n $_d = isset($_GET[$_d]) ? trim($_GET[$_d], \" \\t\\n\\r\\0\\x0B/\") : '';\n\n if ($_d !== '')\n {\n $this->uri->filter_uri($_d);\n $this->set_directory($_d);\n }\n }\n\n $_c = trim($this->config->item('controller_trigger'));\n if ( ! empty($_GET[$_c]))\n {\n $this->uri->filter_uri($_GET[$_c]);\n $this->set_class($_GET[$_c]);\n\n $_f = trim($this->config->item('function_trigger'));\n if ( ! empty($_GET[$_f]))\n {\n $this->uri->filter_uri($_GET[$_f]);\n $this->set_method($_GET[$_f]);\n }\n\n $this->uri->rsegments = array(\n 1 => $this->class,\n 2 => $this->method\n );\n }\n else\n {\n $this->_set_default_controller();\n }\n\n // Routing rules don't apply to query strings and we don't need to detect\n // directories, so we're done here\n return;\n }\n\n // Is there anything to parse?\n if ($this->uri->uri_string !== '')\n {\n $this->_parse_routes();\n }\n else\n {\n $this->_set_default_controller();\n }\n }", "public function __construct() {\n $this->redirectTo = config('lyra.routes.web.prefix');\n parent::__construct();\n }", "function rest_api_init() {\n\trest_api_register_rewrites();\n\n\tglobal $wp;\n\t$wp->add_query_var( 'rest_route' );\n}", "public function setRouting()\n {\n // Are query strings enabled in the config file? Normally CI doesn't utilize query strings\n // since URI segments are more search-engine friendly, but they can optionally be used.\n // If this feature is enabled, we will gather the directory/class/method a little differently\n $segments = array();\n $enableQueryStrings = Fly::getConfig('enableQueryStrings');\n $ct = Fly::getConfig('aliasController');\n $dt = Fly::getConfig('aliasModule');\n $ft = Fly::getConfig('aliasAction');\n\n if ($enableQueryStrings === true && isset($_GET[$ct])) {\n\n if (isset($_GET[$dt])) {\n $this->setModule(trim($this->uri->filterUri($_GET[$dt])));\n $segments[] = $this->fetchModule();\n }\n\n if (isset($_GET[$ct])) {\n $this->setClass(trim($this->uri->filterUri($_GET[$ct])));\n $segments[] = $this->fetchClass();\n }\n\n if (isset($_GET[$ft])) {\n $this->setMethod(trim($this->uri->filterUri($_GET[$ft])));\n $segments[] = $this->fetchMethod();\n }\n }\n\n // Load the routes.php file.\n Fly::app()->loadConfig('config.routes', true, true);\n $route = Fly::app()->getConfig('routes');\n $this->routes = (!isset($route) || !is_array($route)) ? array() : $route;\n unset($route);\n\n // Set the default controller so we can display it in the event\n // the URI doesn't correlated to a valid controller.\n $this->default_controller = (!isset($this->routes['defaultController']) || $this->routes['defaultController'] == '') ? false : $this->routes['defaultController'];\n\n // Were there any query string segments? If so, we'll validate them and bail out since we're done.\n if (count($segments) > 0) {\n $r = $this->validateRequest($segments);\n if ($r === null) {\n return array();\n }\n if (isset($r['segments'])) {\n return $r['segments'];\n }\n return array();\n }\n\n // Fetch the complete URI string\n $this->uri->fetchUriString();\n\n // Is there a URI string? If not, the default controller specified in the \"routes\" file will be shown.\n if ($this->uri->getUriString() == '') {\n return $this->setDefaultController();\n }\n\n // Do we need to remove the URL suffix?\n $this->uri->removeUrlSuffix();\n\n // Compile the segments into an array\n $this->uri->explodeSegments();\n\n // Parse any custom routing that may exist\n $this->parseRoutes();\n\n // Re-index the segment array so that it starts with 1 rather than 0\n $this->uri->reindexSegments();\n }", "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function __construct() {\n\t\n\t\t\tparent::__construct();\n\t\t\t\n\t\t//\tSet active table to \"route\":\n\t\t\t$this->active_table_set('route');\n\t\t\t\n\t\t//\tGet all routes on scope:\n\t\t\t$options = array();\n\t\t\t\n\t\t\t$scope = APPLICATION === ''? 'ROOT' :'APP';\n\t\t\t$options['where'] = '`scope` = \"'.$scope.'\"';\t\t\n\t\t\t$options['orderby'] = 'CHAR_LENGTH(`path`) DESC';\n\t\t\t\n\t\t\t$routes = $this->active_table->select_all($options);\n\t\t\tforeach ($routes as $route){\n\t\t\t\t$this->routes[$route['path']] = $route;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t//\tGet route to controller:\n\t\t\t$route = reset($routes);\n\t\t\tdo {\n\t\t\t\t$result = str_starts(strtolower(trim($route['path'])).'/', '/'.ROUTE.'/') ? true : false;\n\t\t\t\t$this_route = $route;\n\t\t\t\t$route = next($routes);\n\t\t\t} while ($result === false && $route !== false );\n\t\t\t\n\t\t\t\n\t\t\t//\tStop if no match could be made:\n\t\t\t\tif ($result === false ) { return; }\n\t\t\t\n\t\t\t// \tCheck is path is disabled (for scope: \"APP\" only):\n\t\t\t\tif ($scope === 'APP' ) {\n\t\t\t\t\tif ( $this->is_route_available( $this_route['ID']) === false) { return; }\n\t\t\t\t}\n\t\t\t\t$this->route_to_controller = $this_route;\n\t\t\t\t\n\t\t\t//\tStart of crumb:\n\t\t\t\tif (APPLICATION != ''){\n\t\t\t\t\t$crumb= array();\n\t\t\t\t\t$crumb['name'] = TXT_LBL_HOME;\n\t\t\t\t\t$crumb['path'] = HOME;\n\t\t\t\t\t$this->crumbs[] = $crumb;\n\t\t\t\t\t\n\t\t\t\t\t$crumb['name'] = APPLICATION;\n\t\t\t\t\t$crumb['path'] = PATH_;\n\t\t\t\t\t$this->crumbs[] = $crumb;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (APPLICATION == '' && $this->request[0] != ''){\n\t\t\t\t\t$crumb= array();\n\t\t\t\t\t$crumb['name'] = TXT_LBL_HOME;\n\t\t\t\t\t$crumb['path'] = HOME;\n\t\t\t\t\t$this->crumbs[] = $crumb;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\tif ($this->request[0] == '') {return;}\n\t\t\t\t\n\n\t\t\t//\tGet paths that are disabled (on menu):\n\t\t\t\t$routes_disabled = array();\n\t\t\t\t$sql = 'SELECT `ROUTE_ID` FROM `menu_disable` WHERE `APP` = \"'.APP.'\"';\n\t\t\t\t$disable = $this->select($sql);\n\t\t\t\t$strIN = \"\";\n\t\t\t\t$glue = '';\n\t\t\t\tforeach ($disable as $row){\n\t\t\t\t\t$strIN .=$glue.$row['ROUTE_ID'];\n\t\t\t\t\t$glue = ', ';\n\t\t\t\t}\n\t\t\t\t$routes_disabled_raw = array();\n\t\t\t\tif ($strIN !== \"\"){\n\t\t\t\t\t$sql = 'SELECT `path` FROM `route` WHERE `ID` IN('.$strIN.')';\n\t\t\t\t\t$routes_disabled_raw = $this->select($sql);\n\t\t\t\t}\n\t\t\t\t$routes_disabled = array();\n\t\t\t\tforeach ($routes_disabled_raw as $row){\n\t\t\t\t\t$routes_disabled[$row['path']] = $row['path'];\n\t\t\t\t}\n\t\t\t\t\n\t\t // Complete crumb:\n\t\t\t\t$category_names \t= null;\n\t\t\t\t$table \t\t\t\t= null;\n\t\t\t\t$path_start \t\t= PATH_;\n\t\t\t\t$path \t\t\t\t= '';\n\t\t\t\t$glue = '';\n\t\t\t\t$key \t\t\t\t= '';\n\t\t\t\t$glue_key = '';\n\t\t\t\tforeach ($this->request as $part){\n\t\t\t\t\t\n\t\t\t\t\t$path.= $glue.$part;\n\t\t\t\t\t$name = str_replace('_', ' ', $part);\n\t\t\t\t\t$glue ='/';\n\t\t\t\t\t\n\t\t\t\t\tif ($category_names !== null) {\n\t\t\t\t\t\t$key.= $glue_key.$part;\n\t\t\t\t\t\t$glue_key ='/';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//\tRead $category_names table at first match:\t\n\t\t\t\t\tif ($category_names === null){\n\t\t\t\t\t\t\n\t\t\t\t\t\tswitch ($part){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'articles':\n\t\t\t\t\t\tcase 'inhoud':\n\t\t\t\t\t\t\t $table = 'article';\n\t\t\t\t\t\t\t\t$category_names \t= $this->crumbs_lookup_category_name($table);\n\t\t\t\t\t\t\t\t$this->category_names = $category_names;\n\t\t\t\t\t\t\t\t$key.= $glue_key.$part;\n\t\t\t\t\t\t\t\t$glue_key ='/';\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'observaties':\n\t\t\t\t\t\tcase 'observation':\n\t\t\t\t\t\t\t $table = 'observation';\n\t\t\t\t\t\t\t\t$category_names \t= $this->crumbs_lookup_category_name($table);\n\t\t\t\t\t\t\t\t$this->category_names = $category_names;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'calculations':\n\t\t\t\t\t\tcase 'calculaties':\n\t\t\t\t\t\t\t $table = 'calculation';\n\t\t\t\t\t\t\t\t$category_names \t= $this->crumbs_lookup_category_name($table);\n\t\t\t\t\t\t\t\t$this->category_names = $category_names;\n\t\t\t\t\t\t\t break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//\tConvert name:\n\t\t\t\t\tif ($category_names !== null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$name = array_key_exists($key, $category_names)? $category_names[$key] : $name;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$crumb\t\t\t= array();\n\t\t\t\t\t$crumb['name'] = $name;\n\t\t\t\t\t$crumb['path'] = PATH_.$path;\n\t\t\t\t\tif (!array_key_exists('/'.$path, $routes_disabled)){\n\t\t\t\t\t\t$this->crumbs[] = $crumb;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$ID = array_key_exists('id', $_REQUEST)? (int)$_REQUEST['id']: -1;\n\t\t\t\tif ($ID >0 && $table !== null){\n\t\t\t\t\t\n\t\t\t\t\t$aR \t= $this->crumbs_lookup_record($table,$ID);\n\t\t\t\t\tif (array_key_exists('name', $aR) ) {\n\t\t\t\t\t\t$crumb\t\t\t= array();\n\t\t\t\t\t\t$crumb['name'] = $aR['name'];\n\t\t\t\t\t\t$crumb['path'] = PATH_.$path.'?id='.$ID;\n\t\t\t\t\t\t$this->crumbs[] = $crumb;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t}", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "private function loadRoute()\n\t{\n\t\t/*\n\t\t* Se o controller nao for passado por GET,\n\t\t* assume-se como padrão o controller 'IndexController';\n\t\t*/\n\t\t$this->st_controller = isset($_REQUEST['controle']) ? $_REQUEST['controle'] : 'index';\n\t\t\n\t\t/*\n\t\t* Se a action nao for passada por GET,\n\t\t* assume-se como padrão a action 'IndexAction';\n\t\t*/\n\t\t$this->st_action = isset($_REQUEST['acao']) ? $_REQUEST['acao'] : 'index';\n\t}", "public static function routing() {\n\t\treturn env('ROUTING_MODE', 'router');\n\t}", "private function routeConfiguration()\n {\n return [\n 'namespace' => 'OpenHaus\\LaravelEasyFaq\\Http\\Controllers',\n ];\n }", "public function __construct() {\r\n $host = $_SERVER['HTTP_HOST'];\r\n $this->routes['default'] = \"http://$host/index.php\";\r\n $this->routes['login'] = \"http://$host/login.php\";\r\n }", "static function setRoute( \n \\AmidaMVC\\Framework\\Controller $ctrl,\n \\AmidaMVC\\Component\\SiteObj &$_siteObj ) \n {\n $siteDefault = array(\n 'base_url' => $ctrl->base_url,\n 'path_info_ctrl' => $ctrl->path_info,\n 'path_info' => '',\n 'routes' => array(),\n 'command' => array(),\n 'prefix_cmd' => $ctrl->prefixCmd,\n 'mode' => NULL,\n );\n $paths = explode( '/', $siteDefault[ 'path_info_ctrl' ] );\n foreach( $paths as $cmd ) {\n if( empty( $cmd ) ) continue;\n if( $cmd === '..' ) continue;\n if( substr( $cmd, 0, 1 ) === '.' ) continue;\n if( substr( $cmd, 0, 1 ) === $siteDefault[ 'prefix_cmd' ] ) {\n $siteDefault[ 'command' ][] = $cmd;\n }\n else {\n $siteDefault[ 'routes' ][] = $cmd;\n }\n }\n // setup path_info.\n $siteDefault[ 'path_info' ] = implode( '/', $siteDefault[ 'routes' ] );\n if( empty( $siteDefault[ 'path_info' ] ) ) {\n $siteDefault[ 'path_info' ] = '/';\n }\n $ctrl->path_info = $siteDefault[ 'path_info' ];\n // setup command. \n $siteDefault[ 'command' ] = array_unique( $siteDefault[ 'command' ] );\n if( !empty( $siteDefault[ 'command'] ) ) {\n if( $mode = static::findMode( $siteDefault[ 'command'] ) ) {\n $ctrl->mode = $mode;\n $ctrl->setAction( $mode );\n $siteDefault[ 'mode' ] = $mode;\n }\n }\n $_siteObj->set( 'siteObj', $siteDefault );\n }", "function create_initial_rest_routes()\n {\n }", "public function hookDefineRoutes($args) {\n\t\t$args['router']->addConfig(new Zend_Config_Ini(dirname(__FILE__) . '/routes.ini', 'routes'));\n\t}", "public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }", "protected function __construct()\n {\n parent::__construct(new NamespacePrefixedClassLocator('Controllers', 'FF'));\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "public function __construct() {\n $this->setRoutes(array(\n 'user/:userId' => 'updateCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }" ]
[ "0.5807676", "0.5599459", "0.55904484", "0.55878687", "0.5574762", "0.55385447", "0.5533423", "0.5478348", "0.5445458", "0.54419994", "0.54322594", "0.5408356", "0.54043305", "0.5344281", "0.53363085", "0.5335346", "0.53287655", "0.5323554", "0.53212345", "0.5291531", "0.52892935", "0.5240184", "0.5232356", "0.522259", "0.51965696", "0.5184964", "0.51831084", "0.5175555", "0.51678", "0.5157144" ]
0.6664784
0
Initialize properties `match`, `reverse` and other internal properties about those values, when there is necessary to prepare `pattern` value for: a) PHP `preg_match_all()` route match processing, b) for `reverse` value for later self URL building. This method is usually called in core request routing process from `\MvcCore\Router::Matches();` method on each route.
protected function initMatchAndReverse () { if ($this->reverseSections !== NULL) return; if ($this->pattern === NULL) $this->throwExceptionIfKeyPropertyIsMissing('pattern'); $this->lastPatternParam = NULL; $match = addcslashes($this->pattern, "#(){}-?!=^$.+|:*\\"); $reverse = $this->reverse !== NULL ? $this->reverse : $this->pattern; list($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse( $reverse, $match ); $this->reverse = $reverse; $this->reverseParams = $this->initReverseParams( $reverse, $this->reverseSections, $this->constraints, $match ); $this->initFlagsByPatternOrReverse($reverse); $this->match = $this->initMatchComposeRegex( $match, $matchSections, $this->reverseParams, $this->constraints ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\t$reverse = NULL;\n\t\tif ($this->reverse !== NULL) {\n\t\t\t$reverse = $this->reverse;\n\t\t} else if ($this->pattern !== NULL) {\n\t\t\t$reverse = $this->pattern;\n\t\t} else/* if ($this->pattern === NULL)*/ {\n\t\t\tif ($this->redirect !== NULL)\n\t\t\t\treturn $this->initFlagsByPatternOrReverse(\n\t\t\t\t\t$this->pattern !== NULL\n\t\t\t\t\t\t? $this->pattern\n\t\t\t\t\t\t: str_replace(['\\\\', '(?', ')?', '/?'], '', $this->match)\n\t\t\t\t);\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('reverse', 'pattern');\n\t\t}\n\n\t\t$this->lastPatternParam = NULL;\n\n\t\t$this->reverseSections = $this->initSectionsInfo($reverse);\n\t\t$this->reverse = $reverse;\n\n\t\t$match = NULL;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t}", "protected function preparePattern()\n {\n $patterns = [];\n foreach ($this->routes as $route => $config) {\n $this->routeData[$route] = $config;\n $prepared = preg_replace('/\\{([^:]+):([^}]+)\\}/', '{$1}', $config['route']);\n\n $params = [];\n if (preg_match('/\\{([^}]+)\\}/', $prepared, $params)) {\n array_shift($params);\n }\n\n $this->routeData[$route]['params'] = $params;\n $pattern = preg_replace('/\\{([^:]+):([^}]+)\\}/', '($2)', $config['route']);\n $patterns[] = \"(?P<{$route}>{$pattern})\";\n }\n\n $pattern = implode(' | ', $patterns);\n $this->pattern = \"~^(?: {$pattern} )$~x\";\n }", "public function __construct($routeInfo) {\n $this->name = $routeInfo['name'];\n $this->pattern = $routeInfo['pattern'];\n\n \n foreach ($routeInfo as $key => $value) {\n \n switch($key) {\n case ('requirements'): {\n $this->requirements = $value;\n if(is_array($value)) {\n if(array_key_exists('_method', $value)) {\n $this->methodRequirement = $value['_method'];\n }\n }\n break;\n }\n case ('_method'): {\n $this->methodRequirement = $value;\n break;\n }\n case ('defaults'): {\n $this->defaults = $value;\n break;\n }\n case ('fnCheck'): {\n $this->fnCheck = $routeInfo['fnCheck'];\n break;\n }\n case('name'):\n case('pattern'):{ \n break;\n }\n case('optional'): {\n $this->optionalInfo = $routeInfo['optional'];\n break;\n }\n default:{\n $this->extra[$key] = $value;\n break;\n }\n }\n }\n\n $this->calculateStaticPrefix();\n\n //For paths other than the route path '/' allow the last '/' to be optional\n //If the string terminates there.\n if(mb_strlen($this->staticPrefix) > 1) {\n if(mb_substr($this->staticPrefix, mb_strlen($this->staticPrefix)-1) == '/'){\n $this->staticPrefix = mb_substr($this->staticPrefix, 0, mb_strlen($this->staticPrefix)-1);\n }\n\n if(mb_substr($this->pattern, mb_strlen($this->pattern)-1) == '/'){\n $this->pattern = mb_substr($this->pattern, 0, mb_strlen($this->pattern)-1);\n }\n }\n\n $this->buildRegex();\n }", "private function initialize_routes() {\n // capture request method, url string, and break url string into parts (around '/')\n $this->request_method = $_SERVER['REQUEST_METHOD'];\n $this->url_parts_string = (isset($_GET['p'])) ? rtrim(strtolower($_GET['p']), '/'): '';\n $this->url_parts = explode('/', $this->url_parts_string);\n \n // capture request payload\n $this->payload = array();\n if ($this->request_method == 'POST') { \n // POST data if avaiable\n if (!empty($_POST)) {\n $this->payload = $_POST;\n \n // raw JSON if aviaible\n } else {\n $fp = fopen('php://input', 'r');\n $raw_data = stream_get_contents($fp);\n $posted_json = (array)json_decode($raw_data);\n \n if (!empty($posted_json)) {\n $this->payload = $posted_json;\n }\n }\n }\n \n // type cast all dynamic url parts as INT or FLOAT else leave as STRING\n $preg_pattern = '/[a-zA-Z]/';\n foreach ($this->url_parts as $key=>$value) {\n preg_match($preg_pattern, $value, $matches);\n if (empty($matches)) {\n if ((int)$value != null) $this->url_parts[$key] = (int)$value;\n else if ((float)$value != null) $this->url_parts[$key] = (float)$value; \n }\n }\n \n return true;\n }", "protected function init()\n {\n if ($this->regex) {\n return;\n }\n\n $this->regex = $this->path;\n $matches = [];\n\n if ($count = preg_match_all('@{([^A-Za-z]*([A-Za-z]+))([?]?)(?::([^}]+))?}@', $this->regex, $matches)) {\n $this->tokens = new \\SplFixedArray($count);\n\n foreach ($matches[1] as $index => $token) {\n $fullString = $matches[1][$index];\n $name = $matches[2][$index];\n $optional = !empty($matches[3][$index]);\n $constraint = empty($matches[4][$index]) ? '.*' : $matches[4][$index];\n\n if ($optional) {\n $replace = sprintf('(?:%s(?<%s>%s))?', str_replace($name, '', $fullString), $name, $constraint);\n } else {\n $replace = sprintf('(?<%s>%s)', $name, $constraint);\n }\n\n $this->regex = str_replace($matches[0][$index], $replace, $this->regex);\n\n $this->tokens[$index] = [$name, $optional];\n }\n }\n }", "protected function initFlagsByPatternOrReverse ($pattern) {\n\t\t$scheme = static::FLAG_SCHEME_NO;\n\t\tif (mb_strpos($pattern, '//') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_ANY;\n\t\t} else if (mb_strpos($pattern, 'http://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTP;\n\t\t} else if (mb_strpos($pattern, 'https://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTPS;\n\t\t}\n\t\t$this->flags |= $scheme;\n\t\t$host = 0;\n\t\tif (($scheme & static::FLAG_SCHEME_ANY) != 0) {\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_HOST) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_HOST;\n\t\t\t} else if (mb_strpos($pattern, static::PLACEHOLDER_DOMAIN) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_DOMAIN;\n\t\t\t} else {\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_TLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_TLD;\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_SLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_SLD;\n\t\t\t}\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_BASEPATH) !== FALSE)\n\t\t\t\t$host += static::FLAG_HOST_BASEPATH;\n\t\t}\n\t\tif ($host === 0)\n\t\t\t$host = static::FLAG_HOST_NO;\n\t\t$this->flags |= $host;\n\t\t$queryString = mb_strpos($pattern, '?') !== FALSE\n\t\t\t? static::FLAG_QUERY_INCL\n\t\t\t: static::FLAG_QUERY_NO;\n\t\t$this->flags |= $queryString;\n\t}", "public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }", "final private function buildRouteData($pattern)\n {\n // patch tags -- experemential\n if ( count(array_filter($this->routeTags)) ) {\n $pattern = preg_replace($this->routeTags['pattern'], $this->routeTags['replacement'], $pattern);\n }\n \n // find unknown tags\n preg_match_all('~'.preg_quote('[!:').'([a-z\\_\\-]+)'.preg_quote(':!]').'~i', $pattern, $matches);\n\n $exception = null;\n foreach ( $matches[1] as $tag ) {\n $exception = new UnknownRouteTagException('Unknown tag: '.$tag);\n }\n\n if ( $exception ) {\n throw $exception;\n }\n \n // fetch pattern data\n $data = [];\n $replacer = [];\n $offset = 0;\n if ( preg_match_all(static::VAR_REGEX, $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER) ) {\n foreach ( $matches as $set ) {\n if ( $set[0][1] > $offset ) {\n $data[] = substr($pattern, $offset, $set[0][1] - $offset);\n $replacer[] = $set[0][0];\n }\n \n $data[] = array(\n $set[1][0],\n isset($set[2])\n ? trim($set[2][0])\n : static::DEFAULT_REGEX\n );\n\n $offset = $set[0][1] + strlen($set[0][0]);\n }\n }\n \n // build match credentials\n if ( empty($data) ) {\n $storage['regex'] = $pattern;\n $storage['vars'] = [];\n }\n else {\n $storage['regex'] = '';\n $storage['vars'] = [];\n\n foreach ( $data as $current ) {\n if ( is_string($current) ) {\n $storage['regex'] .= preg_quote($current, '~');\n continue;\n }\n\n list($name, $currentRegex) = $current;\n \n if ( isset($storage['vars'][$name]) ) {\n throw new RouteAggregationException(\n 'Impossible to use placeholder \"'.$name.'\" more then once'\n );\n }\n\n $storage['vars'][$name] = null;\n $storage['regex'] .= '('.$currentRegex.')';\n }\n }\n \n $storage['replacer'] = array_combine(array_keys($storage['vars']), $replacer);\n $storage['pattern'] = $pattern;\n \n return $storage;\n }", "protected function preparePatternAndBackReferenceIndexes () {\n\t\t$protocols = implode('|', $this->allowedSchemes);\n\t\tif (($this->allowProtocol & self::ALLOW_PROTOCOL_ABSOLUTE) != 0) {\n\t\t\t$protocol = '('.$protocols.')://';\n\t\t} else if (($this->allowProtocol & self::ALLOW_PROTOCOL_RELATIVE) != 0) {\n\t\t\t$protocol = '(?:('.$protocols.'):)?//';\n\t\t} else {\n\t\t\t$protocol = '(?:('.$protocols.')://)?';\n\t\t}\n\n\t\t$auth = '';\n\t\tif ($this->allowBasicAuth) {\n\t\t\t$auth = static::PATTERN_PART_AUTH;\n\t\t\t$this->backReferencePosHostname = 5;\n\t\t\t$this->backReferencePosPort = 9;\n\t\t} else {\n\t\t\t$this->backReferencePosHostname = 2;\n\t\t\t$this->backReferencePosPort = 6;\n\t\t}\n\t\t\n\n\t\t$hostname = '';\n\t\t$hostnameParts = [];\n\t\tif ($this->allowDomains)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_DOMAIN;\n\t\tif ($this->allowIPv4)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV4;\n\t\tif ($this->allowIPv6)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV6;\n\t\tif (count($hostnameParts) > 0) {\n\t\t\t$hostname = '(' . implode('|', $hostnameParts) . ')';\n\t\t} else {\n\t\t\t$hostname = '(' . implode('|', [\n\t\t\t\tstatic::PATTERN_PART_DOMAIN,\n\t\t\t\tstatic::PATTERN_PART_IPV4,\n\t\t\t\tstatic::PATTERN_PART_IPV6\n\t\t\t]) . ')';\n\t\t}\n\t\t\n\n\t\t$port = '';\n\t\tif (count($this->allowedPorts) > 0 || $this->allowPorts) {\n\t\t\t$port = static::PATTERN_PART_PORT;\n\t\t} else {\n\t\t\t$this->backReferencePosPort = NULL;\n\t\t}\n\n\n\t\t$this->pattern = str_replace([\n\t\t\t'{%protocol}', '{%auth}', '{%hostname}', '{%port}', \n\t\t\t'{%path}', '{%query}', '{%fragment}'\n\t\t], [\n\t\t\t$protocol, $auth, $hostname, $port, \n\t\t\tstatic::PATTERN_PART_PATH, static::PATTERN_PART_QUERY, static::PATTERN_PART_FRAGMENT\n\t\t], static::PATTERN_ALL);\n\t}", "function _parse_routes()\n {\n // Do we even have any custom routing to deal with?\n // There is a default scaffolding trigger, so we'll look just for 1\n if (count($this->routes) == 1)\n {\n $this->_set_request($this->uri->segments);\n return;\n }\n\n // Turn the segment array into a URI string\n $uri = implode('/', $this->uri->segments);\n\n // Is there a literal match? If so we're done\n if (isset($this->routes[$uri]))\n {\n $this->_set_request(explode('/', $this->routes[$uri]));\n return;\n }\n\n //Art\n $i = $this->_search_by_key($this->routes, self::MAIN, $uri);\n if ($i !== FALSE)\n {\n $this->_set_request(explode('/', $this->routes[$i][self::ROUTE]));\n return;\n }\n\n // Loop through the route array looking for wild-cards\n foreach ($this->routes as $key => $val)\n {\n if(is_int($key))\n {\n $key = $val[self::MAIN];\n $val = $val[self::ROUTE];\n }\n // Convert wild-cards to RegEx\n $key = str_replace(':any', '.+', str_replace(':num', '[0-9]+', $key));\n\n // Does the RegEx match?\n if (preg_match('#^'.$key.'$#', $uri))\n {\n // Do we have a back-reference?\n if (strpos($val, '$') !== FALSE AND strpos($key, '(') !== FALSE)\n {\n $val = preg_replace('#^'.$key.'$#', $val, $uri);\n }\n $this->_set_request(explode('/', $val));\n return;\n }\n }\n\n // If we got this far it means we didn't encounter a\n // matching route so we'll set the site default route\n $this->_set_request($this->uri->segments);\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "function __construct(){\r\n $parser = new Shumvc_RouteParser();\r\n $this->routes = $parser->getRoutes();\r\n }", "private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }", "protected function _parse_routes()\n\t{\n\t\t$uri = implode('/', $this->uri->segments);\n\n\t\t// Get HTTP verb\n\t\t$http_verb = isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) : 'cli';\n\n\t\t// Loop through the route array looking for wildcards\n\t\tforeach ($this->routes as $key => $val)\n\t\t{\n\t\t\t// Check if route format is using HTTP verbs\n\t\t\tif (is_array($val))\n\t\t\t{\n\t\t\t\t$val = array_change_key_case($val, CASE_LOWER);\n\t\t\t\tif (isset($val[$http_verb]))\n\t\t\t\t{\n\t\t\t\t\t$val = $val[$http_verb];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Convert wildcards to RegEx\n\t\t\t$key = str_replace(array(':any', ':num',':all'), array('[^/]+', '[0-9]+','(?!(Techsystem|techsystem|Vindex\\/tech5sManagerControl).*$).*'), $key);\n\t\t\t// $key = str_replace(array(':any', ':num'), array('[^/]+', '[0-9]+'), $key);\n\t\t\t// Does the RegEx match?\n\t\t\tif (preg_match('#^'.$key.'$#', $uri, $matches))\n\t\t\t{\n\t\t\t\t// Are we using callbacks to process back-references?\n\t\t\t\tif ( ! is_string($val) && is_callable($val))\n\t\t\t\t{\n\t\t\t\t\t// Remove the original string from the matches array.\n\t\t\t\t\tarray_shift($matches);\n\n\t\t\t\t\t// Execute the callback using the values in matches as its parameters.\n\t\t\t\t\t$val = call_user_func_array($val, $matches);\n\t\t\t\t}\n\t\t\t\t// Are we using the default routing method for back-references?\n\t\t\t\telseif (strpos($val, '$') !== FALSE && strpos($key, '(') !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$val = preg_replace('#^'.$key.'$#', $val, $uri);\n\t\t\t\t}\n\n\t\t\t\t$this->_set_request(explode('/', $val));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\n\t\t// If we got this far it means we didn't encounter a\n\t\t// matching route so we'll set the site default route\n\t\t$this->_set_request(array_values($this->uri->segments));\n\t}", "public function buildRoutePattern()\n {\n $path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;\n\n return '~^' . preg_replace_callback(self::VAR_PATTERN, function ($matches) {\n $this->parameter[] = $key = $matches[1];\n\n // Shorthand validation only if not set using the validation-method\n if (isset($matches[2]) && ! isset($this->parameterPattern[$key])) {\n $this->parameterPattern[$key] = $matches[2];\n }\n return $this->buildParameterPattern($key);\n }, $path) . ($this->terminated ? '$' : '') . '~i';\n }", "protected static function initialize()\n {\n if (!static::$isInitialized) {\n static::$regexSelector = '(?<selector>'\n . '(' . static::$regexUnreserved . '|' . static::$regexPctEncoding . ')+)';\n static::$regexCompareOp = '(?<comp_op>(=[A-Za-z]*|' . static::$regexFiqlDelim . ')=)';\n\n static::$regexArgChar = '(' . static::$regexUnreserved . '|'\n . static::$regexPctEncoding . '|' . static::$regexFiqlDelim . '|'\n . '=)';\n static::$regexArgument = '(?<arg>' . static::$regexArgChar . '+)';\n\n static::$regexConstraint = '/' . static::$regexSelector\n . '(' . static::$regexCompareOp . static::$regexArgument . ')?/';\n\n static::$isInitialized = true;\n }\n }", "protected function buildRoutePattern()\r\n\t{\r\n\t\t$path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;\r\n\r\n\t\treturn '~^' . preg_replace_callback(self::VAR_PATTERN, function($matches) {\r\n\t\t\t$this->parameter[] = $key = $matches[1];\r\n\r\n\t\t\t// Shorthand validation only if not set using the validation-method\r\n\t\t\tif (isset($matches[2]) && !isset($this->parameterPattern[$key])) {\r\n\t\t\t\t$this->parameterPattern[$key] = $matches[2];\r\n\t\t\t}\r\n\t\t\treturn $this->buildParameterPattern($key);\r\n\t\t}, $path) . ($this->terminated ? '$' : '') . '~i';\r\n\r\n\t}", "protected function initialisePatternMap()\n {\n // Define the XML-based scanner output patterns\n $xmlScannerPatterns = new Collection([\n self::XML_NMAP_REGEX => ScannerApp::SCANNER_NMAP,\n self::XML_BURP_REGEX => ScannerApp::SCANNER_BURP,\n self::XML_NEXPOSE_REGEX => ScannerApp::SCANNER_NEXPOSE,\n self::XML_NETSPARKER_REGEX => ScannerApp::SCANNER_NETSPARKER,\n self::XML_NESSUS_REGEX => ScannerApp::SCANNER_NESSUS,\n ]);\n\n // Define the CSV-based scanner output patterns\n $csvScannerPatterns = new Collection();\n\n // Define the JSON-based scanner output patterns\n $jsonScannerPatterns = new Collection();\n\n // Set the pattern Collection for each group of file types on the main Collection\n $this->scannerPatternMap->put(File::FILE_TYPE_XML, $xmlScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_CSV, $csvScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_JSON, $jsonScannerPatterns);\n\n return true;\n }", "public function __construct()\n {\n if (!(self::$matchContext instanceof MatchContext)) {\n self::$matchContext = new MatchContext([], []);\n }\n }", "public function __construct()\n {\n $this->uri = $_SERVER['REQUEST_URI'];\n $this->method = $_SERVER['REQUEST_METHOD'];\n\n // Get all parameters from the request depending on request method\n $parameters = match ($this->method) {\n 'GET' => $_GET,\n 'POST' => $_POST,\n };\n // Remove 'path' from Request parameters because we use it in rewrite rule in htaccess for pretty url,\n // and it is handled by the Route later.\n unset($parameters['path']);\n $this->parameters = $parameters;\n }", "protected function initMatchComposeRegex (& $match, & $matchSectionsInfo, & $reverseParams, & $constraints) {\n\t\t$sections = [];\n\t\t$paramIndex = 0;\n\t\t$reverseParamsKeys = array_keys($reverseParams);\n\t\t$paramsCount = count($reverseParamsKeys);\n\t\t$anyParams = $paramsCount > 0;\n\t\t$defaultPathConstraint = static::$defaultPathConstraint;\n\t\t$defaultDomainConstraint = static::$defaultDomainConstraint;\n\t\t$matchIsAbsolute = ($this->flags & static::FLAG_SCHEME_ANY) != 0;\n\t\t$firstPathSlashPos = 0;\n\t\tif ($matchIsAbsolute) {\n\t\t\t$defaultConstraint = $defaultDomainConstraint;\n\t\t\t// if scheme flag is `http://` or `https://`, there is necessary to increase\n\t\t\t// `mb_strpos()` index by one, because there is always backslash in match pattern\n\t\t\t// before `:` - like `http\\://` or `https\\://`\n\t\t\t$schemeMatchPatternLen = 2;\n\t\t\tif (($this->flags & static::FLAG_SCHEME_HTTP) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 8;\n\t\t\t} else if (($this->flags & static::FLAG_SCHEME_HTTPS) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 9;\n\t\t\t}\n\t\t\t$firstPathSlashPos = mb_strpos($match, '/', $schemeMatchPatternLen);\n\t\t} else {\n\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t}\n\t\t$pathFixedSectionsCount = 0;\n\t\t$lastPathFixedSectionIndex = 0;\n\t\t$trailingSlash = '?';\n\t\t$one = $matchIsAbsolute ? 0 : 1;\n\t\t$sectionsCountMinusOne = count($matchSectionsInfo) - 1;\n\t\tforeach ($matchSectionsInfo as $sectionIndex => $section) {\n\t\t\t$sectionEnd = $section->end;\n\t\t\tif ($anyParams) {\n\t\t\t\t$sectionOffset = $section->start;\n\t\t\t\t$sectionResult = '';\n\t\t\t\twhile ($paramIndex < $paramsCount) {\n\t\t\t\t\t$paramKey = $reverseParamsKeys[$paramIndex];\n\t\t\t\t\t$param = $reverseParams[$paramKey];\n\t\t\t\t\tif ($param->sectionIndex !== $sectionIndex) break;\n\t\t\t\t\t$paramStart = $param->matchStart;\n\t\t\t\t\tif ($matchIsAbsolute && $paramStart > $firstPathSlashPos)\n\t\t\t\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t\t\t\tif ($sectionOffset < $paramStart)\n\t\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $paramStart - $sectionOffset);\n\t\t\t\t\t$paramName = $param->name;\n\t\t\t\t\t$customConstraint = isset($constraints[$paramName]);\n\t\t\t\t\tif (!$customConstraint && $param->greedy) $defaultConstraint = '.*';\n\t\t\t\t\tif ($customConstraint) {\n\t\t\t\t\t\t$constraint = $constraints[$paramName];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$constraint = $defaultConstraint;\n\t\t\t\t\t}\n\t\t\t\t\t$sectionResult .= '(?<' . $paramName . '>' . $constraint . ')';\n\t\t\t\t\t$paramIndex += 1;\n\t\t\t\t\t$sectionOffset = $param->matchEnd;\n\t\t\t\t}\n\t\t\t\tif ($sectionOffset < $sectionEnd)\n\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $sectionEnd - $sectionOffset);\n\t\t\t} else {\n\t\t\t\t$sectionResult = mb_substr($match, $section->start, $section->length);\n\t\t\t}\n\t\t\tif ($matchIsAbsolute && $sectionEnd > $firstPathSlashPos) $one = 1;\n\t\t\tif ($section->fixed) {\n\t\t\t\t$pathFixedSectionsCount += $one;\n\t\t\t\t$lastPathFixedSectionIndex = $sectionIndex;\n\t\t\t} else {\n\t\t\t\t$sectionResult = '(' . $sectionResult . ')?';\n\t\t\t}\n\t\t\t$sections[] = $sectionResult;\n\t\t}\n\t\tif ($pathFixedSectionsCount > 0) {\n\t\t\t$lastFixedSectionContent = & $sections[$lastPathFixedSectionIndex];\n\t\t\tif ($sectionsCountMinusOne == 0 && $lastPathFixedSectionIndex == 0 &&\n\t\t\t\t$lastFixedSectionContent === '/'\n\t\t\t) {\n\t\t\t\t$trailingSlash = ''; // homepage -> `/`\n\t\t\t} else {\n\t\t\t\t$lastCharIsSlash = mb_substr($lastFixedSectionContent, -1, 1) == '/';\n\t\t\t\tif ($lastPathFixedSectionIndex == $sectionsCountMinusOne) {// last section is fixed section\n\t\t\t\t\tif (!$lastCharIsSlash) $trailingSlash = '/?';\n\t\t\t\t} else {// last section is optional section or sections\n\t\t\t\t\t$lastFixedSectionContent .= ($lastCharIsSlash ? '' : '/') . '?';\n\t\t\t\t\t$trailingSlash = '/?';\n\t\t\t\t}}}\n\t\t// always add UTF-8 modifier to match UTF-8 request paths\n\t\t$result = '#^' . implode('', $sections) . $trailingSlash . '$#';\n\t\tif ($this->getStrIsUtf8($result)) $result .= 'u';\n\t\treturn $result;\n\t}", "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "public function __construct() {\n $this->setRouteData();\n }", "protected function prepareRoutes ()\n {\n foreach ($this->routes as $index => $route) {\n $this->registerNamedRoute($route);\n $this->registerRouteMethods($route, $index);\n }\n }", "protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }", "public function __construct(RouteMatchInterface $route_match) {\n $this->routeMatch = $route_match;\n }", "public function __construct(RouteMatchInterface $route_match) {\n $this->routeMatch = $route_match;\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function testRouteSetsPatternWithParams()\n {\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n $this->assertEquals('/hello/:first/:last', $route->getPattern());\n }", "function init() {\n $this->properties = array();\n if(isset($_SERVER['REQUEST_METHOD'])) {\n $urlPieces = explode(\"/\", $_GET['q']);\n array_shift($urlPieces);// the way our mod_rewrite does this, it adds an empty string as an extra element on the beginning\n if($urlPieces[0] === \"a\") {// something like foo/bar/test\n $this->setProperty(\"app\", \"true\");\n $this->setProperty(\"cmd\", $urlPieces[1]);\n $this->setProperty(\"action\", $urlPieces[2]);\n } else {\n $this->setProperty(\"cmd\", $urlPieces[0]);\n $this->setProperty(\"action\", $urlPieces[1]);\n\n if(count($urlPieces) > 2) {\n for($i = 2; $i < count($urlPieces); ++$i) {\n $this->extras[] = $urlPieces[$i];\n }\n }\n }\n }\n\n if(isset($_SERVER['argv'][0])) {\n $argPieces = explode(\"&\", $_SERVER['argv'][0]);\n } else {\n $argPieces = array();\n }\n\n foreach($argPieces as $arg) {\n if(strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);// a=login <- a = 'cmd' in CommandResolver\n $this->setProperty($key, $val);\n }\n }\n }" ]
[ "0.7232774", "0.627612", "0.6070191", "0.59720004", "0.590337", "0.58424723", "0.58327836", "0.5783307", "0.57814074", "0.56690764", "0.5668129", "0.56623894", "0.5609662", "0.56021273", "0.5580354", "0.5578048", "0.5573244", "0.55607367", "0.55449283", "0.5542274", "0.55305606", "0.5515472", "0.5489367", "0.54790795", "0.54786235", "0.5478218", "0.5478218", "0.5471527", "0.54535174", "0.544879" ]
0.8144741
0
Process together given `match` and `reverse` value and complete two arrays with sections info about those two given values. Also change the given `match` and `reverse` string references and remove all brackets `[]` defining variable section(s). Every result array with this sections info, with those statistics contains for each fixed section or variable section defined with brackets `[]` info about it's type (fixed or variable), about start position, end position and length. Those statistics are always used to build URL later.
protected function initSectionsInfoForMatchAndReverse (& $match, & $reverse) { $matchInfo = []; $reverseInfo = []; $reverseIndex = 0; $matchIndex = 0; $reverseLength = mb_strlen($reverse); $matchLength = mb_strlen($match); $matchOpenPos = FALSE; $matchClosePos = FALSE; while ($reverseIndex < $reverseLength) { $reverseOpenPos = mb_strpos($reverse, '[', $reverseIndex); $reverseClosePos = FALSE; if ($reverseOpenPos !== FALSE) { $reverseClosePos = mb_strpos($reverse, ']', $reverseOpenPos); $matchOpenPos = mb_strpos($match, '[', $matchIndex); $matchClosePos = mb_strpos($match, ']', $matchOpenPos); } if ($reverseClosePos === FALSE) { $reverseInfo[] = (object) [ 'fixed'=>TRUE, 'start'=>$reverseIndex, 'end'=>$reverseLength, 'length' => $reverseLength - $reverseIndex ]; $matchInfo[] = (object) [ 'fixed' => TRUE, 'start'=>$matchIndex, 'end'=>$matchLength, 'length' => $matchLength - $matchIndex ]; break; } else { if ($reverseIndex < $reverseOpenPos) { $reverseInfo[] = (object) [ 'fixed'=> TRUE, 'start'=> $reverseIndex, 'end'=> $reverseOpenPos, 'length' => $reverseOpenPos - $reverseIndex ]; $matchInfo[] = (object) [ 'fixed'=> TRUE, 'start'=> $matchIndex, 'end'=> $matchOpenPos, 'length'=> $matchOpenPos - $matchIndex]; } $reverseOpenPosPlusOne = $reverseOpenPos + 1; $reverseLocalLength = $reverseClosePos - $reverseOpenPosPlusOne; $reverse = mb_substr($reverse, 0, $reverseOpenPos) . mb_substr( $reverse, $reverseOpenPosPlusOne, $reverseLocalLength ) . mb_substr($reverse, $reverseClosePos + 1); $reverseLength -= 2; $reverseClosePos -= 1; $reverseInfo[] = (object) [ 'fixed' => FALSE, 'start' => $reverseOpenPos, 'end' => $reverseClosePos, 'length'=> $reverseLocalLength ]; $matchOpenPosPlusOne = $matchOpenPos + 1; $matchLocalLength = $matchClosePos - $matchOpenPosPlusOne; $match = mb_substr($match, 0, $matchOpenPos) . mb_substr($match, $matchOpenPosPlusOne, $matchLocalLength) . mb_substr($match, $matchClosePos + 1); $matchLength -= 2; $matchClosePos -= 1; $matchInfo[] = (object) [ 'fixed' => FALSE, 'start' => $matchOpenPos, 'end' => $matchClosePos, 'length'=> $matchLocalLength ]; } $reverseIndex = $reverseClosePos; $matchIndex = $matchClosePos; } return [$matchInfo, $reverseInfo]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initReverseParams (& $reverse, & $reverseSectionsInfo, & $constraints, & $match = NULL) {\n\t\t$result = [];\n\t\t$completeMatch = $match !== NULL;\n\t\t$reverseIndex = 0;\n\t\t$matchIndex = 0;\n\t\t$sectionIndex = 0;\n\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t$reverseLength = mb_strlen($reverse);\n\t\t$greedyCaught = FALSE;\n\t\t$matchOpenPos = -1;\n\t\t$matchClosePos = -1;\n\t\t$this->lastPatternParam = '';\n\t\twhile ($reverseIndex < $reverseLength) {\n\t\t\t$reverseOpenPos = mb_strpos($reverse, '<', $reverseIndex);\n\t\t\t$reverseClosePos = FALSE;\n\t\t\tif ($reverseOpenPos !== FALSE) {\n\t\t\t\t$reverseClosePos = mb_strpos($reverse, '>', $reverseOpenPos);\n\t\t\t\tif ($completeMatch) {\n\t\t\t\t\t$matchOpenPos = mb_strpos($match, '<', $matchIndex);\n\t\t\t\t\t$matchClosePos = mb_strpos($match, '>', $matchOpenPos) + 1;\n\t\t\t\t}}\n\t\t\tif ($reverseClosePos === FALSE) break;// no other param caught\n\t\t\t// check if param belongs to current section\n\t\t\t// and if not, move to next (or next...) section\n\t\t\t$reverseClosePos += 1;\n\t\t\tif ($reverseClosePos > $section->end) {\n\t\t\t\t$reverseSectionsInfoCountMinusOne = count($reverseSectionsInfo) - 1;\n\t\t\t\twhile ($sectionIndex < $reverseSectionsInfoCountMinusOne) {\n\t\t\t\t\t$nextSection = $reverseSectionsInfo[$sectionIndex + 1];\n\t\t\t\t\tif ($reverseClosePos > $nextSection->end) {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}}}\n\t\t\t// complete param section length and param name\n\t\t\t$paramLength = $reverseClosePos - $reverseOpenPos;\n\t\t\t$paramName = mb_substr($reverse, $reverseOpenPos + 1, $paramLength - 2);\n\t\t\tlist ($greedyFlag, $sectionIsLast) = $this->initReverseParamsGetGreedyInfo(\n\t\t\t\t$reverseSectionsInfo, $constraints,\n\t\t\t\t$paramName, $sectionIndex, $greedyCaught\n\t\t\t);\n\t\t\tif ($greedyFlag && $sectionIsLast) {\n\t\t\t\t$lastSectionChar = mb_substr(\n\t\t\t\t\t$reverse, $reverseClosePos, $reverseSectionsInfo[$sectionIndex]->end - $reverseClosePos\n\t\t\t\t);\n\t\t\t\tif ($lastSectionChar == '/') {\n\t\t\t\t\t$lastSectionChar = '';\n\t\t\t\t\t$reverseSectionsInfo[$sectionIndex]->end -= 1;\n\t\t\t\t}\n\t\t\t\tif ($lastSectionChar === '')\n\t\t\t\t\t$this->lastPatternParam = $paramName;\n\t\t\t}\n\t\t\t$result[$paramName] = (object) [\n\t\t\t\t'name'\t\t\t=> $paramName,\n\t\t\t\t'greedy'\t\t=> $greedyFlag,\n\t\t\t\t'sectionIndex'\t=> $sectionIndex,\n\t\t\t\t\t'length'\t\t=> $paramLength,\n\t\t\t\t'reverseStart'\t=> $reverseOpenPos,\n\t\t\t\t'reverseEnd'\t=> $reverseClosePos,\n\t\t\t\t'matchStart'\t=> $matchOpenPos,\n\t\t\t\t'matchEnd'\t\t=> $matchClosePos,\n\t\t\t];\n\t\t\t$reverseIndex = $reverseClosePos;\n\t\t\t$matchIndex = $matchClosePos;\n\t\t}\n\t\treturn $result;\n\t}", "protected function initMatchComposeRegex (& $match, & $matchSectionsInfo, & $reverseParams, & $constraints) {\n\t\t$sections = [];\n\t\t$paramIndex = 0;\n\t\t$reverseParamsKeys = array_keys($reverseParams);\n\t\t$paramsCount = count($reverseParamsKeys);\n\t\t$anyParams = $paramsCount > 0;\n\t\t$defaultPathConstraint = static::$defaultPathConstraint;\n\t\t$defaultDomainConstraint = static::$defaultDomainConstraint;\n\t\t$matchIsAbsolute = ($this->flags & static::FLAG_SCHEME_ANY) != 0;\n\t\t$firstPathSlashPos = 0;\n\t\tif ($matchIsAbsolute) {\n\t\t\t$defaultConstraint = $defaultDomainConstraint;\n\t\t\t// if scheme flag is `http://` or `https://`, there is necessary to increase\n\t\t\t// `mb_strpos()` index by one, because there is always backslash in match pattern\n\t\t\t// before `:` - like `http\\://` or `https\\://`\n\t\t\t$schemeMatchPatternLen = 2;\n\t\t\tif (($this->flags & static::FLAG_SCHEME_HTTP) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 8;\n\t\t\t} else if (($this->flags & static::FLAG_SCHEME_HTTPS) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 9;\n\t\t\t}\n\t\t\t$firstPathSlashPos = mb_strpos($match, '/', $schemeMatchPatternLen);\n\t\t} else {\n\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t}\n\t\t$pathFixedSectionsCount = 0;\n\t\t$lastPathFixedSectionIndex = 0;\n\t\t$trailingSlash = '?';\n\t\t$one = $matchIsAbsolute ? 0 : 1;\n\t\t$sectionsCountMinusOne = count($matchSectionsInfo) - 1;\n\t\tforeach ($matchSectionsInfo as $sectionIndex => $section) {\n\t\t\t$sectionEnd = $section->end;\n\t\t\tif ($anyParams) {\n\t\t\t\t$sectionOffset = $section->start;\n\t\t\t\t$sectionResult = '';\n\t\t\t\twhile ($paramIndex < $paramsCount) {\n\t\t\t\t\t$paramKey = $reverseParamsKeys[$paramIndex];\n\t\t\t\t\t$param = $reverseParams[$paramKey];\n\t\t\t\t\tif ($param->sectionIndex !== $sectionIndex) break;\n\t\t\t\t\t$paramStart = $param->matchStart;\n\t\t\t\t\tif ($matchIsAbsolute && $paramStart > $firstPathSlashPos)\n\t\t\t\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t\t\t\tif ($sectionOffset < $paramStart)\n\t\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $paramStart - $sectionOffset);\n\t\t\t\t\t$paramName = $param->name;\n\t\t\t\t\t$customConstraint = isset($constraints[$paramName]);\n\t\t\t\t\tif (!$customConstraint && $param->greedy) $defaultConstraint = '.*';\n\t\t\t\t\tif ($customConstraint) {\n\t\t\t\t\t\t$constraint = $constraints[$paramName];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$constraint = $defaultConstraint;\n\t\t\t\t\t}\n\t\t\t\t\t$sectionResult .= '(?<' . $paramName . '>' . $constraint . ')';\n\t\t\t\t\t$paramIndex += 1;\n\t\t\t\t\t$sectionOffset = $param->matchEnd;\n\t\t\t\t}\n\t\t\t\tif ($sectionOffset < $sectionEnd)\n\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $sectionEnd - $sectionOffset);\n\t\t\t} else {\n\t\t\t\t$sectionResult = mb_substr($match, $section->start, $section->length);\n\t\t\t}\n\t\t\tif ($matchIsAbsolute && $sectionEnd > $firstPathSlashPos) $one = 1;\n\t\t\tif ($section->fixed) {\n\t\t\t\t$pathFixedSectionsCount += $one;\n\t\t\t\t$lastPathFixedSectionIndex = $sectionIndex;\n\t\t\t} else {\n\t\t\t\t$sectionResult = '(' . $sectionResult . ')?';\n\t\t\t}\n\t\t\t$sections[] = $sectionResult;\n\t\t}\n\t\tif ($pathFixedSectionsCount > 0) {\n\t\t\t$lastFixedSectionContent = & $sections[$lastPathFixedSectionIndex];\n\t\t\tif ($sectionsCountMinusOne == 0 && $lastPathFixedSectionIndex == 0 &&\n\t\t\t\t$lastFixedSectionContent === '/'\n\t\t\t) {\n\t\t\t\t$trailingSlash = ''; // homepage -> `/`\n\t\t\t} else {\n\t\t\t\t$lastCharIsSlash = mb_substr($lastFixedSectionContent, -1, 1) == '/';\n\t\t\t\tif ($lastPathFixedSectionIndex == $sectionsCountMinusOne) {// last section is fixed section\n\t\t\t\t\tif (!$lastCharIsSlash) $trailingSlash = '/?';\n\t\t\t\t} else {// last section is optional section or sections\n\t\t\t\t\t$lastFixedSectionContent .= ($lastCharIsSlash ? '' : '/') . '?';\n\t\t\t\t\t$trailingSlash = '/?';\n\t\t\t\t}}}\n\t\t// always add UTF-8 modifier to match UTF-8 request paths\n\t\t$result = '#^' . implode('', $sections) . $trailingSlash . '$#';\n\t\tif ($this->getStrIsUtf8($result)) $result .= 'u';\n\t\treturn $result;\n\t}", "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "protected function initReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\t$reverse = NULL;\n\t\tif ($this->reverse !== NULL) {\n\t\t\t$reverse = $this->reverse;\n\t\t} else if ($this->pattern !== NULL) {\n\t\t\t$reverse = $this->pattern;\n\t\t} else/* if ($this->pattern === NULL)*/ {\n\t\t\tif ($this->redirect !== NULL)\n\t\t\t\treturn $this->initFlagsByPatternOrReverse(\n\t\t\t\t\t$this->pattern !== NULL\n\t\t\t\t\t\t? $this->pattern\n\t\t\t\t\t\t: str_replace(['\\\\', '(?', ')?', '/?'], '', $this->match)\n\t\t\t\t);\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('reverse', 'pattern');\n\t\t}\n\n\t\t$this->lastPatternParam = NULL;\n\n\t\t$this->reverseSections = $this->initSectionsInfo($reverse);\n\t\t$this->reverse = $reverse;\n\n\t\t$match = NULL;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t}", "function process_matches(&$output, &$match)\n\t{\n\t\tif (sizeof($match) > 0)\n\t\t{\n\t\t\t$data = implode(\"\\n\", $match);\n\t\t\tarray_unshift($output, new vB_Text_Diff_Entry($data, $data));\n\t\t}\n\n\t\t$match = array();\n\t}", "protected function initSectionsInfo (& $pattern) {\n\t\t$result = [];\n\t\t$index = 0;\n\t\t$length = mb_strlen($pattern);\n\t\twhile ($index < $length) {\n\t\t\t$openPos = mb_strpos($pattern, '[', $index);\n\t\t\t$closePos = FALSE;\n\t\t\tif ($openPos !== FALSE)\n\t\t\t\t$closePos = mb_strpos($pattern, ']', $openPos);\n\t\t\tif ($closePos === FALSE) {\n\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> TRUE,\t'start'\t\t=> $index,\n\t\t\t\t\t'end'\t=> $length,\t'length'\t=> $length - $index\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tif ($index < $openPos)\n\t\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> TRUE,\t\t'start'\t\t=> $index,\n\t\t\t\t\t'end'\t=> $openPos,\t'length'\t=> $openPos - $index\n\t\t\t\t];\n\t\t\t\t$openPosPlusOne = $openPos + 1;\n\t\t\t\t$lengthLocal = $closePos - $openPosPlusOne;\n\t\t\t\t$pattern = mb_substr($pattern, 0, $openPos)\n\t\t\t\t\t. mb_substr($pattern, $openPosPlusOne, $lengthLocal)\n\t\t\t\t\t. mb_substr($pattern, $closePos + 1);\n\t\t\t\t$length -= 2;\n\t\t\t\t$closePos -= 1;\n\t\t\t\t$result[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t'start'\t\t=> $openPos,\n\t\t\t\t\t'end'\t=> $closePos,\t'length'\t=> $lengthLocal\n\t\t\t\t];\n\t\t\t}\n\t\t\t$index = $closePos;\n\t\t}\n\t\treturn $result;\n\t}", "protected function manageMatches() {\n $this->invertedIndex = new InvertedIndex();\n\n foreach ($this->matches as $index => $word) {\n $this->manageWord($word, $index);\n }\n unset($index);\n unset($word);\n }", "public static function diff_match($a, $b, $level=\"line\")\n {\n // set_time_limit(0);\n $answer = \"\";\n if($level == \"line\" || $level == \"word\")\n {\n if($level == \"line\")\n {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n }\n else\n {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n \n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < sizeof($as); $i++)\n {\n $start+= strlen($as[$i])+1;\n for($j = 0; $j < sizeof($bs); $j++)\n {\n if($as[$i] != $bs[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for($i = 0; $i < $m; $i++)\n {\n for($j = 0; $j < $n; $j++)\n {\n if($a[$i] != $b[$j])\n {\n if(isset($next[$j])) unset($next[$j]);\n }\n else\n {\n if(!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if($next[$j] > $len)\n {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n if($level == \"line\" && $answer == \"\") return self::diff_match($a, $b, \"word\");\n elseif($level == \"word\" && $answer == \"\") return self::diff_match($a, $b, \"letter\");\n else return $answer;\n }", "function parseWorldometers() {\n $ch = curl_init(\"https://www.worldometers.info/coronavirus/country/us/\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n\n $US_infected = \"\";\n $US_death = \"\";\n $US_recovered = \"\";\n\n $regex1 = \"/<h1>Coronavirus Cases:<\\/h1>.*?<div class=\\\"maincounter-number\\\">.*?<span style=\\\"color:#aaa\\\">(.*?)<\\/span>.*?<\\/div>.*?<\\/div>.*?<div id=\\\"maincounter-wrap\\\" style=\\\"margin-top:15px\\\">.*?<h1>Deaths:<\\/h1>/\";\n preg_match($regex1, $data, $output1);\n //print_r($output1);\n $US_infected = $output1[1];\n\n $regex2 = \"/<h1>Deaths:<\\/h1> <div class=\\\"maincounter-number\\\"> <span>(.*?)<\\/span> <\\/div><\\/div><div id=\\\"maincounter-wrap\\\" style=\\\"margin-top:15px;\\\"> <h1>Recovered:<\\/h1>/\";\n preg_match($regex2, $data, $output2);\n //print_r($output2);\n $US_death = $output2[1];\n\n $regex3 = \"/<h1>Recovered:<\\/h1> <div class=\\\"maincounter-number\\\" style=\\\"color:#8ACA2B \\\"> <span>(.*?)<\\/span> <\\/div><\\/div><div style=\\\"margin-top:50px;\\\"><\\/div><!-- START --><style>/\";\n preg_match($regex3, $data, $output3);\n//print_r($output3);\n $US_recovered = $output3[1];\n\n return Array(\n \"source_name\" => \"Worldometer.info\",\n \"source_url\" => \"https://www.worldometers.info/coronavirus/country/us/\",\n \"US_infected\" => fix($US_infected),\n \"US_death\" => fix($US_death),\n \"US_recovered\" => fix($US_recovered)\n );\n}", "function phorum_api_diff_match($a, $b, $level=\"line\")\n{\n // set_time_limit(0); No, we don't like it.\n $answer = \"\";\n if ($level == \"line\" || $level == \"word\")\n {\n if ($level == \"line\") {\n $as = explode(\"\\n\", $a);\n $bs = explode(\"\\n\", $b);\n } else {\n $as = explode(\" \", $a);\n $bs = explode(\" \", $b);\n }\n\n $last = array();\n $next = array();\n $start = -1;\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < sizeof($as); $i++) {\n $start+= strlen($as[$i])+1;\n for ($j = 0; $j < sizeof($bs); $j++) {\n if ($as[$i] != $bs[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = strlen($bs[$j]) + 1;\n else\n $next[$j] = strlen($bs[$j]) + $last[$j-1] + 1;\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $start-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n else\n {\n $m = strlen($a);\n $n = strlen($b);\n $last = array();\n $next = array();\n $len = 0;\n $answer = \"\";\n for ($i = 0; $i < $m; $i++) {\n for ($j = 0; $j < $n; $j++) {\n if ($a[$i] != $b[$j]) {\n if (isset($next[$j])) unset($next[$j]);\n } else {\n if (!isset($last[$j-1]))\n $next[$j] = 1;\n else\n $next[$j] = 1 + $last[$j-1];\n if ($next[$j] > $len) {\n $len = $next[$j];\n $answer = substr($a, $i-$len+1, $len);\n }\n }\n }\n // If PHP ever copies pointers here instead of copying data,\n // this will fail. They better add array_copy() if that happens.\n $last = $next;\n }\n }\n\n if ($level == \"line\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"word\");\n } elseif ($level == \"word\" && $answer == \"\") {\n return phorum_api_diff_match($a, $b, \"letter\");\n } else {\n return $answer;\n }\n}", "protected function parseTable(&$template, $matches)\n {\n $tables = [];\n for ($i = 0; $i < count($matches[1]); $i ++) {\n $match = $matches[0][$i];\n $tag = $this->clean($matches[1][$i]);\n if ('TBL:' == substr($tag, 0, 4)) {\n $tags = explode(':', $tag, 3);\n $tables[$tags[1]] = [\n 'start' => $match,\n 'end' => null,\n 'expr' => $tags[2],\n 'content' => null\n ];\n }\n if ('TBLE:' == substr($tag, 0, 5)) {\n $tags = explode(':', $tag, 2);\n if (isset($tables[$tags[1]])) {\n $tables[$tags[1]]['end'] = $match;\n }\n }\n }\n $keys = array_keys($tables);\n for ($i = 0; $i < count($keys); $i ++) {\n if ($tables[$keys[$i]]['start'] && $tables[$keys[$i]]['end']) {\n // find table row begin \\trowd\n if (false !== ($s = strpos($template, $tables[$keys[$i]]['start']))) {\n $s = strrpos(substr($template, 0, $s - 1), '\\trowd ');\n }\n // find table row end \\row followed by \\pard\n if (false !== ($e = strpos($template, $tables[$keys[$i]]['end']))) {\n if (false !== ($e = strpos($template, '\\row ', $e))) {\n $e = strpos($template, '\\pard ', $e);\n }\n }\n if (is_int($s) && is_int($e)) {\n $header = substr($template, 0, $s);\n $content = substr($template, $s, $e - $s);\n $footer = substr($template, $e);\n $content = strtr($content, [\n $tables[$keys[$i]]['start'] => '',\n $tables[$keys[$i]]['end'] => ''\n ]);\n $tables[$keys[$i]]['content'] = $content;\n $template = $header.'%%TBL:'.$keys[$i].'%%'.$footer;\n }\n }\n }\n return $tables;\n }", "public static function parseArrays($template, $data, $output)\n {\n foreach ($data as $key => $value) {\n if (is_array($value) || ($value instanceof \\ArrayAccess) || ($value instanceof \\ArrayObject)) {\n $start = '[{' . $key . '}]';\n $end = '[{/' . $key . '}]';\n if ((strpos($template, $start) !== false) && (strpos($template, $end) !== false)) {\n $loopCode = substr($template, strpos($template, $start));\n $loopCode = substr($loopCode, 0, (strpos($loopCode, $end) + strlen($end)));\n\n $outputLoop = '';\n $i = 0;\n foreach ($value as $ky => $val) {\n $loop = str_replace($start, '', $loopCode);\n $loop = str_replace($end, '', $loop);\n if (strpos($loop, '[{if(') !== false) {\n $matches = [];\n preg_match_all('/\\[{if/mi', $loop, $matches, PREG_OFFSET_CAPTURE);\n\n if (isset($matches[0]) && isset($matches[0][0])) {\n foreach ($matches[0] as $match) {\n $cond = substr($loop, $match[1]);\n $cond = substr($cond, 0, strpos($cond, '[{/if}]') + 7);\n $var = substr($cond, strpos($cond, '(') + 1);\n $var = substr($var, 0, strpos($var, ')'));\n // If var is an array\n if (strpos($var, '[') !== false) {\n $index = substr($var, (strpos($var, '[') + 1));\n $index = substr($index, 0, strpos($index, ']'));\n $var = substr($var, 0, strpos($var, '['));\n $varSet = (!empty($val[$var][$index]));\n } else {\n $index = null;\n $varSet = (!empty($val[$var]));\n }\n if (strpos($cond, '[{else}]') !== false) {\n if ($varSet) {\n $code = substr($cond, (strpos($cond, ')}]') + 3));\n $code = substr($code, 0, strpos($code, '[{else}]'));\n $code = (null !== $index) ?\n str_replace('[{' . $var . '[' . $index . ']}]', $val[$var][$index], $code) :\n str_replace('[{' . $var . '}]', $val[$var], $code);\n $loop = str_replace($cond, $code, $loop);\n } else {\n $code = substr($cond, (strpos($cond, '[{else}]') + 8));\n $code = substr($code, 0, strpos($code, '[{/if}]'));\n $loop = str_replace($cond, $code, $loop);\n }\n } else {\n if ($varSet) {\n $code = substr($cond, (strpos($cond, ')}]') + 3));\n $code = substr($code, 0, strpos($code, '[{/if}]'));\n $code = (null !== $index) ?\n str_replace('[{' . $var . '[' . $index . ']}]', $val[$var][$index], $code) :\n str_replace('[{' . $var . '}]', $val[$var], $code);\n $loop = str_replace($cond, $code, $loop);\n } else {\n $loop = str_replace($cond, '', $loop);\n }\n }\n }\n }\n }\n\n // Handle nested array\n if (is_array($val) || ($value instanceof \\ArrayAccess) || ($val instanceof \\ArrayObject)) {\n if (is_numeric($ky)) {\n $oLoop = $loop;\n foreach ($val as $k => $v) {\n // Check is value is stringable\n if ((is_object($v) && method_exists($v, '__toString')) ||\n (!is_object($v) && !is_array($v))) {\n $oLoop = str_replace('[{' . $k . '}]', $v, $oLoop);\n }\n }\n if (strpos($oLoop, '[{i}]') !== false) {\n $oLoop = str_replace('[{i}]', ($i + 1), $oLoop);\n }\n $outputLoop .= $oLoop;\n } else {\n $s = '[{' . $ky . '}]';\n $e = '[{/' . $ky . '}]';\n if ((strpos($loop, $s) !== false) && (strpos($loop, $e) !== false)) {\n $l = $loop;\n $lCode = substr($l, strpos($l, $s));\n $lCode = substr($lCode, 0, (strpos($lCode, $e) + strlen($e)));\n\n $l = str_replace($s, '', $lCode);\n $l = str_replace($e, '', $l);\n $oLoop = '';\n $j = 1;\n\n foreach ($val as $k => $v) {\n // Check is value is stringable\n if ((is_object($v) && method_exists($v, '__toString')) ||\n (!is_object($v) && !is_array($v))) {\n if (strpos($l, '[{i}]') !== false) {\n $oLoop .= str_replace(['[{key}]', '[{value}]', '[{i}]'], [$k, $v, $j], $l);\n } else {\n $oLoop .= str_replace(['[{key}]', '[{value}]'], [$k, $v], $l);\n }\n $j++;\n }\n }\n $outputLoop = str_replace($lCode, $oLoop, $loop);\n }\n }\n // Handle scalar\n } else {\n // Check is value is stringable\n if ((is_object($val) && method_exists($val, '__toString')) ||\n (!is_object($val) && !is_array($val))) {\n if (strpos($loop, '[{i}]') !== false) {\n $outputLoop .= str_replace(['[{key}]', '[{value}]', '[{i}]'], [$ky, $val, ($i + 1)], $loop);\n } else {\n $outputLoop .= str_replace(['[{key}]', '[{value}]'], [$ky, $val], $loop);\n }\n }\n }\n $i++;\n if ($i < count($value)) {\n $outputLoop .= PHP_EOL;\n }\n }\n $output = str_replace($loopCode, $outputLoop, $output);\n }\n }\n }\n\n return $output;\n }", "private function getSubSectionsByReference(array $subSections, $reference) {\n // loops through the subsections\n foreach ($subSections as $key => $subSection) {\n // limit the results to only those with the correct reference\n $results = [];\n foreach ($subSection['Results'] as $resultKey => $result) {\n if ($result['SampleName'] == $reference) {\n $results[] = $result;\n }\n }\n $subSections[$key]['Results'] = $results;\n\n // unset subsections if no results\n if (!$results) {\n unset($subSections[$key]);\n }\n }\n\n return $subSections;\n }", "public function resolveMatchScore($fixedHomeScore, $fixedAwayScore, $match);", "final private function buildRouteData($pattern)\n {\n // patch tags -- experemential\n if ( count(array_filter($this->routeTags)) ) {\n $pattern = preg_replace($this->routeTags['pattern'], $this->routeTags['replacement'], $pattern);\n }\n \n // find unknown tags\n preg_match_all('~'.preg_quote('[!:').'([a-z\\_\\-]+)'.preg_quote(':!]').'~i', $pattern, $matches);\n\n $exception = null;\n foreach ( $matches[1] as $tag ) {\n $exception = new UnknownRouteTagException('Unknown tag: '.$tag);\n }\n\n if ( $exception ) {\n throw $exception;\n }\n \n // fetch pattern data\n $data = [];\n $replacer = [];\n $offset = 0;\n if ( preg_match_all(static::VAR_REGEX, $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER) ) {\n foreach ( $matches as $set ) {\n if ( $set[0][1] > $offset ) {\n $data[] = substr($pattern, $offset, $set[0][1] - $offset);\n $replacer[] = $set[0][0];\n }\n \n $data[] = array(\n $set[1][0],\n isset($set[2])\n ? trim($set[2][0])\n : static::DEFAULT_REGEX\n );\n\n $offset = $set[0][1] + strlen($set[0][0]);\n }\n }\n \n // build match credentials\n if ( empty($data) ) {\n $storage['regex'] = $pattern;\n $storage['vars'] = [];\n }\n else {\n $storage['regex'] = '';\n $storage['vars'] = [];\n\n foreach ( $data as $current ) {\n if ( is_string($current) ) {\n $storage['regex'] .= preg_quote($current, '~');\n continue;\n }\n\n list($name, $currentRegex) = $current;\n \n if ( isset($storage['vars'][$name]) ) {\n throw new RouteAggregationException(\n 'Impossible to use placeholder \"'.$name.'\" more then once'\n );\n }\n\n $storage['vars'][$name] = null;\n $storage['regex'] .= '('.$currentRegex.')';\n }\n }\n \n $storage['replacer'] = array_combine(array_keys($storage['vars']), $replacer);\n $storage['pattern'] = $pattern;\n \n return $storage;\n }", "abstract public function getMatches(array $tokens, array $info = []): array;", "function find_member_variables($file_contents, array &$line_matches = null) {\r\n $b=0;\r\n $variables = array();\r\n \r\n if (!is_array($file_contents))\r\n $file_contents = explode(\"\\r\\n\", $file_contents);\r\n \r\n $count = count($file_contents);\r\n \r\n for ($i=0; $i<$count; $i++) {\r\n $line = $file_contents[$i];\r\n if (strstr($line, \"{\")) {\r\n ++$b;\r\n }\r\n if (strstr($line, \"}\")) {\r\n --$b;\r\n }\r\n if ($b == 1) {\r\n $matches = array();\r\n\r\n if ( (preg_match('/^[^=]*\\s+([a-zA-Z0-9_]+)\\s*;/', $line, $matches) ||\r\n preg_match('/([a-zA-Z0-9_]+)\\s*=/', $line, $matches)) &&\r\n !preg_match('/static/', $line) ) {\r\n $variables[$i] = $matches[1];\r\n \r\n if (isset($line_matches))\r\n $line_matches[$i] = $file_contents[$i];\r\n }\r\n\r\n }\r\n } \r\n return $variables;\r\n}", "function reverse($data) {\t\t\n\t$rules = array(\n\t\t\"111\" => \"0\",\n\t\t\"110\" => \"0\",\n\t\t\"101\" => \"0\",\n\t\t\"100\" => \"1\",\n\t\t\"011\" => \"1\",\n\t\t\"010\" => \"1\",\n\t\t\"001\" => \"1\",\n\t\t\"000\" => \"0\"\n\t);\n\n\t// This array starts with each of the rules, and is whittled down until only one possible sequence matches.\n\t// We build a number of potential ancestor strings from the rules, which become possible matches to the actual previous row.\n\t$possibleMatches = array();\n\n\t// We step through each character in our row, to evaluate which ancestor rules it matches with\n\tfor ($i = 0; $i < strlen((string)$data); $i ++) {\n\n\t\t// We are going to compare the possible matches so far with the current rules which match.\n\t\t$newMatches = array();\n\n\t\t// We just want to check every rule to see if it fits into any of the possible match strings so far.\t\t\n\t\tforeach ($rules as $rule => $value) {\n\n\t\t\t// Does the data row's input character equal the rule's output character?\t\t\t\n\t\t\tif ((string)$value == ((string)$data[$i])) {\n\n\t\t\t\t// Only on the first step, push each rule into the array or possible - gotta start somewhere, and for the first character, every ancestor rule could apply.\n\t\t\t\tif ($i == 0) {\n\t\t\t\t\tarray_push($newMatches, substr((string)$rule, 1, 2));\n\t\t\t\t} \n\n\t\t\t\telse {\n\t\t\t\t\tforeach($possibleMatches as $part) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t(isset(((string)$part)[$i]) && ((string)$rule)[1] == ((string)$part)[$i]) \t// Does the rule's middle character match the current end of the possible match?\n\t\t\t\t\t\t\t\t&& ((string)$rule)[0] == ((string)$part)[$i-1]\t\t\t\t\t\t\t\t// And does the rule's first character match with the second last character of the possible match?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// (essentially - does the rule line up with any of the current possible strings?)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t// Generate the next possible string by adding the right-most character of the rule-part to one of the possible matches\n\t\t\t\t\t\t\t\t$newData = (string)$part . ((string)$rule)[2];\n\n\t\t\t\t\t\t\t\t// Just a quick hack to force the rightmost overflow bit to be a zero\n\t\t\t\t\t\t\t\tif ($i + 1 >= strlen($data) - 1) {\n\t\t\t\t\t\t\t\t\tif (((string)$rule)[2] != \"0\") $newData = \"\";\n\t\t\t\t\t\t\t\t} \n\n\t\t\t\t\t\t\t\t// Add our new string to the array of possible matches\n\t\t\t\t\t\t\t\tif ($newData != \"\") array_push($newMatches, $newData);\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// (we could probably unset non matching strings above instead of reassigning here)\n\t\t$possibleMatches = $newMatches;\t\n\t}\n\treturn substr($possibleMatches[0], 0, strlen($data));\n}", "private function _Parsing_Translation2($matches)\n {\n return Zero_I18n::View($matches[1], $matches[2]);\n }", "function linkRgaa($matches) {\n\t$rgaa = array(\n'1.1' => 'http://rgaa.net/1-1-Absence-de-cadres-non-titres.html',\n'1.2' => 'http://rgaa.net/Pertinence-des-titres-donnes-aux.html',\n'2.1' => 'http://rgaa.net/Presence-d-un-autre-moyen-que-la.html',\n'2.2' => 'http://rgaa.net/Presence-d-un-autre-moyen-que-la,4.html',\n'2.3' => 'http://rgaa.net/Presence-d-un-moyen-de.html',\n'2.4' => 'http://rgaa.net/Presence-d-un-moyen-de,6.html',\n'2.5' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du.html',\n'2.6' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,8.html',\n'2.7' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,9.html',\n'2.8' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,10.html',\n'2.9' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,11.html',\n'2.10' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,12.html',\n'2.11' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,13.html',\n'2.12' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,14.html',\n'2.13' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,15.html',\n'2.14' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,16.html',\n'2.15' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,17.html',\n'2.16' => 'http://rgaa.net/Valeur-du-rapport-de-contraste-du,18.html',\n'3.1' => 'http://rgaa.net/Possibilite-d-identifier-les.html',\n'3.2' => 'http://rgaa.net/Presence-d-information-prealable.html',\n'3.3' => 'http://rgaa.net/Positionnement-correct-des.html',\n'3.4' => 'http://rgaa.net/Regroupement-d-elements-de.html',\n'3.5' => 'http://rgaa.net/Absence-d-element-fieldset-sans.html',\n'3.6' => 'http://rgaa.net/Pertinence-du-contenu-de-l-element.html',\n'3.7' => 'http://rgaa.net/Regroupement-d-elements-option.html',\n'3.8' => 'http://rgaa.net/Presence-d-un-attribut-label-sur-l.html',\n'3.9' => 'http://rgaa.net/Pertinence-du-contenu-de-l.html',\n'3.10' => 'http://rgaa.net/Absence-d-element-de-formulaire.html',\n'3.11' => 'http://rgaa.net/Absence-d-element-de-formulaire,29.html',\n'3.12' => 'http://rgaa.net/Pertinence-des-etiquettes-d.html',\n'3.13' => 'http://rgaa.net/Presence-d-informations-ou-de.html',\n'3.14' => 'http://rgaa.net/Presence-de-mecanismes-permettant.html',\n'3.15' => 'http://rgaa.net/Presence-de-mecanismes-permettant,33.html',\n'3.16' => 'http://rgaa.net/Presence-d-une-page-d-aide-ou-d-un.html',\n'4.1' => 'http://rgaa.net/Presence-de-l-attribut-alt.html',\n'4.2' => 'http://rgaa.net/Pertinence-de-l-alternative.html',\n'4.3' => 'http://rgaa.net/Pertinence-de-l-alternative,37.html',\n'4.4' => 'http://rgaa.net/Pertinence-de-l-alternative,38.html',\n'4.5' => 'http://rgaa.net/Pertinence-de-l-alternative-vide.html',\n'4.6' => 'http://rgaa.net/Longueur-du-contenu-des.html',\n'4.7' => 'http://rgaa.net/Existence-d-une-description-longue.html',\n'4.8' => 'http://rgaa.net/Pertinence-de-la-description.html',\n'4.9' => 'http://rgaa.net/Presence-de-l-attribut-longdesc.html',\n'4.10' => 'http://rgaa.net/Presence-d-une-information-de.html',\n'4.11' => 'http://rgaa.net/Coherence-dans-l-identification.html',\n'5.1' => 'http://rgaa.net/Acces-a-une-information.html',\n'5.2' => 'http://rgaa.net/Presence-de-la-transcription.html',\n'5.3' => 'http://rgaa.net/Pertinence-de-la-transcription.html',\n'5.4' => 'http://rgaa.net/Presence-d-une-description-audio.html',\n'5.5' => 'http://rgaa.net/Pertinence-de-la-description-audio.html',\n'5.6' => 'http://rgaa.net/Possibilite-de-controler-l.html',\n'5.7' => 'http://rgaa.net/Presence-d-une-description-audio,52.html',\n'5.8' => 'http://rgaa.net/Presence-d-une-description-audio,53.html',\n'5.9' => 'http://rgaa.net/Presence-du-sous-titrage.html',\n'5.10' => 'http://rgaa.net/Pertinence-du-sous-titrage.html',\n'5.11' => 'http://rgaa.net/Presence-d-une-alternative-aux.html',\n'5.12' => 'http://rgaa.net/Presence-d-une-alternative-aux,57.html',\n'5.13' => 'http://rgaa.net/Absence-d-elements-provoquant-des.html',\n'5.14' => 'http://rgaa.net/Absence-de-code-javascript,59.html',\n'5.15' => 'http://rgaa.net/Absence-de-mise-en-forme.html',\n'5.16' => 'http://rgaa.net/Compatibilite-des-elements.html',\n'5.17' => 'http://rgaa.net/Absence-totale-de-changements.html',\n'5.18' => 'http://rgaa.net/Presence-du-sous-titrage,63.html',\n'5.19' => 'http://rgaa.net/Absence-de-l-element-blink.html',\n'5.20' => 'http://rgaa.net/Absence-d-elements-provoquant-des,65.html',\n'5.21' => 'http://rgaa.net/Absence-de-code-javascript,66.html',\n'5.22' => 'http://rgaa.net/Absence-de-mise-en-forme,67.html',\n'5.23' => 'http://rgaa.net/Absence-d-element-marquee.html',\n'5.24' => 'http://rgaa.net/Absence-d-elements-affichant-des.html',\n'5.25' => 'http://rgaa.net/Absence-de-code-javascript,70.html',\n'5.26' => 'http://rgaa.net/Absence-de-mise-en-forme,71.html',\n'5.27' => 'http://rgaa.net/Independance-du-peripherique-d.html',\n'5.28' => 'http://rgaa.net/Presence-d-une-alternative-aux,73.html',\n'5.29' => 'http://rgaa.net/Absence-d-elements-declenchant-la.html',\n'5.30' => 'http://rgaa.net/Absence-d-element-bgsound.html',\n'5.31' => 'http://rgaa.net/Presence-de-version-en-langue-des.html',\n'5.32' => 'http://rgaa.net/Pertinence-de-la-version-en-langue.html',\n'5.33' => 'http://rgaa.net/Niveau-sonore-de-la-piste-de.html',\n'5.34' => 'http://rgaa.net/Presence-d-un-mecanisme-pour.html',\n'6.1' => 'http://rgaa.net/Acces-aux-liens-textuels-doublant.html',\n'6.2' => 'http://rgaa.net/Presence-d-un-avertissement.html',\n'6.3' => 'http://rgaa.net/Presence-d-un-avertissement,82.html',\n'6.4' => 'http://rgaa.net/Presence-d-un-avertissement,83.html',\n'6.5' => 'http://rgaa.net/Absence-d-ouverture-de-nouvelles.html',\n'6.6' => 'http://rgaa.net/Absence-de-piege-lors-de-la.html',\n'6.7' => 'http://rgaa.net/Absence-d-element-meta-provoquant.html',\n'6.8' => 'http://rgaa.net/Absence-de-code-javascript.html',\n'6.9' => 'http://rgaa.net/Absence-d-elements-provoquant-un.html',\n'6.10' => 'http://rgaa.net/Absence-d-element-meta-provoquant,89.html',\n'6.11' => 'http://rgaa.net/Absence-de-code-javascript,90.html',\n'6.12' => 'http://rgaa.net/Absence-d-elements-provoquant-une.html',\n'6.13' => 'http://rgaa.net/Possibilite-d-identifier-la.html',\n'6.14' => 'http://rgaa.net/Possibilite-d-identifier-la,93.html',\n'6.15' => 'http://rgaa.net/Coherence-de-la-destination-ou-de.html',\n'6.16' => 'http://rgaa.net/Absence-de-liens-sans-intitule.html',\n'6.17' => 'http://rgaa.net/Presence-d-une-page-contenant-le.html',\n'6.18' => 'http://rgaa.net/Coherence-du-plan-du-site.html',\n'6.19' => 'http://rgaa.net/Presence-d-un-acces-a-la-page.html',\n'6.20' => 'http://rgaa.net/Presence-d-un-fil-d-ariane.html',\n'6.21' => 'http://rgaa.net/Presence-de-menus-ou-de-barres-de.html',\n'6.22' => 'http://rgaa.net/Coherence-de-la-position-des-menus.html',\n'6.23' => 'http://rgaa.net/Coherence-de-la-presentation-des.html',\n'6.24' => 'http://rgaa.net/Navigation-au-clavier-dans-un.html',\n'6.25' => 'http://rgaa.net/Presence-d-un-avertissement,104.html',\n'6.26' => 'http://rgaa.net/Presence-des-informations-de.html',\n'6.27' => 'http://rgaa.net/Presence-des-informations-de-poids.html',\n'6.28' => 'http://rgaa.net/Presence-des-informations-de,107.html',\n'6.29' => 'http://rgaa.net/Presence-de-regroupement-pour-les.html',\n'6.30' => 'http://rgaa.net/Presence-d-un-balisage-permettant.html',\n'6.31' => 'http://rgaa.net/Presence-de-liens-d-evitement-ou-d.html',\n'6.32' => 'http://rgaa.net/Coherence-des-liens-d-evitement-ou.html',\n'6.33' => 'http://rgaa.net/Ordre-des-liens-d-evitement-ou-d.html',\n'6.34' => 'http://rgaa.net/Presence-d-un-moteur-de-recherche.html',\n'6.35' => 'http://rgaa.net/Possibilite-de-naviguer-facilement.html',\n'6.36' => 'http://rgaa.net/Presence-d-une-indication-de-la.html',\n'7.1' => 'http://rgaa.net/Absence-de-generation-de-contenus.html',\n'7.2' => 'http://rgaa.net/Absence-d-alteration-de-la.html',\n'7.3' => 'http://rgaa.net/Lisibilite-des-informations.html',\n'7.4' => 'http://rgaa.net/Absence-d-espaces-utilises-pour.html',\n'7.5' => 'http://rgaa.net/Absence-de-definition-d-une.html',\n'7.6' => 'http://rgaa.net/Possibilite-de-remplacer-les.html',\n'7.7' => 'http://rgaa.net/Possibilite-de-remplacer-les,122.html',\n'7.8' => 'http://rgaa.net/Absence-d-attributs-ou-d-elements.html',\n'7.9' => 'http://rgaa.net/Absence-d-elements-HTML-utilises-a.html',\n'7.10' => 'http://rgaa.net/Maintien-de-la-distinction.html',\n'7.11' => 'http://rgaa.net/Absence-de-suppression-de-l-effet.html',\n'7.12' => 'http://rgaa.net/Absence-de-justification-du-texte.html',\n'7.13' => 'http://rgaa.net/Lisibilite-du-document-en-cas-d.html',\n'7.14' => 'http://rgaa.net/Absence-d-unites-absolues-ou-de.html',\n'7.15' => 'http://rgaa.net/Absence-d-apparition-de-barre-de.html',\n'7.16' => 'http://rgaa.net/Largeur-des-blocs-de-textes.html',\n'7.17' => 'http://rgaa.net/Valeur-de-l-espace-entre-les.html',\n'7.18' => 'http://rgaa.net/Restitution-correcte-dans-les.html',\n'8.1' => 'http://rgaa.net/Mise-a-jour-des-alternatives-aux.html',\n'8.2' => 'http://rgaa.net/Universalite-du-gestionnaire-d.html',\n'8.3' => 'http://rgaa.net/Universalite-des-gestionnaires-d.html',\n'8.4' => 'http://rgaa.net/Possibilite-de-desactiver-toute.html',\n'8.5' => 'http://rgaa.net/Absence-de-changements-de-contexte.html',\n'8.6' => 'http://rgaa.net/Ordre-d-acces-au-clavier-aux.html',\n'8.7' => 'http://rgaa.net/Utilisation-correcte-du-role-des.html',\n'8.8' => 'http://rgaa.net/Presence-d-une-alternative-au-code.html',\n'8.9' => 'http://rgaa.net/Absence-de-suppression-du-focus.html',\n'8.10' => 'http://rgaa.net/Absence-de-limite-de-temps-pour.html',\n'8.11' => 'http://rgaa.net/Absence-de-perte-d-informations.html',\n'8.12' => 'http://rgaa.net/Presence-d-une-alternative-au-code,145.html',\n'8.13' => 'http://rgaa.net/Accessibilite-des-contenus.html',\n'9.1' => 'http://rgaa.net/Presence-de-la-declaration-d.html',\n'9.2' => 'http://rgaa.net/Conformite-de-la-position-de-la.html',\n'9.3' => 'http://rgaa.net/Conformite-syntaxique-de-la.html',\n'9.4' => 'http://rgaa.net/Validite-du-code-HTML-XHTML-au.html',\n'9.5' => 'http://rgaa.net/Absence-de-composants-obsoletes.html',\n'9.6' => 'http://rgaa.net/Presence-d-un-titre-dans-la-page.html',\n'9.7' => 'http://rgaa.net/Pertinence-du-titre-de-la-page.html',\n'9.8' => 'http://rgaa.net/Presence-d-une-langue-de.html',\n'10.1' => 'http://rgaa.net/Presence-d-au-moins-un-titre-de.html',\n'10.2' => 'http://rgaa.net/Pertinence-du-contenu-des-titres.html',\n'10.3' => 'http://rgaa.net/Absence-d-interruption-dans-la.html',\n'10.4' => 'http://rgaa.net/Presence-d-une-hierarchie-de.html',\n'10.5' => 'http://rgaa.net/Absence-de-simulation-visuelle-de.html',\n'10.6' => 'http://rgaa.net/Utilisation-systematique-de-listes.html',\n'10.7' => 'http://rgaa.net/Balisage-correct-des-listes-de.html',\n'10.8' => 'http://rgaa.net/Balisage-correct-des-citations.html',\n'10.9' => 'http://rgaa.net/Balisage-correct-des-abreviations.html',\n'10.10' => 'http://rgaa.net/Balisage-correct-des-acronymes.html',\n'10.11' => 'http://rgaa.net/Pertinence-de-la-version-non.html',\n'10.12' => 'http://rgaa.net/Pertinence-de-la-version-complete.html',\n'10.13' => 'http://rgaa.net/Accessibilite-des-documents.html',\n'11.1' => 'http://rgaa.net/Presence-des-balises-th-pour.html',\n'11.2' => 'http://rgaa.net/Presence-d-une-relation-entre-les.html',\n'11.3' => 'http://rgaa.net/Presence-d-une-relation-entre-les,170.html',\n'11.4' => 'http://rgaa.net/Absence-des-elements-propres-aux.html',\n'11.5' => 'http://rgaa.net/Absence-de-tableaux-de-donnees-ou.html',\n'11.6' => 'http://rgaa.net/Linearisation-correcte-des.html',\n'11.7' => 'http://rgaa.net/Presence-d-un-titre-pour-les.html',\n'11.8' => 'http://rgaa.net/Presence-d-un-resume-pour-les.html',\n'11.9' => 'http://rgaa.net/Pertinence-du-titre-du-tableau-de.html',\n'11.10' => 'http://rgaa.net/Pertinence-du-resume-du-tableau-de.html',\n'12.1' => 'http://rgaa.net/Presence-de-l-indication-des.html',\n'12.2' => 'http://rgaa.net/Presence-de-l-indication-des,179.html',\n'12.3' => 'http://rgaa.net/Equivalence-de-l-information-mise.html',\n'12.4' => 'http://rgaa.net/Presence-de-liens-ou-de.html',\n'12.5' => 'http://rgaa.net/Absence-de-syntaxes-cryptiques-par.html',\n'12.6' => 'http://rgaa.net/Presence-d-informations-sur-les.html',\n'12.7' => 'http://rgaa.net/Presence-d-un-moyen-de,184.html',\n'12.8' => 'http://rgaa.net/Presence-d-un-autre-moyen-que-la,185.html',\n'12.9' => 'http://rgaa.net/Presence-d-un-autre-moyen-que-la,186.html',\n'12.10' => 'http://rgaa.net/Utilisation-d-un-style-de.html'\n);\n\n\treturn $matches[1].'<a href=\"'.$rgaa[$matches[2]].'\">'.$matches[2].'</a>';\n}", "function parseORgov() {\n $ch = curl_init(\"https://www.oregon.gov/oha/PH/DISEASESCONDITIONS/DISEASESAZ/Pages/emerging-respiratory-infections.aspx\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $data = curl_exec($ch);\n curl_close($ch);\n\n $OR_infected = \"\";\n $OR_death = \"0\";\n\n // \\r\\n is for aspx (windows) newline\n $regex = \"/<td bgcolor=\\\"#cff9f3\\\" style=\\\"width:15%;height:31px;text-align:center\\\">(.*)<\\/td><\\/tr>/\";\n //$regex = \"/Positive<\\/td>\\r\\n<td bgcolor=\\\"#cff9f3\\\" style=\\\"width:15%;height:31px;text-align:center\\\">(.*)<sup>\\‡/\";\n preg_match($regex, $data, $output);\n //print_r ($output);\n $OR_infected = $output[1];\n //$OR_death = $output[2];\n\n return Array(\n \"source_name\" => \"Oregon Health Authority\",\n \"source_url\" => \"https://www.oregon.gov/oha/PH/DISEASESCONDITIONS/DISEASESAZ/Pages/emerging-respiratory-infections.aspx\",\n \"OR_infected\" => fix($OR_infected),\n \"OR_death\" => fix($OR_death)\n );\n}", "function _tsuiseki_tracking_extract_data_from_url($ref) {\n $ref = (string)($ref);\n $opts = array();\n if (!empty($ref)) {\n $ref = urldecode($ref);\n $parts = preg_split('/[&|?]/', $ref);\n if (!empty($parts)) {\n $p = array();\n foreach ($parts as $part) {\n if (preg_match('/\\w+?=.*\\/i=1/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1] .'='. $p[2];\n }\n else if (preg_match('/\\w+?=.*/', $part)) {\n $p = preg_split('/=/', $part);\n $opts[$p[0]] = $p[1];\n }\n } // foreach\n }\n }\n return $opts;\n}", "private function getConjoinedResult(): void\n {\n $tot_match = 0;\n $tot_indecisive = 0;\n $tot_no_match = 0;\n $matches = $this->getNeedlesResult();\n foreach ($matches as $n_key => $match) {\n if (isset($match['matching_filters'])) {\n $match[$this->config->prefix . 'filter_match_count'] = count($match['matching_filters']);\n } else {\n $match[$this->config->prefix . 'filter_match_count'] = 0;\n }\n if ($match[$this->config->prefix . 'filter_match_count'] === 1) {\n $tot_match++;\n $match = $this->getReturnValues($match);\n $match = $this->getLayerData($match);\n unset($match['matching_filters']);\n } elseif ($match[$this->config->prefix . 'filter_match_count'] > 1) {\n unset($match['matching_filters']);\n $tot_indecisive++;\n } else {\n $tot_no_match++;\n }\n $this->SearchResult->matches[$n_key] = $match;\n }\n $this->SearchResult->total_matches = $tot_match;\n $this->SearchResult->total_indecisive_matches = $tot_indecisive;\n $this->SearchResult->total_no_matches = $tot_no_match;\n }", "public static function dataPathMatch() {\n\t\treturn [\n\t\t\t'Exact match: \"/\"' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Exact match: \"/test\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Exact match: \"/test/\" (with trailing slash' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\n\t\t\t'Partial match: \"/\" vs \"/test\"' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/test',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/\" vs \"/test/\" (with trailing slash)' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test/\" (with trailing slash) vs \"/test/ing\"' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/test/ing',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/\" (without vs with trailing slash)' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/ing\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/ing',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/ing/\" (with trailing slash)' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/ing/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\n\t\t\t'Partial non-match: \"/test\" vs \"/\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t\t'Partial non-match: \"/test\" vs \"/testing\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/testing',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t\t'Partial non-match: \"/test/\" (with trailing slash) vs \"/\"' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t];\n\t}", "private function _buildArray($variables)\n {\n $i = 0;\n $j = 0;\n foreach ($variables as $key => $section) {\n foreach ($section as $value) {\n // avoid first and last values, and tag elements\n if ($i == 0 || $i == count($variables[$key])\n || $value[0] == '<') {\n $i++;\n continue;\n } else {\n $variableParts = $this->cleanExplode(\"_\", $value);\n switch ($variableParts[0]) {\n case 'BLOCK':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n if (!empty ($variableGroup[1])) {\n self::$templateVariables[$key][$j]['TYPE'] =\n $variableGroup[1];\n }\n break;\n\n case 'GROUP':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n if (!empty ($variableGroup[1])) {\n self::$templateVariables[$key][$j]['GROUPID'] =\n $variableGroup[1];\n }\n if (!empty ($variableGroup[2])) {\n //The group is nested inside other group\n self::$templateVariables[$key][$j]['GROUP'] =\n $variableGroup[2];\n }\n break;\n\n case 'TAB':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n if (!empty ($variableGroup[1])) {\n self::$templateVariables[$key][$j]['TYPE'] =\n $variableGroup[1];\n }\n break;\n\n case 'HEADING':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n break;\n\n case 'COMMENT':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n if (!empty ($variableGroup[1])) {\n self::$templateVariables[$key][$j]['GROUP'] =\n $variableGroup[1];\n } elseif (!empty ($variableParts[2])) {\n self::$templateVariables[$key][$j]['GROUP'] =\n $variableParts[2];\n }\n break;\n\n case 'TEXT':\n case 'TEXTAREA':\n case 'SELECT':\n case 'DATE':\n self::$templateVariables[$key][$j]['TAG'] = $variableParts[0];\n $variableGroup = $this->cleanExplode(self::$_templateGroupSymbol, $variableParts[1]);\n self::$templateVariables[$key][$j]['NAME'] =\n $variableGroup[0];\n if (!empty ($variableGroup[1])) {\n self::$templateVariables[$key][$j]['GROUP'] =\n $variableGroup[1];\n }\n break;\n\n default:\n break;\n }\n $j++;\n }\n $i++;\n }\n }\n\n }", "private function replaceReferences($data_dict, $target, $replacement) {\n global $module;\n\n //$module->emDebug($target, $replacement);\n\n $foo = preg_replace($target, $replacement, json_encode($data_dict));\n return (json_decode($foo, true));\n\n\n /**\n foreach ($this->data_dict as $field => $dict_row) {\n //replace in calculated field\n $re = '/\\['.$target.'(\\]|\\()/m';\n $re2 = '/.*?(?<target>\\['.$target.'\\]|\\().*?/m';\n $str = '[yboc1] + [yboc2] + [yboc3] + [yboc4] + [yboc5]';\n\n\n echo \"<br><br>\";\n echo \"<br>REPLACED: \" . preg_replace($re, $replacement, $this->data_dict[$target]['select_choices_or_calculations']);\n\n echo \"<br>REPLACED: \" . preg_replace($re, $replacement, $this->data_dict[$target]['branching_logic']);\n\n }\n*/\n }", "function process_variables($input, $graph_item, $graph_start = 0, $graph_end = 0) {\n\n\t$matches = array();\n\t$match = \"\";\n\n\t/* Get graph items for the graph */\n\t$graph_items = db_fetch_assoc(\"SELECT\n\t\tgraph_templates_item.id AS graph_templates_item_id,\n\t\tgraph_templates_item.cdef_id,\n\t\tgraph_templates_item.text_format,\n\t\tgraph_templates_item.value,\n\t\tgraph_templates_item.hard_return,\n\t\tgraph_templates_item.consolidation_function_id,\n\t\tgraph_templates_item.graph_type_id,\n\t\tgraph_templates_gprint.gprint_text,\n\t\tcolors.hex,\n\t\tdata_template_rrd.id as data_template_rrd_id,\n\t\tdata_template_rrd.local_data_id,\n\t\tdata_template_rrd.rrd_minimum,\n\t\tdata_template_rrd.rrd_maximum,\n\t\tdata_template_rrd.data_source_name,\n\t\tdata_template_rrd.local_data_template_rrd_id\n\t\tFROM graph_templates_item\n\t\tLEFT JOIN data_template_rrd ON (graph_templates_item.task_item_id=data_template_rrd.id)\n\t\tLEFT JOIN colors ON (graph_templates_item.color_id=colors.id)\n\t\tLEFT JOIN graph_templates_gprint on (graph_templates_item.gprint_id=graph_templates_gprint.id)\n\t\tWHERE graph_templates_item.local_graph_id=\" . $graph_item[\"local_graph_id\"] . \"\n\t\tORDER BY graph_templates_item.sequence\");\n\n\t/* find the step and how often this graph is updated with new data */\n\t$ds_step = db_fetch_cell(\"select\n\t\tdata_template_data.rrd_step\n\t\tfrom (data_template_data,data_template_rrd,graph_templates_item)\n\t\twhere graph_templates_item.task_item_id=data_template_rrd.id\n\t\tand data_template_rrd.local_data_id=data_template_data.local_data_id\n\t\tand graph_templates_item.local_graph_id=\" . $graph_item[\"local_graph_id\"] . \"\n\t\tlimit 0,1\");\n\t$ds_step = empty($ds_step) ? 300 : $ds_step;\n\n\tif ((empty($graph_start)) || (empty($graph_end))) {\n\t\t$rra[\"rows\"] = 600;\n\t\t$rra[\"steps\"] = 1;\n\t\t$rra[\"timespan\"] = 86400;\n\t}else{\n\t\t/* get a list of RRAs related to this graph */\n\t\t$rras = get_associated_rras($graph_item[\"local_graph_id\"]);\n\n\t\tif (sizeof($rras) > 0) {\n\t\t\tforeach ($rras as $unchosen_rra) {\n\t\t\t\t/* the timespan specified in the RRA \"timespan\" field may not be accurate */\n\t\t\t\t$real_timespan = ($ds_step * $unchosen_rra[\"steps\"] * $unchosen_rra[\"rows\"]);\n\n\t\t\t\t/* make sure the current start/end times fit within each RRA's timespan */\n\t\t\t\tif ( (($graph_end - $graph_start) <= $real_timespan) && ((time() - $graph_start) <= $real_timespan) ) {\n\t\t\t\t\t/* is this RRA better than the already chosen one? */\n\t\t\t\t\tif ((isset($rra)) && ($unchosen_rra[\"steps\"] < $rra[\"steps\"])) {\n\t\t\t\t\t\t$rra = $unchosen_rra;\n\t\t\t\t\t}else if (!isset($rra)) {\n\t\t\t\t\t\t$rra = $unchosen_rra;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!isset($rra)) {\n\t\t\t$rra[\"rows\"] = 600;\n\t\t\t$rra[\"steps\"] = 1;\n\t\t}\n\t}\n\t$seconds_between_graph_updates = ($ds_step * $rra[\"steps\"]);\n\n\t/* override: graph start time */\n\tif ((!isset($graph_start)) || ($graph_start == \"0\")) {\n\t\t$graph_start = -($rra[\"timespan\"]);\n\t}\n\t/* override: graph end time */\n\tif ((!isset($graph_end)) || ($graph_end == \"0\")) {\n\t\t$graph_end = -($seconds_between_graph_updates);\n\t}\n\n\t/* Nth percentile */\n\tif (preg_match_all(\"/\\|([0-9]{1,2}):(bits|bytes):(\\d):(current|total|max|total_peak|all_max_current|all_max_peak|aggregate_max|aggregate_sum|aggregate_current|aggregate):(\\d)?\\|/\", $input, $matches, PREG_SET_ORDER)) {\n\t\tforeach ($matches as $match) {\n\t\t\t$input = str_replace($match[0], variable_nth_percentile($match, $graph_item, $graph_items, $graph_start, $graph_end), $input);\n\t\t}\n\t}\n\n\t/* bandwidth summation */\n\tif (preg_match_all(\"/\\|sum:(\\d|auto):(current|total|atomic):(\\d):(\\d+|auto)\\|/\", $input, $matches, PREG_SET_ORDER)) {\n\t\tforeach ($matches as $match) {\n\t\t\t$input = str_replace($match[0], variable_bandwidth_summation($match, $graph_item, $graph_items, $graph_start, $graph_end, $rra[\"steps\"], $ds_step), $input);\n\t\t}\n\t}\n\n\treturn $input;\n\n}", "public static function parseConditionals($template, $data, $output)\n {\n $matches = [];\n preg_match_all('/\\[{if/mi', $template, $matches, PREG_OFFSET_CAPTURE);\n if (isset($matches[0]) && isset($matches[0][0])) {\n foreach ($matches[0] as $match) {\n $cond = substr($template, $match[1]);\n $cond = substr($cond, 0, strpos($cond, '[{/if}]') + 7);\n $var = substr($cond, strpos($cond, '(') + 1);\n $var = substr($var, 0, strpos($var, ')'));\n\n // If var is an array\n if (strpos($var, '[') !== false) {\n $index = substr($var, (strpos($var, '[') + 1));\n $index = substr($index, 0, strpos($index, ']'));\n $var = substr($var, 0, strpos($var, '['));\n $varSet = (!empty($data[$var][$index]));\n } else {\n $index = null;\n $varSet = (!empty($data[$var]));\n }\n if (strpos($cond, '[{else}]') !== false) {\n if ($varSet) {\n $code = substr($cond, (strpos($cond, ')}]') + 3));\n $code = substr($code, 0, strpos($code, '[{else}]'));\n $code = (null !== $index) ?\n str_replace('[{' . $var . '[' . $index . ']}]', $data[$var][$index], $code) :\n str_replace('[{' . $var . '}]', $data[$var], $code);\n $output = str_replace($cond, $code, $output);\n } else {\n $code = substr($cond, (strpos($cond, '[{else}]') + 8));\n $code = substr($code, 0, strpos($code, '[{/if}]'));\n $output = str_replace($cond, $code, $output);\n }\n } else {\n if ($varSet) {\n $code = substr($cond, (strpos($cond, ')}]') + 3));\n $code = substr($code, 0, strpos($code, '[{/if}]'));\n $code = (null !== $index) ?\n str_replace('[{' . $var . '[' . $index . ']}]', $data[$var][$index], $code) :\n str_replace('[{' . $var . '}]', $data[$var], $code);\n $output = str_replace($cond, $code, $output);\n } else {\n $output = str_replace($cond, '', $output);\n }\n }\n }\n }\n\n return $output;\n }", "public function get_hypernyms ($tag){\n//Kennedy, Jack Kennedy, John Fitzgerald Kennedy, JFK, President Kennedy, President John F. Kennedy\n// INSTANCE OF=> President of the United States, United States President, President, Chief Executive\n// => head of state, chief of state\n// => representative\n// => negotiator, negotiant, treater\n// => communicator\n// => person, individual, someone, somebody, mortal, soul\n// => organism, being\n// => living thing, animate thing\n// => object, physical object\n// => physical entity\n// => entity\n// => causal agent, cause, causal agency\n// => physical entity\n// => entity\n//\n//Sense 2\n//Kennedy, Kennedy Interrnational, Kennedy International Airport\n// INSTANCE OF=> airport, airdrome, aerodrome, drome\n// => airfield, landing field, flying field, field\n// => facility, installation\n// => artifact, artefact\n// => whole, unit\n// => object, physical object\n// => physical entity\n// => entity';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n//\n// $raw_synonims1 = 'Sense 1\n//Kennedy, Jack Kennedy, John Fitzgerald Kennedy, JFK, President Kennedy, President John F. Kennedy\n// INSTANCE OF=> President of the United States, United States President, President, Chief Executive';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n// exit();\n ini_set(\"xdebug.var_display_max_children\", -1);\n ini_set(\"xdebug.var_display_max_data\", -1);\n ini_set(\"xdebug.var_display_max_depth\", -1);\n\n // cmd commend\n $wn_command = '\"C:/Program Files (x86)/WordNet/2.1/bin/wn\" \"'.$tag.'\" \"-hypen\"';\n $raw_synonims = shell_exec ($wn_command);\n\n // if the word exist\n if (! $raw_synonims) {\n return null;\n }\n\n // get the result of cmmend\n $matches = array ();\n preg_match_all (\"/\\s+(.+)\\s+.+?=>/\",\n $raw_synonims, $matches, PREG_PATTERN_ORDER);\n\n // if no matched result\n if(!isset($matches[1][0])){\n return null;\n }\n\n// dd($matches);\n // get all accepted words\n $expanded_query = array();\n\n foreach ($matches[1] as $match){\n $match = explode (\", \", $match);\n foreach ($match as $word){\n array_push($expanded_query, strtolower($word));\n }\n }\n\n // remove repeated element\n $expanded_query = array_unique($expanded_query);\n\n // return the word\n return $expanded_query;\n }", "private function conditionalCallback($matches)\n {\n // Get literal values\n $LHS = $this->getLiteral($matches[2]);\n $RHS = $this->getLiteral($matches[4]);\n\n // Get the (parsed) content\n $content = $this->parse($matches[5]);\n \n // Compare\n switch($matches[3])\n {\n case '==':\n \n if($LHS == $RHS)\n {\n return $content;\n }\n \n break;\n\n case '<':\n \n if($LHS < $RHS)\n {\n return $content;\n }\n \n break;\n \n case '>':\n \n if($LHS > $RHS)\n {\n return $content;\n }\n \n break;\n \n case '>=':\n \n if($LHS >= $RHS)\n {\n return $content;\n }\n \n break;\n \n case '<>':\n \n if($LHS != $RHS)\n {\n return $content;\n }\n \n break;\n \n case '<=':\n \n if($LHS <= $RHS)\n {\n return $content;\n }\n \n break;\n \n case 'in':\n \n if(strpos($RHS, $LHS) !== false)\n {\n return $content;\n }\n \n break;\n \n case '%':\n \n if($LHS % $RHS == 0)\n {\n return $content;\n }\n \n break;\n }\n \n return '';\n }" ]
[ "0.6430995", "0.59423393", "0.5700339", "0.50796366", "0.4866939", "0.46350634", "0.4620728", "0.45479622", "0.44832027", "0.4475329", "0.44235063", "0.42854148", "0.42705113", "0.42505646", "0.42298868", "0.4225993", "0.41991168", "0.41844952", "0.4177714", "0.41715974", "0.4132622", "0.41016033", "0.4095584", "0.40817225", "0.40768212", "0.4065878", "0.4049338", "0.40441284", "0.40086654", "0.3968467" ]
0.78953844
0
Initialize property `reverse` and other internal properties about this value, when there is necessary to prepare it for: a) URL building, b) for request routing, when there is configured `match` property directly an when is necessary to initialize route flags from `reverse` to complete correctly subject to match.
protected function initReverse () { if ($this->reverseSections !== NULL) return; $reverse = NULL; if ($this->reverse !== NULL) { $reverse = $this->reverse; } else if ($this->pattern !== NULL) { $reverse = $this->pattern; } else/* if ($this->pattern === NULL)*/ { if ($this->redirect !== NULL) return $this->initFlagsByPatternOrReverse( $this->pattern !== NULL ? $this->pattern : str_replace(['\\', '(?', ')?', '/?'], '', $this->match) ); $this->throwExceptionIfKeyPropertyIsMissing('reverse', 'pattern'); } $this->lastPatternParam = NULL; $this->reverseSections = $this->initSectionsInfo($reverse); $this->reverse = $reverse; $match = NULL; $this->reverseParams = $this->initReverseParams( $reverse, $this->reverseSections, $this->constraints, $match ); $this->initFlagsByPatternOrReverse($reverse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "protected function initReverseParams (& $reverse, & $reverseSectionsInfo, & $constraints, & $match = NULL) {\n\t\t$result = [];\n\t\t$completeMatch = $match !== NULL;\n\t\t$reverseIndex = 0;\n\t\t$matchIndex = 0;\n\t\t$sectionIndex = 0;\n\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t$reverseLength = mb_strlen($reverse);\n\t\t$greedyCaught = FALSE;\n\t\t$matchOpenPos = -1;\n\t\t$matchClosePos = -1;\n\t\t$this->lastPatternParam = '';\n\t\twhile ($reverseIndex < $reverseLength) {\n\t\t\t$reverseOpenPos = mb_strpos($reverse, '<', $reverseIndex);\n\t\t\t$reverseClosePos = FALSE;\n\t\t\tif ($reverseOpenPos !== FALSE) {\n\t\t\t\t$reverseClosePos = mb_strpos($reverse, '>', $reverseOpenPos);\n\t\t\t\tif ($completeMatch) {\n\t\t\t\t\t$matchOpenPos = mb_strpos($match, '<', $matchIndex);\n\t\t\t\t\t$matchClosePos = mb_strpos($match, '>', $matchOpenPos) + 1;\n\t\t\t\t}}\n\t\t\tif ($reverseClosePos === FALSE) break;// no other param caught\n\t\t\t// check if param belongs to current section\n\t\t\t// and if not, move to next (or next...) section\n\t\t\t$reverseClosePos += 1;\n\t\t\tif ($reverseClosePos > $section->end) {\n\t\t\t\t$reverseSectionsInfoCountMinusOne = count($reverseSectionsInfo) - 1;\n\t\t\t\twhile ($sectionIndex < $reverseSectionsInfoCountMinusOne) {\n\t\t\t\t\t$nextSection = $reverseSectionsInfo[$sectionIndex + 1];\n\t\t\t\t\tif ($reverseClosePos > $nextSection->end) {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}}}\n\t\t\t// complete param section length and param name\n\t\t\t$paramLength = $reverseClosePos - $reverseOpenPos;\n\t\t\t$paramName = mb_substr($reverse, $reverseOpenPos + 1, $paramLength - 2);\n\t\t\tlist ($greedyFlag, $sectionIsLast) = $this->initReverseParamsGetGreedyInfo(\n\t\t\t\t$reverseSectionsInfo, $constraints,\n\t\t\t\t$paramName, $sectionIndex, $greedyCaught\n\t\t\t);\n\t\t\tif ($greedyFlag && $sectionIsLast) {\n\t\t\t\t$lastSectionChar = mb_substr(\n\t\t\t\t\t$reverse, $reverseClosePos, $reverseSectionsInfo[$sectionIndex]->end - $reverseClosePos\n\t\t\t\t);\n\t\t\t\tif ($lastSectionChar == '/') {\n\t\t\t\t\t$lastSectionChar = '';\n\t\t\t\t\t$reverseSectionsInfo[$sectionIndex]->end -= 1;\n\t\t\t\t}\n\t\t\t\tif ($lastSectionChar === '')\n\t\t\t\t\t$this->lastPatternParam = $paramName;\n\t\t\t}\n\t\t\t$result[$paramName] = (object) [\n\t\t\t\t'name'\t\t\t=> $paramName,\n\t\t\t\t'greedy'\t\t=> $greedyFlag,\n\t\t\t\t'sectionIndex'\t=> $sectionIndex,\n\t\t\t\t\t'length'\t\t=> $paramLength,\n\t\t\t\t'reverseStart'\t=> $reverseOpenPos,\n\t\t\t\t'reverseEnd'\t=> $reverseClosePos,\n\t\t\t\t'matchStart'\t=> $matchOpenPos,\n\t\t\t\t'matchEnd'\t\t=> $matchClosePos,\n\t\t\t];\n\t\t\t$reverseIndex = $reverseClosePos;\n\t\t\t$matchIndex = $matchClosePos;\n\t\t}\n\t\treturn $result;\n\t}", "private function initialize_routes() {\n // capture request method, url string, and break url string into parts (around '/')\n $this->request_method = $_SERVER['REQUEST_METHOD'];\n $this->url_parts_string = (isset($_GET['p'])) ? rtrim(strtolower($_GET['p']), '/'): '';\n $this->url_parts = explode('/', $this->url_parts_string);\n \n // capture request payload\n $this->payload = array();\n if ($this->request_method == 'POST') { \n // POST data if avaiable\n if (!empty($_POST)) {\n $this->payload = $_POST;\n \n // raw JSON if aviaible\n } else {\n $fp = fopen('php://input', 'r');\n $raw_data = stream_get_contents($fp);\n $posted_json = (array)json_decode($raw_data);\n \n if (!empty($posted_json)) {\n $this->payload = $posted_json;\n }\n }\n }\n \n // type cast all dynamic url parts as INT or FLOAT else leave as STRING\n $preg_pattern = '/[a-zA-Z]/';\n foreach ($this->url_parts as $key=>$value) {\n preg_match($preg_pattern, $value, $matches);\n if (empty($matches)) {\n if ((int)$value != null) $this->url_parts[$key] = (int)$value;\n else if ((float)$value != null) $this->url_parts[$key] = (float)$value; \n }\n }\n \n return true;\n }", "protected function _route()\r\n\t\t{\r\n\t\t\t((!is_object($this->_route)) ? $this->_route = init_class(ROUTE_NAME) : '');\r\n\t\t}", "public function initialize()\n {\n $configs = \\Phpfox::get('router.provider')->loadConfigs();\n\n $this->phrases = $configs['phrases'];\n\n foreach ($configs['chains'] as $v) {\n\n if (!isset($v['chain'])) {\n throw new InvalidArgumentException(var_export($v, 1));\n }\n $key = $v['chain'];\n unset($v['chain']);\n if (!isset($this->routes[$key])) {\n $this->routes[$key] = new Routing($key, null);\n }\n $this->routes[$key]->chain($this->build($v));\n }\n\n foreach ($configs['routes'] as $key => $v) {\n if (strpos($key, '.')) {\n list($group) = explode('.', $key, 2);\n $this->routes[$group]->add(new Routing($key, $this->build($v)));\n } else {\n $this->routes[$key] = new Routing($key, $this->build($v));\n }\n }\n }", "public function __construct($routeInfo) {\n $this->name = $routeInfo['name'];\n $this->pattern = $routeInfo['pattern'];\n\n \n foreach ($routeInfo as $key => $value) {\n \n switch($key) {\n case ('requirements'): {\n $this->requirements = $value;\n if(is_array($value)) {\n if(array_key_exists('_method', $value)) {\n $this->methodRequirement = $value['_method'];\n }\n }\n break;\n }\n case ('_method'): {\n $this->methodRequirement = $value;\n break;\n }\n case ('defaults'): {\n $this->defaults = $value;\n break;\n }\n case ('fnCheck'): {\n $this->fnCheck = $routeInfo['fnCheck'];\n break;\n }\n case('name'):\n case('pattern'):{ \n break;\n }\n case('optional'): {\n $this->optionalInfo = $routeInfo['optional'];\n break;\n }\n default:{\n $this->extra[$key] = $value;\n break;\n }\n }\n }\n\n $this->calculateStaticPrefix();\n\n //For paths other than the route path '/' allow the last '/' to be optional\n //If the string terminates there.\n if(mb_strlen($this->staticPrefix) > 1) {\n if(mb_substr($this->staticPrefix, mb_strlen($this->staticPrefix)-1) == '/'){\n $this->staticPrefix = mb_substr($this->staticPrefix, 0, mb_strlen($this->staticPrefix)-1);\n }\n\n if(mb_substr($this->pattern, mb_strlen($this->pattern)-1) == '/'){\n $this->pattern = mb_substr($this->pattern, 0, mb_strlen($this->pattern)-1);\n }\n }\n\n $this->buildRegex();\n }", "public function __construct()\n {\n $this->uri = $_SERVER['REQUEST_URI'];\n $this->method = $_SERVER['REQUEST_METHOD'];\n\n // Get all parameters from the request depending on request method\n $parameters = match ($this->method) {\n 'GET' => $_GET,\n 'POST' => $_POST,\n };\n // Remove 'path' from Request parameters because we use it in rewrite rule in htaccess for pretty url,\n // and it is handled by the Route later.\n unset($parameters['path']);\n $this->parameters = $parameters;\n }", "function init() {\n $this->properties = array();\n if(isset($_SERVER['REQUEST_METHOD'])) {\n $urlPieces = explode(\"/\", $_GET['q']);\n array_shift($urlPieces);// the way our mod_rewrite does this, it adds an empty string as an extra element on the beginning\n if($urlPieces[0] === \"a\") {// something like foo/bar/test\n $this->setProperty(\"app\", \"true\");\n $this->setProperty(\"cmd\", $urlPieces[1]);\n $this->setProperty(\"action\", $urlPieces[2]);\n } else {\n $this->setProperty(\"cmd\", $urlPieces[0]);\n $this->setProperty(\"action\", $urlPieces[1]);\n\n if(count($urlPieces) > 2) {\n for($i = 2; $i < count($urlPieces); ++$i) {\n $this->extras[] = $urlPieces[$i];\n }\n }\n }\n }\n\n if(isset($_SERVER['argv'][0])) {\n $argPieces = explode(\"&\", $_SERVER['argv'][0]);\n } else {\n $argPieces = array();\n }\n\n foreach($argPieces as $arg) {\n if(strpos($arg, '=')) {\n list($key, $val) = explode(\"=\", $arg);// a=login <- a = 'cmd' in CommandResolver\n $this->setProperty($key, $val);\n }\n }\n }", "protected function initFlagsByPatternOrReverse ($pattern) {\n\t\t$scheme = static::FLAG_SCHEME_NO;\n\t\tif (mb_strpos($pattern, '//') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_ANY;\n\t\t} else if (mb_strpos($pattern, 'http://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTP;\n\t\t} else if (mb_strpos($pattern, 'https://') === 0) {\n\t\t\t$scheme = static::FLAG_SCHEME_HTTPS;\n\t\t}\n\t\t$this->flags |= $scheme;\n\t\t$host = 0;\n\t\tif (($scheme & static::FLAG_SCHEME_ANY) != 0) {\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_HOST) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_HOST;\n\t\t\t} else if (mb_strpos($pattern, static::PLACEHOLDER_DOMAIN) !== FALSE) {\n\t\t\t\t$host = static::FLAG_HOST_DOMAIN;\n\t\t\t} else {\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_TLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_TLD;\n\t\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_SLD) !== FALSE)\n\t\t\t\t\t$host += static::FLAG_HOST_SLD;\n\t\t\t}\n\t\t\tif (mb_strpos($pattern, static::PLACEHOLDER_BASEPATH) !== FALSE)\n\t\t\t\t$host += static::FLAG_HOST_BASEPATH;\n\t\t}\n\t\tif ($host === 0)\n\t\t\t$host = static::FLAG_HOST_NO;\n\t\t$this->flags |= $host;\n\t\t$queryString = mb_strpos($pattern, '?') !== FALSE\n\t\t\t? static::FLAG_QUERY_INCL\n\t\t\t: static::FLAG_QUERY_NO;\n\t\t$this->flags |= $queryString;\n\t}", "public function __construct() {\n $this->setRouteData();\n }", "public function __construct() {\n\t\t$this->getRoutes = array();\n\t\t$this->postRoutes = array();\n\t}", "public function populate_router() {\n if (Cache::has(APP_NAME.\"_Marmalade\\Router\\Routes\")) {\n $this->routes = Cache::get(APP_NAME.\"_Marmalade\\Router\\Routes\");\n } else {\n $this->build_route_map(Routes::load_routes());\n if (ENABLE_CACHE) {\n Cache::set(APP_NAME.\"_Marmalade\\Router\\Routes\", $this->routes);\n }\n }\n }", "function __construct(){\r\n $parser = new Shumvc_RouteParser();\r\n $this->routes = $parser->getRoutes();\r\n }", "public function __construct()\n {\n $this->_remove_magic_quotes();\n $this->_unregister_globals();\n\n $this->_params = Router::factory()->parse($this->get('url'));\n }", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function __construct()\n {\n $this->route = new \\Janrain\\Union\\Lib\\Route;\n }", "public function GetReverseParams ();", "public function __construct()\n {\n $this->addAdditionalRoute('redeemByGet', 'redeem/{reward}/user/{user}', ['GET']);\n $this->addAdditionalRoute('redeemByPost', 'redeem/', ['POST']);\n }", "protected function preparePatternAndBackReferenceIndexes () {\n\t\t$protocols = implode('|', $this->allowedSchemes);\n\t\tif (($this->allowProtocol & self::ALLOW_PROTOCOL_ABSOLUTE) != 0) {\n\t\t\t$protocol = '('.$protocols.')://';\n\t\t} else if (($this->allowProtocol & self::ALLOW_PROTOCOL_RELATIVE) != 0) {\n\t\t\t$protocol = '(?:('.$protocols.'):)?//';\n\t\t} else {\n\t\t\t$protocol = '(?:('.$protocols.')://)?';\n\t\t}\n\n\t\t$auth = '';\n\t\tif ($this->allowBasicAuth) {\n\t\t\t$auth = static::PATTERN_PART_AUTH;\n\t\t\t$this->backReferencePosHostname = 5;\n\t\t\t$this->backReferencePosPort = 9;\n\t\t} else {\n\t\t\t$this->backReferencePosHostname = 2;\n\t\t\t$this->backReferencePosPort = 6;\n\t\t}\n\t\t\n\n\t\t$hostname = '';\n\t\t$hostnameParts = [];\n\t\tif ($this->allowDomains)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_DOMAIN;\n\t\tif ($this->allowIPv4)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV4;\n\t\tif ($this->allowIPv6)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV6;\n\t\tif (count($hostnameParts) > 0) {\n\t\t\t$hostname = '(' . implode('|', $hostnameParts) . ')';\n\t\t} else {\n\t\t\t$hostname = '(' . implode('|', [\n\t\t\t\tstatic::PATTERN_PART_DOMAIN,\n\t\t\t\tstatic::PATTERN_PART_IPV4,\n\t\t\t\tstatic::PATTERN_PART_IPV6\n\t\t\t]) . ')';\n\t\t}\n\t\t\n\n\t\t$port = '';\n\t\tif (count($this->allowedPorts) > 0 || $this->allowPorts) {\n\t\t\t$port = static::PATTERN_PART_PORT;\n\t\t} else {\n\t\t\t$this->backReferencePosPort = NULL;\n\t\t}\n\n\n\t\t$this->pattern = str_replace([\n\t\t\t'{%protocol}', '{%auth}', '{%hostname}', '{%port}', \n\t\t\t'{%path}', '{%query}', '{%fragment}'\n\t\t], [\n\t\t\t$protocol, $auth, $hostname, $port, \n\t\t\tstatic::PATTERN_PART_PATH, static::PATTERN_PART_QUERY, static::PATTERN_PART_FRAGMENT\n\t\t], static::PATTERN_ALL);\n\t}", "public function __construct()\n {\n $this->route = null;\n }", "protected function initMatchComposeRegex (& $match, & $matchSectionsInfo, & $reverseParams, & $constraints) {\n\t\t$sections = [];\n\t\t$paramIndex = 0;\n\t\t$reverseParamsKeys = array_keys($reverseParams);\n\t\t$paramsCount = count($reverseParamsKeys);\n\t\t$anyParams = $paramsCount > 0;\n\t\t$defaultPathConstraint = static::$defaultPathConstraint;\n\t\t$defaultDomainConstraint = static::$defaultDomainConstraint;\n\t\t$matchIsAbsolute = ($this->flags & static::FLAG_SCHEME_ANY) != 0;\n\t\t$firstPathSlashPos = 0;\n\t\tif ($matchIsAbsolute) {\n\t\t\t$defaultConstraint = $defaultDomainConstraint;\n\t\t\t// if scheme flag is `http://` or `https://`, there is necessary to increase\n\t\t\t// `mb_strpos()` index by one, because there is always backslash in match pattern\n\t\t\t// before `:` - like `http\\://` or `https\\://`\n\t\t\t$schemeMatchPatternLen = 2;\n\t\t\tif (($this->flags & static::FLAG_SCHEME_HTTP) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 8;\n\t\t\t} else if (($this->flags & static::FLAG_SCHEME_HTTPS) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 9;\n\t\t\t}\n\t\t\t$firstPathSlashPos = mb_strpos($match, '/', $schemeMatchPatternLen);\n\t\t} else {\n\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t}\n\t\t$pathFixedSectionsCount = 0;\n\t\t$lastPathFixedSectionIndex = 0;\n\t\t$trailingSlash = '?';\n\t\t$one = $matchIsAbsolute ? 0 : 1;\n\t\t$sectionsCountMinusOne = count($matchSectionsInfo) - 1;\n\t\tforeach ($matchSectionsInfo as $sectionIndex => $section) {\n\t\t\t$sectionEnd = $section->end;\n\t\t\tif ($anyParams) {\n\t\t\t\t$sectionOffset = $section->start;\n\t\t\t\t$sectionResult = '';\n\t\t\t\twhile ($paramIndex < $paramsCount) {\n\t\t\t\t\t$paramKey = $reverseParamsKeys[$paramIndex];\n\t\t\t\t\t$param = $reverseParams[$paramKey];\n\t\t\t\t\tif ($param->sectionIndex !== $sectionIndex) break;\n\t\t\t\t\t$paramStart = $param->matchStart;\n\t\t\t\t\tif ($matchIsAbsolute && $paramStart > $firstPathSlashPos)\n\t\t\t\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t\t\t\tif ($sectionOffset < $paramStart)\n\t\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $paramStart - $sectionOffset);\n\t\t\t\t\t$paramName = $param->name;\n\t\t\t\t\t$customConstraint = isset($constraints[$paramName]);\n\t\t\t\t\tif (!$customConstraint && $param->greedy) $defaultConstraint = '.*';\n\t\t\t\t\tif ($customConstraint) {\n\t\t\t\t\t\t$constraint = $constraints[$paramName];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$constraint = $defaultConstraint;\n\t\t\t\t\t}\n\t\t\t\t\t$sectionResult .= '(?<' . $paramName . '>' . $constraint . ')';\n\t\t\t\t\t$paramIndex += 1;\n\t\t\t\t\t$sectionOffset = $param->matchEnd;\n\t\t\t\t}\n\t\t\t\tif ($sectionOffset < $sectionEnd)\n\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $sectionEnd - $sectionOffset);\n\t\t\t} else {\n\t\t\t\t$sectionResult = mb_substr($match, $section->start, $section->length);\n\t\t\t}\n\t\t\tif ($matchIsAbsolute && $sectionEnd > $firstPathSlashPos) $one = 1;\n\t\t\tif ($section->fixed) {\n\t\t\t\t$pathFixedSectionsCount += $one;\n\t\t\t\t$lastPathFixedSectionIndex = $sectionIndex;\n\t\t\t} else {\n\t\t\t\t$sectionResult = '(' . $sectionResult . ')?';\n\t\t\t}\n\t\t\t$sections[] = $sectionResult;\n\t\t}\n\t\tif ($pathFixedSectionsCount > 0) {\n\t\t\t$lastFixedSectionContent = & $sections[$lastPathFixedSectionIndex];\n\t\t\tif ($sectionsCountMinusOne == 0 && $lastPathFixedSectionIndex == 0 &&\n\t\t\t\t$lastFixedSectionContent === '/'\n\t\t\t) {\n\t\t\t\t$trailingSlash = ''; // homepage -> `/`\n\t\t\t} else {\n\t\t\t\t$lastCharIsSlash = mb_substr($lastFixedSectionContent, -1, 1) == '/';\n\t\t\t\tif ($lastPathFixedSectionIndex == $sectionsCountMinusOne) {// last section is fixed section\n\t\t\t\t\tif (!$lastCharIsSlash) $trailingSlash = '/?';\n\t\t\t\t} else {// last section is optional section or sections\n\t\t\t\t\t$lastFixedSectionContent .= ($lastCharIsSlash ? '' : '/') . '?';\n\t\t\t\t\t$trailingSlash = '/?';\n\t\t\t\t}}}\n\t\t// always add UTF-8 modifier to match UTF-8 request paths\n\t\t$result = '#^' . implode('', $sections) . $trailingSlash . '$#';\n\t\tif ($this->getStrIsUtf8($result)) $result .= 'u';\n\t\treturn $result;\n\t}", "function setReverseMode(){\n\t\t$this->mode = SUSHEE_DEP_REVERSE_MODE;\n\t}", "protected function initSectionsInfoForMatchAndReverse (& $match, & $reverse) {\n\t\t$matchInfo = [];\n\t\t$reverseInfo = [];\n\t\t$reverseIndex = 0;\n\t\t$matchIndex = 0;\n\t\t$reverseLength = mb_strlen($reverse);\n\t\t$matchLength = mb_strlen($match);\n\t\t$matchOpenPos = FALSE;\n\t\t$matchClosePos = FALSE;\n\t\twhile ($reverseIndex < $reverseLength) {\n\t\t\t$reverseOpenPos = mb_strpos($reverse, '[', $reverseIndex);\n\t\t\t$reverseClosePos = FALSE;\n\t\t\tif ($reverseOpenPos !== FALSE) {\n\t\t\t\t$reverseClosePos = mb_strpos($reverse, ']', $reverseOpenPos);\n\t\t\t\t$matchOpenPos = mb_strpos($match, '[', $matchIndex);\n\t\t\t\t$matchClosePos = mb_strpos($match, ']', $matchOpenPos);\n\t\t\t}\n\t\t\tif ($reverseClosePos === FALSE) {\n\t\t\t\t$reverseInfo[] = (object) [\n\t\t\t\t\t'fixed'=>TRUE, 'start'=>$reverseIndex, 'end'=>$reverseLength,\n\t\t\t\t\t'length' => $reverseLength - $reverseIndex\n\t\t\t\t];\n\t\t\t\t$matchInfo[] = (object) [\n\t\t\t\t\t'fixed' => TRUE, 'start'=>$matchIndex, 'end'=>$matchLength,\n\t\t\t\t\t'length' => $matchLength - $matchIndex\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tif ($reverseIndex < $reverseOpenPos) {\n\t\t\t\t\t$reverseInfo[]\t= (object) [\n\t\t\t\t\t\t'fixed'=> TRUE,\t\t\t'start'=> $reverseIndex,\n\t\t\t\t\t\t'end'=> $reverseOpenPos,\n\t\t\t\t\t\t'length' => $reverseOpenPos - $reverseIndex\n\t\t\t\t\t];\n\t\t\t\t\t$matchInfo[]\t= (object) [\n\t\t\t\t\t\t'fixed'=> TRUE,\n\t\t\t\t\t\t'start'=> $matchIndex,\n\t\t\t\t\t\t'end'=> $matchOpenPos,\n\t\t\t\t\t\t'length'=> $matchOpenPos - $matchIndex];\n\t\t\t\t}\n\t\t\t\t$reverseOpenPosPlusOne = $reverseOpenPos + 1;\n\t\t\t\t$reverseLocalLength = $reverseClosePos - $reverseOpenPosPlusOne;\n\t\t\t\t$reverse = mb_substr($reverse, 0, $reverseOpenPos) . mb_substr(\n\t\t\t\t\t$reverse, $reverseOpenPosPlusOne, $reverseLocalLength\n\t\t\t\t\t) . mb_substr($reverse, $reverseClosePos + 1);\n\t\t\t\t$reverseLength -= 2;\n\t\t\t\t$reverseClosePos -= 1;\n\t\t\t\t$reverseInfo[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t\t\t'start'\t=> $reverseOpenPos,\n\t\t\t\t\t'end'\t=> $reverseClosePos,\t'length'=> $reverseLocalLength\n\t\t\t\t];\n\t\t\t\t$matchOpenPosPlusOne = $matchOpenPos + 1;\n\t\t\t\t$matchLocalLength = $matchClosePos - $matchOpenPosPlusOne;\n\t\t\t\t$match = mb_substr($match, 0, $matchOpenPos)\n\t\t\t\t\t. mb_substr($match, $matchOpenPosPlusOne, $matchLocalLength)\n\t\t\t\t\t. mb_substr($match, $matchClosePos + 1);\n\t\t\t\t$matchLength -= 2;\n\t\t\t\t$matchClosePos -= 1;\n\t\t\t\t$matchInfo[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t\t'start'\t=> $matchOpenPos,\n\t\t\t\t\t'end'\t=> $matchClosePos,\t'length'=> $matchLocalLength\n\t\t\t\t];\n\t\t\t}\n\t\t\t$reverseIndex = $reverseClosePos;\n\t\t\t$matchIndex = $matchClosePos;\n\t\t}\n\t\treturn [$matchInfo, $reverseInfo];\n\t}", "protected static function initialize()\n\t{\n\t\t\n\t\t// Set default sort order & so we can use it for reset() function\n\t\tstatic::$default_sort_by \t= static::$sort_by;\n\t\tstatic::$default_direction \t= static::$direction;\n\t\t\n\t\t$sort_uri = \\URI::segment(static::$uri_segment);\n\t\tif($sort_uri && strpos($sort_uri, static::$uri_delimiter) !== false)\n\t\t{\n\t\t\t$sort_uri = explode(static::$uri_delimiter, $sort_uri);\n\t\t\tstatic::$sort_by \t= $sort_uri[0];\n\t\t\tstatic::$direction \t= $sort_uri[1];\n\t\t\t\n\t\t\tif(static::$use_cookies === true)\n\t\t\t{\n\t\t\t\t$cookie_url = static::$base_url;\n\t\t\t\t\\Cookie::set('fuel_ts_sort_by', static::$sort_by, null, $cookie_url);\n\t\t\t\t\\Cookie::set('fuel_ts_direction', static::$direction, null, $cookie_url);\n\t\t\t}\n\t\t}\n\t\telseif (static::$use_cookies === true)\n\t\t{\n\t\t\tstatic::$sort_by \t= \\Cookie::get('fuel_ts_sort_by', static::$sort_by);\n\t\t\tstatic::$direction \t= \\Cookie::get('fuel_ts_direction', static::$direction);\n\t\t}\n\n\t}", "public function initForward()\n {\n if (empty($this->_beforeForwardInfo)) {\n parent::initForward();\n $this->_beforeForwardInfo['route_name'] = $this->getRouteName();\n return $this;\n }\n\n return parent::initForward();\n }", "public function createRouteObject();", "private function __di_init_service_route () {\n $this->route = $this->constant(new GoDiService_Route_Property($this));\n }", "public function __construct()\n\n\t{\n $this->thisRoute = Route::current()->uri();\n\t}", "public function __construct()\n {\n $this->checkRequestType($_SERVER['REQUEST_METHOD']);\n\n $this->setRoute();\n\n $this->executeRoute();\n }", "public function testReversingContinuations() {\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/{:controller}/{:action}/{:id:[0-9]+}');\n\t\tRouter::connect('/{:controller}/{:action}/{:args}');\n\n\t\t$result = Router::match(['Posts::view', 'id' => 5, 'locale' => 'de']);\n\t\t$this->assertEqual($result, '/de/posts/view/5');\n\n\t\t$result = Router::match(['Posts::index', 'locale' => 'en', '?' => ['page' => 2]]);\n\t\t$this->assertIdentical('/en/posts?page=2', $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/{:locale:en|de|it|jp}/{:args}', [], ['continue' => true]);\n\t\tRouter::connect('/pages/{:args}', 'Pages::view');\n\n\t\t$result = Router::match(['Pages::view', 'locale' => 'en', 'args' => ['about']]);\n\t\t$this->assertIdentical('/en/pages/about', $result);\n\n\t\tRouter::reset();\n\t\tRouter::connect('/admin/{:args}', ['admin' => true], ['continue' => true]);\n\t\tRouter::connect('/login', 'Users::login');\n\n\t\t$result = Router::match(['Users::login', 'admin' => true]);\n\t\t$this->assertIdentical('/admin/login', $result);\n\t}" ]
[ "0.7090364", "0.5377095", "0.5249093", "0.51990026", "0.51922643", "0.51684374", "0.50040567", "0.49622965", "0.4953201", "0.4950228", "0.4934564", "0.49036148", "0.48440936", "0.47946227", "0.4788221", "0.4755765", "0.4746261", "0.47370204", "0.47172785", "0.47064713", "0.46966967", "0.46958226", "0.46892533", "0.46868667", "0.46796697", "0.46764773", "0.46702525", "0.46059904", "0.4604861", "0.45954362" ]
0.7523172
0
Initialize reverse params info array. Each item in completed array is `\stdClass` object with records about founded parameter place: `name`, `greedy`, `sectionIndex`, `reverseStart`, `reverseEnd`. Records `matchStart` and `matchEnd` could be values `1` when function argument `$match` is `NULL`, because this function is used to complete `match` and `reverse` properties together and also to complete `reverse` property separately and only. Result array is always used as `reverseParams` property to complete URL rewrite params inside result `reverse` string.
protected function initReverseParams (& $reverse, & $reverseSectionsInfo, & $constraints, & $match = NULL) { $result = []; $completeMatch = $match !== NULL; $reverseIndex = 0; $matchIndex = 0; $sectionIndex = 0; $section = $reverseSectionsInfo[$sectionIndex]; $reverseLength = mb_strlen($reverse); $greedyCaught = FALSE; $matchOpenPos = -1; $matchClosePos = -1; $this->lastPatternParam = ''; while ($reverseIndex < $reverseLength) { $reverseOpenPos = mb_strpos($reverse, '<', $reverseIndex); $reverseClosePos = FALSE; if ($reverseOpenPos !== FALSE) { $reverseClosePos = mb_strpos($reverse, '>', $reverseOpenPos); if ($completeMatch) { $matchOpenPos = mb_strpos($match, '<', $matchIndex); $matchClosePos = mb_strpos($match, '>', $matchOpenPos) + 1; }} if ($reverseClosePos === FALSE) break;// no other param caught // check if param belongs to current section // and if not, move to next (or next...) section $reverseClosePos += 1; if ($reverseClosePos > $section->end) { $reverseSectionsInfoCountMinusOne = count($reverseSectionsInfo) - 1; while ($sectionIndex < $reverseSectionsInfoCountMinusOne) { $nextSection = $reverseSectionsInfo[$sectionIndex + 1]; if ($reverseClosePos > $nextSection->end) { $sectionIndex += 1; } else { $sectionIndex += 1; $section = $reverseSectionsInfo[$sectionIndex]; break; }}} // complete param section length and param name $paramLength = $reverseClosePos - $reverseOpenPos; $paramName = mb_substr($reverse, $reverseOpenPos + 1, $paramLength - 2); list ($greedyFlag, $sectionIsLast) = $this->initReverseParamsGetGreedyInfo( $reverseSectionsInfo, $constraints, $paramName, $sectionIndex, $greedyCaught ); if ($greedyFlag && $sectionIsLast) { $lastSectionChar = mb_substr( $reverse, $reverseClosePos, $reverseSectionsInfo[$sectionIndex]->end - $reverseClosePos ); if ($lastSectionChar == '/') { $lastSectionChar = ''; $reverseSectionsInfo[$sectionIndex]->end -= 1; } if ($lastSectionChar === '') $this->lastPatternParam = $paramName; } $result[$paramName] = (object) [ 'name' => $paramName, 'greedy' => $greedyFlag, 'sectionIndex' => $sectionIndex, 'length' => $paramLength, 'reverseStart' => $reverseOpenPos, 'reverseEnd' => $reverseClosePos, 'matchStart' => $matchOpenPos, 'matchEnd' => $matchClosePos, ]; $reverseIndex = $reverseClosePos; $matchIndex = $matchClosePos; } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "protected function initReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\t$reverse = NULL;\n\t\tif ($this->reverse !== NULL) {\n\t\t\t$reverse = $this->reverse;\n\t\t} else if ($this->pattern !== NULL) {\n\t\t\t$reverse = $this->pattern;\n\t\t} else/* if ($this->pattern === NULL)*/ {\n\t\t\tif ($this->redirect !== NULL)\n\t\t\t\treturn $this->initFlagsByPatternOrReverse(\n\t\t\t\t\t$this->pattern !== NULL\n\t\t\t\t\t\t? $this->pattern\n\t\t\t\t\t\t: str_replace(['\\\\', '(?', ')?', '/?'], '', $this->match)\n\t\t\t\t);\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('reverse', 'pattern');\n\t\t}\n\n\t\t$this->lastPatternParam = NULL;\n\n\t\t$this->reverseSections = $this->initSectionsInfo($reverse);\n\t\t$this->reverse = $reverse;\n\n\t\t$match = NULL;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t}", "protected function initSectionsInfoForMatchAndReverse (& $match, & $reverse) {\n\t\t$matchInfo = [];\n\t\t$reverseInfo = [];\n\t\t$reverseIndex = 0;\n\t\t$matchIndex = 0;\n\t\t$reverseLength = mb_strlen($reverse);\n\t\t$matchLength = mb_strlen($match);\n\t\t$matchOpenPos = FALSE;\n\t\t$matchClosePos = FALSE;\n\t\twhile ($reverseIndex < $reverseLength) {\n\t\t\t$reverseOpenPos = mb_strpos($reverse, '[', $reverseIndex);\n\t\t\t$reverseClosePos = FALSE;\n\t\t\tif ($reverseOpenPos !== FALSE) {\n\t\t\t\t$reverseClosePos = mb_strpos($reverse, ']', $reverseOpenPos);\n\t\t\t\t$matchOpenPos = mb_strpos($match, '[', $matchIndex);\n\t\t\t\t$matchClosePos = mb_strpos($match, ']', $matchOpenPos);\n\t\t\t}\n\t\t\tif ($reverseClosePos === FALSE) {\n\t\t\t\t$reverseInfo[] = (object) [\n\t\t\t\t\t'fixed'=>TRUE, 'start'=>$reverseIndex, 'end'=>$reverseLength,\n\t\t\t\t\t'length' => $reverseLength - $reverseIndex\n\t\t\t\t];\n\t\t\t\t$matchInfo[] = (object) [\n\t\t\t\t\t'fixed' => TRUE, 'start'=>$matchIndex, 'end'=>$matchLength,\n\t\t\t\t\t'length' => $matchLength - $matchIndex\n\t\t\t\t];\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tif ($reverseIndex < $reverseOpenPos) {\n\t\t\t\t\t$reverseInfo[]\t= (object) [\n\t\t\t\t\t\t'fixed'=> TRUE,\t\t\t'start'=> $reverseIndex,\n\t\t\t\t\t\t'end'=> $reverseOpenPos,\n\t\t\t\t\t\t'length' => $reverseOpenPos - $reverseIndex\n\t\t\t\t\t];\n\t\t\t\t\t$matchInfo[]\t= (object) [\n\t\t\t\t\t\t'fixed'=> TRUE,\n\t\t\t\t\t\t'start'=> $matchIndex,\n\t\t\t\t\t\t'end'=> $matchOpenPos,\n\t\t\t\t\t\t'length'=> $matchOpenPos - $matchIndex];\n\t\t\t\t}\n\t\t\t\t$reverseOpenPosPlusOne = $reverseOpenPos + 1;\n\t\t\t\t$reverseLocalLength = $reverseClosePos - $reverseOpenPosPlusOne;\n\t\t\t\t$reverse = mb_substr($reverse, 0, $reverseOpenPos) . mb_substr(\n\t\t\t\t\t$reverse, $reverseOpenPosPlusOne, $reverseLocalLength\n\t\t\t\t\t) . mb_substr($reverse, $reverseClosePos + 1);\n\t\t\t\t$reverseLength -= 2;\n\t\t\t\t$reverseClosePos -= 1;\n\t\t\t\t$reverseInfo[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t\t\t'start'\t=> $reverseOpenPos,\n\t\t\t\t\t'end'\t=> $reverseClosePos,\t'length'=> $reverseLocalLength\n\t\t\t\t];\n\t\t\t\t$matchOpenPosPlusOne = $matchOpenPos + 1;\n\t\t\t\t$matchLocalLength = $matchClosePos - $matchOpenPosPlusOne;\n\t\t\t\t$match = mb_substr($match, 0, $matchOpenPos)\n\t\t\t\t\t. mb_substr($match, $matchOpenPosPlusOne, $matchLocalLength)\n\t\t\t\t\t. mb_substr($match, $matchClosePos + 1);\n\t\t\t\t$matchLength -= 2;\n\t\t\t\t$matchClosePos -= 1;\n\t\t\t\t$matchInfo[] = (object) [\n\t\t\t\t\t'fixed'\t=> FALSE,\t\t\t'start'\t=> $matchOpenPos,\n\t\t\t\t\t'end'\t=> $matchClosePos,\t'length'=> $matchLocalLength\n\t\t\t\t];\n\t\t\t}\n\t\t\t$reverseIndex = $reverseClosePos;\n\t\t\t$matchIndex = $matchClosePos;\n\t\t}\n\t\treturn [$matchInfo, $reverseInfo];\n\t}", "public function GetReverseParams ();", "protected function initMatchComposeRegex (& $match, & $matchSectionsInfo, & $reverseParams, & $constraints) {\n\t\t$sections = [];\n\t\t$paramIndex = 0;\n\t\t$reverseParamsKeys = array_keys($reverseParams);\n\t\t$paramsCount = count($reverseParamsKeys);\n\t\t$anyParams = $paramsCount > 0;\n\t\t$defaultPathConstraint = static::$defaultPathConstraint;\n\t\t$defaultDomainConstraint = static::$defaultDomainConstraint;\n\t\t$matchIsAbsolute = ($this->flags & static::FLAG_SCHEME_ANY) != 0;\n\t\t$firstPathSlashPos = 0;\n\t\tif ($matchIsAbsolute) {\n\t\t\t$defaultConstraint = $defaultDomainConstraint;\n\t\t\t// if scheme flag is `http://` or `https://`, there is necessary to increase\n\t\t\t// `mb_strpos()` index by one, because there is always backslash in match pattern\n\t\t\t// before `:` - like `http\\://` or `https\\://`\n\t\t\t$schemeMatchPatternLen = 2;\n\t\t\tif (($this->flags & static::FLAG_SCHEME_HTTP) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 8;\n\t\t\t} else if (($this->flags & static::FLAG_SCHEME_HTTPS) != 0) {\n\t\t\t\t$schemeMatchPatternLen = 9;\n\t\t\t}\n\t\t\t$firstPathSlashPos = mb_strpos($match, '/', $schemeMatchPatternLen);\n\t\t} else {\n\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t}\n\t\t$pathFixedSectionsCount = 0;\n\t\t$lastPathFixedSectionIndex = 0;\n\t\t$trailingSlash = '?';\n\t\t$one = $matchIsAbsolute ? 0 : 1;\n\t\t$sectionsCountMinusOne = count($matchSectionsInfo) - 1;\n\t\tforeach ($matchSectionsInfo as $sectionIndex => $section) {\n\t\t\t$sectionEnd = $section->end;\n\t\t\tif ($anyParams) {\n\t\t\t\t$sectionOffset = $section->start;\n\t\t\t\t$sectionResult = '';\n\t\t\t\twhile ($paramIndex < $paramsCount) {\n\t\t\t\t\t$paramKey = $reverseParamsKeys[$paramIndex];\n\t\t\t\t\t$param = $reverseParams[$paramKey];\n\t\t\t\t\tif ($param->sectionIndex !== $sectionIndex) break;\n\t\t\t\t\t$paramStart = $param->matchStart;\n\t\t\t\t\tif ($matchIsAbsolute && $paramStart > $firstPathSlashPos)\n\t\t\t\t\t\t$defaultConstraint = $defaultPathConstraint;\n\t\t\t\t\tif ($sectionOffset < $paramStart)\n\t\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $paramStart - $sectionOffset);\n\t\t\t\t\t$paramName = $param->name;\n\t\t\t\t\t$customConstraint = isset($constraints[$paramName]);\n\t\t\t\t\tif (!$customConstraint && $param->greedy) $defaultConstraint = '.*';\n\t\t\t\t\tif ($customConstraint) {\n\t\t\t\t\t\t$constraint = $constraints[$paramName];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$constraint = $defaultConstraint;\n\t\t\t\t\t}\n\t\t\t\t\t$sectionResult .= '(?<' . $paramName . '>' . $constraint . ')';\n\t\t\t\t\t$paramIndex += 1;\n\t\t\t\t\t$sectionOffset = $param->matchEnd;\n\t\t\t\t}\n\t\t\t\tif ($sectionOffset < $sectionEnd)\n\t\t\t\t\t$sectionResult .= mb_substr($match, $sectionOffset, $sectionEnd - $sectionOffset);\n\t\t\t} else {\n\t\t\t\t$sectionResult = mb_substr($match, $section->start, $section->length);\n\t\t\t}\n\t\t\tif ($matchIsAbsolute && $sectionEnd > $firstPathSlashPos) $one = 1;\n\t\t\tif ($section->fixed) {\n\t\t\t\t$pathFixedSectionsCount += $one;\n\t\t\t\t$lastPathFixedSectionIndex = $sectionIndex;\n\t\t\t} else {\n\t\t\t\t$sectionResult = '(' . $sectionResult . ')?';\n\t\t\t}\n\t\t\t$sections[] = $sectionResult;\n\t\t}\n\t\tif ($pathFixedSectionsCount > 0) {\n\t\t\t$lastFixedSectionContent = & $sections[$lastPathFixedSectionIndex];\n\t\t\tif ($sectionsCountMinusOne == 0 && $lastPathFixedSectionIndex == 0 &&\n\t\t\t\t$lastFixedSectionContent === '/'\n\t\t\t) {\n\t\t\t\t$trailingSlash = ''; // homepage -> `/`\n\t\t\t} else {\n\t\t\t\t$lastCharIsSlash = mb_substr($lastFixedSectionContent, -1, 1) == '/';\n\t\t\t\tif ($lastPathFixedSectionIndex == $sectionsCountMinusOne) {// last section is fixed section\n\t\t\t\t\tif (!$lastCharIsSlash) $trailingSlash = '/?';\n\t\t\t\t} else {// last section is optional section or sections\n\t\t\t\t\t$lastFixedSectionContent .= ($lastCharIsSlash ? '' : '/') . '?';\n\t\t\t\t\t$trailingSlash = '/?';\n\t\t\t\t}}}\n\t\t// always add UTF-8 modifier to match UTF-8 request paths\n\t\t$result = '#^' . implode('', $sections) . $trailingSlash . '$#';\n\t\tif ($this->getStrIsUtf8($result)) $result .= 'u';\n\t\treturn $result;\n\t}", "protected function initReverseParamsGetGreedyInfo (& $reverseSectionsInfo, & $constraints, & $paramName, & $sectionIndex, & $greedyCaught) {\n\t\t// complete greedy flag by star character inside param name\n\t\t$greedyFlag = mb_strpos($paramName, '*') !== FALSE;\n\t\t$sectionIsLast = NULL;\n\t\t// check greedy param specifics\n\t\tif ($greedyFlag) {\n\t\t\tif ($greedyFlag && $greedyCaught) \n\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t\"[\".get_class().\"] Route pattern definition can have only one greedy `<param_name*>` \"\n\t\t\t\t\t.\" with star (to include everything - all characters and slashes . `.*`) ({$this}).\"\n\t\t\t\t);\n\t\t\t$reverseSectionsCount = count($reverseSectionsInfo);\n\t\t\t$sectionIndexPlusOne = $sectionIndex + 1;\n\t\t\tif (// next section is optional\n\t\t\t\t$sectionIndexPlusOne < $reverseSectionsCount &&\n\t\t\t\t!($reverseSectionsInfo[$sectionIndexPlusOne]->fixed)\n\t\t\t) {\n\t\t\t\t// check if param is really greedy or not\n\t\t\t\t$constraintDefined = isset($constraints[$paramName]);\n\t\t\t\t$constraint = $constraintDefined ? $constraints[$paramName] : NULL ;\n\t\t\t\t$greedyReal = !$constraintDefined || ($constraintDefined && (\n\t\t\t\t\tmb_strpos($constraint, '.*') !== FALSE || mb_strpos($constraint, '.+') !== FALSE\n\t\t\t\t));\n\t\t\t\tif ($greedyReal) \n\t\t\t\t\tthrow new \\InvalidArgumentException(\n\t\t\t\t\t\t\"[\".get_class().\"] Route pattern definition can not have greedy `<param_name*>` with star \"\n\t\t\t\t\t\t.\"(to include everything - all characters and slashes . `.*`) immediately before optional \"\n\t\t\t\t\t\t.\"section ({$this}).\"\n\t\t\t\t\t);\n\t\t\t}\n\t\t\t$greedyCaught = TRUE;\n\t\t\t$paramName = str_replace('*', '', $paramName);\n\t\t\t$sectionIsLast = $sectionIndexPlusOne === $reverseSectionsCount;\n\t\t}\n\t\treturn [$greedyFlag, $sectionIsLast];\n\t}", "public function GetReverseParams () {\n\t\treturn $this->reverseParams !== NULL \n\t\t\t? array_keys($this->reverseParams)\n\t\t\t: [];\n\t}", "public function reverse(array $params = array())\n {\n $parsed = $this->reverse;\n foreach ($params as $name => $value) {\n $parsed = str_replace(':' . $name, $value, $parsed);\n }\n return $parsed;\n }", "public static function reverseToArray($params)\n {\n $url = [];\n if ($params instanceof ServerRequest) {\n $url = $params->query;\n $params = $params->params;\n } elseif (isset($params['url'])) {\n $url = $params['url'];\n }\n $pass = isset($params['pass']) ? $params['pass'] : [];\n\n unset(\n $params['pass'],\n $params['paging'],\n $params['models'],\n $params['url'],\n $url['url'],\n $params['autoRender'],\n $params['bare'],\n $params['requested'],\n $params['return'],\n $params['_Token'],\n $params['_matchedRoute'],\n $params['_name']\n );\n $params = array_merge($params, $pass);\n if (!empty($url)) {\n $params['?'] = $url;\n }\n\n return $params;\n }", "public function extractParameters()\n {\n $request = $this->container->get('request_stack')->getCurrentRequest();\n\n if (preg_match(self::$routePattern, $request->get('_route'), $routeMatches)) {\n $searchEngine = $this->container->get('search.engine');\n\n $this->routePrefix = reset($routeMatches);\n $this->originalRouteParameterCount = (int)end($routeMatches);\n\n $activeModules = $searchEngine->getActiveModules();\n\n $dateFormatString = $this->container->get('languagehandler')->getDateFormat();\n $dateFormat = preg_replace(\"/[^\\w]/\", '-', $dateFormatString);\n\n for ($i = 0; $i < $this->originalRouteParameterCount; $i++) {\n $rawInput = strtolower($request->get(\"a{$i}\"));\n $parameterInformation = Utility::convertStringToArray($rawInput);\n\n if (!$this->hasKeywords() && $rawKeyword = $searchEngine->convertFromKeywordFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawKeyword);\n foreach ($parameterInformation as $parameter) {\n $this->addKeyword($parameter);\n }\n continue;\n }\n\n if (!$this->hasWheres() && $rawWhere = $searchEngine->convertFromWhereFormat($rawInput)) {\n $parameterInformation = Utility::convertStringToArray($rawWhere);\n foreach ($parameterInformation as $parameter) {\n $this->addWhere($parameter);\n }\n continue;\n }\n\n if (!$this->hasModules() && $modules = array_intersect($activeModules, $parameterInformation)) {\n foreach ($modules as $key => $value) {\n $this->addModule($key);\n }\n continue;\n }\n\n if (!$this->hasStartDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setStartDate($date);\n continue;\n }\n\n if (!$this->hasEndDate() && $date = \\DateTime::createFromFormat($dateFormat, $rawInput)) {\n $this->setEndDate($date);\n continue;\n }\n\n if (($elasticType = $searchEngine->getFriendlyUrlType($parameterInformation)) && (!$this->hasCategories() || !$this->hasLocations())) {\n switch ($elasticType) {\n case CategoryConfiguration::$elasticType:\n if (!$this->hasCategories()) {\n $categories = $searchEngine->categoryFriendlyURLSearch($parameterInformation);\n $this->setCategories($categories);\n !$this->hasModules() and array_map(function($category) {\n $this->addModule($category->getModule());\n }, $categories);\n }\n break;\n case LocationConfiguration::$elasticType:\n if (!$this->hasLocations()) {\n $this->setLocations($searchEngine->locationFriendlyURLSearch($parameterInformation));\n }\n break;\n }\n\n continue;\n }\n\n if (self::$exception) {\n throw new NotFoundHttpException();\n }\n }\n }\n\n foreach ($request->query->all() as $key => $value) {\n $this->queryParameters[$key] = Utility::convertStringToArray($value, '-');\n }\n }", "function prepareParamsReverse($data){\r\n\t$param_info = $this->getParamInfo();\r\n\t$param_ids = array();\r\n\tforeach($param_info as $p_i){\r\n\t\t$param_ids[$p_i['id']] = $p_i['param'];\r\n\t}\r\n\t$new_params = array();\r\n\tforeach($data as $k=>$v){\r\n\t\tif(isset($param_ids[$k])){\r\n\t\t#\t$new_params[$param_ids[$k]] = $v;//this is the text value\r\n\t\t\t$new_params[$param_ids[$k]][0] = $v[0];//this is the text value\r\n\t\t\t$new_params[$param_ids[$k]][1] = $v[1];//this is the option value\r\n\t\t}\r\n\t}\r\n\treturn $new_params;\r\n}", "public static function parseReverseSymmetryData(): array\n {\n return [\n ['/controller/action'],\n ['/controller/action/param'],\n ['/controller/action?param1=value1&param2=value2'],\n ['/controller/action/param?param1=value1'],\n ];\n }", "public function getRouteParams();", "private function setArguments()\n {\n $args = $this->data;\n $match = explode(\"/\", $this->routeMatch);\n\n // remove the domain part.\n foreach ($this->domains as $value) {\n // search for domain on url array.\n // array_search(needle, haystack)\n $index = array_search($value, $args);\n unset($args[$index]);\n\n // search for domain on matched route.\n $index = array_search($value, $match);\n unset($match[$index]);\n }\n\n // find the action part in url data and the matched route string.\n // preg_grep(pattern, input)\n $this->action = preg_grep(\"/^{$this->wildcards[':action']}$/\", $args);\n $matchAction = preg_grep(\"/^{$this->wildcards[':action']}$/\", $match);\n if ( !empty($this->action) )\n {\n // convert action from array to string.\n // find action in url data.\n // remove from url data.\n $this->action = array_shift($this->action);\n $index = array_search($this->action, $args);\n unset($args[$index]);\n\n $matchAction = array_shift($matchAction);\n $index = array_search($matchAction, $match);\n unset($match[$index]);\n }\n\n // get the arguments from url data\n // get the key from the wildcard. :id, :yyyy, :dd, etc.\n foreach ($args as $arg) {\n $key = $this->matchWildcard($match, $arg);\n $this->arguments[$key] = $arg;\n }\n }", "private function createUrlByUrlParameters(\n Result $result,\n array $urlParameters\n ): array {\n foreach ($this->routesDictionary as $field => $route) {\n if (\n !isset($urlParameters[$field]) ||\n (\n is_array($urlParameters[$field]) &&\n count($urlParameters[$field]) !== 1\n )\n ) {\n continue;\n }\n\n $value = is_array($urlParameters[$field])\n ? reset($urlParameters[$field])\n : $urlParameters[$field];\n\n if (!$result\n ->getAggregation($field)\n ->getAllElements()[$value] instanceof Counter) {\n continue;\n }\n\n unset($urlParameters[$field]);\n $path = $this\n ->router\n ->getRouteCollection()\n ->get($route)\n ->getPath();\n preg_match_all(\n '~\\{(.+?)\\}~',\n $path,\n $matches\n );\n\n return [\n 'route' => urldecode($this\n ->router\n ->generate(\n $route,\n array_merge(\n array_intersect_key(\n $result\n ->getAggregation($field)\n ->getAllElements()[$value]\n ->getValues(),\n array_flip($matches[1])\n ),\n $urlParameters\n ),\n UrlGeneratorInterface::ABSOLUTE_URL\n )),\n 'url_parameters' => $urlParameters,\n 'template_path' => $path,\n 'field' => $field,\n ];\n }\n\n return [\n 'route' => urldecode($this\n ->router\n ->generate(\n $this->routesDictionary['main'],\n $urlParameters,\n UrlGeneratorInterface::ABSOLUTE_URL\n )),\n 'url_parameters' => $urlParameters,\n 'template_path' => urldecode($this\n ->router\n ->generate(\n $this->routesDictionary['main'],\n [],\n UrlGeneratorInterface::ABSOLUTE_URL\n )\n ),\n 'field' => false,\n ];\n }", "public function GetMatchedParams ();", "public function getArguments ($reset = FALSE) {\n if ($reset == FALSE && is_array($this->_arguments) == TRUE) {\n return $this->_arguments;\n }\n\n $routeRequest = new Event_Data;\n $routeRequest->path = Request::path();\n\n Event_Dispatcher::notifyObservers(Cmf_Route_Table_Event::rewriteRequestPath, $routeRequest);\n\n if (preg_match($this->getUrlMask(), $routeRequest->path, $matches) == FALSE) {\n $this->_arguments = array();\n return $this->_arguments;\n }\n\n foreach ($matches as $name => $value) {\n if (is_int($name) == TRUE) {\n // Skip all unnamed keys\n continue;\n }\n\n // Set the value for all matched keys\n $this->_arguments[$name] = $value;\n }\n\n foreach ($this->_defaultValues as $name => $value) {\n if (isset($this->_arguments[$name]) == FALSE || $this->_arguments[$name] === '') {\n // Set default values for any key that was not matched\n $this->_arguments[$name] = $value;\n }\n }\n\n return $this->_arguments;\n }", "protected function preparePatternAndBackReferenceIndexes () {\n\t\t$protocols = implode('|', $this->allowedSchemes);\n\t\tif (($this->allowProtocol & self::ALLOW_PROTOCOL_ABSOLUTE) != 0) {\n\t\t\t$protocol = '('.$protocols.')://';\n\t\t} else if (($this->allowProtocol & self::ALLOW_PROTOCOL_RELATIVE) != 0) {\n\t\t\t$protocol = '(?:('.$protocols.'):)?//';\n\t\t} else {\n\t\t\t$protocol = '(?:('.$protocols.')://)?';\n\t\t}\n\n\t\t$auth = '';\n\t\tif ($this->allowBasicAuth) {\n\t\t\t$auth = static::PATTERN_PART_AUTH;\n\t\t\t$this->backReferencePosHostname = 5;\n\t\t\t$this->backReferencePosPort = 9;\n\t\t} else {\n\t\t\t$this->backReferencePosHostname = 2;\n\t\t\t$this->backReferencePosPort = 6;\n\t\t}\n\t\t\n\n\t\t$hostname = '';\n\t\t$hostnameParts = [];\n\t\tif ($this->allowDomains)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_DOMAIN;\n\t\tif ($this->allowIPv4)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV4;\n\t\tif ($this->allowIPv6)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV6;\n\t\tif (count($hostnameParts) > 0) {\n\t\t\t$hostname = '(' . implode('|', $hostnameParts) . ')';\n\t\t} else {\n\t\t\t$hostname = '(' . implode('|', [\n\t\t\t\tstatic::PATTERN_PART_DOMAIN,\n\t\t\t\tstatic::PATTERN_PART_IPV4,\n\t\t\t\tstatic::PATTERN_PART_IPV6\n\t\t\t]) . ')';\n\t\t}\n\t\t\n\n\t\t$port = '';\n\t\tif (count($this->allowedPorts) > 0 || $this->allowPorts) {\n\t\t\t$port = static::PATTERN_PART_PORT;\n\t\t} else {\n\t\t\t$this->backReferencePosPort = NULL;\n\t\t}\n\n\n\t\t$this->pattern = str_replace([\n\t\t\t'{%protocol}', '{%auth}', '{%hostname}', '{%port}', \n\t\t\t'{%path}', '{%query}', '{%fragment}'\n\t\t], [\n\t\t\t$protocol, $auth, $hostname, $port, \n\t\t\tstatic::PATTERN_PART_PATH, static::PATTERN_PART_QUERY, static::PATTERN_PART_FRAGMENT\n\t\t], static::PATTERN_ALL);\n\t}", "public function getRouteAndParams()\n {\n $request = $this->get('request_stack')->getCurrentRequest();\n $routing = $request->attributes->all();\n\n $ret = new \\stdClass();\n\n $ret->route = $routing['_route'];\n $ret->params = array_merge($routing['_route_params'], $request->query->all());\n\n return $ret;\n }", "function getRouteParameters();", "private function BuildRoute($urlparams)\n\t{\n\t\tforeach ($this->routes as $route) {\n\n\t\t\tif (!$route->Valid($urlparams))\n\t\t\t\tcontinue;\n\n\t\t\t$path = $route->Build($urlparams);\n\t\t\t$usedparams = $route->GetUsedParameters();\n\n\t\t\treturn array($path, $usedparams);\n\t\t}\n\n\t\treturn array(null, array());\n\t}", "private function getParameters() {\n $raw_parameters = $this->routeMatch->getRawParameters();\n $parameters = $this->routeMatch->getParameters();\n\n $return_params = [];\n foreach ($parameters as $key => $value) {\n if ($raw_value = $raw_parameters->get($key)) {\n $return_params[$key] = $raw_value;\n continue;\n }\n\n $return_params[$key] = $parameters->get($key);\n }\n\n return $return_params;\n }", "public function getRouteParams($data = null): array\n {\n $resource = $this->resource;\n\n if ($this->isBulk()) {\n if (is_array($data)) {\n return $resource->getCollectionRouteParams($data);\n }\n } elseif ($this->hasInstance()) {\n return $resource->getInstanceRouteParams($data);\n }\n\n return $resource->getBaseRouteParams($data);\n }", "protected function preparePattern()\n {\n $patterns = [];\n foreach ($this->routes as $route => $config) {\n $this->routeData[$route] = $config;\n $prepared = preg_replace('/\\{([^:]+):([^}]+)\\}/', '{$1}', $config['route']);\n\n $params = [];\n if (preg_match('/\\{([^}]+)\\}/', $prepared, $params)) {\n array_shift($params);\n }\n\n $this->routeData[$route]['params'] = $params;\n $pattern = preg_replace('/\\{([^:]+):([^}]+)\\}/', '($2)', $config['route']);\n $patterns[] = \"(?P<{$route}>{$pattern})\";\n }\n\n $pattern = implode(' | ', $patterns);\n $this->pattern = \"~^(?: {$pattern} )$~x\";\n }", "protected function getRouteParams(): array {\n return [];\n }", "public function reverseMatch( $pArgument = array() );", "function deformat_nvp($nvpstr)\n\t{\n\t\t$intial=0;\n\t\t$nvparray = array();\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvparray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvparray;\n\t}", "protected function getParameterPairs($search_for = array())\n {\n $route_parameters = array();\n\n $i = $this->setIndexAtMax();\n\n while ($i > 0) {\n\n $results = $this->getParameterPair($i, $search_for, $route_parameters);\n if ($results === false) {\n break;\n }\n\n $route_parameters = $results;\n $i = $i - 2;\n }\n\n $this->setPath();\n\n return $route_parameters;\n }", "public function resolveParams(&$segments)\n {\n \n $this->params = $segments; \n \n }", "private function setParameters(){\n\t\tif(is_array($this->rawData) and count($this->rawData) > 2){\n\t\t\t$params = array();\n\t\t\tforeach($this->rawData as $paramid => $param){\n\t\t\t\tif($paramid > 1){ # Exclude page and method.\n\t\t\t\t\t$params[$paramid-1] = $param; \n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Store value */\n\t\t\treturn $params;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.7186241", "0.6990568", "0.6638446", "0.62585926", "0.61048883", "0.5878621", "0.58362126", "0.55297494", "0.5388323", "0.5291538", "0.49931586", "0.49773648", "0.49524122", "0.4700859", "0.46830896", "0.4671694", "0.46402776", "0.4594156", "0.45544153", "0.45505437", "0.45036274", "0.44920525", "0.4490331", "0.44727007", "0.4444018", "0.44344077", "0.44143397", "0.4409132", "0.43792212", "0.42995027" ]
0.76538914
0
Get if founded param place is greedy or not. If it's greedy, check if it is only one greedy param in whole pattern string and if it is the last param between other params. Get also if given section index belongs to the last section info in line.
protected function initReverseParamsGetGreedyInfo (& $reverseSectionsInfo, & $constraints, & $paramName, & $sectionIndex, & $greedyCaught) { // complete greedy flag by star character inside param name $greedyFlag = mb_strpos($paramName, '*') !== FALSE; $sectionIsLast = NULL; // check greedy param specifics if ($greedyFlag) { if ($greedyFlag && $greedyCaught) throw new \InvalidArgumentException( "[".get_class()."] Route pattern definition can have only one greedy `<param_name*>` " ." with star (to include everything - all characters and slashes . `.*`) ({$this})." ); $reverseSectionsCount = count($reverseSectionsInfo); $sectionIndexPlusOne = $sectionIndex + 1; if (// next section is optional $sectionIndexPlusOne < $reverseSectionsCount && !($reverseSectionsInfo[$sectionIndexPlusOne]->fixed) ) { // check if param is really greedy or not $constraintDefined = isset($constraints[$paramName]); $constraint = $constraintDefined ? $constraints[$paramName] : NULL ; $greedyReal = !$constraintDefined || ($constraintDefined && ( mb_strpos($constraint, '.*') !== FALSE || mb_strpos($constraint, '.+') !== FALSE )); if ($greedyReal) throw new \InvalidArgumentException( "[".get_class()."] Route pattern definition can not have greedy `<param_name*>` with star " ."(to include everything - all characters and slashes . `.*`) immediately before optional " ."section ({$this})." ); } $greedyCaught = TRUE; $paramName = str_replace('*', '', $paramName); $sectionIsLast = $sectionIndexPlusOne === $reverseSectionsCount; } return [$greedyFlag, $sectionIsLast]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_has_params($string) {\n if (strpos($string, $this->parse['before']) !== false) {\n if (strpos($string, $this->parse['after']) !== false) {\n return strpos($string, $this->parse['after']) >\n strpos($string, $this->parse['before']);\n }\n }\n\n return false;\n }", "function parse_string_extract_param($string) {\n if ($this->parse_string_is_once_param($string)) {\n return\n substr(\n $string, +strlen($this->parse['before']), -strlen($this->parse['after'])\n );\n }\n return false;\n }", "public function isLastPartOfStringReturnsTrueForMatchingFirstPartDataProvider() {}", "public function hasParameters()\n {\n return preg_match('/\\{/', $this->pattern) === 1;\n }", "function parse_string_is_once_param($string) {\n if (\n substr($string, 0, strlen($this->parse['before'])) == $this->parse['before'] &&\n substr($string, -strlen($this->parse['after']), strlen($this->parse['after'])) == $this->parse['after']) {\n return\n substr_count($string, $this->parse['before']) == 1 &&\n substr_count($string, $this->parse['after']) == 1;\n }\n\n return false;\n }", "public function endsWithReturnsTrueForMatchingLastPartDataProvider() {}", "function wantedSection() {\n $urlParts = $this->_getPathUrl();\n return $urlParts[$this->sectionOffset];\n }", "public function getLastSection(): ?NewsSection\n {\n if (! empty($this->path)) {\n return $this->path[array_key_last($this->path)];\n }\n return null;\n }", "public function hasNext($section){\n\t\t$body = $this->toArray();\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key == $section){\n\t\t\t\tif((sizeof($body) - 1) > $i){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$i++;\n\t\t} return false;\n\t}", "public function isLastPartOfStringReturnsFalseForNotMatchingFirstPartDataProvider() {}", "private function greedilyNeedNextLine($line) {\n\t//--\n\t$line = trim($line);\n\t//--\n\tif(!strlen($line)) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(substr($line, -1, 1) == ']') {\n\t\treturn false;\n\t} //end if\n\tif($line[0] == '[') {\n\t\treturn true;\n\t} //end if\n\tif(preg_match('#^[^:]+?:\\s*\\[#', $line)) {\n\t\treturn true;\n\t} //end if\n\t//--\n\treturn false;\n\t//--\n}", "protected function urlSegmentMatch($get, $num = 0) {\n\t\t\n\t\tif(empty($get) && $num > 0) {\n\t\t\treturn isset($this->urlSegments[$num]) ? $this->urlSegments[$num] : '';\n\t\t}\n\t\t\n\t\t$eqPos = strpos($get, '=');\n\t\tif($eqPos !== false) $get = trim($get, '=');\n\t\tlist($matchBefore, $matchAfter) = array($eqPos === 0, $eqPos > 0);\n\t\n\t\t// check if $get has wildcard or regex\n\t\t$regex = $this->patternToRegex($get);\n\t\t$match = '';\n\t\t$index = 0;\n\n\t\tif($regex) {\n\t\t\t// find matching URL segment and return it\n\t\t\tforeach($this->urlSegments as $index => $segment) {\n\t\t\t\tif($num > 0 && $index !== $num) continue;\n\t\t\t\t$match = $this->patternMatchesValue($regex, $segment);\n\t\t\t\tif($match !== '') break;\n\t\t\t}\n\t\t\tif($match === '') $index = 0;\n\t\t\t\n\t\t} else {\n\t\t\t// return index where segment is found\n\t\t\tif($num > 0) {\n\t\t\t\t// apply only to specific URL segment and return bool\n\t\t\t\t$match = isset($this->urlSegments[$num]) && $this->urlSegments[$num] === $get;\n\t\t\t\t$index = $match ? $num : 0;\n\t\t\t} else {\n\t\t\t\t// search all URL segments and return index\n\t\t\t\t$match = (int) array_search($get, $this->urlSegments);\n\t\t\t\t$index = $match;\n\t\t\t}\n\t\t}\n\t\n\t\t// adjust to use urlSegment before or after when requested\n\t\tif($matchBefore) {\n\t\t\t$match = $index > 1 ? $this->urlSegments[$index-1] : '';\n\t\t} else if($matchAfter) {\n\t\t\t$match = isset($this->urlSegments[$index+1]) ? $this->urlSegments[$index+1] : '';\n\t\t}\n\n\t\treturn $match;\n\t}", "public function searchParam()\n {\n require '../configuration/route.php';\n\n foreach(array_keys($route_parameters) as $param) {\n $this->paramPosition = array_keys($this->dumpRoute(), $param);\n }\n\n return $this->paramPosition;\n }", "public function GetMatchedParams ();", "private function paramMatch($match)\n {\n if (isset($this->params[$match[1]])) {\n return '('.$this->params[$match[1]].')';\n }\n return '([^/]+)';\n }", "public function section()\n {\n /*if ($this->section != '') {\n return $this->section;\n }\n else {*/\n // Kill trailing period\n $pattern = \"/\\.$/\"; // remove last \".\"\n $cleaned = $this->section_comment();\n $cleaned = trim($cleaned);\n $cleaned = preg_replace($pattern, '', $cleaned);\n\n $pattern = \"/Styleguide (.+)/\";\n preg_match_all($pattern, $cleaned, $sections);\n //$this->section = $sections[1][0];\n //return $this->section;\n return $sections[1][0];\n //}\n }", "protected function getRoomOptionsByPattern($room){ \n if(!isset ($this->config['rooms']) && !is_array($this->config['rooms'])){\n return false;\n }\n foreach($this->config['rooms'] as $roomPattern => $roomConfig){\n if(!is_string($roomPattern) || strpos($roomPattern, '%') === false){\n continue;\n }\n $roomPattern = str_replace('%', '', $roomPattern);\n if(strpos($room, $roomPattern) !== false){\n return $roomConfig;\n }\n }\n return false;\n }", "public function matchedParam($param)\n {\n if (! is_array($this->matches)) {\n return false;\n }\n return array_key_exists($param, $this->matches);\n }", "protected function get_param( $param ) {\n $params = array(\n 'effect' => 'effect',\n 'slices' => 'slices',\n 'prevText' => 'prevText',\n 'nextText' => 'nextText',\n 'delay' => 'pauseTime',\n 'animationSpeed' => 'animSpeed',\n 'hoverPause' => 'pauseOnHover',\n 'spw' => 'boxCols',\n 'sph' => 'boxRows',\n 'navigation' => 'controlNav',\n 'links' =>'directionNav',\n 'autoPlay' => 'autoPlay'\n );\n\n if ( isset( $params[$param] ) ) {\n return $params[$param];\n }\n\n return false;\n }", "function get_optional_param($param, $default = '')\n{\n global $params;\n\n if (empty($params[$param]))\n return $default;\n\n return $params[$param];\n}", "protected function initReverseParams (& $reverse, & $reverseSectionsInfo, & $constraints, & $match = NULL) {\n\t\t$result = [];\n\t\t$completeMatch = $match !== NULL;\n\t\t$reverseIndex = 0;\n\t\t$matchIndex = 0;\n\t\t$sectionIndex = 0;\n\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t$reverseLength = mb_strlen($reverse);\n\t\t$greedyCaught = FALSE;\n\t\t$matchOpenPos = -1;\n\t\t$matchClosePos = -1;\n\t\t$this->lastPatternParam = '';\n\t\twhile ($reverseIndex < $reverseLength) {\n\t\t\t$reverseOpenPos = mb_strpos($reverse, '<', $reverseIndex);\n\t\t\t$reverseClosePos = FALSE;\n\t\t\tif ($reverseOpenPos !== FALSE) {\n\t\t\t\t$reverseClosePos = mb_strpos($reverse, '>', $reverseOpenPos);\n\t\t\t\tif ($completeMatch) {\n\t\t\t\t\t$matchOpenPos = mb_strpos($match, '<', $matchIndex);\n\t\t\t\t\t$matchClosePos = mb_strpos($match, '>', $matchOpenPos) + 1;\n\t\t\t\t}}\n\t\t\tif ($reverseClosePos === FALSE) break;// no other param caught\n\t\t\t// check if param belongs to current section\n\t\t\t// and if not, move to next (or next...) section\n\t\t\t$reverseClosePos += 1;\n\t\t\tif ($reverseClosePos > $section->end) {\n\t\t\t\t$reverseSectionsInfoCountMinusOne = count($reverseSectionsInfo) - 1;\n\t\t\t\twhile ($sectionIndex < $reverseSectionsInfoCountMinusOne) {\n\t\t\t\t\t$nextSection = $reverseSectionsInfo[$sectionIndex + 1];\n\t\t\t\t\tif ($reverseClosePos > $nextSection->end) {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sectionIndex += 1;\n\t\t\t\t\t\t$section = $reverseSectionsInfo[$sectionIndex];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}}}\n\t\t\t// complete param section length and param name\n\t\t\t$paramLength = $reverseClosePos - $reverseOpenPos;\n\t\t\t$paramName = mb_substr($reverse, $reverseOpenPos + 1, $paramLength - 2);\n\t\t\tlist ($greedyFlag, $sectionIsLast) = $this->initReverseParamsGetGreedyInfo(\n\t\t\t\t$reverseSectionsInfo, $constraints,\n\t\t\t\t$paramName, $sectionIndex, $greedyCaught\n\t\t\t);\n\t\t\tif ($greedyFlag && $sectionIsLast) {\n\t\t\t\t$lastSectionChar = mb_substr(\n\t\t\t\t\t$reverse, $reverseClosePos, $reverseSectionsInfo[$sectionIndex]->end - $reverseClosePos\n\t\t\t\t);\n\t\t\t\tif ($lastSectionChar == '/') {\n\t\t\t\t\t$lastSectionChar = '';\n\t\t\t\t\t$reverseSectionsInfo[$sectionIndex]->end -= 1;\n\t\t\t\t}\n\t\t\t\tif ($lastSectionChar === '')\n\t\t\t\t\t$this->lastPatternParam = $paramName;\n\t\t\t}\n\t\t\t$result[$paramName] = (object) [\n\t\t\t\t'name'\t\t\t=> $paramName,\n\t\t\t\t'greedy'\t\t=> $greedyFlag,\n\t\t\t\t'sectionIndex'\t=> $sectionIndex,\n\t\t\t\t\t'length'\t\t=> $paramLength,\n\t\t\t\t'reverseStart'\t=> $reverseOpenPos,\n\t\t\t\t'reverseEnd'\t=> $reverseClosePos,\n\t\t\t\t'matchStart'\t=> $matchOpenPos,\n\t\t\t\t'matchEnd'\t\t=> $matchClosePos,\n\t\t\t];\n\t\t\t$reverseIndex = $reverseClosePos;\n\t\t\t$matchIndex = $matchClosePos;\n\t\t}\n\t\treturn $result;\n\t}", "public function getNext($section){\n\t\t$body = $this->toArray();\n\t\tif(!$this->hasNext($section)){\n\t\t\treturn false;\n\t\t}\n\t\t$index = $this->sectionIndex($section);\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($i == ($index + 1)){\n\t\t\t\treturn array($key => $body[$key]);\n\t\t\t}\n\t\t\t$i++;\n\t\t} return false;\n\t}", "public function endsWithReturnsFalseForNotMatchingLastPartDataProvider() {}", "abstract function getQualifyingPattern();", "public function parse(&$currentRoute, &$permit) {\n\t\t$route = $permit['route'];\n\n\t\t$count = count($route);\n\t\tif ($count == 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tforeach ($route as $key => $value) {\n\t\t\tif (isset($currentRoute[$key])) {\n\t\t\t\t$values = (is_array($value)) ? $value : array($value);\n\t\t\t\tforeach ($values as $k => $v) {\n\t\t\t\t\tif ($currentRoute[$key] == $v) {\n\t\t\t\t\t\t$count--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $count == 0;\n\t}", "function extractFromDelimiters($string, $start, $end)\n{\n if (strpos($string, $start) !== false) {\n $section_retrieved = substr($string, strpos($string, $start) + strlen($start));\n $section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));\n return $section_retrieved;\n }\n return false;\n}", "function StartEnd($v)\n{\n\treturn (preg_match(\"/^\\*\\*\\* (?:START|END)/m\",$v));\n}", "public function keyHasNext($section, $element){\n\t\t$body = $this->toArray();\n\t\t$i = 0;\n\t\tforeach ($body as $key => $value) {\n\t\t\tif($key == $section){\n\t\t\t\tforeach ($value as $k => $v) {\n\t\t\t\t\tif($k == $element){\n\t\t\t\t\t\tif((sizeof($value) - 1) > $i){\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t} return false;\n\t}", "private function section_comment()\n {\n $pattern = \"/Styleguide \\d/i\"; // /i for case insensitive\n $text_section = '';\n $values_comment_sections = array_values($this->comment_sections());\n foreach ( $values_comment_sections as $key => $text) {\n if (preg_match($pattern, $text)) {\n $text_section = $text;\n break;\n }\n }\n\n return $text_section;\n }", "public function hasParam(){\n return $this->_has(2);\n }" ]
[ "0.5324095", "0.52519095", "0.4977254", "0.49378043", "0.4856218", "0.48315275", "0.47411835", "0.45974347", "0.45716", "0.4571483", "0.45678285", "0.4567037", "0.45349464", "0.45061383", "0.44787017", "0.4476848", "0.44726643", "0.44526824", "0.4405651", "0.43864045", "0.43809238", "0.43643323", "0.43355277", "0.4318818", "0.43138272", "0.43100923", "0.4309698", "0.42925292", "0.42667004", "0.42632604" ]
0.6557533
0
Initialize three route integer flags. About if and what scheme definition is contained in given pattern, if and what domain parts are contained in given pattern and if given pattern contains any part of query string. Given pattern is `reverse` and if reverse is empty, it's `pattern` prop.
protected function initFlagsByPatternOrReverse ($pattern) { $scheme = static::FLAG_SCHEME_NO; if (mb_strpos($pattern, '//') === 0) { $scheme = static::FLAG_SCHEME_ANY; } else if (mb_strpos($pattern, 'http://') === 0) { $scheme = static::FLAG_SCHEME_HTTP; } else if (mb_strpos($pattern, 'https://') === 0) { $scheme = static::FLAG_SCHEME_HTTPS; } $this->flags |= $scheme; $host = 0; if (($scheme & static::FLAG_SCHEME_ANY) != 0) { if (mb_strpos($pattern, static::PLACEHOLDER_HOST) !== FALSE) { $host = static::FLAG_HOST_HOST; } else if (mb_strpos($pattern, static::PLACEHOLDER_DOMAIN) !== FALSE) { $host = static::FLAG_HOST_DOMAIN; } else { if (mb_strpos($pattern, static::PLACEHOLDER_TLD) !== FALSE) $host += static::FLAG_HOST_TLD; if (mb_strpos($pattern, static::PLACEHOLDER_SLD) !== FALSE) $host += static::FLAG_HOST_SLD; } if (mb_strpos($pattern, static::PLACEHOLDER_BASEPATH) !== FALSE) $host += static::FLAG_HOST_BASEPATH; } if ($host === 0) $host = static::FLAG_HOST_NO; $this->flags |= $host; $queryString = mb_strpos($pattern, '?') !== FALSE ? static::FLAG_QUERY_INCL : static::FLAG_QUERY_NO; $this->flags |= $queryString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "protected function initReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\t$reverse = NULL;\n\t\tif ($this->reverse !== NULL) {\n\t\t\t$reverse = $this->reverse;\n\t\t} else if ($this->pattern !== NULL) {\n\t\t\t$reverse = $this->pattern;\n\t\t} else/* if ($this->pattern === NULL)*/ {\n\t\t\tif ($this->redirect !== NULL)\n\t\t\t\treturn $this->initFlagsByPatternOrReverse(\n\t\t\t\t\t$this->pattern !== NULL\n\t\t\t\t\t\t? $this->pattern\n\t\t\t\t\t\t: str_replace(['\\\\', '(?', ')?', '/?'], '', $this->match)\n\t\t\t\t);\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('reverse', 'pattern');\n\t\t}\n\n\t\t$this->lastPatternParam = NULL;\n\n\t\t$this->reverseSections = $this->initSectionsInfo($reverse);\n\t\t$this->reverse = $reverse;\n\n\t\t$match = NULL;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t}", "protected function preparePatternAndBackReferenceIndexes () {\n\t\t$protocols = implode('|', $this->allowedSchemes);\n\t\tif (($this->allowProtocol & self::ALLOW_PROTOCOL_ABSOLUTE) != 0) {\n\t\t\t$protocol = '('.$protocols.')://';\n\t\t} else if (($this->allowProtocol & self::ALLOW_PROTOCOL_RELATIVE) != 0) {\n\t\t\t$protocol = '(?:('.$protocols.'):)?//';\n\t\t} else {\n\t\t\t$protocol = '(?:('.$protocols.')://)?';\n\t\t}\n\n\t\t$auth = '';\n\t\tif ($this->allowBasicAuth) {\n\t\t\t$auth = static::PATTERN_PART_AUTH;\n\t\t\t$this->backReferencePosHostname = 5;\n\t\t\t$this->backReferencePosPort = 9;\n\t\t} else {\n\t\t\t$this->backReferencePosHostname = 2;\n\t\t\t$this->backReferencePosPort = 6;\n\t\t}\n\t\t\n\n\t\t$hostname = '';\n\t\t$hostnameParts = [];\n\t\tif ($this->allowDomains)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_DOMAIN;\n\t\tif ($this->allowIPv4)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV4;\n\t\tif ($this->allowIPv6)\n\t\t\t$hostnameParts[] = static::PATTERN_PART_IPV6;\n\t\tif (count($hostnameParts) > 0) {\n\t\t\t$hostname = '(' . implode('|', $hostnameParts) . ')';\n\t\t} else {\n\t\t\t$hostname = '(' . implode('|', [\n\t\t\t\tstatic::PATTERN_PART_DOMAIN,\n\t\t\t\tstatic::PATTERN_PART_IPV4,\n\t\t\t\tstatic::PATTERN_PART_IPV6\n\t\t\t]) . ')';\n\t\t}\n\t\t\n\n\t\t$port = '';\n\t\tif (count($this->allowedPorts) > 0 || $this->allowPorts) {\n\t\t\t$port = static::PATTERN_PART_PORT;\n\t\t} else {\n\t\t\t$this->backReferencePosPort = NULL;\n\t\t}\n\n\n\t\t$this->pattern = str_replace([\n\t\t\t'{%protocol}', '{%auth}', '{%hostname}', '{%port}', \n\t\t\t'{%path}', '{%query}', '{%fragment}'\n\t\t], [\n\t\t\t$protocol, $auth, $hostname, $port, \n\t\t\tstatic::PATTERN_PART_PATH, static::PATTERN_PART_QUERY, static::PATTERN_PART_FRAGMENT\n\t\t], static::PATTERN_ALL);\n\t}", "public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }", "public function getPatternFlags()\n {\n return null;\n }", "protected function buildRoutePattern()\r\n\t{\r\n\t\t$path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;\r\n\r\n\t\treturn '~^' . preg_replace_callback(self::VAR_PATTERN, function($matches) {\r\n\t\t\t$this->parameter[] = $key = $matches[1];\r\n\r\n\t\t\t// Shorthand validation only if not set using the validation-method\r\n\t\t\tif (isset($matches[2]) && !isset($this->parameterPattern[$key])) {\r\n\t\t\t\t$this->parameterPattern[$key] = $matches[2];\r\n\t\t\t}\r\n\t\t\treturn $this->buildParameterPattern($key);\r\n\t\t}, $path) . ($this->terminated ? '$' : '') . '~i';\r\n\r\n\t}", "public function __construct( $pattern, $default = null )\n {\n $this->pattern = $pattern;\n $this->default = $default;\n }", "protected function preparePattern()\n {\n $patterns = [];\n foreach ($this->routes as $route => $config) {\n $this->routeData[$route] = $config;\n $prepared = preg_replace('/\\{([^:]+):([^}]+)\\}/', '{$1}', $config['route']);\n\n $params = [];\n if (preg_match('/\\{([^}]+)\\}/', $prepared, $params)) {\n array_shift($params);\n }\n\n $this->routeData[$route]['params'] = $params;\n $pattern = preg_replace('/\\{([^:]+):([^}]+)\\}/', '($2)', $config['route']);\n $patterns[] = \"(?P<{$route}>{$pattern})\";\n }\n\n $pattern = implode(' | ', $patterns);\n $this->pattern = \"~^(?: {$pattern} )$~x\";\n }", "public function buildRoutePattern()\n {\n $path = $this->prefix ? rtrim($this->prefix . '/' . $this->route, '/') : $this->route;\n\n return '~^' . preg_replace_callback(self::VAR_PATTERN, function ($matches) {\n $this->parameter[] = $key = $matches[1];\n\n // Shorthand validation only if not set using the validation-method\n if (isset($matches[2]) && ! isset($this->parameterPattern[$key])) {\n $this->parameterPattern[$key] = $matches[2];\n }\n return $this->buildParameterPattern($key);\n }, $path) . ($this->terminated ? '$' : '') . '~i';\n }", "public function testRouteSetsPatternWithParams()\n {\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n $this->assertEquals('/hello/:first/:last', $route->getPattern());\n }", "public function __construct($patterns = [\"Proxy\\\\{ns}\\\\{ln}\"])\n {\n $this->patterns = $patterns;\n }", "public function setPattern($pattern) {}", "public function setIntegerPattern($pattern)\n\t{\n\t\t$this->integer_pattern = $pattern;\n\t\treturn $this;\n\t}", "public function getPatternFlags()\n {\n return $this->getConfig('pattern_flags');\n }", "private function initialize_routes() {\n // capture request method, url string, and break url string into parts (around '/')\n $this->request_method = $_SERVER['REQUEST_METHOD'];\n $this->url_parts_string = (isset($_GET['p'])) ? rtrim(strtolower($_GET['p']), '/'): '';\n $this->url_parts = explode('/', $this->url_parts_string);\n \n // capture request payload\n $this->payload = array();\n if ($this->request_method == 'POST') { \n // POST data if avaiable\n if (!empty($_POST)) {\n $this->payload = $_POST;\n \n // raw JSON if aviaible\n } else {\n $fp = fopen('php://input', 'r');\n $raw_data = stream_get_contents($fp);\n $posted_json = (array)json_decode($raw_data);\n \n if (!empty($posted_json)) {\n $this->payload = $posted_json;\n }\n }\n }\n \n // type cast all dynamic url parts as INT or FLOAT else leave as STRING\n $preg_pattern = '/[a-zA-Z]/';\n foreach ($this->url_parts as $key=>$value) {\n preg_match($preg_pattern, $value, $matches);\n if (empty($matches)) {\n if ((int)$value != null) $this->url_parts[$key] = (int)$value;\n else if ((float)$value != null) $this->url_parts[$key] = (float)$value; \n }\n }\n \n return true;\n }", "final private function buildRouteData($pattern)\n {\n // patch tags -- experemential\n if ( count(array_filter($this->routeTags)) ) {\n $pattern = preg_replace($this->routeTags['pattern'], $this->routeTags['replacement'], $pattern);\n }\n \n // find unknown tags\n preg_match_all('~'.preg_quote('[!:').'([a-z\\_\\-]+)'.preg_quote(':!]').'~i', $pattern, $matches);\n\n $exception = null;\n foreach ( $matches[1] as $tag ) {\n $exception = new UnknownRouteTagException('Unknown tag: '.$tag);\n }\n\n if ( $exception ) {\n throw $exception;\n }\n \n // fetch pattern data\n $data = [];\n $replacer = [];\n $offset = 0;\n if ( preg_match_all(static::VAR_REGEX, $pattern, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER) ) {\n foreach ( $matches as $set ) {\n if ( $set[0][1] > $offset ) {\n $data[] = substr($pattern, $offset, $set[0][1] - $offset);\n $replacer[] = $set[0][0];\n }\n \n $data[] = array(\n $set[1][0],\n isset($set[2])\n ? trim($set[2][0])\n : static::DEFAULT_REGEX\n );\n\n $offset = $set[0][1] + strlen($set[0][0]);\n }\n }\n \n // build match credentials\n if ( empty($data) ) {\n $storage['regex'] = $pattern;\n $storage['vars'] = [];\n }\n else {\n $storage['regex'] = '';\n $storage['vars'] = [];\n\n foreach ( $data as $current ) {\n if ( is_string($current) ) {\n $storage['regex'] .= preg_quote($current, '~');\n continue;\n }\n\n list($name, $currentRegex) = $current;\n \n if ( isset($storage['vars'][$name]) ) {\n throw new RouteAggregationException(\n 'Impossible to use placeholder \"'.$name.'\" more then once'\n );\n }\n\n $storage['vars'][$name] = null;\n $storage['regex'] .= '('.$currentRegex.')';\n }\n }\n \n $storage['replacer'] = array_combine(array_keys($storage['vars']), $replacer);\n $storage['pattern'] = $pattern;\n \n return $storage;\n }", "public function __construct($pattern, $resource) {\r\n $this->pattern = $pattern;\r\n $this->resource = $resource;\r\n }", "private function newRoute($pattern, $replacement, $isLast=false)\n {\n return array(\n 'pattern' => $pattern,\n 'replacement' => $replacement,\n 'isLast' => $isLast\n );\n }", "public function route($pattern,$cb = null,$conditions=null){\n\t\treturn $this->add_route('GET',$pattern,$cb,$conditions);\n\t}", "public function route($patterns, $callback) {\n if( ! is_array($patterns)) $patterns = array($patterns);\n foreach($patterns as $pattern) {\n $pattern = trim($pattern, '/');\n $pattern = str_replace(\n array('\\(','\\)','\\|','\\:any','\\:num','\\:all','#'),\n array('(',')','|','[^/]+','\\d+','.*?','\\#'),\n preg_quote($pattern, '/'));\n $this->routes['#^' . $pattern . '$#'] = $callback;\n }\n }", "public function addReverseRoute($pattern, $replacement, $isLast=false)\n {\n // Store reverse route\n $this->reverseRoutes[] = $this->newRoute($pattern, $replacement, $isLast);\n }", "public function test_match_fromInvalidPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('GET', '/test'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }", "protected function createRegexPatterns($pattern)\n {\n $pattern = rtrim($pattern, ' /');\n $extra = $this->extractCatchAllPattern($pattern);\n $matchPattern = str_replace(\n static::QUOTED_PARAM_IDENTIFIER, static::REGEX_SINGLE_PARAM, preg_quote($pattern), $paramCount\n );\n $replacePattern = str_replace(static::PARAM_IDENTIFIER, '/%s', $pattern);\n $matchPattern = $this->fixOptionalParams($matchPattern);\n $matchRegex = \"#^{$matchPattern}{$extra}$#\";\n return array($matchRegex, $replacePattern);\n }", "public function testRouteSetsPattern()\n {\n $route1 = new \\Slim\\Route('/foo/bar', function () {});\n $this->assertEquals('/foo/bar', $route1->getPattern());\n }", "static public function add($pattern, array $route=array())\n\t{\n\t\tif (is_array($pattern))\n\t\t{\n\t\t\tself::$routes = $pattern + self::$routes;\n\n\t\t\treturn;\n\t\t}\n\n\t\tself::$routes[$pattern] = $route;\n\t}", "public function setPattern($pattern)\n {\n $this->_pattern = $pattern;\n }", "public function __construct(array $pattern)\n {\n foreach ($pattern as $property => $rules) {\n if (is_array($rules)) {\n $this->rules[$property] = Rule::createRulesArray($rules);\n } elseif (is_string($rules)) {\n $this->rules[$property] = Rule::createRulesArray(explode('|', $rules));\n } else {\n throw new \\RuntimeException('Invalid pattern for validator', 500);\n }\n }\n }", "protected function initialisePatternMap()\n {\n // Define the XML-based scanner output patterns\n $xmlScannerPatterns = new Collection([\n self::XML_NMAP_REGEX => ScannerApp::SCANNER_NMAP,\n self::XML_BURP_REGEX => ScannerApp::SCANNER_BURP,\n self::XML_NEXPOSE_REGEX => ScannerApp::SCANNER_NEXPOSE,\n self::XML_NETSPARKER_REGEX => ScannerApp::SCANNER_NETSPARKER,\n self::XML_NESSUS_REGEX => ScannerApp::SCANNER_NESSUS,\n ]);\n\n // Define the CSV-based scanner output patterns\n $csvScannerPatterns = new Collection();\n\n // Define the JSON-based scanner output patterns\n $jsonScannerPatterns = new Collection();\n\n // Set the pattern Collection for each group of file types on the main Collection\n $this->scannerPatternMap->put(File::FILE_TYPE_XML, $xmlScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_CSV, $csvScannerPatterns);\n $this->scannerPatternMap->put(File::FILE_TYPE_JSON, $jsonScannerPatterns);\n\n return true;\n }", "public function getBaseRoutePattern(): string;", "public function routeMatchesEmptyRequestPathIfUriPatternContainsOneOptionalStaticRoutePart()\n {\n $this->route->setUriPattern('(optional)');\n\n self::assertTrue($this->routeMatchesPath(''));\n }" ]
[ "0.6568618", "0.64865005", "0.58676046", "0.52820337", "0.5120785", "0.5055493", "0.5027716", "0.49952638", "0.4994026", "0.49280918", "0.4917553", "0.4891009", "0.48871627", "0.48588836", "0.48561904", "0.4830877", "0.48231167", "0.48156837", "0.47943282", "0.47535205", "0.47010213", "0.46824944", "0.4670797", "0.46702802", "0.46555954", "0.4650331", "0.4633954", "0.4631991", "0.46236137", "0.46019697" ]
0.7618548
0
Thrown a logic exception about missing key property in route object to parse `pattern` or `reverse`. Those properties are necessary to complete correctly `match` property to route incoming request or to complete correctly `reverse` property to build URL address.
protected function throwExceptionIfKeyPropertyIsMissing ($propsNames) { $propsNames = func_get_args(); throw new \LogicException( "[".get_class()."] Route configuration property/properties is/are" ." missing: `" . implode("`, `", $propsNames) . "`, to parse and" ." complete key properties `match` and/or `reverse` to route" ." or build URL correctly ({$this})." ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_match_fromInvalidPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertFalse(\n $route->match('GET', '/test'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }", "public function testGetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->getParam('foo');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }", "public function test_match_fromPatternWithoutVars()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertTrue(\n $route->match('GET', '/home'),\n 'match() must return true if URI pattern provided is the same as the one specified in constructor.'\n );\n }", "public function testParseError(): void\n {\n $this->expectException(MissingRouteException::class);\n\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);\n Router::parseRequest($this->makeRequest('/nope', 'GET'));\n }", "public function testRouteDoesNotMatchAndParamsNotExtracted()\n {\n $resource = '/foo/bar';\n $route = new \\Slim\\Route('/hello/:name', function () {});\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }", "public function testInvalidRouteAction()\n {\n $res = $this->controller->catchAll();\n $body = $res->getBody();\n $this->assertStringContainsString(\"Route not found\", $body);\n }", "public function testCustomRouteException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/{controller}', [], ['routeClass' => 'Object']);\n }", "public static function GenerateRoute () {\n // Failed or invalid attempts need to render a different view (and have the model be null);\n }", "abstract public function getRouteMatch();", "public function get_route($request_route) {\n\n\n if (array_key_exists($request_route[\"_method\"], $this->_routes)) {\n\n if (array_key_exists($request_route[\"_rule\"], $this->_routes[$request_route[\"_method\"]])) {\n return $this->_routes[$request_route[\"_method\"]][$request_route[\"_rule\"]];\n } else { // search for match routes\n\n foreach ($this->_routes[$request_route[\"_method\"]] as $_route) {\n\n if ($_route->_match) {\n\n $request_rule = explode(\"/\", trim($request_route[\"_rule\"], \"/\"));\n $permit_rule = explode(\"/\", trim($_route->_rule, \"/\"));\n\n if (count($request_rule) == count($permit_rule)) {\n $match = true;\n foreach ($request_rule as $index => $value) {\n\n if (($request_rule[$index] != $permit_rule[$index]) and ($permit_rule[$index] != ApplicationRoute::dynamical_segment)) {\n $match = false;\n break;\n }\n }\n if ($match) {\n\n $permit_match_rule = explode(\"/\", trim($_route->_match_rule, \"/\"));\n preg_match_all('@:([\\w]+)@', $_route->_match_rule, $segments, PREG_PATTERN_ORDER);\n $segments = $segments[0];\n\n // get methodları için locals'a yükle : değişkenler\n foreach ($segments as $segment) {\n if ($index = array_search($segment, $permit_match_rule)) {\n $_route->_locals[substr($segment, 1)] = $request_rule[$index];\n }\n }\n\n return $_route;\n }\n }\n }\n }\n }\n return null;\n //throw new ConfigurationException(\"Böyle bir yönlendirme mevcut değil\", $request_route[\"_method\"] . \":\" . $request_route[\"_rule\"]);\n }\n throw new ConfigurationException(\"Uzay çağında bizim henüz desteklemediğimiz bir method\", $request_route[\"_method\"]);\n }", "public function testUriStrategyRouteThrowsExceptionWhenResponseCannotBeBuilt()\n {\n $this->setExpectedException('RuntimeException');\n\n $collection = new Route\\RouteCollection;\n $collection->setStrategy(new UriStrategy);\n\n $collection->get('/route/{id}/{name}', function ($id, $name) {\n $this->assertEquals('2', $id);\n $this->assertEquals('phil', $name);\n return new \\stdClass;\n });\n\n $dispatcher = $collection->getDispatcher();\n $response = $dispatcher->dispatch('GET', '/route/2/phil');\n }", "public function testGetRoutePathMissing()\n {\n $this->assertEquals('', $this->uut->getRoutePath('unknown'));\n }", "public function testRouteThrowsExecptionWithInvalidCallable()\n {\n $this->setExpectedException('InvalidArgumentException');\n $route = new \\Slim\\Route('/foo/bar', 'fnDoesNotExist');\n }", "public function get_matched_route()\n {\n }", "public function testRouteOptionalParameters()\n {\n $pattern = '/archive/:year(/:month(/:day))';\n\n //Case A\n $routeA = new \\Slim\\Route($pattern, function () {});\n $resourceA = '/archive/2010';\n $resultA = $routeA->matches($resourceA);\n $this->assertTrue($resultA);\n $this->assertEquals(array('year' => '2010'), $routeA->getParams());\n\n //Case B\n $routeB = new \\Slim\\Route($pattern, function () {});\n $resourceB = '/archive/2010/05';\n $resultB = $routeB->matches($resourceB);\n $this->assertTrue($resultB);\n $this->assertEquals(array('year' => '2010', 'month' => '05'), $routeB->getParams());\n\n //Case C\n $routeC = new \\Slim\\Route($pattern, function () {});\n $resourceC = '/archive/2010/05/13';\n $resultC = $routeC->matches($resourceC);\n $this->assertTrue($resultC);\n $this->assertEquals(array('year' => '2010', 'month' => '05', 'day' => '13'), $routeC->getParams());\n }", "public function __construct($routeInfo) {\n $this->name = $routeInfo['name'];\n $this->pattern = $routeInfo['pattern'];\n\n \n foreach ($routeInfo as $key => $value) {\n \n switch($key) {\n case ('requirements'): {\n $this->requirements = $value;\n if(is_array($value)) {\n if(array_key_exists('_method', $value)) {\n $this->methodRequirement = $value['_method'];\n }\n }\n break;\n }\n case ('_method'): {\n $this->methodRequirement = $value;\n break;\n }\n case ('defaults'): {\n $this->defaults = $value;\n break;\n }\n case ('fnCheck'): {\n $this->fnCheck = $routeInfo['fnCheck'];\n break;\n }\n case('name'):\n case('pattern'):{ \n break;\n }\n case('optional'): {\n $this->optionalInfo = $routeInfo['optional'];\n break;\n }\n default:{\n $this->extra[$key] = $value;\n break;\n }\n }\n }\n\n $this->calculateStaticPrefix();\n\n //For paths other than the route path '/' allow the last '/' to be optional\n //If the string terminates there.\n if(mb_strlen($this->staticPrefix) > 1) {\n if(mb_substr($this->staticPrefix, mb_strlen($this->staticPrefix)-1) == '/'){\n $this->staticPrefix = mb_substr($this->staticPrefix, 0, mb_strlen($this->staticPrefix)-1);\n }\n\n if(mb_substr($this->pattern, mb_strlen($this->pattern)-1) == '/'){\n $this->pattern = mb_substr($this->pattern, 0, mb_strlen($this->pattern)-1);\n }\n }\n\n $this->buildRegex();\n }", "public function testNamedRouteException(): void\n {\n $this->expectException(MissingRouteException::class);\n $routes = Router::createRouteBuilder('/');\n $routes->connect(\n '/users/{name}',\n ['controller' => 'Users', 'action' => 'view'],\n ['_name' => 'test']\n );\n Router::url(['_name' => 'junk', 'name' => 'mark']);\n }", "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "public function testSetRouteParamWhenNotExists()\n {\n // Prepare route\n $requestUri = '/hello/mr/anderson';\n $route = new \\Slim\\Route('/hello/:first/:last', function () {});\n\n // Parse route params\n $this->assertTrue($route->matches($requestUri));\n\n // Get param\n try {\n $param = $route->setParam('foo', 'bar');\n $this->fail('Did not catch expected InvalidArgumentException');\n } catch ( \\InvalidArgumentException $e ) {}\n }", "protected function checkRoute()\n {\n if (Router::current() === null) {\n return $this->error(404);\n }\n }", "protected function parseRoute()\n { \n $matches = explode(\"/\", $this->route);\n\n $pattern = '/^([a-zA-Z0-9_-])+$/';\n \n if (preg_match($pattern, $matches[0])) {\n $this->controller = ucfirst(strtolower($matches[0]));\n }\n\n if (!empty($matches[1]) && preg_match($pattern, $matches[1])) {\n $this->action = $this->convert($matches[1]);\n }\n }", "abstract public function getRoute();", "public function getRouteMatch();", "public function validate($data) {\n \tif (!isset($data->route) || empty($data->route)) {\n \t return parent::validate($data);\n \t}\n\n $route = rtrim(ltrim($data->route, Request::QUERY_SEPARATOR), Request::QUERY_SEPARATOR);\n\n $tokens = explode(Request::QUERY_SEPARATOR, $route);\n foreach ($tokens as $index => $token) {\n $token = String::safeString($token);\n\n if (empty($token)) {\n unset($tokens[$index]);\n } else {\n $tokens[$index] = $token;\n }\n }\n\n $data->route = implode(Request::QUERY_SEPARATOR, $tokens);\n\n try {\n parent::validate($data);\n $exception = new ValidationException();\n } catch (ValidationException $e) {\n \t$exception = $e;\n }\n\n $query = $this->createQuery(0, $data->dataLocale, false);\n $query->setFields('{id}');\n $query->addCondition('{parent} LIKE %1% AND {route} = %2% AND {id} <> %3%', $data->getRootNodeId() . self::PATH_SEPARATOR . '%', $data->route, $data->id);\n $node = $query->queryFirst();\n\n if ($node) {\n \t$error = new ValidationError(self::VALIDATION_ROUTE_ERROR_CODE, self::VALIDATION_ROUTE_ERROR_MESSAGE, array('route' => $data->route, 'node' => $node->id));\n $exception->addErrors('route', array($error));\n }\n\n if ($exception->hasErrors()) {\n \tthrow $exception;\n }\n }", "public function routeMatchesEmptyRequestPathIfUriPatternContainsOneOptionalStaticRoutePart()\n {\n $this->route->setUriPattern('(optional)');\n\n self::assertTrue($this->routeMatchesPath(''));\n }", "public function testRouteParamDefaults(): void\n {\n $routes = Router::createRouteBuilder('/');\n $routes->connect('/cache/*', ['prefix' => false, 'plugin' => true, 'controller' => 0, 'action' => 1]);\n\n $url = Router::url(['prefix' => '0', 'plugin' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $expected = '/cache/test';\n $this->assertSame($expected, $url);\n\n try {\n Router::url(['controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n\n try {\n Router::url(['prefix' => '1', 'controller' => '0', 'action' => '1', 'test']);\n $this->fail('No exception raised');\n } catch (Exception $e) {\n $this->assertTrue(true, 'Exception was raised');\n }\n }", "public function testDispatchErrorNoRoute()\n {\n $this->expectException(ResourceNotFoundException::class);\n\n $this->uut->dispatch($this->buildRequest('/unknown-path'));\n }", "public function testRouteDoesNotMatchResourceWithConditions()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $route->conditions(array('first' => '[a-z]{3,}'));\n $result = $route->matches($resource);\n $this->assertFalse($result);\n $this->assertEquals(array(), $route->getParams());\n }", "public function test_construct_withEmptyMethod()\n {\n $this->expectException(InvalidArgumentException::class);\n new Route('', '/home', 'test');\n }", "public function test_construct_withValidParameters()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertSame(\n 'test',\n $route->getTarget(),\n 'Target specified in constructor must be returned via getTarget() method.'\n );\n $this->assertSame(\n [],\n $route->getParams(),\n 'Route from an URI pattern without parameters must return an empty array via getParams() method.'\n );\n }" ]
[ "0.6518188", "0.5794388", "0.5788631", "0.5760706", "0.57446665", "0.56541264", "0.56141937", "0.55395937", "0.55158865", "0.54563713", "0.53772974", "0.5375996", "0.5314642", "0.5303367", "0.5281333", "0.5261131", "0.5215614", "0.5210832", "0.5203177", "0.51988673", "0.5197114", "0.5195203", "0.5190667", "0.518763", "0.517865", "0.5168415", "0.5164435", "0.51255405", "0.5122278", "0.51185614" ]
0.5913249
1
This method serve only for debug and development purposes. It renders all instance properties values into string, to print whole route in logic exception message about what property is missing.
public function __toString () { $type = new \ReflectionClass($this); $allProps = $type->getProperties( \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED | \ReflectionProperty::IS_PRIVATE ); $result = []; /** @var \ReflectionProperty $prop */ foreach ($allProps as $prop) { if ($prop->isStatic()) continue; if ($prop->isPrivate()) $prop->setAccessible(TRUE); $value = NULL; try { $value = $prop->getValue($this); if ($value instanceof \MvcCore\Router) continue; } catch (\Throwable $e) { }; $result[] = '"' . $prop->getName() . '":"' . ($value === NULL ? 'NULL' : var_export($value)) . '"'; } return '{'.implode(', ', $result) . '}'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __toString()\n\t{\n\t\treturn $this->displayError();\n\t}", "protected function renderTrustedPropertiesField() {}", "public function __toString()\n {\n try {\n return $this->get() ?: '';\n } catch (Exception $e) {\n restore_error_handler();\n trigger_error($e->getMessage());\n }\n }", "public function __toString() {\r\n echo '<pre>';\r\n print_r($this->getTraceAsString());\r\n die();\r\n $config = Application::getConfig();\r\n if ($config->debug == 1) {\r\n require_once 'erreur_debug.php';\r\n } else {\r\n require_once 'erreur_production.php';\r\n }\r\n die();\r\n }", "final public function __toString() {\n\t\ttry {\n\t\t\treturn $this->render();\n\t\t} catch(Exception $e) {\n\t\t\ttrigger_error($e->getMessage(), E_USER_ERROR);\n\t\t}\n\t}", "abstract protected function getToStringProperties();", "public function __toString()\n {\n try {\n return $this->render();\n } catch (ViewException $e) {\n return $e->getMessage();\n }\n }", "public function __toString(){ return $this->render(); }", "public function properties(){\n\t\techo \"<span style=\\\"background-color:#FFF;color:red\\\"><strong>Host:</strong>\".$this->host.\"&nbsp;<strong>DB:</strong>\".$this->dbnm.\"&nbsp;<strong>User:</strong>\".$this->user.\"&nbsp;<strong>Password:</strong>\".$this->pssw.\"</span>\";\t\n\t}", "public function __toString()\n {\n try {\n return (string) $this->render();\n } catch (Exception $e) {\n return '';\n }\n }", "function displayProperties ()\n {\n foreach ($this as $key => $property)\n {\n echo $key . ':' . $property . '<br>';\n }\n }", "function __toString(){\n\t\tif($this->ERROR!==false) return $this->ERROR;\n\t\telse return $this->HTML;\n\t}", "public function __toString()\n {\n try {\n $result = $this->render();\n } catch (PDOException $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>' . ORM::get_last_query() . '<hr>';\n } catch (Exception $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>';\n }\n\n return $result;\n }", "public function __toString()\n {\n try {\n $result = $this->render();\n } catch (PDOException $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>' . ORM::get_last_query() . '<hr>';\n } catch (Exception $e) {\n $result = '<hr>' . get_class($e) . ': ' . $e->getMessage() . '<hr>';\n }\n\n return $result;\n }", "public function __toString(){\n\t\t$ref = new ReflectionObject($this);\n\t\t$r = \"[\".$ref->getName().\"]\\n\";\n\t\tforeach($ref->getProperties() as $prop){\n\t\t\t$r .= \"\\t - \".$prop->getName().\"=\".$prop->getValue().\"\\n\";\n\t\t}\n\t\treturn $r;\n\t}", "public function __toString() {\n\t\treturn $this->debug();\n\t}", "function dump() {\n\t\t$vars = get_object_vars( $this );\n\t\techo '<pre style=\"text-align:left\">';\n\t\tforeach( $vars as $name => $value ) {\n\t\t\techo $name.': '.$value.\"\\n\";\n\t\t}\n\t\techo '</pre>';\n\t}", "public function toString()\n {\n $this->assertEquals(\"net::stubbles::reflection::stubReflectionProperty[stubTestProperty1::property] {\\n}\\n\", (string) $this->stubRefProperty);\n }", "public function __toString () {\n\t\treturn $this->Render();\n\t}", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }", "public function __toString()\n {\n return $this->render();\n }" ]
[ "0.61946803", "0.6142063", "0.60639817", "0.59923", "0.59572953", "0.59491", "0.5908902", "0.5864291", "0.5854278", "0.5809952", "0.57832456", "0.57702833", "0.5766682", "0.5766682", "0.5742624", "0.57232326", "0.56855077", "0.5663922", "0.56622493", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726", "0.5657726" ]
0.654259
0
if (isset($_POST['user_id']) && is_numeric($_POST['s']))
private function get_user_id() { // return intval($_POST['s']); if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) { //$_POST['s'] = $_GET['user_id']; return intval($_GET['user_id']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasValidPostUid()\n{\n $validState =\n isset($_POST[\"state\"]) && isUid($_POST[\"state\"]);\n \n $validSession =\n isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n \n if($validState && $validSession)\n {\n return $_SESSION[\"state\"] == $_POST[\"state\"];\n }\n else\n {\n return false;\n }\n}", "function isValidUpdate($user, $id)\n{\n return isValidInsert($user) && is_numeric($id) && $id > 0;\n}", "function isValid( $id_user ) {\n\n\t\treturn true;\n\t}", "function is_valid_input( $id = 0 ) {\n \t\treturn true;\n\t}", "public static function validateId($post_key)\n\t{\n\t\treturn (isset($_POST[$post_key]) && is_numeric($_POST[$post_key]) && $_POST[$post_key] > 0);\n\t}", "function check_if_set(){\r\n if(!(isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email']) && isset($_POST['headline']) && isset($_POST['summary']))){\r\n\treturn false;\r\n }\r\n else{\r\n\treturn true;\r\n }\r\n}", "function isFilled( $id_user ) {\n\n\t\treturn true;\n\t}", "public function validateUserParam($p){\n\t\t\treturn (preg_match(\"/^user_id=[0-9]+$/\", $p) || preg_match(\"/^screen_name=[0-9a-zA-Z_]+$/\", $p));\n\t\t}", "function check_integer($which) {\n if(isset($_REQUEST[$which])){\n if (intval($_REQUEST[$which])>0) {\n //check the paging variable was set or not, \n //if yes then return its number:\n //for example: ?page=5, then it will return 5 (integer)\n return intval($_REQUEST[$which]);\n } else {\n return false;\n }\n }\n return false;\n }", "function post_int($integer_name) {\n\t$integer = $_POST[$integer_name];\n\tsettype($integer, \"integer\");\n\treturn $integer;\n}", "function validateData($tID, $sID){\r\n\t\t\t\tglobal $error;\r\n\t\t\t\tglobal $count;\r\n\t\t\t\t\r\n\t\t\t\tif($tID==0 || $tID== null){\r\n\t\t\t\t\t$error.= \"<br/> You must select a tutor.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(count($sID)==0){\r\n\t\t\t\t\t$error.= \"<br/> You must select a student to assign.\"; \r\n\t\t\t\t\t$count++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "function isFormValid(){\n\tif(!isset($_POST['num-input'])){\n\t\treturn false;\n\t}\n\tif(!isset($_POST['job-name'])){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isValidInsert($user)\n{ \n echo $user;\n return isset($user['email']) &&\n isset($user['password']) ;\n}", "function get_user_id() {\n\tif (!empty($_SESSION['user_id'])) {\n\t\treturn (int) $_SESSION['user_id'];\n\t} else {\n\t\treturn false;\n\t}\n}", "private function validatePostID($_post_id){\n if(is_numeric($_post_id) && $_post_id>0 && $_post_id<65535){\n $post_id = intval($_post_id);\n return true;\n }else{\n return false;\n }\n }", "function checkedituser()\n\t{\n\t\t$query1 = $this->db->query('select * from admin where username = \"'.$this->input->post('username').'\" AND id != \"'.$this->input->post('id').'\" ') or die(mysql_error());\n\t\t\n\t\t//echo 'Coint:'.$query1->num_rows();\texit;\n\t\tif($query1->num_rows() == 0)\n\t\t {\t\t\t\n\t\t\t\techo '0';\t\n\t\t }\n\t\t else\t\t \n\t\t {\n\t\t\t\techo '1';\n\t\t\t}\n\t\t \n\t\t\n\t}", "protected function valid()\r\n {\r\n return isset($_SESSION['user']['user_id']) ? true : false;\r\n }", "function securityValidation($id){\n\t\n$level_sql = \"SELECT * FROM user WHERE id = '$id'\";\n$level_query = mysql_query($level_sql);\n$row_level = mysql_num_rows($level_query);\n$rs_level = mysql_fetch_object($level_query);\n\nif( $row_level == 1){\n\t$sec = $rs_level->user_type;\n}else{\n$sec = false;\t\n}\n\nreturn $sec;\n}", "function WriteID()\r\n{\r\n if (isset($_POST))\r\n {\r\n if (!empty($_POST) && !empty($_POST['delivery']))\r\n {\r\n echo $_POST['delivery'];\r\n }\r\n\r\n }\r\n}", "function check_input($value)\n\t{\n\tif(!empty($value))\n\t\t{\n\t\t$value = substr($value,0,50); \n\t\t}\n\t\tif (get_magic_quotes_gpc()) \n\t\t\t{\n\t\t\t$value = stripslashes($value);\n\t\t\t}\n\t\tif (!ctype_digit($value)) \t\n\t\t\t{\n\t\t\t$value = \"'\" . mysql_real_escape_string($value) . \"'\";\n\t\t\t}\n\telse\n\t\t{\n\t\t$value = intval($value);\n\t\t}\n\treturn $value;\n\t}", "function usingRequest()\r\n{ echo \"<br>\";\r\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\")\r\n {\r\n // collect value of input field\r\n $name = htmlspecialchars($_REQUEST['fname']);\r\n if (empty($name)) \r\n {\r\n throw new Exception(\"Accept only integer values!!!\"); \r\n } \r\n else \r\n {\r\n echo $name.\"<br>\";\r\n }\r\n\r\n }\r\n}", "function hasValidUid()\n{\n return isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n}", "function validateUser($id) {\n\tif(empty($id)) die(\"You started a session without an ID...\");\n session_regenerate_id (); //this is a security measure\n $_SESSION['valid'] = 1;\n $_SESSION['userid'] = $id;\n}", "function isInteger ($s) {\r\n return is_integer($s);\r\n }", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "private function validatePostAuthorID($_post_author_id){\n if(is_numeric($_post_author_id) && $_post_author_id>0 && $_post_author_id<65535){\n $this->post_author_id = intval($_post_author_id);\n return true;\n }else{\n return false;\n }\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "private function checkUserId() {\n\t\tif(!$this->userId || gettype($this->userId) != 'integer') {\n\t\t\tthrow new ErrorException($this->idErrorMessage);\n\t\t}\n\t\treturn true;\n\t}", "function validate_user_form()\n {\n }", "function cleanInput($infoUser, $type)\r\n {\r\n switch($type)\r\n {\r\n case 0:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\r\n $error = filter_var($error, FILTER_DEFAULT);\r\n break;\r\n\r\n case 1:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_EMAIL);\r\n $error = filter_var($error, FILTER_VALIDATE_EMAIL);\r\n break;\r\n\r\n case 2:\r\n\r\n\r\n //$error = filter_var($infoUser, FILTER_SANITIZE_NUMBER_INT);\r\n if (filter_var($infoUser, FILTER_VALIDATE_INT) === 0 || !filter_var($infoUser, FILTER_VALIDATE_INT) === false) {\r\n $error = filter_var($infoUser, FILTER_VALIDATE_INT);\r\n } else {\r\n echo(\"Integer is not valid\");\r\n }\r\n break;\r\n\r\n case 3:\r\n $error = filter_var($infoUser, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\r\n $error = filter_var($error, FILTER_DEFAULT);\r\n break;\r\n\r\n\r\n }\r\n return $error;\r\n\r\n }" ]
[ "0.6181011", "0.60639924", "0.5983581", "0.5805633", "0.5746848", "0.57267255", "0.5661057", "0.5633353", "0.55801797", "0.5577172", "0.5572611", "0.5543544", "0.5527128", "0.55113524", "0.54851943", "0.54836595", "0.548193", "0.54773355", "0.5476028", "0.5463998", "0.546117", "0.5441688", "0.54411703", "0.54304934", "0.5415668", "0.5407698", "0.53940654", "0.53905314", "0.5381691", "0.53767544" ]
0.70548385
0
upload only works for User entities
private function uploadFile($entity) { if (!$entity instanceof DUser) { return; } $file = $entity->getPicture(); // only upload new files if (!$file instanceof UploadedFile) { return; } $fileName = $this->uploader->upload($file); $entity->setPicture($fileName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload();", "private function postUploadFile($entity)\n {\n if (!$entity instanceof User) {\n return;\n }\n\n $file = $entity->getTempFile();\n\n // only upload new files\n if (!$file instanceof UploadedFile) {\n return;\n }\n\n if (null === $file) {\n return;\n }\n\n if (null !== $entity->getTempFilename()) {\n $oldFile = $this->uploader->getTargetDir().'/'.$entity->getId().'.'.$entity->getTempFilename();\n\n if(file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n $fileName = $entity->getId().'.'.$entity->getAvatar();\n\n $this->uploader->upload($file, $fileName);\n }", "public function upload()\n {\n }", "public function upload()\n\t{\n\t}", "abstract protected function doUpload();", "public function upload() {\n\t\t$this->load->model('clublog_model');\n\n\t\t$users = $this->clublog_model->get_clublog_users();\n\n\t\tforeach ($users as $user) {\n\t\t\t$this->uploadUser($user->user_id, $user->user_clublog_name, $user->user_clublog_password);\n\t\t}\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "function uploadObject();", "public function step_2_manage_upload()\n {\n }", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "public function avatarUploadAction()\n { \n \n $uid= $this->auth->getUserId();\n $object = Users::findFirstById($uid);\n\n if($object && $object->getStatus() == $object::STATUS_ACTIVE) {\n\n if ($this->request->hasFiles()) {\n\n $uploads = $this->request->getUploadedFiles();\n\n foreach ($uploads as $fileObj) {\n\n $fileExt = $fileObj->getRealType();\n $mediaType = new MediaType();\n\n if (!$mediaType->checkExtension($fileExt)) {\n return $this->setError(t(\"Can't upload because file type's not allowed\"). \": \". $fileExt);\n }\n\n $localPath = $fileObj->getTempName();\n\n $name = Hash::generate().\"-\". $uid .'.jpg';\n $thumb = new Easy();\n $thumb->Thumbsize = 150;\n $thumb->Cropimage = [3,1,125,125,85,85];\n $thumb->Thumbsaveas = 'jpg';\n $thumb->Thumbfilename = $name;\n $thumb->Thumblocation = content_path('uploads/avatars/');\n $thumb->Createthumb( $localPath , 'file');\n\n $object->setAvatar( $name );\n $object->save();\n\n }\n\n }\n\n }\n\n die(); // no need to use media\n\n if ($this->request->hasFiles()) {\n \n $media = new Media();\n $uploads = $this->request->getUploadedFiles();\n $this->view->disable();\n $uploaded = true;\n\n \n\n foreach ($uploads as $fileObj) {\n\n $avatar = $media->initAvatar($fileObj);\n if (!$avatar) {\n $uploaded = false;\n }else {\n $path = $avatar;\n }\n }\n\n\n if (!$uploaded) {\n $error = implode(\"\\n\", $media->getError());\n $this->response->setStatusCode(406, $error);\n $this->response->setContent($error);\n } else {\n $object->setAvatar( $path );\n $object->save();\n $this->response->setStatusCode(200, t(\"Success\"));\n }\n return $this->response->send();\n }\n\n }", "private function uploadFile($entity)\n {\n if (!$entity instanceof Image) {\n return;\n }\n\n $file = $entity->getImagefile();\n // only upload new files\n if ($file instanceof UploadedFile) {\n $fileName = $this->uploader->upload($file);\n $entity->setImagefile($fileName);\n }\n }", "public function uploadImage($userRqt, $entity)\n\t{\n\t\n\t $orm = $this->getOrm();\n\t $id = $entity->getId();\n\t \n\t // upload des images\n\t $filePath = PATH_UPLOADS.'attachments/';\n\t $filePath .= $userRqt->tSource.'/'.$userRqt->tField.'/';\n\t $filePath .= SParserString::idToPath($id);\n \n\t $uploadImage = $userRqt->getUpload();\n\t \n\t if ($uploadImage) {\n\n\t $uploadImage->copy($id, $filePath);\n\t \n\t // thumbs cleanen\n\t $fileTemp = PATH_UPLOADS.'thumbs/';\n\t $fileTemp .= $userRqt->tSource.'/'.$userRqt->tField;\n\t $fileTemp .= SParserString::idToPath($id).$id;\n\t \n\n\t Log::debug( 'clean cache '.$fileTemp );\n\t \n\t SFilesystem::cleanFolder($fileTemp);\n\t $entity->setData($userRqt->tField, $uploadImage->oldname);\n\t $orm->update($entity);\n\t \n\t } else {\n\n\t Log::warn( 'NO UPLOAD IMAGE' );\n\t }\n\t \n\t \n\n\n\t}", "public function uploadFiles()\n {\n\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n\n $input = \\Input::all();\n\n $rules = array(\n 'file' => 'image|max:3000',\n );\n\n $validation = \\Validator::make($input, $rules);\n\n if ($validation->fails()) {\n return \\Response::make($validation->errors->first(), 400);\n }\n $image = \\Input::file('file');\n $destinationPath = 'profilepics'; // upload path\n $fileName = \\Auth::user()->idPerson . '.' . $image->getClientOriginalExtension();\n $upload_success = $image->move($destinationPath, $fileName); // uploading file to given path\n $tenant->profile_picture = $fileName;\n $tenant->save();\n\n if ($upload_success) {\n return \\Response::json('success', 200);\n } else {\n return \\Response::json('error', 400);\n }\n\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadimage()\n\t{\n\t\t$user = User::find($_POST['user_id']);\n\n\t\t$userprofile = Input::file( 'user_profile_image' );\n\n\t\tif( !empty( $userprofile ) )\n\t\t{\n\t\t\t$file_in = $userprofile->getRealPath();\n\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_profile_image = $file_out;\n\t\t}\n\n\t\t$usercoverprofile = Input::file( 'user_cover_image' );\n\n\t\tif( !empty( $usercoverprofile ) )\n\t\t{\n\t\t\t$file_in = $usercoverprofile->getRealPath();\n\t\t\t$file_out = 'profile/' . $_POST['user_id'] . \"-\" . str_random( 12 ) . \".jpg\";\n\n\t\t\t$img = Image::make( $file_in );\n\n\t\t\t$img->resize( 200, 200 );\n\n\t\t\t$img->save( Config::get('app.home') . '/public/' . $file_out, 80 );\n\n\t\t\t$handle = fopen( Config::get('app.home') . '/public/' . $file_out, \"r\" );\n\n\t\t\tFlysystem::connection( 'awss3' )->put( $file_out,\n\t\t\t\t\t\t\t\t\t\t\t\t fread( $handle,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t filesize( Config::get('app.home') . '/public/' . $file_out ) ) );\n\n\t\t\t$user->user_cover_image = $file_out;\n\t\t}\n\t\t$user->save();\n\t\theader(\"Location:http://\".Config::get('app.url_admin').\"/user/\".$_POST['user_id']);\n\t\texit();\n\t\t/*end of code for upload user profile and cover image*/\n\t}", "public function upload()\n {\n if (!Request::hasPost('requestToken') || !RequestToken::validate(Request::getPost('requestToken'))) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Invalid Request Token!');\n $objResponse->output();\n }\n\n if (!Request::getInstance()->files->has($this->name)) {\n return;\n }\n\n $objTmpFolder = new \\Folder(MultiFileUpload::UPLOAD_TMP);\n\n // contao 4 support, create tmp dir symlink\n if (version_compare(VERSION, '4.0', '>=')) {\n // tmp directory is not public, mandatory for preview images\n if (!file_exists(System::getContainer()->getParameter('contao.web_dir') . DIRECTORY_SEPARATOR . MultiFileUpload::UPLOAD_TMP)) {\n $objTmpFolder->unprotect();\n $command = new SymlinksCommand();\n $command->setContainer(System::getContainer());\n $input = new ArrayInput([]);\n $output = new NullOutput();\n $command->run($input, $output);\n }\n }\n\n $strField = $this->name;\n $varFile = Request::getInstance()->files->get($strField);\n // Multi-files upload at once\n if (is_array($varFile)) {\n // prevent disk flooding\n if (count($varFile) > $this->maxFiles) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Bulk file upload violation.');\n $objResponse->output();\n }\n\n /**\n * @var UploadedFile $objFile\n */\n foreach ($varFile as $strKey => $objFile) {\n $arrFile = $this->uploadFile($objFile, $objTmpFolder->path, $strField);\n $varReturn[] = $arrFile;\n\n if (\\Validator::isUuid($arrFile['uuid'])) {\n $arrUuids[] = $arrFile['uuid'];\n }\n }\n } // Single-file upload\n else {\n /**\n * @var UploadedFile $varFile\n */\n $varReturn = $this->uploadFile($varFile, $objTmpFolder->path, $strField);\n\n if (\\Validator::isUuid($varReturn['uuid'])) {\n $arrUuids[] = $varReturn['uuid'];\n }\n }\n\n if ($varReturn !== null) {\n $this->varValue = $arrUuids;\n $objResponse = new ResponseSuccess();\n $objResult = new ResponseData();\n $objResult->setData($varReturn);\n $objResponse->setResult($objResult);\n\n return $objResponse;\n }\n }", "public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}", "public function uploadProfileImageAction(Request $request)\n {\n\n\n if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) {\n return JsonResponse::create(['asc' => 'logout']);\n }\n\n $user = $this->getUser();\n\n\n $res = $this->get('fly.local.uploader')->uploadUserPicture($this->get('request')->files->get('file'), $user);\n// die('ok3');\n if ($res['asc'] == 'error') {\n return JsonResponse::create(['asc' => 'error', 'message' => $res['msg']]);\n }\n $userManager = $this->get('fos_user.user_manager');\n $user->setPhoto($res['url']);\n $user->setPhotoSmall($res['small_url']);\n\n// $userManager->createUser($user);\n $userManager->updateUser($user);\n\n return JsonResponse::create(['asc' => 'success', 'url' => $res['url'], 'small_url'=>$res['small_url']]);\n// return $this->render('FlyPlatformBundle:Default:index.html.twig', array('name' => $name));\n }", "public function upload(Request $request)\n {\n //\n }", "public function onUserProfilePhotoUpload($event)\n {\n\t\tif(Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('album'))\n\t\t\treturn;\n $payload = $event->getPayload();\n if( empty($payload['user']) || !($payload['user'] instanceof Core_Model_Item_Abstract) ) {\n return;\n }\n if( empty($payload['file']) || !($payload['file'] instanceof Storage_Model_File) ) {\n return;\n }\n $viewer = $payload['user'];\n $file = $payload['file'];\n // Get album\n $table = Engine_Api::_()->getDbtable('albums', 'sesalbum');\n $album = $table->getSpecialAlbum($viewer, 'profile');\n $photoTable = Engine_Api::_()->getDbtable('photos', 'sesalbum');\n $photo = $photoTable->createRow();\n $photo->setFromArray(array(\n 'owner_type' => 'user',\n 'owner_id' => Engine_Api::_()->user()->getViewer()->getIdentity()\n ));\n $photo->save();\n $photo->setPhoto($file);\n $photo->album_id = $album->album_id;\n $photo->save();\n if( !$album->photo_id ) {\n $album->photo_id = $photo->getIdentity();\n $album->save();\n }\n $auth = Engine_Api::_()->authorization()->context;\n $auth->setAllowed($photo, 'everyone', 'view', true);\n $auth->setAllowed($photo, 'everyone', 'comment', true);\n $auth->setAllowed($album, 'everyone', 'view', true);\n $auth->setAllowed($album, 'everyone', 'comment', true);\n $event->addResponse($photo);\n }", "public function handle_upload()\n {\n }", "public function lifecycleFileUpload() {\n $this->upload();\n}", "public function checkUpload() {}", "public function p_upload(){\n \n if(!isset($_FILES)){\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n }\n //fixed filename upper case possibility.\n $_FILES['avatar_pic']['name'] = strtolower($_FILES['avatar_pic']['name']);\n //get file extension \n $parts = pathinfo( ($_FILES['avatar_pic']['name']) );\n //boolean set to FALSE for incorrect file extension uploading\n $upload_ok = FALSE;\n \n \n \n \n if($parts['extension'] == \"jpg\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"jpeg\")\n $upload_ok = TRUE; \n if($parts['extension'] == \"png\")\n $upload_ok = TRUE;\n if($parts['extension'] == \"gif\")\n $upload_ok = TRUE; \n \n if($upload_ok) { \n //upload the chosen file and rename it temp-user_id.original extension\n Upload::upload($_FILES, \"/uploads/avatars/\", array(\"jpg\", \"jpeg\", \"gif\", \"png\"), \"temp-\".$this->user->user_id); \n //resize the image to 258x181 -- usually it's 258 wide then optimal height.\n $imgObj = new Image(APP_PATH.'uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']);\n \n $imgObj->resize(100, 100);\n $imgObj->save_image(APP_PATH.'uploads/avatars/'.$this->user->user_id.'.'.'png'); //save the file as user_id.png\n unlink('uploads/avatars/'.'temp-'.$this->user->user_id.'.'.$parts['extension']); //delete the temp file\n Router::redirect(\"/users/profile/\".$this->user->user_id);\n }\n else {\n //send the user back to the profile but this time have error set.\n Router::redirect(\"/users/profile/\".$this->user->user_id.\"/error\");\n } //else\n }", "public function uploadpicture()\n { \n // calling the Model with upload functionality\n $this->uploadfile($picture = true);\n }", "public function uploadFile($object, $file, $path){\n $fileName = md5(uniqid()).'.'.$file->guessExtension();\n // Move the file to the directory where brochures are stored\n $picDir = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$path;\n $file->move($picDir, $fileName);\n // Update the 'screenshot' property to store the file name instead of the file\n return $object->setPic($fileName);\n}", "function uploadUserImage($file)\n {\n $fileLoc = '';\n $imageRp = new ImageRespository();\n $validateF = new ValidateFunctions();\n\n if ($file['file_upload']['name'] != '' && $_GET['action'] != 'edituser') {\n $fileLoc = $imageRp->uploadImage($file, $imageRp->getNextId('user_db'), 'user');\n } else if ($file['file_upload']['name'] == '' && $_GET['action'] != 'edituser') {\n $fileLoc = DEFAULT_IMAGE;\n } else if ($file['file_upload']['name'] != '' && $_GET['action'] == 'edituser') {\n $_userRp = new UserRepository();\n $user = $_userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n $userObj = new User();\n $userObj->copyToObject(json_decode($user[3], true));\n $prevImg = $userObj->getImage();\n\n if ($prevImg != DEFAULT_IMAGE) {\n unlink($_SERVER['DOCUMENT_ROOT'] . $prevImg);\n }\n $fileLoc = $imageRp->uploadImage($file, $_GET['id'], 'user');\n } else if ($file['file_upload']['name'] == '' && $_GET['action'] == 'edituser'){\n $_userRp = new UserRepository();\n $user = $_userRp->getOneFromDB($validateF->sanitize($_GET['id']));\n $userObj = new User();\n $userObj->copyToObject(json_decode($user[3], true));\n $fileLoc = $userObj->getImage();\n }else {\n $fileLoc = DEFAULT_IMAGE;\n }\n return $fileLoc;\n }" ]
[ "0.70467997", "0.6946498", "0.68858933", "0.6811658", "0.669485", "0.6628978", "0.6609578", "0.65895957", "0.65867287", "0.65759933", "0.63668", "0.6300808", "0.62582487", "0.62370276", "0.6190593", "0.61893994", "0.6094032", "0.607278", "0.60646695", "0.6045309", "0.60380477", "0.60360223", "0.6025326", "0.6016117", "0.6014375", "0.6003551", "0.59989774", "0.5994995", "0.5983785", "0.5959741" ]
0.70752674
0
This method returns the json from array list
public function json_encode() { try{ return json_encode((array)array_values(self::get_items())); }catch(Exception $e){ throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getListJsonString() {\r\n \r\n $arr=array();\r\n \r\n foreach ($this->list as $object)\r\n {\r\n $vars = $object->getObjectVars();\r\n \r\n if ( $object->getObjCentro() !=null )\r\n {\r\n $vars['objCentro']=$object->getObjCentro()->getObjectVars();\r\n }\r\n if ( $object->getObjCiclo() !=null )\r\n {\r\n $vars['objCiclo']=$object->getObjCiclo()->getObjectVars();\r\n \r\n if ( $object->getObjCiclo()->getObjFamilia() !=null )\r\n {\r\n $vars['objFamilia']=$object->getObjCiclo()->getObjFamilia()->getObjectVars();\r\n } \r\n }\r\n \r\n array_push($arr, $vars);\r\n }\r\n return json_encode($arr);\r\n }", "function listToJson($list) {\n $json = array();\n\n foreach($list as $m) {\n $json[count($json)] = $m->generateJson();\n }\n\n return $json;\n}", "public static function getAllToJson() {\n $jsonArray = array(); //create JSON array\n //read items\n foreach(self::getAll() as $item) {\n array_push($jsonArray, json_decode($item->toJson()));\n }\n return json_encode($jsonArray); //return JSON array\n }", "public static function getAllJson() {\n\t\t\t//list\n\t\t\t$list = array();\n\t\t\t//get all\n\t\t\tforeach(self::getAll() as $item) {\n\t\t\t\tarray_push($list, json_decode($item->toJson()));\n\t\t\t}\n\t\t\t//return json encoded array\n\t\t\treturn json_encode(array(\n\t\t\t\t'machines' => $list\n\t\t\t));\n\t\t}", "public function index_get_json() {\r\n\t\t\r\n\t\t$res = $this->logic->getLists ();\r\n\t\techo json_encode ( $res );\r\n\t}", "public function buildJson();", "public function jsonSerialize()\n {\n $json = array();\n $json['defaultMode'] = $this->defaultMode;\n $json['items'] = $this->items;\n\n return $json;\n }", "function asJSON(){\n\t\t\treturn json_encode($this->asArray());\n\t\t}", "public function resultsToJson ()\n {\n// $res = array();\n// foreach ($this->results() as $result)\n// {\n// array_push($res, array($result));\n// }\n return json_encode($this->results());\n }", "function get_item_list_json()\n {\n $output = $this->invm->get_item_list_search(strtolower($this->uri->segment(4)));\n echo json_encode($output);\n }", "public function toJson(){\n\t\t$array = $this->toArray();\n\t\treturn json_encode($array);\n\t}", "public function jsonSerialize() \n {\n return $this->items;\n }", "public function getAppointmentsListJSON() {\nglobal $_LW;\n$output=[];\nforeach($_LW->dbo->query('select', 'id, title', 'livewhale_appointments', false, 'title ASC')->run() as $res2) { // loop through and add appointments\n\t$output[]=['id'=>$res2['id'], 'title'=>$res2['title']];\n};\nreturn json_encode($output);\n}", "public function json()\n\t{\n\t\t$data = [\n\t\t\t'totalResults' => '3',\n\t\t\t'values' => [\n\t\t\t\t['name' => 'John', 'age' => 30],\n\t\t\t\t['name' => 'Mary', 'age' => 24],\n\t\t\t\t['name' => 'Petter', 'age' => 18],\n\t\t\t],\n\t\t];\n\n\t\treturn $data;\n\t}", "public function jsonSerialize()\n {\n return [['id' => $this->id,\n 'users_id' => $this->users,\n 'result' => $this->result,\n 'time' => $this->time]\n\n ];\n }", "public function json();", "public function jsonSerialize()\n {\n $json = array();\n $json['list_id'] = $this->listId;\n $json['sender'] = $this->sender;\n $json['subject'] = $this->subject;\n $json['body'] = $this->body;\n $json['resource_urls'] = $this->resourceUrls;\n $json['send_date'] = $this->sendDate;\n\n return $json;\n }", "public function jsonString(){\n return json_encode($this->createRequestsArray());\n }", "public function asJson()\n {\n return array();\n }", "public function jsonSerialize()\n {\n $arrayJson = array();\n foreach ($this as $key =>$value){\n if($key != 'document')\n $arrayJson[$key] = $value;\n }\n return $arrayJson;\n }", "public function toJson()\n {\n return json_encode($this->items);\n }", "public function jsonSerialize()\n {\n return $this->items;\n }", "public function jsonSerialize()\n {\n return $this->items;\n }", "public function jsonSerialize()\n {\n try {\n $lists = $this->getLists();\n } catch (\\Exception $e) {\n $lists = [];\n }\n\n return [\n \"integrationId\" => $this->getId(),\n \"resourceId\" => \"\",\n \"type\" => self::TYPE,\n \"source\" => $this->getServiceProvider(),\n \"name\" => $this->getName(),\n \"label\" => 'Opt-in mailing list \"' . $this->getName() . '\"',\n \"emailFieldHash\" => \"\",\n \"lists\" => $lists,\n ];\n }", "private function json()\n {\n return json_encode($this->data);\n }", "public function jsonSerialize()\n {\n $json = array();\n foreach ($this as $key => $value) {\n $json[$key] = $value;\n }\n \n $json['created_at'] = $this->getCreatedAt()->format(\"F j, Y\");\n \n return $json;\n }", "public function toJSONString(){\n $this->buildArray();\n return json_encode($this->array);\n }", "private function json($data){\r\n if(is_array($data)){\r\n return json_encode($data);\r\n }\r\n else return json_encode($data);\r\n }", "public function toJson();", "public function toJson();" ]
[ "0.72982126", "0.705181", "0.6993491", "0.68498564", "0.6830353", "0.6816437", "0.6717638", "0.66275674", "0.6589807", "0.6583303", "0.6582989", "0.6581208", "0.65729165", "0.65625787", "0.6537383", "0.65070826", "0.64930725", "0.64794785", "0.6463965", "0.64507", "0.6443318", "0.6442598", "0.6442598", "0.6430986", "0.64219975", "0.6396728", "0.63804466", "0.63710904", "0.63665754", "0.63665754" ]
0.7084782
1
Return an array of cached WP_Query post ID's.
protected function wpQueryGetAllIdsCached(string $post_type, array $args = [], ?int $expiration = null): array { return $this->wpGetAllIds([$this, 'wpQueryCached'], $post_type, $args, $expiration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kalium_get_post_ids_from_query( $query ) {\n\t$ids = [];\n\n\tforeach ( $query->posts as $post ) {\n\t\tif ( is_object( $post ) ) {\n\t\t\t$ids[] = $post->ID;\n\t\t} else if ( is_numeric( $post ) ) {\n\t\t\t$ids[] = $post;\n\t\t}\n\t}\n\n\treturn $ids;\n}", "private function getAllPostsData(){\n\t\tglobal $wpdb;\n\n\t\tif( empty ( $this->posts ) ){\n\t\t\t$posts = wp_cache_get( 'pi_all_posts', 'post' );\n\t\t\tif( ! is_array( $posts ) ){\n\t\t\t\t$posts = $wpdb -> get_results( \"SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'post' LIMIT 100\", ARRAY_A );\n\t\t\t\twp_cache_set( 'pi_all_posts', $posts, 'post', 120);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$posts = $this -> posts;\n\t\t}\n\n\t\treturn $posts;\n\n\t}", "public function getPostIDs() {\n\t\treturn self::getAllPostIDs($this->threadID);\n\t}", "public function getIdentities() {\n\treturn [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "private function extractPostIds()\n {\n $postIds = [];\n $documentType = $this->getConfig()->getDocumentType();\n\n if ($this->searchResult !== null && isset($this->searchResult['records'][$documentType])) {\n foreach ($this->searchResult['records'][$documentType] as $hit) {\n $postIds[] = (int) $hit['external_id'];\n }\n }\n\n if (empty($postIds)) {\n $postIds = [0];\n }\n\n return $postIds;\n }", "function get_home_featured_posts_ids() {\n if (false === ($featured_post_ids = get_transient('featured_post_ids'))) {\n $featured_args = array(\n 'orderby' => 'date', \n 'order' => 'DESC',\n 'posts_per_page' => 5,\n 'meta_info' => 'featured',\n 'meta_key' => '_thumbnail_id',\n 'post_status' => 'publish',\n 'post_type' => array('post', 'external_tool', 'wp_tool')\n );\n\n // The Featured Posts query.\n $featured = new WP_Query($featured_args);\n\n // Proceed only if published posts with thumbnails exist\n if ($featured->have_posts()) {\n while ( $featured->have_posts()) {\n $featured->the_post();\n if ( has_post_thumbnail( $featured->post->ID ) ) {\n $featured_post_ids[] = $featured->post->ID;\n }\n }\n\n set_transient('featured_post_ids', $featured_post_ids);\n }\n }\n\n return $featured_post_ids;\n}", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getEntityId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG.'_'.$this->getId()];\n }", "function get_warm_posts(){\r\n\t\treturn $this->get_post_ids(40, 10);\r\n\t}", "function update_postmeta_cache($post_ids)\n {\n }", "function get_hot_posts(){\r\n\t\treturn $this->get_post_ids(10);\r\n\t}", "public function getIdentities(){\n return [self::CACHE_TAG.'_'.$this->getProductId()];\n }", "function post_ids() {\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn array();\n\n\t\t$media_files = $media_location->media_files();\n\n\t\tif ( ! count( $media_files ) )\n\t\t\treturn array();\n\n\t\t// fetch releases\n\t\t$episode_ids = array_map( function ( $v ) { return $v->episode_id; }, $media_files );\n\t\t$episodes = Episode::find_all_by_where( \"id IN (\" . implode( ',', $episode_ids ) . \")\" );\n\n\t\treturn array_map( function ( $v ) { return $v->post_id; }, $episodes );\n\t}", "function get_all_posts_maps () {\r\n\t\t$table = $this->get_table_name();\r\n\t\t$maps = $this->wpdb->get_results(\"SELECT * FROM {$table} WHERE post_ids <> 'a:0:{}'\", ARRAY_A);\r\n\t\tif (is_array($maps)) foreach ($maps as $k=>$v) {\r\n\t\t\t$maps[$k] = $this->prepare_map($v);\r\n\t\t}\r\n\t\treturn $maps;\r\n\t}", "function _prime_post_caches($ids, $update_term_cache = \\true, $update_meta_cache = \\true)\n {\n }", "public function getIdentities()\n {\n $tags = [];\n if ($this->getId()) {\n $tags[] = self::CACHE_TAG . '_' . $this->getId();\n }\n return $tags; \n }", "protected function wpQueryGetAllIds(string $post_type, array $args = [], ?int $expiration = null): array\n {\n if (is_int($expiration)) {\n _deprecated_argument(\n __FUNCTION__,\n '2.4.0',\n esc_html__( // phpcs:disable Generic.Files.LineLength.TooLong\n 'Usage of expiration is deprecated. Use `WpQueryTrait::wpQueryGetAllIdsCached` if cache is desired.',\n 'wp-utilities'\n ) // phpcs:enable\n );\n }\n\n return $this->wpGetAllIds([$this, 'wpQuery'], $post_type, $args, $expiration);\n }", "public static function bkap_get_resource_ids() {\n\t\t\n\t\t$all_resource_ids \t= array();\n\t\t$args \t\t\t\t= array('post_type' => 'bkap_resource','posts_per_page'=> -1,);\n\t\t$resources \t\t\t= get_posts( $args );\n\t\t\n\t\tif( count( $resources ) > 0 ){\n\t\t\tforeach ( $resources as $key => $value ) {\n\t\t\t\t$all_resource_ids[] = $value->ID;\n\t\t\t}\n\t\t}\n\t\treturn $all_resource_ids;\n\t}", "public function getTargetPostsWithCachePaginate(){\n\n $cacheKey = \"{$this->getCacheKey(Auth::user()->email)}.posts\";\n\n return \\Cache::store('redis')\n ->remember($cacheKey, Carbon::now()->addMinutes(15), function (){\n return ['latest'=> $this->getLatestPostsWithPaginate(),\n 'oldest' => $this->getOldestPostsWithPaginate(),\n 'rand' => $this->getRandPostsWithPaginate()\n ];\n });\n }", "function mf_get_posts_by_ID_array($post_ID_array){\n\tglobal $wpdb;\n\tforeach ($post_ID_array as $post_ID){\n\t$query[] = \"SELECT post_title, ID FROM $wpdb->posts WHERE post_status ='publish' AND post_id = '$post_ID'\";\n\t}\n\t\n\t\n\tforeach ($post_ID_array as $post_ID){\n\t\t$post_object_array[]=get_post($post_ID);\n\t}\n\tforeach ($post_object_array as $post_object){\n\t\tif ($post_object->post_status == 'publish'){\n\t\t\t$published_objects[]=$post_object;\n\t\t}\n\t}\n\t\n\treturn $published_objects;\n}", "private function _get_all_cached_attachment_transient_ids( $prefix = '_sn' ) {\n\t\tglobal $wpdb;\n\t\t$sql = \"SELECT `option_name` AS `name`, `option_value` AS `value`\n\t\t\t\t\t\tFROM $wpdb->options\n\t\t\t\t\t\tWHERE `option_name` LIKE '%transient_%'\n\t\t\t\t\t\tORDER BY `option_name`\";\n\n\t\t$results = $wpdb->get_results( $sql );\n\n\t\t// Find the transient IDs with the supplied prefix.\n\t\t$transients = array();\n\t\tforeach ( $results as $result ) {\n\t\t\tif ( strpos( $result->name, \"_transient_{$prefix}\" ) !== false ) {\n\t\t\t\t$transient_id = str_replace( '_transient_', '', $result->name );\n\t\t\t\t$transients[] = $transient_id;\n\t\t\t} // if()\n\t\t} // foreach()\n\n\t\treturn array_unique( $transients );\n\t}", "public static function getContentIDs($postID)\n {\n $timePassesList = TimePass::getTimePassesListByPostID($postID);\n $timePasses = TimePass::getTokenizedTimePassIDs($timePassesList);\n $subscriptionsList = Subscription::getSubscriptionsListByPostID($postID);\n $subscriptions = Subscription::getTokenizedIDs($subscriptionsList);\n\n return array_merge(array_merge(array($postID), $timePasses, $subscriptions));\n }" ]
[ "0.66878194", "0.64032906", "0.626438", "0.62574726", "0.61770266", "0.61770266", "0.61770266", "0.61770266", "0.61770266", "0.61770266", "0.61770266", "0.61770266", "0.61489534", "0.6111235", "0.60795444", "0.60319346", "0.5991098", "0.59635884", "0.59190005", "0.58724713", "0.5834544", "0.57788825", "0.5739685", "0.5667073", "0.56238097", "0.56083673", "0.5575122", "0.55538726", "0.5535933", "0.5526536" ]
0.6648656
1
When user logged in store user login data
public function saveLoginData() { //Get user data (ip, time, browser) $request = \Yii::$app->getRequest(); $userData = [ 'ip' => $request->getUserIP(), 'login_time' => time(), 'browser' => UserAgent::model()->browser, 'user_id' => \Yii::$app->user->id ]; //Save it to DB $loginStories = new LoginStories(); $loginStories->attributes = $userData; $loginStories->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function sessionLogin() {\r\n $this->uid = $this->sess->getUid();\r\n $this->email = $this->sess->getEmail();\r\n $this->fname = $this->sess->getFname();\r\n $this->lname = $this->sess->getLname();\r\n $this->isadmin = $this->sess->isAdmin();\r\n }", "private function loginWithSessionData()\n { \n $this->user_name = $_SESSION['user_name'];\n $this->user_email = $_SESSION['user_email'];\n\n // set logged in status to true, because we just checked for this:\n //if(!empty($_SESSION['user_name']) && ($_SESSION['user_logged_in'] == 1)\n // when we called this method (in the constructor)\n $this->user_is_logged_in = true;\n \n if($_SESSION['user_privileges'] == 1)\n $this->user_admin = true;\n }", "function login() {\n \t$this->set('indata',$this->data);\n\t\tif(empty($this->data)){\n\t\t\t$this->pageTitle = 'Log in';\n\t\t\t$cookie = $this->Cookie->read('Auth.User');\n\t\t}\n }", "private function check_stored_login() {\n if(isset($_SESSION['admin_id'])) {\n $this->admin_id = $_SESSION['admin_id'];\n $this->username = $_SESSION['username'];\n $this->user_level = $_SESSION['user_level'];\n $this->last_login = $_SESSION['last_login'];\n }\n }", "public function login() {\r\n\r\n // signal any observers that the user has logged in\r\n $this->setState(\"login\");\r\n }", "public function store() {\n\t\t$_SESSION['puserauth'] = serialize($this);\n\t}", "public function storeSessionData() {}", "public function storeSessionData() {}", "private function assign_auth_values(){\n\t\t$is_authenticated = AuthManager::is_authenticated();\n\t\t$this->assign('batl_is_logged', $is_authenticated);\n\t\tif($is_authenticated && $this->is_db_available()){\n\t\t\t// check if logged in local server\n\t\t\t$this->assign('batl_is_admin', AuthManager::is_current_user_admin());\n\t\t\t$this->assign('batl_current_user', AuthManager::get_user_infos());\n\n\t\t}else{\n\t\t\t// check if logged in on FB\n\t\t\t/*$facebook_manager = new FacebookService();\n\t\t\t$batl_current_user = AuthManager::get_user_profile($facebook_manager);\n\t\t\t$this->assign('batl_current_user', $batl_current_user);\n\t\t\t$this->assign('fbloginouturl', AuthManager::get_loginout_url($facebook_manager,$batl_current_user));*/\n\t\t}\n\t}", "function storeAuth($login, $password)\n{\n$this->session->set(USER_LOGIN_VAR, $login);\n$this->session->set(USER_PASSW_VAR, $password);\n// Create a session variable to use to confirm sessions\n$hashKey = md5($this->hashKey . $login . $password);\n$this->session->set('login_hash', $hashKey);\n}", "function cafet_set_logged_user(User $user)\n {\n $_SESSION['user'] = serialize($user);\n }", "public function loginUser() {\n self::$isLoggedIn = true;\n $this->session->setLoginSession(self::$storedUserId, self::$isLoggedIn);\n $this->session->setFlashMessage(1);\n }", "public function store()\n\t{\n\t\t$user = $this->user->store( Input::all() );\n\t}", "public function touchLogin() {\n $this->last_login = date( 'Y-m-d H:i:s' );\n $this->save();\n }", "private function loginWithPostData() {\n \n $this->user_name = $this->connection->real_escape_string($_POST['user_name']); \n $checklogin = $this->connection->query(\"SELECT user_name, user_email, user_password_hash FROM users WHERE user_name = '\".$this->user_name.\"';\");\n \n if($checklogin->num_rows == 1) {\n \n $result_row = $checklogin->fetch_object();\n \n if (crypt($_POST['user_password'], $result_row->user_password_hash) == $result_row->user_password_hash) {\n \n /**\n * write user data into PHP SESSION [a file on your server]\n */\n $_SESSION['user_name'] = $result_row->user_name;\n $_SESSION['user_email'] = $result_row->user_email;\n $_SESSION['user_logged_in'] = 1;\n $_SESSION['user_name'] = $result_row->user_name;\n \n\t\t\t\t\t// session security\n $_SESSION['agent'] = $_SERVER['HTTP_USER_AGENT'] ;\n\t\t\t\t\t$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$_SESSION['count'] = 0; \n\t\t\t\t\t\t\t\t\t\t \n /**\n * write user data into COOKIE [a file in user's browser]\n */\n setcookie(\"user_name\", $result_row->user_name, time() + (3600*24*100));\n setcookie(\"user_email\", $result_row->user_email, time() + (3600*24*100));\n $this->user_is_logged_in = true;\n return true; \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false; \n } \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false;\n } \n }", "public function userinfo()\n {\n if($user = $this->Session->read('user')){\n if(!empty($this->request->data)){\n //update thong tin\n }\n $this->set('user', $user);\n }else{\n $this->redirect(array('action' => 'login', ''));\n }\n }", "protected function loadUserData()\n {\n $this->userData = ($this->session->userData?:[]) + $this->userDataTemplate;\n }", "public function complete_login()\n\t{\n\t\tif ($this->loaded())\n\t\t{\n\t\t\t// Update the number of logins\n\t\t\t$this->logins = $this->logins + 1;\n\n\t\t\t// Set the last login date\n\t\t\t$this->last_login = time();\n\n\t\t\t// Save the user\n\t\t\t$this->save();\n\t\t}\n\t}", "function loggedin() {\n $this->checkAccess('user',false,false);\n\n $template = new Template;\n $user = new User($this->db);\n\n //get user details\n $user->getByEmail($this->f3->get('SESSION.email'));\n $this->f3->set('user', $user);\n\n //get user followers\n $this->f3->set('followers', $user->getUserFollowers($this->f3->get('SESSION.cid'))[0]);\n\n //get user waiting position\n $this->f3->set('waitrank', $user->getUserWaitPosition($this->f3->get('SESSION.cid'))[0]);\n\n echo $template->render('header.html');\n echo $template->render('user/user.html');\n echo $template->render('footer.html');\n }", "function userLogin($userData)\n\t\t{\n\t\t\t//at first we are checking that the input value is username or email id\n\t\t\t$presenceChar = strpos($userData['username'],'@');\n\t\t\tif(empty($presenceChar))\n\t\t\t{\n\t\t\t\t$column_name = 'username';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$column_name = 'email_id';\n\t\t\t}\n\t\t\t//getting the password from database\n\t\t\t$userCreden = $this->manageContent->getValue_where('user_credentials','*',$column_name,$userData['username']);\n\t\t\tif(!empty($userCreden[0]))\n\t\t\t{\n\t\t\t\t//checking for password field\n\t\t\t\tif($userCreden[0]['password'] == md5($userData['password']))\n\t\t\t\t{\n\t\t\t\t\tif($userCreden[0]['status'] == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//setting cookie expiry time\n\t\t\t\t\t\tif($userData['loggedin_time'] == 'on')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cookie_exp_time = time() + (2*7*24*3600);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$cookie_exp_time = time() + (24*3600);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//creating the cookie\n\t\t\t\t\t\t$set_cookie = $this->createCookie('uid',$userCreden[0]['user_id'],$cookie_exp_time);\n\t\t\t\t\t\t//calculating total number of sign in\n\t\t\t\t\t\t$sign_in = $userCreden[0]['sign_in_count'] + 1;\n\t\t\t\t\t\t//getting last sign in ip\n\t\t\t\t\t\t$last_sign_in_ip = $this->manageUtility->getIpAddress();\n\t\t\t\t\t\t//updating the values\n\t\t\t\t\t\t$update1 = $this->manageContent->updateValueWhere(\"user_credentials\",\"sign_in_count\",$sign_in,\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\t$update2 = $this->manageContent->updateValueWhere(\"user_credentials\",\"last_sign_in_ip\",$last_sign_in_ip,\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\t$update1 = $this->manageContent->updateValueWhere(\"user_credentials\",\"date\",date(\"Y-m-d g:i:s\"),\"user_id\",$userCreden[0]['user_id']);\n\t\t\t\t\t\treturn array(1,'Login Successfull!!',$userCreden[0]['user_id'],$userCreden[0]['category']);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\treturn array(0,'You Have Been Deactivated By Admin.. Please Contact To The Admin!!');\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\treturn array(0,'Username or Password Is Incorrect!!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array(0,'Username or Password Is Incorrect!!');\n\t\t\t}\n\t\t\t\n\t\t}", "public static function saveUserSession(){\n\t\t$_SESSION['user']=self::$_leuser;\n\t}", "public function setUserToLoggedIn($result) {\n // this is dangerous and lazy but will be fine for the assignment.\n $_SESSION['is_logged_in'] = true;\n $_SESSION['user_id'] = $result->id;\n $_SESSION['username'] = $result->username;\n $_SESSION['membership'] = $result->membership;\n $_SESSION['avatar'] = $result->avatar;\n $_SESSION['created_at'] = $result->created_at;\n }", "private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\n }", "public function handleUserLogin($event) {\n //Log user login\n $activity = new Activity;\n $activity->activity_type = 'login';\n $activity->actor_id = $event->user->id;\n $activity->actor_type = 'user';\n $activity->activity_data = '';\n $activity->user_agent = $this->request->header('User-Agent');\n $activity->actor_ip = $this->request->ip();\n $activity->save();\n }", "private function userLoginData($data){\n $logDataModel = new Model_Jiafuyun_RegulatorLoginData();\n $filter = array(\n 'regulator_id' => $data['regulator_id'],\n 'login_name' => $data['login_name']\n );\n $info = $logDataModel->getByWhere($filter,'*');\n if(empty($info)){\n $log_data = array(\n 'regulator_id' => $data['regulator_id'],\n 'login_name' => $data['login_name'],\n 'times' => '1',\n 'last_visit_time' => $data['last_visit_time']\n );\n $logDataModel->insert($log_data);\n }else{\n $log_data = array(\n 'times' => ++$info['times']\n );\n $logDataModel->update($info['id'],$log_data);\n }\n }", "function user_loggedin(){\n\t$app = \\Jolt\\Jolt::getInstance();\n\tif( !$app->store('user') ){\n\t\treturn false;\n\t}\n\treturn true;\n//\t$app->redirect( $app->getBaseUri().'/login',!$app->store('user') );\n}", "function SubmitLoginDetails()\n\t{\n\t\t// Login logic is handled by Application::CheckAuth method\n\t\tAuthenticatedUser()->CheckAuth();\n\t}", "private function check_the_login(){\n \n if(isset($_SESSION['login_user'])){\n \n $this->login_user = $_SESSION['login_user'];\n $this->signed_in = true;\n \n }else{\n unset($this->login_user);\n $this->signed_in = false;\n }\n \n }", "public function login()\n {\n if ($this->UserManager_model->verifUser($_POST['user_id'], $_POST['user_password'])) {\n\n $arrUser = $this->UserManager_model->getUserByIdentifier($_POST['user_id']);\n $data = array();\n $objUser = new UserClass_model;\n $objUser->hydrate($arrUser);\n $data['objUser'] = $objUser;\n\n $user = array(\n 'user_id' => $objUser->getId(),\n 'user_pseudo' => $objUser->getPseudo(),\n 'user_img' => $objUser->getImg(),\n 'user_role' => $objUser->getRole(),\n );\n\n $this->session->set_userdata($user);\n redirect('/');\n } else {\n $this->signin(true);\n }\n }", "public function store_user_data() {\n\n\t\t$user = User::where('mobile_number', session('phone_number'))->where('type', 0)->get();\n\n\t\tif (count($user)) {\n\t\t\tflash_message('danger', trans('messages.driver.this_number_already_have_account_please_login'));\n\t\t\treturn redirect()->route('login');\n\t\t} else {\n\t\t\t$user = new User;\n\t\t\t$user->mobile_number = session('phone_number');\n\t\t\t$user->name = session('user_name');\n\t\t\t$user->type = 0;\n\t\t\t$user->password = bcrypt(session('password'));\n\t\t\t$user->country_code = session('country_code');\n\t\t\t$user->email = session('email_address');\n\t\t\t$user->status = \"1\";\n\t\t\t$user->save();\n\n\t\t\tif (Auth::guard()->attempt(['mobile_number' => session('phone_number'), 'password' => session('password')])) {\n\t\t\t\t$intended_url = session('url.intended');\n\t\t\t\tif ($intended_url) {\n\t\t\t\t\t//create new order use session values\n\t\t\t\t\tadd_order_data();\n\t\t\t\t\treturn redirect()->route($intended_url); // Redirect to intended url page\n\t\t\t\t} else {\n\t\t\t\t\treturn redirect()->route('search'); // Redirect to search page\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\treturn redirect()->route('login'); // Redirect to login page\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.73674154", "0.7208126", "0.71686655", "0.684174", "0.6811378", "0.6801145", "0.6751898", "0.6749616", "0.66948164", "0.6678967", "0.66297394", "0.6623948", "0.66115767", "0.6606006", "0.6583988", "0.6559912", "0.6538077", "0.65242577", "0.64872897", "0.6446742", "0.6444684", "0.641891", "0.6417268", "0.64097923", "0.63928246", "0.6379959", "0.6370825", "0.6368832", "0.6368321", "0.63666797" ]
0.75702024
0
Method 1 Gets all of the products
public function getAll() { return $this->products; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function all(){\n \t\t$response = $this->curl->get( $this->api_url, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\n \t\tif( $response->success ){\n \t\t\t$products = [];\n\t\t\tforeach ($response->products as $product) {\n\t \t\t\t$tmp = new Product( $this );\n\t \t\t\t$tmp->fetch($product);\n\t \t\t\t$products[] = $tmp;\n\n\t \t\t\treturn $products;\n\t \t\t}//foreach\n \t\t}//if\n \t\telse{\n \t\t\t// Throw error according to status\n \t\t}//else\n\n \t}", "public function products()\n {\n //$products = $api->getAllProducts();\n //var_dump($products);\n // TODO save products to database\n }", "public function getAllProducts(){\r\n\t\t//viet cau sql\r\n\t\t$sql =\"SELECT * FROM products\";\r\n\t\t//thuc thi cau truy van\r\n\t\t$obj = self::$conn->query($sql);\r\n\t\treturn $this->getData($obj);\r\n\t}", "public function getProducts() {\n\t\treturn $this->requester->request('GET', $this->url);\n\t}", "public function GetProducts() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM products\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function getAllProducts() {\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][field]=category_id&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][value]=25&\";\n $searchCondition .= \"searchCriteria[filter_groups][0][filters][0][condition_type]=eq&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][field]=sku&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][value]=%25case%25&\";\n $searchCondition .= \"searchCriteria[filter_groups][1][filters][0][condition_type]=nlike\";\n\n $this->products = $this->cUrlRequest($this->url . '/rest/V1/products?fields=items[name,price,custom_attributes,sku]&'.$searchCondition.'&searchCriteria[pageSize]=' . $this->items, $this->getToken());\n\n return $this->products;\n }", "public function getAllproducts() {\r\n\r\n\t\t$res = $this->db->get('items');\r\n\r\n\t\treturn $res->result();\r\n\t}", "public function getAllProducts()\n {\n return $this->productRepository->all();\n }", "public function getProducts(){\r\n\t\t$query = \"Select * from products\";\r\n\t\treturn $GLOBALS['dbObj']->dbQuery($query);\r\n\t}", "public function get_all_productes() \r\n\t{\r\n\t\t$res=mysql_query(\"select * from products\") or die(mysql_error());\r\n\t\treturn $res;\r\n\t}", "private function loadAll() {\n\n return $this->search->getProducts();\n\n }", "protected function getAllProducts()\r\n {\r\n \r\n // Enter the query into the Data Access Layer\r\n $sql = \"SELECT * from tbl_products\";\r\n \r\n // Make a connection anjd run the query on the SQL statement\r\n $results = $this->connect->query($sql);\r\n \r\n // Get the number of rows that were returned\r\n $numRows = $results->num_rows;\r\n \r\n // Return results only of the number of rows is greater than zero\r\n if ($numRows > 0) {\r\n // Pass the results of the query to the next class\r\n return $results;\r\n } else {\r\n echo \"Could not find products\";\r\n }\r\n }", "public function productRetrieveAll(){\n\t\t$productId\t\t\t=\tself::getUserId();\n\t\t$productTable\t\t=\tself::getUserTable();\n\t\t$joinTable\t\t\t=\tself::getJoinTable();\n\t\t$productArray\t\t=\tself::getUserArray(); //multi dimension array output\t\t\n\t\t$dbFieldArray\t\t=\tarray();\n\t\tforeach($productArray as $prodIndex => $prodVal){\n\t\t\t$dbFieldArray[]\t=\t$productArray[$prodIndex][0]; //Get db fields only from multi dimension array\n\t\t}\t\t\n\t\t$productCond\t\t=\tself::getUserCond();\t\t\n\t\t$retArray\t\t\t=\tself::retrieveEntry($productTable, $dbFieldArray, $joinTable,$productCond);\n\t\t$returnValue \t\t= \tarray();\t\t\t \t \n\t\tforeach ($retArray as $retIndex => $retValue) {\n $$retIndex \t\t= \t$retValue;\n $mainArr \t\t=\texplode('|', $$retIndex);\t\t\t\n\t\t\t$returnValue[] \t= \t$mainArr;\t\t\t\t\t\t \n }\n\t\treturn $returnValue;\n\t}", "function products_get() {\n\n $products = $this->api_model->get_products();\n\n if(isset($products))\n {\n $this->response(array('status' => 'success', 'message' => $products));\n }\n else\n {\n $this->response(array('status' => 'failure', 'message' => 'The specified product could not be found'), REST_CONTROLLER::HTTP_NOT_FOUND);\n }\n\n\t}", "public function getAllProduct()\n {\n //eager loading of \"product\" with \"category\"\n return Product::with('category')\n ->orderBy('title')\n ->get();\n }", "public function getAllProducts(){\r\n\t\treturn $this->query(\"SELECT * FROM beer\");\r\n\t}", "public function getProductList()\n {\n return $this->with('images','manufacturer', 'category')->get();\n }", "public function index() {\n\t\treturn $this->product->all();\n\t}", "public function getProducts()\n {\n return $this->products;\n }", "public function allProducts()\r\n {\r\n // left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n // left join mshop_media as mm on mm.id = mpl.refid\r\n // left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n // where mpl.pos = 0 and mpl.domain in ('media','price')\";\r\n $qry1 = \"select mp.id as product_id, mp.code as product_code, mp.label as product_name, mm.preview as image_url from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left join mshop_media as mm on mm.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('media')\";\r\n $qry2 = \"select mp.id as product_id, mp.label as product_name, mpri.value as product_price from mshop_product as mp \r\n left join mshop_product_list as mpl on mpl.parentid = mp.id \r\n left JOIN mshop_price as mpri on mpri.id = mpl.refid\r\n where mpl.pos = 0 and mpl.domain in ('price')\";\r\n $products1 = DB::select($qry1);\r\n $products2 = DB::select($qry2); \r\n $i = 0;\r\n foreach($products1 as $products) {\r\n foreach($products2 as $product) {\r\n if($product->product_id === $products->product_id) {\r\n $products1[$i]->product_price = $product->product_price;\r\n }\r\n }\r\n $i++;\r\n }\r\n return $products1;\r\n }", "public function getProductList(){\n\n $productModel = new ProductModel();\n $products = $productModel->getProductList();\n $this->JsonCall($products);\n }", "function getProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/product.json' , $params ),true);\n\t}", "public function getProducts() {\n\t\t$baseUrl = 'https://'.$this->apiKey.':'.$this->password.'@'.$this->domain.'.myshopify.com';\n\t\t$request = '/admin/products.json';\n\t\t$method = 'GET';\n\n\t\t$result = $this->curl($baseUrl.$request, $method);\n\n\t\t$products = array();\n\t\tforeach($result->products as $shopify) {\n\t\t\tforeach($shopify->variants as $variant) {\n\t\t\t\t// need to make a class Product in this folder?\n\t\t\t\t$product = new stdClass;\n\t\t\t\t$product->id \t\t= $shopify->id;\n\t\t\t\t$product->sku \t\t= $variant->sku;\n\t\t\t\t$product->name \t\t= $shopify->title;\n\t\t\t\t$product->price \t= $variant->price;\n\t\t\t\t$product->quantity \t= $variant->inventory_quantity;\t\n\t\t\t\tarray_push($products, $product);\n\t\t\t}\n\t\t}\n\n\t\treturn $products;\n\t}", "public function getAllProducts()\n {\n\n $query = $this->db->get_where('products', array('pro_status' => 1));\n return $query->result();\n }", "public function getProducts() \n {\n return $this->_products;\n }", "function allproducts_get()\n\t{\n\t\t$is_exists=$this->user_model->get_joins('products',array('is_product'=>'Y'),'',array('catg_id','child_id','prod_detail','description','size','unit','mrp'));\n\t\t//print_r($is_exists);exit('u');\n\t\tif(!empty($is_exists))\n\t\t{\n\t\t\t$this->response(array('status'=>'true','message'=>$is_exists));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response(array('status'=>'false','message'=>'No Product Found'),REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }", "public function getProducts()\n {\n return $this->products;\n }" ]
[ "0.81696516", "0.81120527", "0.8005276", "0.8001242", "0.7997505", "0.79428405", "0.7914478", "0.7901616", "0.7893354", "0.7839842", "0.78044814", "0.7795148", "0.77912706", "0.77805644", "0.7755827", "0.77486175", "0.7741932", "0.76980555", "0.76965535", "0.76795655", "0.7664501", "0.76639444", "0.7658262", "0.762381", "0.76135397", "0.7597741", "0.75958514", "0.75958514", "0.75958514", "0.75958514" ]
0.81549287
1
Get the callback URL.
public function getCallbackUrl() { return $this->callback_url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCallbackUrl()\r\n {\r\n return $this->callback_url;\r\n }", "public function get_callback_url(){\n\t\treturn $this->callback_url;\n\t}", "public function getCallbackUrl()\n {\n return $this->getParameter('callbackUrl');\n }", "public function getCallbackUrl()\n {\n return $this->callbackUrl;\n }", "public function getHttpCallbackUrl()\n {\n return $this->httpCallbackUrl;\n }", "public function getApiCallback()\n {\n return $this->_callbackurl;\n }", "public function getCallbackUri()\n {\n if (array_key_exists(\"callbackUri\", $this->_propDict)) {\n return $this->_propDict[\"callbackUri\"];\n } else {\n return null;\n }\n }", "public static function callback_url() {\n global $CFG;\n\n return new moodle_url('/admin/oauth2callback.php');\n }", "public function getCallbackUrl(): ?string\n {\n return $this->callback_url;\n }", "public function getLocalCallbackUrl(): string\n {\n return $this->getIntegrationSetup()->getLocalCallbackUrl();\n }", "private function getCallbackURL()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'ssl://sandbox.payfast.co.za';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'ssl://www.payfast.co.za';\n\t\t}\n\t}", "public function getCallBackUrl()\r\n {\r\n \r\n }", "private function getProcessCallbackUrl()\n {\n return Context::getContext()->link->getModuleLink('doofinder', 'callback', []);\n }", "private function get_redirect_uri() {\n\t\treturn self::OAUTH2_CALLBACK_URI;\n\t}", "public function callBackUrl()\r\n\t{\r\n\t\treturn Mage::getUrl('ezloginlite/social/callBack');\r\n\t}", "public function getUrl() {\n\t\t//$url = \"https://www.facebook.com/dialog/oauth?client_id=\".$this->appId.\"&redirect_uri=\".$this->redirectUrl.\"&scope=\".$this->permission.\"&state=\".$_SESSION['state'];\n\t\treturn $this->redirectUrl;\n\t}", "private function getCallbackUrl($provider)\n {\n return $this->url->getUrl('clean_checkout/social/authenticate', ['_query' => ['provider' => $provider]]);\n }", "public function getCallback() {\r\n\t\treturn $this->options ['callback'];\r\n\t}", "public static function getAuthUrl() {\n $queryString = http_build_query(\n array( 'client_id' => self::CLIENT_ID,\n 'response_type' => 'code',\n 'redirect_uri' => self::getAbsoluteUrl(array(\n 'controller' => 'oauth',\n 'action' => 'callback',\n 'service' => self::TYPE\n ))\n ));\n $url = self::OAUTH_URL . '?' . $queryString;\n return $url;\n }", "function cjpopups_callback_url($callback = null){\n\t$text_domain = cjpopups_item_info('text_domain');\n\t$callback = (isset($_GET['callback']) && is_null($callback)) ? $_GET['callback'] : $callback;\n\tif(!is_null($callback)){\n\t\treturn admin_url('admin.php?page=').cjpopups_item_info('page_slug').'&callback='.$callback;\n\t}else{\n\t\treturn admin_url('admin.php?page=').cjpopups_item_info('page_slug');\n\t}\n}", "public static function get_webhook_url() {\n\t\treturn add_query_arg( 'wc-api', 'wc_stripe', trailingslashit( get_home_url() ) );\n\t}", "public function getConnectUrl() {\n return $this->redirect_url;\n }", "private function getRedirectUrl()\n {\n return $this->getConfigData('url');\n }", "function getRedirectUri(){\n\n\t//Building Redirect URI\n\t$url = $_SERVER['REQUEST_URI']; //returns the current URL\n\tif(strrpos($url, '?') > 0)\n\t\t$url = substr($url, 0, strrpos($url, '?') ); // Removing any parameters.\n\t$folder = substr($url, 0, strrpos($url, '/') ); // Removeing current file.\n\treturn (isset($_SERVER['HTTPS']) ? \"https\" : \"http\") . '://' . $_SERVER['HTTP_HOST'] . $folder. '/oauth2callback.php';\n}", "public static function getURL()\r\n {\r\n $url = 'https://accounts.google.com/o/oauth2/auth?client_id=' . self::$details['client_id'] . '&redirect_uri=' . self::$details['redirect'] . '&scope=https://www.google.com/m8/feeds/&response_type=code';\r\n return $url;\r\n }", "public function getUrl() {\n\t\t$this->getRublon()->log(__METHOD__);\n\t\treturn $this->getRublon()->getAPIDomain() .\n\t\t\tself::URL_PATH_CODE .\n\t\t\turlencode($this->getUrlParamsString());\n\t}", "public function getLoginUrl() {\n $url = CURL::urljoin($this->authorization_uri, array(\n 'client_id' => $this->client_id,\n 'scope' => $this->scope,\n 'response_type' => 'code',\n 'redirect_uri' => $this->getConnectUrl(),\n 'state' => $this->state,\n 'display' => 'popup',\n ));\n return $url;\n }", "protected abstract function getButtonCallbackURL();", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public function getRedirectUrl();" ]
[ "0.88661367", "0.88076216", "0.8790226", "0.87749624", "0.8446361", "0.83191365", "0.8318206", "0.8218329", "0.81984675", "0.78449905", "0.783785", "0.7441816", "0.71991843", "0.71917504", "0.71099615", "0.70998627", "0.7082508", "0.7081698", "0.7004788", "0.69278646", "0.6861956", "0.6859239", "0.68561447", "0.6828285", "0.6808953", "0.6801598", "0.67784554", "0.6749124", "0.6747263", "0.6743243" ]
0.8867966
0
/ oracle_login: void > void purpose: expects nothing and returns nothing but has the side effect of building an html login form by Marcellus Parley last modified 20180426
function oracle_login() { ?> <form action="<?= htmlentities($_SERVER['PHP_SELF'], ENT_QUOTES) ?>" method="post"> <fieldset> <legend> Oracle Login </legend> <div class="username_pass"> <label for="username_fld"> Username: </label> <input type="text" name="db_user" id="username_fld" required="required" /> <br /> <label for="password_fld"> Password: </label> <input type="password" name="db_pass" id="password_fld" required="required" /> </div> <input type="submit" name="login-button" value="Log in" /> </fieldset> </form> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\n\t\t// TODO: pull this from a config area\n\t\t$server = 'localhost';\n\t\t$port = '10389';\n\t\t$default_dn = 'cn=William Bush,ou=people,o=sevenSeas';\n\t\t$tpl->assign('server', $server);\n\t\t$tpl->assign('port', $port);\n\t\t$tpl->assign('default_dn', $default_dn);\n\t\t\n\t\t// display login form\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_ldap.tpl');\n\t}", "private function genLogin()\n {\n ob_start(); ?>\n <form name=\"login\" action=\"./\" method=\"post\">\n <fieldset class=\"uk-fieldset\">\n <legend class=\"uk-legend\">[[legend]]</legend>\n <div class=\"uk-margin\">\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: user\"></span>\n <input class=\"uk-input\" type=\"text\" name=\"username\" value=\"[[value_username]]\"\n placeholder=\"[[placaholder_username]]\">\n </div>\n </div>\n <div class=\"uk-margin-small-bottom\">\n <div class=\"uk-inline\">\n <span class=\"uk-form-icon\" uk-icon=\"icon: lock\"></span>\n <input class=\"uk-input\" type=\"password\" name=\"password\" placeholder=\"[[placaholder_password]]\">\n </div>\n </div>\n <div class=\"uk-margin-bottom\">\n <input type=\"hidden\" name=\"action\" value=\"login\">\n <button class=\"uk-button uk-button-default\">[[submit_text]]</button>\n </div>\n </div>\n <p>[[register_text]] <span uk-icon=\"icon: link\"></span>\n <a href=\"../registration/\">[[register_link]]</a></p>\n </fieldset>\n </form>\n <?php return ob_get_clean();\n }", "abstract protected function doLogin();", "function renderLoginForm() {\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t\n\t\t// add translations for calls from classes that aren't Page Extensions (mobile plugin, specifically)\n\t\t$translate = DevblocksPlatform::getTranslationService();\n\t\t$tpl->assign('translate', $translate);\n\t\t\n\t\t@$redir_path = explode('/',urldecode(DevblocksPlatform::importGPC($_REQUEST[\"url\"],\"string\",\"\")));\n\t\t$tpl->assign('original_path', (count($redir_path)==0) ? 'login' : implode(',',$redir_path));\n\t\t\n\t\t$tpl->display('file:' . dirname(dirname(__FILE__)) . '/templates/login/login_form_default.tpl');\n\t}", "function m_loginForm()\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_block(\"TPL_USER_FILE\",\"TPL_MSG_BLK\",\"msg_blk\");\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_var(\"TPL_VAR_MSG\",\"\");\n\t\t$this->ObTpl->set_var(\"msg_blk\",\"\");\n\t\t$formUrl1=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.checkLogin\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FORMURL1\",$formUrl1);\n\t\n\t\t$formUrl2=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.emailPass\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_FORMURL2\",$formUrl2);\t\n\n\t\t$signupUrl=$this->libFunc->m_safeUrl(SITE_URL.\"user/index.php?action=user.signupForm\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SIGNUPURL\",$signupUrl);\t\n\t\t\n\t\t#defining Language Variables.\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CUSTOMERLOGIN\",LANG_CUSTOMERLOGIN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_NOTREGISTERED\",LANG_NOTREGISTERED);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_EMAILADDRESS\",LANG_EMAILADDRESS);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_PASSWORD\",LANG_PASSWORD);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_LOSTPASSWORD\",LANG_LOSTPASSWORD);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_CUSTOMERLOGIN\",LANG_CUSTOMERLOGIN);\n\t\t$this->ObTpl->set_var(\"LANG_VAR_SENDPASSWORD\",LANG_SENDPASSWORD);\n\t\tif($this->request[\"mode\"] == \"tc\"){\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_TRADE_REGISTER);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\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\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\n\t\tif(isset($this->request['msg']) && $this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_PASS_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\telseif(isset($this->request['msg']) && $this->request['msg']==2)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_PASS_NOSENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\telseif(isset($this->request['msg']) && $this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",\"Password Changed.\");\n\t\t\t$this->ObTpl->parse(\"msg_blk\",\"TPL_MSG_BLK\");\n\t\t}\n\t\tif(!isset($_COOKIE['email']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_EMAIL\",'email address');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_EMAIL\",$_COOKIE['email']);\n\t\t}\n\n\t\tif(!isset($_COOKIE['password']))\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PASS\",'password');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_PASS\",$_COOKIE['password']);\n\t\t}\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_USER_FILE\"));\n\t}", "public function loginForm(){\n self::$loginEmail = $_POST['login-email'];\n self::$loginPassword = $_POST['login-password'];\n \n self::sanitize();\n $this->tryLogIn();\n }", "function FormLogin()\n\t{\n\t\t?>\n\t\t\t<!DOCTYPE html>\n\t\t\t<html>\n\t\t\t<head>\n\t\t\t\t<title>Login</title>\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<form method=\"post\" action=\"\">\n\t\t\t\t\t<input type=\"text\" name=\"username\" placeholder=\"Username\" required autofocus>\n\t\t\t\t\t<input type=\"password\" name=\"password\" placeholder=\"Password\" required>\n\t\t\t\t\t<input type=\"submit\" name=\"login\" value=\"Login\">\n\t\t\t\t</form>\n\t\t\t</body>\n\t\t\t</html>\n\t\t<?php\n\t}", "function _genLogin()\n {\n $this->mismatch = false;\n if (isset($_POST['login']) && $this->_verify() == \"\") {\n $this->name_post = $_POST['gebruikersnaam'];\n $this->pass_post = $_POST['wachtwoord'];\n\n $this->_getFromGebruikersDb($this->name_post);\n if ($this->_isMatch()) {\n $_SESSION['ingelogd'] = true;\n //toegevoegd door rens om een gebruikersnaam en rol te krijgen\n $_SESSION['gebruikersnaam'] = $this->name_post;\n $_SESSION['Rol'] = $this->role_db;\n header('location: Login_Redir.php');\n }\n }\n }", "public function processLogin(): void;", "private function login(){\n \n }", "function displayLogin($a_omit_minit = false, $a_omit_cinit = false)\n\t{\n\t\tglobal $lng;\n\t\t$this->tpl->setVariable(\"SETUP_LOGIN_CLASS\", \" ilSetupLogin\");\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.std_layout.html\", \"setup\");\n\n\t\tif ($a_omit_minit)\n\t\t{\n\t\t\t$m_form = $this->form->getHTML();\n\t\t}\n\t\tif (!$a_omit_cinit)\n\t\t{\n\t\t\t$this->initClientLoginForm();\n\t\t}\n\t\t$cl_form = $this->form->getHTML();\n\t\tif (!$a_omit_minit)\n\t\t{\n\t\t\t$this->initMasterLoginForm();\n\t\t\t$m_form = $this->form->getHTML();\n\t\t}\n\t\t$this->tpl->setVariable(\"SETUP_CONTENT\", $cl_form.\"<br>\".$m_form);\n\t\t$this->tpl->setVariable(\"TXT_HEADER\", $lng->txt(\"login\"));\n\t}", "public function getFormLoginPage();", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function login();", "public function login();", "public function loginForm()\n {\n // If already logged in, redirect appropriately\n if ($this->custLoggedIn())\n {\n $this->redirect(\"mainPageCust.php\");\n } elseif ($this->ownerLoggedIn())\n {\n $this->redirect(\"mainPageOwner.php\");\n }\n \n // prepare errors to display if there are any\n $error = array();\n if (!empty($_GET['error']))\n {\n $error_string = urldecode($_GET['error']);\n $error = explode(',', $error_string);\n }\n \n // here the login form view class is loaded and method printHtml() is called \n require_once('views/FormError.class.php');\n require_once('views/LoginForm.class.php');\n $site = new SiteContainer($this->db);\n $form = new LoginForm();\n $error_page = new FormError();\n $site->printHeader();\n $site->printNav();\n $error_page->printHtml($error);\n $form->printHtml();\n $site->printFooter();\n \n }", "function Login()\n{\n\tglobal $txt, $context;\n\n\t// You're not a guest, why are you here?\n\tif (we::$is_member)\n\t\tredirectexit();\n\n\t// We need to load the Login template/language file.\n\tloadLanguage('Login');\n\tloadTemplate('Login');\n\twetem::load('login');\n\n\t// Get the template ready.... not really much else to do.\n\t$context['page_title'] = $txt['login'];\n\t$context['default_username'] =& $_REQUEST['u'];\n\t$context['default_password'] = '';\n\t$context['never_expire'] = false;\n\t$context['robot_no_index'] = true;\n\n\t// Add the login chain to the link tree.\n\tadd_linktree($txt['login'], '<URL>?action=login');\n\n\t// Set the login URL - will be used when the login process is done (but careful not to send us to an attachment).\n\tif (isset($_SESSION['old_url']) && strpos($_SESSION['old_url'], 'dlattach') === false && strhas($_SESSION['old_url'], array('board=', 'topic=', 'board,', 'topic,')))\n\t\t$_SESSION['login_url'] = $_SESSION['old_url'];\n\telse\n\t\tunset($_SESSION['login_url']);\n}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "function login() {\n\n\techo '<h1 id=\"loginwarning\">Welcome Guest</h1>\n\t\t\t<form action=\"'. $_SERVER['PHP_SELF'] .'\" method=\"post\">\n\t\t\t\t<fieldset>\n\t\t\t\t\tUsername: <input type=\"text\" name=\"login\" />\n\t\t\t\t\t<input type=\"submit\" value=\"Login\" class=\"button\" onclick=\"return validateLoginDetails(this.form.login.value)\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>';\n\n}", "public function login() {\n $this->FormHandler->setRequired('employeeCode');\n $this->FormHandler->setRequired('employeePassword');\n\n\n if ($this->FormHandler->run() === true) {\n $employeeCode = $this->FormHandler->getPostValue('employeeCode');\n $employePassword = $this->FormHandler->getPostValue('employeePassword');\n if ($this->User->checkLoginCredentials($employeeCode, $employePassword) === true) {\n // Log them in and redirect\n $this->User->loginClient($_SESSION, $employeeCode);\n redirect('employee/dashboard');\n }\n }\n else if ($this->User->checkIfClientIsLoggedIn($_SESSION) === true) {\n redirect('employee/dashboard');\n }\n\n loadHeader();\n include APP_PATH . '/view/user/login.php';\n loadFooter();\n }", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function getLoginForm();", "static function displayLogInUser()\n {\n echo \"<div class='col-xs-6'><h1>Log Into Account</h1>\";\n echo \"<form role='form' method='post' action='login.php'>\";\n echo \"<label for='loginUser'>Username: </label>\";\n echo \"<input type='text' class='form-control' id='loginUser' name='usr' required>\";\n echo \"<label for='loginPass'>Password: </label>\";\n echo \"<input type='password' class='form-control' id='loginPass' name='pwd' required>\";\n echo \"<input type='hidden' name='action' value='login'><input type='submit' class='btn btn-default'>\";\n echo \"</form></div>\";\n }", "function _renren_login_form() {\n global $RR_config, $user;\n //$backurl = url('user', array('absolute' => true));\n $xd_receiver = url(\"user/renren_receiver\", array('absolute' => true));\n return\n '<xn:login-button autologoutlink=\"true\"></xn:login-button>\n <script type=\"text/javascript\" src=\"http://static.connect.renren.com/js/v1.0/FeatureLoader.jsp\"></script>\n <script type=\"text/javascript\">\n XN_RequireFeatures([\"EXNML\"], function()\n {\n XN.Main.init(\"'.$RR_config->APIKey.'\", \"'.$xd_receiver.'\");\n });\n </script>';\n}", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function webtestLogin() {\n //$this->open(\"{$this->sboxPath}user\");\n $password = $this->settings->adminPassword;\n $username = $this->settings->adminUsername;\n // Make sure login form is available\n $this->waitForElementPresent('edit-submit');\n $this->type('edit-name', $username);\n $this->type('edit-pass', $password);\n $this->click('edit-submit');\n $this->waitForPageToLoad('30000');\n }", "function login_form() { \n\t$output = <<<END\n\t<h1>Stuff</h1>\n\t<form name=\"login-form\" class=\"login-form\" action=\"sf-login.php\" method=\"post\">\n\t\t<fieldset>\n\t\t\t<legend>Secure Login</legend>\n\t\t\t<div class=\"login-field above-below15 above30 clear\">\n\t\t\t\t<label for=\"user\" class=\"placeholder active\">Username</label>\n\t\t\t\t<input type=\"text\" name=\"user\" id=\"user\" tabindex=\"1\" class=\"av-text\" value=\"\">\n\t\t\t</div>\n\t\t\t<div class=\"login-field above-below15\">\n\t\t\t\t<label for=\"pass\" class=\"placeholder \">Password</label>\n\t\t\t\t<input type=\"password\" name=\"pass\" id=\"pass\" tabindex=\"2\" class=\"av-password\" value=\"\">\n\t\t\t</div>\n\t\t\t<input type=\"submit\" value=\"sign in\" class=\"button float-left no-transform\" tabindex=\"3\">\n\t\t\t<label for=\"stay-signed-in\">stay signed in</label>\n\t\t\t<input type=\"checkbox\" title=\"Select to stay signed in 7 days\" name=\"stay-signed-in\" id=\"stay-signed-in\" value=\"1\" tabindex=\"9\">\\n\nEND;\n\tforeach( $_GET as $k => $v ) {\n\t\t$output .= \"\\t\\t\\t\" . '<input type=\"hidden\" name=\"' . $k . '\" value=\"' . $v . '\" />' . \"\\n\";\n\t}\n\t$output .= \"\\t\\t</fieldset>\\n\\t</form>\\n\\t\";\n\t$output .= '<p class=\"back\">';\n\t$output .= '<a href=\"' . HOME . '\">&larr; Home</a></p>';\n\treturn $output;\n}", "protected function outputLoginFormIfNotAuthorized() {}", "function login_code($quiet)\n{\n\t//return value of 1 means don't do anything else\n\t\t//the login script has closed the fence for some reason\n\tglobal $mysql_db, $config;\n\t#TODO : produce the div tags when quiet=1 and output is actually produced\n\tif ($quiet == 0)\n\t{\n\t\t//this div includes login, logout, and change password widgets\n\t\techo \"<div id=\\\"login_control\\\">\\n\";\n\t}\n\t$retv = 0;\n\tif (!(array_key_exists(\"HTTPS\", $_SERVER)))\n\t{\n\t\t$_SERVER[\"HTTPS\"] = \"off\";\n\t}\n\t\n\tif (($_SERVER[\"HTTPS\"] != \"on\") && ($config['require_https'] == 1))\n\t{\n\t\techo \"HTTPS is required<br >\\n\";\n\t\t$retv = 1;\n\t}\n\n\tif (($_POST[\"action\"] == \"create_user\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$attempt_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t\t\n\t\t\tif (isset($_POST[\"email\"]))\n\t\t\t{\n\t\t\t\t$attempt_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t\t\tif (isset($_POST[\"pass2\"]))\n\t\t\t\t{\n\t\t\t\t\t$attempt_pass1 = $mysql_db->real_escape_string($_POST[\"pass2\"]);\n\t\t\t\t\tif (isset($_POST[\"pass3\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$attempt_pass2 = $mysql_db->real_escape_string($_POST[\"pass3\"]);\t\t\t\t\t\t\n\t\t\t\t\t\tif ($attempt_pass1 != $attempt_pass2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"Passwords do not match!<br>\\n\";\n\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (($attempt_pass1 != '') && \n\t\t\t\t\t\t\t\t($attempt_username != '') &&\n\t\t\t\t\t\t\t\t($attempt_email != ''))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (attempt_registration($attempt_username, $attempt_email, $attempt_pass1)==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"Failed to register<br>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"Registered successfully<br>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\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\n\t//If chain to determine what to do\n\tif (($_POST[\"action\"] == \"register\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$previous_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_username = \"\";\n\t\t}\n\t\tif (isset($_POST[\"email\"]))\n\t\t{\n\t\t\t$previous_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_email = \"\";\n\t\t}\n\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"create_user\\\">\\n\" .\n\t\t\t\t\t\"\tUsername: <input type=\\\"text\\\" name=\\\"username\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tEmail: <input type=\\\"text\\\" name=\\\"email\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t}\n\telse if ($_POST[\"action\"] == \"login\")\n\t{\t//retrieve submitted username and password, if applicable\n\t\t$username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t$passworder = $mysql_db->real_escape_string($_POST[\"password\"]);\n\t\n\t\t$_SESSION['username'] = $username;\n\t}\n\telse if ($_POST[\"action\"] == \"logout\")\n\t{\n\t\techo \"Logout<br>\\n\";\n\t\tunset($_SESSION['username']);\n\t\tunset($_SESSION['password']);\n\t}\n\telse if ($_POST[\"action\"] == \"change_pass\")\n\t{\n\t\t$retv = 1;\n\t\tif ($quiet == 0)\n\t\t{\n\t\t\t#TODO : create button to change mind on changing password\n\t\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"apply_pass\\\">\\n\" .\n\t\t\t\t\t\"\tOld password: <input type=\\\"password\\\" name=\\\"pass1\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t}\n\telse if ($_POST[\"action\"] == \"apply_pass\")\n\t{\n\t\t$oldpass = $mysql_db->real_escape_string($_POST['pass1']);\n\t\t$newpass = $mysql_db->real_escape_string($_POST['pass2']);\n\t\t$passmatch = $mysql_db->real_escape_string($_POST['pass3']);\n\t\tif ($newpass == $passmatch)\n\t\t{\n\t\t\t$uid = $_SESSION['user']['emp_id'];\n\t\t\tcontacts::store_user_pword($uid, $oldpass, $newpass);\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<h3>Passwords do not match</h3><br >\\n\";\n\t\t}\n\t}\n\n\t#logic for logging in and normal activity\n\tif (isset($_SESSION['username']))\n\t{\n\t\t$query = \"SELECT * FROM contacts WHERE username='\" . $_SESSION['username'] . \"' LIMIT 1;\";\n\t\t$results = $mysql_db->query($query);\n\t\tif ($results)\n\t\t{\n\t\t\t$row = $results->fetch_array(MYSQLI_BOTH);\n\t\t\t#TODO : more testing of the failed login logic\n\t\t\tif ($row['fail_logins'] >= $config['max_fail_logins'])\n\t\t\t{\t//TODO: set time period for waiting to login\n\t\t\t\techo \"Failed login too many times error<br>\\n\";\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t}\n\t\t\t\n\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t{\n\t\t\t\t//check to see if the password matches and the stretching does not match\n\t\t\t\t//this piece allows the stretching value to be changed at any given time\n\t\t\t\t//the only drawback is the password is hashed twice when the user logs in\n\t\t\t\t//in order to change the stretching value\n\t\t\t\t$temp = hash_password($passworder, $row['salt'], $row['stretching']);\n\t\t\t\tif ( ($row['password'] == $temp) && ($row['stretching'] != $config['key_stretching_value']) )\n\t\t\t\t{\t//password is good, key stretching needs to be fixed\n\t\t\t\t\tcontacts::mod_user_pword($row['emp_id'], $passworder);\n\t\t\t\t\t$fquery = \"SELECT * From contacts WHERE username='\" . $_SESSION['username'] . \"'LIMIT 1;\";\n\t\t\t\t\t$fresults = $mysql_db->query($fquery);\n\t\t\t\t\tif ($fresults)\n\t\t\t\t\t{\n\t\t\t\t\t\t$row = $fresults->fetch_array(MYSQLI_BOTH);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t//this should never happen\n\t\t\t\t\t\tthrow new Exception(\"Failed to reformat password\");\n\t\t\t\t\t}\n\t\t\t\t\t$temp = hash_password($passworder, $row['salt'], $config['key_stretching_value']);\n\t\t\t\t\t$row['password'] = $temp;\n\t\t\t\t}\n\n\t\t\t\t$_SESSION['password'] = $temp;\n\t\t\t}\n\t\t\tif (($row['password'] == $_SESSION['password']) && isset($_SESSION['password']) && ($_SESSION['password'] <> \"\"))\n\t\t\t{\t#successful login\n\t\t\t\t#TODO : limit the number of valid sessions for users? create a valid session table?\n\t\t\t\t$_SESSION['user'] = $row;\n\t\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t\t{\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_pass_change=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_logins=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t}\n\t\t\t\tif ($quiet == 0)\n\t\t\t\t{\n\t\t\t\t\techo \"<h3>Welcome \";\n\t\t\t\t\techo print_contact($_SESSION['user']['emp_id']);\n\t\t\t\t\techo \"</h3>\\n\";\n\t\t\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"logout\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Logout\\\">\\n\" .\n\t\t\t\t\t\t \"</form>\\n\";\n\t\t\t\t\tif ($_POST[\"action\"] != \"change_pass\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo\t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"change_pass\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"</form>\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t//password fail match\n\t\t\t\t$query = \"UPDATE contacts SET fail_logins=fail_logins+1 WHERE username = \" . $_SESSION['username'] . \";\";\n\t\t\t\t$mysql_db->query($query);\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t\tinvalid_username_password();\n\t\t\t\t$retv = 1;\n\t\t\t}\n\t\t\t$results->close();\n\t\t}\n\t\telse\n\t\t{\t//contact not found\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tinvalid_username_password();\n\t\t\t$retv = 1;\t\n\t\t}\n\t}\n\telse\n\t{\n\t\tlogin_button();\n\t\tif ($config['allow_user_create']=1)\n\t\t{\n\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"register\\\">\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t\t$retv = 1;\n\t}\n\n\tif ($quiet == 0)\n\t{\n\t\techo \"</div>\\n\";\n\t}\t\n\n\treturn $retv;\n}", "function login() {\n $this->checkAccess('user',true,true);\n\n\n $template = new Template;\n echo $template->render('header.html');\n echo $template->render('user/login.html');\n echo $template->render('footer.html');\n\n //clear error status\n $this->f3->set('SESSION.haserror', '');\n }" ]
[ "0.73841363", "0.7350473", "0.7309806", "0.72233075", "0.7093745", "0.7051119", "0.6950626", "0.6943272", "0.6899638", "0.68954986", "0.688297", "0.68628776", "0.68560296", "0.68451846", "0.68451846", "0.6824452", "0.682357", "0.6814895", "0.6814672", "0.679042", "0.67541015", "0.6740614", "0.67381585", "0.67304367", "0.6710495", "0.6709309", "0.6691506", "0.668713", "0.6669951", "0.66449225" ]
0.7931832
0
Gets the available composite object (self in this case).
function getComposite() { return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getObject()\n {\n return $this->forgeObject();\n }", "public function get_object()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this;\n }", "public function get_object()\n {\n return $this->_object;\n }", "protected function getObject()\n {\n return $this->parentContext->getObject();\n }", "protected function getObject()\n {\n return $this;\n }", "public function getObject()\n {\n return $this->_object;\n }", "private function getObject() {\n return $this->object;\n }", "public function getObject() {\n return $this->object;\n }", "public function getObject()\n {\n return $this->object;\n }", "public function getObject()\n {\n return $this->object;\n }", "public function getObject();", "public function getObject();", "public function getObject(){\n return $this->getCourier();\n }", "public function object()\n {\n return $this->object;\n }", "public function construct()\n {\n return $this->object;\n }", "public function getObject() {}", "public function getObject() {}", "public function GetObject()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\tif (!$this->object)\n\t\t\t$this->object = $this->project->GetObject($this->objectHash);\n\n\t\treturn $this->object;\n\t}", "public static function get_object() {\n\t\treturn self::$object;\n\t}", "protected function getObject()\n\t{\n\t\tif( $this->object !== null ) {\n\t\t\treturn $this->object;\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function getObject(){\n\t\treturn self::$object_class;\n\t}", "public function getObject(): object;", "public function getComponent()\n {\n return $this->hasOne(Component::className(), ['id' => 'component_id']);\n }", "public function current() {\t\t\n\t\treturn new $this->object_class($this->storage);\n\t}", "public function getObject()\n {\n $object = Doctrine::getTable($this->getModel())->findOneById($this->getModelId());\n\n return $object;\n }", "public function get_base_object() {\n\t\treturn $this->_base_obj;\n\t}", "public function getComponent()\n {\n return $this->hasOne(Component::class, ['id' => 'component_id']);\n }", "public function getBaseObject()\r\n\t{\r\n\t\treturn $this->obj;\r\n\t}", "function getObject();" ]
[ "0.6451645", "0.64489895", "0.63706934", "0.63526684", "0.63379925", "0.6290879", "0.6281595", "0.62731445", "0.6224414", "0.61935616", "0.61935616", "0.61903757", "0.61903757", "0.61015695", "0.60925937", "0.609002", "0.60763615", "0.60763615", "0.6071203", "0.6053245", "0.600535", "0.59611535", "0.5939385", "0.59054345", "0.5881317", "0.5775571", "0.5736698", "0.5712751", "0.5707027", "0.56984454" ]
0.72762847
0
Gets an array of data with fields and relations needed in revision history.
public function getRevisionData() { return $this->getData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRevisions(): array;", "public function history()\n\t{\n\t\t$res = $this->hasManyThrough(Revision::class, RevisionSet::class, 'id', 'revision_set_id', 'revision_set_id')\n\t\t\t->where(\n\t\t\t\tfunction ($query) {\n\t\t\t\t\treturn $query->where('revisions.created_at', '<', $this->created_at);\n\t\t\t\t})\n\t\t\t->select('revisions.id', 'revisions.title', 'revisions.created_at', 'revisions.layout_name', 'revisions.layout_version');\n\t\treturn $res;\n\t}", "public function getRevisions(): array\n {\n return $this->revs;\n }", "public function fetchHistory(): array;", "public function getHistory(): array\n {\n return $this->history;\n }", "public function getHistory(): array\n {\n return $this->history;\n }", "public function dataRevisionsTable();", "function getHistory() {\n\t\treturn db_query_params ('SELECT * FROM artifact_history_user_vw WHERE artifact_id=$1 ORDER BY entrydate DESC, id ASC',\n\t\t\t\t\tarray ($this->getID())) ;\n\t}", "public function getHistoryFields()\n {\n $owner = $this->owner;\n if (!$owner->isLatestVersion()) {\n return null;\n }\n\n $config = GridFieldConfig_RecordViewer::create()\n ->removeComponentsByType([\n GridFieldToolbarHeader::class,\n GridFieldSortableHeader::class,\n GridFieldPaginator::class,\n GridFieldPageCount::class,\n GridFieldViewButton::class\n ])\n ->addComponent(new GridFieldTitleHeader)\n ->addComponent(new GridFieldHistoryButton);\n $config->getComponentByType(GridFieldDetailForm::class)\n ->setItemRequestClass(HistoryGridFieldItemRequest::class);\n $config->getComponentByType(GridFieldDataColumns::class)\n ->setDisplayFields([\n 'Version' => '#',\n 'LastEdited.Nice' => _t(__CLASS__ . '.WHEN', 'When'),\n 'Title' => _t(__CLASS__ . '.TITLE', 'Title'),\n 'Author.Name' => _t(__CLASS__ . '.AUTHOR', 'Author')\n ]);\n\n return FieldList::create(\n GridField::create(\n 'History',\n '',\n Versioned::get_all_versions(\n $owner->ClassName,\n $owner->ID\n )\n ->sort('Version', 'DESC'),\n $config\n )\n ->addExtraClass('grid-field--history')\n );\n }", "public function getAllRevisions()\n {\n // Retrieves username associated with an id. \n $this->ui_ids = array();\n\n /**\n * Retrieves list of previous versions of data dictionary.\n */\n $pid = $_GET[\"pid\"];\n $previous_versions = array();\n $sql = \"select p.pr_id, p.ts_approved, p.ui_id_requester, p.ui_id_approver,\n if(l.description = 'Approve production project modifications (automatic)',1,0) as automatic\n from redcap_metadata_prod_revisions p left join redcap_log_event l\n on p.project_id = l.project_id and p.ts_approved*1 = l.ts\n where p.project_id = $pid and p.ts_approved is not null order by p.pr_id\";\n\n if ($result = $this->query($sql))\n {\n // Cycle through results\n $rev_num = 0;\n $num_rows = $result->num_rows;\n while ($row = $result->fetch_object())\n {\n if ($rev_num == 0)\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Moved to Production\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved,\n );\n }\n else\n {\n $previous_versions[] = array(\n \"id\" => $row->pr_id,\n \"label\" => \"Production Revision #$rev_num\",\n \"requester\" => $this->getUsernameFirstLast($row->ui_id_requester),\n \"approver\" => $this->getUsernameFirstLast($row->ui_id_approver),\n \"automatic_approval\" => $row->automatic,\n \"ts_approved\" => $row->ts_approved\n );\n }\n\n if ($rev_num == $num_rows - 1)\n {\n // Current revision will be mapped to timestamp and approver of last row\n $current_revision_ts_approved = $row->ts_approved;\n $current_revision_approver = $this->getUsernameFirstLast($row->ui_id_approver);\n $current_revision_requester = $this->getUsernameFirstLast($row->ui_id_requester);\n $current_revision_automatic = $row->automatic;\n }\n\n $rev_num++;\n }\n\n $result->close();\n \n // Sort by most recent version.\n $previous_versions = array_reverse($previous_versions);\n }\n\n // Shift timestamps, approvers, requesters, and automatic approval down by one,\n // as the correct info for each one is when the previous version was archived. \n $last_key = null;\n foreach($previous_versions as $key => $version)\n {\n if ($last_key !== null)\n {\n $previous_versions[$last_key][\"ts_approved\"] = $previous_versions[$key][\"ts_approved\"];\n $previous_versions[$last_key][\"requester\"] = $previous_versions[$key][\"requester\"];\n $previous_versions[$last_key][\"approver\"] = $previous_versions[$key][\"approver\"];\n $previous_versions[$last_key][\"automatic_approval\"] = $previous_versions[$key][\"automatic_approval\"];\n }\n $last_key = $key;\n }\n\n // Get correct production timestamp,\n // and the person who moved it to production\n if (!empty($previous_versions))\n {\n // Get correct production timestamp\n $sql = \"select production_time from redcap_projects where project_id = $pid\";\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $timestamp = $row->production_time;\n $previous_versions[sizeof($previous_versions)-1][\"ts_approved\"] = $timestamp;\n }\n $result->close();\n }\n\n if (!empty($timestamp))\n {\n // Retrieve person who moved to production, as it's stored separately. \n $sql = \"select u.ui_id from redcap_user_information u, redcap_log_event l\n where u.username = l.user and l.description = 'Move project to production status' and l.project_id = $pid \n and l.ts = '\" . str_replace(array(' ',':','-'), array('','',''), $timestamp) . \"' order by log_event_id desc limit 1\";\n\n if ($result = $this->query($sql))\n {\n while ($row = $result->fetch_object()){\n $previous_versions[sizeof($previous_versions)-1][\"approver\"] = $this->getUsernameFirstLast($row->ui_id);\n }\n $result->close();\n }\n }\n }\n\n // Add current revision\n if (isset($current_revision_approver) && \n isset($current_revision_ts_approved) && \n isset($current_revision_automatic) && \n isset($current_revision_requester))\n {\n array_unshift($previous_versions, array(\n \"id\" => \"current\",\n \"label\" => \"Production Revision #$rev_num <b>(Current Revision)</b>\",\n \"requester\" => $current_revision_requester,\n \"approver\" => $current_revision_approver,\n \"automatic_approval\" => $current_revision_automatic,\n \"ts_approved\" => $current_revision_ts_approved\n ));\n }\n\n return $previous_versions;\n }", "public function getRevisionData($revision);", "function getHistory()\n\t{\n\t\tif (intval($this->id)==0) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// $db = Zend_Registry::get('db');\n\t\t// $sql = sprintf('select * from object_history where link_to=%d and link_id=%d order by cts desc',$ot,$id);\n\t\t// $rs = $db->fetch_all($sql);\n\t\t// return $rs;\n\n\t\t$s = 'select id,auth_user_id,ctime,link,f,v0,v1 from base_diff ';\n\t\t$s.= sprintf(' where link = \\'%s\\' ',$this->link() );\n\t\t// $s.= ' order by ctime ';\n\t\t$s.= ' union all ';\n\t\t$s.= 'select id,auth_user_id,cts,link,\\'-None-\\',message,null from object_history ';\n\t\t$s.= sprintf(' where link = \\'%s\\' ',$this->link() );\n\t\t$s.= ' order by ctime desc ';\n\n\t\t// $s = $d->select();\n\t\t// $s->from('object_history');\n\t\t// $s->where('link = ?', $this->link() );\n\t\t// $s->order('cts');\n\t\t$r = SQL::fetch_all($s);\n\t\treturn $r;\n\t}", "public function getQueryHistory(): array\n {\n return $this->History;\n }", "public function getRecipeHistory()\n {\n $recipe_ids = $this->getAttribute('recipe_history', array());\n return RecipePeer::retrieveByPKs($recipe_ids);\n }", "public static function getRevisionArray($json){\n\t\t\treturn MWJsonDecoder::getArray(MWJsonDecoder::jsonDecodeRevision($json), \"revid\");\n\t\t}", "protected function getDatastreamHistory() {\n return $this->repository->api->m->getDatastreamHistory($this->parent->id, $this->id);\n }", "public function getQueryHistory(): array;", "public function getRevisioned() ;", "public function getRevisions()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('revisions');\n }", "function getRecentChanges()\r\n\t{\r\n\t\tinclude_once(\"./Modules/Wiki/classes/class.ilWikiPage.php\");\r\n\t\t$changes = ilWikiPage::getRecentChanges(\"wpg\", $this->wiki_id);\r\n\t\t$this->setDefaultOrderField(\"date\");\r\n\t\t$this->setDefaultOrderDirection(\"desc\");\r\n\t\t$this->setData($changes);\r\n\t}", "public function getRevision() ;", "public function getRevision();", "function get_history() {\n\t\treturn $this->history;\n\t}", "public function revisionsTable();", "public function getRevision() {}", "public function history()\n\t{\n\t\treturn $this->morphMany('History', 'historable');\n\t}", "public function getChanges();", "public function getChanges();", "public function revisions()\n {\n return $this->morphMany(Revision::class, 'revisionable');\n }", "public function getDataChangesList() {\n return DataChangeRecord::get()->filter([\n 'ChangeRecordID' => $this->owner->ID,\n 'ChangeRecordClass' => $this->owner->ClassName\n ]);\n }" ]
[ "0.77306175", "0.7204306", "0.7199492", "0.6902535", "0.66657144", "0.66657144", "0.6532738", "0.65165746", "0.6450499", "0.6443531", "0.6428055", "0.6423209", "0.6378845", "0.63544446", "0.6343552", "0.63382524", "0.6278483", "0.624976", "0.62462634", "0.61946195", "0.6190624", "0.61635333", "0.61597747", "0.61569715", "0.61548364", "0.6149834", "0.61317277", "0.61317277", "0.6103141", "0.60964656" ]
0.74471605
1
Imports USA administration level 0 (country)
public function importUsaLevelCountry() { return $this->importData('USA_adm/USA_adm0.shp', 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importUsaLevelStates()\n {\n return $this->importData('USA_adm/USA_adm1.shp', 0);\n }", "private function _loadLocalizedCountryFields()\n {\n $this->_addAccountfields['United Kingdom'] = ['account_name', 'bank_name', 'sort_code', 'account_number'];\n $this->_addAccountfields['United States'] = ['account_name', 'bank_name', 'account_type', 'routing_number', 'account_number'];\n $this->_addAccountfields['India'] = ['account_name', 'bank_name', 'ifsc_code', 'account_number'];\n $this->_addAccountfields['Canada'] = ['account_name', 'bank_name', 'transit_number', 'institution_number', 'account_number'];\n $this->_addAccountfields['Australia'] = ['account_name', 'bank_name', 'bsb', 'account_number'];\n $this->_addAccountfields['New Zealand'] = ['account_name', 'bank_name', 'bsb', 'account_number'];\n $this->_addAccountfields['Japan'] = ['account_name', 'bank_name', 'bank_code', 'branch_code', 'account_type', 'account_number'];\n $this->_addAccountfields['Malaysia'] = ['account_name', 'bank_name', 'meps', 'account_number'];\n $this->_addAccountfields['Mexico'] = ['account_name', 'bank_name', 'account_number'];\n $this->_addAccountfields['Philippines'] = ['account_name', 'bank_name', 'brstn_code', 'account_number'];\n }", "abstract public function country();", "public function importUsaLevelCounties()\n {\n return $this->importData('USA_adm/USA_adm2.shp', 0);\n }", "public function getCountry() {}", "public function getCountry() {}", "public function actionAddCountryCode()\n {\n Loads::addCountryCode();\n }", "public function requestCountry();", "abstract public function countryISOCode();", "function agst_pmpro_default_country($country) {\n\treturn 'AU';\n}", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function getCountry();", "public function getCountry();", "public function countryCode();", "function my_init()\n{\n\tglobal $restricted_countries;\n\t\n\t//Only allow for the countries in the $restricted_countries array\n\t$restricted_countries = array(\n\t\t\t\t\t\t\t1 => array('AU'),\n\t\t\t\t\t\t\t2 => array('AU'),\n\t);\n}", "private static function import_countries_states( $opts ) {\n\t\techo absint( self::import_global_states_csv( $opts ) );\n\t}", "public function import(CountryInterface $country);", "public function getCountriesInfo();", "protected function loadCountry()\n {\n $country = Country::findOne([\n 'code' => 'es'\n ]);\n $this->countryId = $country->id;\n }", "function country_list()\t{\r\n\t\t$list = array(\r\n\t\t\t'AF' => 'Afghanistan',\r\n\t\t\t'AX' => 'Aland Island (Finland)',\r\n\t\t\t'AL' => 'Albania',\r\n\t\t\t'DZ' => 'Algeria',\r\n\t\t\t'AD' => 'Andorra',\r\n\t\t\t'AO' => 'Angola',\r\n\t\t\t'AI' => 'Anguilla',\r\n\t\t\t'AG' => 'Antigua and Barbuda',\r\n\t\t\t'AR' => 'Argentina',\r\n\t\t\t'AM' => 'Armenia',\r\n\t\t\t'AW' => 'Aruba',\r\n\t\t\t'AU' => 'Australia',\r\n\t\t\t'AT' => 'Austria',\r\n\t\t\t'AZ' => 'Azerbaijan',\r\n\t\t\t'BS' => 'Bahamas',\r\n\t\t\t'BH' => 'Bahrain',\r\n\t\t\t'BD' => 'Bangladesh',\r\n\t\t\t'BB' => 'Barbados',\r\n\t\t\t'BY' => 'Belarus',\r\n\t\t\t'BE' => 'Belgium',\r\n\t\t\t'BZ' => 'Belize',\r\n\t\t\t'BJ' => 'Benin',\r\n\t\t\t'BM' => 'Bermuda',\r\n\t\t\t'BT' => 'Bhutan',\r\n\t\t\t'BO' => 'Bolivia',\r\n\t\t\t'BQ' => 'Bonaire (Netherlands Antilles)',\r\n\t\t\t'BA' => 'Bosnia-Herzegovina',\r\n\t\t\t'BW' => 'Botswana',\r\n\t\t\t'BR' => 'Brazil',\r\n\t\t\t'VG' => 'British Virgin Islands',\r\n\t\t\t'BN' => 'Brunei Darussalam',\r\n\t\t\t'BG' => 'Bulgaria',\r\n\t\t\t'BF' => 'Burkina Faso',\r\n\t\t\t'MM' => 'Burma',\r\n\t\t\t'BI' => 'Burundi',\r\n\t\t\t'KH' => 'Cambodia',\r\n\t\t\t'CM' => 'Cameroon',\r\n\t\t\t'CA' => 'Canada',\r\n\t\t\t'CV' => 'Cape Verde',\r\n\t\t\t'KY' => 'Cayman Islands',\r\n\t\t\t'CF' => 'Central African Republic',\r\n\t\t\t'TD' => 'Chad',\r\n\t\t\t'CL' => 'Chile',\r\n\t\t\t'CN' => 'China',\r\n\t\t\t'CX' => 'Christmas Island (Australia)',\r\n\t\t\t'CC' => 'Cocos Island (Australia)',\r\n\t\t\t'CO' => 'Colombia',\r\n\t\t\t'KM' => 'Comoros',\r\n\t\t\t'CG' => 'Congo, Republic of the',\r\n\t\t\t'CD' => 'Congo, Democratic Republic of the',\r\n\t\t\t'CK' => 'Cook Islands (New Zealand)',\r\n\t\t\t'CR' => 'Costa Rica',\r\n\t\t\t'CI' => 'Cote d\\'Ivoire',\r\n\t\t\t'HR' => 'Croatia',\r\n\t\t\t'CU' => 'Cuba',\r\n\t\t\t'CW' => 'Curacao (Netherlands Antilles)',\r\n\t\t\t'CY' => 'Cyprus',\r\n\t\t\t'CZ' => 'Czech Republic',\r\n\t\t\t'DK' => 'Denmark',\r\n\t\t\t'DJ' => 'Djibouti',\r\n\t\t\t'DM' => 'Dominica',\r\n\t\t\t'DO' => 'Dominican Republic',\r\n\t\t\t'TL' => 'East Timor (Indonesia)',\r\n\t\t\t'EC' => 'Ecuador',\r\n\t\t\t'EG' => 'Egypt',\r\n\t\t\t'SV' => 'El Salvador',\r\n\t\t\t'GQ' => 'Equatorial Guinea',\r\n\t\t\t'ER' => 'Eritrea',\r\n\t\t\t'EE' => 'Estonia',\r\n\t\t\t'ET' => 'Ethiopia',\r\n\t\t\t'FK' => 'Falkland Islands',\r\n\t\t\t'FO' => 'Faroe Islands',\r\n\t\t\t'FJ' => 'Fiji',\r\n\t\t\t'FI' => 'Finland',\r\n\t\t\t'FR' => 'France',\r\n\t\t\t'GF' => 'French Guiana',\r\n\t\t\t'PF' => 'French Polynesia',\r\n\t\t\t'GA' => 'Gabon',\r\n\t\t\t'GM' => 'Gambia',\r\n\t\t\t'GE' => 'Georgia, Republic of',\r\n\t\t\t'DE' => 'Germany',\r\n\t\t\t'GH' => 'Ghana',\r\n\t\t\t'GI' => 'Gibraltar',\r\n\t\t\t'GB' => 'Great Britain and Northern Ireland',\r\n\t\t\t'GR' => 'Greece',\r\n\t\t\t'GL' => 'Greenland',\r\n\t\t\t'GD' => 'Grenada',\r\n\t\t\t'GP' => 'Guadeloupe',\r\n\t\t\t'GT' => 'Guatemala',\r\n\t\t\t'GG' => 'Guernsey',\r\n\t\t\t'GN' => 'Guinea',\r\n\t\t\t'GW' => 'Guinea-Bissau',\r\n\t\t\t'GY' => 'Guyana',\r\n\t\t\t'HT' => 'Haiti',\r\n\t\t\t'HN' => 'Honduras',\r\n\t\t\t'HK' => 'Hong Kong',\r\n\t\t\t'HU' => 'Hungary',\r\n\t\t\t'IS' => 'Iceland',\r\n\t\t\t'IN' => 'India',\r\n\t\t\t'ID' => 'Indonesia',\r\n\t\t\t'IR' => 'Iran',\r\n\t\t\t'IQ' => 'Iraq',\r\n\t\t\t'IE' => 'Ireland',\r\n\t\t\t'IM' => 'Isle of Man (Great Britain and Northern Ireland)',\r\n\t\t\t'IL' => 'Israel',\r\n\t\t\t'IT' => 'Italy',\r\n\t\t\t'JM' => 'Jamaica',\r\n\t\t\t'JP' => 'Japan',\r\n\t\t\t'JE' => 'Jersey (Channel Islands) (Great Britain and Northern Ireland)',\r\n\t\t\t'JO' => 'Jordan',\r\n\t\t\t'KZ' => 'Kazakhstan',\r\n\t\t\t'KE' => 'Kenya',\r\n\t\t\t'KI' => 'Kiribati',\r\n\t\t\t'KW' => 'Kuwait',\r\n\t\t\t'KG' => 'Kyrgyzstan',\r\n\t\t\t'LA' => 'Laos',\r\n\t\t\t'LV' => 'Latvia',\r\n\t\t\t'LB' => 'Lebanon',\r\n\t\t\t'LS' => 'Lesotho',\r\n\t\t\t'LR' => 'Liberia',\r\n\t\t\t'LY' => 'Libya',\r\n\t\t\t'LI' => 'Liechtenstein',\r\n\t\t\t'LT' => 'Lithuania',\r\n\t\t\t'LU' => 'Luxembourg',\r\n\t\t\t'MO' => 'Macao',\r\n\t\t\t'MK' => 'Macedonia, Republic of',\r\n\t\t\t'MG' => 'Madagascar',\r\n\t\t\t'MW' => 'Malawi',\r\n\t\t\t'MY' => 'Malaysia',\r\n\t\t\t'MV' => 'Maldives',\r\n\t\t\t'ML' => 'Mali',\r\n\t\t\t'MT' => 'Malta',\r\n\t\t\t'MQ' => 'Martinique',\r\n\t\t\t'MR' => 'Mauritania',\r\n\t\t\t'MU' => 'Mauritius',\r\n\t\t\t'YT' => 'Mayotte (France)',\r\n\t\t\t'MX' => 'Mexico',\r\n\t\t\t'MD' => 'Moldova',\r\n\t\t\t'MC' => 'Monaco (France)',\r\n\t\t\t'MN' => 'Mongolia',\r\n\t\t\t'ME' => 'Montenegro',\r\n\t\t\t'MS' => 'Montserrat',\r\n\t\t\t'MA' => 'Morocco',\r\n\t\t\t'MZ' => 'Mozambique',\r\n\t\t\t'NA' => 'Namibia',\r\n\t\t\t'NR' => 'Nauru',\r\n\t\t\t'NP' => 'Nepal',\r\n\t\t\t'NL' => 'Netherlands',\r\n\t\t\t'AN' => 'Netherlands Antilles',\r\n\t\t\t'NC' => 'New Caledonia',\r\n\t\t\t'NZ' => 'New Zealand',\r\n\t\t\t'NI' => 'Nicaragua',\r\n\t\t\t'NE' => 'Niger',\r\n\t\t\t'NG' => 'Nigeria',\r\n\t\t\t'NU' => 'Niue',\r\n\t\t\t'NF' => 'Norfolk Island',\r\n\t\t\t'KP' => 'North Korea (Korea, Democratic People\\'s Republic of)',\r\n\t\t\t'NO' => 'Norway',\r\n\t\t\t'OM' => 'Oman',\r\n\t\t\t'PK' => 'Pakistan',\r\n\t\t\t'PA' => 'Panama',\r\n\t\t\t'PG' => 'Papua New Guinea',\r\n\t\t\t'PY' => 'Paraguay',\r\n\t\t\t'PE' => 'Peru',\r\n\t\t\t'PH' => 'Philippines',\r\n\t\t\t'PN' => 'Pitcairn Island',\r\n\t\t\t'PL' => 'Poland',\r\n\t\t\t'PT' => 'Portugal',\r\n\t\t\t'QA' => 'Qatar',\r\n\t\t\t'RE' => 'Reunion',\r\n\t\t\t'RO' => 'Romania',\r\n\t\t\t'RU' => 'Russia',\r\n\t\t\t'RW' => 'Rwanda',\r\n\t\t\t'BL' => 'Saint Barthelemy (Guadeloupe)',\r\n\t\t\t'SH' => 'Saint Helena',\r\n\t\t\t'KN' => 'Saint Kitts (Saint Christopher and Nevis)',\r\n\t\t\t'LC' => 'Saint Lucia',\r\n\t\t\t'MF' => 'Saint Martin (French) (Guadeloupe)',\r\n\t\t\t'PM' => 'Saint Pierre and Miquelon',\r\n\t\t\t'VC' => 'Saint Vincent and the Grenadines',\r\n\t\t\t'SM' => 'San Marino',\r\n\t\t\t'ST' => 'Sao Tome and Principe',\r\n\t\t\t'SA' => 'Saudi Arabia',\r\n\t\t\t'SN' => 'Senegal',\r\n\t\t\t'RS' =>\t'Serbia, Republic of',\r\n\t\t\t'SC' => 'Seychelles',\r\n\t\t\t'SL' => 'Sierra Leone',\r\n\t\t\t'SG' => 'Singapore',\r\n\t\t\t'SX' => 'Saint Maarten (Dutch) (Netherlands Antilles)',\r\n\t\t\t'SK' => 'Slovak Republic',\r\n\t\t\t'SI' => 'Slovenia',\r\n\t\t\t'SB' => 'Solomon Islands',\r\n\t\t\t'SO' => 'Somalia',\r\n\t\t\t'ZA' => 'South Africa',\r\n\t\t\t'GS' => 'South Georgia (Falkland Islands)',\r\n\t\t\t'KR' => 'South Korea (Korea, Republic of)',\r\n\t\t\t'SS' => 'Sudan', // South Sudan, not listed separately from Sudan by USPS\r\n\t\t\t'ES' => 'Spain',\r\n\t\t\t'LK' => 'Sri Lanka',\r\n\t\t\t'SD' => 'Sudan',\r\n\t\t\t'SR' => 'Suriname',\r\n\t\t\t'SZ' => 'Swaziland',\r\n\t\t\t'SE' => 'Sweden',\r\n\t\t\t'CH' => 'Switzerland',\r\n\t\t\t'SY' => 'Syrian Arab Republic',\r\n\t\t\t'TW' => 'Taiwan',\r\n\t\t\t'TJ' => 'Tajikistan',\r\n\t\t\t'TZ' => 'Tanzania',\r\n\t\t\t'TH' => 'Thailand',\r\n\t\t\t'TG' => 'Togo',\r\n\t\t\t'TK' => 'Tokelau (Union Group) (Western Samoa)',\r\n\t\t\t'TO' => 'Tonga',\r\n\t\t\t'TT' => 'Trinidad and Tobago',\r\n\t\t\t'TN' => 'Tunisia',\r\n\t\t\t'TR' => 'Turkey',\r\n\t\t\t'TM' => 'Turkmenistan',\r\n\t\t\t'TC' => 'Turks and Caicos Islands',\r\n\t\t\t'TV' => 'Tuvalu',\r\n\t\t\t'UG' => 'Uganda',\r\n\t\t\t'UA' => 'Ukraine',\r\n\t\t\t'AE' => 'United Arab Emirates',\r\n\t\t\t'UY' => 'Uruguay',\r\n\t\t\t'UZ' => 'Uzbekistan',\r\n\t\t\t'VU' => 'Vanuatu',\r\n\t\t\t'VA' => 'Vatican City',\r\n\t\t\t'VE' => 'Venezuela',\r\n\t\t\t'VN' => 'Vietnam',\r\n\t\t\t'WF' => 'Wallis and Futuna Islands',\r\n\t\t\t'WS' => 'Western Samoa',\r\n\t\t\t'YE' => 'Yemen',\r\n\t\t\t'ZM' => 'Zambia',\r\n\t\t\t'ZW' => 'Zimbabwe');\r\n\t\treturn $list;\r\n\t}", "function tep_get_countries_with_iso_codes($countries_id) {\n\treturn tep_get_countries($countries_id, true);\n}", "function _country_get_predefined_list() {\n static $countries;\n\n if (isset($countries)) {\n return $countries;\n }\n $t = get_t();\n\n $countries = array(\n 'AD' => $t('Andorra'),\n 'AE' => $t('United Arab Emirates'),\n 'AF' => $t('Afghanistan'),\n 'AG' => $t('Antigua and Barbuda'),\n 'AI' => $t('Anguilla'),\n 'AL' => $t('Albania'),\n 'AM' => $t('Armenia'),\n 'AN' => $t('Netherlands Antilles'),\n 'AO' => $t('Angola'),\n 'AQ' => $t('Antarctica'),\n 'AR' => $t('Argentina'),\n 'AS' => $t('American Samoa'),\n 'AT' => $t('Austria'),\n 'AU' => $t('Australia'),\n 'AW' => $t('Aruba'),\n 'AX' => $t('Aland Islands'),\n 'AZ' => $t('Azerbaijan'),\n 'BA' => $t('Bosnia and Herzegovina'),\n 'BB' => $t('Barbados'),\n 'BD' => $t('Bangladesh'),\n 'BE' => $t('Belgium'),\n 'BF' => $t('Burkina Faso'),\n 'BG' => $t('Bulgaria'),\n 'BH' => $t('Bahrain'),\n 'BI' => $t('Burundi'),\n 'BJ' => $t('Benin'),\n 'BL' => $t('Saint Barthélemy'),\n 'BM' => $t('Bermuda'),\n 'BN' => $t('Brunei'),\n 'BO' => $t('Bolivia'),\n 'BR' => $t('Brazil'),\n 'BS' => $t('Bahamas'),\n 'BT' => $t('Bhutan'),\n 'BV' => $t('Bouvet Island'),\n 'BW' => $t('Botswana'),\n 'BY' => $t('Belarus'),\n 'BZ' => $t('Belize'),\n 'CA' => $t('Canada'),\n 'CC' => $t('Cocos (Keeling) Islands'),\n 'CD' => $t('Congo (Kinshasa)'),\n 'CF' => $t('Central African Republic'),\n 'CG' => $t('Congo (Brazzaville)'),\n 'CH' => $t('Switzerland'),\n 'CI' => $t('Ivory Coast'),\n 'CK' => $t('Cook Islands'),\n 'CL' => $t('Chile'),\n 'CM' => $t('Cameroon'),\n 'CN' => $t('China'),\n 'CO' => $t('Colombia'),\n 'CR' => $t('Costa Rica'),\n 'CU' => $t('Cuba'),\n 'CV' => $t('Cape Verde'),\n 'CX' => $t('Christmas Island'),\n 'CY' => $t('Cyprus'),\n 'CZ' => $t('Czech Republic'),\n 'DE' => $t('Germany'),\n 'DJ' => $t('Djibouti'),\n 'DK' => $t('Denmark'),\n 'DM' => $t('Dominica'),\n 'DO' => $t('Dominican Republic'),\n 'DZ' => $t('Algeria'),\n 'EC' => $t('Ecuador'),\n 'EE' => $t('Estonia'),\n 'EG' => $t('Egypt'),\n 'EH' => $t('Western Sahara'),\n 'ER' => $t('Eritrea'),\n 'ES' => $t('Spain'),\n 'ET' => $t('Ethiopia'),\n 'FI' => $t('Finland'),\n 'FJ' => $t('Fiji'),\n 'FK' => $t('Falkland Islands'),\n 'FM' => $t('Micronesia'),\n 'FO' => $t('Faroe Islands'),\n 'FR' => $t('France'),\n 'GA' => $t('Gabon'),\n 'GB' => $t('United Kingdom'),\n 'GD' => $t('Grenada'),\n 'GE' => $t('Georgia'),\n 'GF' => $t('French Guiana'),\n 'GG' => $t('Guernsey'),\n 'GH' => $t('Ghana'),\n 'GI' => $t('Gibraltar'),\n 'GL' => $t('Greenland'),\n 'GM' => $t('Gambia'),\n 'GN' => $t('Guinea'),\n 'GP' => $t('Guadeloupe'),\n 'GQ' => $t('Equatorial Guinea'),\n 'GR' => $t('Greece'),\n 'GS' => $t('South Georgia and the South Sandwich Islands'),\n 'GT' => $t('Guatemala'),\n 'GU' => $t('Guam'),\n 'GW' => $t('Guinea-Bissau'),\n 'GY' => $t('Guyana'),\n 'HK' => $t('Hong Kong S.A.R., China'),\n 'HM' => $t('Heard Island and McDonald Islands'),\n 'HN' => $t('Honduras'),\n 'HR' => $t('Croatia'),\n 'HT' => $t('Haiti'),\n 'HU' => $t('Hungary'),\n 'ID' => $t('Indonesia'),\n 'IE' => $t('Ireland'),\n 'IL' => $t('Israel'),\n 'IM' => $t('Isle of Man'),\n 'IN' => $t('India'),\n 'IO' => $t('British Indian Ocean Territory'),\n 'IQ' => $t('Iraq'),\n 'IR' => $t('Iran'),\n 'IS' => $t('Iceland'),\n 'IT' => $t('Italy'),\n 'JE' => $t('Jersey'),\n 'JM' => $t('Jamaica'),\n 'JO' => $t('Jordan'),\n 'JP' => $t('Japan'),\n 'KE' => $t('Kenya'),\n 'KG' => $t('Kyrgyzstan'),\n 'KH' => $t('Cambodia'),\n 'KI' => $t('Kiribati'),\n 'KM' => $t('Comoros'),\n 'KN' => $t('Saint Kitts and Nevis'),\n 'KP' => $t('North Korea'),\n 'KR' => $t('South Korea'),\n 'KW' => $t('Kuwait'),\n 'KY' => $t('Cayman Islands'),\n 'KZ' => $t('Kazakhstan'),\n 'LA' => $t('Laos'),\n 'LB' => $t('Lebanon'),\n 'LC' => $t('Saint Lucia'),\n 'LI' => $t('Liechtenstein'),\n 'LK' => $t('Sri Lanka'),\n 'LR' => $t('Liberia'),\n 'LS' => $t('Lesotho'),\n 'LT' => $t('Lithuania'),\n 'LU' => $t('Luxembourg'),\n 'LV' => $t('Latvia'),\n 'LY' => $t('Libya'),\n 'MA' => $t('Morocco'),\n 'MC' => $t('Monaco'),\n 'MD' => $t('Moldova'),\n 'ME' => $t('Montenegro'),\n 'MF' => $t('Saint Martin (French part)'),\n 'MG' => $t('Madagascar'),\n 'MH' => $t('Marshall Islands'),\n 'MK' => $t('Macedonia'),\n 'ML' => $t('Mali'),\n 'MM' => $t('Myanmar'),\n 'MN' => $t('Mongolia'),\n 'MO' => $t('Macao S.A.R., China'),\n 'MP' => $t('Northern Mariana Islands'),\n 'MQ' => $t('Martinique'),\n 'MR' => $t('Mauritania'),\n 'MS' => $t('Montserrat'),\n 'MT' => $t('Malta'),\n 'MU' => $t('Mauritius'),\n 'MV' => $t('Maldives'),\n 'MW' => $t('Malawi'),\n 'MX' => $t('Mexico'),\n 'MY' => $t('Malaysia'),\n 'MZ' => $t('Mozambique'),\n 'NA' => $t('Namibia'),\n 'NC' => $t('New Caledonia'),\n 'NE' => $t('Niger'),\n 'NF' => $t('Norfolk Island'),\n 'NG' => $t('Nigeria'),\n 'NI' => $t('Nicaragua'),\n 'NL' => $t('Netherlands'),\n 'NO' => $t('Norway'),\n 'NP' => $t('Nepal'),\n 'NR' => $t('Nauru'),\n 'NU' => $t('Niue'),\n 'NZ' => $t('New Zealand'),\n 'OM' => $t('Oman'),\n 'PA' => $t('Panama'),\n 'PE' => $t('Peru'),\n 'PF' => $t('French Polynesia'),\n 'PG' => $t('Papua New Guinea'),\n 'PH' => $t('Philippines'),\n 'PK' => $t('Pakistan'),\n 'PL' => $t('Poland'),\n 'PM' => $t('Saint Pierre and Miquelon'),\n 'PN' => $t('Pitcairn'),\n 'PR' => $t('Puerto Rico'),\n 'PS' => $t('Palestinian Territory'),\n 'PT' => $t('Portugal'),\n 'PW' => $t('Palau'),\n 'PY' => $t('Paraguay'),\n 'QA' => $t('Qatar'),\n 'RE' => $t('Reunion'),\n 'RO' => $t('Romania'),\n 'RS' => $t('Serbia'),\n 'RU' => $t('Russia'),\n 'RW' => $t('Rwanda'),\n 'SA' => $t('Saudi Arabia'),\n 'SB' => $t('Solomon Islands'),\n 'SC' => $t('Seychelles'),\n 'SD' => $t('Sudan'),\n 'SE' => $t('Sweden'),\n 'SG' => $t('Singapore'),\n 'SH' => $t('Saint Helena'),\n 'SI' => $t('Slovenia'),\n 'SJ' => $t('Svalbard and Jan Mayen'),\n 'SK' => $t('Slovakia'),\n 'SL' => $t('Sierra Leone'),\n 'SM' => $t('San Marino'),\n 'SN' => $t('Senegal'),\n 'SO' => $t('Somalia'),\n 'SR' => $t('Suriname'),\n 'ST' => $t('Sao Tome and Principe'),\n 'SV' => $t('El Salvador'),\n 'SY' => $t('Syria'),\n 'SZ' => $t('Swaziland'),\n 'TC' => $t('Turks and Caicos Islands'),\n 'TD' => $t('Chad'),\n 'TF' => $t('French Southern Territories'),\n 'TG' => $t('Togo'),\n 'TH' => $t('Thailand'),\n 'TJ' => $t('Tajikistan'),\n 'TK' => $t('Tokelau'),\n 'TL' => $t('East Timor'),\n 'TM' => $t('Turkmenistan'),\n 'TN' => $t('Tunisia'),\n 'TO' => $t('Tonga'),\n 'TR' => $t('Turkey'),\n 'TT' => $t('Trinidad and Tobago'),\n 'TV' => $t('Tuvalu'),\n 'TW' => $t('Taiwan'),\n 'TZ' => $t('Tanzania'),\n 'UA' => $t('Ukraine'),\n 'UG' => $t('Uganda'),\n 'UM' => $t('United States Minor Outlying Islands'),\n 'US' => $t('United States'),\n 'UY' => $t('Uruguay'),\n 'UZ' => $t('Uzbekistan'),\n 'VA' => $t('Vatican'),\n 'VC' => $t('Saint Vincent and the Grenadines'),\n 'VE' => $t('Venezuela'),\n 'VG' => $t('British Virgin Islands'),\n 'VI' => $t('U.S. Virgin Islands'),\n 'VN' => $t('Vietnam'),\n 'VU' => $t('Vanuatu'),\n 'WF' => $t('Wallis and Futuna'),\n 'WS' => $t('Samoa'),\n 'YE' => $t('Yemen'),\n 'YT' => $t('Mayotte'),\n 'ZA' => $t('South Africa'),\n 'ZM' => $t('Zambia'),\n 'ZW' => $t('Zimbabwe'),\n );\n\n // Sort the list.\n natcasesort($countries);\n\n return $countries;\n}", "private function getDefaultCountryId()\n {\n return 2;\n }", "function loadCountriesFromXML() {\n\tglobal $countries;\n\treturn $countries->load_countries_from_xml();\n}", "function tep_get_country_iso_code_2($country_id) {\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "function tep_get_country_iso_code_2($country_id) {\n\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }", "public function countryOptionList();", "public function setCountry($country = \"\");", "public function setCountryModel()\n {\n\n $layout = Mage::app()->getLayout();\n\n $layout->getBlock('js')->append($layout\n ->createBlock('adminhtml/template')\n ->setTemplate('gls/system/shipping/gls_applicable_country.phtml'));\n }", "public function get_country_list() \n\t{\n\t\treturn $this->db->select('num_code')\n\t\t->select('country_name')\n\t\t->select('num_code')\n\t\t->from('system_iso3166_l10n')\n\t\t->order_by('country_name', 'ASC')\t\n\t\t->get()->result();\n\t}" ]
[ "0.67534035", "0.6553982", "0.64996743", "0.63109", "0.6169242", "0.6169242", "0.60970604", "0.60949993", "0.6085152", "0.6076152", "0.60613835", "0.60443604", "0.60443604", "0.6023646", "0.60191226", "0.6015569", "0.60119885", "0.59470105", "0.5907035", "0.58959365", "0.5815676", "0.580558", "0.580137", "0.57647514", "0.57542825", "0.57322335", "0.5715438", "0.5695399", "0.5678389", "0.56661975" ]
0.8007422
0
Imports USA administration level 1 (states)
public function importUsaLevelStates() { return $this->importData('USA_adm/USA_adm1.shp', 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importUsaLevelCountry()\n {\n return $this->importData('USA_adm/USA_adm0.shp', 0);\n }", "private static function import_countries_states( $opts ) {\n\t\techo absint( self::import_global_states_csv( $opts ) );\n\t}", "public function importUsaLevelCounties()\n {\n return $this->importData('USA_adm/USA_adm2.shp', 0);\n }", "static function states()\n {\n return array(\n 'USA' => array('name' => 'United States',\n 'states' => array(\n 'AL'=>'ALABAMA',\n 'AK'=>'ALASKA',\n 'AZ'=>'ARIZONA',\n 'AR'=>'ARKANSAS',\n 'CA'=>'CALIFORNIA',\n 'CO'=>'COLORADO',\n 'CT'=>'CONNECTICUT',\n 'DE'=>'DELAWARE',\n 'DC'=>'DISTRICT OF COLUMBIA',\n 'FL'=>'FLORIDA',\n 'GA'=>'GEORGIA',\n 'HI'=>'HAWAII',\n 'ID'=>'IDAHO',\n 'IL'=>'ILLINOIS',\n 'IN'=>'INDIANA',\n 'IA'=>'IOWA',\n 'KS'=>'KANSAS',\n 'KY'=>'KENTUCKY',\n 'LA'=>'LOUISIANA',\n 'ME'=>'MAINE',\n 'MD'=>'MARYLAND',\n 'MA'=>'MASSACHUSETTS',\n 'MI'=>'MICHIGAN',\n 'MN'=>'MINNESOTA',\n 'MS'=>'MISSISSIPPI',\n 'MO'=>'MISSOURI',\n 'MT'=>'MONTANA',\n 'NE'=>'NEBRASKA',\n 'NV'=>'NEVADA',\n 'NH'=>'NEW HAMPSHIRE',\n 'NJ'=>'NEW JERSEY',\n 'NM'=>'NEW MEXICO',\n 'NY'=>'NEW YORK',\n 'NC'=>'NORTH CAROLINA',\n 'ND'=>'NORTH DAKOTA',\n 'OH'=>'OHIO',\n 'OK'=>'OKLAHOMA',\n 'OR'=>'OREGON',\n 'PA'=>'PENNSYLVANIA',\n 'PR'=>'PUERTO RICO',\n 'RI'=>'RHODE ISLAND',\n 'SC'=>'SOUTH CAROLINA',\n 'SD'=>'SOUTH DAKOTA',\n 'TN'=>'TENNESSEE',\n 'TX'=>'TEXAS',\n 'UT'=>'UTAH',\n 'VT'=>'VERMONT',\n 'VA'=>'VIRGINIA',\n 'WA'=>'WASHINGTON',\n 'WV'=>'WEST VIRGINIA',\n 'WI'=>'WISCONSIN',\n 'WY'=>'WYOMING'\n )\n ),\n 'CAN' => array('name' => 'Canada',\n 'states' => array(\n \"BC\"=>\"British Columbia\", \n \"ON\"=>\"Ontario\", \n \"NL\"=>\"Newfoundland and Labrador\", \n \"NS\"=>\"Nova Scotia\", \n \"PE\"=>\"Prince Edward Island\", \n \"NB\"=>\"New Brunswick\", \n \"QC\"=>\"Quebec\", \n \"MB\"=>\"Manitoba\", \n \"SK\"=>\"Saskatchewan\", \n \"AB\"=>\"Alberta\", \n \"NT\"=>\"Northwest Territories\", \n \"NU\"=>\"Nunavut\",\n \"YT\"=>\"Yukon Territory\"\n )\n )\n );\n }", "function get_all_states()\n{\n\t\t$states = array(\n\t\t\t\"Alabama\" => \"Alabama\",\n\t\t\t\"Alaska\" => \"Alaska\",\n\t\t\t\"Arizona\" => \"Arizona\",\n\t\t\t\"Arkansas\" => \"Arkansas\",\n\t\t\t\"California\" => \"California\",\n\t\t\t\"Colorado\" => \"Colorado\",\n\t\t\t\"Connecticut\" => \"Connecticut\",\n\t\t\t\"Delaware\" => \"Delaware\",\n\t\t\t\"District of Columbia\" => \"District of Columbia\",\n\t\t\t\"Florida\" => \"Florida\",\n\t\t\t\"Georgia\" => \"Georgia\",\n\t\t\t\"Hawaii\" => \"Hawaii\",\n\t\t\t\"Idaho\" => \"Idaho\",\n\t\t\t\"Illinois\" => \"Illinois\",\n\t\t\t\"Indiana\" => \"Indiana\",\n\t\t\t\"Iowa\" => \"Iowa\",\n\t\t\t\"Kansas\" => \"Kansas\",\n\t\t\t\"Kentucky\" => \"Kentucky\",\n\t\t\t\"Louisiana\" => \"Louisiana\",\n\t\t\t\"Maine\" => \"Maine\",\n\t\t\t\"Maryland\" => \"Maryland\",\n\t\t\t\"Massachusetts\" => \"Massachusetts\",\n\t\t\t\"Michigan\" => \"Michigan\",\n\t\t\t\"Minnesota\" => \"Minnesota\",\n\t\t\t\"Mississippi\" => \"Mississippi\",\n\t\t\t\"Missouri\" => \"Missouri\",\n\t\t\t\"Montana\" => \"Montana\",\n\t\t\t\"Nebraska\" => \"Nebraska\",\n\t\t\t\"Nevada\" => \"Nevada\",\n\t\t\t\"New Hampshire\" => \"New Hampshire\",\n\t\t\t\"New Jersey\" => \"New Jersey\",\n\t\t\t\"New Mexico\" => \"New Mexico\",\n\t\t\t\"New York\" => \"New York\",\n\t\t\t\"North Carolina\" => \"North Carolina\",\n\t\t\t\"North Dakota\" => \"North Dakota\",\n\t\t\t\"Ohio\" => \"Ohio\",\n\t\t\t\"Oklahoma\" => \"Oklahoma\",\n\t\t\t\"Oregon\" => \"Oregon\",\n\t\t\t\"Pennsylvania\" => \"Pennsylvania\",\n\t\t\t\"Rhode island\" => \"Rhode island\",\n\t\t\t\"South Carolina\" => \"South Carolina\",\n\t\t\t\"South Dakota\" => \"South Dakota\",\n\t\t\t\"Tennessee\" => \"Tennessee\",\n\t\t\t\"Texas\" => \"Texas\",\n\t\t\t\"Utah\" => \"Utah\",\n\t\t\t\"Vermont\" => \"Vermont\",\n\t\t\t\"Virgin Islands\" => \"Virgin Islands\",\n\t\t\t\"Virginia\" => \"Virginia\",\n\t\t\t\"Washington\" => \"Washington\",\n\t\t\t\"West Virginia\" => \"West Virginia\",\n\t\t\t\"Wisconsin\" => \"Wisconsin\",\n\t\t\t\"Wyoming\" => \"Wyoming\",\n\t\t\t\"Alberta\" => \"Alberta\",\n\t\t\t\"Nova Scotia\" => \"Nova Scotia\",\n\t\t\t\"British Columbia\" => \"British Columbia\",\n\t\t\t\"Ontario\" => \"Ontario\",\n\t\t\t\"Manitoba\" => \"Manitoba\",\n\t\t\t\"Prince Edward Island\" => \"Prince Edward Island\",\n\t\t\t\"New Brunswick\" => \"New Brunswick\",\n\t\t\t\"Quebec\" => \"Quebec\",\n\t\t\t\"Newfoundland\" => \"Newfoundland\",\n\t\t\t\"Saskatchewan\" => \"Saskatchewan\",\n\t\t\t\"Northwest Territories\" => \"Northwest Territories\",\n\t\t\t\"Yukon Territory\" => \"Yukon Territory\",\n\t\t\t\"Nunavut\" => \"Nunavut\",\n\t\t\t\"American Samoa\" => \"American Samoa\",\n\t\t\t\"Guam\" => \"Guam\",\n\t\t\t\"Marshall Islands\" => \"Marshall Islands\",\n\t\t\t\"Micronesia (Federated States of)\" => \"Micronesia (Federated States of)\",\n\t\t\t\"Palau\" => \"Palau\",\n\t\t\t\"Puerto Rico\" => \"Puerto Rico\",\n\t\t\t\"U.S. Minor Outlying Islands\" => \"U.S. Minor Outlying Islands\",\n\t\t\t\"Northern Mariana Islands\" => \"Northern Mariana Islands\",\n\t\t\t\"Armed Forces Africa\" => \"Armed Forces Africa\",\n\t\t\t\"Armed Forces Americas AA (except Canada)\" => \"Armed Forces Americas AA (except Canada)\",\n\t\t\t\"Armed Forces Canada\" => \"Armed Forces Canada\",\n\t\t\t\"Armed Forces Europe AE\" => \"Armed Forces Europe AE\",\n\t\t\t\"Armed Forces Middle East AE\" => \"Armed Forces Middle East AE\",\n\t\t\t\"Armed Forces Pacific AP\" => \"Armed Forces Pacific AP\",\n\t\t\t\"Foreign\" => \"Foreign\",\n\t\t\t\"Others Not Listed above\" => \"Others Not Listed above\"\n\t\t);\n\treturn $states;\n}", "private static function import_states_cities( $opts ) {\n\t\techo absint( self::import_cities_with_counties_csv( $opts ) );\n\t}", "protected function loadPackageStates() {}", "protected function loadPackageStates() {}", "static function get_states() {\r\n // https://en.wikipedia.org/wiki/List_of_U.S._state_abbreviations\r\n $states = [];\r\n $states['AL'] = 'Alabama';\r\n $states['AK'] = 'Alaska';\r\n $states['AZ'] = 'Arizona';\r\n $states['AR'] = 'Arkansas';\r\n $states['CA'] = 'California';\r\n $states['CO'] = 'Colorado';\r\n $states['CT'] = 'Connecticut';\r\n $states['DE'] = 'Delaware';\r\n $states['DC'] = 'District of Columbia';\r\n $states['FL'] = 'Florida';\r\n $states['GA'] = 'Georgia';\r\n $states['HI'] = 'Hawaii';\r\n $states['ID'] = 'Idaho';\r\n $states['IL'] = 'Illinois';\r\n $states['IN'] = 'Indiana';\r\n $states['IA'] = 'Iowa';\r\n $states['KS'] = 'Kansas';\r\n $states['KY'] = 'Kentucky';\r\n $states['LA'] = 'Louisiana';\r\n $states['ME'] = 'Maine';\r\n $states['MD'] = 'Maryland';\r\n $states['MA'] = 'Massachusetts';\r\n $states['MI'] = 'Michigan';\r\n $states['MN'] = 'Minnesota';\r\n $states['MS'] = 'Mississippi';\r\n $states['MO'] = 'Missouri';\r\n $states['MT'] = 'Montana';\r\n $states['NE'] = 'Nebraska';\r\n $states['NV'] = 'Nevada';\r\n $states['NH'] = 'New Hampshire';\r\n $states['NJ'] = 'New Jersey';\r\n $states['NM'] = 'New Mexico';\r\n $states['NY'] = 'New York';\r\n $states['NC'] = 'North Carolina';\r\n $states['ND'] = 'North Dakota';\r\n $states['OH'] = 'Ohio';\r\n $states['OK'] = 'Oklahoma';\r\n $states['OR'] = 'Oregon';\r\n $states['PA'] = 'Pennsylvania';\r\n $states['RI'] = 'Rhode Island';\r\n $states['SC'] = 'South Carolina';\r\n $states['SD'] = 'South Dakota';\r\n $states['TN'] = 'Tennessee';\r\n $states['TX'] = 'Texas';\r\n $states['UT'] = 'Utah';\r\n $states['VT'] = 'Vermont';\r\n $states['VA'] = 'Virginia';\r\n $states['WA'] = 'Washington';\r\n $states['WV'] = 'West Virginia';\r\n $states['WI'] = 'Wisconsin';\r\n $states['WY'] = 'Wyoming';\r\n $states['AS'] = 'American Samoa';\r\n $states['GU'] = 'Guam';\r\n $states['MP'] = 'Northern Mariana Islands';\r\n $states['PR'] = 'Puerto Rico';\r\n $states['VI'] = 'U.S. Virgin Islands';\r\n $states['UM'] = 'U.S. Minor Outlying Islands';\r\n $states['FM'] = 'Micronesia';\r\n $states['MH'] = 'Marshall Islands';\r\n $states['PW'] = 'Palau';\r\n natsort($states);\r\n return $states;\r\n }", "protected function integrateStates()\n {\n $states = [\n ['_id' => 1, 'name' => 'Andalucía'],\n ['_id' => 2, 'name' => 'Aragón'],\n ['_id' => 3, 'name' => 'Principado de Asturias'],\n ['_id' => 4, 'name' => 'Islas Baleares'],\n ['_id' => 5, 'name' => 'Canarias'],\n ['_id' => 6, 'name' => 'Cantabria'],\n ['_id' => 7, 'name' => 'Castilla y León'],\n ['_id' => 8, 'name' => 'Castilla - La Mancha'],\n ['_id' => 9, 'name' => 'Cataluña'],\n ['_id' => 10, 'name' => 'Comunitat Valenciana'],\n ['_id' => 11, 'name' => 'Extremadura'],\n ['_id' => 12, 'name' => 'Galicia'],\n ['_id' => 13, 'name' => 'Comunidad de Madrid'],\n ['_id' => 14, 'name' => 'Región de Murcia'],\n ['_id' => 15, 'name' => 'Comunidad Foral de Navarra'],\n ['_id' => 16, 'name' => 'País Vasco'],\n ['_id' => 17, 'name' => 'La Rioja'],\n ['_id' => 18, 'name' => 'Ceuta'],\n ['_id' => 19, 'name' => 'Melilla'],\n ];\n\n foreach ($states as $sData) {\n $state = new State([\n 'name' => $sData['name'],\n 'country_id' => $this->countryId\n ]);\n if ($state->save() === false) {\n throw new SaveException($state);\n }\n }\n }", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function run()\n {\n Country::create($this->country());\n $this->disableForeignKeys();\n $this->truncate('states');\n $state=[\n ['id' => 782481, 'country_code' => 'SE', 'name' => 'Blekinge', 'active' => 1, 'slug' => 'blekinge'],\n ['id' => 782482, 'country_code' => 'SE', 'name' => 'Dalarnas', 'active' => 1, 'slug' => 'dalarnas'],\n ['id' => 782483, 'country_code' => 'SE', 'name' => 'Gävleborgs', 'active' => 1, 'slug' => 'gavleborgs'],\n ['id' => 782484, 'country_code' => 'SE', 'name' => 'Gotlands', 'active' => 1, 'slug' => 'gotlands'],\n ['id' => 782485, 'country_code' => 'SE', 'name' => 'Hallands', 'active' => 1, 'slug' => 'hallands'],\n ['id' => 782486, 'country_code' => 'SE', 'name' => 'Jämtlands', 'active' => 1, 'slug' => 'jamtlands'],\n ['id' => 782487, 'country_code' => 'SE', 'name' => 'Jönköpings', 'active' => 1, 'slug' => 'jonkopings'],\n ['id' => 782488, 'country_code' => 'SE', 'name' => 'Kalmar', 'active' => 1, 'slug' => 'kalmar'],\n ['id' => 782489, 'country_code' => 'SE', 'name' => 'Kronobergs', 'active' => 1, 'slug' => 'kronobergs'],\n ['id' => 782490, 'country_code' => 'SE', 'name' => 'Norrbottens', 'active' => 1, 'slug' => 'norrbottens'],\n ['id' => 782491, 'country_code' => 'SE', 'name' => 'Örebro', 'active' => 1, 'slug' => 'orebro'],\n ['id' => 782492, 'country_code' => 'SE', 'name' => 'Östergötlands', 'active' => 1, 'slug' => 'ostergotlands'],\n ['id' => 782493, 'country_code' => 'SE', 'name' => 'Skåne', 'active' => 1, 'slug' => 'skane'],\n ['id' => 782494, 'country_code' => 'SE', 'name' => 'Södermanlands', 'active' => 1, 'slug' => 'sodermanlands'],\n ['id' => 782495, 'country_code' => 'SE', 'name' => 'Stockholms', 'active' => 1, 'slug' => 'stockholms'],\n ['id' => 782496, 'country_code' => 'SE', 'name' => 'Uppsala', 'active' => 1, 'slug' => 'uppsala'],\n ['id' => 782497, 'country_code' => 'SE', 'name' => 'Värmlands', 'active' => 1, 'slug' => 'varmlands'],\n ['id' => 782498, 'country_code' => 'SE', 'name' => 'Västerbottens', 'active' => 1, 'slug' => 'vasterbottens'],\n ['id' => 782499, 'country_code' => 'SE', 'name' => 'Västernorrlands', 'active' => 1, 'slug' => 'vasternorrlands'],\n ['id' => 782500, 'country_code' => 'SE', 'name' => 'Västmanlands', 'active' => 1, 'slug' => 'vastmanlands'],\n ['id' => 782501, 'country_code' => 'SE', 'name' => 'Västra Götalands', 'active' => 1, 'slug' => 'vastra-gotalands']\n\n ];\n\n State::create($state);\n $this->enableForeignKeys();\n\n }", "private static function import_global_states_csv( $opts ) {\n\t\tself::maybe_initialize_option( 'states', $opts );\n\n\t\tif ( $opts['states'] < self::$states_total ) {\n\t\t\t// Get state form ID\n\t\t\t$form_id = FrmForm::get_id_by_key( 'frm_loc_list' );\n\t\t\tif ( ! $form_id ) {\n\t\t\t\treturn $opts['states'];\n\t\t\t}\n\n\t\t\t// Import states from CSV\n\t\t\t$filename = dirname( dirname( __FILE__ ) ) . '/locations_data/states.csv';\n\t\t\t$opts['states'] = FrmProXMLHelper::import_csv(\n\t\t\t\t$filename,\n\t\t\t\t$form_id,\n\t\t\t\tarray(\n\t\t\t\t\t0 => FrmField::get_id_by_key( 'frm_loc_state' ),\n\t\t\t\t\t1 => FrmField::get_id_by_key( 'frm_loc_state_abr' ),\n\t\t\t\t\t2 => FrmField::get_id_by_key( 'frm_loc_country_code2' ),\n\t\t\t\t\t3 => FrmField::get_id_by_key( 'frm_loc_country' ),\n\t\t\t\t\t4 => FrmField::get_id_by_key( 'frm_loc_country_code3' ),\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t$opts['states'] + 1\n\t\t\t);\n\n\t\t\tupdate_option( 'frm_usloc_options', $opts );\n\t\t}\n\n\t\treturn $opts['states'];\n\t}", "public function insertStatesAction() {\n $repository = $this->get('doctrine_mongodb')->getRepository('ProductBundle:Country');\n $name = 'INDIA';\n $india = $repository->findOneByName($name);\n $name = 'USA';\n $usa = $repository->findOneByName($name);\n $name = 'UK';\n $uk = $repository->findOneByName($name);\n \n $cal = new States();\n $cal->setState('Karnataka');\n $cal->setCountry($india);\n $dm = $this->get('doctrine_mongodb')->getManager();\n $dm->persist($cal);\n $dm->flush();\n \n return new Response('Created state with id: '. $cal->getId());\n }", "public function actionIndex()\n\t{ \n\t\t$this->render('states');\n\t}", "private function addUsStates(CountryInterface $country)\r\n {\r\n $states = array(\r\n 'AL' => 'Alabama',\r\n 'AK' => 'Alaska',\r\n 'AZ' => 'Arizona',\r\n 'AR' => 'Arkansas',\r\n 'CA' => 'California',\r\n 'CO' => 'Colorado',\r\n 'CT' => 'Connecticut',\r\n 'DE' => 'Delaware',\r\n 'DC' => 'District Of Columbia',\r\n 'FL' => 'Florida',\r\n 'GA' => 'Georgia',\r\n 'HI' => 'Hawaii',\r\n 'ID' => 'Idaho',\r\n 'IL' => 'Illinois',\r\n 'IN' => 'Indiana',\r\n 'IA' => 'Iowa',\r\n 'KS' => 'Kansas',\r\n 'KY' => 'Kentucky',\r\n 'LA' => 'Louisiana',\r\n 'ME' => 'Maine',\r\n 'MD' => 'Maryland',\r\n 'MA' => 'Massachusetts',\r\n 'MI' => 'Michigan',\r\n 'MN' => 'Minnesota',\r\n 'MS' => 'Mississippi',\r\n 'MO' => 'Missouri',\r\n 'MT' => 'Montana',\r\n 'NE' => 'Nebraska',\r\n 'NV' => 'Nevada',\r\n 'NH' => 'New Hampshire',\r\n 'NJ' => 'New Jersey',\r\n 'NM' => 'New Mexico',\r\n 'NY' => 'New York',\r\n 'NC' => 'North Carolina',\r\n 'ND' => 'North Dakota',\r\n 'OH' => 'Ohio',\r\n 'OK' => 'Oklahoma',\r\n 'OR' => 'Oregon',\r\n 'PA' => 'Pennsylvania',\r\n 'RI' => 'Rhode Island',\r\n 'SC' => 'South Carolina',\r\n 'SD' => 'South Dakota',\r\n 'TN' => 'Tennessee',\r\n 'TX' => 'Texas',\r\n 'UT' => 'Utah',\r\n 'VT' => 'Vermont',\r\n 'VA' => 'Virginia',\r\n 'WA' => 'Washington',\r\n 'WV' => 'West Virginia',\r\n 'WI' => 'Wisconsin',\r\n 'WY' => 'Wyoming'\r\n );\r\n\r\n $this->addProvinces($country, $states); \r\n }", "public static function import_locations() {\n\t\t$data_to_import = FrmAppHelper::get_post_param( 'frm_import_files', '', 'sanitize_title' );\n\n\t\t$form = FrmForm::getOne( 'frm_loc_list' );\n\t\tif ( ! $form ) {\n\t\t\t$file = dirname( dirname( __FILE__ ) ) . '/templates/locations-forms.xml';\n\t\t\tFrmXMLHelper::import_xml( $file );\n\t\t}\n\n\t\t$opts = get_option( 'frm_usloc_options' );\n\t\t$remaining = self::remaining_count( $opts, $data_to_import );\n\n\t\tinclude dirname( dirname( __FILE__ ) ) . '/views/importing_page.php';\n\t}", "public function run()\n {\n Country::create($this->country());\n $this->disableForeignKeys();\n $this->truncate('states');\n $state=[\n ['id' => 782511, 'country_code' => 'TR', 'name' => 'Adana', 'active' => 1, 'slug' => 'adana'],\n ['id' => 782512, 'country_code' => 'TR', 'name' => 'Adıyaman', 'active' => 1, 'slug' => 'adiyaman'],\n ['id' => 782513, 'country_code' => 'TR', 'name' => 'Afyon', 'active' => 1, 'slug' => 'afyon'],\n ['id' => 782514, 'country_code' => 'TR', 'name' => 'Ağrı', 'active' => 1, 'slug' => 'agri'],\n ['id' => 782515, 'country_code' => 'TR', 'name' => 'Aksaray', 'active' => 1, 'slug' => 'aksaray'],\n ['id' => 782516, 'country_code' => 'TR', 'name' => 'Amasya', 'active' => 1, 'slug' => 'amasya'],\n ['id' => 782517, 'country_code' => 'TR', 'name' => 'Ankara', 'active' => 1, 'slug' => 'ankara'],\n ['id' => 782518, 'country_code' => 'TR', 'name' => 'Antalya', 'active' => 1, 'slug' => 'antalya'],\n ['id' => 782519, 'country_code' => 'TR', 'name' => 'Ardahan', 'active' => 1, 'slug' => 'ardahan'],\n ['id' => 782520, 'country_code' => 'TR', 'name' => 'Artvin', 'active' => 1, 'slug' => 'artvin'],\n ['id' => 782521, 'country_code' => 'TR', 'name' => 'Aydın', 'active' => 1, 'slug' => 'aydin'],\n ['id' => 782522, 'country_code' => 'TR', 'name' => 'Balıkesir', 'active' => 1, 'slug' => 'balikesir'],\n ['id' => 782523, 'country_code' => 'TR', 'name' => 'Bartın', 'active' => 1, 'slug' => 'bartin'],\n ['id' => 782524, 'country_code' => 'TR', 'name' => 'Batman', 'active' => 1, 'slug' => 'batman'],\n ['id' => 782525, 'country_code' => 'TR', 'name' => 'Bayburt', 'active' => 1, 'slug' => 'bayburt'],\n ['id' => 782526, 'country_code' => 'TR', 'name' => 'Bilecik', 'active' => 1, 'slug' => 'bilecik'],\n ['id' => 782527, 'country_code' => 'TR', 'name' => 'Bingöl', 'active' => 1, 'slug' => 'bingol'],\n ['id' => 782528, 'country_code' => 'TR', 'name' => 'Bitlis', 'active' => 1, 'slug' => 'bitlis'],\n ['id' => 782529, 'country_code' => 'TR', 'name' => 'Bolu', 'active' => 1, 'slug' => 'bolu'],\n ['id' => 782530, 'country_code' => 'TR', 'name' => 'Burdur', 'active' => 1, 'slug' => 'burdur'],\n ['id' => 782531, 'country_code' => 'TR', 'name' => 'Bursa', 'active' => 1, 'slug' => 'bursa'],\n ['id' => 782532, 'country_code' => 'TR', 'name' => 'Çanakkale', 'active' => 1, 'slug' => 'canakkale'],\n ['id' => 782533, 'country_code' => 'TR', 'name' => 'Çankırı', 'active' => 1, 'slug' => 'cankiri'],\n ['id' => 782534, 'country_code' => 'TR', 'name' => 'Çorum', 'active' => 1, 'slug' => 'corum'],\n ['id' => 782535, 'country_code' => 'TR', 'name' => 'Denizli', 'active' => 1, 'slug' => 'denizli'],\n ['id' => 782536, 'country_code' => 'TR', 'name' => 'Diyarbakır', 'active' => 1, 'slug' => 'diyarbakir'],\n ['id' => 782537, 'country_code' => 'TR', 'name' => 'Düzce', 'active' => 1, 'slug' => 'duzce'],\n ['id' => 782538, 'country_code' => 'TR', 'name' => 'Edirne', 'active' => 1, 'slug' => 'edirne'],\n ['id' => 782539, 'country_code' => 'TR', 'name' => 'Elazığ', 'active' => 1, 'slug' => 'elazig'],\n ['id' => 782540, 'country_code' => 'TR', 'name' => 'Erzincan', 'active' => 1, 'slug' => 'erzincan'],\n ['id' => 782541, 'country_code' => 'TR', 'name' => 'Erzurum', 'active' => 1, 'slug' => 'erzurum'],\n ['id' => 782542, 'country_code' => 'TR', 'name' => 'Eskişehir', 'active' => 1, 'slug' => 'eskisehir'],\n ['id' => 782543, 'country_code' => 'TR', 'name' => 'Gaziantep', 'active' => 1, 'slug' => 'gaziantep'],\n ['id' => 782544, 'country_code' => 'TR', 'name' => 'Giresun', 'active' => 1, 'slug' => 'giresun'],\n ['id' => 782545, 'country_code' => 'TR', 'name' => 'Girne', 'active' => 1, 'slug' => 'girne'],\n ['id' => 782546, 'country_code' => 'TR', 'name' => 'Gümüşhane', 'active' => 1, 'slug' => 'gumushane'],\n ['id' => 782547, 'country_code' => 'TR', 'name' => 'Güzelyurt', 'active' => 1, 'slug' => 'guzelyurt'],\n ['id' => 782548, 'country_code' => 'TR', 'name' => 'Hakkari', 'active' => 1, 'slug' => 'hakkari'],\n ['id' => 782549, 'country_code' => 'TR', 'name' => 'Hatay', 'active' => 1, 'slug' => 'hatay'],\n ['id' => 782550, 'country_code' => 'TR', 'name' => 'Iğdır', 'active' => 1, 'slug' => 'igdir'],\n ['id' => 782551, 'country_code' => 'TR', 'name' => 'İskele', 'active' => 1, 'slug' => 'iskele'],\n ['id' => 782552, 'country_code' => 'TR', 'name' => 'Isparta', 'active' => 1, 'slug' => 'isparta'],\n ['id' => 782553, 'country_code' => 'TR', 'name' => 'İstanbul', 'active' => 1, 'slug' => 'istanbul'],\n ['id' => 782554, 'country_code' => 'TR', 'name' => 'İzmir', 'active' => 1, 'slug' => 'izmir'],\n ['id' => 782555, 'country_code' => 'TR', 'name' => 'Kahramanmaraş', 'active' => 1, 'slug' => 'kahramanmaras'],\n ['id' => 782556, 'country_code' => 'TR', 'name' => 'Karabük', 'active' => 1, 'slug' => 'karabuk'],\n ['id' => 782557, 'country_code' => 'TR', 'name' => 'Karaman', 'active' => 1, 'slug' => 'karaman'],\n ['id' => 782558, 'country_code' => 'TR', 'name' => 'Kars', 'active' => 1, 'slug' => 'kars'],\n ['id' => 782559, 'country_code' => 'TR', 'name' => 'Kastamonu', 'active' => 1, 'slug' => 'kastamonu'],\n ['id' => 782560, 'country_code' => 'TR', 'name' => 'Kayseri', 'active' => 1, 'slug' => 'kayseri'],\n ['id' => 782561, 'country_code' => 'TR', 'name' => 'Kilis', 'active' => 1, 'slug' => 'kilis'],\n ['id' => 782562, 'country_code' => 'TR', 'name' => 'Kırıkkale', 'active' => 1, 'slug' => 'kirikkale'],\n ['id' => 782563, 'country_code' => 'TR', 'name' => 'Kırklareli', 'active' => 1, 'slug' => 'kirklareli'],\n ['id' => 782564, 'country_code' => 'TR', 'name' => 'Kırşehir', 'active' => 1, 'slug' => 'kirsehir'],\n ['id' => 782565, 'country_code' => 'TR', 'name' => 'Kocaeli', 'active' => 1, 'slug' => 'kocaeli'],\n ['id' => 782566, 'country_code' => 'TR', 'name' => 'Konya', 'active' => 1, 'slug' => 'konya'],\n ['id' => 782567, 'country_code' => 'TR', 'name' => 'Kütahya', 'active' => 1, 'slug' => 'kutahya'],\n ['id' => 782568, 'country_code' => 'TR', 'name' => 'Lefkoşa', 'active' => 1, 'slug' => 'lefkosa'],\n ['id' => 782569, 'country_code' => 'TR', 'name' => 'Magosa', 'active' => 1, 'slug' => 'magosa'],\n ['id' => 782570, 'country_code' => 'TR', 'name' => 'Malatya', 'active' => 1, 'slug' => 'malatya'],\n ['id' => 782571, 'country_code' => 'TR', 'name' => 'Manisa', 'active' => 1, 'slug' => 'manisa'],\n ['id' => 782572, 'country_code' => 'TR', 'name' => 'Mardin', 'active' => 1, 'slug' => 'mardin'],\n ['id' => 782573, 'country_code' => 'TR', 'name' => 'Mersin', 'active' => 1, 'slug' => 'mersin'],\n ['id' => 782574, 'country_code' => 'TR', 'name' => 'Muğla', 'active' => 1, 'slug' => 'mugla'],\n ['id' => 782575, 'country_code' => 'TR', 'name' => 'Muş', 'active' => 1, 'slug' => 'mus'],\n ['id' => 782576, 'country_code' => 'TR', 'name' => 'Nevşehir', 'active' => 1, 'slug' => 'nevsehir'],\n ['id' => 782577, 'country_code' => 'TR', 'name' => 'Niğde', 'active' => 1, 'slug' => 'nigde'],\n ['id' => 782578, 'country_code' => 'TR', 'name' => 'Ordu', 'active' => 1, 'slug' => 'ordu'],\n ['id' => 782579, 'country_code' => 'TR', 'name' => 'Osmaniye', 'active' => 1, 'slug' => 'osmaniye'],\n ['id' => 782580, 'country_code' => 'TR', 'name' => 'Rize', 'active' => 1, 'slug' => 'rize'],\n ['id' => 782581, 'country_code' => 'TR', 'name' => 'Sakarya', 'active' => 1, 'slug' => 'sakarya'],\n ['id' => 782582, 'country_code' => 'TR', 'name' => 'Samsun', 'active' => 1, 'slug' => 'samsun'],\n ['id' => 782583, 'country_code' => 'TR', 'name' => 'Şanlıurfa', 'active' => 1, 'slug' => 'sanliurfa'],\n ['id' => 782584, 'country_code' => 'TR', 'name' => 'Siirt', 'active' => 1, 'slug' => 'siirt'],\n ['id' => 782585, 'country_code' => 'TR', 'name' => 'Sinop', 'active' => 1, 'slug' => 'sinop'],\n ['id' => 782586, 'country_code' => 'TR', 'name' => 'Şırnak', 'active' => 1, 'slug' => 'sirnak'],\n ['id' => 782587, 'country_code' => 'TR', 'name' => 'Sivas', 'active' => 1, 'slug' => 'sivas'],\n ['id' => 782588, 'country_code' => 'TR', 'name' => 'Tekirdağ', 'active' => 1, 'slug' => 'tekirdag'],\n ['id' => 782589, 'country_code' => 'TR', 'name' => 'Tokat', 'active' => 1, 'slug' => 'tokat'],\n ['id' => 782590, 'country_code' => 'TR', 'name' => 'Trabzon', 'active' => 1, 'slug' => 'trabzon'],\n ['id' => 782591, 'country_code' => 'TR', 'name' => 'Tunceli', 'active' => 1, 'slug' => 'tunceli'],\n ['id' => 782592, 'country_code' => 'TR', 'name' => 'Uşak', 'active' => 1, 'slug' => 'usak'],\n ['id' => 782593, 'country_code' => 'TR', 'name' => 'Van', 'active' => 1, 'slug' => 'van'],\n ['id' => 782594, 'country_code' => 'TR', 'name' => 'Yalova', 'active' => 1, 'slug' => 'yalova'],\n ['id' => 782595, 'country_code' => 'TR', 'name' => 'Yozgat', 'active' => 1, 'slug' => 'yozgat'],\n ['id' => 782596, 'country_code' => 'TR', 'name' => 'Zonguldak', 'active' => 1, 'slug' => 'zonguldak']\n\n ];\n\n State::create($state);\n $this->enableForeignKeys();\n\n }", "function addstate() {\n $clang = Yii::app()->lang;\n\n if (!Permission::model()->hasGlobalPermission('Regions', 'create')) {\n Yii::app()->setFlashMessage($clang->gT(\"You do not have sufficient rights to access this page.\"), 'error');\n $this->getController()->redirect(array(\"admin/index\"));\n }\n $new_state = flattenText(Yii::app()->request->getPost('new_state'), false, true);\n $country_name = (int) Yii::app()->request->getPost(\"country_name\");\n $zonelist = Yii::app()->request->getPost(\"zonelist\");\n $aData = array();\n if (empty($new_state)) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A state was not supplied or the state is invalid.\"), 'class' => 'warningheader');\n } elseif ($country_name == 0) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A country was not supplied or the country is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == 'zoneselect') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif ($zonelist == '0') {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"A zone was not supplied or the zone is invalid.\"), 'class' => 'warningheader');\n } elseif (State::model()->findByAttributes(array('state_Name' => $new_state, 'zone_id' => $zonelist))) {\n $aViewUrls['message'] = array('title' => $clang->gT(\"Failed to add State\"), 'message' => $clang->gT(\"The State already exists.\"), 'class' => 'warningheader');\n } else {\n $iNewUID = State::model()->instState($new_state, $zonelist);\n if ($iNewUID) {\n Yii::app()->setFlashMessage($clang->gT(\"State added successfully\"));\n $this->getController()->redirect(array(\"admin/state/index\"));\n } else {\n $aViewUrls['mboxwithredirect'][] = $this->_messageBoxWithRedirect($clang->gT(\"Failed to add state\"), $clang->gT(\"The state already exists.\"), 'warningheader');\n }\n }\n\n $this->_renderWrappedTemplate('region/state', $aViewUrls, $aData);\n }", "public function run() {\n $states = [\n ['name' => 'Arte Plastica', 'type_id' => 1],\n ['name' => 'Arte Moderna', 'type_id' => 1],\n ['name' => 'Cine', 'type_id' => 1],\n ['name' => 'Teatro', 'type_id' => 1],\n ['name' => 'Musica', 'type_id' => 1],\n ['name' => 'Fotografia', 'type_id' => 1],\n ['name' => 'Cardiologia', 'type_id' => 2],\n ['name' => 'Dermatologia', 'type_id' => 2],\n ['name' => 'Cirugia', 'type_id' => 2],\n ['name' => 'Enfermeria y Nutricion', 'type_id' => 2],\n ['name' => 'Fisiologia', 'type_id' => 2],\n ['name' => 'Ginecologia', 'type_id' => 2],\n ['name' => 'Gerontología', 'type_id' => 2],\n ['name' => 'Hepatología', 'type_id' => 2],\n ['name' => 'Inmunología', 'type_id' => 2],\n ['name' => 'Medicina Alternativa', 'type_id' => 2],\n ['name' => 'Medicina Familiar', 'type_id' => 2],\n ['name' => 'Medicina Interna', 'type_id' => 2],\n ['name' => 'Neumología', 'type_id' => 2],\n ['name' => 'Neurología', 'type_id' => 2],\n ['name' => 'Odontología', 'type_id' => 2],\n ['name' => 'Oftalmología', 'type_id' => 2],\n ['name' => 'Oncología', 'type_id' => 2],\n ['name' => 'Ortopedia', 'type_id' => 2],\n ['name' => 'Patología', 'type_id' => 2],\n ['name' => 'Pediatría Y Neonatología', 'type_id' => 2],\n ['name' => 'Primeros Auxilios', 'type_id' => 2],\n ['name' => 'Salud Pública Auditoría', 'type_id' => 2],\n ['name' => 'Sexología', 'type_id' => 2],\n ['name' => 'Temas Varios De Salud', 'type_id' => 2],\n ['name' => 'Terapias Y Farmacología', 'type_id' => 2],\n ['name' => 'Urgencias Médicas', 'type_id' => 2],\n ['name' => 'Urología', 'type_id' => 2],\n ['name' => 'Biología', 'type_id' => 3],\n ['name' => 'Fisica', 'type_id' => 3],\n ['name' => 'Matematicas', 'type_id' => 3],\n ['name' => 'Ingles', 'type_id' => 3],\n ['name' => 'Educacion Fisica', 'type_id' => 3],\n ['name' => 'Pedagogia', 'type_id' => 3],\n ['name' => 'Sociales e Historia', 'type_id' => 3],\n ['name' => 'Democracia', 'type_id' => 3],\n ['name' => 'Pastoral', 'type_id' => 3],\n ['name' => 'Filosofia', 'type_id' => 3],\n ['name' => 'Quimica', 'type_id' => 3],\n ['name' => 'Español', 'type_id' => 3],\n ['name' => 'Geometria', 'type_id' => 3],\n ['name' => 'Informatica', 'type_id' => 3],\n ['name' => 'Redes', 'type_id' => 3],\n ['name' => 'Diseño de interiores', 'type_id' => 4],\n ['name' => 'Diseño Grafico', 'type_id' => 4],\n ['name' => 'Diseño Industrial', 'type_id' => 4],\n ['name' => 'Diseño de Moda', 'type_id' => 4],\n ['name' => 'Diseño Digital', 'type_id' => 4],\n ['name' => 'Ingenieria de Sistemas', 'type_id' => 5],\n ['name' => 'Ingenieria Industrial', 'type_id' => 5],\n ['name' => 'Ingenieria Civil', 'type_id' => 5],\n ['name' => 'Ingenieria Electronica', 'type_id' => 5],\n ['name' => 'Ingenieria de Sonido', 'type_id' => 5],\n ['name' => 'Ingenieria Aeronautica', 'type_id' => 5],\n ['name' => 'Ingenieria Agronómica', 'type_id' => 5],\n ['name' => 'Ingeniería Ambiental', 'type_id' => 5],\n ['name' => 'Ingeniería Biomédica', 'type_id' => 5],\n ['name' => 'Ingeniería Comercial', 'type_id' => 5],\n ['name' => 'Ingeniería de Procesos', 'type_id' => 5],\n ['name' => 'Ingeniería de Producción', 'type_id' => 5],\n ['name' => 'Ingeniería de Telecomunicaciones', 'type_id' => 5],\n ['name' => 'Ingeniería Eléctrica', 'type_id' => 5],\n ['name' => 'Ingeniería Financiera', 'type_id' => 5],\n ['name' => 'Ingeniería Mecánica', 'type_id' => 5],\n ['name' => 'Ingeniería Mecatrónica', 'type_id' => 5],\n ['name' => 'Ingeniería Metalúrgica', 'type_id' => 5],\n ['name' => 'Ingeniería Química', 'type_id' => 5],\n ['name' => 'Ingeniería Topográfica', 'type_id' => 5],\n ['name' => 'Ingeniería Textil', 'type_id' => 5],\n ['name' => 'Economia', 'type_id' => 6],\n ['name' => 'Contabilidad', 'type_id' => 6],\n ['name' => 'Finanzas', 'type_id' => 6],\n ['name' => 'Administracion', 'type_id' => 6],\n ['name' => 'Secretaria', 'type_id' => 6],\n ['name' => 'Marketing', 'type_id' => 6],\n ['name' => 'Internacional', 'type_id' => 7],\n ['name' => 'Colombiana', 'type_id' => 7],\n ['name' => 'Especialidades', 'type_id' => 7],\n ['name' => 'Cacera', 'type_id' => 7],\n ['name' => 'Comic', 'type_id' => 8],\n ['name' => 'Accion', 'type_id' => 8],\n ['name' => 'Romance', 'type_id' => 8],\n ['name' => 'Terror', 'type_id' => 8],\n ['name' => 'Anime', 'type_id' => 8],\n ['name' => 'Adultos', 'type_id' => 8],\n ['name' => 'Aventura', 'type_id' => 8],\n ['name' => 'Ciencia Ficcion', 'type_id' => 8],\n ['name' => 'Comedia', 'type_id' => 8],\n ['name' => 'Misterio', 'type_id' => 8],\n ['name' => 'Suspenso', 'type_id' => 8],\n ['name' => 'LGTBI', 'type_id' => 8],\n ['name' => 'Football', 'type_id' => 9],\n ['name' => 'Tenis', 'type_id' => 9],\n ['name' => 'Baloncesto', 'type_id' => 9],\n ['name' => 'Balonmano', 'type_id' => 9],\n ['name' => 'Boxeo', 'type_id' => 9],\n ['name' => 'Beisbol', 'type_id' => 9],\n ['name' => 'Ciclismo', 'type_id' => 9],\n ['name' => 'Bolos', 'type_id' => 9],\n ['name' => 'Esqui', 'type_id' => 9],\n ['name' => 'Golf', 'type_id' => 9],\n ['name' => 'Hokey', 'type_id' => 9],\n ['name' => 'Karate', 'type_id' => 9],\n ['name' => 'Lucha', 'type_id' => 9],\n ['name' => 'Natacion', 'type_id' => 9],\n ['name' => 'Patinaje', 'type_id' => 9],\n ['name' => 'Polo', 'type_id' => 9],\n ['name' => 'Remo', 'type_id' => 9],\n ['name' => 'Rugby', 'type_id' => 9],\n ['name' => 'Ajedrez', 'type_id' => 9],\n ['name' => 'Surf', 'type_id' => 9],\n ['name' => 'Arqueria', 'type_id' => 9],\n ['name' => 'Parkour', 'type_id' => 9],\n ['name' => 'Estudios', 'type_id' => 10],\n ['name' => 'Documentales', 'type_id' => 10],\n ['name' => 'Articulos', 'type_id' => 10],\n ['name' => 'Proyectos', 'type_id' => 10],\n ];\n Subtype::insert($states);\n }", "function import_menu_location(){\r\n\r\n\t\t$data = array(\r\n 'primary' => 'kleonavmenu',\r\n 'top' => 'kleotopmenu'\r\n );\r\n\t\t$menus = wp_get_nav_menus();\r\n\r\n\t\tforeach( $data as $key => $val ){\r\n\t\t\tforeach( $menus as $menu ){\r\n\t\t\t\tif( $menu->slug == $val ){\r\n\t\t\t\t\t$data[$key] = absint( $menu->term_id );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tset_theme_mod( 'nav_menu_locations', $data );\r\n\t}", "static function getStates($bLong=False) {\n\t\tif ($bLong)\n\t\treturn array('AL'=>'Alabama (AL)','AK'=>'Alaska (AK)','AZ'=>'Arizona (AZ)','AR'=>'Arkansas (AR)','CA'=>'California (CA)','CO'=>'Colorado (CO)',\n\t\t\t'CT'=>'Connecticut (CT)','DE'=>'Delaware (DE)','FL'=>'Florida (FL)','GA'=>'Georgia (GA)','HI'=>'Hawaii (HI)','ID'=>'Idaho (ID)',\n\t\t\t'IL'=>'Illinois (IL)','IN'=>'Indiana (IN)','IA'=>'Iowa (IA)','KS'=>'Kansas (KS)','KY'=>'Kentucky (KY)','LA'=>'Louisiana (LA)',\n\t\t\t'ME'=>'Maine (ME)','MD'=>'Maryland (MD)','MA'=>'Massachusetts (MA)','MI'=>'Michigan (MI)','MN'=>'Minnesota (MN)','MS'=>'Mississippi (MS)',\n\t\t\t'MO'=>'Missouri (MO)','MT'=>'Montana (MT)','NE'=>'Nebraska (NE)','NV'=>'Nevada (NV)','NH'=>'New Hampshire (NH)','NJ'=>'New Jersey (NJ)',\n\t\t\t'NM'=>'New Mexico (NM)','NY'=>'New York (NY)','NC'=>'North Carolina (NC)','ND'=>'North Dakota (ND)','OH'=>'Ohio (OH)','OK'=>'Oklahoma (OK)',\n\t\t\t'OR'=>'Oregon (OR)','PA'=>'Pennsylvania (PA)','RI'=>'Rhode Island (RI)','SC'=>'South Carolina (SC)','SD'=>'South Dakota (SD)','TN'=>'Tennessee (TN)',\n\t\t\t'TX'=>'Texas (TX)','UT'=>'Utah (UT)','VT'=>'Vermont (VT)','VA'=>'Virginia (VA)','WA'=>'Washington (WA)','WV'=>'West Virginia (WV)',\n\t\t\t'WI'=>'Wisconsin (WI)','WY'=>'Wyoming (WY)');\n\t\telse\n\t\t\treturn array('AL','AK','AZ','AR','CA','CO','CT','DE','FL','GA','HI','ID','IL','IN','IA','KS','KY','LA','ME','MD','MA','MI','MN','MS',\n\t\t\t'MO','MT','NE','NV','NH','NJ','NM','NY','NC','ND','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VT','VA','WA','WV','WI','WY');\n\t}", "public static function setupMultilingual()\n {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $languages = self::getLanguages();\n if (count($languages)) {\n //states table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_states\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_states table\n $prefix = $language->sef;\n if (!in_array('state_name_' . $prefix, $fieldArr)) {\n $fieldName = 'state_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_states` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //cities table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_cities\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_cities table\n $prefix = $language->sef;\n if (!in_array('city_' . $prefix, $fieldArr)) {\n $fieldName = 'city_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_cities` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n\t\t\t//cities table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_countries\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_countries table\n $prefix = $language->sef;\n if (!in_array('country_name_' . $prefix, $fieldArr)) {\n $fieldName = 'country_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_countries` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //tags table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_tags\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_emails table\n $prefix = $language->sef;\n //$fields = array_keys($db->getTableColumns('#__osrs_emails'));\n if (!in_array('keyword_' . $prefix, $fieldArr)) {\n $fieldName = 'keyword_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_tags` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n //emails table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_emails\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_emails table\n $prefix = $language->sef;\n //$fields = array_keys($db->getTableColumns('#__osrs_emails'));\n if (!in_array('email_title_' . $prefix, $fieldArr)) {\n $fieldName = 'email_title_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_emails` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'email_content_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_emails` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //categories table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_categories\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_categories table\n $prefix = $language->sef;\n if (!in_array('category_name_' . $prefix, $fieldArr)) {\n $fieldName = 'category_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_categories` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'category_alias_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_categories` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'category_description_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_categories` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n //amenities table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_amenities\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('amenities_' . $prefix, $fieldArr)) {\n $fieldName = 'amenities_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_amenities` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //field group table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_fieldgroups\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('group_name_' . $prefix, $fieldArr)) {\n $fieldName = 'group_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_fieldgroups` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //extra field table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_extra_fields\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('field_label_' . $prefix, $fieldArr)) {\n $fieldName = 'field_label_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_extra_fields` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'field_description_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_extra_fields` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n //field group table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_extra_field_options\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('field_option_' . $prefix, $fieldArr)) {\n $fieldName = 'field_option_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_extra_field_options` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //osrs_property_field_value table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_property_field_value\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('value_' . $prefix, $fieldArr)) {\n $fieldName = 'value_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_property_field_value` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //types table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_types\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('type_name_' . $prefix, $fieldArr)) {\n $fieldName = 'type_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_types` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'type_alias_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_types` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n //properties table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_properties\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_properties table\n $prefix = $language->sef;\n if (!in_array('pro_name_' . $prefix, $fieldArr)) {\n $fieldName = 'pro_name_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'pro_alias_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n if (!in_array('address_' . $prefix, $fieldArr)) {\n $fieldName = 'address_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n\t\t\t\tif (!in_array('price_text_' . $prefix, $fieldArr)) {\n $fieldName = 'price_text_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR( 255 );\";\n $db->setQuery($sql);\n $db->execute();\n }\n if (!in_array('pro_small_desc_' . $prefix, $fieldArr)) {\n $fieldName = 'pro_small_desc_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'pro_full_desc_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n if (!in_array('metadesc_' . $prefix, $fieldArr)) {\n $fieldName = 'metadesc_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR (255) DEFAULT '' NOT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n\n $fieldName = 'metakey_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR (255) DEFAULT '' NOT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n\t\t\t\tif (!in_array('pro_browser_title_' . $prefix, $fieldArr)) {\n $fieldName = 'pro_browser_title_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_properties` ADD `$fieldName` VARCHAR( 255 ) DEFAULT '' NOT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n //types table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_agents\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('bio_' . $prefix, $fieldArr)) {\n $fieldName = 'bio_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_agents` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n\n //companies table\n $db->setQuery(\"SHOW COLUMNS FROM #__osrs_companies\");\n $fields = $db->loadObjectList();\n if (count($fields) > 0) {\n $fieldArr = array();\n for ($i = 0; $i < count($fields); $i++) {\n $field = $fields[$i];\n $fieldname = $field->Field;\n $fieldArr[$i] = $fieldname;\n }\n }\n foreach ($languages as $language) {\n #Process for #__osrs_amenities table\n $prefix = $language->sef;\n if (!in_array('company_description_' . $prefix, $fieldArr)) {\n $fieldName = 'company_description_' . $prefix;\n $sql = \"ALTER TABLE `#__osrs_companies` ADD `$fieldName` TEXT NULL;\";\n $db->setQuery($sql);\n $db->execute();\n }\n }\n\n }\n }", "private function _loadLocalizedCountryFields()\n {\n $this->_addAccountfields['United Kingdom'] = ['account_name', 'bank_name', 'sort_code', 'account_number'];\n $this->_addAccountfields['United States'] = ['account_name', 'bank_name', 'account_type', 'routing_number', 'account_number'];\n $this->_addAccountfields['India'] = ['account_name', 'bank_name', 'ifsc_code', 'account_number'];\n $this->_addAccountfields['Canada'] = ['account_name', 'bank_name', 'transit_number', 'institution_number', 'account_number'];\n $this->_addAccountfields['Australia'] = ['account_name', 'bank_name', 'bsb', 'account_number'];\n $this->_addAccountfields['New Zealand'] = ['account_name', 'bank_name', 'bsb', 'account_number'];\n $this->_addAccountfields['Japan'] = ['account_name', 'bank_name', 'bank_code', 'branch_code', 'account_type', 'account_number'];\n $this->_addAccountfields['Malaysia'] = ['account_name', 'bank_name', 'meps', 'account_number'];\n $this->_addAccountfields['Mexico'] = ['account_name', 'bank_name', 'account_number'];\n $this->_addAccountfields['Philippines'] = ['account_name', 'bank_name', 'brstn_code', 'account_number'];\n }", "function get_list_states($preselect = null){\n $states = array('AL'=>\"Alabama\",\n 'AK'=>\"Alaska\",\n 'AZ'=>\"Arizona\",\n 'AR'=>\"Arkansas\",\n 'CA'=>\"California\",\n 'CO'=>\"Colorado\",\n 'CT'=>\"Connecticut\",\n 'DE'=>\"Delaware\",\n 'DC'=>\"District Of Columbia\",\n 'FL'=>\"Florida\",\n 'GA'=>\"Georgia\",\n 'HI'=>\"Hawaii\",\n 'ID'=>\"Idaho\",\n 'IL'=>\"Illinois\",\n 'IN'=>\"Indiana\",\n 'IA'=>\"Iowa\",\n 'KS'=>\"Kansas\",\n 'KY'=>\"Kentucky\",\n 'LA'=>\"Louisiana\",\n 'ME'=>\"Maine\",\n 'MD'=>\"Maryland\",\n 'MA'=>\"Massachusetts\",\n 'MI'=>\"Michigan\",\n 'MN'=>\"Minnesota\",\n 'MS'=>\"Mississippi\",\n 'MO'=>\"Missouri\",\n 'MT'=>\"Montana\",\n 'NE'=>\"Nebraska\",\n 'NV'=>\"Nevada\",\n 'NH'=>\"New Hampshire\",\n 'NJ'=>\"New Jersey\",\n 'NM'=>\"New Mexico\",\n 'NY'=>\"New York\",\n 'NC'=>\"North Carolina\",\n 'ND'=>\"North Dakota\",\n 'OH'=>\"Ohio\",\n 'OK'=>\"Oklahoma\",\n 'OR'=>\"Oregon\",\n 'PA'=>\"Pennsylvania\",\n 'RI'=>\"Rhode Island\",\n 'SC'=>\"South Carolina\",\n 'SD'=>\"South Dakota\",\n 'TN'=>\"Tennessee\",\n 'TX'=>\"Texas\",\n 'UT'=>\"Utah\",\n 'VT'=>\"Vermont\",\n 'VA'=>\"Virginia\",\n 'WA'=>\"Washington\",\n 'WV'=>\"West Virginia\",\n 'WI'=>\"Wisconsin\",\n 'WY'=>\"Wyoming\");\n foreach ($states as $key=>$val) {\n if ($preselect == $key) {\n $selected = 'selected';\n } else {\n $selected = null;\n }\n echo '<option value=\"' . $key . '\" ' . $selected . '>' . $val . '</option>';\n }\n }", "public function run()\n {\n //\n\n DB::table('state')->delete();\n $states = array(\n array('name' => \"Andaman and Nicobar Islands\",'id_country' => 101),\n array('name' => \"Andhra Pradesh\",'id_country' => 101),\n array('name' => \"Arunachal Pradesh\",'id_country' => 101),\n array('name' => \"Assam\",'id_country' => 101),\n array('name' => \"Bihar\",'id_country' => 101),\n array('name' => \"Chandigarh\",'id_country' => 101),\n array('name' => \"Chhattisgarh\",'id_country' => 101),\n array('name' => \"Dadra and Nagar Haveli\",'id_country' => 101),\n array('name' => \"Daman and Diu\",'id_country' => 101),\n array('name' => \"Delhi\",'id_country' => 101),\n array('name' => \"Goa\",'id_country' => 101),\n array('name' => \"Gujarat\",'id_country' => 101),\n array('name' => \"Haryana\",'id_country' => 101),\n array('name' => \"Himachal Pradesh\",'id_country' => 101),\n array('name' => \"Jammu and Kashmir\",'id_country' => 101),\n array('name' => \"Jharkhand\",'id_country' => 101),\n array('name' => \"Karnataka\",'id_country' => 101),\n array('name' => \"Kenmore\",'id_country' => 101),\n array('name' => \"Kerala\",'id_country' => 101),\n array('name' => \"Lakshadweep\",'id_country' => 101),\n array('name' => \"Madhya Pradesh\",'id_country' => 101),\n array('name' => \"Maharashtra\",'id_country' => 101),\n array('name' => \"Manipur\",'id_country' => 101),\n array('name' => \"Meghalaya\",'id_country' => 101),\n array('name' => \"Mizoram\",'id_country' => 101),\n array('name' => \"Nagaland\",'id_country' => 101),\n array('name' => \"Narora\",'id_country' => 101),\n array('name' => \"Natwar\",'id_country' => 101),\n array('name' => \"Odisha\",'id_country' => 101),\n array('name' => \"Paschim Medinipur\",'id_country' => 101),\n array('name' => \"Pondicherry\",'id_country' => 101),\n array('name' => \"Punjab\",'id_country' => 101),\n array('name' => \"Rajasthan\",'id_country' => 101),\n array('name' => \"Sikkim\",'id_country' => 101),\n array('name' => \"Tamil Nadu\",'id_country' => 101),\n array('name' => \"Telangana\",'id_country' => 101),\n array('name' => \"Tripura\",'id_country' => 101),\n array('name' => \"Uttar Pradesh\",'id_country' => 101),\n array('name' => \"Uttarakhand\",'id_country' => 101),\n array('name' => \"Vaishali\",'id_country' => 101),\n array('name' => \"West Bengal\",'id_country' => 101),\n array('name' => \"Badakhshan\",'id_country' => 1),\n array('name' => \"Badgis\",'id_country' => 1),\n array('name' => \"Baglan\",'id_country' => 1),\n array('name' => \"Balkh\",'id_country' => 1),\n array('name' => \"Bamiyan\",'id_country' => 1),\n array('name' => \"Farah\",'id_country' => 1),\n array('name' => \"Faryab\",'id_country' => 1),\n array('name' => \"Gawr\",'id_country' => 1),\n array('name' => \"Gazni\",'id_country' => 1),\n array('name' => \"Herat\",'id_country' => 1),\n array('name' => \"Hilmand\",'id_country' => 1),\n array('name' => \"Jawzjan\",'id_country' => 1),\n array('name' => \"Kabul\",'id_country' => 1),\n array('name' => \"Kapisa\",'id_country' => 1),\n array('name' => \"Khawst\",'id_country' => 1),\n array('name' => \"Kunar\",'id_country' => 1),\n array('name' => \"Lagman\",'id_country' => 1),\n array('name' => \"Lawghar\",'id_country' => 1),\n array('name' => \"Nangarhar\",'id_country' => 1),\n array('name' => \"Nimruz\",'id_country' => 1),\n array('name' => \"Nuristan\",'id_country' => 1),\n array('name' => \"Paktika\",'id_country' => 1),\n array('name' => \"Paktiya\",'id_country' => 1),\n array('name' => \"Parwan\",'id_country' => 1),\n array('name' => \"Qandahar\",'id_country' => 1),\n array('name' => \"Qunduz\",'id_country' => 1),\n array('name' => \"Samangan\",'id_country' => 1),\n array('name' => \"Sar-e Pul\",'id_country' => 1),\n array('name' => \"Takhar\",'id_country' => 1),\n array('name' => \"Uruzgan\",'id_country' => 1),\n array('name' => \"Wardak\",'id_country' => 1),\n array('name' => \"Zabul\",'id_country' => 1),\n array('name' => \"Berat\",'id_country' => 2),\n array('name' => \"Bulqize\",'id_country' => 2),\n array('name' => \"Delvine\",'id_country' => 2),\n array('name' => \"Devoll\",'id_country' => 2),\n array('name' => \"Dibre\",'id_country' => 2),\n array('name' => \"Durres\",'id_country' => 2),\n array('name' => \"Elbasan\",'id_country' => 2),\n array('name' => \"Fier\",'id_country' => 2),\n array('name' => \"Gjirokaster\",'id_country' => 2),\n array('name' => \"Gramsh\",'id_country' => 2),\n array('name' => \"Has\",'id_country' => 2),\n array('name' => \"Kavaje\",'id_country' => 2),\n array('name' => \"Kolonje\",'id_country' => 2),\n array('name' => \"Korce\",'id_country' => 2),\n array('name' => \"Kruje\",'id_country' => 2),\n array('name' => \"Kucove\",'id_country' => 2),\n array('name' => \"Kukes\",'id_country' => 2),\n array('name' => \"Kurbin\",'id_country' => 2),\n array('name' => \"Lezhe\",'id_country' => 2),\n array('name' => \"Librazhd\",'id_country' => 2),\n array('name' => \"Lushnje\",'id_country' => 2),\n array('name' => \"Mallakaster\",'id_country' => 2),\n array('name' => \"Malsi e Madhe\",'id_country' => 2),\n array('name' => \"Mat\",'id_country' => 2),\n array('name' => \"Mirdite\",'id_country' => 2),\n array('name' => \"Peqin\",'id_country' => 2),\n array('name' => \"Permet\",'id_country' => 2),\n array('name' => \"Pogradec\",'id_country' => 2),\n array('name' => \"Puke\",'id_country' => 2),\n array('name' => \"Sarande\",'id_country' => 2),\n array('name' => \"Shkoder\",'id_country' => 2),\n array('name' => \"Skrapar\",'id_country' => 2),\n array('name' => \"Tepelene\",'id_country' => 2),\n array('name' => \"Tirane\",'id_country' => 2),\n array('name' => \"Tropoje\",'id_country' => 2),\n array('name' => \"Vlore\",'id_country' => 2),\n array('name' => \"'Ayn Daflah\",'id_country' => 3),\n array('name' => \"'Ayn Tamushanat\",'id_country' => 3),\n array('name' => \"Adrar\",'id_country' => 3),\n array('name' => \"Algiers\",'id_country' => 3),\n array('name' => \"Annabah\",'id_country' => 3),\n array('name' => \"Bashshar\",'id_country' => 3),\n array('name' => \"Batnah\",'id_country' => 3),\n array('name' => \"Bijayah\",'id_country' => 3),\n array('name' => \"Biskrah\",'id_country' => 3),\n array('name' => \"Blidah\",'id_country' => 3),\n array('name' => \"Buirah\",'id_country' => 3),\n array('name' => \"Bumardas\",'id_country' => 3),\n array('name' => \"Burj Bu Arririj\",'id_country' => 3),\n array('name' => \"Ghalizan\",'id_country' => 3),\n array('name' => \"Ghardayah\",'id_country' => 3),\n array('name' => \"Ilizi\",'id_country' => 3),\n array('name' => \"Jijili\",'id_country' => 3),\n array('name' => \"Jilfah\",'id_country' => 3),\n array('name' => \"Khanshalah\",'id_country' => 3),\n array('name' => \"Masilah\",'id_country' => 3),\n array('name' => \"Midyah\",'id_country' => 3),\n array('name' => \"Milah\",'id_country' => 3),\n array('name' => \"Muaskar\",'id_country' => 3),\n array('name' => \"Mustaghanam\",'id_country' => 3),\n array('name' => \"Naama\",'id_country' => 3),\n array('name' => \"Oran\",'id_country' => 3),\n array('name' => \"Ouargla\",'id_country' => 3),\n array('name' => \"Qalmah\",'id_country' => 3),\n array('name' => \"Qustantinah\",'id_country' => 3),\n array('name' => \"Sakikdah\",'id_country' => 3),\n array('name' => \"Satif\",'id_country' => 3),\n array('name' => \"Sayda'\",'id_country' => 3),\n array('name' => \"Sidi ban-al-'Abbas\",'id_country' => 3),\n array('name' => \"Suq Ahras\",'id_country' => 3),\n array('name' => \"Tamanghasat\",'id_country' => 3),\n array('name' => \"Tibazah\",'id_country' => 3),\n array('name' => \"Tibissah\",'id_country' => 3),\n array('name' => \"Tilimsan\",'id_country' => 3),\n array('name' => \"Tinduf\",'id_country' => 3),\n array('name' => \"Tisamsilt\",'id_country' => 3),\n array('name' => \"Tiyarat\",'id_country' => 3),\n array('name' => \"Tizi Wazu\",'id_country' => 3),\n array('name' => \"Umm-al-Bawaghi\",'id_country' => 3),\n array('name' => \"Wahran\",'id_country' => 3),\n array('name' => \"Warqla\",'id_country' => 3),\n array('name' => \"Wilaya d Alger\",'id_country' => 3),\n array('name' => \"Wilaya de Bejaia\",'id_country' => 3),\n array('name' => \"Wilaya de Constantine\",'id_country' => 3),\n array('name' => \"al-Aghwat\",'id_country' => 3),\n array('name' => \"al-Bayadh\",'id_country' => 3),\n array('name' => \"al-Jaza'ir\",'id_country' => 3),\n array('name' => \"al-Wad\",'id_country' => 3),\n array('name' => \"ash-Shalif\",'id_country' => 3),\n array('name' => \"at-Tarif\",'id_country' => 3),\n array('name' => \"Eastern\",'id_country' => 4),\n array('name' => \"Manu'a\",'id_country' => 4),\n array('name' => \"Swains Island\",'id_country' => 4),\n array('name' => \"Western\",'id_country' => 4),\n array('name' => \"Andorra la Vella\",'id_country' => 5),\n array('name' => \"Canillo\",'id_country' => 5),\n array('name' => \"Encamp\",'id_country' => 5),\n array('name' => \"La Massana\",'id_country' => 5),\n array('name' => \"Les Escaldes\",'id_country' => 5),\n array('name' => \"Ordino\",'id_country' => 5),\n array('name' => \"Sant Julia de Loria\",'id_country' => 5),\n array('name' => \"Bengo\",'id_country' => 6),\n array('name' => \"Benguela\",'id_country' => 6),\n array('name' => \"Bie\",'id_country' => 6),\n array('name' => \"Cabinda\",'id_country' => 6),\n array('name' => \"Cunene\",'id_country' => 6),\n array('name' => \"Huambo\",'id_country' => 6),\n array('name' => \"Huila\",'id_country' => 6),\n array('name' => \"Kuando-Kubango\",'id_country' => 6),\n array('name' => \"Kwanza Norte\",'id_country' => 6),\n array('name' => \"Kwanza Sul\",'id_country' => 6),\n array('name' => \"Luanda\",'id_country' => 6),\n array('name' => \"Lunda Norte\",'id_country' => 6),\n array('name' => \"Lunda Sul\",'id_country' => 6),\n array('name' => \"Malanje\",'id_country' => 6),\n array('name' => \"Moxico\",'id_country' => 6),\n array('name' => \"Namibe\",'id_country' => 6),\n array('name' => \"Uige\",'id_country' => 6),\n array('name' => \"Zaire\",'id_country' => 6),\n array('name' => \"Other Provinces\",'id_country' => 7),\n array('name' => \"Sector claimed by Argentina/Ch\",'id_country' => 8),\n array('name' => \"Sector claimed by Argentina/UK\",'id_country' => 8),\n array('name' => \"Sector claimed by Australia\",'id_country' => 8),\n array('name' => \"Sector claimed by France\",'id_country' => 8),\n array('name' => \"Sector claimed by New Zealand\",'id_country' => 8),\n array('name' => \"Sector claimed by Norway\",'id_country' => 8),\n array('name' => \"Unclaimed Sector\",'id_country' => 8),\n array('name' => \"Barbuda\",'id_country' => 9),\n array('name' => \"Saint George\",'id_country' => 9),\n array('name' => \"Saint John\",'id_country' => 9),\n array('name' => \"Saint Mary\",'id_country' => 9),\n array('name' => \"Saint Paul\",'id_country' => 9),\n array('name' => \"Saint Peter\",'id_country' => 9),\n array('name' => \"Saint Philip\",'id_country' => 9),\n array('name' => \"Buenos Aires\",'id_country' => 10),\n array('name' => \"Catamarca\",'id_country' => 10),\n array('name' => \"Chaco\",'id_country' => 10),\n array('name' => \"Chubut\",'id_country' => 10),\n array('name' => \"Cordoba\",'id_country' => 10),\n array('name' => \"Corrientes\",'id_country' => 10),\n array('name' => \"Distrito Federal\",'id_country' => 10),\n array('name' => \"Entre Rios\",'id_country' => 10),\n array('name' => \"Formosa\",'id_country' => 10),\n array('name' => \"Jujuy\",'id_country' => 10),\n array('name' => \"La Pampa\",'id_country' => 10),\n array('name' => \"La Rioja\",'id_country' => 10),\n array('name' => \"Mendoza\",'id_country' => 10),\n array('name' => \"Misiones\",'id_country' => 10),\n array('name' => \"Neuquen\",'id_country' => 10),\n array('name' => \"Rio Negro\",'id_country' => 10),\n array('name' => \"Salta\",'id_country' => 10),\n array('name' => \"San Juan\",'id_country' => 10),\n array('name' => \"San Luis\",'id_country' => 10),\n array('name' => \"Santa Cruz\",'id_country' => 10),\n array('name' => \"Santa Fe\",'id_country' => 10),\n array('name' => \"Santiago del Estero\",'id_country' => 10),\n array('name' => \"Tierra del Fuego\",'id_country' => 10),\n array('name' => \"Tucuman\",'id_country' => 10),\n array('name' => \"Aragatsotn\",'id_country' => 11),\n array('name' => \"Ararat\",'id_country' => 11),\n array('name' => \"Armavir\",'id_country' => 11),\n array('name' => \"Gegharkunik\",'id_country' => 11),\n array('name' => \"Kotaik\",'id_country' => 11),\n array('name' => \"Lori\",'id_country' => 11),\n array('name' => \"Shirak\",'id_country' => 11),\n array('name' => \"Stepanakert\",'id_country' => 11),\n array('name' => \"Syunik\",'id_country' => 11),\n array('name' => \"Tavush\",'id_country' => 11),\n array('name' => \"Vayots Dzor\",'id_country' => 11),\n array('name' => \"Yerevan\",'id_country' => 11),\n array('name' => \"Aruba\",'id_country' => 12),\n array('name' => \"Auckland\",'id_country' => 13),\n array('name' => \"Australian Capital Territory\",'id_country' => 13),\n array('name' => \"Balgowlah\",'id_country' => 13),\n array('name' => \"Balmain\",'id_country' => 13),\n array('name' => \"Bankstown\",'id_country' => 13),\n array('name' => \"Baulkham Hills\",'id_country' => 13),\n array('name' => \"Bonnet Bay\",'id_country' => 13),\n array('name' => \"Camberwell\",'id_country' => 13),\n array('name' => \"Carole Park\",'id_country' => 13),\n array('name' => \"Castle Hill\",'id_country' => 13),\n array('name' => \"Caulfield\",'id_country' => 13),\n array('name' => \"Chatswood\",'id_country' => 13),\n array('name' => \"Cheltenham\",'id_country' => 13),\n array('name' => \"Cherrybrook\",'id_country' => 13),\n array('name' => \"Clayton\",'id_country' => 13),\n array('name' => \"Collingwood\",'id_country' => 13),\n array('name' => \"Frenchs Forest\",'id_country' => 13),\n array('name' => \"Hawthorn\",'id_country' => 13),\n array('name' => \"Jannnali\",'id_country' => 13),\n array('name' => \"Knoxfield\",'id_country' => 13),\n array('name' => \"Melbourne\",'id_country' => 13),\n array('name' => \"New South Wales\",'id_country' => 13),\n array('name' => \"Northern Territory\",'id_country' => 13),\n array('name' => \"Perth\",'id_country' => 13),\n array('name' => \"Queensland\",'id_country' => 13),\n array('name' => \"South Australia\",'id_country' => 13),\n array('name' => \"Tasmania\",'id_country' => 13),\n array('name' => \"Templestowe\",'id_country' => 13),\n array('name' => \"Victoria\",'id_country' => 13),\n array('name' => \"Werribee south\",'id_country' => 13),\n array('name' => \"Western Australia\",'id_country' => 13),\n array('name' => \"Wheeler\",'id_country' => 13),\n array('name' => \"Bundesland Salzburg\",'id_country' => 14),\n array('name' => \"Bundesland Steiermark\",'id_country' => 14),\n array('name' => \"Bundesland Tirol\",'id_country' => 14),\n array('name' => \"Burgenland\",'id_country' => 14),\n array('name' => \"Carinthia\",'id_country' => 14),\n array('name' => \"Karnten\",'id_country' => 14),\n array('name' => \"Liezen\",'id_country' => 14),\n array('name' => \"Lower Austria\",'id_country' => 14),\n array('name' => \"Niederosterreich\",'id_country' => 14),\n array('name' => \"Oberosterreich\",'id_country' => 14),\n array('name' => \"Salzburg\",'id_country' => 14),\n array('name' => \"Schleswig-Holstein\",'id_country' => 14),\n array('name' => \"Steiermark\",'id_country' => 14),\n array('name' => \"Styria\",'id_country' => 14),\n array('name' => \"Tirol\",'id_country' => 14),\n array('name' => \"Upper Austria\",'id_country' => 14),\n array('name' => \"Vorarlberg\",'id_country' => 14),\n array('name' => \"Wien\",'id_country' => 14),\n array('name' => \"Abseron\",'id_country' => 15),\n array('name' => \"Baki Sahari\",'id_country' => 15),\n array('name' => \"Ganca\",'id_country' => 15),\n array('name' => \"Ganja\",'id_country' => 15),\n array('name' => \"Kalbacar\",'id_country' => 15),\n array('name' => \"Lankaran\",'id_country' => 15),\n array('name' => \"Mil-Qarabax\",'id_country' => 15),\n array('name' => \"Mugan-Salyan\",'id_country' => 15),\n array('name' => \"Nagorni-Qarabax\",'id_country' => 15),\n array('name' => \"Naxcivan\",'id_country' => 15),\n array('name' => \"Priaraks\",'id_country' => 15),\n array('name' => \"Qazax\",'id_country' => 15),\n array('name' => \"Saki\",'id_country' => 15),\n array('name' => \"Sirvan\",'id_country' => 15),\n array('name' => \"Xacmaz\",'id_country' => 15),\n array('name' => \"Abaco\",'id_country' => 16),\n array('name' => \"Acklins Island\",'id_country' => 16),\n array('name' => \"Andros\",'id_country' => 16),\n array('name' => \"Berry Islands\",'id_country' => 16),\n array('name' => \"Biminis\",'id_country' => 16),\n array('name' => \"Cat Island\",'id_country' => 16),\n array('name' => \"Crooked Island\",'id_country' => 16),\n array('name' => \"Eleuthera\",'id_country' => 16),\n array('name' => \"Exuma and Cays\",'id_country' => 16),\n array('name' => \"Grand Bahama\",'id_country' => 16),\n array('name' => \"Inagua Islands\",'id_country' => 16),\n array('name' => \"Long Island\",'id_country' => 16),\n array('name' => \"Mayaguana\",'id_country' => 16),\n array('name' => \"New Providence\",'id_country' => 16),\n array('name' => \"Ragged Island\",'id_country' => 16),\n array('name' => \"Rum Cay\",'id_country' => 16),\n array('name' => \"San Salvador\",'id_country' => 16),\n array('name' => \"'Isa\",'id_country' => 17),\n array('name' => \"Badiyah\",'id_country' => 17),\n array('name' => \"Hidd\",'id_country' => 17),\n array('name' => \"Jidd Hafs\",'id_country' => 17),\n array('name' => \"Mahama\",'id_country' => 17),\n array('name' => \"Manama\",'id_country' => 17),\n array('name' => \"Sitrah\",'id_country' => 17),\n array('name' => \"al-Manamah\",'id_country' => 17),\n array('name' => \"al-Muharraq\",'id_country' => 17),\n array('name' => \"ar-Rifa'a\",'id_country' => 17),\n array('name' => \"Bagar Hat\",'id_country' => 18),\n array('name' => \"Bandarban\",'id_country' => 18),\n array('name' => \"Barguna\",'id_country' => 18),\n array('name' => \"Barisal\",'id_country' => 18),\n array('name' => \"Bhola\",'id_country' => 18),\n array('name' => \"Bogora\",'id_country' => 18),\n array('name' => \"Brahman Bariya\",'id_country' => 18),\n array('name' => \"Chandpur\",'id_country' => 18),\n array('name' => \"Chattagam\",'id_country' => 18),\n array('name' => \"Chittagong Division\",'id_country' => 18),\n array('name' => \"Chuadanga\",'id_country' => 18),\n array('name' => \"Dhaka\",'id_country' => 18),\n array('name' => \"Dinajpur\",'id_country' => 18),\n array('name' => \"Faridpur\",'id_country' => 18),\n array('name' => \"Feni\",'id_country' => 18),\n array('name' => \"Gaybanda\",'id_country' => 18),\n array('name' => \"Gazipur\",'id_country' => 18),\n array('name' => \"Gopalganj\",'id_country' => 18),\n array('name' => \"Habiganj\",'id_country' => 18),\n array('name' => \"Jaipur Hat\",'id_country' => 18),\n array('name' => \"Jamalpur\",'id_country' => 18),\n array('name' => \"Jessor\",'id_country' => 18),\n array('name' => \"Jhalakati\",'id_country' => 18),\n array('name' => \"Jhanaydah\",'id_country' => 18),\n array('name' => \"Khagrachhari\",'id_country' => 18),\n array('name' => \"Khulna\",'id_country' => 18),\n array('name' => \"Kishorganj\",'id_country' => 18),\n array('name' => \"Koks Bazar\",'id_country' => 18),\n array('name' => \"Komilla\",'id_country' => 18),\n array('name' => \"Kurigram\",'id_country' => 18),\n array('name' => \"Kushtiya\",'id_country' => 18),\n array('name' => \"Lakshmipur\",'id_country' => 18),\n array('name' => \"Lalmanir Hat\",'id_country' => 18),\n array('name' => \"Madaripur\",'id_country' => 18),\n array('name' => \"Magura\",'id_country' => 18),\n array('name' => \"Maimansingh\",'id_country' => 18),\n array('name' => \"Manikganj\",'id_country' => 18),\n array('name' => \"Maulvi Bazar\",'id_country' => 18),\n array('name' => \"Meherpur\",'id_country' => 18),\n array('name' => \"Munshiganj\",'id_country' => 18),\n array('name' => \"Naral\",'id_country' => 18),\n array('name' => \"Narayanganj\",'id_country' => 18),\n array('name' => \"Narsingdi\",'id_country' => 18),\n array('name' => \"Nator\",'id_country' => 18),\n array('name' => \"Naugaon\",'id_country' => 18),\n array('name' => \"Nawabganj\",'id_country' => 18),\n array('name' => \"Netrakona\",'id_country' => 18),\n array('name' => \"Nilphamari\",'id_country' => 18),\n array('name' => \"Noakhali\",'id_country' => 18),\n array('name' => \"Pabna\",'id_country' => 18),\n array('name' => \"Panchagarh\",'id_country' => 18),\n array('name' => \"Patuakhali\",'id_country' => 18),\n array('name' => \"Pirojpur\",'id_country' => 18),\n array('name' => \"Rajbari\",'id_country' => 18),\n array('name' => \"Rajshahi\",'id_country' => 18),\n array('name' => \"Rangamati\",'id_country' => 18),\n array('name' => \"Rangpur\",'id_country' => 18),\n array('name' => \"Satkhira\",'id_country' => 18),\n array('name' => \"Shariatpur\",'id_country' => 18),\n array('name' => \"Sherpur\",'id_country' => 18),\n array('name' => \"Silhat\",'id_country' => 18),\n array('name' => \"Sirajganj\",'id_country' => 18),\n array('name' => \"Sunamganj\",'id_country' => 18),\n array('name' => \"Tangayal\",'id_country' => 18),\n array('name' => \"Thakurgaon\",'id_country' => 18),\n array('name' => \"Christ Church\",'id_country' => 19),\n array('name' => \"Saint Andrew\",'id_country' => 19),\n array('name' => \"Saint George\",'id_country' => 19),\n array('name' => \"Saint James\",'id_country' => 19),\n array('name' => \"Saint John\",'id_country' => 19),\n array('name' => \"Saint Joseph\",'id_country' => 19),\n array('name' => \"Saint Lucy\",'id_country' => 19),\n array('name' => \"Saint Michael\",'id_country' => 19),\n array('name' => \"Saint Peter\",'id_country' => 19),\n array('name' => \"Saint Philip\",'id_country' => 19),\n array('name' => \"Saint Thomas\",'id_country' => 19),\n array('name' => \"Brest\",'id_country' => 20),\n array('name' => \"Homjel'\",'id_country' => 20),\n array('name' => \"Hrodna\",'id_country' => 20),\n array('name' => \"Mahiljow\",'id_country' => 20),\n array('name' => \"Mahilyowskaya Voblasts\",'id_country' => 20),\n array('name' => \"Minsk\",'id_country' => 20),\n array('name' => \"Minskaja Voblasts'\",'id_country' => 20),\n array('name' => \"Petrik\",'id_country' => 20),\n array('name' => \"Vicebsk\",'id_country' => 20),\n array('name' => \"Antwerpen\",'id_country' => 21),\n array('name' => \"Berchem\",'id_country' => 21),\n array('name' => \"Brabant\",'id_country' => 21),\n array('name' => \"Brabant Wallon\",'id_country' => 21),\n array('name' => \"Brussel\",'id_country' => 21),\n array('name' => \"East Flanders\",'id_country' => 21),\n array('name' => \"Hainaut\",'id_country' => 21),\n array('name' => \"Liege\",'id_country' => 21),\n array('name' => \"Limburg\",'id_country' => 21),\n array('name' => \"Luxembourg\",'id_country' => 21),\n array('name' => \"Namur\",'id_country' => 21),\n array('name' => \"Ontario\",'id_country' => 21),\n array('name' => \"Oost-Vlaanderen\",'id_country' => 21),\n array('name' => \"Provincie Brabant\",'id_country' => 21),\n array('name' => \"Vlaams-Brabant\",'id_country' => 21),\n array('name' => \"Wallonne\",'id_country' => 21),\n array('name' => \"West-Vlaanderen\",'id_country' => 21),\n array('name' => \"Belize\",'id_country' => 22),\n array('name' => \"Cayo\",'id_country' => 22),\n array('name' => \"Corozal\",'id_country' => 22),\n array('name' => \"Orange Walk\",'id_country' => 22),\n array('name' => \"Stann Creek\",'id_country' => 22),\n array('name' => \"Toledo\",'id_country' => 22),\n array('name' => \"Alibori\",'id_country' => 23),\n array('name' => \"Atacora\",'id_country' => 23),\n array('name' => \"Atlantique\",'id_country' => 23),\n array('name' => \"Borgou\",'id_country' => 23),\n array('name' => \"Collines\",'id_country' => 23),\n array('name' => \"Couffo\",'id_country' => 23),\n array('name' => \"Donga\",'id_country' => 23),\n array('name' => \"Littoral\",'id_country' => 23),\n array('name' => \"Mono\",'id_country' => 23),\n array('name' => \"Oueme\",'id_country' => 23),\n array('name' => \"Plateau\",'id_country' => 23),\n array('name' => \"Zou\",'id_country' => 23),\n array('name' => \"Hamilton\",'id_country' => 24),\n array('name' => \"Saint George\",'id_country' => 24),\n array('name' => \"Bumthang\",'id_country' => 25),\n array('name' => \"Chhukha\",'id_country' => 25),\n array('name' => \"Chirang\",'id_country' => 25),\n array('name' => \"Daga\",'id_country' => 25),\n array('name' => \"Geylegphug\",'id_country' => 25),\n array('name' => \"Ha\",'id_country' => 25),\n array('name' => \"Lhuntshi\",'id_country' => 25),\n array('name' => \"Mongar\",'id_country' => 25),\n array('name' => \"Pemagatsel\",'id_country' => 25),\n array('name' => \"Punakha\",'id_country' => 25),\n array('name' => \"Rinpung\",'id_country' => 25),\n array('name' => \"Samchi\",'id_country' => 25),\n array('name' => \"Samdrup Jongkhar\",'id_country' => 25),\n array('name' => \"Shemgang\",'id_country' => 25),\n array('name' => \"Tashigang\",'id_country' => 25),\n array('name' => \"Timphu\",'id_country' => 25),\n array('name' => \"Tongsa\",'id_country' => 25),\n array('name' => \"Wangdiphodrang\",'id_country' => 25),\n array('name' => \"Beni\",'id_country' => 26),\n array('name' => \"Chuquisaca\",'id_country' => 26),\n array('name' => \"Cochabamba\",'id_country' => 26),\n array('name' => \"La Paz\",'id_country' => 26),\n array('name' => \"Oruro\",'id_country' => 26),\n array('name' => \"Pando\",'id_country' => 26),\n array('name' => \"Potosi\",'id_country' => 26),\n array('name' => \"Santa Cruz\",'id_country' => 26),\n array('name' => \"Tarija\",'id_country' => 26),\n array('name' => \"Federacija Bosna i Hercegovina\",'id_country' => 27),\n array('name' => \"Republika Srpska\",'id_country' => 27),\n array('name' => \"Central Bobonong\",'id_country' => 28),\n array('name' => \"Central Boteti\",'id_country' => 28),\n array('name' => \"Central Mahalapye\",'id_country' => 28),\n array('name' => \"Central Serowe-Palapye\",'id_country' => 28),\n array('name' => \"Central Tutume\",'id_country' => 28),\n array('name' => \"Chobe\",'id_country' => 28),\n array('name' => \"Francistown\",'id_country' => 28),\n array('name' => \"Gaborone\",'id_country' => 28),\n array('name' => \"Ghanzi\",'id_country' => 28),\n array('name' => \"Jwaneng\",'id_country' => 28),\n array('name' => \"Kgalagadi North\",'id_country' => 28),\n array('name' => \"Kgalagadi South\",'id_country' => 28),\n array('name' => \"Kgatleng\",'id_country' => 28),\n array('name' => \"Kweneng\",'id_country' => 28),\n array('name' => \"Lobatse\",'id_country' => 28),\n array('name' => \"Ngamiland\",'id_country' => 28),\n array('name' => \"Ngwaketse\",'id_country' => 28),\n array('name' => \"North East\",'id_country' => 28),\n array('name' => \"Okavango\",'id_country' => 28),\n array('name' => \"Orapa\",'id_country' => 28),\n array('name' => \"Selibe Phikwe\",'id_country' => 28),\n array('name' => \"South East\",'id_country' => 28),\n array('name' => \"Sowa\",'id_country' => 28),\n array('name' => \"Bouvet Island\",'id_country' => 29),\n array('name' => \"Acre\",'id_country' => 30),\n array('name' => \"Alagoas\",'id_country' => 30),\n array('name' => \"Amapa\",'id_country' => 30),\n array('name' => \"Amazonas\",'id_country' => 30),\n array('name' => \"Bahia\",'id_country' => 30),\n array('name' => \"Ceara\",'id_country' => 30),\n array('name' => \"Distrito Federal\",'id_country' => 30),\n array('name' => \"Espirito Santo\",'id_country' => 30),\n array('name' => \"Estado de Sao Paulo\",'id_country' => 30),\n array('name' => \"Goias\",'id_country' => 30),\n array('name' => \"Maranhao\",'id_country' => 30),\n array('name' => \"Mato Grosso\",'id_country' => 30),\n array('name' => \"Mato Grosso do Sul\",'id_country' => 30),\n array('name' => \"Minas Gerais\",'id_country' => 30),\n array('name' => \"Para\",'id_country' => 30),\n array('name' => \"Paraiba\",'id_country' => 30),\n array('name' => \"Parana\",'id_country' => 30),\n array('name' => \"Pernambuco\",'id_country' => 30),\n array('name' => \"Piaui\",'id_country' => 30),\n array('name' => \"Rio Grande do Norte\",'id_country' => 30),\n array('name' => \"Rio Grande do Sul\",'id_country' => 30),\n array('name' => \"Rio de Janeiro\",'id_country' => 30),\n array('name' => \"Rondonia\",'id_country' => 30),\n array('name' => \"Roraima\",'id_country' => 30),\n array('name' => \"Santa Catarina\",'id_country' => 30),\n array('name' => \"Sao Paulo\",'id_country' => 30),\n array('name' => \"Sergipe\",'id_country' => 30),\n array('name' => \"Tocantins\",'id_country' => 30),\n array('name' => \"British Indian Ocean Territory\",'id_country' => 31),\n array('name' => \"Belait\",'id_country' => 32),\n array('name' => \"Brunei-Muara\",'id_country' => 32),\n array('name' => \"Temburong\",'id_country' => 32),\n array('name' => \"Tutong\",'id_country' => 32),\n array('name' => \"Blagoevgrad\",'id_country' => 33),\n array('name' => \"Burgas\",'id_country' => 33),\n array('name' => \"Dobrich\",'id_country' => 33),\n array('name' => \"Gabrovo\",'id_country' => 33),\n array('name' => \"Haskovo\",'id_country' => 33),\n array('name' => \"Jambol\",'id_country' => 33),\n array('name' => \"Kardzhali\",'id_country' => 33),\n array('name' => \"Kjustendil\",'id_country' => 33),\n array('name' => \"Lovech\",'id_country' => 33),\n array('name' => \"Montana\",'id_country' => 33),\n array('name' => \"Oblast Sofiya-Grad\",'id_country' => 33),\n array('name' => \"Pazardzhik\",'id_country' => 33),\n array('name' => \"Pernik\",'id_country' => 33),\n array('name' => \"Pleven\",'id_country' => 33),\n array('name' => \"Plovdiv\",'id_country' => 33),\n array('name' => \"Razgrad\",'id_country' => 33),\n array('name' => \"Ruse\",'id_country' => 33),\n array('name' => \"Shumen\",'id_country' => 33),\n array('name' => \"Silistra\",'id_country' => 33),\n array('name' => \"Sliven\",'id_country' => 33),\n array('name' => \"Smoljan\",'id_country' => 33),\n array('name' => \"Sofija grad\",'id_country' => 33),\n array('name' => \"Sofijska oblast\",'id_country' => 33),\n array('name' => \"Stara Zagora\",'id_country' => 33),\n array('name' => \"Targovishte\",'id_country' => 33),\n array('name' => \"Varna\",'id_country' => 33),\n array('name' => \"Veliko Tarnovo\",'id_country' => 33),\n array('name' => \"Vidin\",'id_country' => 33),\n array('name' => \"Vraca\",'id_country' => 33),\n array('name' => \"Yablaniza\",'id_country' => 33),\n array('name' => \"Bale\",'id_country' => 34),\n array('name' => \"Bam\",'id_country' => 34),\n array('name' => \"Bazega\",'id_country' => 34),\n array('name' => \"Bougouriba\",'id_country' => 34),\n array('name' => \"Boulgou\",'id_country' => 34),\n array('name' => \"Boulkiemde\",'id_country' => 34),\n array('name' => \"Comoe\",'id_country' => 34),\n array('name' => \"Ganzourgou\",'id_country' => 34),\n array('name' => \"Gnagna\",'id_country' => 34),\n array('name' => \"Gourma\",'id_country' => 34),\n array('name' => \"Houet\",'id_country' => 34),\n array('name' => \"Ioba\",'id_country' => 34),\n array('name' => \"Kadiogo\",'id_country' => 34),\n array('name' => \"Kenedougou\",'id_country' => 34),\n array('name' => \"Komandjari\",'id_country' => 34),\n array('name' => \"Kompienga\",'id_country' => 34),\n array('name' => \"Kossi\",'id_country' => 34),\n array('name' => \"Kouritenga\",'id_country' => 34),\n array('name' => \"Kourweogo\",'id_country' => 34),\n array('name' => \"Leraba\",'id_country' => 34),\n array('name' => \"Mouhoun\",'id_country' => 34),\n array('name' => \"Nahouri\",'id_country' => 34),\n array('name' => \"Namentenga\",'id_country' => 34),\n array('name' => \"Noumbiel\",'id_country' => 34),\n array('name' => \"Oubritenga\",'id_country' => 34),\n array('name' => \"Oudalan\",'id_country' => 34),\n array('name' => \"Passore\",'id_country' => 34),\n array('name' => \"Poni\",'id_country' => 34),\n array('name' => \"Sanguie\",'id_country' => 34),\n array('name' => \"Sanmatenga\",'id_country' => 34),\n array('name' => \"Seno\",'id_country' => 34),\n array('name' => \"Sissili\",'id_country' => 34),\n array('name' => \"Soum\",'id_country' => 34),\n array('name' => \"Sourou\",'id_country' => 34),\n array('name' => \"Tapoa\",'id_country' => 34),\n array('name' => \"Tuy\",'id_country' => 34),\n array('name' => \"Yatenga\",'id_country' => 34),\n array('name' => \"Zondoma\",'id_country' => 34),\n array('name' => \"Zoundweogo\",'id_country' => 34),\n array('name' => \"Bubanza\",'id_country' => 35),\n array('name' => \"Bujumbura\",'id_country' => 35),\n array('name' => \"Bururi\",'id_country' => 35),\n array('name' => \"Cankuzo\",'id_country' => 35),\n array('name' => \"Cibitoke\",'id_country' => 35),\n array('name' => \"Gitega\",'id_country' => 35),\n array('name' => \"Karuzi\",'id_country' => 35),\n array('name' => \"Kayanza\",'id_country' => 35),\n array('name' => \"Kirundo\",'id_country' => 35),\n array('name' => \"Makamba\",'id_country' => 35),\n array('name' => \"Muramvya\",'id_country' => 35),\n array('name' => \"Muyinga\",'id_country' => 35),\n array('name' => \"Ngozi\",'id_country' => 35),\n array('name' => \"Rutana\",'id_country' => 35),\n array('name' => \"Ruyigi\",'id_country' => 35),\n array('name' => \"Banteay Mean Chey\",'id_country' => 36),\n array('name' => \"Bat Dambang\",'id_country' => 36),\n array('name' => \"Kampong Cham\",'id_country' => 36),\n array('name' => \"Kampong Chhnang\",'id_country' => 36),\n array('name' => \"Kampong Spoeu\",'id_country' => 36),\n array('name' => \"Kampong Thum\",'id_country' => 36),\n array('name' => \"Kampot\",'id_country' => 36),\n array('name' => \"Kandal\",'id_country' => 36),\n array('name' => \"Kaoh Kong\",'id_country' => 36),\n array('name' => \"Kracheh\",'id_country' => 36),\n array('name' => \"Krong Kaeb\",'id_country' => 36),\n array('name' => \"Krong Pailin\",'id_country' => 36),\n array('name' => \"Krong Preah Sihanouk\",'id_country' => 36),\n array('name' => \"Mondol Kiri\",'id_country' => 36),\n array('name' => \"Otdar Mean Chey\",'id_country' => 36),\n array('name' => \"Phnum Penh\",'id_country' => 36),\n array('name' => \"Pousat\",'id_country' => 36),\n array('name' => \"Preah Vihear\",'id_country' => 36),\n array('name' => \"Prey Veaeng\",'id_country' => 36),\n array('name' => \"Rotanak Kiri\",'id_country' => 36),\n array('name' => \"Siem Reab\",'id_country' => 36),\n array('name' => \"Stueng Traeng\",'id_country' => 36),\n array('name' => \"Svay Rieng\",'id_country' => 36),\n array('name' => \"Takaev\",'id_country' => 36),\n array('name' => \"Adamaoua\",'id_country' => 37),\n array('name' => \"Centre\",'id_country' => 37),\n array('name' => \"Est\",'id_country' => 37),\n array('name' => \"Littoral\",'id_country' => 37),\n array('name' => \"Nord\",'id_country' => 37),\n array('name' => \"Nord Extreme\",'id_country' => 37),\n array('name' => \"Nordouest\",'id_country' => 37),\n array('name' => \"Ouest\",'id_country' => 37),\n array('name' => \"Sud\",'id_country' => 37),\n array('name' => \"Sudouest\",'id_country' => 37),\n array('name' => \"Alberta\",'id_country' => 38),\n array('name' => \"British Columbia\",'id_country' => 38),\n array('name' => \"Manitoba\",'id_country' => 38),\n array('name' => \"New Brunswick\",'id_country' => 38),\n array('name' => \"Newfoundland and Labrador\",'id_country' => 38),\n array('name' => \"Northwest Territories\",'id_country' => 38),\n array('name' => \"Nova Scotia\",'id_country' => 38),\n array('name' => \"Nunavut\",'id_country' => 38),\n array('name' => \"Ontario\",'id_country' => 38),\n array('name' => \"Prince Edward Island\",'id_country' => 38),\n array('name' => \"Quebec\",'id_country' => 38),\n array('name' => \"Saskatchewan\",'id_country' => 38),\n array('name' => \"Yukon\",'id_country' => 38),\n array('name' => \"Boavista\",'id_country' => 39),\n array('name' => \"Brava\",'id_country' => 39),\n array('name' => \"Fogo\",'id_country' => 39),\n array('name' => \"Maio\",'id_country' => 39),\n array('name' => \"Sal\",'id_country' => 39),\n array('name' => \"Santo Antao\",'id_country' => 39),\n array('name' => \"Sao Nicolau\",'id_country' => 39),\n array('name' => \"Sao Tiago\",'id_country' => 39),\n array('name' => \"Sao Vicente\",'id_country' => 39),\n array('name' => \"Grand Cayman\",'id_country' => 40),\n array('name' => \"Bamingui-Bangoran\",'id_country' => 41),\n array('name' => \"Bangui\",'id_country' => 41),\n array('name' => \"Basse-Kotto\",'id_country' => 41),\n array('name' => \"Haut-Mbomou\",'id_country' => 41),\n array('name' => \"Haute-Kotto\",'id_country' => 41),\n array('name' => \"Kemo\",'id_country' => 41),\n array('name' => \"Lobaye\",'id_country' => 41),\n array('name' => \"Mambere-Kadei\",'id_country' => 41),\n array('name' => \"Mbomou\",'id_country' => 41),\n array('name' => \"Nana-Gribizi\",'id_country' => 41),\n array('name' => \"Nana-Mambere\",'id_country' => 41),\n array('name' => \"Ombella Mpoko\",'id_country' => 41),\n array('name' => \"Ouaka\",'id_country' => 41),\n array('name' => \"Ouham\",'id_country' => 41),\n array('name' => \"Ouham-Pende\",'id_country' => 41),\n array('name' => \"Sangha-Mbaere\",'id_country' => 41),\n array('name' => \"Vakaga\",'id_country' => 41),\n array('name' => \"Batha\",'id_country' => 42),\n array('name' => \"Biltine\",'id_country' => 42),\n array('name' => \"Bourkou-Ennedi-Tibesti\",'id_country' => 42),\n array('name' => \"Chari-Baguirmi\",'id_country' => 42),\n array('name' => \"Guera\",'id_country' => 42),\n array('name' => \"Kanem\",'id_country' => 42),\n array('name' => \"Lac\",'id_country' => 42),\n array('name' => \"Logone Occidental\",'id_country' => 42),\n array('name' => \"Logone Oriental\",'id_country' => 42),\n array('name' => \"Mayo-Kebbi\",'id_country' => 42),\n array('name' => \"Moyen-Chari\",'id_country' => 42),\n array('name' => \"Ouaddai\",'id_country' => 42),\n array('name' => \"Salamat\",'id_country' => 42),\n array('name' => \"Tandjile\",'id_country' => 42),\n array('name' => \"Aisen\",'id_country' => 43),\n array('name' => \"Antofagasta\",'id_country' => 43),\n array('name' => \"Araucania\",'id_country' => 43),\n array('name' => \"Atacama\",'id_country' => 43),\n array('name' => \"Bio Bio\",'id_country' => 43),\n array('name' => \"Coquimbo\",'id_country' => 43),\n array('name' => \"Libertador General Bernardo O'\",'id_country' => 43),\n array('name' => \"Los Lagos\",'id_country' => 43),\n array('name' => \"Magellanes\",'id_country' => 43),\n array('name' => \"Maule\",'id_country' => 43),\n array('name' => \"Metropolitana\",'id_country' => 43),\n array('name' => \"Metropolitana de Santiago\",'id_country' => 43),\n array('name' => \"Tarapaca\",'id_country' => 43),\n array('name' => \"Valparaiso\",'id_country' => 43),\n array('name' => \"Anhui\",'id_country' => 44),\n array('name' => \"Anhui Province\",'id_country' => 44),\n array('name' => \"Anhui Sheng\",'id_country' => 44),\n array('name' => \"Aomen\",'id_country' => 44),\n array('name' => \"Beijing\",'id_country' => 44),\n array('name' => \"Beijing Shi\",'id_country' => 44),\n array('name' => \"Chongqing\",'id_country' => 44),\n array('name' => \"Fujian\",'id_country' => 44),\n array('name' => \"Fujian Sheng\",'id_country' => 44),\n array('name' => \"Gansu\",'id_country' => 44),\n array('name' => \"Guangdong\",'id_country' => 44),\n array('name' => \"Guangdong Sheng\",'id_country' => 44),\n array('name' => \"Guangxi\",'id_country' => 44),\n array('name' => \"Guizhou\",'id_country' => 44),\n array('name' => \"Hainan\",'id_country' => 44),\n array('name' => \"Hebei\",'id_country' => 44),\n array('name' => \"Heilongjiang\",'id_country' => 44),\n array('name' => \"Henan\",'id_country' => 44),\n array('name' => \"Hubei\",'id_country' => 44),\n array('name' => \"Hunan\",'id_country' => 44),\n array('name' => \"Jiangsu\",'id_country' => 44),\n array('name' => \"Jiangsu Sheng\",'id_country' => 44),\n array('name' => \"Jiangxi\",'id_country' => 44),\n array('name' => \"Jilin\",'id_country' => 44),\n array('name' => \"Liaoning\",'id_country' => 44),\n array('name' => \"Liaoning Sheng\",'id_country' => 44),\n array('name' => \"Nei Monggol\",'id_country' => 44),\n array('name' => \"Ningxia Hui\",'id_country' => 44),\n array('name' => \"Qinghai\",'id_country' => 44),\n array('name' => \"Shaanxi\",'id_country' => 44),\n array('name' => \"Shandong\",'id_country' => 44),\n array('name' => \"Shandong Sheng\",'id_country' => 44),\n array('name' => \"Shanghai\",'id_country' => 44),\n array('name' => \"Shanxi\",'id_country' => 44),\n array('name' => \"Sichuan\",'id_country' => 44),\n array('name' => \"Tianjin\",'id_country' => 44),\n array('name' => \"Xianggang\",'id_country' => 44),\n array('name' => \"Xinjiang\",'id_country' => 44),\n array('name' => \"Xizang\",'id_country' => 44),\n array('name' => \"Yunnan\",'id_country' => 44),\n array('name' => \"Zhejiang\",'id_country' => 44),\n array('name' => \"Zhejiang Sheng\",'id_country' => 44),\n array('name' => \"Christmas Island\",'id_country' => 45),\n array('name' => \"Cocos (Keeling) Islands\",'id_country' => 46),\n array('name' => \"Amazonas\",'id_country' => 47),\n array('name' => \"Antioquia\",'id_country' => 47),\n array('name' => \"Arauca\",'id_country' => 47),\n array('name' => \"Atlantico\",'id_country' => 47),\n array('name' => \"Bogota\",'id_country' => 47),\n array('name' => \"Bolivar\",'id_country' => 47),\n array('name' => \"Boyaca\",'id_country' => 47),\n array('name' => \"Caldas\",'id_country' => 47),\n array('name' => \"Caqueta\",'id_country' => 47),\n array('name' => \"Casanare\",'id_country' => 47),\n array('name' => \"Cauca\",'id_country' => 47),\n array('name' => \"Cesar\",'id_country' => 47),\n array('name' => \"Choco\",'id_country' => 47),\n array('name' => \"Cordoba\",'id_country' => 47),\n array('name' => \"Cundinamarca\",'id_country' => 47),\n array('name' => \"Guainia\",'id_country' => 47),\n array('name' => \"Guaviare\",'id_country' => 47),\n array('name' => \"Huila\",'id_country' => 47),\n array('name' => \"La Guajira\",'id_country' => 47),\n array('name' => \"Magdalena\",'id_country' => 47),\n array('name' => \"Meta\",'id_country' => 47),\n array('name' => \"Narino\",'id_country' => 47),\n array('name' => \"Norte de Santander\",'id_country' => 47),\n array('name' => \"Putumayo\",'id_country' => 47),\n array('name' => \"Quindio\",'id_country' => 47),\n array('name' => \"Risaralda\",'id_country' => 47),\n array('name' => \"San Andres y Providencia\",'id_country' => 47),\n array('name' => \"Santander\",'id_country' => 47),\n array('name' => \"Sucre\",'id_country' => 47),\n array('name' => \"Tolima\",'id_country' => 47),\n array('name' => \"Valle del Cauca\",'id_country' => 47),\n array('name' => \"Vaupes\",'id_country' => 47),\n array('name' => \"Vichada\",'id_country' => 47),\n array('name' => \"Mwali\",'id_country' => 48),\n array('name' => \"Njazidja\",'id_country' => 48),\n array('name' => \"Nzwani\",'id_country' => 48),\n array('name' => \"Bouenza\",'id_country' => 49),\n array('name' => \"Brazzaville\",'id_country' => 49),\n array('name' => \"Cuvette\",'id_country' => 49),\n array('name' => \"Kouilou\",'id_country' => 49),\n array('name' => \"Lekoumou\",'id_country' => 49),\n array('name' => \"Likouala\",'id_country' => 49),\n array('name' => \"Niari\",'id_country' => 49),\n array('name' => \"Plateaux\",'id_country' => 49),\n array('name' => \"Pool\",'id_country' => 49),\n array('name' => \"Sangha\",'id_country' => 49),\n array('name' => \"Bandundu\",'id_country' => 50),\n array('name' => \"Bas-Congo\",'id_country' => 50),\n array('name' => \"Equateur\",'id_country' => 50),\n array('name' => \"Haut-Congo\",'id_country' => 50),\n array('name' => \"Kasai-Occidental\",'id_country' => 50),\n array('name' => \"Kasai-Oriental\",'id_country' => 50),\n array('name' => \"Katanga\",'id_country' => 50),\n array('name' => \"Kinshasa\",'id_country' => 50),\n array('name' => \"Maniema\",'id_country' => 50),\n array('name' => \"Nord-Kivu\",'id_country' => 50),\n array('name' => \"Sud-Kivu\",'id_country' => 50),\n array('name' => \"Aitutaki\",'id_country' => 51),\n array('name' => \"Atiu\",'id_country' => 51),\n array('name' => \"Mangaia\",'id_country' => 51),\n array('name' => \"Manihiki\",'id_country' => 51),\n array('name' => \"Mauke\",'id_country' => 51),\n array('name' => \"Mitiaro\",'id_country' => 51),\n array('name' => \"Nassau\",'id_country' => 51),\n array('name' => \"Pukapuka\",'id_country' => 51),\n array('name' => \"Rakahanga\",'id_country' => 51),\n array('name' => \"Rarotonga\",'id_country' => 51),\n array('name' => \"Tongareva\",'id_country' => 51),\n array('name' => \"Alajuela\",'id_country' => 52),\n array('name' => \"Cartago\",'id_country' => 52),\n array('name' => \"Guanacaste\",'id_country' => 52),\n array('name' => \"Heredia\",'id_country' => 52),\n array('name' => \"Limon\",'id_country' => 52),\n array('name' => \"Puntarenas\",'id_country' => 52),\n array('name' => \"San Jose\",'id_country' => 52),\n array('name' => \"Abidjan\",'id_country' => 53),\n array('name' => \"Agneby\",'id_country' => 53),\n array('name' => \"Bafing\",'id_country' => 53),\n array('name' => \"Denguele\",'id_country' => 53),\n array('name' => \"Dix-huit Montagnes\",'id_country' => 53),\n array('name' => \"Fromager\",'id_country' => 53),\n array('name' => \"Haut-Sassandra\",'id_country' => 53),\n array('name' => \"Lacs\",'id_country' => 53),\n array('name' => \"Lagunes\",'id_country' => 53),\n array('name' => \"Marahoue\",'id_country' => 53),\n array('name' => \"Moyen-Cavally\",'id_country' => 53),\n array('name' => \"Moyen-Comoe\",'id_country' => 53),\n array('name' => \"N'zi-Comoe\",'id_country' => 53),\n array('name' => \"Sassandra\",'id_country' => 53),\n array('name' => \"Savanes\",'id_country' => 53),\n array('name' => \"Sud-Bandama\",'id_country' => 53),\n array('name' => \"Sud-Comoe\",'id_country' => 53),\n array('name' => \"Vallee du Bandama\",'id_country' => 53),\n array('name' => \"Worodougou\",'id_country' => 53),\n array('name' => \"Zanzan\",'id_country' => 53),\n array('name' => \"Bjelovar-Bilogora\",'id_country' => 54),\n array('name' => \"Dubrovnik-Neretva\",'id_country' => 54),\n array('name' => \"Grad Zagreb\",'id_country' => 54),\n array('name' => \"Istra\",'id_country' => 54),\n array('name' => \"Karlovac\",'id_country' => 54),\n array('name' => \"Koprivnica-Krizhevci\",'id_country' => 54),\n array('name' => \"Krapina-Zagorje\",'id_country' => 54),\n array('name' => \"Lika-Senj\",'id_country' => 54),\n array('name' => \"Medhimurje\",'id_country' => 54),\n array('name' => \"Medimurska Zupanija\",'id_country' => 54),\n array('name' => \"Osijek-Baranja\",'id_country' => 54),\n array('name' => \"Osjecko-Baranjska Zupanija\",'id_country' => 54),\n array('name' => \"Pozhega-Slavonija\",'id_country' => 54),\n array('name' => \"Primorje-Gorski Kotar\",'id_country' => 54),\n array('name' => \"Shibenik-Knin\",'id_country' => 54),\n array('name' => \"Sisak-Moslavina\",'id_country' => 54),\n array('name' => \"Slavonski Brod-Posavina\",'id_country' => 54),\n array('name' => \"Split-Dalmacija\",'id_country' => 54),\n array('name' => \"Varazhdin\",'id_country' => 54),\n array('name' => \"Virovitica-Podravina\",'id_country' => 54),\n array('name' => \"Vukovar-Srijem\",'id_country' => 54),\n array('name' => \"Zadar\",'id_country' => 54),\n array('name' => \"Zagreb\",'id_country' => 54),\n array('name' => \"Camaguey\",'id_country' => 55),\n array('name' => \"Ciego de Avila\",'id_country' => 55),\n array('name' => \"Cienfuegos\",'id_country' => 55),\n array('name' => \"Ciudad de la Habana\",'id_country' => 55),\n array('name' => \"Granma\",'id_country' => 55),\n array('name' => \"Guantanamo\",'id_country' => 55),\n array('name' => \"Habana\",'id_country' => 55),\n array('name' => \"Holguin\",'id_country' => 55),\n array('name' => \"Isla de la Juventud\",'id_country' => 55),\n array('name' => \"La Habana\",'id_country' => 55),\n array('name' => \"Las Tunas\",'id_country' => 55),\n array('name' => \"Matanzas\",'id_country' => 55),\n array('name' => \"Pinar del Rio\",'id_country' => 55),\n array('name' => \"Sancti Spiritus\",'id_country' => 55),\n array('name' => \"Santiago de Cuba\",'id_country' => 55),\n array('name' => \"Villa Clara\",'id_country' => 55),\n array('name' => \"Government controlled area\",'id_country' => 56),\n array('name' => \"Limassol\",'id_country' => 56),\n array('name' => \"Nicosia District\",'id_country' => 56),\n array('name' => \"Paphos\",'id_country' => 56),\n array('name' => \"Turkish controlled area\",'id_country' => 56),\n array('name' => \"Central Bohemian\",'id_country' => 57),\n array('name' => \"Frycovice\",'id_country' => 57),\n array('name' => \"Jihocesky Kraj\",'id_country' => 57),\n array('name' => \"Jihochesky\",'id_country' => 57),\n array('name' => \"Jihomoravsky\",'id_country' => 57),\n array('name' => \"Karlovarsky\",'id_country' => 57),\n array('name' => \"Klecany\",'id_country' => 57),\n array('name' => \"Kralovehradecky\",'id_country' => 57),\n array('name' => \"Liberecky\",'id_country' => 57),\n array('name' => \"Lipov\",'id_country' => 57),\n array('name' => \"Moravskoslezsky\",'id_country' => 57),\n array('name' => \"Olomoucky\",'id_country' => 57),\n array('name' => \"Olomoucky Kraj\",'id_country' => 57),\n array('name' => \"Pardubicky\",'id_country' => 57),\n array('name' => \"Plzensky\",'id_country' => 57),\n array('name' => \"Praha\",'id_country' => 57),\n array('name' => \"Rajhrad\",'id_country' => 57),\n array('name' => \"Smirice\",'id_country' => 57),\n array('name' => \"South Moravian\",'id_country' => 57),\n array('name' => \"Straz nad Nisou\",'id_country' => 57),\n array('name' => \"Stredochesky\",'id_country' => 57),\n array('name' => \"Unicov\",'id_country' => 57),\n array('name' => \"Ustecky\",'id_country' => 57),\n array('name' => \"Valletta\",'id_country' => 57),\n array('name' => \"Velesin\",'id_country' => 57),\n array('name' => \"Vysochina\",'id_country' => 57),\n array('name' => \"Zlinsky\",'id_country' => 57),\n array('name' => \"Arhus\",'id_country' => 58),\n array('name' => \"Bornholm\",'id_country' => 58),\n array('name' => \"Frederiksborg\",'id_country' => 58),\n array('name' => \"Fyn\",'id_country' => 58),\n array('name' => \"Hovedstaden\",'id_country' => 58),\n array('name' => \"Kobenhavn\",'id_country' => 58),\n array('name' => \"Kobenhavns Amt\",'id_country' => 58),\n array('name' => \"Kobenhavns Kommune\",'id_country' => 58),\n array('name' => \"Nordjylland\",'id_country' => 58),\n array('name' => \"Ribe\",'id_country' => 58),\n array('name' => \"Ringkobing\",'id_country' => 58),\n array('name' => \"Roervig\",'id_country' => 58),\n array('name' => \"Roskilde\",'id_country' => 58),\n array('name' => \"Roslev\",'id_country' => 58),\n array('name' => \"Sjaelland\",'id_country' => 58),\n array('name' => \"Soeborg\",'id_country' => 58),\n array('name' => \"Sonderjylland\",'id_country' => 58),\n array('name' => \"Storstrom\",'id_country' => 58),\n array('name' => \"Syddanmark\",'id_country' => 58),\n array('name' => \"Toelloese\",'id_country' => 58),\n array('name' => \"Vejle\",'id_country' => 58),\n array('name' => \"Vestsjalland\",'id_country' => 58),\n array('name' => \"Viborg\",'id_country' => 58),\n array('name' => \"'Ali Sabih\",'id_country' => 59),\n array('name' => \"Dikhil\",'id_country' => 59),\n array('name' => \"Jibuti\",'id_country' => 59),\n array('name' => \"Tajurah\",'id_country' => 59),\n array('name' => \"Ubuk\",'id_country' => 59),\n array('name' => \"Saint Andrew\",'id_country' => 60),\n array('name' => \"Saint David\",'id_country' => 60),\n array('name' => \"Saint George\",'id_country' => 60),\n array('name' => \"Saint John\",'id_country' => 60),\n array('name' => \"Saint Joseph\",'id_country' => 60),\n array('name' => \"Saint Luke\",'id_country' => 60),\n array('name' => \"Saint Mark\",'id_country' => 60),\n array('name' => \"Saint Patrick\",'id_country' => 60),\n array('name' => \"Saint Paul\",'id_country' => 60),\n array('name' => \"Saint Peter\",'id_country' => 60),\n array('name' => \"Azua\",'id_country' => 61),\n array('name' => \"Bahoruco\",'id_country' => 61),\n array('name' => \"Barahona\",'id_country' => 61),\n array('name' => \"Dajabon\",'id_country' => 61),\n array('name' => \"Distrito Nacional\",'id_country' => 61),\n array('name' => \"Duarte\",'id_country' => 61),\n array('name' => \"El Seybo\",'id_country' => 61),\n array('name' => \"Elias Pina\",'id_country' => 61),\n array('name' => \"Espaillat\",'id_country' => 61),\n array('name' => \"Hato Mayor\",'id_country' => 61),\n array('name' => \"Independencia\",'id_country' => 61),\n array('name' => \"La Altagracia\",'id_country' => 61),\n array('name' => \"La Romana\",'id_country' => 61),\n array('name' => \"La Vega\",'id_country' => 61),\n array('name' => \"Maria Trinidad Sanchez\",'id_country' => 61),\n array('name' => \"Monsenor Nouel\",'id_country' => 61),\n array('name' => \"Monte Cristi\",'id_country' => 61),\n array('name' => \"Monte Plata\",'id_country' => 61),\n array('name' => \"Pedernales\",'id_country' => 61),\n array('name' => \"Peravia\",'id_country' => 61),\n array('name' => \"Puerto Plata\",'id_country' => 61),\n array('name' => \"Salcedo\",'id_country' => 61),\n array('name' => \"Samana\",'id_country' => 61),\n array('name' => \"San Cristobal\",'id_country' => 61),\n array('name' => \"San Juan\",'id_country' => 61),\n array('name' => \"San Pedro de Macoris\",'id_country' => 61),\n array('name' => \"Sanchez Ramirez\",'id_country' => 61),\n array('name' => \"Santiago\",'id_country' => 61),\n array('name' => \"Santiago Rodriguez\",'id_country' => 61),\n array('name' => \"Valverde\",'id_country' => 61),\n array('name' => \"Aileu\",'id_country' => 62),\n array('name' => \"Ainaro\",'id_country' => 62),\n array('name' => \"Ambeno\",'id_country' => 62),\n array('name' => \"Baucau\",'id_country' => 62),\n array('name' => \"Bobonaro\",'id_country' => 62),\n array('name' => \"Cova Lima\",'id_country' => 62),\n array('name' => \"Dili\",'id_country' => 62),\n array('name' => \"Ermera\",'id_country' => 62),\n array('name' => \"Lautem\",'id_country' => 62),\n array('name' => \"Liquica\",'id_country' => 62),\n array('name' => \"Manatuto\",'id_country' => 62),\n array('name' => \"Manufahi\",'id_country' => 62),\n array('name' => \"Viqueque\",'id_country' => 62),\n array('name' => \"Azuay\",'id_country' => 63),\n array('name' => \"Bolivar\",'id_country' => 63),\n array('name' => \"Canar\",'id_country' => 63),\n array('name' => \"Carchi\",'id_country' => 63),\n array('name' => \"Chimborazo\",'id_country' => 63),\n array('name' => \"Cotopaxi\",'id_country' => 63),\n array('name' => \"El Oro\",'id_country' => 63),\n array('name' => \"Esmeraldas\",'id_country' => 63),\n array('name' => \"Galapagos\",'id_country' => 63),\n array('name' => \"Guayas\",'id_country' => 63),\n array('name' => \"Imbabura\",'id_country' => 63),\n array('name' => \"Loja\",'id_country' => 63),\n array('name' => \"Los Rios\",'id_country' => 63),\n array('name' => \"Manabi\",'id_country' => 63),\n array('name' => \"Morona Santiago\",'id_country' => 63),\n array('name' => \"Napo\",'id_country' => 63),\n array('name' => \"Orellana\",'id_country' => 63),\n array('name' => \"Pastaza\",'id_country' => 63),\n array('name' => \"Pichincha\",'id_country' => 63),\n array('name' => \"Sucumbios\",'id_country' => 63),\n array('name' => \"Tungurahua\",'id_country' => 63),\n array('name' => \"Zamora Chinchipe\",'id_country' => 63),\n array('name' => \"Aswan\",'id_country' => 64),\n array('name' => \"Asyut\",'id_country' => 64),\n array('name' => \"Bani Suwayf\",'id_country' => 64),\n array('name' => \"Bur Sa'id\",'id_country' => 64),\n array('name' => \"Cairo\",'id_country' => 64),\n array('name' => \"Dumyat\",'id_country' => 64),\n array('name' => \"Kafr-ash-Shaykh\",'id_country' => 64),\n array('name' => \"Matruh\",'id_country' => 64),\n array('name' => \"Muhafazat ad Daqahliyah\",'id_country' => 64),\n array('name' => \"Muhafazat al Fayyum\",'id_country' => 64),\n array('name' => \"Muhafazat al Gharbiyah\",'id_country' => 64),\n array('name' => \"Muhafazat al Iskandariyah\",'id_country' => 64),\n array('name' => \"Muhafazat al Qahirah\",'id_country' => 64),\n array('name' => \"Qina\",'id_country' => 64),\n array('name' => \"Sawhaj\",'id_country' => 64),\n array('name' => \"Sina al-Janubiyah\",'id_country' => 64),\n array('name' => \"Sina ash-Shamaliyah\",'id_country' => 64),\n array('name' => \"ad-Daqahliyah\",'id_country' => 64),\n array('name' => \"al-Bahr-al-Ahmar\",'id_country' => 64),\n array('name' => \"al-Buhayrah\",'id_country' => 64),\n array('name' => \"al-Fayyum\",'id_country' => 64),\n array('name' => \"al-Gharbiyah\",'id_country' => 64),\n array('name' => \"al-Iskandariyah\",'id_country' => 64),\n array('name' => \"al-Ismailiyah\",'id_country' => 64),\n array('name' => \"al-Jizah\",'id_country' => 64),\n array('name' => \"al-Minufiyah\",'id_country' => 64),\n array('name' => \"al-Minya\",'id_country' => 64),\n array('name' => \"al-Qahira\",'id_country' => 64),\n array('name' => \"al-Qalyubiyah\",'id_country' => 64),\n array('name' => \"al-Uqsur\",'id_country' => 64),\n array('name' => \"al-Wadi al-Jadid\",'id_country' => 64),\n array('name' => \"as-Suways\",'id_country' => 64),\n array('name' => \"ash-Sharqiyah\",'id_country' => 64),\n array('name' => \"Ahuachapan\",'id_country' => 65),\n array('name' => \"Cabanas\",'id_country' => 65),\n array('name' => \"Chalatenango\",'id_country' => 65),\n array('name' => \"Cuscatlan\",'id_country' => 65),\n array('name' => \"La Libertad\",'id_country' => 65),\n array('name' => \"La Paz\",'id_country' => 65),\n array('name' => \"La Union\",'id_country' => 65),\n array('name' => \"Morazan\",'id_country' => 65),\n array('name' => \"San Miguel\",'id_country' => 65),\n array('name' => \"San Salvador\",'id_country' => 65),\n array('name' => \"San Vicente\",'id_country' => 65),\n array('name' => \"Santa Ana\",'id_country' => 65),\n array('name' => \"Sonsonate\",'id_country' => 65),\n array('name' => \"Usulutan\",'id_country' => 65),\n array('name' => \"Annobon\",'id_country' => 66),\n array('name' => \"Bioko Norte\",'id_country' => 66),\n array('name' => \"Bioko Sur\",'id_country' => 66),\n array('name' => \"Centro Sur\",'id_country' => 66),\n array('name' => \"Kie-Ntem\",'id_country' => 66),\n array('name' => \"Litoral\",'id_country' => 66),\n array('name' => \"Wele-Nzas\",'id_country' => 66),\n array('name' => \"Anseba\",'id_country' => 67),\n array('name' => \"Debub\",'id_country' => 67),\n array('name' => \"Debub-Keih-Bahri\",'id_country' => 67),\n array('name' => \"Gash-Barka\",'id_country' => 67),\n array('name' => \"Maekel\",'id_country' => 67),\n array('name' => \"Semien-Keih-Bahri\",'id_country' => 67),\n array('name' => \"Harju\",'id_country' => 68),\n array('name' => \"Hiiu\",'id_country' => 68),\n array('name' => \"Ida-Viru\",'id_country' => 68),\n array('name' => \"Jarva\",'id_country' => 68),\n array('name' => \"Jogeva\",'id_country' => 68),\n array('name' => \"Laane\",'id_country' => 68),\n array('name' => \"Laane-Viru\",'id_country' => 68),\n array('name' => \"Parnu\",'id_country' => 68),\n array('name' => \"Polva\",'id_country' => 68),\n array('name' => \"Rapla\",'id_country' => 68),\n array('name' => \"Saare\",'id_country' => 68),\n array('name' => \"Tartu\",'id_country' => 68),\n array('name' => \"Valga\",'id_country' => 68),\n array('name' => \"Viljandi\",'id_country' => 68),\n array('name' => \"Voru\",'id_country' => 68),\n array('name' => \"Addis Abeba\",'id_country' => 69),\n array('name' => \"Afar\",'id_country' => 69),\n array('name' => \"Amhara\",'id_country' => 69),\n array('name' => \"Benishangul\",'id_country' => 69),\n array('name' => \"Diredawa\",'id_country' => 69),\n array('name' => \"Gambella\",'id_country' => 69),\n array('name' => \"Harar\",'id_country' => 69),\n array('name' => \"Jigjiga\",'id_country' => 69),\n array('name' => \"Mekele\",'id_country' => 69),\n array('name' => \"Oromia\",'id_country' => 69),\n array('name' => \"Somali\",'id_country' => 69),\n array('name' => \"Southern\",'id_country' => 69),\n array('name' => \"Tigray\",'id_country' => 69),\n array('name' => \"Christmas Island\",'id_country' => 70),\n array('name' => \"Cocos Islands\",'id_country' => 70),\n array('name' => \"Coral Sea Islands\",'id_country' => 70),\n array('name' => \"Falkland Islands\",'id_country' => 71),\n array('name' => \"South Georgia\",'id_country' => 71),\n array('name' => \"Klaksvik\",'id_country' => 72),\n array('name' => \"Nor ara Eysturoy\",'id_country' => 72),\n array('name' => \"Nor oy\",'id_country' => 72),\n array('name' => \"Sandoy\",'id_country' => 72),\n array('name' => \"Streymoy\",'id_country' => 72),\n array('name' => \"Su uroy\",'id_country' => 72),\n array('name' => \"Sy ra Eysturoy\",'id_country' => 72),\n array('name' => \"Torshavn\",'id_country' => 72),\n array('name' => \"Vaga\",'id_country' => 72),\n array('name' => \"Central\",'id_country' => 73),\n array('name' => \"Eastern\",'id_country' => 73),\n array('name' => \"Northern\",'id_country' => 73),\n array('name' => \"South Pacific\",'id_country' => 73),\n array('name' => \"Western\",'id_country' => 73),\n array('name' => \"Ahvenanmaa\",'id_country' => 74),\n array('name' => \"Etela-Karjala\",'id_country' => 74),\n array('name' => \"Etela-Pohjanmaa\",'id_country' => 74),\n array('name' => \"Etela-Savo\",'id_country' => 74),\n array('name' => \"Etela-Suomen Laani\",'id_country' => 74),\n array('name' => \"Ita-Suomen Laani\",'id_country' => 74),\n array('name' => \"Ita-Uusimaa\",'id_country' => 74),\n array('name' => \"Kainuu\",'id_country' => 74),\n array('name' => \"Kanta-Hame\",'id_country' => 74),\n array('name' => \"Keski-Pohjanmaa\",'id_country' => 74),\n array('name' => \"Keski-Suomi\",'id_country' => 74),\n array('name' => \"Kymenlaakso\",'id_country' => 74),\n array('name' => \"Lansi-Suomen Laani\",'id_country' => 74),\n array('name' => \"Lappi\",'id_country' => 74),\n array('name' => \"Northern Savonia\",'id_country' => 74),\n array('name' => \"Ostrobothnia\",'id_country' => 74),\n array('name' => \"Oulun Laani\",'id_country' => 74),\n array('name' => \"Paijat-Hame\",'id_country' => 74),\n array('name' => \"Pirkanmaa\",'id_country' => 74),\n array('name' => \"Pohjanmaa\",'id_country' => 74),\n array('name' => \"Pohjois-Karjala\",'id_country' => 74),\n array('name' => \"Pohjois-Pohjanmaa\",'id_country' => 74),\n array('name' => \"Pohjois-Savo\",'id_country' => 74),\n array('name' => \"Saarijarvi\",'id_country' => 74),\n array('name' => \"Satakunta\",'id_country' => 74),\n array('name' => \"Southern Savonia\",'id_country' => 74),\n array('name' => \"Tavastia Proper\",'id_country' => 74),\n array('name' => \"Uleaborgs Lan\",'id_country' => 74),\n array('name' => \"Uusimaa\",'id_country' => 74),\n array('name' => \"Varsinais-Suomi\",'id_country' => 74),\n array('name' => \"Ain\",'id_country' => 75),\n array('name' => \"Aisne\",'id_country' => 75),\n array('name' => \"Albi Le Sequestre\",'id_country' => 75),\n array('name' => \"Allier\",'id_country' => 75),\n array('name' => \"Alpes-Cote dAzur\",'id_country' => 75),\n array('name' => \"Alpes-Maritimes\",'id_country' => 75),\n array('name' => \"Alpes-de-Haute-Provence\",'id_country' => 75),\n array('name' => \"Alsace\",'id_country' => 75),\n array('name' => \"Aquitaine\",'id_country' => 75),\n array('name' => \"Ardeche\",'id_country' => 75),\n array('name' => \"Ardennes\",'id_country' => 75),\n array('name' => \"Ariege\",'id_country' => 75),\n array('name' => \"Aube\",'id_country' => 75),\n array('name' => \"Aude\",'id_country' => 75),\n array('name' => \"Auvergne\",'id_country' => 75),\n array('name' => \"Aveyron\",'id_country' => 75),\n array('name' => \"Bas-Rhin\",'id_country' => 75),\n array('name' => \"Basse-Normandie\",'id_country' => 75),\n array('name' => \"Bouches-du-Rhone\",'id_country' => 75),\n array('name' => \"Bourgogne\",'id_country' => 75),\n array('name' => \"Bretagne\",'id_country' => 75),\n array('name' => \"Brittany\",'id_country' => 75),\n array('name' => \"Burgundy\",'id_country' => 75),\n array('name' => \"Calvados\",'id_country' => 75),\n array('name' => \"Cantal\",'id_country' => 75),\n array('name' => \"Cedex\",'id_country' => 75),\n array('name' => \"Centre\",'id_country' => 75),\n array('name' => \"Charente\",'id_country' => 75),\n array('name' => \"Charente-Maritime\",'id_country' => 75),\n array('name' => \"Cher\",'id_country' => 75),\n array('name' => \"Correze\",'id_country' => 75),\n array('name' => \"Corse-du-Sud\",'id_country' => 75),\n array('name' => \"Cote-d'Or\",'id_country' => 75),\n array('name' => \"Cotes-d'Armor\",'id_country' => 75),\n array('name' => \"Creuse\",'id_country' => 75),\n array('name' => \"Crolles\",'id_country' => 75),\n array('name' => \"Deux-Sevres\",'id_country' => 75),\n array('name' => \"Dordogne\",'id_country' => 75),\n array('name' => \"Doubs\",'id_country' => 75),\n array('name' => \"Drome\",'id_country' => 75),\n array('name' => \"Essonne\",'id_country' => 75),\n array('name' => \"Eure\",'id_country' => 75),\n array('name' => \"Eure-et-Loir\",'id_country' => 75),\n array('name' => \"Feucherolles\",'id_country' => 75),\n array('name' => \"Finistere\",'id_country' => 75),\n array('name' => \"Franche-Comte\",'id_country' => 75),\n array('name' => \"Gard\",'id_country' => 75),\n array('name' => \"Gers\",'id_country' => 75),\n array('name' => \"Gironde\",'id_country' => 75),\n array('name' => \"Haut-Rhin\",'id_country' => 75),\n array('name' => \"Haute-Corse\",'id_country' => 75),\n array('name' => \"Haute-Garonne\",'id_country' => 75),\n array('name' => \"Haute-Loire\",'id_country' => 75),\n array('name' => \"Haute-Marne\",'id_country' => 75),\n array('name' => \"Haute-Saone\",'id_country' => 75),\n array('name' => \"Haute-Savoie\",'id_country' => 75),\n array('name' => \"Haute-Vienne\",'id_country' => 75),\n array('name' => \"Hautes-Alpes\",'id_country' => 75),\n array('name' => \"Hautes-Pyrenees\",'id_country' => 75),\n array('name' => \"Hauts-de-Seine\",'id_country' => 75),\n array('name' => \"Herault\",'id_country' => 75),\n array('name' => \"Ile-de-France\",'id_country' => 75),\n array('name' => \"Ille-et-Vilaine\",'id_country' => 75),\n array('name' => \"Indre\",'id_country' => 75),\n array('name' => \"Indre-et-Loire\",'id_country' => 75),\n array('name' => \"Isere\",'id_country' => 75),\n array('name' => \"Jura\",'id_country' => 75),\n array('name' => \"Klagenfurt\",'id_country' => 75),\n array('name' => \"Landes\",'id_country' => 75),\n array('name' => \"Languedoc-Roussillon\",'id_country' => 75),\n array('name' => \"Larcay\",'id_country' => 75),\n array('name' => \"Le Castellet\",'id_country' => 75),\n array('name' => \"Le Creusot\",'id_country' => 75),\n array('name' => \"Limousin\",'id_country' => 75),\n array('name' => \"Loir-et-Cher\",'id_country' => 75),\n array('name' => \"Loire\",'id_country' => 75),\n array('name' => \"Loire-Atlantique\",'id_country' => 75),\n array('name' => \"Loiret\",'id_country' => 75),\n array('name' => \"Lorraine\",'id_country' => 75),\n array('name' => \"Lot\",'id_country' => 75),\n array('name' => \"Lot-et-Garonne\",'id_country' => 75),\n array('name' => \"Lower Normandy\",'id_country' => 75),\n array('name' => \"Lozere\",'id_country' => 75),\n array('name' => \"Maine-et-Loire\",'id_country' => 75),\n array('name' => \"Manche\",'id_country' => 75),\n array('name' => \"Marne\",'id_country' => 75),\n array('name' => \"Mayenne\",'id_country' => 75),\n array('name' => \"Meurthe-et-Moselle\",'id_country' => 75),\n array('name' => \"Meuse\",'id_country' => 75),\n array('name' => \"Midi-Pyrenees\",'id_country' => 75),\n array('name' => \"Morbihan\",'id_country' => 75),\n array('name' => \"Moselle\",'id_country' => 75),\n array('name' => \"Nievre\",'id_country' => 75),\n array('name' => \"Nord\",'id_country' => 75),\n array('name' => \"Nord-Pas-de-Calais\",'id_country' => 75),\n array('name' => \"Oise\",'id_country' => 75),\n array('name' => \"Orne\",'id_country' => 75),\n array('name' => \"Paris\",'id_country' => 75),\n array('name' => \"Pas-de-Calais\",'id_country' => 75),\n array('name' => \"Pays de la Loire\",'id_country' => 75),\n array('name' => \"Pays-de-la-Loire\",'id_country' => 75),\n array('name' => \"Picardy\",'id_country' => 75),\n array('name' => \"Puy-de-Dome\",'id_country' => 75),\n array('name' => \"Pyrenees-Atlantiques\",'id_country' => 75),\n array('name' => \"Pyrenees-Orientales\",'id_country' => 75),\n array('name' => \"Quelmes\",'id_country' => 75),\n array('name' => \"Rhone\",'id_country' => 75),\n array('name' => \"Rhone-Alpes\",'id_country' => 75),\n array('name' => \"Saint Ouen\",'id_country' => 75),\n array('name' => \"Saint Viatre\",'id_country' => 75),\n array('name' => \"Saone-et-Loire\",'id_country' => 75),\n array('name' => \"Sarthe\",'id_country' => 75),\n array('name' => \"Savoie\",'id_country' => 75),\n array('name' => \"Seine-Maritime\",'id_country' => 75),\n array('name' => \"Seine-Saint-Denis\",'id_country' => 75),\n array('name' => \"Seine-et-Marne\",'id_country' => 75),\n array('name' => \"Somme\",'id_country' => 75),\n array('name' => \"Sophia Antipolis\",'id_country' => 75),\n array('name' => \"Souvans\",'id_country' => 75),\n array('name' => \"Tarn\",'id_country' => 75),\n array('name' => \"Tarn-et-Garonne\",'id_country' => 75),\n array('name' => \"Territoire de Belfort\",'id_country' => 75),\n array('name' => \"Treignac\",'id_country' => 75),\n array('name' => \"Upper Normandy\",'id_country' => 75),\n array('name' => \"Val-d'Oise\",'id_country' => 75),\n array('name' => \"Val-de-Marne\",'id_country' => 75),\n array('name' => \"Var\",'id_country' => 75),\n array('name' => \"Vaucluse\",'id_country' => 75),\n array('name' => \"Vellise\",'id_country' => 75),\n array('name' => \"Vendee\",'id_country' => 75),\n array('name' => \"Vienne\",'id_country' => 75),\n array('name' => \"Vosges\",'id_country' => 75),\n array('name' => \"Yonne\",'id_country' => 75),\n array('name' => \"Yvelines\",'id_country' => 75),\n array('name' => \"Cayenne\",'id_country' => 76),\n array('name' => \"Saint-Laurent-du-Maroni\",'id_country' => 76),\n array('name' => \"Iles du Vent\",'id_country' => 77),\n array('name' => \"Iles sous le Vent\",'id_country' => 77),\n array('name' => \"Marquesas\",'id_country' => 77),\n array('name' => \"Tuamotu\",'id_country' => 77),\n array('name' => \"Tubuai\",'id_country' => 77),\n array('name' => \"Amsterdam\",'id_country' => 78),\n array('name' => \"Crozet Islands\",'id_country' => 78),\n array('name' => \"Kerguelen\",'id_country' => 78),\n array('name' => \"Estuaire\",'id_country' => 79),\n array('name' => \"Haut-Ogooue\",'id_country' => 79),\n array('name' => \"Moyen-Ogooue\",'id_country' => 79),\n array('name' => \"Ngounie\",'id_country' => 79),\n array('name' => \"Nyanga\",'id_country' => 79),\n array('name' => \"Ogooue-Ivindo\",'id_country' => 79),\n array('name' => \"Ogooue-Lolo\",'id_country' => 79),\n array('name' => \"Ogooue-Maritime\",'id_country' => 79),\n array('name' => \"Woleu-Ntem\",'id_country' => 79),\n array('name' => \"Banjul\",'id_country' => 80),\n array('name' => \"Basse\",'id_country' => 80),\n array('name' => \"Brikama\",'id_country' => 80),\n array('name' => \"Janjanbureh\",'id_country' => 80),\n array('name' => \"Kanifing\",'id_country' => 80),\n array('name' => \"Kerewan\",'id_country' => 80),\n array('name' => \"Kuntaur\",'id_country' => 80),\n array('name' => \"Mansakonko\",'id_country' => 80),\n array('name' => \"Abhasia\",'id_country' => 81),\n array('name' => \"Ajaria\",'id_country' => 81),\n array('name' => \"Guria\",'id_country' => 81),\n array('name' => \"Imereti\",'id_country' => 81),\n array('name' => \"Kaheti\",'id_country' => 81),\n array('name' => \"Kvemo Kartli\",'id_country' => 81),\n array('name' => \"Mcheta-Mtianeti\",'id_country' => 81),\n array('name' => \"Racha\",'id_country' => 81),\n array('name' => \"Samagrelo-Zemo Svaneti\",'id_country' => 81),\n array('name' => \"Samche-Zhavaheti\",'id_country' => 81),\n array('name' => \"Shida Kartli\",'id_country' => 81),\n array('name' => \"Tbilisi\",'id_country' => 81),\n array('name' => \"Auvergne\",'id_country' => 82),\n array('name' => \"Baden-Wurttemberg\",'id_country' => 82),\n array('name' => \"Bavaria\",'id_country' => 82),\n array('name' => \"Bayern\",'id_country' => 82),\n array('name' => \"Beilstein Wurtt\",'id_country' => 82),\n array('name' => \"Berlin\",'id_country' => 82),\n array('name' => \"Brandenburg\",'id_country' => 82),\n array('name' => \"Bremen\",'id_country' => 82),\n array('name' => \"Dreisbach\",'id_country' => 82),\n array('name' => \"Freistaat Bayern\",'id_country' => 82),\n array('name' => \"Hamburg\",'id_country' => 82),\n array('name' => \"Hannover\",'id_country' => 82),\n array('name' => \"Heroldstatt\",'id_country' => 82),\n array('name' => \"Hessen\",'id_country' => 82),\n array('name' => \"Kortenberg\",'id_country' => 82),\n array('name' => \"Laasdorf\",'id_country' => 82),\n array('name' => \"Land Baden-Wurttemberg\",'id_country' => 82),\n array('name' => \"Land Bayern\",'id_country' => 82),\n array('name' => \"Land Brandenburg\",'id_country' => 82),\n array('name' => \"Land Hessen\",'id_country' => 82),\n array('name' => \"Land Mecklenburg-Vorpommern\",'id_country' => 82),\n array('name' => \"Land Nordrhein-Westfalen\",'id_country' => 82),\n array('name' => \"Land Rheinland-Pfalz\",'id_country' => 82),\n array('name' => \"Land Sachsen\",'id_country' => 82),\n array('name' => \"Land Sachsen-Anhalt\",'id_country' => 82),\n array('name' => \"Land Thuringen\",'id_country' => 82),\n array('name' => \"Lower Saxony\",'id_country' => 82),\n array('name' => \"Mecklenburg-Vorpommern\",'id_country' => 82),\n array('name' => \"Mulfingen\",'id_country' => 82),\n array('name' => \"Munich\",'id_country' => 82),\n array('name' => \"Neubeuern\",'id_country' => 82),\n array('name' => \"Niedersachsen\",'id_country' => 82),\n array('name' => \"Noord-Holland\",'id_country' => 82),\n array('name' => \"Nordrhein-Westfalen\",'id_country' => 82),\n array('name' => \"North Rhine-Westphalia\",'id_country' => 82),\n array('name' => \"Osterode\",'id_country' => 82),\n array('name' => \"Rheinland-Pfalz\",'id_country' => 82),\n array('name' => \"Rhineland-Palatinate\",'id_country' => 82),\n array('name' => \"Saarland\",'id_country' => 82),\n array('name' => \"Sachsen\",'id_country' => 82),\n array('name' => \"Sachsen-Anhalt\",'id_country' => 82),\n array('name' => \"Saxony\",'id_country' => 82),\n array('name' => \"Schleswig-Holstein\",'id_country' => 82),\n array('name' => \"Thuringia\",'id_country' => 82),\n array('name' => \"Webling\",'id_country' => 82),\n array('name' => \"Weinstrabe\",'id_country' => 82),\n array('name' => \"schlobborn\",'id_country' => 82),\n array('name' => \"Ashanti\",'id_country' => 83),\n array('name' => \"Brong-Ahafo\",'id_country' => 83),\n array('name' => \"Central\",'id_country' => 83),\n array('name' => \"Eastern\",'id_country' => 83),\n array('name' => \"Greater Accra\",'id_country' => 83),\n array('name' => \"Northern\",'id_country' => 83),\n array('name' => \"Upper East\",'id_country' => 83),\n array('name' => \"Upper West\",'id_country' => 83),\n array('name' => \"Volta\",'id_country' => 83),\n array('name' => \"Western\",'id_country' => 83),\n array('name' => \"Gibraltar\",'id_country' => 84),\n array('name' => \"Acharnes\",'id_country' => 85),\n array('name' => \"Ahaia\",'id_country' => 85),\n array('name' => \"Aitolia kai Akarnania\",'id_country' => 85),\n array('name' => \"Argolis\",'id_country' => 85),\n array('name' => \"Arkadia\",'id_country' => 85),\n array('name' => \"Arta\",'id_country' => 85),\n array('name' => \"Attica\",'id_country' => 85),\n array('name' => \"Attiki\",'id_country' => 85),\n array('name' => \"Ayion Oros\",'id_country' => 85),\n array('name' => \"Crete\",'id_country' => 85),\n array('name' => \"Dodekanisos\",'id_country' => 85),\n array('name' => \"Drama\",'id_country' => 85),\n array('name' => \"Evia\",'id_country' => 85),\n array('name' => \"Evritania\",'id_country' => 85),\n array('name' => \"Evros\",'id_country' => 85),\n array('name' => \"Evvoia\",'id_country' => 85),\n array('name' => \"Florina\",'id_country' => 85),\n array('name' => \"Fokis\",'id_country' => 85),\n array('name' => \"Fthiotis\",'id_country' => 85),\n array('name' => \"Grevena\",'id_country' => 85),\n array('name' => \"Halandri\",'id_country' => 85),\n array('name' => \"Halkidiki\",'id_country' => 85),\n array('name' => \"Hania\",'id_country' => 85),\n array('name' => \"Heraklion\",'id_country' => 85),\n array('name' => \"Hios\",'id_country' => 85),\n array('name' => \"Ilia\",'id_country' => 85),\n array('name' => \"Imathia\",'id_country' => 85),\n array('name' => \"Ioannina\",'id_country' => 85),\n array('name' => \"Iraklion\",'id_country' => 85),\n array('name' => \"Karditsa\",'id_country' => 85),\n array('name' => \"Kastoria\",'id_country' => 85),\n array('name' => \"Kavala\",'id_country' => 85),\n array('name' => \"Kefallinia\",'id_country' => 85),\n array('name' => \"Kerkira\",'id_country' => 85),\n array('name' => \"Kiklades\",'id_country' => 85),\n array('name' => \"Kilkis\",'id_country' => 85),\n array('name' => \"Korinthia\",'id_country' => 85),\n array('name' => \"Kozani\",'id_country' => 85),\n array('name' => \"Lakonia\",'id_country' => 85),\n array('name' => \"Larisa\",'id_country' => 85),\n array('name' => \"Lasithi\",'id_country' => 85),\n array('name' => \"Lesvos\",'id_country' => 85),\n array('name' => \"Levkas\",'id_country' => 85),\n array('name' => \"Magnisia\",'id_country' => 85),\n array('name' => \"Messinia\",'id_country' => 85),\n array('name' => \"Nomos Attikis\",'id_country' => 85),\n array('name' => \"Nomos Zakynthou\",'id_country' => 85),\n array('name' => \"Pella\",'id_country' => 85),\n array('name' => \"Pieria\",'id_country' => 85),\n array('name' => \"Piraios\",'id_country' => 85),\n array('name' => \"Preveza\",'id_country' => 85),\n array('name' => \"Rethimni\",'id_country' => 85),\n array('name' => \"Rodopi\",'id_country' => 85),\n array('name' => \"Samos\",'id_country' => 85),\n array('name' => \"Serrai\",'id_country' => 85),\n array('name' => \"Thesprotia\",'id_country' => 85),\n array('name' => \"Thessaloniki\",'id_country' => 85),\n array('name' => \"Trikala\",'id_country' => 85),\n array('name' => \"Voiotia\",'id_country' => 85),\n array('name' => \"West Greece\",'id_country' => 85),\n array('name' => \"Xanthi\",'id_country' => 85),\n array('name' => \"Zakinthos\",'id_country' => 85),\n array('name' => \"Aasiaat\",'id_country' => 86),\n array('name' => \"Ammassalik\",'id_country' => 86),\n array('name' => \"Illoqqortoormiut\",'id_country' => 86),\n array('name' => \"Ilulissat\",'id_country' => 86),\n array('name' => \"Ivittuut\",'id_country' => 86),\n array('name' => \"Kangaatsiaq\",'id_country' => 86),\n array('name' => \"Maniitsoq\",'id_country' => 86),\n array('name' => \"Nanortalik\",'id_country' => 86),\n array('name' => \"Narsaq\",'id_country' => 86),\n array('name' => \"Nuuk\",'id_country' => 86),\n array('name' => \"Paamiut\",'id_country' => 86),\n array('name' => \"Qaanaaq\",'id_country' => 86),\n array('name' => \"Qaqortoq\",'id_country' => 86),\n array('name' => \"Qasigiannguit\",'id_country' => 86),\n array('name' => \"Qeqertarsuaq\",'id_country' => 86),\n array('name' => \"Sisimiut\",'id_country' => 86),\n array('name' => \"Udenfor kommunal inddeling\",'id_country' => 86),\n array('name' => \"Upernavik\",'id_country' => 86),\n array('name' => \"Uummannaq\",'id_country' => 86),\n array('name' => \"Carriacou-Petite Martinique\",'id_country' => 87),\n array('name' => \"Saint Andrew\",'id_country' => 87),\n array('name' => \"Saint Davids\",'id_country' => 87),\n array('name' => \"Saint George's\",'id_country' => 87),\n array('name' => \"Saint John\",'id_country' => 87),\n array('name' => \"Saint Mark\",'id_country' => 87),\n array('name' => \"Saint Patrick\",'id_country' => 87),\n array('name' => \"Basse-Terre\",'id_country' => 88),\n array('name' => \"Grande-Terre\",'id_country' => 88),\n array('name' => \"Iles des Saintes\",'id_country' => 88),\n array('name' => \"La Desirade\",'id_country' => 88),\n array('name' => \"Marie-Galante\",'id_country' => 88),\n array('name' => \"Saint Barthelemy\",'id_country' => 88),\n array('name' => \"Saint Martin\",'id_country' => 88),\n array('name' => \"Agana Heights\",'id_country' => 89),\n array('name' => \"Agat\",'id_country' => 89),\n array('name' => \"Barrigada\",'id_country' => 89),\n array('name' => \"Chalan-Pago-Ordot\",'id_country' => 89),\n array('name' => \"Dededo\",'id_country' => 89),\n array('name' => \"Hagatna\",'id_country' => 89),\n array('name' => \"Inarajan\",'id_country' => 89),\n array('name' => \"Mangilao\",'id_country' => 89),\n array('name' => \"Merizo\",'id_country' => 89),\n array('name' => \"Mongmong-Toto-Maite\",'id_country' => 89),\n array('name' => \"Santa Rita\",'id_country' => 89),\n array('name' => \"Sinajana\",'id_country' => 89),\n array('name' => \"Talofofo\",'id_country' => 89),\n array('name' => \"Tamuning\",'id_country' => 89),\n array('name' => \"Yigo\",'id_country' => 89),\n array('name' => \"Yona\",'id_country' => 89),\n array('name' => \"Alta Verapaz\",'id_country' => 90),\n array('name' => \"Baja Verapaz\",'id_country' => 90),\n array('name' => \"Chimaltenango\",'id_country' => 90),\n array('name' => \"Chiquimula\",'id_country' => 90),\n array('name' => \"El Progreso\",'id_country' => 90),\n array('name' => \"Escuintla\",'id_country' => 90),\n array('name' => \"Guatemala\",'id_country' => 90),\n array('name' => \"Huehuetenango\",'id_country' => 90),\n array('name' => \"Izabal\",'id_country' => 90),\n array('name' => \"Jalapa\",'id_country' => 90),\n array('name' => \"Jutiapa\",'id_country' => 90),\n array('name' => \"Peten\",'id_country' => 90),\n array('name' => \"Quezaltenango\",'id_country' => 90),\n array('name' => \"Quiche\",'id_country' => 90),\n array('name' => \"Retalhuleu\",'id_country' => 90),\n array('name' => \"Sacatepequez\",'id_country' => 90),\n array('name' => \"San Marcos\",'id_country' => 90),\n array('name' => \"Santa Rosa\",'id_country' => 90),\n array('name' => \"Solola\",'id_country' => 90),\n array('name' => \"Suchitepequez\",'id_country' => 90),\n array('name' => \"Totonicapan\",'id_country' => 90),\n array('name' => \"Zacapa\",'id_country' => 90),\n array('name' => \"Alderney\",'id_country' => 91),\n array('name' => \"Castel\",'id_country' => 91),\n array('name' => \"Forest\",'id_country' => 91),\n array('name' => \"Saint Andrew\",'id_country' => 91),\n array('name' => \"Saint Martin\",'id_country' => 91),\n array('name' => \"Saint Peter Port\",'id_country' => 91),\n array('name' => \"Saint Pierre du Bois\",'id_country' => 91),\n array('name' => \"Saint Sampson\",'id_country' => 91),\n array('name' => \"Saint Saviour\",'id_country' => 91),\n array('name' => \"Sark\",'id_country' => 91),\n array('name' => \"Torteval\",'id_country' => 91),\n array('name' => \"Vale\",'id_country' => 91),\n array('name' => \"Beyla\",'id_country' => 92),\n array('name' => \"Boffa\",'id_country' => 92),\n array('name' => \"Boke\",'id_country' => 92),\n array('name' => \"Conakry\",'id_country' => 92),\n array('name' => \"Coyah\",'id_country' => 92),\n array('name' => \"Dabola\",'id_country' => 92),\n array('name' => \"Dalaba\",'id_country' => 92),\n array('name' => \"Dinguiraye\",'id_country' => 92),\n array('name' => \"Faranah\",'id_country' => 92),\n array('name' => \"Forecariah\",'id_country' => 92),\n array('name' => \"Fria\",'id_country' => 92),\n array('name' => \"Gaoual\",'id_country' => 92),\n array('name' => \"Gueckedou\",'id_country' => 92),\n array('name' => \"Kankan\",'id_country' => 92),\n array('name' => \"Kerouane\",'id_country' => 92),\n array('name' => \"Kindia\",'id_country' => 92),\n array('name' => \"Kissidougou\",'id_country' => 92),\n array('name' => \"Koubia\",'id_country' => 92),\n array('name' => \"Koundara\",'id_country' => 92),\n array('name' => \"Kouroussa\",'id_country' => 92),\n array('name' => \"Labe\",'id_country' => 92),\n array('name' => \"Lola\",'id_country' => 92),\n array('name' => \"Macenta\",'id_country' => 92),\n array('name' => \"Mali\",'id_country' => 92),\n array('name' => \"Mamou\",'id_country' => 92),\n array('name' => \"Mandiana\",'id_country' => 92),\n array('name' => \"Nzerekore\",'id_country' => 92),\n array('name' => \"Pita\",'id_country' => 92),\n array('name' => \"Siguiri\",'id_country' => 92),\n array('name' => \"Telimele\",'id_country' => 92),\n array('name' => \"Tougue\",'id_country' => 92),\n array('name' => \"Yomou\",'id_country' => 92),\n array('name' => \"Bafata\",'id_country' => 93),\n array('name' => \"Bissau\",'id_country' => 93),\n array('name' => \"Bolama\",'id_country' => 93),\n array('name' => \"Cacheu\",'id_country' => 93),\n array('name' => \"Gabu\",'id_country' => 93),\n array('name' => \"Oio\",'id_country' => 93),\n array('name' => \"Quinara\",'id_country' => 93),\n array('name' => \"Tombali\",'id_country' => 93),\n array('name' => \"Barima-Waini\",'id_country' => 94),\n array('name' => \"Cuyuni-Mazaruni\",'id_country' => 94),\n array('name' => \"Demerara-Mahaica\",'id_country' => 94),\n array('name' => \"East Berbice-Corentyne\",'id_country' => 94),\n array('name' => \"Essequibo Islands-West Demerar\",'id_country' => 94),\n array('name' => \"Mahaica-Berbice\",'id_country' => 94),\n array('name' => \"Pomeroon-Supenaam\",'id_country' => 94),\n array('name' => \"Potaro-Siparuni\",'id_country' => 94),\n array('name' => \"Upper Demerara-Berbice\",'id_country' => 94),\n array('name' => \"Upper Takutu-Upper Essequibo\",'id_country' => 94),\n array('name' => \"Artibonite\",'id_country' => 95),\n array('name' => \"Centre\",'id_country' => 95),\n array('name' => \"Grand'Anse\",'id_country' => 95),\n array('name' => \"Nord\",'id_country' => 95),\n array('name' => \"Nord-Est\",'id_country' => 95),\n array('name' => \"Nord-Ouest\",'id_country' => 95),\n array('name' => \"Ouest\",'id_country' => 95),\n array('name' => \"Sud\",'id_country' => 95),\n array('name' => \"Sud-Est\",'id_country' => 95),\n array('name' => \"Heard and McDonald Islands\",'id_country' => 96),\n array('name' => \"Atlantida\",'id_country' => 97),\n array('name' => \"Choluteca\",'id_country' => 97),\n array('name' => \"Colon\",'id_country' => 97),\n array('name' => \"Comayagua\",'id_country' => 97),\n array('name' => \"Copan\",'id_country' => 97),\n array('name' => \"Cortes\",'id_country' => 97),\n array('name' => \"Distrito Central\",'id_country' => 97),\n array('name' => \"El Paraiso\",'id_country' => 97),\n array('name' => \"Francisco Morazan\",'id_country' => 97),\n array('name' => \"Gracias a Dios\",'id_country' => 97),\n array('name' => \"Intibuca\",'id_country' => 97),\n array('name' => \"Islas de la Bahia\",'id_country' => 97),\n array('name' => \"La Paz\",'id_country' => 97),\n array('name' => \"Lempira\",'id_country' => 97),\n array('name' => \"Ocotepeque\",'id_country' => 97),\n array('name' => \"Olancho\",'id_country' => 97),\n array('name' => \"Santa Barbara\",'id_country' => 97),\n array('name' => \"Valle\",'id_country' => 97),\n array('name' => \"Yoro\",'id_country' => 97),\n array('name' => \"Hong Kong\",'id_country' => 98),\n array('name' => \"Bacs-Kiskun\",'id_country' => 99),\n array('name' => \"Baranya\",'id_country' => 99),\n array('name' => \"Bekes\",'id_country' => 99),\n array('name' => \"Borsod-Abauj-Zemplen\",'id_country' => 99),\n array('name' => \"Budapest\",'id_country' => 99),\n array('name' => \"Csongrad\",'id_country' => 99),\n array('name' => \"Fejer\",'id_country' => 99),\n array('name' => \"Gyor-Moson-Sopron\",'id_country' => 99),\n array('name' => \"Hajdu-Bihar\",'id_country' => 99),\n array('name' => \"Heves\",'id_country' => 99),\n array('name' => \"Jasz-Nagykun-Szolnok\",'id_country' => 99),\n array('name' => \"Komarom-Esztergom\",'id_country' => 99),\n array('name' => \"Nograd\",'id_country' => 99),\n array('name' => \"Pest\",'id_country' => 99),\n array('name' => \"Somogy\",'id_country' => 99),\n array('name' => \"Szabolcs-Szatmar-Bereg\",'id_country' => 99),\n array('name' => \"Tolna\",'id_country' => 99),\n array('name' => \"Vas\",'id_country' => 99),\n array('name' => \"Veszprem\",'id_country' => 99),\n array('name' => \"Zala\",'id_country' => 99),\n array('name' => \"Austurland\",'id_country' => 100),\n array('name' => \"Gullbringusysla\",'id_country' => 100),\n array('name' => \"Hofu borgarsva i\",'id_country' => 100),\n array('name' => \"Nor urland eystra\",'id_country' => 100),\n array('name' => \"Nor urland vestra\",'id_country' => 100),\n array('name' => \"Su urland\",'id_country' => 100),\n array('name' => \"Su urnes\",'id_country' => 100),\n array('name' => \"Vestfir ir\",'id_country' => 100),\n array('name' => \"Vesturland\",'id_country' => 100),\n array('name' => \"Aceh\",'id_country' => 102),\n array('name' => \"Bali\",'id_country' => 102),\n array('name' => \"Bangka-Belitung\",'id_country' => 102),\n array('name' => \"Banten\",'id_country' => 102),\n array('name' => \"Bengkulu\",'id_country' => 102),\n array('name' => \"Gandaria\",'id_country' => 102),\n array('name' => \"Gorontalo\",'id_country' => 102),\n array('name' => \"Jakarta\",'id_country' => 102),\n array('name' => \"Jambi\",'id_country' => 102),\n array('name' => \"Jawa Barat\",'id_country' => 102),\n array('name' => \"Jawa Tengah\",'id_country' => 102),\n array('name' => \"Jawa Timur\",'id_country' => 102),\n array('name' => \"Kalimantan Barat\",'id_country' => 102),\n array('name' => \"Kalimantan Selatan\",'id_country' => 102),\n array('name' => \"Kalimantan Tengah\",'id_country' => 102),\n array('name' => \"Kalimantan Timur\",'id_country' => 102),\n array('name' => \"Kendal\",'id_country' => 102),\n array('name' => \"Lampung\",'id_country' => 102),\n array('name' => \"Maluku\",'id_country' => 102),\n array('name' => \"Maluku Utara\",'id_country' => 102),\n array('name' => \"Nusa Tenggara Barat\",'id_country' => 102),\n array('name' => \"Nusa Tenggara Timur\",'id_country' => 102),\n array('name' => \"Papua\",'id_country' => 102),\n array('name' => \"Riau\",'id_country' => 102),\n array('name' => \"Riau Kepulauan\",'id_country' => 102),\n array('name' => \"Solo\",'id_country' => 102),\n array('name' => \"Sulawesi Selatan\",'id_country' => 102),\n array('name' => \"Sulawesi Tengah\",'id_country' => 102),\n array('name' => \"Sulawesi Tenggara\",'id_country' => 102),\n array('name' => \"Sulawesi Utara\",'id_country' => 102),\n array('name' => \"Sumatera Barat\",'id_country' => 102),\n array('name' => \"Sumatera Selatan\",'id_country' => 102),\n array('name' => \"Sumatera Utara\",'id_country' => 102),\n array('name' => \"Yogyakarta\",'id_country' => 102),\n array('name' => \"Ardabil\",'id_country' => 103),\n array('name' => \"Azarbayjan-e Bakhtari\",'id_country' => 103),\n array('name' => \"Azarbayjan-e Khavari\",'id_country' => 103),\n array('name' => \"Bushehr\",'id_country' => 103),\n array('name' => \"Chahar Mahal-e Bakhtiari\",'id_country' => 103),\n array('name' => \"Esfahan\",'id_country' => 103),\n array('name' => \"Fars\",'id_country' => 103),\n array('name' => \"Gilan\",'id_country' => 103),\n array('name' => \"Golestan\",'id_country' => 103),\n array('name' => \"Hamadan\",'id_country' => 103),\n array('name' => \"Hormozgan\",'id_country' => 103),\n array('name' => \"Ilam\",'id_country' => 103),\n array('name' => \"Kerman\",'id_country' => 103),\n array('name' => \"Kermanshah\",'id_country' => 103),\n array('name' => \"Khorasan\",'id_country' => 103),\n array('name' => \"Khuzestan\",'id_country' => 103),\n array('name' => \"Kohgiluyeh-e Boyerahmad\",'id_country' => 103),\n array('name' => \"Kordestan\",'id_country' => 103),\n array('name' => \"Lorestan\",'id_country' => 103),\n array('name' => \"Markazi\",'id_country' => 103),\n array('name' => \"Mazandaran\",'id_country' => 103),\n array('name' => \"Ostan-e Esfahan\",'id_country' => 103),\n array('name' => \"Qazvin\",'id_country' => 103),\n array('name' => \"Qom\",'id_country' => 103),\n array('name' => \"Semnan\",'id_country' => 103),\n array('name' => \"Sistan-e Baluchestan\",'id_country' => 103),\n array('name' => \"Tehran\",'id_country' => 103),\n array('name' => \"Yazd\",'id_country' => 103),\n array('name' => \"Zanjan\",'id_country' => 103),\n array('name' => \"Babil\",'id_country' => 104),\n array('name' => \"Baghdad\",'id_country' => 104),\n array('name' => \"Dahuk\",'id_country' => 104),\n array('name' => \"Dhi Qar\",'id_country' => 104),\n array('name' => \"Diyala\",'id_country' => 104),\n array('name' => \"Erbil\",'id_country' => 104),\n array('name' => \"Irbil\",'id_country' => 104),\n array('name' => \"Karbala\",'id_country' => 104),\n array('name' => \"Kurdistan\",'id_country' => 104),\n array('name' => \"Maysan\",'id_country' => 104),\n array('name' => \"Ninawa\",'id_country' => 104),\n array('name' => \"Salah-ad-Din\",'id_country' => 104),\n array('name' => \"Wasit\",'id_country' => 104),\n array('name' => \"al-Anbar\",'id_country' => 104),\n array('name' => \"al-Basrah\",'id_country' => 104),\n array('name' => \"al-Muthanna\",'id_country' => 104),\n array('name' => \"al-Qadisiyah\",'id_country' => 104),\n array('name' => \"an-Najaf\",'id_country' => 104),\n array('name' => \"as-Sulaymaniyah\",'id_country' => 104),\n array('name' => \"at-Ta'mim\",'id_country' => 104),\n array('name' => \"Armagh\",'id_country' => 105),\n array('name' => \"Carlow\",'id_country' => 105),\n array('name' => \"Cavan\",'id_country' => 105),\n array('name' => \"Clare\",'id_country' => 105),\n array('name' => \"Cork\",'id_country' => 105),\n array('name' => \"Donegal\",'id_country' => 105),\n array('name' => \"Dublin\",'id_country' => 105),\n array('name' => \"Galway\",'id_country' => 105),\n array('name' => \"Kerry\",'id_country' => 105),\n array('name' => \"Kildare\",'id_country' => 105),\n array('name' => \"Kilkenny\",'id_country' => 105),\n array('name' => \"Laois\",'id_country' => 105),\n array('name' => \"Leinster\",'id_country' => 105),\n array('name' => \"Leitrim\",'id_country' => 105),\n array('name' => \"Limerick\",'id_country' => 105),\n array('name' => \"Loch Garman\",'id_country' => 105),\n array('name' => \"Longford\",'id_country' => 105),\n array('name' => \"Louth\",'id_country' => 105),\n array('name' => \"Mayo\",'id_country' => 105),\n array('name' => \"Meath\",'id_country' => 105),\n array('name' => \"Monaghan\",'id_country' => 105),\n array('name' => \"Offaly\",'id_country' => 105),\n array('name' => \"Roscommon\",'id_country' => 105),\n array('name' => \"Sligo\",'id_country' => 105),\n array('name' => \"Tipperary North Riding\",'id_country' => 105),\n array('name' => \"Tipperary South Riding\",'id_country' => 105),\n array('name' => \"Ulster\",'id_country' => 105),\n array('name' => \"Waterford\",'id_country' => 105),\n array('name' => \"Westmeath\",'id_country' => 105),\n array('name' => \"Wexford\",'id_country' => 105),\n array('name' => \"Wicklow\",'id_country' => 105),\n array('name' => \"Beit Hanania\",'id_country' => 106),\n array('name' => \"Ben Gurion Airport\",'id_country' => 106),\n array('name' => \"Bethlehem\",'id_country' => 106),\n array('name' => \"Caesarea\",'id_country' => 106),\n array('name' => \"Centre\",'id_country' => 106),\n array('name' => \"Gaza\",'id_country' => 106),\n array('name' => \"Hadaron\",'id_country' => 106),\n array('name' => \"Haifa District\",'id_country' => 106),\n array('name' => \"Hamerkaz\",'id_country' => 106),\n array('name' => \"Hazafon\",'id_country' => 106),\n array('name' => \"Hebron\",'id_country' => 106),\n array('name' => \"Jaffa\",'id_country' => 106),\n array('name' => \"Jerusalem\",'id_country' => 106),\n array('name' => \"Khefa\",'id_country' => 106),\n array('name' => \"Kiryat Yam\",'id_country' => 106),\n array('name' => \"Lower Galilee\",'id_country' => 106),\n array('name' => \"Qalqilya\",'id_country' => 106),\n array('name' => \"Talme Elazar\",'id_country' => 106),\n array('name' => \"Tel Aviv\",'id_country' => 106),\n array('name' => \"Tsafon\",'id_country' => 106),\n array('name' => \"Umm El Fahem\",'id_country' => 106),\n array('name' => \"Yerushalayim\",'id_country' => 106),\n array('name' => \"Abruzzi\",'id_country' => 107),\n array('name' => \"Abruzzo\",'id_country' => 107),\n array('name' => \"Agrigento\",'id_country' => 107),\n array('name' => \"Alessandria\",'id_country' => 107),\n array('name' => \"Ancona\",'id_country' => 107),\n array('name' => \"Arezzo\",'id_country' => 107),\n array('name' => \"Ascoli Piceno\",'id_country' => 107),\n array('name' => \"Asti\",'id_country' => 107),\n array('name' => \"Avellino\",'id_country' => 107),\n array('name' => \"Bari\",'id_country' => 107),\n array('name' => \"Basilicata\",'id_country' => 107),\n array('name' => \"Belluno\",'id_country' => 107),\n array('name' => \"Benevento\",'id_country' => 107),\n array('name' => \"Bergamo\",'id_country' => 107),\n array('name' => \"Biella\",'id_country' => 107),\n array('name' => \"Bologna\",'id_country' => 107),\n array('name' => \"Bolzano\",'id_country' => 107),\n array('name' => \"Brescia\",'id_country' => 107),\n array('name' => \"Brindisi\",'id_country' => 107),\n array('name' => \"Calabria\",'id_country' => 107),\n array('name' => \"Campania\",'id_country' => 107),\n array('name' => \"Cartoceto\",'id_country' => 107),\n array('name' => \"Caserta\",'id_country' => 107),\n array('name' => \"Catania\",'id_country' => 107),\n array('name' => \"Chieti\",'id_country' => 107),\n array('name' => \"Como\",'id_country' => 107),\n array('name' => \"Cosenza\",'id_country' => 107),\n array('name' => \"Cremona\",'id_country' => 107),\n array('name' => \"Cuneo\",'id_country' => 107),\n array('name' => \"Emilia-Romagna\",'id_country' => 107),\n array('name' => \"Ferrara\",'id_country' => 107),\n array('name' => \"Firenze\",'id_country' => 107),\n array('name' => \"Florence\",'id_country' => 107),\n array('name' => \"Forli-Cesena \",'id_country' => 107),\n array('name' => \"Friuli-Venezia Giulia\",'id_country' => 107),\n array('name' => \"Frosinone\",'id_country' => 107),\n array('name' => \"Genoa\",'id_country' => 107),\n array('name' => \"Gorizia\",'id_country' => 107),\n array('name' => \"L'Aquila\",'id_country' => 107),\n array('name' => \"Lazio\",'id_country' => 107),\n array('name' => \"Lecce\",'id_country' => 107),\n array('name' => \"Lecco\",'id_country' => 107),\n array('name' => \"Lecco Province\",'id_country' => 107),\n array('name' => \"Liguria\",'id_country' => 107),\n array('name' => \"Lodi\",'id_country' => 107),\n array('name' => \"Lombardia\",'id_country' => 107),\n array('name' => \"Lombardy\",'id_country' => 107),\n array('name' => \"Macerata\",'id_country' => 107),\n array('name' => \"Mantova\",'id_country' => 107),\n array('name' => \"Marche\",'id_country' => 107),\n array('name' => \"Messina\",'id_country' => 107),\n array('name' => \"Milan\",'id_country' => 107),\n array('name' => \"Modena\",'id_country' => 107),\n array('name' => \"Molise\",'id_country' => 107),\n array('name' => \"Molteno\",'id_country' => 107),\n array('name' => \"Montenegro\",'id_country' => 107),\n array('name' => \"Monza and Brianza\",'id_country' => 107),\n array('name' => \"Naples\",'id_country' => 107),\n array('name' => \"Novara\",'id_country' => 107),\n array('name' => \"Padova\",'id_country' => 107),\n array('name' => \"Parma\",'id_country' => 107),\n array('name' => \"Pavia\",'id_country' => 107),\n array('name' => \"Perugia\",'id_country' => 107),\n array('name' => \"Pesaro-Urbino\",'id_country' => 107),\n array('name' => \"Piacenza\",'id_country' => 107),\n array('name' => \"Piedmont\",'id_country' => 107),\n array('name' => \"Piemonte\",'id_country' => 107),\n array('name' => \"Pisa\",'id_country' => 107),\n array('name' => \"Pordenone\",'id_country' => 107),\n array('name' => \"Potenza\",'id_country' => 107),\n array('name' => \"Puglia\",'id_country' => 107),\n array('name' => \"Reggio Emilia\",'id_country' => 107),\n array('name' => \"Rimini\",'id_country' => 107),\n array('name' => \"Roma\",'id_country' => 107),\n array('name' => \"Salerno\",'id_country' => 107),\n array('name' => \"Sardegna\",'id_country' => 107),\n array('name' => \"Sassari\",'id_country' => 107),\n array('name' => \"Savona\",'id_country' => 107),\n array('name' => \"Sicilia\",'id_country' => 107),\n array('name' => \"Siena\",'id_country' => 107),\n array('name' => \"Sondrio\",'id_country' => 107),\n array('name' => \"South Tyrol\",'id_country' => 107),\n array('name' => \"Taranto\",'id_country' => 107),\n array('name' => \"Teramo\",'id_country' => 107),\n array('name' => \"Torino\",'id_country' => 107),\n array('name' => \"Toscana\",'id_country' => 107),\n array('name' => \"Trapani\",'id_country' => 107),\n array('name' => \"Trentino-Alto Adige\",'id_country' => 107),\n array('name' => \"Trento\",'id_country' => 107),\n array('name' => \"Treviso\",'id_country' => 107),\n array('name' => \"Udine\",'id_country' => 107),\n array('name' => \"Umbria\",'id_country' => 107),\n array('name' => \"Valle d'Aosta\",'id_country' => 107),\n array('name' => \"Varese\",'id_country' => 107),\n array('name' => \"Veneto\",'id_country' => 107),\n array('name' => \"Venezia\",'id_country' => 107),\n array('name' => \"Verbano-Cusio-Ossola\",'id_country' => 107),\n array('name' => \"Vercelli\",'id_country' => 107),\n array('name' => \"Verona\",'id_country' => 107),\n array('name' => \"Vicenza\",'id_country' => 107),\n array('name' => \"Viterbo\",'id_country' => 107),\n array('name' => \"Buxoro Viloyati\",'id_country' => 108),\n array('name' => \"Clarendon\",'id_country' => 108),\n array('name' => \"Hanover\",'id_country' => 108),\n array('name' => \"Kingston\",'id_country' => 108),\n array('name' => \"Manchester\",'id_country' => 108),\n array('name' => \"Portland\",'id_country' => 108),\n array('name' => \"Saint Andrews\",'id_country' => 108),\n array('name' => \"Saint Ann\",'id_country' => 108),\n array('name' => \"Saint Catherine\",'id_country' => 108),\n array('name' => \"Saint Elizabeth\",'id_country' => 108),\n array('name' => \"Saint James\",'id_country' => 108),\n array('name' => \"Saint Mary\",'id_country' => 108),\n array('name' => \"Saint Thomas\",'id_country' => 108),\n array('name' => \"Trelawney\",'id_country' => 108),\n array('name' => \"Westmoreland\",'id_country' => 108),\n array('name' => \"Aichi\",'id_country' => 109),\n array('name' => \"Akita\",'id_country' => 109),\n array('name' => \"Aomori\",'id_country' => 109),\n array('name' => \"Chiba\",'id_country' => 109),\n array('name' => \"Ehime\",'id_country' => 109),\n array('name' => \"Fukui\",'id_country' => 109),\n array('name' => \"Fukuoka\",'id_country' => 109),\n array('name' => \"Fukushima\",'id_country' => 109),\n array('name' => \"Gifu\",'id_country' => 109),\n array('name' => \"Gumma\",'id_country' => 109),\n array('name' => \"Hiroshima\",'id_country' => 109),\n array('name' => \"Hokkaido\",'id_country' => 109),\n array('name' => \"Hyogo\",'id_country' => 109),\n array('name' => \"Ibaraki\",'id_country' => 109),\n array('name' => \"Ishikawa\",'id_country' => 109),\n array('name' => \"Iwate\",'id_country' => 109),\n array('name' => \"Kagawa\",'id_country' => 109),\n array('name' => \"Kagoshima\",'id_country' => 109),\n array('name' => \"Kanagawa\",'id_country' => 109),\n array('name' => \"Kanto\",'id_country' => 109),\n array('name' => \"Kochi\",'id_country' => 109),\n array('name' => \"Kumamoto\",'id_country' => 109),\n array('name' => \"Kyoto\",'id_country' => 109),\n array('name' => \"Mie\",'id_country' => 109),\n array('name' => \"Miyagi\",'id_country' => 109),\n array('name' => \"Miyazaki\",'id_country' => 109),\n array('name' => \"Nagano\",'id_country' => 109),\n array('name' => \"Nagasaki\",'id_country' => 109),\n array('name' => \"Nara\",'id_country' => 109),\n array('name' => \"Niigata\",'id_country' => 109),\n array('name' => \"Oita\",'id_country' => 109),\n array('name' => \"Okayama\",'id_country' => 109),\n array('name' => \"Okinawa\",'id_country' => 109),\n array('name' => \"Osaka\",'id_country' => 109),\n array('name' => \"Saga\",'id_country' => 109),\n array('name' => \"Saitama\",'id_country' => 109),\n array('name' => \"Shiga\",'id_country' => 109),\n array('name' => \"Shimane\",'id_country' => 109),\n array('name' => \"Shizuoka\",'id_country' => 109),\n array('name' => \"Tochigi\",'id_country' => 109),\n array('name' => \"Tokushima\",'id_country' => 109),\n array('name' => \"Tokyo\",'id_country' => 109),\n array('name' => \"Tottori\",'id_country' => 109),\n array('name' => \"Toyama\",'id_country' => 109),\n array('name' => \"Wakayama\",'id_country' => 109),\n array('name' => \"Yamagata\",'id_country' => 109),\n array('name' => \"Yamaguchi\",'id_country' => 109),\n array('name' => \"Yamanashi\",'id_country' => 109),\n array('name' => \"Grouville\",'id_country' => 110),\n array('name' => \"Saint Brelade\",'id_country' => 110),\n array('name' => \"Saint Clement\",'id_country' => 110),\n array('name' => \"Saint Helier\",'id_country' => 110),\n array('name' => \"Saint John\",'id_country' => 110),\n array('name' => \"Saint Lawrence\",'id_country' => 110),\n array('name' => \"Saint Martin\",'id_country' => 110),\n array('name' => \"Saint Mary\",'id_country' => 110),\n array('name' => \"Saint Peter\",'id_country' => 110),\n array('name' => \"Saint Saviour\",'id_country' => 110),\n array('name' => \"Trinity\",'id_country' => 110),\n array('name' => \"'Ajlun\",'id_country' => 111),\n array('name' => \"Amman\",'id_country' => 111),\n array('name' => \"Irbid\",'id_country' => 111),\n array('name' => \"Jarash\",'id_country' => 111),\n array('name' => \"Ma'an\",'id_country' => 111),\n array('name' => \"Madaba\",'id_country' => 111),\n array('name' => \"al-'Aqabah\",'id_country' => 111),\n array('name' => \"al-Balqa'\",'id_country' => 111),\n array('name' => \"al-Karak\",'id_country' => 111),\n array('name' => \"al-Mafraq\",'id_country' => 111),\n array('name' => \"at-Tafilah\",'id_country' => 111),\n array('name' => \"az-Zarqa'\",'id_country' => 111),\n array('name' => \"Akmecet\",'id_country' => 112),\n array('name' => \"Akmola\",'id_country' => 112),\n array('name' => \"Aktobe\",'id_country' => 112),\n array('name' => \"Almati\",'id_country' => 112),\n array('name' => \"Atirau\",'id_country' => 112),\n array('name' => \"Batis Kazakstan\",'id_country' => 112),\n array('name' => \"Burlinsky Region\",'id_country' => 112),\n array('name' => \"Karagandi\",'id_country' => 112),\n array('name' => \"Kostanay\",'id_country' => 112),\n array('name' => \"Mankistau\",'id_country' => 112),\n array('name' => \"Ontustik Kazakstan\",'id_country' => 112),\n array('name' => \"Pavlodar\",'id_country' => 112),\n array('name' => \"Sigis Kazakstan\",'id_country' => 112),\n array('name' => \"Soltustik Kazakstan\",'id_country' => 112),\n array('name' => \"Taraz\",'id_country' => 112),\n array('name' => \"Central\",'id_country' => 113),\n array('name' => \"Coast\",'id_country' => 113),\n array('name' => \"Eastern\",'id_country' => 113),\n array('name' => \"Nairobi\",'id_country' => 113),\n array('name' => \"North Eastern\",'id_country' => 113),\n array('name' => \"Nyanza\",'id_country' => 113),\n array('name' => \"Rift Valley\",'id_country' => 113),\n array('name' => \"Western\",'id_country' => 113),\n array('name' => \"Abaiang\",'id_country' => 114),\n array('name' => \"Abemana\",'id_country' => 114),\n array('name' => \"Aranuka\",'id_country' => 114),\n array('name' => \"Arorae\",'id_country' => 114),\n array('name' => \"Banaba\",'id_country' => 114),\n array('name' => \"Beru\",'id_country' => 114),\n array('name' => \"Butaritari\",'id_country' => 114),\n array('name' => \"Kiritimati\",'id_country' => 114),\n array('name' => \"Kuria\",'id_country' => 114),\n array('name' => \"Maiana\",'id_country' => 114),\n array('name' => \"Makin\",'id_country' => 114),\n array('name' => \"Marakei\",'id_country' => 114),\n array('name' => \"Nikunau\",'id_country' => 114),\n array('name' => \"Nonouti\",'id_country' => 114),\n array('name' => \"Onotoa\",'id_country' => 114),\n array('name' => \"Phoenix Islands\",'id_country' => 114),\n array('name' => \"Tabiteuea North\",'id_country' => 114),\n array('name' => \"Tabiteuea South\",'id_country' => 114),\n array('name' => \"Tabuaeran\",'id_country' => 114),\n array('name' => \"Tamana\",'id_country' => 114),\n array('name' => \"Tarawa North\",'id_country' => 114),\n array('name' => \"Tarawa South\",'id_country' => 114),\n array('name' => \"Teraina\",'id_country' => 114),\n array('name' => \"Chagangdo\",'id_country' => 115),\n array('name' => \"Hamgyeongbukto\",'id_country' => 115),\n array('name' => \"Hamgyeongnamdo\",'id_country' => 115),\n array('name' => \"Hwanghaebukto\",'id_country' => 115),\n array('name' => \"Hwanghaenamdo\",'id_country' => 115),\n array('name' => \"Kaeseong\",'id_country' => 115),\n array('name' => \"Kangweon\",'id_country' => 115),\n array('name' => \"Nampo\",'id_country' => 115),\n array('name' => \"Pyeonganbukto\",'id_country' => 115),\n array('name' => \"Pyeongannamdo\",'id_country' => 115),\n array('name' => \"Pyeongyang\",'id_country' => 115),\n array('name' => \"Yanggang\",'id_country' => 115),\n array('name' => \"Busan\",'id_country' => 116),\n array('name' => \"Cheju\",'id_country' => 116),\n array('name' => \"Chollabuk\",'id_country' => 116),\n array('name' => \"Chollanam\",'id_country' => 116),\n array('name' => \"Chungbuk\",'id_country' => 116),\n array('name' => \"Chungcheongbuk\",'id_country' => 116),\n array('name' => \"Chungcheongnam\",'id_country' => 116),\n array('name' => \"Chungnam\",'id_country' => 116),\n array('name' => \"Daegu\",'id_country' => 116),\n array('name' => \"Gangwon-do\",'id_country' => 116),\n array('name' => \"Goyang-si\",'id_country' => 116),\n array('name' => \"Gyeonggi-do\",'id_country' => 116),\n array('name' => \"Gyeongsang \",'id_country' => 116),\n array('name' => \"Gyeongsangnam-do\",'id_country' => 116),\n array('name' => \"Incheon\",'id_country' => 116),\n array('name' => \"Jeju-Si\",'id_country' => 116),\n array('name' => \"Jeonbuk\",'id_country' => 116),\n array('name' => \"Kangweon\",'id_country' => 116),\n array('name' => \"Kwangju\",'id_country' => 116),\n array('name' => \"Kyeonggi\",'id_country' => 116),\n array('name' => \"Kyeongsangbuk\",'id_country' => 116),\n array('name' => \"Kyeongsangnam\",'id_country' => 116),\n array('name' => \"Kyonggi-do\",'id_country' => 116),\n array('name' => \"Kyungbuk-Do\",'id_country' => 116),\n array('name' => \"Kyunggi-Do\",'id_country' => 116),\n array('name' => \"Kyunggi-do\",'id_country' => 116),\n array('name' => \"Pusan\",'id_country' => 116),\n array('name' => \"Seoul\",'id_country' => 116),\n array('name' => \"Sudogwon\",'id_country' => 116),\n array('name' => \"Taegu\",'id_country' => 116),\n array('name' => \"Taejeon\",'id_country' => 116),\n array('name' => \"Taejon-gwangyoksi\",'id_country' => 116),\n array('name' => \"Ulsan\",'id_country' => 116),\n array('name' => \"Wonju\",'id_country' => 116),\n array('name' => \"gwangyoksi\",'id_country' => 116),\n array('name' => \"Al Asimah\",'id_country' => 117),\n array('name' => \"Hawalli\",'id_country' => 117),\n array('name' => \"Mishref\",'id_country' => 117),\n array('name' => \"Qadesiya\",'id_country' => 117),\n array('name' => \"Safat\",'id_country' => 117),\n array('name' => \"Salmiya\",'id_country' => 117),\n array('name' => \"al-Ahmadi\",'id_country' => 117),\n array('name' => \"al-Farwaniyah\",'id_country' => 117),\n array('name' => \"al-Jahra\",'id_country' => 117),\n array('name' => \"al-Kuwayt\",'id_country' => 117),\n array('name' => \"Batken\",'id_country' => 118),\n array('name' => \"Bishkek\",'id_country' => 118),\n array('name' => \"Chui\",'id_country' => 118),\n array('name' => \"Issyk-Kul\",'id_country' => 118),\n array('name' => \"Jalal-Abad\",'id_country' => 118),\n array('name' => \"Naryn\",'id_country' => 118),\n array('name' => \"Osh\",'id_country' => 118),\n array('name' => \"Talas\",'id_country' => 118),\n array('name' => \"Attopu\",'id_country' => 119),\n array('name' => \"Bokeo\",'id_country' => 119),\n array('name' => \"Bolikhamsay\",'id_country' => 119),\n array('name' => \"Champasak\",'id_country' => 119),\n array('name' => \"Houaphanh\",'id_country' => 119),\n array('name' => \"Khammouane\",'id_country' => 119),\n array('name' => \"Luang Nam Tha\",'id_country' => 119),\n array('name' => \"Luang Prabang\",'id_country' => 119),\n array('name' => \"Oudomxay\",'id_country' => 119),\n array('name' => \"Phongsaly\",'id_country' => 119),\n array('name' => \"Saravan\",'id_country' => 119),\n array('name' => \"Savannakhet\",'id_country' => 119),\n array('name' => \"Sekong\",'id_country' => 119),\n array('name' => \"Viangchan Prefecture\",'id_country' => 119),\n array('name' => \"Viangchan Province\",'id_country' => 119),\n array('name' => \"Xaignabury\",'id_country' => 119),\n array('name' => \"Xiang Khuang\",'id_country' => 119),\n array('name' => \"Aizkraukles\",'id_country' => 120),\n array('name' => \"Aluksnes\",'id_country' => 120),\n array('name' => \"Balvu\",'id_country' => 120),\n array('name' => \"Bauskas\",'id_country' => 120),\n array('name' => \"Cesu\",'id_country' => 120),\n array('name' => \"Daugavpils\",'id_country' => 120),\n array('name' => \"Daugavpils City\",'id_country' => 120),\n array('name' => \"Dobeles\",'id_country' => 120),\n array('name' => \"Gulbenes\",'id_country' => 120),\n array('name' => \"Jekabspils\",'id_country' => 120),\n array('name' => \"Jelgava\",'id_country' => 120),\n array('name' => \"Jelgavas\",'id_country' => 120),\n array('name' => \"Jurmala City\",'id_country' => 120),\n array('name' => \"Kraslavas\",'id_country' => 120),\n array('name' => \"Kuldigas\",'id_country' => 120),\n array('name' => \"Liepaja\",'id_country' => 120),\n array('name' => \"Liepajas\",'id_country' => 120),\n array('name' => \"Limbazhu\",'id_country' => 120),\n array('name' => \"Ludzas\",'id_country' => 120),\n array('name' => \"Madonas\",'id_country' => 120),\n array('name' => \"Ogres\",'id_country' => 120),\n array('name' => \"Preilu\",'id_country' => 120),\n array('name' => \"Rezekne\",'id_country' => 120),\n array('name' => \"Rezeknes\",'id_country' => 120),\n array('name' => \"Riga\",'id_country' => 120),\n array('name' => \"Rigas\",'id_country' => 120),\n array('name' => \"Saldus\",'id_country' => 120),\n array('name' => \"Talsu\",'id_country' => 120),\n array('name' => \"Tukuma\",'id_country' => 120),\n array('name' => \"Valkas\",'id_country' => 120),\n array('name' => \"Valmieras\",'id_country' => 120),\n array('name' => \"Ventspils\",'id_country' => 120),\n array('name' => \"Ventspils City\",'id_country' => 120),\n array('name' => \"Beirut\",'id_country' => 121),\n array('name' => \"Jabal Lubnan\",'id_country' => 121),\n array('name' => \"Mohafazat Liban-Nord\",'id_country' => 121),\n array('name' => \"Mohafazat Mont-Liban\",'id_country' => 121),\n array('name' => \"Sidon\",'id_country' => 121),\n array('name' => \"al-Biqa\",'id_country' => 121),\n array('name' => \"al-Janub\",'id_country' => 121),\n array('name' => \"an-Nabatiyah\",'id_country' => 121),\n array('name' => \"ash-Shamal\",'id_country' => 121),\n array('name' => \"Berea\",'id_country' => 122),\n array('name' => \"Butha-Buthe\",'id_country' => 122),\n array('name' => \"Leribe\",'id_country' => 122),\n array('name' => \"Mafeteng\",'id_country' => 122),\n array('name' => \"Maseru\",'id_country' => 122),\n array('name' => \"Mohale's Hoek\",'id_country' => 122),\n array('name' => \"Mokhotlong\",'id_country' => 122),\n array('name' => \"Qacha's Nek\",'id_country' => 122),\n array('name' => \"Quthing\",'id_country' => 122),\n array('name' => \"Thaba-Tseka\",'id_country' => 122),\n array('name' => \"Bomi\",'id_country' => 123),\n array('name' => \"Bong\",'id_country' => 123),\n array('name' => \"Grand Bassa\",'id_country' => 123),\n array('name' => \"Grand Cape Mount\",'id_country' => 123),\n array('name' => \"Grand Gedeh\",'id_country' => 123),\n array('name' => \"Loffa\",'id_country' => 123),\n array('name' => \"Margibi\",'id_country' => 123),\n array('name' => \"Maryland and Grand Kru\",'id_country' => 123),\n array('name' => \"Montserrado\",'id_country' => 123),\n array('name' => \"Nimba\",'id_country' => 123),\n array('name' => \"Rivercess\",'id_country' => 123),\n array('name' => \"Sinoe\",'id_country' => 123),\n array('name' => \"Ajdabiya\",'id_country' => 124),\n array('name' => \"Fezzan\",'id_country' => 124),\n array('name' => \"Banghazi\",'id_country' => 124),\n array('name' => \"Darnah\",'id_country' => 124),\n array('name' => \"Ghadamis\",'id_country' => 124),\n array('name' => \"Gharyan\",'id_country' => 124),\n array('name' => \"Misratah\",'id_country' => 124),\n array('name' => \"Murzuq\",'id_country' => 124),\n array('name' => \"Sabha\",'id_country' => 124),\n array('name' => \"Sawfajjin\",'id_country' => 124),\n array('name' => \"Surt\",'id_country' => 124),\n array('name' => \"Tarabulus\",'id_country' => 124),\n array('name' => \"Tarhunah\",'id_country' => 124),\n array('name' => \"Tripolitania\",'id_country' => 124),\n array('name' => \"Tubruq\",'id_country' => 124),\n array('name' => \"Yafran\",'id_country' => 124),\n array('name' => \"Zlitan\",'id_country' => 124),\n array('name' => \"al-'Aziziyah\",'id_country' => 124),\n array('name' => \"al-Fatih\",'id_country' => 124),\n array('name' => \"al-Jabal al Akhdar\",'id_country' => 124),\n array('name' => \"al-Jufrah\",'id_country' => 124),\n array('name' => \"al-Khums\",'id_country' => 124),\n array('name' => \"al-Kufrah\",'id_country' => 124),\n array('name' => \"an-Nuqat al-Khams\",'id_country' => 124),\n array('name' => \"ash-Shati'\",'id_country' => 124),\n array('name' => \"az-Zawiyah\",'id_country' => 124),\n array('name' => \"Balzers\",'id_country' => 125),\n array('name' => \"Eschen\",'id_country' => 125),\n array('name' => \"Gamprin\",'id_country' => 125),\n array('name' => \"Mauren\",'id_country' => 125),\n array('name' => \"Planken\",'id_country' => 125),\n array('name' => \"Ruggell\",'id_country' => 125),\n array('name' => \"Schaan\",'id_country' => 125),\n array('name' => \"Schellenberg\",'id_country' => 125),\n array('name' => \"Triesen\",'id_country' => 125),\n array('name' => \"Triesenberg\",'id_country' => 125),\n array('name' => \"Vaduz\",'id_country' => 125),\n array('name' => \"Alytaus\",'id_country' => 126),\n array('name' => \"Anyksciai\",'id_country' => 126),\n array('name' => \"Kauno\",'id_country' => 126),\n array('name' => \"Klaipedos\",'id_country' => 126),\n array('name' => \"Marijampoles\",'id_country' => 126),\n array('name' => \"Panevezhio\",'id_country' => 126),\n array('name' => \"Panevezys\",'id_country' => 126),\n array('name' => \"Shiauliu\",'id_country' => 126),\n array('name' => \"Taurages\",'id_country' => 126),\n array('name' => \"Telshiu\",'id_country' => 126),\n array('name' => \"Telsiai\",'id_country' => 126),\n array('name' => \"Utenos\",'id_country' => 126),\n array('name' => \"Vilniaus\",'id_country' => 126),\n array('name' => \"Capellen\",'id_country' => 127),\n array('name' => \"Clervaux\",'id_country' => 127),\n array('name' => \"Diekirch\",'id_country' => 127),\n array('name' => \"Echternach\",'id_country' => 127),\n array('name' => \"Esch-sur-Alzette\",'id_country' => 127),\n array('name' => \"Grevenmacher\",'id_country' => 127),\n array('name' => \"Luxembourg\",'id_country' => 127),\n array('name' => \"Mersch\",'id_country' => 127),\n array('name' => \"Redange\",'id_country' => 127),\n array('name' => \"Remich\",'id_country' => 127),\n array('name' => \"Vianden\",'id_country' => 127),\n array('name' => \"Wiltz\",'id_country' => 127),\n array('name' => \"Macau\",'id_country' => 128),\n array('name' => \"Berovo\",'id_country' => 129),\n array('name' => \"Bitola\",'id_country' => 129),\n array('name' => \"Brod\",'id_country' => 129),\n array('name' => \"Debar\",'id_country' => 129),\n array('name' => \"Delchevo\",'id_country' => 129),\n array('name' => \"Demir Hisar\",'id_country' => 129),\n array('name' => \"Gevgelija\",'id_country' => 129),\n array('name' => \"Gostivar\",'id_country' => 129),\n array('name' => \"Kavadarci\",'id_country' => 129),\n array('name' => \"Kichevo\",'id_country' => 129),\n array('name' => \"Kochani\",'id_country' => 129),\n array('name' => \"Kratovo\",'id_country' => 129),\n array('name' => \"Kriva Palanka\",'id_country' => 129),\n array('name' => \"Krushevo\",'id_country' => 129),\n array('name' => \"Kumanovo\",'id_country' => 129),\n array('name' => \"Negotino\",'id_country' => 129),\n array('name' => \"Ohrid\",'id_country' => 129),\n array('name' => \"Prilep\",'id_country' => 129),\n array('name' => \"Probishtip\",'id_country' => 129),\n array('name' => \"Radovish\",'id_country' => 129),\n array('name' => \"Resen\",'id_country' => 129),\n array('name' => \"Shtip\",'id_country' => 129),\n array('name' => \"Skopje\",'id_country' => 129),\n array('name' => \"Struga\",'id_country' => 129),\n array('name' => \"Strumica\",'id_country' => 129),\n array('name' => \"Sveti Nikole\",'id_country' => 129),\n array('name' => \"Tetovo\",'id_country' => 129),\n array('name' => \"Valandovo\",'id_country' => 129),\n array('name' => \"Veles\",'id_country' => 129),\n array('name' => \"Vinica\",'id_country' => 129),\n array('name' => \"Antananarivo\",'id_country' => 130),\n array('name' => \"Antsiranana\",'id_country' => 130),\n array('name' => \"Fianarantsoa\",'id_country' => 130),\n array('name' => \"Mahajanga\",'id_country' => 130),\n array('name' => \"Toamasina\",'id_country' => 130),\n array('name' => \"Toliary\",'id_country' => 130),\n array('name' => \"Balaka\",'id_country' => 131),\n array('name' => \"Blantyre City\",'id_country' => 131),\n array('name' => \"Chikwawa\",'id_country' => 131),\n array('name' => \"Chiradzulu\",'id_country' => 131),\n array('name' => \"Chitipa\",'id_country' => 131),\n array('name' => \"Dedza\",'id_country' => 131),\n array('name' => \"Dowa\",'id_country' => 131),\n array('name' => \"Karonga\",'id_country' => 131),\n array('name' => \"Kasungu\",'id_country' => 131),\n array('name' => \"Lilongwe City\",'id_country' => 131),\n array('name' => \"Machinga\",'id_country' => 131),\n array('name' => \"Mangochi\",'id_country' => 131),\n array('name' => \"Mchinji\",'id_country' => 131),\n array('name' => \"Mulanje\",'id_country' => 131),\n array('name' => \"Mwanza\",'id_country' => 131),\n array('name' => \"Mzimba\",'id_country' => 131),\n array('name' => \"Mzuzu City\",'id_country' => 131),\n array('name' => \"Nkhata Bay\",'id_country' => 131),\n array('name' => \"Nkhotakota\",'id_country' => 131),\n array('name' => \"Nsanje\",'id_country' => 131),\n array('name' => \"Ntcheu\",'id_country' => 131),\n array('name' => \"Ntchisi\",'id_country' => 131),\n array('name' => \"Phalombe\",'id_country' => 131),\n array('name' => \"Rumphi\",'id_country' => 131),\n array('name' => \"Salima\",'id_country' => 131),\n array('name' => \"Thyolo\",'id_country' => 131),\n array('name' => \"Zomba Municipality\",'id_country' => 131),\n array('name' => \"Johor\",'id_country' => 132),\n array('name' => \"Kedah\",'id_country' => 132),\n array('name' => \"Kelantan\",'id_country' => 132),\n array('name' => \"Kuala Lumpur\",'id_country' => 132),\n array('name' => \"Labuan\",'id_country' => 132),\n array('name' => \"Melaka\",'id_country' => 132),\n array('name' => \"Negeri Johor\",'id_country' => 132),\n array('name' => \"Negeri Sembilan\",'id_country' => 132),\n array('name' => \"Pahang\",'id_country' => 132),\n array('name' => \"Penang\",'id_country' => 132),\n array('name' => \"Perak\",'id_country' => 132),\n array('name' => \"Perlis\",'id_country' => 132),\n array('name' => \"Pulau Pinang\",'id_country' => 132),\n array('name' => \"Sabah\",'id_country' => 132),\n array('name' => \"Sarawak\",'id_country' => 132),\n array('name' => \"Selangor\",'id_country' => 132),\n array('name' => \"Sembilan\",'id_country' => 132),\n array('name' => \"Terengganu\",'id_country' => 132),\n array('name' => \"Alif Alif\",'id_country' => 133),\n array('name' => \"Alif Dhaal\",'id_country' => 133),\n array('name' => \"Baa\",'id_country' => 133),\n array('name' => \"Dhaal\",'id_country' => 133),\n array('name' => \"Faaf\",'id_country' => 133),\n array('name' => \"Gaaf Alif\",'id_country' => 133),\n array('name' => \"Gaaf Dhaal\",'id_country' => 133),\n array('name' => \"Ghaviyani\",'id_country' => 133),\n array('name' => \"Haa Alif\",'id_country' => 133),\n array('name' => \"Haa Dhaal\",'id_country' => 133),\n array('name' => \"Kaaf\",'id_country' => 133),\n array('name' => \"Laam\",'id_country' => 133),\n array('name' => \"Lhaviyani\",'id_country' => 133),\n array('name' => \"Male\",'id_country' => 133),\n array('name' => \"Miim\",'id_country' => 133),\n array('name' => \"Nuun\",'id_country' => 133),\n array('name' => \"Raa\",'id_country' => 133),\n array('name' => \"Shaviyani\",'id_country' => 133),\n array('name' => \"Siin\",'id_country' => 133),\n array('name' => \"Thaa\",'id_country' => 133),\n array('name' => \"Vaav\",'id_country' => 133),\n array('name' => \"Bamako\",'id_country' => 134),\n array('name' => \"Gao\",'id_country' => 134),\n array('name' => \"Kayes\",'id_country' => 134),\n array('name' => \"Kidal\",'id_country' => 134),\n array('name' => \"Koulikoro\",'id_country' => 134),\n array('name' => \"Mopti\",'id_country' => 134),\n array('name' => \"Segou\",'id_country' => 134),\n array('name' => \"Sikasso\",'id_country' => 134),\n array('name' => \"Tombouctou\",'id_country' => 134),\n array('name' => \"Gozo and Comino\",'id_country' => 135),\n array('name' => \"Inner Harbour\",'id_country' => 135),\n array('name' => \"Northern\",'id_country' => 135),\n array('name' => \"Outer Harbour\",'id_country' => 135),\n array('name' => \"South Eastern\",'id_country' => 135),\n array('name' => \"Valletta\",'id_country' => 135),\n array('name' => \"Western\",'id_country' => 135),\n array('name' => \"Castletown\",'id_country' => 136),\n array('name' => \"Douglas\",'id_country' => 136),\n array('name' => \"Laxey\",'id_country' => 136),\n array('name' => \"Onchan\",'id_country' => 136),\n array('name' => \"Peel\",'id_country' => 136),\n array('name' => \"Port Erin\",'id_country' => 136),\n array('name' => \"Port Saint Mary\",'id_country' => 136),\n array('name' => \"Ramsey\",'id_country' => 136),\n array('name' => \"Ailinlaplap\",'id_country' => 137),\n array('name' => \"Ailuk\",'id_country' => 137),\n array('name' => \"Arno\",'id_country' => 137),\n array('name' => \"Aur\",'id_country' => 137),\n array('name' => \"Bikini\",'id_country' => 137),\n array('name' => \"Ebon\",'id_country' => 137),\n array('name' => \"Enewetak\",'id_country' => 137),\n array('name' => \"Jabat\",'id_country' => 137),\n array('name' => \"Jaluit\",'id_country' => 137),\n array('name' => \"Kili\",'id_country' => 137),\n array('name' => \"Kwajalein\",'id_country' => 137),\n array('name' => \"Lae\",'id_country' => 137),\n array('name' => \"Lib\",'id_country' => 137),\n array('name' => \"Likiep\",'id_country' => 137),\n array('name' => \"Majuro\",'id_country' => 137),\n array('name' => \"Maloelap\",'id_country' => 137),\n array('name' => \"Mejit\",'id_country' => 137),\n array('name' => \"Mili\",'id_country' => 137),\n array('name' => \"Namorik\",'id_country' => 137),\n array('name' => \"Namu\",'id_country' => 137),\n array('name' => \"Rongelap\",'id_country' => 137),\n array('name' => \"Ujae\",'id_country' => 137),\n array('name' => \"Utrik\",'id_country' => 137),\n array('name' => \"Wotho\",'id_country' => 137),\n array('name' => \"Wotje\",'id_country' => 137),\n array('name' => \"Fort-de-France\",'id_country' => 138),\n array('name' => \"La Trinite\",'id_country' => 138),\n array('name' => \"Le Marin\",'id_country' => 138),\n array('name' => \"Saint-Pierre\",'id_country' => 138),\n array('name' => \"Adrar\",'id_country' => 139),\n array('name' => \"Assaba\",'id_country' => 139),\n array('name' => \"Brakna\",'id_country' => 139),\n array('name' => \"Dhakhlat Nawadibu\",'id_country' => 139),\n array('name' => \"Hudh-al-Gharbi\",'id_country' => 139),\n array('name' => \"Hudh-ash-Sharqi\",'id_country' => 139),\n array('name' => \"Inshiri\",'id_country' => 139),\n array('name' => \"Nawakshut\",'id_country' => 139),\n array('name' => \"Qidimagha\",'id_country' => 139),\n array('name' => \"Qurqul\",'id_country' => 139),\n array('name' => \"Taqant\",'id_country' => 139),\n array('name' => \"Tiris Zammur\",'id_country' => 139),\n array('name' => \"Trarza\",'id_country' => 139),\n array('name' => \"Black River\",'id_country' => 140),\n array('name' => \"Eau Coulee\",'id_country' => 140),\n array('name' => \"Flacq\",'id_country' => 140),\n array('name' => \"Floreal\",'id_country' => 140),\n array('name' => \"Grand Port\",'id_country' => 140),\n array('name' => \"Moka\",'id_country' => 140),\n array('name' => \"Pamplempousses\",'id_country' => 140),\n array('name' => \"Plaines Wilhelm\",'id_country' => 140),\n array('name' => \"Port Louis\",'id_country' => 140),\n array('name' => \"Riviere du Rempart\",'id_country' => 140),\n array('name' => \"Rodrigues\",'id_country' => 140),\n array('name' => \"Rose Hill\",'id_country' => 140),\n array('name' => \"Savanne\",'id_country' => 140),\n array('name' => \"Mayotte\",'id_country' => 141),\n array('name' => \"Pamanzi\",'id_country' => 141),\n array('name' => \"Aguascalientes\",'id_country' => 142),\n array('name' => \"Baja California\",'id_country' => 142),\n array('name' => \"Baja California Sur\",'id_country' => 142),\n array('name' => \"Campeche\",'id_country' => 142),\n array('name' => \"Chiapas\",'id_country' => 142),\n array('name' => \"Chihuahua\",'id_country' => 142),\n array('name' => \"Coahuila\",'id_country' => 142),\n array('name' => \"Colima\",'id_country' => 142),\n array('name' => \"Distrito Federal\",'id_country' => 142),\n array('name' => \"Durango\",'id_country' => 142),\n array('name' => \"Estado de Mexico\",'id_country' => 142),\n array('name' => \"Guanajuato\",'id_country' => 142),\n array('name' => \"Guerrero\",'id_country' => 142),\n array('name' => \"Hidalgo\",'id_country' => 142),\n array('name' => \"Jalisco\",'id_country' => 142),\n array('name' => \"Mexico\",'id_country' => 142),\n array('name' => \"Michoacan\",'id_country' => 142),\n array('name' => \"Morelos\",'id_country' => 142),\n array('name' => \"Nayarit\",'id_country' => 142),\n array('name' => \"Nuevo Leon\",'id_country' => 142),\n array('name' => \"Oaxaca\",'id_country' => 142),\n array('name' => \"Puebla\",'id_country' => 142),\n array('name' => \"Queretaro\",'id_country' => 142),\n array('name' => \"Quintana Roo\",'id_country' => 142),\n array('name' => \"San Luis Potosi\",'id_country' => 142),\n array('name' => \"Sinaloa\",'id_country' => 142),\n array('name' => \"Sonora\",'id_country' => 142),\n array('name' => \"Tabasco\",'id_country' => 142),\n array('name' => \"Tamaulipas\",'id_country' => 142),\n array('name' => \"Tlaxcala\",'id_country' => 142),\n array('name' => \"Veracruz\",'id_country' => 142),\n array('name' => \"Yucatan\",'id_country' => 142),\n array('name' => \"Zacatecas\",'id_country' => 142),\n array('name' => \"Chuuk\",'id_country' => 143),\n array('name' => \"Kusaie\",'id_country' => 143),\n array('name' => \"Pohnpei\",'id_country' => 143),\n array('name' => \"Yap\",'id_country' => 143),\n array('name' => \"Balti\",'id_country' => 144),\n array('name' => \"Cahul\",'id_country' => 144),\n array('name' => \"Chisinau\",'id_country' => 144),\n array('name' => \"Chisinau Oras\",'id_country' => 144),\n array('name' => \"Edinet\",'id_country' => 144),\n array('name' => \"Gagauzia\",'id_country' => 144),\n array('name' => \"Lapusna\",'id_country' => 144),\n array('name' => \"Orhei\",'id_country' => 144),\n array('name' => \"Soroca\",'id_country' => 144),\n array('name' => \"Taraclia\",'id_country' => 144),\n array('name' => \"Tighina\",'id_country' => 144),\n array('name' => \"Transnistria\",'id_country' => 144),\n array('name' => \"Ungheni\",'id_country' => 144),\n array('name' => \"Fontvieille\",'id_country' => 145),\n array('name' => \"La Condamine\",'id_country' => 145),\n array('name' => \"Monaco-Ville\",'id_country' => 145),\n array('name' => \"Monte Carlo\",'id_country' => 145),\n array('name' => \"Arhangaj\",'id_country' => 146),\n array('name' => \"Bajan-Olgij\",'id_country' => 146),\n array('name' => \"Bajanhongor\",'id_country' => 146),\n array('name' => \"Bulgan\",'id_country' => 146),\n array('name' => \"Darhan-Uul\",'id_country' => 146),\n array('name' => \"Dornod\",'id_country' => 146),\n array('name' => \"Dornogovi\",'id_country' => 146),\n array('name' => \"Dundgovi\",'id_country' => 146),\n array('name' => \"Govi-Altaj\",'id_country' => 146),\n array('name' => \"Govisumber\",'id_country' => 146),\n array('name' => \"Hentij\",'id_country' => 146),\n array('name' => \"Hovd\",'id_country' => 146),\n array('name' => \"Hovsgol\",'id_country' => 146),\n array('name' => \"Omnogovi\",'id_country' => 146),\n array('name' => \"Orhon\",'id_country' => 146),\n array('name' => \"Ovorhangaj\",'id_country' => 146),\n array('name' => \"Selenge\",'id_country' => 146),\n array('name' => \"Suhbaatar\",'id_country' => 146),\n array('name' => \"Tov\",'id_country' => 146),\n array('name' => \"Ulaanbaatar\",'id_country' => 146),\n array('name' => \"Uvs\",'id_country' => 146),\n array('name' => \"Zavhan\",'id_country' => 146),\n array('name' => \"Montserrat\",'id_country' => 147),\n array('name' => \"Agadir\",'id_country' => 148),\n array('name' => \"Casablanca\",'id_country' => 148),\n array('name' => \"Chaouia-Ouardigha\",'id_country' => 148),\n array('name' => \"Doukkala-Abda\",'id_country' => 148),\n array('name' => \"Fes-Boulemane\",'id_country' => 148),\n array('name' => \"Gharb-Chrarda-Beni Hssen\",'id_country' => 148),\n array('name' => \"Guelmim\",'id_country' => 148),\n array('name' => \"Kenitra\",'id_country' => 148),\n array('name' => \"Marrakech-Tensift-Al Haouz\",'id_country' => 148),\n array('name' => \"Meknes-Tafilalet\",'id_country' => 148),\n array('name' => \"Oriental\",'id_country' => 148),\n array('name' => \"Oujda\",'id_country' => 148),\n array('name' => \"Province de Tanger\",'id_country' => 148),\n array('name' => \"Rabat-Sale-Zammour-Zaer\",'id_country' => 148),\n array('name' => \"Sala Al Jadida\",'id_country' => 148),\n array('name' => \"Settat\",'id_country' => 148),\n array('name' => \"Souss Massa-Draa\",'id_country' => 148),\n array('name' => \"Tadla-Azilal\",'id_country' => 148),\n array('name' => \"Tangier-Tetouan\",'id_country' => 148),\n array('name' => \"Taza-Al Hoceima-Taounate\",'id_country' => 148),\n array('name' => \"Wilaya de Casablanca\",'id_country' => 148),\n array('name' => \"Wilaya de Rabat-Sale\",'id_country' => 148),\n array('name' => \"Cabo Delgado\",'id_country' => 149),\n array('name' => \"Gaza\",'id_country' => 149),\n array('name' => \"Inhambane\",'id_country' => 149),\n array('name' => \"Manica\",'id_country' => 149),\n array('name' => \"Maputo\",'id_country' => 149),\n array('name' => \"Maputo Provincia\",'id_country' => 149),\n array('name' => \"Nampula\",'id_country' => 149),\n array('name' => \"Niassa\",'id_country' => 149),\n array('name' => \"Sofala\",'id_country' => 149),\n array('name' => \"Tete\",'id_country' => 149),\n array('name' => \"Zambezia\",'id_country' => 149),\n array('name' => \"Ayeyarwady\",'id_country' => 150),\n array('name' => \"Bago\",'id_country' => 150),\n array('name' => \"Chin\",'id_country' => 150),\n array('name' => \"Kachin\",'id_country' => 150),\n array('name' => \"Kayah\",'id_country' => 150),\n array('name' => \"Kayin\",'id_country' => 150),\n array('name' => \"Magway\",'id_country' => 150),\n array('name' => \"Mandalay\",'id_country' => 150),\n array('name' => \"Mon\",'id_country' => 150),\n array('name' => \"Nay Pyi Taw\",'id_country' => 150),\n array('name' => \"Rakhine\",'id_country' => 150),\n array('name' => \"Sagaing\",'id_country' => 150),\n array('name' => \"Shan\",'id_country' => 150),\n array('name' => \"Tanintharyi\",'id_country' => 150),\n array('name' => \"Yangon\",'id_country' => 150),\n array('name' => \"Caprivi\",'id_country' => 151),\n array('name' => \"Erongo\",'id_country' => 151),\n array('name' => \"Hardap\",'id_country' => 151),\n array('name' => \"Karas\",'id_country' => 151),\n array('name' => \"Kavango\",'id_country' => 151),\n array('name' => \"Khomas\",'id_country' => 151),\n array('name' => \"Kunene\",'id_country' => 151),\n array('name' => \"Ohangwena\",'id_country' => 151),\n array('name' => \"Omaheke\",'id_country' => 151),\n array('name' => \"Omusati\",'id_country' => 151),\n array('name' => \"Oshana\",'id_country' => 151),\n array('name' => \"Oshikoto\",'id_country' => 151),\n array('name' => \"Otjozondjupa\",'id_country' => 151),\n array('name' => \"Yaren\",'id_country' => 152),\n array('name' => \"Bagmati\",'id_country' => 153),\n array('name' => \"Bheri\",'id_country' => 153),\n array('name' => \"Dhawalagiri\",'id_country' => 153),\n array('name' => \"Gandaki\",'id_country' => 153),\n array('name' => \"Janakpur\",'id_country' => 153),\n array('name' => \"Karnali\",'id_country' => 153),\n array('name' => \"Koshi\",'id_country' => 153),\n array('name' => \"Lumbini\",'id_country' => 153),\n array('name' => \"Mahakali\",'id_country' => 153),\n array('name' => \"Mechi\",'id_country' => 153),\n array('name' => \"Narayani\",'id_country' => 153),\n array('name' => \"Rapti\",'id_country' => 153),\n array('name' => \"Sagarmatha\",'id_country' => 153),\n array('name' => \"Seti\",'id_country' => 153),\n array('name' => \"Bonaire\",'id_country' => 154),\n array('name' => \"Curacao\",'id_country' => 154),\n array('name' => \"Saba\",'id_country' => 154),\n array('name' => \"Sint Eustatius\",'id_country' => 154),\n array('name' => \"Sint Maarten\",'id_country' => 154),\n array('name' => \"Amsterdam\",'id_country' => 155),\n array('name' => \"Benelux\",'id_country' => 155),\n array('name' => \"Drenthe\",'id_country' => 155),\n array('name' => \"Flevoland\",'id_country' => 155),\n array('name' => \"Friesland\",'id_country' => 155),\n array('name' => \"Gelderland\",'id_country' => 155),\n array('name' => \"Groningen\",'id_country' => 155),\n array('name' => \"Limburg\",'id_country' => 155),\n array('name' => \"Noord-Brabant\",'id_country' => 155),\n array('name' => \"Noord-Holland\",'id_country' => 155),\n array('name' => \"Overijssel\",'id_country' => 155),\n array('name' => \"South Holland\",'id_country' => 155),\n array('name' => \"Utrecht\",'id_country' => 155),\n array('name' => \"Zeeland\",'id_country' => 155),\n array('name' => \"Zuid-Holland\",'id_country' => 155),\n array('name' => \"Iles\",'id_country' => 156),\n array('name' => \"Nord\",'id_country' => 156),\n array('name' => \"Sud\",'id_country' => 156),\n array('name' => \"Area Outside Region\",'id_country' => 157),\n array('name' => \"Auckland\",'id_country' => 157),\n array('name' => \"Bay of Plenty\",'id_country' => 157),\n array('name' => \"Canterbury\",'id_country' => 157),\n array('name' => \"Christchurch\",'id_country' => 157),\n array('name' => \"Gisborne\",'id_country' => 157),\n array('name' => \"Hawke's Bay\",'id_country' => 157),\n array('name' => \"Manawatu-Wanganui\",'id_country' => 157),\n array('name' => \"Marlborough\",'id_country' => 157),\n array('name' => \"Nelson\",'id_country' => 157),\n array('name' => \"Northland\",'id_country' => 157),\n array('name' => \"Otago\",'id_country' => 157),\n array('name' => \"Rodney\",'id_country' => 157),\n array('name' => \"Southland\",'id_country' => 157),\n array('name' => \"Taranaki\",'id_country' => 157),\n array('name' => \"Tasman\",'id_country' => 157),\n array('name' => \"Waikato\",'id_country' => 157),\n array('name' => \"Wellington\",'id_country' => 157),\n array('name' => \"West Coast\",'id_country' => 157),\n array('name' => \"Atlantico Norte\",'id_country' => 158),\n array('name' => \"Atlantico Sur\",'id_country' => 158),\n array('name' => \"Boaco\",'id_country' => 158),\n array('name' => \"Carazo\",'id_country' => 158),\n array('name' => \"Chinandega\",'id_country' => 158),\n array('name' => \"Chontales\",'id_country' => 158),\n array('name' => \"Esteli\",'id_country' => 158),\n array('name' => \"Granada\",'id_country' => 158),\n array('name' => \"Jinotega\",'id_country' => 158),\n array('name' => \"Leon\",'id_country' => 158),\n array('name' => \"Madriz\",'id_country' => 158),\n array('name' => \"Managua\",'id_country' => 158),\n array('name' => \"Masaya\",'id_country' => 158),\n array('name' => \"Matagalpa\",'id_country' => 158),\n array('name' => \"Nueva Segovia\",'id_country' => 158),\n array('name' => \"Rio San Juan\",'id_country' => 158),\n array('name' => \"Rivas\",'id_country' => 158),\n array('name' => \"Agadez\",'id_country' => 159),\n array('name' => \"Diffa\",'id_country' => 159),\n array('name' => \"Dosso\",'id_country' => 159),\n array('name' => \"Maradi\",'id_country' => 159),\n array('name' => \"Niamey\",'id_country' => 159),\n array('name' => \"Tahoua\",'id_country' => 159),\n array('name' => \"Tillabery\",'id_country' => 159),\n array('name' => \"Zinder\",'id_country' => 159),\n array('name' => \"Abia\",'id_country' => 160),\n array('name' => \"Abuja Federal Capital Territor\",'id_country' => 160),\n array('name' => \"Adamawa\",'id_country' => 160),\n array('name' => \"Akwa Ibom\",'id_country' => 160),\n array('name' => \"Anambra\",'id_country' => 160),\n array('name' => \"Bauchi\",'id_country' => 160),\n array('name' => \"Bayelsa\",'id_country' => 160),\n array('name' => \"Benue\",'id_country' => 160),\n array('name' => \"Borno\",'id_country' => 160),\n array('name' => \"Cross River\",'id_country' => 160),\n array('name' => \"Delta\",'id_country' => 160),\n array('name' => \"Ebonyi\",'id_country' => 160),\n array('name' => \"Edo\",'id_country' => 160),\n array('name' => \"Ekiti\",'id_country' => 160),\n array('name' => \"Enugu\",'id_country' => 160),\n array('name' => \"Gombe\",'id_country' => 160),\n array('name' => \"Imo\",'id_country' => 160),\n array('name' => \"Jigawa\",'id_country' => 160),\n array('name' => \"Kaduna\",'id_country' => 160),\n array('name' => \"Kano\",'id_country' => 160),\n array('name' => \"Katsina\",'id_country' => 160),\n array('name' => \"Kebbi\",'id_country' => 160),\n array('name' => \"Kogi\",'id_country' => 160),\n array('name' => \"Kwara\",'id_country' => 160),\n array('name' => \"Lagos\",'id_country' => 160),\n array('name' => \"Nassarawa\",'id_country' => 160),\n array('name' => \"Niger\",'id_country' => 160),\n array('name' => \"Ogun\",'id_country' => 160),\n array('name' => \"Ondo\",'id_country' => 160),\n array('name' => \"Osun\",'id_country' => 160),\n array('name' => \"Oyo\",'id_country' => 160),\n array('name' => \"Plateau\",'id_country' => 160),\n array('name' => \"Rivers\",'id_country' => 160),\n array('name' => \"Sokoto\",'id_country' => 160),\n array('name' => \"Taraba\",'id_country' => 160),\n array('name' => \"Yobe\",'id_country' => 160),\n array('name' => \"Zamfara\",'id_country' => 160),\n array('name' => \"Niue\",'id_country' => 161),\n array('name' => \"Norfolk Island\",'id_country' => 162),\n array('name' => \"Northern Islands\",'id_country' => 163),\n array('name' => \"Rota\",'id_country' => 163),\n array('name' => \"Saipan\",'id_country' => 163),\n array('name' => \"Tinian\",'id_country' => 163),\n array('name' => \"Akershus\",'id_country' => 164),\n array('name' => \"Aust Agder\",'id_country' => 164),\n array('name' => \"Bergen\",'id_country' => 164),\n array('name' => \"Buskerud\",'id_country' => 164),\n array('name' => \"Finnmark\",'id_country' => 164),\n array('name' => \"Hedmark\",'id_country' => 164),\n array('name' => \"Hordaland\",'id_country' => 164),\n array('name' => \"Moere og Romsdal\",'id_country' => 164),\n array('name' => \"Nord Trondelag\",'id_country' => 164),\n array('name' => \"Nordland\",'id_country' => 164),\n array('name' => \"Oestfold\",'id_country' => 164),\n array('name' => \"Oppland\",'id_country' => 164),\n array('name' => \"Oslo\",'id_country' => 164),\n array('name' => \"Rogaland\",'id_country' => 164),\n array('name' => \"Soer Troendelag\",'id_country' => 164),\n array('name' => \"Sogn og Fjordane\",'id_country' => 164),\n array('name' => \"Stavern\",'id_country' => 164),\n array('name' => \"Sykkylven\",'id_country' => 164),\n array('name' => \"Telemark\",'id_country' => 164),\n array('name' => \"Troms\",'id_country' => 164),\n array('name' => \"Vest Agder\",'id_country' => 164),\n array('name' => \"Vestfold\",'id_country' => 164),\n array('name' => \"Østfold\",'id_country' => 164),\n array('name' => \"Al Buraimi\",'id_country' => 165),\n array('name' => \"Dhufar\",'id_country' => 165),\n array('name' => \"Masqat\",'id_country' => 165),\n array('name' => \"Musandam\",'id_country' => 165),\n array('name' => \"Rusayl\",'id_country' => 165),\n array('name' => \"Wadi Kabir\",'id_country' => 165),\n array('name' => \"ad-Dakhiliyah\",'id_country' => 165),\n array('name' => \"adh-Dhahirah\",'id_country' => 165),\n array('name' => \"al-Batinah\",'id_country' => 165),\n array('name' => \"ash-Sharqiyah\",'id_country' => 165),\n array('name' => \"Azad kashmir\",'id_country' => 166),\n array('name' => \"Balochistan\",'id_country' => 166),\n array('name' => \"Fata\",'id_country' => 166),\n array('name' => \"Gilgit–baltistan\",'id_country' => 166),\n array('name' => \"Islamabad capital territory\",'id_country' => 166),\n array('name' => \"Khyber Pakhtunkhwa\",'id_country' => 166),\n array('name' => \"Punjab\",'id_country' => 166),\n array('name' => \"Sindh\",'id_country' => 166),\n array('name' => \"Aimeliik\",'id_country' => 167),\n array('name' => \"Airai\",'id_country' => 167),\n array('name' => \"Angaur\",'id_country' => 167),\n array('name' => \"Hatobohei\",'id_country' => 167),\n array('name' => \"Kayangel\",'id_country' => 167),\n array('name' => \"Koror\",'id_country' => 167),\n array('name' => \"Melekeok\",'id_country' => 167),\n array('name' => \"Ngaraard\",'id_country' => 167),\n array('name' => \"Ngardmau\",'id_country' => 167),\n array('name' => \"Ngaremlengui\",'id_country' => 167),\n array('name' => \"Ngatpang\",'id_country' => 167),\n array('name' => \"Ngchesar\",'id_country' => 167),\n array('name' => \"Ngerchelong\",'id_country' => 167),\n array('name' => \"Ngiwal\",'id_country' => 167),\n array('name' => \"Peleliu\",'id_country' => 167),\n array('name' => \"Sonsorol\",'id_country' => 167),\n array('name' => \"Ariha\",'id_country' => 168),\n array('name' => \"Bayt Lahm\",'id_country' => 168),\n array('name' => \"Bethlehem\",'id_country' => 168),\n array('name' => \"Dayr-al-Balah\",'id_country' => 168),\n array('name' => \"Ghazzah\",'id_country' => 168),\n array('name' => \"Ghazzah ash-Shamaliyah\",'id_country' => 168),\n array('name' => \"Janin\",'id_country' => 168),\n array('name' => \"Khan Yunis\",'id_country' => 168),\n array('name' => \"Nabulus\",'id_country' => 168),\n array('name' => \"Qalqilyah\",'id_country' => 168),\n array('name' => \"Rafah\",'id_country' => 168),\n array('name' => \"Ram Allah wal-Birah\",'id_country' => 168),\n array('name' => \"Salfit\",'id_country' => 168),\n array('name' => \"Tubas\",'id_country' => 168),\n array('name' => \"Tulkarm\",'id_country' => 168),\n array('name' => \"al-Khalil\",'id_country' => 168),\n array('name' => \"al-Quds\",'id_country' => 168),\n array('name' => \"Bocas del Toro\",'id_country' => 169),\n array('name' => \"Chiriqui\",'id_country' => 169),\n array('name' => \"Cocle\",'id_country' => 169),\n array('name' => \"Colon\",'id_country' => 169),\n array('name' => \"Darien\",'id_country' => 169),\n array('name' => \"Embera\",'id_country' => 169),\n array('name' => \"Herrera\",'id_country' => 169),\n array('name' => \"Kuna Yala\",'id_country' => 169),\n array('name' => \"Los Santos\",'id_country' => 169),\n array('name' => \"Ngobe Bugle\",'id_country' => 169),\n array('name' => \"Panama\",'id_country' => 169),\n array('name' => \"Veraguas\",'id_country' => 169),\n array('name' => \"East New Britain\",'id_country' => 170),\n array('name' => \"East Sepik\",'id_country' => 170),\n array('name' => \"Eastern Highlands\",'id_country' => 170),\n array('name' => \"Enga\",'id_country' => 170),\n array('name' => \"Fly River\",'id_country' => 170),\n array('name' => \"Gulf\",'id_country' => 170),\n array('name' => \"Madang\",'id_country' => 170),\n array('name' => \"Manus\",'id_country' => 170),\n array('name' => \"Milne Bay\",'id_country' => 170),\n array('name' => \"Morobe\",'id_country' => 170),\n array('name' => \"National Capital District\",'id_country' => 170),\n array('name' => \"New Ireland\",'id_country' => 170),\n array('name' => \"North Solomons\",'id_country' => 170),\n array('name' => \"Oro\",'id_country' => 170),\n array('name' => \"Sandaun\",'id_country' => 170),\n array('name' => \"Simbu\",'id_country' => 170),\n array('name' => \"Southern Highlands\",'id_country' => 170),\n array('name' => \"West New Britain\",'id_country' => 170),\n array('name' => \"Western Highlands\",'id_country' => 170),\n array('name' => \"Alto Paraguay\",'id_country' => 171),\n array('name' => \"Alto Parana\",'id_country' => 171),\n array('name' => \"Amambay\",'id_country' => 171),\n array('name' => \"Asuncion\",'id_country' => 171),\n array('name' => \"Boqueron\",'id_country' => 171),\n array('name' => \"Caaguazu\",'id_country' => 171),\n array('name' => \"Caazapa\",'id_country' => 171),\n array('name' => \"Canendiyu\",'id_country' => 171),\n array('name' => \"Central\",'id_country' => 171),\n array('name' => \"Concepcion\",'id_country' => 171),\n array('name' => \"Cordillera\",'id_country' => 171),\n array('name' => \"Guaira\",'id_country' => 171),\n array('name' => \"Itapua\",'id_country' => 171),\n array('name' => \"Misiones\",'id_country' => 171),\n array('name' => \"Neembucu\",'id_country' => 171),\n array('name' => \"Paraguari\",'id_country' => 171),\n array('name' => \"Presidente Hayes\",'id_country' => 171),\n array('name' => \"San Pedro\",'id_country' => 171),\n array('name' => \"Amazonas\",'id_country' => 172),\n array('name' => \"Ancash\",'id_country' => 172),\n array('name' => \"Apurimac\",'id_country' => 172),\n array('name' => \"Arequipa\",'id_country' => 172),\n array('name' => \"Ayacucho\",'id_country' => 172),\n array('name' => \"Cajamarca\",'id_country' => 172),\n array('name' => \"Cusco\",'id_country' => 172),\n array('name' => \"Huancavelica\",'id_country' => 172),\n array('name' => \"Huanuco\",'id_country' => 172),\n array('name' => \"Ica\",'id_country' => 172),\n array('name' => \"Junin\",'id_country' => 172),\n array('name' => \"La Libertad\",'id_country' => 172),\n array('name' => \"Lambayeque\",'id_country' => 172),\n array('name' => \"Lima y Callao\",'id_country' => 172),\n array('name' => \"Loreto\",'id_country' => 172),\n array('name' => \"Madre de Dios\",'id_country' => 172),\n array('name' => \"Moquegua\",'id_country' => 172),\n array('name' => \"Pasco\",'id_country' => 172),\n array('name' => \"Piura\",'id_country' => 172),\n array('name' => \"Puno\",'id_country' => 172),\n array('name' => \"San Martin\",'id_country' => 172),\n array('name' => \"Tacna\",'id_country' => 172),\n array('name' => \"Tumbes\",'id_country' => 172),\n array('name' => \"Ucayali\",'id_country' => 172),\n array('name' => \"Batangas\",'id_country' => 173),\n array('name' => \"Bicol\",'id_country' => 173),\n array('name' => \"Bulacan\",'id_country' => 173),\n array('name' => \"Cagayan\",'id_country' => 173),\n array('name' => \"Caraga\",'id_country' => 173),\n array('name' => \"Central Luzon\",'id_country' => 173),\n array('name' => \"Central Mindanao\",'id_country' => 173),\n array('name' => \"Central Visayas\",'id_country' => 173),\n array('name' => \"Cordillera\",'id_country' => 173),\n array('name' => \"Davao\",'id_country' => 173),\n array('name' => \"Eastern Visayas\",'id_country' => 173),\n array('name' => \"Greater Metropolitan Area\",'id_country' => 173),\n array('name' => \"Ilocos\",'id_country' => 173),\n array('name' => \"Laguna\",'id_country' => 173),\n array('name' => \"Luzon\",'id_country' => 173),\n array('name' => \"Mactan\",'id_country' => 173),\n array('name' => \"Metropolitan Manila Area\",'id_country' => 173),\n array('name' => \"Muslim Mindanao\",'id_country' => 173),\n array('name' => \"Northern Mindanao\",'id_country' => 173),\n array('name' => \"Southern Mindanao\",'id_country' => 173),\n array('name' => \"Southern Tagalog\",'id_country' => 173),\n array('name' => \"Western Mindanao\",'id_country' => 173),\n array('name' => \"Western Visayas\",'id_country' => 173),\n array('name' => \"Pitcairn Island\",'id_country' => 174),\n array('name' => \"Biale Blota\",'id_country' => 175),\n array('name' => \"Dobroszyce\",'id_country' => 175),\n array('name' => \"Dolnoslaskie\",'id_country' => 175),\n array('name' => \"Dziekanow Lesny\",'id_country' => 175),\n array('name' => \"Hopowo\",'id_country' => 175),\n array('name' => \"Kartuzy\",'id_country' => 175),\n array('name' => \"Koscian\",'id_country' => 175),\n array('name' => \"Krakow\",'id_country' => 175),\n array('name' => \"Kujawsko-Pomorskie\",'id_country' => 175),\n array('name' => \"Lodzkie\",'id_country' => 175),\n array('name' => \"Lubelskie\",'id_country' => 175),\n array('name' => \"Lubuskie\",'id_country' => 175),\n array('name' => \"Malomice\",'id_country' => 175),\n array('name' => \"Malopolskie\",'id_country' => 175),\n array('name' => \"Mazowieckie\",'id_country' => 175),\n array('name' => \"Mirkow\",'id_country' => 175),\n array('name' => \"Opolskie\",'id_country' => 175),\n array('name' => \"Ostrowiec\",'id_country' => 175),\n array('name' => \"Podkarpackie\",'id_country' => 175),\n array('name' => \"Podlaskie\",'id_country' => 175),\n array('name' => \"Polska\",'id_country' => 175),\n array('name' => \"Pomorskie\",'id_country' => 175),\n array('name' => \"Poznan\",'id_country' => 175),\n array('name' => \"Pruszkow\",'id_country' => 175),\n array('name' => \"Rymanowska\",'id_country' => 175),\n array('name' => \"Rzeszow\",'id_country' => 175),\n array('name' => \"Slaskie\",'id_country' => 175),\n array('name' => \"Stare Pole\",'id_country' => 175),\n array('name' => \"Swietokrzyskie\",'id_country' => 175),\n array('name' => \"Warminsko-Mazurskie\",'id_country' => 175),\n array('name' => \"Warsaw\",'id_country' => 175),\n array('name' => \"Wejherowo\",'id_country' => 175),\n array('name' => \"Wielkopolskie\",'id_country' => 175),\n array('name' => \"Wroclaw\",'id_country' => 175),\n array('name' => \"Zachodnio-Pomorskie\",'id_country' => 175),\n array('name' => \"Zukowo\",'id_country' => 175),\n array('name' => \"Abrantes\",'id_country' => 176),\n array('name' => \"Acores\",'id_country' => 176),\n array('name' => \"Alentejo\",'id_country' => 176),\n array('name' => \"Algarve\",'id_country' => 176),\n array('name' => \"Braga\",'id_country' => 176),\n array('name' => \"Centro\",'id_country' => 176),\n array('name' => \"Distrito de Leiria\",'id_country' => 176),\n array('name' => \"Distrito de Viana do Castelo\",'id_country' => 176),\n array('name' => \"Distrito de Vila Real\",'id_country' => 176),\n array('name' => \"Distrito do Porto\",'id_country' => 176),\n array('name' => \"Lisboa e Vale do Tejo\",'id_country' => 176),\n array('name' => \"Madeira\",'id_country' => 176),\n array('name' => \"Norte\",'id_country' => 176),\n array('name' => \"Paivas\",'id_country' => 176),\n array('name' => \"Arecibo\",'id_country' => 177),\n array('name' => \"Bayamon\",'id_country' => 177),\n array('name' => \"Carolina\",'id_country' => 177),\n array('name' => \"Florida\",'id_country' => 177),\n array('name' => \"Guayama\",'id_country' => 177),\n array('name' => \"Humacao\",'id_country' => 177),\n array('name' => \"Mayaguez-Aguadilla\",'id_country' => 177),\n array('name' => \"Ponce\",'id_country' => 177),\n array('name' => \"Salinas\",'id_country' => 177),\n array('name' => \"San Juan\",'id_country' => 177),\n array('name' => \"Doha\",'id_country' => 178),\n array('name' => \"Jarian-al-Batnah\",'id_country' => 178),\n array('name' => \"Umm Salal\",'id_country' => 178),\n array('name' => \"ad-Dawhah\",'id_country' => 178),\n array('name' => \"al-Ghuwayriyah\",'id_country' => 178),\n array('name' => \"al-Jumayliyah\",'id_country' => 178),\n array('name' => \"al-Khawr\",'id_country' => 178),\n array('name' => \"al-Wakrah\",'id_country' => 178),\n array('name' => \"ar-Rayyan\",'id_country' => 178),\n array('name' => \"ash-Shamal\",'id_country' => 178),\n array('name' => \"Saint-Benoit\",'id_country' => 179),\n array('name' => \"Saint-Denis\",'id_country' => 179),\n array('name' => \"Saint-Paul\",'id_country' => 179),\n array('name' => \"Saint-Pierre\",'id_country' => 179),\n array('name' => \"Alba\",'id_country' => 180),\n array('name' => \"Arad\",'id_country' => 180),\n array('name' => \"Arges\",'id_country' => 180),\n array('name' => \"Bacau\",'id_country' => 180),\n array('name' => \"Bihor\",'id_country' => 180),\n array('name' => \"Bistrita-Nasaud\",'id_country' => 180),\n array('name' => \"Botosani\",'id_country' => 180),\n array('name' => \"Braila\",'id_country' => 180),\n array('name' => \"Brasov\",'id_country' => 180),\n array('name' => \"Bucuresti\",'id_country' => 180),\n array('name' => \"Buzau\",'id_country' => 180),\n array('name' => \"Calarasi\",'id_country' => 180),\n array('name' => \"Caras-Severin\",'id_country' => 180),\n array('name' => \"Cluj\",'id_country' => 180),\n array('name' => \"Constanta\",'id_country' => 180),\n array('name' => \"Covasna\",'id_country' => 180),\n array('name' => \"Dambovita\",'id_country' => 180),\n array('name' => \"Dolj\",'id_country' => 180),\n array('name' => \"Galati\",'id_country' => 180),\n array('name' => \"Giurgiu\",'id_country' => 180),\n array('name' => \"Gorj\",'id_country' => 180),\n array('name' => \"Harghita\",'id_country' => 180),\n array('name' => \"Hunedoara\",'id_country' => 180),\n array('name' => \"Ialomita\",'id_country' => 180),\n array('name' => \"Iasi\",'id_country' => 180),\n array('name' => \"Ilfov\",'id_country' => 180),\n array('name' => \"Maramures\",'id_country' => 180),\n array('name' => \"Mehedinti\",'id_country' => 180),\n array('name' => \"Mures\",'id_country' => 180),\n array('name' => \"Neamt\",'id_country' => 180),\n array('name' => \"Olt\",'id_country' => 180),\n array('name' => \"Prahova\",'id_country' => 180),\n array('name' => \"Salaj\",'id_country' => 180),\n array('name' => \"Satu Mare\",'id_country' => 180),\n array('name' => \"Sibiu\",'id_country' => 180),\n array('name' => \"Sondelor\",'id_country' => 180),\n array('name' => \"Suceava\",'id_country' => 180),\n array('name' => \"Teleorman\",'id_country' => 180),\n array('name' => \"Timis\",'id_country' => 180),\n array('name' => \"Tulcea\",'id_country' => 180),\n array('name' => \"Valcea\",'id_country' => 180),\n array('name' => \"Vaslui\",'id_country' => 180),\n array('name' => \"Vrancea\",'id_country' => 180),\n array('name' => \"Adygeja\",'id_country' => 181),\n array('name' => \"Aga\",'id_country' => 181),\n array('name' => \"Alanija\",'id_country' => 181),\n array('name' => \"Altaj\",'id_country' => 181),\n array('name' => \"Amur\",'id_country' => 181),\n array('name' => \"Arhangelsk\",'id_country' => 181),\n array('name' => \"Astrahan\",'id_country' => 181),\n array('name' => \"Bashkortostan\",'id_country' => 181),\n array('name' => \"Belgorod\",'id_country' => 181),\n array('name' => \"Brjansk\",'id_country' => 181),\n array('name' => \"Burjatija\",'id_country' => 181),\n array('name' => \"Chechenija\",'id_country' => 181),\n array('name' => \"Cheljabinsk\",'id_country' => 181),\n array('name' => \"Chita\",'id_country' => 181),\n array('name' => \"Chukotka\",'id_country' => 181),\n array('name' => \"Chuvashija\",'id_country' => 181),\n array('name' => \"Dagestan\",'id_country' => 181),\n array('name' => \"Evenkija\",'id_country' => 181),\n array('name' => \"Gorno-Altaj\",'id_country' => 181),\n array('name' => \"Habarovsk\",'id_country' => 181),\n array('name' => \"Hakasija\",'id_country' => 181),\n array('name' => \"Hanty-Mansija\",'id_country' => 181),\n array('name' => \"Ingusetija\",'id_country' => 181),\n array('name' => \"Irkutsk\",'id_country' => 181),\n array('name' => \"Ivanovo\",'id_country' => 181),\n array('name' => \"Jamalo-Nenets\",'id_country' => 181),\n array('name' => \"Jaroslavl\",'id_country' => 181),\n array('name' => \"Jevrej\",'id_country' => 181),\n array('name' => \"Kabardino-Balkarija\",'id_country' => 181),\n array('name' => \"Kaliningrad\",'id_country' => 181),\n array('name' => \"Kalmykija\",'id_country' => 181),\n array('name' => \"Kaluga\",'id_country' => 181),\n array('name' => \"Kamchatka\",'id_country' => 181),\n array('name' => \"Karachaj-Cherkessija\",'id_country' => 181),\n array('name' => \"Karelija\",'id_country' => 181),\n array('name' => \"Kemerovo\",'id_country' => 181),\n array('name' => \"Khabarovskiy Kray\",'id_country' => 181),\n array('name' => \"Kirov\",'id_country' => 181),\n array('name' => \"Komi\",'id_country' => 181),\n array('name' => \"Komi-Permjakija\",'id_country' => 181),\n array('name' => \"Korjakija\",'id_country' => 181),\n array('name' => \"Kostroma\",'id_country' => 181),\n array('name' => \"Krasnodar\",'id_country' => 181),\n array('name' => \"Krasnojarsk\",'id_country' => 181),\n array('name' => \"Krasnoyarskiy Kray\",'id_country' => 181),\n array('name' => \"Kurgan\",'id_country' => 181),\n array('name' => \"Kursk\",'id_country' => 181),\n array('name' => \"Leningrad\",'id_country' => 181),\n array('name' => \"Lipeck\",'id_country' => 181),\n array('name' => \"Magadan\",'id_country' => 181),\n array('name' => \"Marij El\",'id_country' => 181),\n array('name' => \"Mordovija\",'id_country' => 181),\n array('name' => \"Moscow\",'id_country' => 181),\n array('name' => \"Moskovskaja Oblast\",'id_country' => 181),\n array('name' => \"Moskovskaya Oblast\",'id_country' => 181),\n array('name' => \"Moskva\",'id_country' => 181),\n array('name' => \"Murmansk\",'id_country' => 181),\n array('name' => \"Nenets\",'id_country' => 181),\n array('name' => \"Nizhnij Novgorod\",'id_country' => 181),\n array('name' => \"Novgorod\",'id_country' => 181),\n array('name' => \"Novokusnezk\",'id_country' => 181),\n array('name' => \"Novosibirsk\",'id_country' => 181),\n array('name' => \"Omsk\",'id_country' => 181),\n array('name' => \"Orenburg\",'id_country' => 181),\n array('name' => \"Orjol\",'id_country' => 181),\n array('name' => \"Penza\",'id_country' => 181),\n array('name' => \"Perm\",'id_country' => 181),\n array('name' => \"Primorje\",'id_country' => 181),\n array('name' => \"Pskov\",'id_country' => 181),\n array('name' => \"Pskovskaya Oblast\",'id_country' => 181),\n array('name' => \"Rjazan\",'id_country' => 181),\n array('name' => \"Rostov\",'id_country' => 181),\n array('name' => \"Saha\",'id_country' => 181),\n array('name' => \"Sahalin\",'id_country' => 181),\n array('name' => \"Samara\",'id_country' => 181),\n array('name' => \"Samarskaya\",'id_country' => 181),\n array('name' => \"Sankt-Peterburg\",'id_country' => 181),\n array('name' => \"Saratov\",'id_country' => 181),\n array('name' => \"Smolensk\",'id_country' => 181),\n array('name' => \"Stavropol\",'id_country' => 181),\n array('name' => \"Sverdlovsk\",'id_country' => 181),\n array('name' => \"Tajmyrija\",'id_country' => 181),\n array('name' => \"Tambov\",'id_country' => 181),\n array('name' => \"Tatarstan\",'id_country' => 181),\n array('name' => \"Tjumen\",'id_country' => 181),\n array('name' => \"Tomsk\",'id_country' => 181),\n array('name' => \"Tula\",'id_country' => 181),\n array('name' => \"Tver\",'id_country' => 181),\n array('name' => \"Tyva\",'id_country' => 181),\n array('name' => \"Udmurtija\",'id_country' => 181),\n array('name' => \"Uljanovsk\",'id_country' => 181),\n array('name' => \"Ulyanovskaya Oblast\",'id_country' => 181),\n array('name' => \"Ust-Orda\",'id_country' => 181),\n array('name' => \"Vladimir\",'id_country' => 181),\n array('name' => \"Volgograd\",'id_country' => 181),\n array('name' => \"Vologda\",'id_country' => 181),\n array('name' => \"Voronezh\",'id_country' => 181),\n array('name' => \"Butare\",'id_country' => 182),\n array('name' => \"Byumba\",'id_country' => 182),\n array('name' => \"Cyangugu\",'id_country' => 182),\n array('name' => \"Gikongoro\",'id_country' => 182),\n array('name' => \"Gisenyi\",'id_country' => 182),\n array('name' => \"Gitarama\",'id_country' => 182),\n array('name' => \"Kibungo\",'id_country' => 182),\n array('name' => \"Kibuye\",'id_country' => 182),\n array('name' => \"Kigali-ngali\",'id_country' => 182),\n array('name' => \"Ruhengeri\",'id_country' => 182),\n array('name' => \"Ascension\",'id_country' => 183),\n array('name' => \"Gough Island\",'id_country' => 183),\n array('name' => \"Saint Helena\",'id_country' => 183),\n array('name' => \"Tristan da Cunha\",'id_country' => 183),\n array('name' => \"Christ Church Nichola Town\",'id_country' => 184),\n array('name' => \"Saint Anne Sandy Point\",'id_country' => 184),\n array('name' => \"Saint George Basseterre\",'id_country' => 184),\n array('name' => \"Saint George Gingerland\",'id_country' => 184),\n array('name' => \"Saint James Windward\",'id_country' => 184),\n array('name' => \"Saint John Capesterre\",'id_country' => 184),\n array('name' => \"Saint John Figtree\",'id_country' => 184),\n array('name' => \"Saint Mary Cayon\",'id_country' => 184),\n array('name' => \"Saint Paul Capesterre\",'id_country' => 184),\n array('name' => \"Saint Paul Charlestown\",'id_country' => 184),\n array('name' => \"Saint Peter Basseterre\",'id_country' => 184),\n array('name' => \"Saint Thomas Lowland\",'id_country' => 184),\n array('name' => \"Saint Thomas Middle Island\",'id_country' => 184),\n array('name' => \"Trinity Palmetto Point\",'id_country' => 184),\n array('name' => \"Anse-la-Raye\",'id_country' => 185),\n array('name' => \"Canaries\",'id_country' => 185),\n array('name' => \"Castries\",'id_country' => 185),\n array('name' => \"Choiseul\",'id_country' => 185),\n array('name' => \"Dennery\",'id_country' => 185),\n array('name' => \"Gros Inlet\",'id_country' => 185),\n array('name' => \"Laborie\",'id_country' => 185),\n array('name' => \"Micoud\",'id_country' => 185),\n array('name' => \"Soufriere\",'id_country' => 185),\n array('name' => \"Vieux Fort\",'id_country' => 185),\n array('name' => \"Miquelon-Langlade\",'id_country' => 186),\n array('name' => \"Saint-Pierre\",'id_country' => 186),\n array('name' => \"Charlotte\",'id_country' => 187),\n array('name' => \"Grenadines\",'id_country' => 187),\n array('name' => \"Saint Andrew\",'id_country' => 187),\n array('name' => \"Saint David\",'id_country' => 187),\n array('name' => \"Saint George\",'id_country' => 187),\n array('name' => \"Saint Patrick\",'id_country' => 187),\n array('name' => \"A'ana\",'id_country' => 188),\n array('name' => \"Aiga-i-le-Tai\",'id_country' => 188),\n array('name' => \"Atua\",'id_country' => 188),\n array('name' => \"Fa'asaleleaga\",'id_country' => 188),\n array('name' => \"Gaga'emauga\",'id_country' => 188),\n array('name' => \"Gagaifomauga\",'id_country' => 188),\n array('name' => \"Palauli\",'id_country' => 188),\n array('name' => \"Satupa'itea\",'id_country' => 188),\n array('name' => \"Tuamasaga\",'id_country' => 188),\n array('name' => \"Va'a-o-Fonoti\",'id_country' => 188),\n array('name' => \"Vaisigano\",'id_country' => 188),\n array('name' => \"Acquaviva\",'id_country' => 189),\n array('name' => \"Borgo Maggiore\",'id_country' => 189),\n array('name' => \"Chiesanuova\",'id_country' => 189),\n array('name' => \"Domagnano\",'id_country' => 189),\n array('name' => \"Faetano\",'id_country' => 189),\n array('name' => \"Fiorentino\",'id_country' => 189),\n array('name' => \"Montegiardino\",'id_country' => 189),\n array('name' => \"San Marino\",'id_country' => 189),\n array('name' => \"Serravalle\",'id_country' => 189),\n array('name' => \"Agua Grande\",'id_country' => 190),\n array('name' => \"Cantagalo\",'id_country' => 190),\n array('name' => \"Lemba\",'id_country' => 190),\n array('name' => \"Lobata\",'id_country' => 190),\n array('name' => \"Me-Zochi\",'id_country' => 190),\n array('name' => \"Pague\",'id_country' => 190),\n array('name' => \"Al Khobar\",'id_country' => 191),\n array('name' => \"Aseer\",'id_country' => 191),\n array('name' => \"Ash Sharqiyah\",'id_country' => 191),\n array('name' => \"Asir\",'id_country' => 191),\n array('name' => \"Central Province\",'id_country' => 191),\n array('name' => \"Eastern Province\",'id_country' => 191),\n array('name' => \"Ha'il\",'id_country' => 191),\n array('name' => \"Jawf\",'id_country' => 191),\n array('name' => \"Jizan\",'id_country' => 191),\n array('name' => \"Makkah\",'id_country' => 191),\n array('name' => \"Najran\",'id_country' => 191),\n array('name' => \"Qasim\",'id_country' => 191),\n array('name' => \"Tabuk\",'id_country' => 191),\n array('name' => \"Western Province\",'id_country' => 191),\n array('name' => \"al-Bahah\",'id_country' => 191),\n array('name' => \"al-Hudud-ash-Shamaliyah\",'id_country' => 191),\n array('name' => \"al-Madinah\",'id_country' => 191),\n array('name' => \"ar-Riyad\",'id_country' => 191),\n array('name' => \"Dakar\",'id_country' => 192),\n array('name' => \"Diourbel\",'id_country' => 192),\n array('name' => \"Fatick\",'id_country' => 192),\n array('name' => \"Kaolack\",'id_country' => 192),\n array('name' => \"Kolda\",'id_country' => 192),\n array('name' => \"Louga\",'id_country' => 192),\n array('name' => \"Saint-Louis\",'id_country' => 192),\n array('name' => \"Tambacounda\",'id_country' => 192),\n array('name' => \"Thies\",'id_country' => 192),\n array('name' => \"Ziguinchor\",'id_country' => 192),\n array('name' => \"Central Serbia\",'id_country' => 193),\n array('name' => \"Kosovo and Metohija\",'id_country' => 193),\n array('name' => \"Vojvodina\",'id_country' => 193),\n array('name' => \"Anse Boileau\",'id_country' => 194),\n array('name' => \"Anse Royale\",'id_country' => 194),\n array('name' => \"Cascade\",'id_country' => 194),\n array('name' => \"Takamaka\",'id_country' => 194),\n array('name' => \"Victoria\",'id_country' => 194),\n array('name' => \"Eastern\",'id_country' => 195),\n array('name' => \"Northern\",'id_country' => 195),\n array('name' => \"Southern\",'id_country' => 195),\n array('name' => \"Western\",'id_country' => 195),\n array('name' => \"Singapore\",'id_country' => 196),\n array('name' => \"Banskobystricky\",'id_country' => 197),\n array('name' => \"Bratislavsky\",'id_country' => 197),\n array('name' => \"Kosicky\",'id_country' => 197),\n array('name' => \"Nitriansky\",'id_country' => 197),\n array('name' => \"Presovsky\",'id_country' => 197),\n array('name' => \"Trenciansky\",'id_country' => 197),\n array('name' => \"Trnavsky\",'id_country' => 197),\n array('name' => \"Zilinsky\",'id_country' => 197),\n array('name' => \"Benedikt\",'id_country' => 198),\n array('name' => \"Gorenjska\",'id_country' => 198),\n array('name' => \"Gorishka\",'id_country' => 198),\n array('name' => \"Jugovzhodna Slovenija\",'id_country' => 198),\n array('name' => \"Koroshka\",'id_country' => 198),\n array('name' => \"Notranjsko-krashka\",'id_country' => 198),\n array('name' => \"Obalno-krashka\",'id_country' => 198),\n array('name' => \"Obcina Domzale\",'id_country' => 198),\n array('name' => \"Obcina Vitanje\",'id_country' => 198),\n array('name' => \"Osrednjeslovenska\",'id_country' => 198),\n array('name' => \"Podravska\",'id_country' => 198),\n array('name' => \"Pomurska\",'id_country' => 198),\n array('name' => \"Savinjska\",'id_country' => 198),\n array('name' => \"Slovenian Littoral\",'id_country' => 198),\n array('name' => \"Spodnjeposavska\",'id_country' => 198),\n array('name' => \"Zasavska\",'id_country' => 198),\n array('name' => \"Pitcairn\",'id_country' => 199),\n array('name' => \"Central\",'id_country' => 200),\n array('name' => \"Choiseul\",'id_country' => 200),\n array('name' => \"Guadalcanal\",'id_country' => 200),\n array('name' => \"Isabel\",'id_country' => 200),\n array('name' => \"Makira and Ulawa\",'id_country' => 200),\n array('name' => \"Malaita\",'id_country' => 200),\n array('name' => \"Rennell and Bellona\",'id_country' => 200),\n array('name' => \"Temotu\",'id_country' => 200),\n array('name' => \"Western\",'id_country' => 200),\n array('name' => \"Awdal\",'id_country' => 201),\n array('name' => \"Bakol\",'id_country' => 201),\n array('name' => \"Banadir\",'id_country' => 201),\n array('name' => \"Bari\",'id_country' => 201),\n array('name' => \"Bay\",'id_country' => 201),\n array('name' => \"Galgudug\",'id_country' => 201),\n array('name' => \"Gedo\",'id_country' => 201),\n array('name' => \"Hiran\",'id_country' => 201),\n array('name' => \"Jubbada Hose\",'id_country' => 201),\n array('name' => \"Jubbadha Dexe\",'id_country' => 201),\n array('name' => \"Mudug\",'id_country' => 201),\n array('name' => \"Nugal\",'id_country' => 201),\n array('name' => \"Sanag\",'id_country' => 201),\n array('name' => \"Shabellaha Dhexe\",'id_country' => 201),\n array('name' => \"Shabellaha Hose\",'id_country' => 201),\n array('name' => \"Togdher\",'id_country' => 201),\n array('name' => \"Woqoyi Galbed\",'id_country' => 201),\n array('name' => \"Eastern Cape\",'id_country' => 202),\n array('name' => \"Free State\",'id_country' => 202),\n array('name' => \"Gauteng\",'id_country' => 202),\n array('name' => \"Kempton Park\",'id_country' => 202),\n array('name' => \"Kramerville\",'id_country' => 202),\n array('name' => \"KwaZulu Natal\",'id_country' => 202),\n array('name' => \"Limpopo\",'id_country' => 202),\n array('name' => \"Mpumalanga\",'id_country' => 202),\n array('name' => \"North West\",'id_country' => 202),\n array('name' => \"Northern Cape\",'id_country' => 202),\n array('name' => \"Parow\",'id_country' => 202),\n array('name' => \"Table View\",'id_country' => 202),\n array('name' => \"Umtentweni\",'id_country' => 202),\n array('name' => \"Western Cape\",'id_country' => 202),\n array('name' => \"South Georgia\",'id_country' => 203),\n array('name' => \"Central Equatoria\",'id_country' => 204),\n array('name' => \"A Coruna\",'id_country' => 205),\n array('name' => \"Alacant\",'id_country' => 205),\n array('name' => \"Alava\",'id_country' => 205),\n array('name' => \"Albacete\",'id_country' => 205),\n array('name' => \"Almeria\",'id_country' => 205),\n array('name' => \"Andalucia\",'id_country' => 205),\n array('name' => \"Asturias\",'id_country' => 205),\n array('name' => \"Avila\",'id_country' => 205),\n array('name' => \"Badajoz\",'id_country' => 205),\n array('name' => \"Balears\",'id_country' => 205),\n array('name' => \"Barcelona\",'id_country' => 205),\n array('name' => \"Bertamirans\",'id_country' => 205),\n array('name' => \"Biscay\",'id_country' => 205),\n array('name' => \"Burgos\",'id_country' => 205),\n array('name' => \"Caceres\",'id_country' => 205),\n array('name' => \"Cadiz\",'id_country' => 205),\n array('name' => \"Cantabria\",'id_country' => 205),\n array('name' => \"Castello\",'id_country' => 205),\n array('name' => \"Catalunya\",'id_country' => 205),\n array('name' => \"Ceuta\",'id_country' => 205),\n array('name' => \"Ciudad Real\",'id_country' => 205),\n array('name' => \"Comunidad Autonoma de Canarias\",'id_country' => 205),\n array('name' => \"Comunidad Autonoma de Cataluna\",'id_country' => 205),\n array('name' => \"Comunidad Autonoma de Galicia\",'id_country' => 205),\n array('name' => \"Comunidad Autonoma de las Isla\",'id_country' => 205),\n array('name' => \"Comunidad Autonoma del Princip\",'id_country' => 205),\n array('name' => \"Comunidad Valenciana\",'id_country' => 205),\n array('name' => \"Cordoba\",'id_country' => 205),\n array('name' => \"Cuenca\",'id_country' => 205),\n array('name' => \"Gipuzkoa\",'id_country' => 205),\n array('name' => \"Girona\",'id_country' => 205),\n array('name' => \"Granada\",'id_country' => 205),\n array('name' => \"Guadalajara\",'id_country' => 205),\n array('name' => \"Guipuzcoa\",'id_country' => 205),\n array('name' => \"Huelva\",'id_country' => 205),\n array('name' => \"Huesca\",'id_country' => 205),\n array('name' => \"Jaen\",'id_country' => 205),\n array('name' => \"La Rioja\",'id_country' => 205),\n array('name' => \"Las Palmas\",'id_country' => 205),\n array('name' => \"Leon\",'id_country' => 205),\n array('name' => \"Lerida\",'id_country' => 205),\n array('name' => \"Lleida\",'id_country' => 205),\n array('name' => \"Lugo\",'id_country' => 205),\n array('name' => \"Madrid\",'id_country' => 205),\n array('name' => \"Malaga\",'id_country' => 205),\n array('name' => \"Melilla\",'id_country' => 205),\n array('name' => \"Murcia\",'id_country' => 205),\n array('name' => \"Navarra\",'id_country' => 205),\n array('name' => \"Ourense\",'id_country' => 205),\n array('name' => \"Pais Vasco\",'id_country' => 205),\n array('name' => \"Palencia\",'id_country' => 205),\n array('name' => \"Pontevedra\",'id_country' => 205),\n array('name' => \"Salamanca\",'id_country' => 205),\n array('name' => \"Santa Cruz de Tenerife\",'id_country' => 205),\n array('name' => \"Segovia\",'id_country' => 205),\n array('name' => \"Sevilla\",'id_country' => 205),\n array('name' => \"Soria\",'id_country' => 205),\n array('name' => \"Tarragona\",'id_country' => 205),\n array('name' => \"Tenerife\",'id_country' => 205),\n array('name' => \"Teruel\",'id_country' => 205),\n array('name' => \"Toledo\",'id_country' => 205),\n array('name' => \"Valencia\",'id_country' => 205),\n array('name' => \"Valladolid\",'id_country' => 205),\n array('name' => \"Vizcaya\",'id_country' => 205),\n array('name' => \"Zamora\",'id_country' => 205),\n array('name' => \"Zaragoza\",'id_country' => 205),\n array('name' => \"Amparai\",'id_country' => 206),\n array('name' => \"Anuradhapuraya\",'id_country' => 206),\n array('name' => \"Badulla\",'id_country' => 206),\n array('name' => \"Boralesgamuwa\",'id_country' => 206),\n array('name' => \"Colombo\",'id_country' => 206),\n array('name' => \"Galla\",'id_country' => 206),\n array('name' => \"Gampaha\",'id_country' => 206),\n array('name' => \"Hambantota\",'id_country' => 206),\n array('name' => \"Kalatura\",'id_country' => 206),\n array('name' => \"Kegalla\",'id_country' => 206),\n array('name' => \"Kilinochchi\",'id_country' => 206),\n array('name' => \"Kurunegala\",'id_country' => 206),\n array('name' => \"Madakalpuwa\",'id_country' => 206),\n array('name' => \"Maha Nuwara\",'id_country' => 206),\n array('name' => \"Malwana\",'id_country' => 206),\n array('name' => \"Mannarama\",'id_country' => 206),\n array('name' => \"Matale\",'id_country' => 206),\n array('name' => \"Matara\",'id_country' => 206),\n array('name' => \"Monaragala\",'id_country' => 206),\n array('name' => \"Mullaitivu\",'id_country' => 206),\n array('name' => \"North Eastern Province\",'id_country' => 206),\n array('name' => \"North Western Province\",'id_country' => 206),\n array('name' => \"Nuwara Eliya\",'id_country' => 206),\n array('name' => \"Polonnaruwa\",'id_country' => 206),\n array('name' => \"Puttalama\",'id_country' => 206),\n array('name' => \"Ratnapuraya\",'id_country' => 206),\n array('name' => \"Southern Province\",'id_country' => 206),\n array('name' => \"Tirikunamalaya\",'id_country' => 206),\n array('name' => \"Tuscany\",'id_country' => 206),\n array('name' => \"Vavuniyawa\",'id_country' => 206),\n array('name' => \"Western Province\",'id_country' => 206),\n array('name' => \"Yapanaya\",'id_country' => 206),\n array('name' => \"kadawatha\",'id_country' => 206),\n array('name' => \"A'ali-an-Nil\",'id_country' => 207),\n array('name' => \"Bahr-al-Jabal\",'id_country' => 207),\n array('name' => \"Central Equatoria\",'id_country' => 207),\n array('name' => \"Gharb Bahr-al-Ghazal\",'id_country' => 207),\n array('name' => \"Gharb Darfur\",'id_country' => 207),\n array('name' => \"Gharb Kurdufan\",'id_country' => 207),\n array('name' => \"Gharb-al-Istiwa'iyah\",'id_country' => 207),\n array('name' => \"Janub Darfur\",'id_country' => 207),\n array('name' => \"Janub Kurdufan\",'id_country' => 207),\n array('name' => \"Junqali\",'id_country' => 207),\n array('name' => \"Kassala\",'id_country' => 207),\n array('name' => \"Nahr-an-Nil\",'id_country' => 207),\n array('name' => \"Shamal Bahr-al-Ghazal\",'id_country' => 207),\n array('name' => \"Shamal Darfur\",'id_country' => 207),\n array('name' => \"Shamal Kurdufan\",'id_country' => 207),\n array('name' => \"Sharq-al-Istiwa'iyah\",'id_country' => 207),\n array('name' => \"Sinnar\",'id_country' => 207),\n array('name' => \"Warab\",'id_country' => 207),\n array('name' => \"Wilayat al Khartum\",'id_country' => 207),\n array('name' => \"al-Bahr-al-Ahmar\",'id_country' => 207),\n array('name' => \"al-Buhayrat\",'id_country' => 207),\n array('name' => \"al-Jazirah\",'id_country' => 207),\n array('name' => \"al-Khartum\",'id_country' => 207),\n array('name' => \"al-Qadarif\",'id_country' => 207),\n array('name' => \"al-Wahdah\",'id_country' => 207),\n array('name' => \"an-Nil-al-Abyad\",'id_country' => 207),\n array('name' => \"an-Nil-al-Azraq\",'id_country' => 207),\n array('name' => \"ash-Shamaliyah\",'id_country' => 207),\n array('name' => \"Brokopondo\",'id_country' => 208),\n array('name' => \"Commewijne\",'id_country' => 208),\n array('name' => \"Coronie\",'id_country' => 208),\n array('name' => \"Marowijne\",'id_country' => 208),\n array('name' => \"Nickerie\",'id_country' => 208),\n array('name' => \"Para\",'id_country' => 208),\n array('name' => \"Paramaribo\",'id_country' => 208),\n array('name' => \"Saramacca\",'id_country' => 208),\n array('name' => \"Wanica\",'id_country' => 208),\n array('name' => \"Svalbard\",'id_country' => 209),\n array('name' => \"Hhohho\",'id_country' => 210),\n array('name' => \"Lubombo\",'id_country' => 210),\n array('name' => \"Manzini\",'id_country' => 210),\n array('name' => \"Shiselweni\",'id_country' => 210),\n array('name' => \"Alvsborgs Lan\",'id_country' => 211),\n array('name' => \"Angermanland\",'id_country' => 211),\n array('name' => \"Blekinge\",'id_country' => 211),\n array('name' => \"Bohuslan\",'id_country' => 211),\n array('name' => \"Dalarna\",'id_country' => 211),\n array('name' => \"Gavleborg\",'id_country' => 211),\n array('name' => \"Gaza\",'id_country' => 211),\n array('name' => \"Gotland\",'id_country' => 211),\n array('name' => \"Halland\",'id_country' => 211),\n array('name' => \"Jamtland\",'id_country' => 211),\n array('name' => \"Jonkoping\",'id_country' => 211),\n array('name' => \"Kalmar\",'id_country' => 211),\n array('name' => \"Kristianstads\",'id_country' => 211),\n array('name' => \"Kronoberg\",'id_country' => 211),\n array('name' => \"Norrbotten\",'id_country' => 211),\n array('name' => \"Orebro\",'id_country' => 211),\n array('name' => \"Ostergotland\",'id_country' => 211),\n array('name' => \"Saltsjo-Boo\",'id_country' => 211),\n array('name' => \"Skane\",'id_country' => 211),\n array('name' => \"Smaland\",'id_country' => 211),\n array('name' => \"Sodermanland\",'id_country' => 211),\n array('name' => \"Stockholm\",'id_country' => 211),\n array('name' => \"Uppsala\",'id_country' => 211),\n array('name' => \"Varmland\",'id_country' => 211),\n array('name' => \"Vasterbotten\",'id_country' => 211),\n array('name' => \"Vastergotland\",'id_country' => 211),\n array('name' => \"Vasternorrland\",'id_country' => 211),\n array('name' => \"Vastmanland\",'id_country' => 211),\n array('name' => \"Vastra Gotaland\",'id_country' => 211),\n array('name' => \"Aargau\",'id_country' => 212),\n array('name' => \"Appenzell Inner-Rhoden\",'id_country' => 212),\n array('name' => \"Appenzell-Ausser Rhoden\",'id_country' => 212),\n array('name' => \"Basel-Landschaft\",'id_country' => 212),\n array('name' => \"Basel-Stadt\",'id_country' => 212),\n array('name' => \"Bern\",'id_country' => 212),\n array('name' => \"Canton Ticino\",'id_country' => 212),\n array('name' => \"Fribourg\",'id_country' => 212),\n array('name' => \"Geneve\",'id_country' => 212),\n array('name' => \"Glarus\",'id_country' => 212),\n array('name' => \"Graubunden\",'id_country' => 212),\n array('name' => \"Heerbrugg\",'id_country' => 212),\n array('name' => \"Jura\",'id_country' => 212),\n array('name' => \"Kanton Aargau\",'id_country' => 212),\n array('name' => \"Luzern\",'id_country' => 212),\n array('name' => \"Morbio Inferiore\",'id_country' => 212),\n array('name' => \"Muhen\",'id_country' => 212),\n array('name' => \"Neuchatel\",'id_country' => 212),\n array('name' => \"Nidwalden\",'id_country' => 212),\n array('name' => \"Obwalden\",'id_country' => 212),\n array('name' => \"Sankt Gallen\",'id_country' => 212),\n array('name' => \"Schaffhausen\",'id_country' => 212),\n array('name' => \"Schwyz\",'id_country' => 212),\n array('name' => \"Solothurn\",'id_country' => 212),\n array('name' => \"Thurgau\",'id_country' => 212),\n array('name' => \"Ticino\",'id_country' => 212),\n array('name' => \"Uri\",'id_country' => 212),\n array('name' => \"Valais\",'id_country' => 212),\n array('name' => \"Vaud\",'id_country' => 212),\n array('name' => \"Vauffelin\",'id_country' => 212),\n array('name' => \"Zug\",'id_country' => 212),\n array('name' => \"Zurich\",'id_country' => 212),\n array('name' => \"Aleppo\",'id_country' => 213),\n array('name' => \"Dar'a\",'id_country' => 213),\n array('name' => \"Dayr-az-Zawr\",'id_country' => 213),\n array('name' => \"Dimashq\",'id_country' => 213),\n array('name' => \"Halab\",'id_country' => 213),\n array('name' => \"Hamah\",'id_country' => 213),\n array('name' => \"Hims\",'id_country' => 213),\n array('name' => \"Idlib\",'id_country' => 213),\n array('name' => \"Madinat Dimashq\",'id_country' => 213),\n array('name' => \"Tartus\",'id_country' => 213),\n array('name' => \"al-Hasakah\",'id_country' => 213),\n array('name' => \"al-Ladhiqiyah\",'id_country' => 213),\n array('name' => \"al-Qunaytirah\",'id_country' => 213),\n array('name' => \"ar-Raqqah\",'id_country' => 213),\n array('name' => \"as-Suwayda\",'id_country' => 213),\n array('name' => \"Changhwa\",'id_country' => 214),\n array('name' => \"Chiayi Hsien\",'id_country' => 214),\n array('name' => \"Chiayi Shih\",'id_country' => 214),\n array('name' => \"Eastern Taipei\",'id_country' => 214),\n array('name' => \"Hsinchu Hsien\",'id_country' => 214),\n array('name' => \"Hsinchu Shih\",'id_country' => 214),\n array('name' => \"Hualien\",'id_country' => 214),\n array('name' => \"Ilan\",'id_country' => 214),\n array('name' => \"Kaohsiung Hsien\",'id_country' => 214),\n array('name' => \"Kaohsiung Shih\",'id_country' => 214),\n array('name' => \"Keelung Shih\",'id_country' => 214),\n array('name' => \"Kinmen\",'id_country' => 214),\n array('name' => \"Miaoli\",'id_country' => 214),\n array('name' => \"Nantou\",'id_country' => 214),\n array('name' => \"Northern Taiwan\",'id_country' => 214),\n array('name' => \"Penghu\",'id_country' => 214),\n array('name' => \"Pingtung\",'id_country' => 214),\n array('name' => \"Taichung\",'id_country' => 214),\n array('name' => \"Taichung Hsien\",'id_country' => 214),\n array('name' => \"Taichung Shih\",'id_country' => 214),\n array('name' => \"Tainan Hsien\",'id_country' => 214),\n array('name' => \"Tainan Shih\",'id_country' => 214),\n array('name' => \"Taipei Hsien\",'id_country' => 214),\n array('name' => \"Taipei Shih / Taipei Hsien\",'id_country' => 214),\n array('name' => \"Taitung\",'id_country' => 214),\n array('name' => \"Taoyuan\",'id_country' => 214),\n array('name' => \"Yilan\",'id_country' => 214),\n array('name' => \"Yun-Lin Hsien\",'id_country' => 214),\n array('name' => \"Yunlin\",'id_country' => 214),\n array('name' => \"Dushanbe\",'id_country' => 215),\n array('name' => \"Gorno-Badakhshan\",'id_country' => 215),\n array('name' => \"Karotegin\",'id_country' => 215),\n array('name' => \"Khatlon\",'id_country' => 215),\n array('name' => \"Sughd\",'id_country' => 215),\n array('name' => \"Arusha\",'id_country' => 216),\n array('name' => \"Dar es Salaam\",'id_country' => 216),\n array('name' => \"Dodoma\",'id_country' => 216),\n array('name' => \"Iringa\",'id_country' => 216),\n array('name' => \"Kagera\",'id_country' => 216),\n array('name' => \"Kigoma\",'id_country' => 216),\n array('name' => \"Kilimanjaro\",'id_country' => 216),\n array('name' => \"Lindi\",'id_country' => 216),\n array('name' => \"Mara\",'id_country' => 216),\n array('name' => \"Mbeya\",'id_country' => 216),\n array('name' => \"Morogoro\",'id_country' => 216),\n array('name' => \"Mtwara\",'id_country' => 216),\n array('name' => \"Mwanza\",'id_country' => 216),\n array('name' => \"Pwani\",'id_country' => 216),\n array('name' => \"Rukwa\",'id_country' => 216),\n array('name' => \"Ruvuma\",'id_country' => 216),\n array('name' => \"Shinyanga\",'id_country' => 216),\n array('name' => \"Singida\",'id_country' => 216),\n array('name' => \"Tabora\",'id_country' => 216),\n array('name' => \"Tanga\",'id_country' => 216),\n array('name' => \"Zanzibar and Pemba\",'id_country' => 216),\n array('name' => \"Amnat Charoen\",'id_country' => 217),\n array('name' => \"Ang Thong\",'id_country' => 217),\n array('name' => \"Bangkok\",'id_country' => 217),\n array('name' => \"Buri Ram\",'id_country' => 217),\n array('name' => \"Chachoengsao\",'id_country' => 217),\n array('name' => \"Chai Nat\",'id_country' => 217),\n array('name' => \"Chaiyaphum\",'id_country' => 217),\n array('name' => \"Changwat Chaiyaphum\",'id_country' => 217),\n array('name' => \"Chanthaburi\",'id_country' => 217),\n array('name' => \"Chiang Mai\",'id_country' => 217),\n array('name' => \"Chiang Rai\",'id_country' => 217),\n array('name' => \"Chon Buri\",'id_country' => 217),\n array('name' => \"Chumphon\",'id_country' => 217),\n array('name' => \"Kalasin\",'id_country' => 217),\n array('name' => \"Kamphaeng Phet\",'id_country' => 217),\n array('name' => \"Kanchanaburi\",'id_country' => 217),\n array('name' => \"Khon Kaen\",'id_country' => 217),\n array('name' => \"Krabi\",'id_country' => 217),\n array('name' => \"Krung Thep\",'id_country' => 217),\n array('name' => \"Lampang\",'id_country' => 217),\n array('name' => \"Lamphun\",'id_country' => 217),\n array('name' => \"Loei\",'id_country' => 217),\n array('name' => \"Lop Buri\",'id_country' => 217),\n array('name' => \"Mae Hong Son\",'id_country' => 217),\n array('name' => \"Maha Sarakham\",'id_country' => 217),\n array('name' => \"Mukdahan\",'id_country' => 217),\n array('name' => \"Nakhon Nayok\",'id_country' => 217),\n array('name' => \"Nakhon Pathom\",'id_country' => 217),\n array('name' => \"Nakhon Phanom\",'id_country' => 217),\n array('name' => \"Nakhon Ratchasima\",'id_country' => 217),\n array('name' => \"Nakhon Sawan\",'id_country' => 217),\n array('name' => \"Nakhon Si Thammarat\",'id_country' => 217),\n array('name' => \"Nan\",'id_country' => 217),\n array('name' => \"Narathiwat\",'id_country' => 217),\n array('name' => \"Nong Bua Lam Phu\",'id_country' => 217),\n array('name' => \"Nong Khai\",'id_country' => 217),\n array('name' => \"Nonthaburi\",'id_country' => 217),\n array('name' => \"Pathum Thani\",'id_country' => 217),\n array('name' => \"Pattani\",'id_country' => 217),\n array('name' => \"Phangnga\",'id_country' => 217),\n array('name' => \"Phatthalung\",'id_country' => 217),\n array('name' => \"Phayao\",'id_country' => 217),\n array('name' => \"Phetchabun\",'id_country' => 217),\n array('name' => \"Phetchaburi\",'id_country' => 217),\n array('name' => \"Phichit\",'id_country' => 217),\n array('name' => \"Phitsanulok\",'id_country' => 217),\n array('name' => \"Phra Nakhon Si Ayutthaya\",'id_country' => 217),\n array('name' => \"Phrae\",'id_country' => 217),\n array('name' => \"Phuket\",'id_country' => 217),\n array('name' => \"Prachin Buri\",'id_country' => 217),\n array('name' => \"Prachuap Khiri Khan\",'id_country' => 217),\n array('name' => \"Ranong\",'id_country' => 217),\n array('name' => \"Ratchaburi\",'id_country' => 217),\n array('name' => \"Rayong\",'id_country' => 217),\n array('name' => \"Roi Et\",'id_country' => 217),\n array('name' => \"Sa Kaeo\",'id_country' => 217),\n array('name' => \"Sakon Nakhon\",'id_country' => 217),\n array('name' => \"Samut Prakan\",'id_country' => 217),\n array('name' => \"Samut Sakhon\",'id_country' => 217),\n array('name' => \"Samut Songkhran\",'id_country' => 217),\n array('name' => \"Saraburi\",'id_country' => 217),\n array('name' => \"Satun\",'id_country' => 217),\n array('name' => \"Si Sa Ket\",'id_country' => 217),\n array('name' => \"Sing Buri\",'id_country' => 217),\n array('name' => \"Songkhla\",'id_country' => 217),\n array('name' => \"Sukhothai\",'id_country' => 217),\n array('name' => \"Suphan Buri\",'id_country' => 217),\n array('name' => \"Surat Thani\",'id_country' => 217),\n array('name' => \"Surin\",'id_country' => 217),\n array('name' => \"Tak\",'id_country' => 217),\n array('name' => \"Trang\",'id_country' => 217),\n array('name' => \"Trat\",'id_country' => 217),\n array('name' => \"Ubon Ratchathani\",'id_country' => 217),\n array('name' => \"Udon Thani\",'id_country' => 217),\n array('name' => \"Uthai Thani\",'id_country' => 217),\n array('name' => \"Uttaradit\",'id_country' => 217),\n array('name' => \"Yala\",'id_country' => 217),\n array('name' => \"Yasothon\",'id_country' => 217),\n array('name' => \"Centre\",'id_country' => 218),\n array('name' => \"Kara\",'id_country' => 218),\n array('name' => \"Maritime\",'id_country' => 218),\n array('name' => \"Plateaux\",'id_country' => 218),\n array('name' => \"Savanes\",'id_country' => 218),\n array('name' => \"Atafu\",'id_country' => 219),\n array('name' => \"Fakaofo\",'id_country' => 219),\n array('name' => \"Nukunonu\",'id_country' => 219),\n array('name' => \"Eua\",'id_country' => 220),\n array('name' => \"Ha'apai\",'id_country' => 220),\n array('name' => \"Niuas\",'id_country' => 220),\n array('name' => \"Tongatapu\",'id_country' => 220),\n array('name' => \"Vava'u\",'id_country' => 220),\n array('name' => \"Arima-Tunapuna-Piarco\",'id_country' => 221),\n array('name' => \"Caroni\",'id_country' => 221),\n array('name' => \"Chaguanas\",'id_country' => 221),\n array('name' => \"Couva-Tabaquite-Talparo\",'id_country' => 221),\n array('name' => \"Diego Martin\",'id_country' => 221),\n array('name' => \"Glencoe\",'id_country' => 221),\n array('name' => \"Penal Debe\",'id_country' => 221),\n array('name' => \"Point Fortin\",'id_country' => 221),\n array('name' => \"Port of Spain\",'id_country' => 221),\n array('name' => \"Princes Town\",'id_country' => 221),\n array('name' => \"Saint George\",'id_country' => 221),\n array('name' => \"San Fernando\",'id_country' => 221),\n array('name' => \"San Juan\",'id_country' => 221),\n array('name' => \"Sangre Grande\",'id_country' => 221),\n array('name' => \"Siparia\",'id_country' => 221),\n array('name' => \"Tobago\",'id_country' => 221),\n array('name' => \"Aryanah\",'id_country' => 222),\n array('name' => \"Bajah\",'id_country' => 222),\n array('name' => \"Bin 'Arus\",'id_country' => 222),\n array('name' => \"Binzart\",'id_country' => 222),\n array('name' => \"Gouvernorat de Ariana\",'id_country' => 222),\n array('name' => \"Gouvernorat de Nabeul\",'id_country' => 222),\n array('name' => \"Gouvernorat de Sousse\",'id_country' => 222),\n array('name' => \"Hammamet Yasmine\",'id_country' => 222),\n array('name' => \"Jundubah\",'id_country' => 222),\n array('name' => \"Madaniyin\",'id_country' => 222),\n array('name' => \"Manubah\",'id_country' => 222),\n array('name' => \"Monastir\",'id_country' => 222),\n array('name' => \"Nabul\",'id_country' => 222),\n array('name' => \"Qabis\",'id_country' => 222),\n array('name' => \"Qafsah\",'id_country' => 222),\n array('name' => \"Qibili\",'id_country' => 222),\n array('name' => \"Safaqis\",'id_country' => 222),\n array('name' => \"Sfax\",'id_country' => 222),\n array('name' => \"Sidi Bu Zayd\",'id_country' => 222),\n array('name' => \"Silyanah\",'id_country' => 222),\n array('name' => \"Susah\",'id_country' => 222),\n array('name' => \"Tatawin\",'id_country' => 222),\n array('name' => \"Tawzar\",'id_country' => 222),\n array('name' => \"Tunis\",'id_country' => 222),\n array('name' => \"Zaghwan\",'id_country' => 222),\n array('name' => \"al-Kaf\",'id_country' => 222),\n array('name' => \"al-Mahdiyah\",'id_country' => 222),\n array('name' => \"al-Munastir\",'id_country' => 222),\n array('name' => \"al-Qasrayn\",'id_country' => 222),\n array('name' => \"al-Qayrawan\",'id_country' => 222),\n array('name' => \"Adana\",'id_country' => 223),\n array('name' => \"Adiyaman\",'id_country' => 223),\n array('name' => \"Afyon\",'id_country' => 223),\n array('name' => \"Agri\",'id_country' => 223),\n array('name' => \"Aksaray\",'id_country' => 223),\n array('name' => \"Amasya\",'id_country' => 223),\n array('name' => \"Ankara\",'id_country' => 223),\n array('name' => \"Antalya\",'id_country' => 223),\n array('name' => \"Ardahan\",'id_country' => 223),\n array('name' => \"Artvin\",'id_country' => 223),\n array('name' => \"Aydin\",'id_country' => 223),\n array('name' => \"Balikesir\",'id_country' => 223),\n array('name' => \"Bartin\",'id_country' => 223),\n array('name' => \"Batman\",'id_country' => 223),\n array('name' => \"Bayburt\",'id_country' => 223),\n array('name' => \"Bilecik\",'id_country' => 223),\n array('name' => \"Bingol\",'id_country' => 223),\n array('name' => \"Bitlis\",'id_country' => 223),\n array('name' => \"Bolu\",'id_country' => 223),\n array('name' => \"Burdur\",'id_country' => 223),\n array('name' => \"Bursa\",'id_country' => 223),\n array('name' => \"Canakkale\",'id_country' => 223),\n array('name' => \"Cankiri\",'id_country' => 223),\n array('name' => \"Corum\",'id_country' => 223),\n array('name' => \"Denizli\",'id_country' => 223),\n array('name' => \"Diyarbakir\",'id_country' => 223),\n array('name' => \"Duzce\",'id_country' => 223),\n array('name' => \"Edirne\",'id_country' => 223),\n array('name' => \"Elazig\",'id_country' => 223),\n array('name' => \"Erzincan\",'id_country' => 223),\n array('name' => \"Erzurum\",'id_country' => 223),\n array('name' => \"Eskisehir\",'id_country' => 223),\n array('name' => \"Gaziantep\",'id_country' => 223),\n array('name' => \"Giresun\",'id_country' => 223),\n array('name' => \"Gumushane\",'id_country' => 223),\n array('name' => \"Hakkari\",'id_country' => 223),\n array('name' => \"Hatay\",'id_country' => 223),\n array('name' => \"Icel\",'id_country' => 223),\n array('name' => \"Igdir\",'id_country' => 223),\n array('name' => \"Isparta\",'id_country' => 223),\n array('name' => \"Istanbul\",'id_country' => 223),\n array('name' => \"Izmir\",'id_country' => 223),\n array('name' => \"Kahramanmaras\",'id_country' => 223),\n array('name' => \"Karabuk\",'id_country' => 223),\n array('name' => \"Karaman\",'id_country' => 223),\n array('name' => \"Kars\",'id_country' => 223),\n array('name' => \"Karsiyaka\",'id_country' => 223),\n array('name' => \"Kastamonu\",'id_country' => 223),\n array('name' => \"Kayseri\",'id_country' => 223),\n array('name' => \"Kilis\",'id_country' => 223),\n array('name' => \"Kirikkale\",'id_country' => 223),\n array('name' => \"Kirklareli\",'id_country' => 223),\n array('name' => \"Kirsehir\",'id_country' => 223),\n array('name' => \"Kocaeli\",'id_country' => 223),\n array('name' => \"Konya\",'id_country' => 223),\n array('name' => \"Kutahya\",'id_country' => 223),\n array('name' => \"Lefkosa\",'id_country' => 223),\n array('name' => \"Malatya\",'id_country' => 223),\n array('name' => \"Manisa\",'id_country' => 223),\n array('name' => \"Mardin\",'id_country' => 223),\n array('name' => \"Mugla\",'id_country' => 223),\n array('name' => \"Mus\",'id_country' => 223),\n array('name' => \"Nevsehir\",'id_country' => 223),\n array('name' => \"Nigde\",'id_country' => 223),\n array('name' => \"Ordu\",'id_country' => 223),\n array('name' => \"Osmaniye\",'id_country' => 223),\n array('name' => \"Rize\",'id_country' => 223),\n array('name' => \"Sakarya\",'id_country' => 223),\n array('name' => \"Samsun\",'id_country' => 223),\n array('name' => \"Sanliurfa\",'id_country' => 223),\n array('name' => \"Siirt\",'id_country' => 223),\n array('name' => \"Sinop\",'id_country' => 223),\n array('name' => \"Sirnak\",'id_country' => 223),\n array('name' => \"Sivas\",'id_country' => 223),\n array('name' => \"Tekirdag\",'id_country' => 223),\n array('name' => \"Tokat\",'id_country' => 223),\n array('name' => \"Trabzon\",'id_country' => 223),\n array('name' => \"Tunceli\",'id_country' => 223),\n array('name' => \"Usak\",'id_country' => 223),\n array('name' => \"Van\",'id_country' => 223),\n array('name' => \"Yalova\",'id_country' => 223),\n array('name' => \"Yozgat\",'id_country' => 223),\n array('name' => \"Zonguldak\",'id_country' => 223),\n array('name' => \"Ahal\",'id_country' => 224),\n array('name' => \"Asgabat\",'id_country' => 224),\n array('name' => \"Balkan\",'id_country' => 224),\n array('name' => \"Dasoguz\",'id_country' => 224),\n array('name' => \"Lebap\",'id_country' => 224),\n array('name' => \"Mari\",'id_country' => 224),\n array('name' => \"Grand Turk\",'id_country' => 225),\n array('name' => \"South Caicos and East Caicos\",'id_country' => 225),\n array('name' => \"Funafuti\",'id_country' => 226),\n array('name' => \"Nanumanga\",'id_country' => 226),\n array('name' => \"Nanumea\",'id_country' => 226),\n array('name' => \"Niutao\",'id_country' => 226),\n array('name' => \"Nui\",'id_country' => 226),\n array('name' => \"Nukufetau\",'id_country' => 226),\n array('name' => \"Nukulaelae\",'id_country' => 226),\n array('name' => \"Vaitupu\",'id_country' => 226),\n array('name' => \"Central\",'id_country' => 227),\n array('name' => \"Eastern\",'id_country' => 227),\n array('name' => \"Northern\",'id_country' => 227),\n array('name' => \"Western\",'id_country' => 227),\n array('name' => \"Cherkas'ka\",'id_country' => 228),\n array('name' => \"Chernihivs'ka\",'id_country' => 228),\n array('name' => \"Chernivets'ka\",'id_country' => 228),\n array('name' => \"Crimea\",'id_country' => 228),\n array('name' => \"Dnipropetrovska\",'id_country' => 228),\n array('name' => \"Donets'ka\",'id_country' => 228),\n array('name' => \"Ivano-Frankivs'ka\",'id_country' => 228),\n array('name' => \"Kharkiv\",'id_country' => 228),\n array('name' => \"Kharkov\",'id_country' => 228),\n array('name' => \"Khersonska\",'id_country' => 228),\n array('name' => \"Khmel'nyts'ka\",'id_country' => 228),\n array('name' => \"Kirovohrad\",'id_country' => 228),\n array('name' => \"Krym\",'id_country' => 228),\n array('name' => \"Kyyiv\",'id_country' => 228),\n array('name' => \"Kyyivs'ka\",'id_country' => 228),\n array('name' => \"L'vivs'ka\",'id_country' => 228),\n array('name' => \"Luhans'ka\",'id_country' => 228),\n array('name' => \"Mykolayivs'ka\",'id_country' => 228),\n array('name' => \"Odes'ka\",'id_country' => 228),\n array('name' => \"Odessa\",'id_country' => 228),\n array('name' => \"Poltavs'ka\",'id_country' => 228),\n array('name' => \"Rivnens'ka\",'id_country' => 228),\n array('name' => \"Sevastopol'\",'id_country' => 228),\n array('name' => \"Sums'ka\",'id_country' => 228),\n array('name' => \"Ternopil's'ka\",'id_country' => 228),\n array('name' => \"Volyns'ka\",'id_country' => 228),\n array('name' => \"Vynnyts'ka\",'id_country' => 228),\n array('name' => \"Zakarpats'ka\",'id_country' => 228),\n array('name' => \"Zaporizhia\",'id_country' => 228),\n array('name' => \"Zhytomyrs'ka\",'id_country' => 228),\n array('name' => \"Abu Zabi\",'id_country' => 229),\n array('name' => \"Ajman\",'id_country' => 229),\n array('name' => \"Dubai\",'id_country' => 229),\n array('name' => \"Ras al-Khaymah\",'id_country' => 229),\n array('name' => \"Sharjah\",'id_country' => 229),\n array('name' => \"Sharjha\",'id_country' => 229),\n array('name' => \"Umm al Qaywayn\",'id_country' => 229),\n array('name' => \"al-Fujayrah\",'id_country' => 229),\n array('name' => \"ash-Shariqah\",'id_country' => 229),\n array('name' => \"Aberdeen\",'id_country' => 230),\n array('name' => \"Aberdeenshire\",'id_country' => 230),\n array('name' => \"Argyll\",'id_country' => 230),\n array('name' => \"Armagh\",'id_country' => 230),\n array('name' => \"Bedfordshire\",'id_country' => 230),\n array('name' => \"Belfast\",'id_country' => 230),\n array('name' => \"Berkshire\",'id_country' => 230),\n array('name' => \"Birmingham\",'id_country' => 230),\n array('name' => \"Brechin\",'id_country' => 230),\n array('name' => \"Bridgnorth\",'id_country' => 230),\n array('name' => \"Bristol\",'id_country' => 230),\n array('name' => \"Buckinghamshire\",'id_country' => 230),\n array('name' => \"Cambridge\",'id_country' => 230),\n array('name' => \"Cambridgeshire\",'id_country' => 230),\n array('name' => \"Channel Islands\",'id_country' => 230),\n array('name' => \"Cheshire\",'id_country' => 230),\n array('name' => \"Cleveland\",'id_country' => 230),\n array('name' => \"Co Fermanagh\",'id_country' => 230),\n array('name' => \"Conwy\",'id_country' => 230),\n array('name' => \"Cornwall\",'id_country' => 230),\n array('name' => \"Coventry\",'id_country' => 230),\n array('name' => \"Craven Arms\",'id_country' => 230),\n array('name' => \"Cumbria\",'id_country' => 230),\n array('name' => \"Denbighshire\",'id_country' => 230),\n array('name' => \"Derby\",'id_country' => 230),\n array('name' => \"Derbyshire\",'id_country' => 230),\n array('name' => \"Devon\",'id_country' => 230),\n array('name' => \"Dial Code Dungannon\",'id_country' => 230),\n array('name' => \"Didcot\",'id_country' => 230),\n array('name' => \"Dorset\",'id_country' => 230),\n array('name' => \"Dunbartonshire\",'id_country' => 230),\n array('name' => \"Durham\",'id_country' => 230),\n array('name' => \"East Dunbartonshire\",'id_country' => 230),\n array('name' => \"East Lothian\",'id_country' => 230),\n array('name' => \"East Midlands\",'id_country' => 230),\n array('name' => \"East Sussex\",'id_country' => 230),\n array('name' => \"East Yorkshire\",'id_country' => 230),\n array('name' => \"England\",'id_country' => 230),\n array('name' => \"Essex\",'id_country' => 230),\n array('name' => \"Fermanagh\",'id_country' => 230),\n array('name' => \"Fife\",'id_country' => 230),\n array('name' => \"Flintshire\",'id_country' => 230),\n array('name' => \"Fulham\",'id_country' => 230),\n array('name' => \"Gainsborough\",'id_country' => 230),\n array('name' => \"Glocestershire\",'id_country' => 230),\n array('name' => \"Gwent\",'id_country' => 230),\n array('name' => \"Hampshire\",'id_country' => 230),\n array('name' => \"Hants\",'id_country' => 230),\n array('name' => \"Herefordshire\",'id_country' => 230),\n array('name' => \"Hertfordshire\",'id_country' => 230),\n array('name' => \"Ireland\",'id_country' => 230),\n array('name' => \"Isle Of Man\",'id_country' => 230),\n array('name' => \"Isle of Wight\",'id_country' => 230),\n array('name' => \"Kenford\",'id_country' => 230),\n array('name' => \"Kent\",'id_country' => 230),\n array('name' => \"Kilmarnock\",'id_country' => 230),\n array('name' => \"Lanarkshire\",'id_country' => 230),\n array('name' => \"Lancashire\",'id_country' => 230),\n array('name' => \"Leicestershire\",'id_country' => 230),\n array('name' => \"Lincolnshire\",'id_country' => 230),\n array('name' => \"Llanymynech\",'id_country' => 230),\n array('name' => \"London\",'id_country' => 230),\n array('name' => \"Ludlow\",'id_country' => 230),\n array('name' => \"Manchester\",'id_country' => 230),\n array('name' => \"Mayfair\",'id_country' => 230),\n array('name' => \"Merseyside\",'id_country' => 230),\n array('name' => \"Mid Glamorgan\",'id_country' => 230),\n array('name' => \"Middlesex\",'id_country' => 230),\n array('name' => \"Mildenhall\",'id_country' => 230),\n array('name' => \"Monmouthshire\",'id_country' => 230),\n array('name' => \"Newton Stewart\",'id_country' => 230),\n array('name' => \"Norfolk\",'id_country' => 230),\n array('name' => \"North Humberside\",'id_country' => 230),\n array('name' => \"North Yorkshire\",'id_country' => 230),\n array('name' => \"Northamptonshire\",'id_country' => 230),\n array('name' => \"Northants\",'id_country' => 230),\n array('name' => \"Northern Ireland\",'id_country' => 230),\n array('name' => \"Northumberland\",'id_country' => 230),\n array('name' => \"Nottinghamshire\",'id_country' => 230),\n array('name' => \"Oxford\",'id_country' => 230),\n array('name' => \"Powys\",'id_country' => 230),\n array('name' => \"Roos-shire\",'id_country' => 230),\n array('name' => \"SUSSEX\",'id_country' => 230),\n array('name' => \"Sark\",'id_country' => 230),\n array('name' => \"Scotland\",'id_country' => 230),\n array('name' => \"Scottish Borders\",'id_country' => 230),\n array('name' => \"Shropshire\",'id_country' => 230),\n array('name' => \"Somerset\",'id_country' => 230),\n array('name' => \"South Glamorgan\",'id_country' => 230),\n array('name' => \"South Wales\",'id_country' => 230),\n array('name' => \"South Yorkshire\",'id_country' => 230),\n array('name' => \"Southwell\",'id_country' => 230),\n array('name' => \"Staffordshire\",'id_country' => 230),\n array('name' => \"Strabane\",'id_country' => 230),\n array('name' => \"Suffolk\",'id_country' => 230),\n array('name' => \"Surrey\",'id_country' => 230),\n array('name' => \"Sussex\",'id_country' => 230),\n array('name' => \"Twickenham\",'id_country' => 230),\n array('name' => \"Tyne and Wear\",'id_country' => 230),\n array('name' => \"Tyrone\",'id_country' => 230),\n array('name' => \"Utah\",'id_country' => 230),\n array('name' => \"Wales\",'id_country' => 230),\n array('name' => \"Warwickshire\",'id_country' => 230),\n array('name' => \"West Lothian\",'id_country' => 230),\n array('name' => \"West Midlands\",'id_country' => 230),\n array('name' => \"West Sussex\",'id_country' => 230),\n array('name' => \"West Yorkshire\",'id_country' => 230),\n array('name' => \"Whissendine\",'id_country' => 230),\n array('name' => \"Wiltshire\",'id_country' => 230),\n array('name' => \"Wokingham\",'id_country' => 230),\n array('name' => \"Worcestershire\",'id_country' => 230),\n array('name' => \"Wrexham\",'id_country' => 230),\n array('name' => \"Wurttemberg\",'id_country' => 230),\n array('name' => \"Yorkshire\",'id_country' => 230),\n array('name' => \"Alabama\",'id_country' => 231),\n array('name' => \"Alaska\",'id_country' => 231),\n array('name' => \"Arizona\",'id_country' => 231),\n array('name' => \"Arkansas\",'id_country' => 231),\n array('name' => \"Byram\",'id_country' => 231),\n array('name' => \"California\",'id_country' => 231),\n array('name' => \"Cokato\",'id_country' => 231),\n array('name' => \"Colorado\",'id_country' => 231),\n array('name' => \"Connecticut\",'id_country' => 231),\n array('name' => \"Delaware\",'id_country' => 231),\n array('name' => \"District of Columbia\",'id_country' => 231),\n array('name' => \"Florida\",'id_country' => 231),\n array('name' => \"Georgia\",'id_country' => 231),\n array('name' => \"Hawaii\",'id_country' => 231),\n array('name' => \"Idaho\",'id_country' => 231),\n array('name' => \"Illinois\",'id_country' => 231),\n array('name' => \"Indiana\",'id_country' => 231),\n array('name' => \"Iowa\",'id_country' => 231),\n array('name' => \"Kansas\",'id_country' => 231),\n array('name' => \"Kentucky\",'id_country' => 231),\n array('name' => \"Louisiana\",'id_country' => 231),\n array('name' => \"Lowa\",'id_country' => 231),\n array('name' => \"Maine\",'id_country' => 231),\n array('name' => \"Maryland\",'id_country' => 231),\n array('name' => \"Massachusetts\",'id_country' => 231),\n array('name' => \"Medfield\",'id_country' => 231),\n array('name' => \"Michigan\",'id_country' => 231),\n array('name' => \"Minnesota\",'id_country' => 231),\n array('name' => \"Mississippi\",'id_country' => 231),\n array('name' => \"Missouri\",'id_country' => 231),\n array('name' => \"Montana\",'id_country' => 231),\n array('name' => \"Nebraska\",'id_country' => 231),\n array('name' => \"Nevada\",'id_country' => 231),\n array('name' => \"New Hampshire\",'id_country' => 231),\n array('name' => \"New Jersey\",'id_country' => 231),\n array('name' => \"New Jersy\",'id_country' => 231),\n array('name' => \"New Mexico\",'id_country' => 231),\n array('name' => \"New York\",'id_country' => 231),\n array('name' => \"North Carolina\",'id_country' => 231),\n array('name' => \"North Dakota\",'id_country' => 231),\n array('name' => \"Ohio\",'id_country' => 231),\n array('name' => \"Oklahoma\",'id_country' => 231),\n array('name' => \"Ontario\",'id_country' => 231),\n array('name' => \"Oregon\",'id_country' => 231),\n array('name' => \"Pennsylvania\",'id_country' => 231),\n array('name' => \"Ramey\",'id_country' => 231),\n array('name' => \"Rhode Island\",'id_country' => 231),\n array('name' => \"South Carolina\",'id_country' => 231),\n array('name' => \"South Dakota\",'id_country' => 231),\n array('name' => \"Sublimity\",'id_country' => 231),\n array('name' => \"Tennessee\",'id_country' => 231),\n array('name' => \"Texas\",'id_country' => 231),\n array('name' => \"Trimble\",'id_country' => 231),\n array('name' => \"Utah\",'id_country' => 231),\n array('name' => \"Vermont\",'id_country' => 231),\n array('name' => \"Virginia\",'id_country' => 231),\n array('name' => \"Washington\",'id_country' => 231),\n array('name' => \"West Virginia\",'id_country' => 231),\n array('name' => \"Wisconsin\",'id_country' => 231),\n array('name' => \"Wyoming\",'id_country' => 231),\n array('name' => \"United States Minor Outlying I\",'id_country' => 232),\n array('name' => \"Artigas\",'id_country' => 233),\n array('name' => \"Canelones\",'id_country' => 233),\n array('name' => \"Cerro Largo\",'id_country' => 233),\n array('name' => \"Colonia\",'id_country' => 233),\n array('name' => \"Durazno\",'id_country' => 233),\n array('name' => \"FLorida\",'id_country' => 233),\n array('name' => \"Flores\",'id_country' => 233),\n array('name' => \"Lavalleja\",'id_country' => 233),\n array('name' => \"Maldonado\",'id_country' => 233),\n array('name' => \"Montevideo\",'id_country' => 233),\n array('name' => \"Paysandu\",'id_country' => 233),\n array('name' => \"Rio Negro\",'id_country' => 233),\n array('name' => \"Rivera\",'id_country' => 233),\n array('name' => \"Rocha\",'id_country' => 233),\n array('name' => \"Salto\",'id_country' => 233),\n array('name' => \"San Jose\",'id_country' => 233),\n array('name' => \"Soriano\",'id_country' => 233),\n array('name' => \"Tacuarembo\",'id_country' => 233),\n array('name' => \"Treinta y Tres\",'id_country' => 233),\n array('name' => \"Andijon\",'id_country' => 234),\n array('name' => \"Buhoro\",'id_country' => 234),\n array('name' => \"Buxoro Viloyati\",'id_country' => 234),\n array('name' => \"Cizah\",'id_country' => 234),\n array('name' => \"Fargona\",'id_country' => 234),\n array('name' => \"Horazm\",'id_country' => 234),\n array('name' => \"Kaskadar\",'id_country' => 234),\n array('name' => \"Korakalpogiston\",'id_country' => 234),\n array('name' => \"Namangan\",'id_country' => 234),\n array('name' => \"Navoi\",'id_country' => 234),\n array('name' => \"Samarkand\",'id_country' => 234),\n array('name' => \"Sirdare\",'id_country' => 234),\n array('name' => \"Surhondar\",'id_country' => 234),\n array('name' => \"Toskent\",'id_country' => 234),\n array('name' => \"Malampa\",'id_country' => 235),\n array('name' => \"Penama\",'id_country' => 235),\n array('name' => \"Sanma\",'id_country' => 235),\n array('name' => \"Shefa\",'id_country' => 235),\n array('name' => \"Tafea\",'id_country' => 235),\n array('name' => \"Torba\",'id_country' => 235),\n array('name' => \"Vatican City State (Holy See)\",'id_country' => 236),\n array('name' => \"Amazonas\",'id_country' => 237),\n array('name' => \"Anzoategui\",'id_country' => 237),\n array('name' => \"Apure\",'id_country' => 237),\n array('name' => \"Aragua\",'id_country' => 237),\n array('name' => \"Barinas\",'id_country' => 237),\n array('name' => \"Bolivar\",'id_country' => 237),\n array('name' => \"Carabobo\",'id_country' => 237),\n array('name' => \"Cojedes\",'id_country' => 237),\n array('name' => \"Delta Amacuro\",'id_country' => 237),\n array('name' => \"Distrito Federal\",'id_country' => 237),\n array('name' => \"Falcon\",'id_country' => 237),\n array('name' => \"Guarico\",'id_country' => 237),\n array('name' => \"Lara\",'id_country' => 237),\n array('name' => \"Merida\",'id_country' => 237),\n array('name' => \"Miranda\",'id_country' => 237),\n array('name' => \"Monagas\",'id_country' => 237),\n array('name' => \"Nueva Esparta\",'id_country' => 237),\n array('name' => \"Portuguesa\",'id_country' => 237),\n array('name' => \"Sucre\",'id_country' => 237),\n array('name' => \"Tachira\",'id_country' => 237),\n array('name' => \"Trujillo\",'id_country' => 237),\n array('name' => \"Vargas\",'id_country' => 237),\n array('name' => \"Yaracuy\",'id_country' => 237),\n array('name' => \"Zulia\",'id_country' => 237),\n array('name' => \"Bac Giang\",'id_country' => 238),\n array('name' => \"Binh Dinh\",'id_country' => 238),\n array('name' => \"Binh Duong\",'id_country' => 238),\n array('name' => \"Da Nang\",'id_country' => 238),\n array('name' => \"Dong Bang Song Cuu Long\",'id_country' => 238),\n array('name' => \"Dong Bang Song Hong\",'id_country' => 238),\n array('name' => \"Dong Nai\",'id_country' => 238),\n array('name' => \"Dong Nam Bo\",'id_country' => 238),\n array('name' => \"Duyen Hai Mien Trung\",'id_country' => 238),\n array('name' => \"Hanoi\",'id_country' => 238),\n array('name' => \"Hung Yen\",'id_country' => 238),\n array('name' => \"Khu Bon Cu\",'id_country' => 238),\n array('name' => \"Long An\",'id_country' => 238),\n array('name' => \"Mien Nui Va Trung Du\",'id_country' => 238),\n array('name' => \"Thai Nguyen\",'id_country' => 238),\n array('name' => \"Thanh Pho Ho Chi Minh\",'id_country' => 238),\n array('name' => \"Thu Do Ha Noi\",'id_country' => 238),\n array('name' => \"Tinh Can Tho\",'id_country' => 238),\n array('name' => \"Tinh Da Nang\",'id_country' => 238),\n array('name' => \"Tinh Gia Lai\",'id_country' => 238),\n array('name' => \"Anegada\",'id_country' => 239),\n array('name' => \"Jost van Dyke\",'id_country' => 239),\n array('name' => \"Tortola\",'id_country' => 239),\n array('name' => \"Saint Croix\",'id_country' => 240),\n array('name' => \"Saint John\",'id_country' => 240),\n array('name' => \"Saint Thomas\",'id_country' => 240),\n array('name' => \"Alo\",'id_country' => 241),\n array('name' => \"Singave\",'id_country' => 241),\n array('name' => \"Wallis\",'id_country' => 241),\n array('name' => \"Bu Jaydur\",'id_country' => 242),\n array('name' => \"Wad-adh-Dhahab\",'id_country' => 242),\n array('name' => \"al-'Ayun\",'id_country' => 242),\n array('name' => \"as-Samarah\",'id_country' => 242),\n array('name' => \"'Adan\",'id_country' => 243),\n array('name' => \"Abyan\",'id_country' => 243),\n array('name' => \"Dhamar\",'id_country' => 243),\n array('name' => \"Hadramaut\",'id_country' => 243),\n array('name' => \"Hajjah\",'id_country' => 243),\n array('name' => \"Hudaydah\",'id_country' => 243),\n array('name' => \"Ibb\",'id_country' => 243),\n array('name' => \"Lahij\",'id_country' => 243),\n array('name' => \"Ma'rib\",'id_country' => 243),\n array('name' => \"Madinat San'a\",'id_country' => 243),\n array('name' => \"Sa'dah\",'id_country' => 243),\n array('name' => \"Sana\",'id_country' => 243),\n array('name' => \"Shabwah\",'id_country' => 243),\n array('name' => \"Ta'izz\",'id_country' => 243),\n array('name' => \"al-Bayda\",'id_country' => 243),\n array('name' => \"al-Hudaydah\",'id_country' => 243),\n array('name' => \"al-Jawf\",'id_country' => 243),\n array('name' => \"al-Mahrah\",'id_country' => 243),\n array('name' => \"al-Mahwit\",'id_country' => 243),\n array('name' => \"Central Serbia\",'id_country' => 244),\n array('name' => \"Kosovo and Metohija\",'id_country' => 244),\n array('name' => \"Montenegro\",'id_country' => 244),\n array('name' => \"Republic of Serbia\",'id_country' => 244),\n array('name' => \"Serbia\",'id_country' => 244),\n array('name' => \"Vojvodina\",'id_country' => 244),\n array('name' => \"Central\",'id_country' => 245),\n array('name' => \"Copperbelt\",'id_country' => 245),\n array('name' => \"Eastern\",'id_country' => 245),\n array('name' => \"Luapala\",'id_country' => 245),\n array('name' => \"Lusaka\",'id_country' => 245),\n array('name' => \"North-Western\",'id_country' => 245),\n array('name' => \"Northern\",'id_country' => 245),\n array('name' => \"Southern\",'id_country' => 245),\n array('name' => \"Western\",'id_country' => 245),\n array('name' => \"Bulawayo\",'id_country' => 246),\n array('name' => \"Harare\",'id_country' => 246),\n array('name' => \"Manicaland\",'id_country' => 246),\n array('name' => \"Mashonaland Central\",'id_country' => 246),\n array('name' => \"Mashonaland East\",'id_country' => 246),\n array('name' => \"Mashonaland West\",'id_country' => 246),\n array('name' => \"Masvingo\",'id_country' => 246),\n array('name' => \"Matabeleland North\",'id_country' => 246),\n array('name' => \"Matabeleland South\",'id_country' => 246),\n array('name' => \"Midlands\",'id_country' => 246)\n );\n DB::table('state')->insert($states);\n }", "function wc_ru_regions_add_counties( $states ) {\n\n $states['RU'] = array(\n 'AD' => 'Республика Адыгея (Адыгея)',\n 'BA' => 'Республика Башкортостан',\n 'BU' => 'Республика Бурятия',\n 'AL' => 'Республика Алтай',\n 'DA' => 'Республика Дагестан',\n 'IN' => 'Республика Ингушетия',\n 'KABA' => 'Кабардино-Балкарская Республика',\n 'KA' => 'Республика Калмыкия',\n 'KACH' => 'Карачаево-Черкесская Республика',\n 'KAR' => 'Республика Карелия',\n 'KOM' => 'Республика Коми',\n 'MAR' => 'Республика Марий Эл',\n 'MOR' => 'Республика Мордовия',\n 'SAH' => 'Республика Саха (Якутия)',\n 'SEV' => 'Республика Северная Осетия - Алания',\n 'TAT' => 'Республика Татарстан (Татарстан)',\n 'TI' => 'Республика Тыва',\n 'UD' => 'Удмуртская Республика',\n 'HA' => 'Республика Хакасия',\n 'CHE' => 'Чеченская Республика',\n 'CHU' => 'Чувашская Республика - Чувашия',\n 'ALT' => 'Алтайский край',\n 'KRD' => 'Краснодарский край',\n 'KRY' => 'Красноярский край',\n 'PRI' => 'Приморский край',\n 'STA' => 'Ставропольский край',\n 'HAB' => 'Хабаровский край',\n 'AM' => 'Амурская область',\n 'AR' => 'Архангельская область',\n 'AS' => 'Астраханская область',\n 'BE' => 'Белгородская область',\n 'BR' => 'Брянская область',\n 'VL' => 'Владимирская область',\n 'VG' => 'Волгоградская область',\n 'VOG' => 'Вологодская область',\n 'VR' => 'Воронежская область',\n 'IV' => 'Ивановская область',\n 'IR' => 'Иркутская область',\n 'KON' => 'Калининградская область',\n 'KLG' => 'Калужская область',\n 'KM' => 'Камчатский край',\n 'KE' => 'Кемеровская область',\n 'KI' => 'Кировская область',\n 'KO' => 'Костромская область',\n 'KU' => 'Курганская область',\n 'KUR' => 'Курская область',\n 'LEO' => 'Ленинградская область',\n 'LI' => 'Липецкая область',\n 'MA' => 'Магаданская область',\n 'MO' => 'Московская область',\n 'MU' => 'Мурманская область',\n 'NI' => 'Нижегородская область',\n 'NO' => 'Новгородская область',\n 'NOV' => 'Новосибирская область',\n 'OM' => 'Омская область',\n 'OR' => 'Оренбургская область',\n 'ORL' => 'Орловская область',\n 'PEN' => 'Пензенская область',\n 'PER' => 'Пермский край',\n 'PS' => 'Псковская область',\n 'RO' => 'Ростовская область',\n 'RY' => 'Рязанская область',\n 'SA' => 'Самарская область',\n 'SAR' => 'Саратовская область',\n 'SHL' => 'Сахалинская область',\n 'SV' => 'Свердловская область',\n 'SM' => 'Смоленская область',\n 'TA' => 'Тамбовская область',\n 'TV' => 'Тверская область',\n 'TO' => 'Томская область',\n 'TU' => 'Тульская область',\n 'TY' => 'Тюменская область',\n 'UL' => 'Ульяновская область',\n 'CH' => 'Челябинская область',\n 'ZA' => 'Забайкальский край',\n 'YA' => 'Ярославская область',\n 'DC' => 'г. Москва',\n 'LE' => 'Санкт-Петербург',\n 'EV' => 'Еврейская автономная область',\n 'NE' => 'Ненецкий автономный округ',\n 'HAN' => 'Ханты-Мансийский автономный округ - Югра',\n 'CHK' => 'Чукотский автономный округ',\n 'YM' => 'Ямало-Ненецкий автономный округ',\n 'KRM' => 'Республика Крым',\n 'SVS' => 'Севастополь',\n 'OTH' => 'Иные территории, включая город и космодром Байконур',\n );\n return $states;\n\n}", "public function run()\n {\n App\\State::create([\"name\"=>\"Aguascalientes\", \"short_name\"=>\"Ags\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Baja California\", \"short_name\"=>\"B.C\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Baja California Sur\", \"short_name\"=>\"B.C.S\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Campeche\", \"short_name\"=>\"Camp\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Chiapas\", \"short_name\"=>\"Chis\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Chihuahua\", \"short_name\"=>\"Chih\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Ciudad de México\", \"short_name\"=>\"CDMX\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Coahuila\", \"short_name\"=>\"Coah\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Colima\", \"short_name\"=>\"Col\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Durango\", \"short_name\"=>\"Dgo\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Guanajuato\", \"short_name\"=>\"Gto\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Guerrero\", \"short_name\"=>\"Gro\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Hidalgo\", \"short_name\"=>\"Hgo\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Jalisco\", \"short_name\"=>\"Jal\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"México\", \"short_name\"=>\"Méx\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Michoacán\", \"short_name\"=>\"Mich\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Morelos\", \"short_name\"=>\"Mor\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Nayarit\", \"short_name\"=>\"Nay\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Nuevo León\", \"short_name\"=>\"N.L\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Oaxaca\", \"short_name\"=>\"Oax\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Puebla\", \"short_name\"=>\"Pue\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Querétaro\", \"short_name\"=>\"Qro\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Quintana Roo\", \"short_name\"=>\"Q.R\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"San Luis Potosí\", \"short_name\"=>\"S.L.P\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Sinaloa\", \"short_name\"=>\"Sin\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Sonora\", \"short_name\"=>\"Son\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Tabasco\", \"short_name\"=>\"Tab\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Tamaulipas\", \"short_name\"=>\"Tamps\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Tlaxcala\", \"short_name\"=>\"Tlax\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Veracruz\", \"short_name\"=>\"Ver\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Yucatán\", \"short_name\"=>\"Yuc\", \"country_id\"=> 1 ]);\n App\\State::create([\"name\"=>\"Zacatecas\", \"short_name\"=>\"Zac\", \"country_id\"=> 1 ]);\n }", "function GetStates () {\n\t\t$this->db->order_by('name_long','ASC');\n\t\t$result = $this->db->get('states');\n\n\t\t$states = array();\n\t\tforeach ($result->result_array() as $state) {\n\t\t\t$states[] = array(\n\t\t\t\t\t\t\t'code' => $state['name_short'],\n\t\t\t\t\t\t\t'name' => $state['name_long']\n\t\t\t\t\t\t);\n\t\t}\n\n\t\treturn $states;\n\t}", "public function getStateAction()\n {\n\n $country_id = $this->getRequest()->getPost('country_id');\n\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n //$states = Mage::getModel('directory/country')->load($country_id)->getRegions();\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $select = $connectionRead->select()\n ->from('citylist', array('*'))\n ->where('country_code=?',$country_id)\n ->group('region_name');\n\n $states = $connectionRead->fetchAll($select);\n\n //state names\n $response = array();\n\n $i=0;\n foreach ($states as $state) {\n $response[$i]['id'] = $state['id_citylist'];\n $response[$i]['country_code'] = $state['country_code'];\n $response[$i]['name'] = $state['region_name'];\n $i++;\n }\n\n echo json_encode($response);\n exit;\n }" ]
[ "0.6908315", "0.66189903", "0.626148", "0.6017034", "0.5963487", "0.595073", "0.59050304", "0.59033144", "0.5886462", "0.58399963", "0.57921493", "0.5709187", "0.5699826", "0.5652771", "0.5642856", "0.5618905", "0.55506253", "0.55354947", "0.54750013", "0.542755", "0.53769183", "0.53762037", "0.53737056", "0.5299877", "0.52664274", "0.5265438", "0.5249919", "0.52472717", "0.5231792", "0.5223428" ]
0.7954591
0
Imports USA administration level 2 (counties)
public function importUsaLevelCounties() { return $this->importData('USA_adm/USA_adm2.shp', 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function importUsaLevelCountry()\n {\n return $this->importData('USA_adm/USA_adm0.shp', 0);\n }", "public function importUsaLevelStates()\n {\n return $this->importData('USA_adm/USA_adm1.shp', 0);\n }", "function wc_ie_counties_add_counties( $states ) {\r\n\t$states['IE'] = array(\r\n\t\t'Carlow' => 'Carlow',\r\n\t\t'Cavan' => 'Cavan',\r\n\t\t'Clare' => 'Clare',\r\n\t\t'Cork' => 'Cork',\r\n\t\t'Donegal' => 'Donegal',\r\n\t\t'Dublin' => 'Dublin',\r\n\t\t'Galway' => 'Galway',\r\n\t\t'Kerry' => 'Kerry',\r\n\t\t'Kildare' => 'Kildare',\r\n\t\t'Kilkenny' => 'Kilkenny',\r\n\t\t'Laois' => 'Laois',\r\n\t\t'Leitrim' => 'Leitrim',\r\n\t\t'Limerick' => 'Limerick',\r\n\t\t'Longford' => 'Longford',\r\n\t\t'Louth' => 'Louth',\r\n\t\t'Mayo' => 'Mayo',\r\n\t\t'Meath' => 'Meath',\r\n\t\t'Monaghan' => 'Monaghan',\r\n\t\t'Offaly' => 'Offaly',\r\n\t\t'Roscommon' => 'Roscommon',\r\n\t\t'Sligo' => 'Sligo',\r\n\t\t'Tipperary' => 'Tipperary',\r\n\t\t'Waterford' => 'Waterford',\r\n\t\t'Westmeath' => 'Westmeath',\r\n\t\t'Wexford' => 'Wexford',\r\n\t\t'Wicklow' => 'Wicklow',\r\n\t);\r\n\treturn $states;\r\n}", "function wc_uk_counties_add_counties( $states ) {\n\n $states['GB'] = array(\n 'AV' => 'Avon',\n 'BE' => 'Bedfordshire',\n 'BK' => 'Berkshire',\n 'BU' => 'Buckinghamshire',\n 'CA' => 'Cambridgeshire',\n 'CH' => 'Cheshire',\n 'CL' => 'Cleveland',\n 'CO' => 'Cornwall',\n 'CD' => 'County Durham',\n 'CU' => 'Cumbria',\n 'DE' => 'Derbyshire',\n 'DV' => 'Devon',\n 'DO' => 'Dorset',\n 'ES' => 'East Sussex',\n 'EX' => 'Essex',\n 'GL' => 'Gloucestershire',\n 'HA' => 'Hampshire',\n 'HE' => 'Herefordshire',\n 'HT' => 'Hertfordshire',\n 'IW' => 'Isle of Wight',\n 'KE' => 'Kent',\n 'LA' => 'Lancashire',\n 'LE' => 'Leicestershire',\n 'LI' => 'Lincolnshire',\n 'LO' => 'London',\n 'ME' => 'Merseyside',\n 'MI' => 'Middlesex',\n 'NO' => 'Norfolk',\n 'NH' => 'North Humberside',\n 'NY' => 'North Yorkshire',\n 'NS' => 'Northamptonshire',\n 'NL' => 'Northumberland',\n 'NT' => 'Nottinghamshire',\n 'OX' => 'Oxfordshire',\n 'SH' => 'Shropshire',\n 'SO' => 'Somerset',\n 'SM' => 'South Humberside',\n 'SY' => 'South Yorkshire',\n 'SF' => 'Staffordshire',\n 'SU' => 'Suffolk',\n 'SR' => 'Surrey',\n 'TW' => 'Tyne and Wear',\n 'WA' => 'Warwickshire',\n 'WM' => 'West Midlands',\n 'WS' => 'West Sussex',\n 'WY' => 'West Yorkshire',\n 'WI' => 'Wiltshire',\n 'WO' => 'Worcestershire',\n 'ABD' => 'Scotland / Aberdeenshire',\n 'ANS' => 'Scotland / Angus',\n 'ARL' => 'Scotland / Argyle & Bute',\n 'AYR' => 'Scotland / Ayrshire',\n 'CLK' => 'Scotland / Clackmannanshire',\n 'DGY' => 'Scotland / Dumfries & Galloway',\n 'DNB' => 'Scotland / Dunbartonshire',\n 'DDE' => 'Scotland / Dundee',\n 'ELN' => 'Scotland / East Lothian',\n 'EDB' => 'Scotland / Edinburgh',\n 'FIF' => 'Scotland / Fife',\n 'GGW' => 'Scotland / Glasgow',\n 'HLD' => 'Scotland / Highland',\n 'LKS' => 'Scotland / Lanarkshire',\n 'MLN' => 'Scotland / Midlothian',\n 'MOR' => 'Scotland / Moray',\n 'OKI' => 'Scotland / Orkney',\n 'PER' => 'Scotland / Perth and Kinross',\n 'RFW' => 'Scotland / Renfrewshire',\n 'SB' => 'Scotland / Scottish Borders',\n 'SHI' => 'Scotland / Shetland Isles',\n 'STI' => 'Scotland / Stirling',\n 'WLN' => 'Scotland / West Lothian',\n 'WIS' => 'Scotland / Western Isles',\n 'AGY' => 'Wales / Anglesey',\n 'GNT' => 'Wales / Blaenau Gwent',\n 'CP' => 'Wales / Caerphilly',\n 'CF' => 'Wales / Cardiff',\n 'CAE' => 'Wales / Carmarthenshire',\n 'CR' => 'Wales / Ceredigion',\n 'CW' => 'Wales / Conwy',\n 'DEN' => 'Wales / Denbighshire',\n 'FLN' => 'Wales / Flintshire',\n 'GLA' => 'Wales / Glamorgan',\n 'GWN' => 'Wales / Gwynedd',\n 'MT' => 'Wales / Merthyr Tydfil',\n 'MON' => 'Wales / Monmouthshire',\n 'PT' => 'Wales / Neath Port Talbot',\n 'NP' => 'Wales / Newport',\n 'PEM' => 'Wales / Pembrokeshire',\n 'POW' => 'Wales / Powys',\n 'RT' => 'Wales / Rhondda Cynon Taff',\n 'SS' => 'Wales / Swansea',\n 'TF' => 'Wales / Torfaen',\n 'WX' => 'Wales / Wrexham',\n 'ANT' => 'Northern Ireland / County Antrim',\n 'ARM' => 'Northern Ireland / County Armagh',\n 'DOW' => 'Northern Ireland / County Down',\n 'FER' => 'Northern Ireland / County Fermanagh',\n 'LDY' => 'Northern Ireland / County Londonderry',\n 'TYR' => 'Northern Ireland / County Tyrone',\n );\n return $states;\n\n}", "public function actionCountries()\n {\n $salys = Yii::$app->db_prod->createCommand(\"SELECT * FROM salys\")->queryAll();\n foreach ($salys as $salis) {\n $city = new City([\n 'name' => $salis['pavadinimas_lt'],\n 'ansi_name' => $salis['pavadinimas_lt'],\n 'alt_name' => $this->formatCountryAltName($salis),\n 'latitude' => $salis['latitude'],\n 'longitude' => $salis['longitude'],\n 'country_code' => strtoupper($salis['kodas']),\n 'population' => null,\n 'elevation' => null,\n 'timezone' => null,\n 'modification_date' => null,\n ]);\n $city->save();\n }\n\n Cities::addCountries();\n }", "public function populateRegionTables() {\n\t\t$scrapeLog = $this->addLog(COUNTY_TABLE);\n\t\t\n\t\t$counties = $this->countyRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . COUNTY_PATH);\n\t\tforeach($counties as $county) {\n\t\t\t$this->countyRepository->add($county);\n\t\t\t\n\t\t\t$municipalities = $this->municipalityRepository->getFromXML(BASE_PATH . AD_PATH . SEARCH_LIST_PATH . MUNICIPALITY_PATH . $county->getCountyId(), $county->getCountyId());\n\t\t\t\n\t\t\tforeach($municipalities as $municipality) {\n\t\t\t\t$this->municipalityRepository->add($municipality);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->updateLog($scrapeLog);\n\t}", "private static function import_states_cities( $opts ) {\n\t\techo absint( self::import_cities_with_counties_csv( $opts ) );\n\t}", "private function _counties()\n\t{\n\t\t$counties = ORM::factory('county')\n\t\t\t->orderby('county_name')\n\t\t\t->find_all();\n\n\t\treturn $counties;\n\t}", "private static function import_cities_with_counties_csv( $opts ) {\n\t\tself::maybe_initialize_option( 'cities', $opts );\n\n\t\tif ( $opts['cities'] < self::$cities_total ) {\n\t\t\t// Get city form ID\n\t\t\t$form_id = FrmForm::get_id_by_key( 'frm_loc_list' );\n\t\t\tif ( ! $form_id ) {\n\t\t\t\treturn $opts['cities'];\n\t\t\t}\n\n\t\t\t// Import cities from CSV\n\t\t\t$filename = dirname( dirname( __FILE__ ) ) . '/locations_data/us_cities.csv';\n\t\t\t$opts['cities'] = FrmProXMLHelper::import_csv(\n\t\t\t\t$filename,\n\t\t\t\t$form_id,\n\t\t\t\tarray(\n\t\t\t\t\t1 => FrmField::get_id_by_key( 'frm_loc_city' ),\n\t\t\t\t\t2 => FrmField::get_id_by_key( 'frm_loc_county' ),\n\t\t\t\t\t4 => FrmField::get_id_by_key( 'frm_loc_state' ),\n\t\t\t\t\t5 => FrmField::get_id_by_key( 'frm_loc_state_abr' ),\n\t\t\t\t\t6 => FrmField::get_id_by_key( 'frm_loc_country_code2' ),\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t$opts['cities'] + 1\n\t\t\t);\n\n\t\t\tupdate_option( 'frm_usloc_options', $opts );\n\t\t}\n\n\t\treturn $opts['cities'];\n\t}", "public function import_Categories(){\n\n \t\t\tExcel::import(new ComponentsImport,'/imports/categories_main.csv');\n return 200;\n\n \t}", "function wc_ru_regions_add_counties( $states ) {\n\n $states['RU'] = array(\n 'AD' => 'Республика Адыгея (Адыгея)',\n 'BA' => 'Республика Башкортостан',\n 'BU' => 'Республика Бурятия',\n 'AL' => 'Республика Алтай',\n 'DA' => 'Республика Дагестан',\n 'IN' => 'Республика Ингушетия',\n 'KABA' => 'Кабардино-Балкарская Республика',\n 'KA' => 'Республика Калмыкия',\n 'KACH' => 'Карачаево-Черкесская Республика',\n 'KAR' => 'Республика Карелия',\n 'KOM' => 'Республика Коми',\n 'MAR' => 'Республика Марий Эл',\n 'MOR' => 'Республика Мордовия',\n 'SAH' => 'Республика Саха (Якутия)',\n 'SEV' => 'Республика Северная Осетия - Алания',\n 'TAT' => 'Республика Татарстан (Татарстан)',\n 'TI' => 'Республика Тыва',\n 'UD' => 'Удмуртская Республика',\n 'HA' => 'Республика Хакасия',\n 'CHE' => 'Чеченская Республика',\n 'CHU' => 'Чувашская Республика - Чувашия',\n 'ALT' => 'Алтайский край',\n 'KRD' => 'Краснодарский край',\n 'KRY' => 'Красноярский край',\n 'PRI' => 'Приморский край',\n 'STA' => 'Ставропольский край',\n 'HAB' => 'Хабаровский край',\n 'AM' => 'Амурская область',\n 'AR' => 'Архангельская область',\n 'AS' => 'Астраханская область',\n 'BE' => 'Белгородская область',\n 'BR' => 'Брянская область',\n 'VL' => 'Владимирская область',\n 'VG' => 'Волгоградская область',\n 'VOG' => 'Вологодская область',\n 'VR' => 'Воронежская область',\n 'IV' => 'Ивановская область',\n 'IR' => 'Иркутская область',\n 'KON' => 'Калининградская область',\n 'KLG' => 'Калужская область',\n 'KM' => 'Камчатский край',\n 'KE' => 'Кемеровская область',\n 'KI' => 'Кировская область',\n 'KO' => 'Костромская область',\n 'KU' => 'Курганская область',\n 'KUR' => 'Курская область',\n 'LEO' => 'Ленинградская область',\n 'LI' => 'Липецкая область',\n 'MA' => 'Магаданская область',\n 'MO' => 'Московская область',\n 'MU' => 'Мурманская область',\n 'NI' => 'Нижегородская область',\n 'NO' => 'Новгородская область',\n 'NOV' => 'Новосибирская область',\n 'OM' => 'Омская область',\n 'OR' => 'Оренбургская область',\n 'ORL' => 'Орловская область',\n 'PEN' => 'Пензенская область',\n 'PER' => 'Пермский край',\n 'PS' => 'Псковская область',\n 'RO' => 'Ростовская область',\n 'RY' => 'Рязанская область',\n 'SA' => 'Самарская область',\n 'SAR' => 'Саратовская область',\n 'SHL' => 'Сахалинская область',\n 'SV' => 'Свердловская область',\n 'SM' => 'Смоленская область',\n 'TA' => 'Тамбовская область',\n 'TV' => 'Тверская область',\n 'TO' => 'Томская область',\n 'TU' => 'Тульская область',\n 'TY' => 'Тюменская область',\n 'UL' => 'Ульяновская область',\n 'CH' => 'Челябинская область',\n 'ZA' => 'Забайкальский край',\n 'YA' => 'Ярославская область',\n 'DC' => 'г. Москва',\n 'LE' => 'Санкт-Петербург',\n 'EV' => 'Еврейская автономная область',\n 'NE' => 'Ненецкий автономный округ',\n 'HAN' => 'Ханты-Мансийский автономный округ - Югра',\n 'CHK' => 'Чукотский автономный округ',\n 'YM' => 'Ямало-Ненецкий автономный округ',\n 'KRM' => 'Республика Крым',\n 'SVS' => 'Севастополь',\n 'OTH' => 'Иные территории, включая город и космодром Байконур',\n );\n return $states;\n\n}", "public function index()\n {\n return CountyResource::collection(County::all());\n }", "public function getCountriesInfo();", "private static function import_countries_states( $opts ) {\n\t\techo absint( self::import_global_states_csv( $opts ) );\n\t}", "public function sub_county(){\r\n $response = Sub_county::all();\r\n return response()->json($response, 200);\r\n }", "function CountriesList()\n\t{\t$countries = array();\n\t\t$adminuser = new AdminUser((int)$_SESSION[SITE_NAME][\"auserid\"]);\n\t\t\n\t\t$sql = \"SELECT countries.ccode, countries.shortname, IF(toplist > 0, 0, 1) AS istoplist FROM countries ORDER BY istoplist, toplist, shortname\";\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$countries[$row[\"ccode\"]] = $row[\"shortname\"];\n\t\t\t}\n\t\t}\n\t\treturn $countries;\n\t}", "public function index()\n {\n return new CountyCollection(\n CountyResource::collection(\n County::all()\n )\n );\n }", "public function acfedu_import_preset_countries() {\n\t\t\t\tif ( isset( $_POST[\"import_actions_nonce\"] ) ) {\n\t\t\t\t\tif ( ! wp_verify_nonce( $_POST[\"import_actions_nonce\"], 'import-actions-nonce' ) ) {\n\t\t\t\t\t\t$this->acfedu_errors()->add( 'error_no_nonce_match', esc_html__( 'Something went wrong, please try again.', 'acf-faculty-selector' ) );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) || isset( $_POST['import_be'] ) || isset( $_POST['import_lux'] ) ) {\n\t\t\t\t\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\t\t\t\t\tob_start();\n\t\t\t\t\t\t\tglobal $wpdb;\n\t\t\t\t\t\t\tif ( isset( $_POST['import_be'] ) && 1 == $_POST[\"import_be\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_be.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_be' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_lux'] ) && 1 == $_POST[\"import_lux\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_lux.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_lu' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( isset( $_POST['import_nl'] ) && 1 == $_POST[\"import_nl\"] ) {\n\t\t\t\t\t\t\t\trequire_once( 'lib/import_nl.php' );\n\t\t\t\t\t\t\t\tdo_action( 'acfedu_after_success_import_nl' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = ob_get_clean();\n\t\t\t\t\t\t\tdbDelta( $sql );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function counties()\n {\n $name = County::get();\n return view('counties')->with('counties', $name);\n }", "public function listsSubcountiesget()\r\n {\r\n $response = Sub_county::get();\r\n return response()->json($response, 200);\r\n }", "public function county_sidebar()\n\t{\n\t\t$box = View::factory('iebc/sidebar');\n\t\t$box->counties = self::_counties();\n\t\t$box->render(TRUE);\n\t}", "public function listsCountiesget()\r\n {\r\n $response = County::all();\r\n return response()->json($response, 200);\r\n }", "function load_Info()\n {\n\n $this->Facility_Info($this->facilities[0]);\n }", "public function actionCountries()\n {\n $continentId = Yii::$app->request->get(\"continentId\");\n $countries = Country::getAvailable( $continentId );\n echo json_encode( $countries );\n Yii::$app->end(200);\n }", "public static function collection()\n {\n $jsoLoader = new JsonLoader(new ISO3166CountryFactory());\n\n return new Collection($jsoLoader->load(__DIR__.'/../data/iso3166.json'));\n }", "private function loadAllDistricts(){\n \n\n }", "function getSiteCountries() {\n global $dbAccess;\n $this->db = $dbAccess;\n $data = $this->db->SimpleQuery(\"SELECT * FROM \" . TBL_COUNTRIES . \" WHERE status='1' ORDER BY country_name\");\n\n return $data;\n }", "function getcountries() {\n\t\t// import the country DB\n\t\t$cntArray = array();\t \n\t\tApp::import(\"Model\",\"Country\");\n\t\t$this->Country=& new Country();\n\t\t$country = $this->Country->find('all', array('conditions'=>array('Country.status'=>'1'), 'fields'=>array('Country.id','Country.country_name')));\n\t\tforeach($country as $cat){\n\t\t\t$cntArray[$cat['Country']['id']] = $cat['Country']['country_name'];\n\t\t}\n\t\treturn $cntArray;\n\t}", "function CountriesBodyMain()\n\t{\t$this->city->InputForm();\n\t\t$this->city->LocationList();\n\t}", "abstract public function country();" ]
[ "0.6868408", "0.6443929", "0.5839611", "0.5775317", "0.56625223", "0.56458956", "0.564032", "0.5565163", "0.5555205", "0.5387053", "0.53322256", "0.53273094", "0.52688944", "0.52559817", "0.5237133", "0.5235443", "0.5147905", "0.51304775", "0.5129921", "0.5102804", "0.50817406", "0.50778425", "0.50556785", "0.50527924", "0.50385976", "0.5020199", "0.50104034", "0.50053924", "0.5004864", "0.49480274" ]
0.7752886
0
Format the instance as site date
public function toSite() { return $this->format(Config::get('settings.site_datetime_format')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formatDate() {\n\t\t\tif(!empty($this->review_date)) {\n\t\t\t\t$date = new dateTime($this->review_date);\n\t\t\t\treturn $date->format('M jS, Y - H:i');\n\t\t\t}\n\t\t}", "public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }", "private function getPublishedDate(): string\n {\n if ($this->context->get('is_term')) {\n return '';\n }\n\n if (!$this->context->get('date')) {\n return '';\n }\n\n return $this->formatIso8601($this->augmented($this->context->get('date')), false);\n }", "public function display_date(){\n\t\t$display = date('d-m-Y');\n\t\treturn $display;\n\t}", "function article_date() {\n if($created = Registry::prop('article', 'created')) {\n return $created->format('jS F, Y');\n }\n}", "public function date() {\n\n\t\t\t$output = '';\n\n\t\t\t$output['date'] = mysql2date(get_option('date_format'), $this->post->post_date);\n\t\t\t$output['time'] = mysql2date(get_option('time_format'), $this->post->post_date);\n\t\t\t$output['posted'] = sprintf(__('Posted %1$s at %2$s', 'theme translation'), mysql2date(get_option('date_format'), $this->post->post_date), mysql2date(get_option('time_format'), $this->post->post_date));\n\t\t\t$output['datetime'] = mysql2date('c', $this->post->post_date);\n\n\t\t\treturn $output;\n\t\t}", "private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }", "function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }", "function getFormattedCreatedDate()\r\n {\r\n return $this->created_at->format('d/m/y');\r\n }", "public function date();", "public function date();", "function bootstrap_posted_on() {\n\tprintf(get_the_date());\n}", "public function display_date(){\n\t\t$display = date('d/m/Y');\n\t\treturn $display;\n\t}", "function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }", "public function dateSend()\n {\n if ($this->time) {\n return $this->time->format('m/d/Y');\n }\n }", "public function getFormattedCreateDate();", "public function getFormatedDateAttribute() {\n return date('d.m.Y', strtotime($this->date));\n }", "function agilespirit_entry_date( $echo = true ) {\n if ( has_post_format( array( 'chat', 'status' ) ) )\n $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'agilespirit' );\n else\n $format_prefix = '%2$s';\n\n $date = sprintf( '<span class=\"date\">' . __('Published on ', 'agilespirit') . '<a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n esc_url( get_permalink() ),\n esc_attr( sprintf( __( 'Permalink to %s', 'agilespirit' ), the_title_attribute( 'echo=0' ) ) ),\n esc_attr( get_the_date( 'c' ) ),\n esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n );\n\n if ( $echo )\n echo $date;\n\n return $date;\n}", "public function __toString()\r\n\t{\r\n\t\treturn $this->format('l, jS F, Y');\r\n\t}", "function classiera_entry_date( $echo = true ) {\r\n\tif ( has_post_format( array( 'chat', 'status' ) ) )\r\n\t\t$format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'classiera' );\r\n\telse\r\n\t\t$format_prefix = '%2$s';\r\n\r\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\r\n\t\tesc_url( get_permalink() ),\r\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'classiera' ), the_title_attribute( 'echo=0' ) ) ),\r\n\t\tesc_attr( get_the_date( 'c' ) ),\r\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\r\n\t);\r\n\r\n\tif ( $echo )\r\n\t\techo $date;\r\n\r\n\treturn $date;\r\n}", "function get_feed_build_date($format)\n {\n }", "function getDatePublish($format = null) {\n\t\tif ($format == 'human') {\n\t\t\treturn polarbear_time2str($this->datePublish);\n\t\t} else if ($format) {\n\t\t\treturn strftime($format, $this->datePublish);\n\t\t} else {\n\t\t\treturn $this->datePublish;\n\t\t}\n\t}", "function get_short_date_format() {\n\t\tstatic $site_short_date_format = FALSE;\n\n\t\tif( !$site_short_date_format ) {\n\t\t\t$site_short_date_format = $this->getConfig( 'site_short_date_format', '%d %b %Y' );\n\t\t}\n\n\t\treturn $site_short_date_format;\n\t}", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "public function getDatePublished() {\n\t\treturn date(\"d/m/Y\", strtotime($this->datePublished));\n\t}", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }", "private function format()\n {\n return config('app.locale') != 'en' ? 'd/m/Y' : 'm/d/Y';\n }", "function getFormattedCreatedDateExtended()\r\n {\r\n return $this->created_at->format('d').\" de \".$this->getMes_ptBR((int) $this->created_at->format('m') ).\" de \".$this->created_at->format('Y') ;\r\n }", "function the_date($format = '', $before = '', $after = '', $display = \\true)\n {\n }", "function quasar_entry_date( $echo = true ) {\n\t$format_prefix = ( has_post_format( 'chat' ) || has_post_format( 'status' ) ) ? _x( '%1$s on %2$s', '1: post format name. 2: date', 'quasar' ): '%2$s';\n\n\t$date = sprintf( '<span class=\"date\"><a href=\"%1$s\" title=\"%2$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></a></span>',\n\t\tesc_url( get_permalink() ),\n\t\tesc_attr( sprintf( __( 'Permalink to %s', 'quasar' ), the_title_attribute( 'echo=0' ) ) ),\n\t\tesc_attr( get_the_date( 'c' ) ),\n\t\tesc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )\n\t);\n\n\tif ( $echo )\n\t\techo $date;\n\n\treturn $date;\n}" ]
[ "0.65940225", "0.6552656", "0.65477496", "0.6414425", "0.64141667", "0.63928205", "0.63681585", "0.6367057", "0.6319835", "0.63180554", "0.63180554", "0.63056815", "0.62869465", "0.6269225", "0.6229646", "0.6227921", "0.6227767", "0.62164235", "0.62072396", "0.6194875", "0.61861175", "0.6184569", "0.6169286", "0.61294603", "0.6126701", "0.6109276", "0.6107459", "0.61027515", "0.6098873", "0.6082422" ]
0.7498081
0
Format the instance as database date
public function toDatabase() { return $this->format(Config::get('settings.database_datetime_format')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uiToDBdate() {\r\n\r\n\t\t$month = (int) substr($this->date, -10, 2);\r\n\t\t$day = (int) substr($this->date, -7, 2);\r\n\t\t$year = (int) substr($this->date, -4, 4);\r\n\r\n\t\t$formattedDate = $year . \"-\" . $month . \"-\" . $day;\r\n\r\n\t\t$this->date = $formattedDate;\r\n\t}", "protected function dateFormatDatabase()\n {\n return $this->dateFormat('mysql');\n }", "public function getMySQLFormat()\r\n\t{\r\n\t\treturn $this->format('Y-m-d');\r\n\t}", "public function getFormattedCreateDate();", "function db_date() {\n\treturn date(\"Y-m-d H:i:s\");\n}", "public function getFormatedDateAttribute() {\n return date('d.m.Y', strtotime($this->date));\n }", "function dbToUIdate() {\r\n\t\t\r\n\t\t$year = substr($this->event_date_time, -19, 4);\r\n\t\t$month = substr($this->event_date_time, -14, 2);\r\n\t\t$day = substr($this->event_date_time, -11, 2);\r\n\r\n\t\t$this->date = $month . \"/\" . $day . \"/\" . $year;\r\n\t\r\n\t}", "public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }", "public function getDateFormatter();", "function datum($db_date) {\r\n return strftime('%d.%m.%Y', strtotime($db_date));\r\n }", "public function getFormatDateAttribute()\n {\n return Carbon::parse($this->created_at)->toDateString();\n }", "public function __toString()\r\n\t{\r\n\t\treturn $this->format('l, jS F, Y');\r\n\t}", "function getFormattedCreatedDate()\r\n {\r\n return $this->created_at->format('d/m/y');\r\n }", "public function __toString() {\n return $this->format('Y-m-d H:i');\n }", "public function __toString()\n {\n return $this->format(\"Y-m-d H:i:s\");\n }", "public function __toString()\r\n {\r\n return $this->format(DATE_MYSQL_TIMESTAMP);\r\n }", "public function getIngresoAttribute()\n {\n return strftime(\"%d/%b/%Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function dateFormat();", "public function getIngresaAttribute()\n {\n return strftime(\"%d de %B de %Y\", strtotime(date_format(date_create($this->fecha_ingreso), 'd-m-Y')));\n }", "public function getDate() : string\r\n {\r\n return $this->format('Y-m-d');\r\n }", "protected function dt(){\n return date('Y-m-d\\TH:i:s');\n }", "public function dateTimeFormat();", "public static function dateDB(){\n\t\t$day = date('d');\n\t\t$month = date('m');\n\t\t$year = date('Y');\n\n\t\t$date = $year.\"-\".$month.\"-\".$day;\n\n\t\treturn ($date);\n\t}", "public function formatValueForDatabase($value) {\n\t\tswitch ($this->type) {\n\t\t\tcase 'Date':\n\t\t\t\t/**\n\t\t\t\t * @var \\DateTime $value\n\t\t\t\t */\n\t\t\t\t$value = $value->format('Y-m-d');\n\t\t\t\tbreak;\n\n\t\t\tcase 'DateTime':\n\t\t\t\t/**\n\t\t\t\t * @var \\DateTime $value\n\t\t\t\t */\n\t\t\t\t$value = $value->format('Y-m-d H:i:s');\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $value;\n\t}", "public function formatDate() {\n\t\t\tif(!empty($this->review_date)) {\n\t\t\t\t$date = new dateTime($this->review_date);\n\t\t\t\treturn $date->format('M jS, Y - H:i');\n\t\t\t}\n\t\t}", "public function getDateFormated(){\n\t\treturn date(\"d/m/Y à\\s H:i\", strtotime($this->data));\n\t}", "public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }", "public function getRegisterDateAttribute()\n {\n //$dt->setTimestamp(date_timestamp_get($this->created_at));\n return Jalalian::forge($this->created_at)->format('%d %B، %Y');\n }", "public function toDateString()\n {\n return $this->format('Y-m-d');\n }", "public function getDateFormatee() {\n return date('d/m/Y', strtotime($this->date));\n }" ]
[ "0.71171355", "0.69076467", "0.68139815", "0.67236954", "0.6700562", "0.66888225", "0.6687653", "0.6664628", "0.6662499", "0.66290677", "0.66046023", "0.6554928", "0.65429", "0.65032023", "0.6490364", "0.64842856", "0.64805037", "0.6469689", "0.6462172", "0.64541084", "0.6423495", "0.6418627", "0.6417853", "0.64039016", "0.6400403", "0.6399687", "0.63541716", "0.6344641", "0.6317182", "0.6311817" ]
0.7022848
1
Retrieve iterator Retrieve an array copy of the object, reverse its order, and return an ArrayIterator with that reversed array.
public function getIterator() { $array = $this->getArrayCopy(); return new ArrayIterator( array_reverse($array) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reverse()\n {\n $this->dataToArray();\n $preserveKeys = (\\Sledgehammer\\is_indexed($this->data) === false);\n\n return new self(array_reverse($this->data, $preserveKeys));\n }", "public function reverse()\n {\n return new static(array_reverse($this->objects, true));\n }", "public function reverse()\n {\n $array = $this->toArray();\n return static::createFormArray(array_reverse($array), false);\n }", "public function reverse(): self\n {\n return Factory::create(array_reverse($this->items, true));\n }", "function reverse () {\r\n\t$rev = $this;\r\n $rev->edits = array();\r\n foreach ($this->edits as $edit) {\r\n $rev->edits[] = $edit->reverse();\r\n }\r\n\treturn $rev;\r\n }", "public function reverse()\n {\n return Collection::new(array_reverse($this->items));\n }", "public function getIterator()\n {\n return new ArrayIterator(static::$origin);\n }", "function reverse() {\r\n return new self(array_reverse($this->list));\r\n }", "public function reverse() {\n\t\tarray_reverse( $this->elements );\n\n\t\treturn $this;\n\t}", "public function getIterator()\n {\n return new \\ArrayObject($this->toArray());\n }", "public function getIterator()\n {\n return new ArrayObject($this->_data);\n }", "public function reverse(): CollectionInterface;", "public function reverse() {\n $rev = $this;\n $rev->edits = [];\n foreach ($this->edits as $edit) {\n $rev->edits[] = $edit->reverse();\n }\n return $rev;\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "public function descendingIterator();", "public function getIterator() {\n\t\treturn new \\ArrayObject($this->data);\n\t}", "public function reverse() {\n\t\t$clone = clone $this;\n\t\t\n\t\tif (is_array($clone->order)) {\n\t\t\tforeach ($clone->order as &$value) {\n\t\t\t\t$value[1] = $value[1] == 'DESC' ? 'ASC' : 'DESC';\n\t\t\t}\n\t\t}\n\t\t\t\n\t\t$clone->sql = null;\n\t\treturn $clone;\n\t}", "public function reverse() : Arr {\n $keys = [];\n $values = [];\n foreach($this as $k => $v) {\n $keys[] = $k;\n $values[] = $v;\n unset($this[$k]);\n }\n\n for($i = sizeof($keys) - 1; $i >= 0; --$i) {\n $this[$keys[$i]] = $values[$i];\n }\n\n return $this;\n }", "public function reversed();", "public function getIterator()\n {\n return new ArrayIterator((array)$this->data);\n }", "public function reverse(): self\n {\n $collection = clone $this;\n $collection->items = array_reverse($collection->items);\n\n return $collection;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_array);\n }", "public function reverse() {\r\n\t\t$this->collection = array_reverse($this->collection);\r\n return $this;\r\n }", "public function getIterator()\n {\n return new ArrayObject((array)$this->attributes);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->toArray());\n }", "function reverse($object);", "public function getIterator()\n {\n return new ArrayIterator($this->result);\n }", "public function inverse() : self\n {\n $a = self::identity($this->m)\n ->augmentLeft($this)\n ->rref()\n ->a()\n ->asArray();\n\n $b = [];\n\n foreach ($a as $rowA) {\n $b[] = array_slice($rowA, $this->n);\n }\n\n return self::quick($b);\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->array);\n\t}", "public function reverse()\r\n\t{\r\n\t\tarray_reverse($this->_items);\r\n\t}" ]
[ "0.7021056", "0.68084174", "0.6766576", "0.6441267", "0.63582426", "0.63489974", "0.6341495", "0.6314599", "0.63092047", "0.6288207", "0.62357295", "0.62347096", "0.6222566", "0.62205863", "0.6219842", "0.62188774", "0.62047327", "0.6183985", "0.61474586", "0.6114677", "0.6103863", "0.608569", "0.6075953", "0.60585886", "0.6058425", "0.6052383", "0.6023719", "0.6011248", "0.6007098", "0.6003154" ]
0.8103426
0
se pasan meta array para init
public function initializeByMeta($meta) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init_from_array($array)\n { \n foreach($array as $key => $val)\n { \n $this->set($key,$val);\n }\n }", "abstract public function init(array $input);", "public function __construct(){\n\t\tcall_user_func_array('parent::__construct', func_get_args());\n\n\t\t// Now we need to know if there is a \n\t\tif(!isset($this->_activeSection['entry_meta']))\n\t\t\treturn trigger_error(\"pEntryHandler needs a **entry_meta** key in its array structure.\", E_USER_ERROR);\n\n\t\t$this->_meta = $this->_activeSection['entry_meta'];\n\t}", "public function __construct(){\n\t\t\tparent::__construct(array(), \\ArrayObject::STD_PROP_LIST);\n\t\t\t$values = func_get_args();\n\t\t\tif(is_array($values) === true){\n\t\t\t\tforeach($values as $k => $v){\n\t\t\t\t\t$this[$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function __construct(){\n\t\t\tparent::__construct(array(), \\ArrayObject::STD_PROP_LIST);\n\t\t\t$values = func_get_args();\n\t\t\tif(is_array($values) === true && count($values) > 0 && is_array($values[0])){\n\t\t\t\t$values = current($values);\n\t\t\t\tforeach($values as $k => $v){\n\t\t\t\t\t$this[$k] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function init($array){\n foreach($this->params as $key=>$val){\n if(array_key_exists($key,$array)){\n if($key=='mil_labs')$array[$key] = explode(\",\",$array[$key]); \n $this->params[$key] = $array[$key];\n }else{\n throw new Exception(\"Parameter $key is required.\");\n }\n }\n $this->irrSysTypeCategory = Utility::getLookupTable('irr_sys_type_category');\n $this->counties = Utility::getLookupTable(\"fl_county\");\n}", "public function __construct($array)\n {\n if ($array !== null) {\n foreach ($array as $key => $value) {\n $this->$key = $value;\n }\n }\n }", "public function __construct( array $data = array() )\n {\n\n $this->initFromArray( $data );\n\n }", "public function init($array) {\n foreach ($this->params as $key => $val) {\n if (array_key_exists($key, $array)) {\n //if ($key == 'mil_labs')\n // $array[$key] = explode(\",\", $array[$key]);\n $this->params[$key] = $array[$key];\n } else {\n throw new Exception(\"Parameter $key is required.\");\n }\n }\n //$this->irrSysTypeCategory = Utility::getLookupTable('irr_sys_type_category');\n $this->irrSysTypes = Utility::getLookupTable('irr_sys_types');\n\n $this->counties = Utility::getLookupTable(\"fl_county\");\n\n $sql = \"select id, common_name from irr_sys_types\";\n $query_rez = MIL::doQuery($sql, MYSQL_ASSOC);\n foreach ($query_rez as $i => $value) {\n $this->irrTypes[$i] = $value;\n }\n }", "public function __construct()\n {\n $args = func_get_args();\n\n // if an array or object load using fromArray\n if (!empty($args[0]) && (Validate::isAssociativeArray($args[0]) || is_object($args[0]))) {\n $this->fromArray((array)$args[0]);\n }\n }", "public function __construct()\n {\n # no args = no further setup\n if (func_num_args() == 0) return;\n\n # use this to work out whether an arg refers to an Orm name\n $name_specified = 0;\n\n if (is_array($input = func_get_arg(0))) { # array = new object with initial values\n if (func_num_args() == 2)\n $name_specified = 1;\n\n foreach($input as $key => $val)\n $this->$key = $val;\n\n }\n\n if ($name_specified > 0) {\n $this->setup_name = func_get_arg($name_specified);\n }\n }", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function initWithObjects()\n {\n $this->array = func_get_args();\n return $this;\n }", "function __construct($array = null) {\n\t\tparent::__construct(is_array($array) || is_object($array)?$array:array());\n\t}", "public function setFromArray($array){\n\t\tif(isset($array['nome_artista'])) $this->nome_artista = $array['nome_artista'];\n\t\tif(isset($array['foto'])) $this->foto = $array['foto'];\n\t\tif(isset($array['autore'])) $this->autore = $array['autore'];\n\t\tif(isset($array['genere'])) $this->genere = $array['genere'];\n\t\tif(isset($array['data'])) $this->data = $array['data'];\n\t\tif(isset($array['stato'])) $this->stato = $array['stato'];\n\t\tif(isset($array['stato_pubblicazione'])) $this->stato_pubblicazione = $array['stato_pubblicazione'];\n\t\tif(isset($array['id'])) $this->id = $array['id'];\n\t\tif(isset($array['id_artista'])) $this->id_artista = $array['id_artista'];\n\t\tif(isset($array['descrizione'])) $this->descrizione = $array['descrizione'];\n\t\t\n\t}", "protected abstract function initItems () : array;", "public function __construct(array $data){\t\n\t\t$this->data=$data;\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($data = Array()){\n\n if(is_object($data)){\n $data = (array) $data;\n }//if\n\n if(count($data)){\n $this->data = array_merge( array_intersect_key($data, array_flip(array_keys($this->definition) ) ) );\n }//if\n\n }", "public function __construct(array $data){\n\t\t$this->data=$data;\n\t}", "public function __construct(public array $data)\n {\n }", "public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS){\r\n parent::__construct($array, $flags);\r\n }", "public function __construct()\n {\n $args = func_get_args ();\n if (empty ( $args [0] )) {\n $args [0] = array ();\n }\n $this->_data = $args [0];\n }", "abstract protected function init();", "abstract protected function init();" ]
[ "0.69540226", "0.69137", "0.6912437", "0.6900788", "0.6895575", "0.6789525", "0.6702101", "0.6676006", "0.66134125", "0.6612631", "0.6586405", "0.65515965", "0.65515965", "0.65515965", "0.65259725", "0.65152264", "0.6500054", "0.647566", "0.6461067", "0.6455454", "0.6455454", "0.6455454", "0.6455454", "0.644092", "0.6422095", "0.6393573", "0.6385884", "0.636719", "0.6355488", "0.6355488" ]
0.6933507
1
Resets the response in the container.
private function resetReponse() { $this->app->singleton("response", function () { return new Response(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resetResponse()\n\t{\n\t\t$this->_response = NULL;\n\t\t$this->_redirect = NULL;\n\t}", "public function clearResponse()\n {\n $this->responseContent = '';\n $this->responseHeader = array();\n $this->responseCode = '200 Ok';\n }", "public function clear()\n\t{\n\t\t$this->xResponse = null;\n\t}", "private function reset()\r\n {\r\n $this->last_response = null;\r\n $this->last_request = null;\r\n }", "public function reset_response()\n\t{\n\t\t$this->data = array();\n\t\t$this->last_selector = null;\n\t\t$this->merged = array();\n\t\treturn $this;\n\t}", "public function reset(): void{\n curl_reset($this->handler);\n }", "public function rewind(): void\n {\n \\reset($this->responseData->_embedded->items);\n }", "public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }", "public function reset()\n {\n $this->status_code = null;\n $this->header_fields = array();\n $this->response_cookies = array();\n $this->etag_type = null;\n $this->jsonp_query_string = null;\n $this->response_file = null;\n $this->response_content = null;\n return $this;\n }", "protected function reset()\n {\n $this->lastRequest = null;\n $this->lastResponse = null;\n $this->lastException = null;\n }", "public function reset()\n {\n try {\n $this->resetBiz->reset();\n return $this->createResponse(Response::HTTP_OK, 'OK');\n } catch (\\Exception $ex) {\n return $this->createResponse(Response::HTTP_INTERNAL_SERVER_ERROR);\n }\n }", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function reset() {}", "public function flushResponses()\n {\n self::$bxClient->flushResponses();\n self::$bxClient->resetRequests();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_REWARDS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_SERVER_INFO] = array();\n }", "public static function reset()\n {\n $container = static::getInstance();\n $container->values = array();\n $container->factories = array();\n $container->raw = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "public function reset()\n {\n $this->values[self::_RESULT] = null;\n $this->values[self::_CHANNEL] = null;\n $this->values[self::_CONTENTS] = array();\n }", "protected function reset() {}", "protected function reset() {}", "protected function reset() {}" ]
[ "0.7655662", "0.74203575", "0.7101546", "0.7092691", "0.6951228", "0.68167794", "0.67838687", "0.6650524", "0.6638022", "0.6560254", "0.6556008", "0.6511103", "0.6511103", "0.6511103", "0.6511103", "0.6511103", "0.6511103", "0.6511103", "0.6511048", "0.6511048", "0.6511048", "0.65039945", "0.64804167", "0.6455609", "0.6409131", "0.6408925", "0.6408487", "0.63964087", "0.6396311", "0.6395729" ]
0.7732364
0
List all the snippets
public function index() { $snippets = $this->snippetService->getAll(); return response()->json($snippets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n\t{\n\t\t$snippets = Snippet::paginate(10);\n\t\t// return $snippets;\n\t\treturn View::make('admin.snippets')\n\t\t\t->with('snippets', $snippets);\n\t}", "public function getIndex()\n {\n $page = Input::get('page', 1);\n\n // Candidate for config item\n $perPage = 10;\n\n $pagiData = $this->snippet->byPage($page, $perPage);\n $snippets = Paginator::make($pagiData->items, $pagiData->totalItems, $perPage);\n return View::make('snippets.index', compact('snippets'));\n }", "public function loadSnippets()\n\t{\n\t\t$fresh = ee('Model')->make('Snippet')->loadAll();\n\n\t\tif ($fresh->count() > 0)\n\t\t{\n\t\t\t$snippets = $fresh->getDictionary('snippet_name', 'snippet_contents');\n\n\t\t\t// Thanks to @litzinger for the code suggestion to parse\n\t\t\t// global vars in snippets...here we go.\n\n\t\t\t$var_keys = array();\n\n\t\t\tforeach (ee()->config->_global_vars as $k => $v)\n\t\t\t{\n\t\t\t\t$var_keys[] = LD.$k.RD;\n\t\t\t}\n\n\t\t\t$snippets = str_replace($var_keys, ee()->config->_global_vars, $snippets);\n\n\t\t\tee()->config->_global_vars = ee()->config->_global_vars + $snippets;\n\n\t\t\tunset($snippets);\n\t\t\tunset($fresh);\n\t\t\tunset($var_keys);\n\t\t}\n\t}", "public function index(){\n\n\t\t$snippets = array();\n\t\tforeach (Snippet::orderBy('updated_at','desc')->get() as $snippet) {\t\t//条件付けのときは->get()が必要\n\t\t\t$temp = $snippet->toArray();\n\t\t\t$temp[\"updated_at\"] = $this->convertToUserView($temp[\"updated_at\"]);\n\t\t\t$temp[\"tags\"] = $snippet->tags()->getResults()->toArray();\n\n\t\t\tarray_push($snippets, $temp); \n\t\t}\n\t\t\n\t\treturn Response::json($snippets);\n\t}", "public static function getCollection(): array {\n\t\treturn self::$snippets;\n\t}", "function listContent()\n {\n }", "public function listing();", "public function snippets()\n {\n return $this->hasMany(Snippet::class);\n }", "public function search()\n\t{\n\t\t$snippets = Snippet::where( 'title', 'LIKE', '%'.Input::get('search').'%')->paginate(10);\n\n\t\treturn View::make('admin.snippets')\n\t\t\t->with('snippets', $snippets );\n\t}", "public static function snippet_start() {\r\n\t\tself::$snippet = array();\r\n\t}", "public function story_list()\n\t{\n\t\t$data['page']='Story List';\n\t\t$data['stories_list']=$this->stories->get_all();\n\t\t$view = 'admin/stories/admin_stories_list_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "function snippets_read() {\n try {\n $app = Slim\\Slim::getInstance();\n\n $filter = $app->request->params('filter'); // name snippets\n $ext = $app->request->params('name'); // name snippets\n $filter_content = $app->request->params('filter_content');\n\n $page = $app->request->params('page'); // Param from pagination\n $rows = $app->request->params('rows'); // Param from pagination\n\n if ($page <= 1) {\n $da = 1;\n $a = $rows;\n } else {\n $da = ($page - 1) * $rows;\n $da = $da + 1;\n $a = $page * $rows;\n }\n\n $gii = new easyuigii();\n $data = $gii->list_file_for_snippets($filter, $ext, $filter_content);\n\n //for pagination\n $ar = [];\n $riga = 1;\n foreach ($data as $value) {\n $riga += 1;\n if (($riga >= $da) && ($riga <= $a)) {\n $ar[] = $value;\n }\n }\n $result['rows'] = $ar;\n $result['total'] = Count($data);\n\n\n $app->response()->body(json_encode($result));\n\n ($gii->debug_on_file) ? error_log(logTime() . basename(__FILE__) . \" \" . __FUNCTION__ . PHP_EOL, 3, 'logs/fn.log') : false;\n } catch (Exception $e) {\n $app->render(200, ['isError' => true, 'msg' => $e->getMessage()]);\n error_log(LogTime() . 'error - list file snippets ' . PHP_EOL, 3, 'logs/error.log');\n }\n}", "function listing() {\r\n\r\n }", "public function list();", "public function list();", "public function list();", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}", "public function listAll()\n {\n }", "private function _get_snippets( $project ) {\n\n\t\t$request = new Gitlab();\n\t\t$gitlab = $request->init_request();\n\n\t\t$snippets = [];\n\t\t$page_index = 1;\n\t\t$total = 0;\n\n\t\tdo {\n\n\t\t\t$response = $gitlab->get( 'projects/' . $project['id'] . \"/snippets?per_page=50&page=$page_index&sort=asc\" );\n\t\t\t$response_arr = json_decode( $response->body, true );\n\n\t\t\t$snippets = array_merge( $snippets, $response_arr );\n\n\t\t\t$page_index++;\n\t\t\t$total += count( $response_arr );\n\n\t\t} while ( count( $response_arr ) > 0 );\n\n\t\treturn $snippets;\n\n\t}", "public function canManageSnippets();", "public function getGroupSnippets(): array\n {\n return GlobalSnippets::$plugin->snippets->getSnippetsByGroup($this->id);\n }", "public function showall()\n {\n }", "public function listAll();", "public function listAll();", "public function knowledgeshareviewall(){\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/knowledgesharelist';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Courses Knowledge chat room list',\n\t\t\t'knowledge_box'=> $this->setting_model->Get_All('knowledge_box'),\n\t\t\t'knowledge_box_main' => $this->setting_model->Get_All('knowledge_box_main'),\n\t\t\t'course' => $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function getAllTagsAction()\n {\n $tags = $this->storedTagsAction();\n\n $this->views->add('comment/tags_list', [\n 'title' => \"Taggar\",\n 'tags' => $tags\n ]);\n }", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "function index() {\n\t\t$this->show_list();\n\t}", "public function view_all()\n {\n return \"This is all readers\";\n }" ]
[ "0.72572434", "0.68453556", "0.68147707", "0.649023", "0.635779", "0.62695175", "0.62685084", "0.6193557", "0.6187358", "0.6124792", "0.6038486", "0.599076", "0.59615505", "0.58438814", "0.58438814", "0.58438814", "0.5839735", "0.5753365", "0.57229304", "0.5722901", "0.56918806", "0.56902975", "0.5681956", "0.5670135", "0.5670135", "0.56617606", "0.5645488", "0.5616851", "0.5566391", "0.5564994" ]
0.70880896
1
/ function check if user is sorted in db or not and if sorted update his info $helper> get form facebook api $FB>get form facebook api
public function FacebookLogin($helper,$FB) { $db = new DB(); $accessToken = $helper->getAccessToken(); $oAuth2Client = $FB->getOAuth2Client(); if(!$accessToken->isLongLived()) { $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken); } $response = $FB->get("/me?fields=id,first_name,last_name,gender,email,link,picture.type(large)",$accessToken); $userData=$response->getGraphNode()->asArray(); $gpUserData = array( 'oauth_provider'=> 'facebook', 'oauth_uid' => $userData['id'], 'first_name' => $userData['first_name'], 'last_name' => $userData['last_name'], 'email' => $userData['email'], 'gender' => $userData['gender'], 'picture' => $userData['picture']['url'], 'link' => $userData['link'] ); if(!empty($gpUserData)){ //Check whether user data already exists in database $querySelect = "SELECT * FROM ".$this->userTbl." WHERE oauth_provider = '".$gpUserData['oauth_provider']."' AND oauth_uid = '".$gpUserData['oauth_uid']."'"; $result = $db->prepare($querySelect); $result->execute(); if($result->rowCount() > 0){ //Update user data if already exists $queryUpdate = "UPDATE ".$this->userTbl." SET first_name = '".$gpUserData['first_name']."', last_name = '".$gpUserData['last_name']."', email = '".$gpUserData['email']."', gender = '".$gpUserData['gender']."', picture = '".$gpUserData['picture']."', link = '".$gpUserData['link']."' WHERE oauth_provider = '".$gpUserData['oauth_provider']."' AND oauth_uid = '".$gpUserData['oauth_uid']."'"; $update = $db->prepare($queryUpdate); $update->execute(); }else{ //Insert user data $queryInsert = "INSERT INTO ".$this->userTbl." SET oauth_provider = '".$gpUserData['oauth_provider']."', oauth_uid = '".$gpUserData['oauth_uid']."', first_name = '".$gpUserData['first_name']."', last_name = '".$gpUserData['last_name']."', email = '".$gpUserData['email']."', gender = '".$gpUserData['gender']."', picture = '".$gpUserData['picture']."', link = '".$gpUserData['link']."'"; $insert = $db->prepare($queryInsert); $insert->execute(); } //Get user data from the database $result = $db->prepare($querySelect); $result->execute(); $gpUserData = $result->fetchAll(); } //close db connection $db = NULL; //Return user data return $gpUserData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function facebook_user_check($email,$firstname,$lastname,$oauth_uid,$username) \n { \n \n $sql = \"SELECT id,username,activated FROM $this->user_table WHERE email = ? and activated = ? and oauth_uid = ? \"; \n\t $query = $this->db->query($sql,array($email,1,$oauth_uid)); \n \n\t\tif ($query->num_rows()==1) \n\t\t{\n\t\t foreach($query->result_array() as $r)\n {\n $stored_id = $r['id'];\n\t\t\t $stored_username = $r['username'];\n\t\t\t $stored_activation = $r['activated'];\n }\n $data = array(\n\t\t\t 'user_id' => $stored_id,\n\t\t\t 'username' => $stored_username, \n\t\t\t 'status'\t => $stored_activation, \n 'oauth_provider'\t=> 'facebook' \t\t\t \n\t\t\t);\n return $data; \t \n } \n else \n { \n $user_data = array(\n\t\t 'username' => $username,\n\t\t\t'firstname' => $firstname,\n\t\t\t'lastname' => $lastname,\n\t\t\t'email' => $email,\n\t\t\t'activated' => 1,\n\t\t\t'new_email_key' => NULL,\n\t\t\t'last_ip' => $this->input->ip_address(),\n\t\t\t'last_login' => date(\"Y-m-d H:i:s\"),\n\t\t\t'oauth_uid' => $oauth_uid,\n\t\t\t'oauth_provider' => 'facebook' \n\t\t );\n //---------Insert User Credentials------------\t\n\t\t\t\n\t\t\t$this->db->insert($this->user_table,$user_data);\n $current_id = $this->db->insert_id();\n\t\t\t\n\t\t\t//-------- Insert User Profile Data ----------\n\t\t\t\n\t\t\t$profile_data = array(\n\t\t\t 'user_id' => $current_id,\n\t\t\t);\n\t\t\t$this->db->insert($this->user_profile_table,$profile_data);\n $data = array(\n\t\t\t 'user_id' => $current_id,\n\t\t\t 'username' => $username, \n\t\t\t 'status'\t => 1,\n 'oauth_provider'\t=> 'facebook' \t\t \n\t\t\t);\n return $data; \t\t\t\n } \n }", "function NewSorting($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$rec = self::findSortingDatas($username);\r\n\t\t$flag = $rec['flag'];\r\n\t\t$gender = $rec['gender'];\r\n\t\t$birthday = $rec['birthday'];\r\n\t\t$city = $rec['city'];\r\n\t\t$count = $rec['count1'];\r\n\t\t$isactive = $rec['isactive'];\r\n\t\tif($count>=1){ self::shiftSorting($username);}\r\n\t\tif($isactive==1){\r\n\t\t\t$count = self::findSortingCount($username);\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_COUNT.\"=\".TABLE_MEMBER_COUNT.\"+1\r\n\t\t\t\t\t\tWHERE \".TABLE_MEMBER_COUNT.\" >= $count\r\n\t\t\t\t\t\t\tAND \".TABLE_MEMBER_CITY.\" = '$city'\r\n\t\t\t\t\t\t\tAND \".TABLE_MEMBER_GENDER.\" = '$gender'\";\r\n\t\t\tDBconnect::execute_q($sql);\r\n\t\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_COUNT.\"= $count WHERE \".TABLE_MEMBER_USERNAME.\"= '$username'\";\r\n\t\t\tDBconnect::execute_q($sql);\r\n\t\t}\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 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 insertUpdate($user_args) {\n\t\t$success = false;\n\t\tif (count($user_args) < 3) {\n\t\t\t$this->logger->log(\"Too few arguements passed to insert update!\",Zend_Log::INFO);\n\t\t\treturn null;\n\t\t}\n\t\tif($this->dbHandle == null) {\n\t\t\t$this->logger->log(\"Error in fetching DB handler.\",Zend_Log::INFO);\n\t\t\treturn null;\n\t\t}\n\t\t$collection = $this->dbHandle->updates;\n\t\t$search = new SearchUser();\n\t\t$client= new GearmanClient();\n\t\t$client->addServer();\n\t\t$fbid = $search->getFBIDFromUID($user_args['uid']);\n\t\tif ($fbid == null){\n\t\t\treturn false;\n\t\t}\n\t\t$user_args['fbid'] = $fbid;\n\t\t$update_table_args = $user_args;\n\t\t$update_table_args['created_on'] = new MongoDate($user_args['created_on']);\n\t\t$handler = new CheckinPointsHandler($user_args);\n\t\t$return = array();\n\t\t$pointsForCheckin = true;\n\t\t$shareOnFacebook = false;\n\t\tif (isset($user_args['shareOnFacebook'])){\n\t\t\t$flag = $user_args['shareOnFacebook'];\n\t\t\t$this->logger->log(\"share on facebook : $flag\",Zend_Log::INFO);\n\t\t\tif ($flag == \"true\"){\n\t\t\t\t$shareOnFacebook = true;\n\t\t\t}\n\t\t}\n\t\tif ($handler->isValidCheckin()){\n//\t\tif (true){\n\t\t\t$this->logger->log(\"valid checkin for points\",Zend_Log::INFO);\n\t\t\t$return = $handler->getCheckintype();\n\t\t}\n\t\telse{\n\t\t\t$this->logger->log(\"no points for this checkin\",Zend_Log::INFO);\n\t\t\t$return['details'] = array();\n \t$return['points'] = 0;\n\t\t\t$pointsForCheckin = false;\n\t\t\treturn $return;\n\t\t}\n\t\t$update_table_args['meta'] = array('score' => $return);//add the points details for the checkin.\n\t\t$this->logger->log(var_export($return, true),Zend_Log::INFO);\n\t\t$success = $collection->insert($update_table_args);\n\t\tif (isset($success)) {\n\t\t\tif ($success != false) {\n\t\t\t\tif ($pointsForCheckin){\n\t\t\t\t\t$points = array('uid' => $user_args['uid'], 'points' => $return['points'], 'ts' => $user_args['created_on']);\n\t\t\t\t\t$points_job = $client->doBackground(\"UpdateUserPointsV4\", json_encode($points));\n\t\t\t\t\t$this->logger->log(\"update user points job id = $points_job\", Zend_Log::INFO);\n\t\t\t\t}\n\t\t\t\tif ($shareOnFacebook){\n\t\t\t\t\t$post_fb_job = $client->doBackground(\"PostTofacebookWallV4\", json_encode ($user_args));\n\t\t\t\t\t$this->logger->log(\"checking notifiy job id = $post_fb_job\", Zend_Log::INFO);\n\t\t\t\t}\n\t\t\t\t$update_job = $client->doBackground(\"UpdateUserTableForCheckinV4\", json_encode ($user_args));\n\t\t\t\t$timing_job = $client->doBackground(\"UpdateTimingsTableForCheckinV4\", json_encode ($user_args));\n\t\t\t\t$notify_job = $client->doBackground(\"SendCheckinNotificationsV4\", json_encode ($user_args));\n\t\t\t\t$this->logger->log(\"user table update job id = $update_job\", Zend_Log::INFO);\n\t\t\t\t$this->logger->log(\"timings table update job id = $timing_job\", Zend_Log::INFO);\n\t\t\t\t$this->logger->log(\"checking notifiy job id = $notify_job\", Zend_Log::INFO);\n\t\t\t\t$operation = $return;\n\t\t\t}\n\t\t}\n\t\treturn $operation;\n\t}", "function shiftSorting($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$rec = self::findSortingDatas($username);\r\n\t\t$flag = $rec['flag'];\r\n\t\t$gender = $rec['gender'];\r\n\t\t$birthday = $rec['birthday'];\r\n\t\t$count = $rec['count1'];\r\n\t\t$city = $rec['city'];\r\n\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_COUNT.\"= 0 WHERE \".TABLE_MEMBER_USERNAME.\"= '$username'\";\r\n\t\tDBconnect::execute_q($sql);\r\n\t\t$sql = \"UPDATE \".TABLE_MEMBER.\" SET \".TABLE_MEMBER_COUNT.\"=\".TABLE_MEMBER_COUNT.\"-1\r\n\t\t\t\t\tWHERE \".TABLE_MEMBER_COUNT.\"> $count\r\n\t\t\t\t\t\tAND \".TABLE_MEMBER_CITY.\" = '$city'\r\n\t\t\t\t\t\tAND \".TABLE_MEMBER_GENDER.\" = '$gender'\";\r\n\t\treturn DBconnect::execute_q($sql);\r\n\t}", "function userSort($type, $num) {\r\n\t\tglobal $db_uidblacklist;\r\n\t\t$ifOverflow = 0;\r\n\t\t$marktype = $this->_getUserMark();\r\n\t\tif (!in_array($type, $marktype) && !is_numeric($type)) return false;\r\n\t\t$num = (int) $num;\r\n\t\t!$num && $num = $this->cachenum;\r\n\t\t$this->reality == true && require_once (R_P . 'require/showimg.php');\r\n\r\n\t\t$sqladd = $this->_getBlackList('md.uid', $db_uidblacklist);\r\n\t\tif (in_array($type, array('postnum','onlinetime','rvrc','money','credit','currency','digests'))) {\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.$type as value,m.username as addition FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.postnum>0{$sqladd} ORDER BY md.$type DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.$type as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.postnum>0{$sqladd} ORDER BY md.$type DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'f_num') {\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid AS id, COUNT(*) AS value, m.username AS addition FROM pw_friends md LEFT JOIN pw_members m USING(uid) WHERE 1{$sqladd} GROUP BY md.uid ORDER BY value DESC\" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid, COUNT(*) AS value, m.username, m.icon, m.gender, m.groupid, m.memberid FROM pw_friends md LEFT JOIN pw_members m USING(uid) WHERE 1{$sqladd} GROUP BY md.uid ORDER BY value DESC\" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'todaypost') {\r\n\t\t\t$tdtime = PwStrtoTime(get_date($GLOBALS['timestamp'], 'Y-m-d'));\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.todaypost as value,m.username as addition FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastpost>\" . S::sqlEscape($tdtime) . \" AND md.postnum>0{$sqladd} ORDER BY md.todaypost DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.todaypost as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastpost>\" . S::sqlEscape($tdtime) . \" AND md.postnum>0{$sqladd} ORDER BY md.todaypost DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'monthpost') {\r\n\t\t\t$montime = PwStrtoTime(get_date($GLOBALS['timestamp'], 'Y-m') . '-1');\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.monthpost as value,m.username as addition FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastpost>\" . S::sqlEscape($montime) . \" AND md.postnum>0{$sqladd} ORDER BY md.monthpost DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.monthpost as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastpost>\" . S::sqlEscape($montime) . \" AND md.postnum>0{$sqladd} ORDER BY md.monthpost DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'monoltime') {\r\n\t\t\t$montime = PwStrtoTime(get_date($GLOBALS['timestamp'], 'Y-m') . '-1');\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.monoltime as value,m.username as addition FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastvisit>\" . S::sqlEscape($montime) . \" AND md.postnum>0{$sqladd} ORDER BY md.monoltime DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.monoltime as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_memberdata md LEFT JOIN pw_members m USING(uid) WHERE md.lastvisit>\" . S::sqlEscape($montime) . \" AND md.postnum>0{$sqladd} ORDER BY md.monoltime DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif (is_numeric($type) && $GLOBALS['_CREDITDB'][$type]) {\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.value,m.username as addition FROM pw_membercredit md LEFT JOIN pw_members m USING(uid) WHERE md.cid=\" . S::sqlEscape($type) . \"$sqladd ORDER BY md.value DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_membercredit md LEFT JOIN pw_members m USING(uid) WHERE md.cid=\" . S::sqlEscape($type) . \"$sqladd ORDER BY md.value DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'newUser') {\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,md.uid as value,m.username as addition FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) ORDER BY m.uid DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,md.uid as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) ORDER BY m.uid DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} elseif ($type == 'postMostUser') {\r\n\t\t\tglobal $timestamp;\r\n\t\t\t$sqlAdd = '';\r\n\t\t\t$week = $timestamp - 3600*24*7;\r\n\t\t\t$sqlAdd .= \" t.postdate BETWEEN $week AND $timestamp\";\r\n\t\t\t$sqlAdd .= \" AND (tpcstatus & 16) = 16 \";\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$sql = \"SELECT md.uid as id,COUNT(*) as value,m.username as addition FROM pw_threads t LEFT JOIN pw_members m ON t.authorid = m.uid LEFT JOIN pw_memberdata md USING(uid) WHERE $sqlAdd GROUP BY t.authorid ORDER BY value DESC \" . S::sqlLimit($num);\r\n\t\t\t} else {\r\n\t\t\t\t$sql = \"SELECT md.uid,COUNT(*) as value,m.username,m.icon,m.gender,m.groupid,m.memberid FROM pw_threads t LEFT JOIN pw_members m ON t.authorid = m.uid LEFT JOIN pw_memberdata md USING(uid) WHERE $sqlAdd GROUP BY t.authorid ORDER BY value DESC \" . S::sqlLimit($num);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$member = array();\r\n\t\t$query = $this->db->query($sql);\r\n\t\twhile ($rt = $this->db->fetch_array($query)) {\r\n\t\t\tif ($rt['value']>PW_OVERFLOW_NUM) $ifOverflow = 1;\r\n\t\t\tif ($type == 'rvrc') {\r\n\t\t\t\t$rt['value'] = floor($rt['value'] / 10);\r\n\t\t\t} elseif ($type == 'onlinetime' || $type == 'monoltime') {\r\n\t\t\t\t$rt['value'] = floor($rt['value'] / 3600);\r\n\t\t\t}\r\n\t\t\tif ($this->reality == false) {\r\n\t\t\t\t$rt['type'] = 'usersort';\r\n\t\t\t\t$rt['mark'] = $type;\r\n\t\t\t\t$member[] = $rt;\r\n\t\t\t} else {\r\n\t\t\t\t$tem = array();\r\n\t\t\t\t$tem['url'] = USER_URL . $rt['uid'];\r\n\t\t\t\t$tem['uid'] = $rt['uid'];\r\n\t\t\t\t$tem['title'] = $rt['username'];\r\n\t\t\t\t$tem['value'] = $rt['value'];\r\n\t\t\t\tif (!$rt['icon']) {\r\n\t\t\t\t\tswitch ($rt['gender']) {\r\n\t\t\t\t\t\tcase 0 :\r\n\t\t\t\t\t\t\t$rt['icon'] = 'none.gif|1|||';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 1 :\r\n\t\t\t\t\t\t\t$rt['icon'] = '2.gif|1|||';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 2 ;\r\n\t\t\t\t\t\t\t$rt['icon'] = '0.gif|1|||';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t$rt['icon'] = 'none.gif|1|||';\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$pic = showfacedesign($rt['icon'], true);\r\n\t\t\t\tif (is_array($pic)) {\r\n\t\t\t\t\t$tem['image'] = $pic[0];\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$tem['image'] = '';\r\n\t\t\t\t}\r\n\t\t\t\t$tem['addition'] = $rt;\r\n\t\t\t\t$member[] = $tem;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($ifOverflow && $this->_excuteOverflow($type)) {\r\n\t\t\treturn $this->userSort($type,$num);\r\n\t\t}\r\n\t\treturn $member;\r\n\t}", "function index()\r\n{\r\n\tif(!isset($_GET['search']))\r\n\t\t$_GET['search']=\"NULL\";\r\n\tif(!isset($_GET['paging']))\r\n\t\theader(\"location: /gadmin/user/?paging=1&search=\".$_GET['search']);\r\n\t//preparing to query\r\n\t$max_results=10;\r\n\t$arr_get=array(\r\n\t\t\t\"status_not\" => \"delete\"\r\n\t);\r\n\t$order=array(\r\n\t\t\t\"by\" => \"date_created\",\r\n\t\t\t\"sort\" => \"DESC\"\r\n\t);\r\n\t$limit=array(\r\n\t\t\t\"start\" => (($_GET['paging']*$max_results)-$max_results),\r\n\t\t\t\"end\" => $max_results\r\n\t);\r\n\t//setting search\r\n\tif($_GET['search']!=\"NULL\")\r\n\t\t$arr_get['search']=\"%\".$_GET['search'].\"%\";\r\n\t//assigning variables\r\n\t$users=User::get($arr_get, true, $order, $limit);\r\n\tforeach($users as $user)\r\n\t{\r\n\t\t$par1=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tnext($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$par2=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tprev($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$user->params=\"\";\r\n\t\tif(isset($par1))\r\n\t\t\t$user->params=$user->params.$par1->value;\r\n\t\tif(isset($par2))\r\n\t\t\t$user->params=$user->params.\" \".$par2->value;\r\n\t\t$credit=MetaUser::get(array(\"id_user\" => $user->id, \"name\" => \"credit\"));\r\n\t\tif(isset($credit))\r\n\t\t\t$user->credit=$credit->value;\r\n\t\telse\r\n\t\t\t$user->credit=0;\r\n\t}\r\n\t$GLOBALS['GCMS']->assign('users', $users);\r\n\t$GLOBALS['GCMS']->assign('paging', ceil(User::get_count($arr_get)/$max_results));\r\n}", "function feuserloginsystem_updateUserStatisticEntry() {\r\n\r\n # Get existing statistic information for the current user and session.\r\n $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\r\n\t\t\t'uid,feuserid,sessionstart,lastpageview,pagecounter,pagetracking',\r\n\t\t\t'tx_feuserloginsystem_userstatistics',\r\n\t\t\tsprintf('feuserid=\\'%s\\'',addslashes(intval($this->fe_user->user[\"uid\"]))),\r\n\t\t\t'',\r\n\t\t\t'sessionstart DESC',\r\n\t\t\t'1'\r\n \t);\r\n \t$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);\r\n\r\n \t# Existing statistic information could be found.\r\n \tif(is_array($row)) {\r\n\r\n $timeStamp = time();\r\n\r\n # Unserialize page tracking information.\r\n $pagetrackingArray = unserialize($row['pagetracking']);\r\n # Add new page tracking information to the already existing page tracking information.\r\n $pagetrackingArray[] = array('time' => $timeStamp, 'pageID' => intval($this->id));\r\n\r\n\t\t\t#Update commom information for statistics.\r\n\t\t $insertDataArray = array();\r\n\t\t $insertDataArray['lastpageview'] = $timeStamp;\r\n\t\t $insertDataArray['pagecounter'] = intval($row['pagecounter'] + 1);\r\n\t\t $insertDataArray['pagetracking'] = serialize($pagetrackingArray);\r\n\r\n\t\t # Update statistic information in the database.\r\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\r\n 'tx_feuserloginsystem_userstatistics',\r\n sprintf('uid=\\'%s\\'',addslashes(intval($row['uid']))),\r\n $insertDataArray\r\n );\r\n\r\n }\r\n\r\n }", "public function handleFacebookCallback()\n {\n \n $user = Socialite::driver('facebook')->user();\n\n \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}", "private function _paginateWithSorting($uID, $limit = 7, $approved = 1)\n {\n try{\n $this->paginate['UserFriend']['joins'] = array(\n array(\n 'table' => 'bs_users',\n 'alias' => 'Friend',\n 'type' => 'left',\n 'conditions' => array('UserFriend.friend_id = Friend.id'),\n ),\n array(\n 'table' => 'bs_user_infos',\n 'alias' => 'UserInfo',\n 'type' => 'left',\n 'conditions' => array('Friend.id = UserInfo.user_id'),\n ),\n array(\n 'table' => 'bs_countries',\n 'alias' => 'UserCountry',\n 'type' => 'left',\n 'conditions' => array('UserInfo.country_id = UserCountry.id'),\n ),\n array(\n 'table' => 'bs_user_private_infos',\n 'alias' => 'UserPrivateInfo',\n 'type' => 'left',\n 'conditions' => array('UserPrivateInfo.user_id = Friend.id'),\n )\n );\n $this->paginate['UserFriend']['conditions'] = array(\n 'UserFriend.user_id' => $uID,\n 'UserFriend.approved' => $approved,\n// 'Friend.id <>' => null,\n );\n $this->paginate['UserFriend']['fields'] = '*';\n $this->paginate['UserFriend']['limit'] = $limit;\n $this->paginate['UserFriend']['order'] = array('UserInfo.first_name');\n $this->paginate['UserFriend']['recursive'] = 2;\n $this->UserFriend->unbindModel(\n array(\n 'belongsTo' => array('Friend')\n ), false\n );\n $data = $this->paginate('UserFriend');\n } catch (Exception $e) {\n $data = false;\n }\n\n return $data;\n\n }", "public function update()\n {\n $r = false;\n $vars = $this->container->getSiteInstance()->getVariables();\n if (!$vars->hasKey('facebook_number_of_likes')) {\n $r = true;\n }\n if ($vars->getValue('facebook_number_of_likes') != ($n = $this->getRemoteNumberOfLikes())) {\n $r = true;\n $vars->setValue('facebook_number_of_likes', $n);\n }\n if ($this->initializeIdList() && ($l = $this->getRemoteIdList()) != $this->id_list) {\n $r = true;\n $this->initializeIdList($l);\n }\n\n $status = $this->getStatus();\n while ($status != null) {\n if ($status->update()) {\n $r = true;\n }\n\n $status = $status->getNextStatus();\n }\n\n return $r;\n }", "private function _get_users_data(){ \r\n $this->db->select('*'); \r\n $this->db->from('suggestions');\r\n\t\t$this->db->order_by('suggestion_id', 'desc');\t\r\n }", "public function updateFacebookUser()\n {\n $jsonHelper = new JsonResponseHelper;\n \n\n // fail if we don't have a user id\n if (!Input::has('facebookId'))\n {\n return $jsonHelper->failJson('Missing input');\n }\n \n $facebookId = Input::get('facebookId');\n $facebookName = Input::get('facebookName');\n $facebookAccessToken = Input::get('facebookAccessToken');\n $facebookFirstName = Input::get('facebookFirstName');\n \n if ($facebookId == NULL)\n {\n return $jsonHelper->failJson(\"Null input: \" . $facebookId );\n }\n \n if ($facebookId < 5)\n {\n return $jsonHelper->failJson(\"Facebook Id cannot be zero\");\n }\n \n \n // set user id\n $user = User::firstOrNew(array(\n 'id' => $facebookId\n ));\n\n $user->id = $facebookId; \n\n $infoUpdated = 1;\n \n $user->save();\n \n if (!Auth::check())\n {\n Auth::loginUsingId($facebookId);\n }\n\n // if facebook FirstName was given, update that\n if (Input::has('facebookFirstName'))\n {\n if($facebookFirstName != 'null')\n {\n $infoUpdated += 100;\n Auth::user()->first_name = $facebookFirstName;\n Auth::user()->save();\n }\n }\n \n // update name if we have it\n if (Input::has('facebookName'))\n {\n // ensure value isn't null\n if ($facebookName == null)\n {\n return $jsonHelper->failJson(\"Invalid name\");\n }\n $infoUpdated += 2;\n\n $user->name = $facebookName;\n $user->save();\n }\n \n // set facebook access token\n if (Input::has('facebookAccessToken'))\n {\n \n // ensure value isn't null\n if ($facebookAccessToken == null)\n {\n if (strlen($facebookAccessToken > 0))\n {\n return $jsonHelper->failJson(\"Invalid access token\");\n \n }\n \n }\n \n // try to extend the access token\n // get new session\n $fbHelper = new FacebookHelper;\n $session = $fbHelper->getSessionWithToken($facebookAccessToken);\n // try to extend token\n \n if ($session)\n { \n $checkAccessToken = $session->getAccessToken();\n if ($checkAccessToken == $facebookAccessToken)\n {\n $longLivedAccessToken = $checkAccessToken->extend();\n if ($longLivedAccessToken != NULL)\n {\n if (strlen($longLivedAccessToken) > 5)\n {\n $infoUpdated += 20;\n $facebookAccessToken = $longLivedAccessToken;\n }\n }\n }\n }\n \n \n $infoUpdated += 4;\n Auth::user()->fb_token = $facebookAccessToken;\n Auth::user()->save();\n } \n \n // log the user in to the system;\n //Auth::login($user);\n \n if (Auth::check())\n {\n $infoUpdated += 10;\n }\n\n if ($facebookName != null)\n {\n // this is an attempt to solve persistance problem \n // that makes returning regular json_encode data\n // not persist, which is critical for login to work\n return Response::json(array(\"status\"=>\"SUCCESS\",\n \"detailedStatus\" => 'Updated user info ' . $infoUpdated,\n 'facebook_name' => $facebookName\n ));\n }\n else if ($facebookAccessToken != null)\n {\n return array(\"status\"=>\"SUCCESS\",\n \"detailedStatus\" => 'Updated user info ' . $infoUpdated,\n 'facebook_token' => $user->fb_token\n );\n }\n return array(\n \"status\" => \"SUCCESS\",\n \"detailedStatus\" => 'Updated user info ' . $infoUpdated\n );\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 FirstTimeProfileCheck(){\n\t\t\t\t$checkheader=$this->db->prepare(\"SELECT verified_status FROM users WHERE id=:id AND status=1 AND verified_status=2\");\n\t\t\t\t$user_id=isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;\n\t\t\t\t$checkheader->execute(array(\"id\"=>$user_id));\n\t\t\t\t$rowchk=$checkheader->fetch(PDO::FETCH_ASSOC);\n\n\t\t\t\tif(!empty($rowchk)){\n\t\t\t\t\tif($_SESSION['user_type']=='broker'){\n\t\t\t\t\t\tif(strpos($_SERVER['REQUEST_URI'], \"/app/broker/profile\")!=false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/broker/add-load\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($_SESSION['user_type']=='shipper'){\n\t\t\t\t\t\tif(strpos($_SERVER['REQUEST_URI'], \"/app/shipper/profile\")!=false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/shipper/add-load\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}elseif($_SESSION['user_type']=='trucker'){\n\t\t\t\t\t\tif(strpos($_SERVER['REQUEST_URI'], \"/app/trucker/profile\")!=false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/trucker/search-loads\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif($_SESSION['user_type']=='broker'){\n\t\t\t\t\t\tif(strpos($_SERVER['REQUEST_URI'], \"/app/broker/profile\")==false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/broker/profile\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t }elseif($_SESSION['user_type']=='shipper'){\n\t\t\t\t\t\tif(strpos($_SERVER['REQUEST_URI'], \"/app/shipper/profile\")==false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/shipper/profile\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t }elseif($_SESSION['user_type']=='trucker'){\n\t\t\t\t \tif(strpos($_SERVER['REQUEST_URI'], \"/app/trucker/profile\")==false){\n\t\t\t\t\t\t\theader(\"Location:\".SITEURL.\"app/trucker/profile\");\n\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t } \n\t\t\t}\n\n\t\t}", "function updateUserInfo($user_info){\n\t$conn = DbTools::getDBConnect('dota');\n\t$res = $conn->query(\"SELECT id,score,rank FROM dota.user_info \".\n\t\t\"WHERE uname LIKE '\".$conn->escape_string($user_info['user']).\"'\");\n\tif (false === $res){\n\n\t}\n\textract($user_info);\n\t$rank = $rank == \"-\" ? 0 : $rank;\n\t$time = time();\n\t// update\n\tif (!empty($res)){\n\t\tif ($score > $res[0]['score']){\n\t\t\t$trend = 1;\n\t\t}\n\t\telseif($score < $res[0]['score']){\n\t\t\t$trend = -1;\n\t\t}\n\t\telse{\n\t\t\t$trend = 0;\n\t\t}\n\t\t$conn->query(\"UPDATE dota.user_info SET score = $score, rank = $rank,\".\n\t\t\t\"win = $win, lose = $lose, user_url = '\".$conn->escape_string($user_url).\"', \".\n\t\t\t\"trend = $trend, update_time = $time WHERE id = \". $res[0]['id']);\n\t\t$rank_id = $res[0]['id'];\n\t}\n\t// insert\n\telse{\n\t\t$trend = 0;\n\t\t$sql = \"INSERT INTO dota.user_info SET uname = '\".$conn->escape_string($user).\"', score = $score,\".\n\t\t\t\"rank = $rank, win = $win, lose = $lose, user_url = '\".$conn->escape_string($user_url).\"', \".\n\t\t\t\"trend = $trend, update_time = $time\";\n\t\t//var_dump($sql);\n\t\t$conn->query($sql);\n\t\t$rank_id = $conn->insert_id;\n\t}\n\t$ret = array('rank_id' => $rank_id, \n\t\t'score' => $score,\n\t\t'rank' => $rank,\n\t\t'win' => $win,\n\t\t'lose' => $lose,\n\t\t'trend' => $trend);\n\treturn $ret;\n}", "public function preDispatch() {\r\n\t\t$this->_auth = Zend_Auth::getInstance();\r\n\t\t$this->_auth->setStorage(new Zend_Auth_Storage_Session('Fancrank_App'));\r\n\t\t//\r\n\t\tif(!$this->_auth->hasIdentity()) {\r\n\t\t\t$this->_helper->json(array('message'=>'authentication failed','code'=>400));\r\n\t\t\t//set the proper navbar\r\n\t\t}\r\n\t\t$this->_helper->layout()->disableLayout();\r\n\t\t$this->_helper->viewRenderer->setNoRender();\r\n\t\t$this->_user = $this->_auth->getIdentity();\r\n\t\t\r\n\t\tif ($this->_getParam('id') != $this->_user->facebook_user_id){\r\n\t\t\techo \"IDENTITY AND PARAMETER ID DOES NOT MATCH\"\t;\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "function sf_precreate_sflast()\n{\n\tglobal $wpdb;\n\n\t$users = $wpdb->get_results(\"SELECT ID FROM \".SFUSERS);\n\tif($users)\n\t{\n\t\tforeach($users as $user)\n\t\t{\n\t\t\t$check = $wpdb->get_var(\"SELECT umeta_id FROM \".SFUSERMETA.\" WHERE meta_key='\".$wpdb->prefix.\"sflast' AND user_id=\".$user->ID);\n\t\t\tif(!$check)\n\t\t\t{\n\t\t\t\tsf_set_last_visited($user->ID);\n\t\t\t}\n\t\t}\n\t}\n\treturn;\n}", "public function handleProviderCallback()\n {\n\n try {\n $facebook_user = Socialite::driver('facebook')\n ->fields([\n 'name',\n 'first_name',\n 'last_name',\n 'email',\n 'verified',\n \"id\"\n ])->user();\n } catch (Exception $e) {\n return Redirect::route(\"client::pages.index\")->withErrors([\"Servicio temporalmente no disponible\"]);\n }\n\n if (!filter_var( $facebook_user->getEmail() , FILTER_VALIDATE_EMAIL)) {\n return Socialite::driver('facebook')->reRequest()->redirect();\n }\n\n $local_users = User::withTrashed()\n\t\t\t->where([\"email\" => $facebook_user->getEmail()])\n\t\t\t->orWhere([\"facebook_id\" => $facebook_user->getId()])\n\t\t\t->get();\n\n switch ($local_users->count()) {\n case 0:\n\n $data = [\n \"name\" => User::createUniqueUsername( $facebook_user->getName() , \"\" ),\n \"active\" => true,\n 'email' => $facebook_user->getEmail(),\n 'first_name' => isset($facebook_user->user[\"first_name\"]) ? $facebook_user->user[\"first_name\"] : \"\",\n 'last_name' => isset($facebook_user->user[\"last_name\"]) ? $facebook_user->user[\"last_name\"] : \"\",\n 'password' => User::setRandomPassword(),\n 'facebook_id' => $facebook_user->getId(),\n ];\n\n $local_user = User::CltvoCreate($data);\n\n break;\n case 1:\n\n $local_user = $local_users->first();\n\n if ($local_user->facebook_id != $facebook_user->getId()) {\n $local_user->facebook_id = $facebook_user->getId();\n $local_user->save();\n }\n\n break;\n default:\n $local_user = $local_users->where(\"facebook_id\" , $facebook_user->getId())->first();\n break;\n }\n\n\n if ($local_user) {\n foreach ($this->cookie_bags as $bag_key) {\n $bag_user = BagUser::where([\"user_id\"=> null])->with(\"bag\")->whereHas(\"bag\",function($q) use ($bag_key) {\n return $q->ByKey($bag_key)->Actives();\n })->first();\n if ($bag_user) {\n $bag_user->user_id = $local_user->id;\n $bag_user->save();\n }\n }\n }\n\n\t\tif ($local_user->trashed()) {\n\t\t\treturn Redirect::back()->withErrors([\n 'active' => \"La cuenta a sido desactivada\"\n ]);;\n\t\t}\n\t\tif( !$local_user->isActive() ){\n\t\t\treturn Redirect::back()->withErrors([\n\t\t\t\t'active' => \"te enviamos un correo para activar tu cuenta\"\n\t\t\t]);\n\t\t}\n\n Auth::login($local_user);\n return Redirect::to($this->redirectPath());\n }", "public function get_user_followers($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n $filter = $filters['filter'];\n \n //Most Recent\n $active_filter = \" ORDER BY created_at DESC, u.first_name, u.last_name\";\n if($filter == 1) {\n //Alphabetical\n $active_filter = \" ORDER BY u.first_name, u.last_name\";\n } else if($filter == 2) {\n //By number of followers\n $active_filter = \" ORDER BY followers DESC, u.first_name, u.last_name\";\n } else if($filter == 3) {\n //By number of mutual friends\n $active_filter = \" ORDER BY mutual_friends DESC, u.first_name, u.last_name\";\n } else if($filter == 4) {\n //By number of similar interests\n $active_filter = \" ORDER BY similar_interest DESC, u.first_name, u.last_name\";\n }\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NOT NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n coalesce(mf.mutualfriends,0) as mutual_friends,\n coalesce(ms.mutualstrings,0) as similar_interest,\n uq.created_at\n FROM useracquiantances uq\n JOIN users u ON u.id = uq.user_one_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uq.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uq.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uq.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uq.user_two_id\n LEFT OUTER JOIN (select uf5.user_one_id,\n COUNT(*) mutualfriends\n FROM userfriends uf5\n WHERE uf5.status=1 AND\n uf5.user_two_id IN (SELECT uf6.user_two_id\n FROM userfriends uf6\n WHERE uf6.user_one_id={$active_login_userid} AND status=1)\n GROUP BY uf5.user_one_id) as mf ON mf.user_one_id = u.id\n LEFT OUTER JOIN (select tr.user_id,\n COUNT(*) mutualstrings\n FROM topictrack tr\n LEFT JOIN topic t ON t.id = tr.topic_id\n WHERE t.deleted_at IS NULL AND tr.mask=0 AND\n tr.topic_id IN (SELECT tr2.topic_id \n FROM topictrack tr2\n LEFT JOIN topic t2 ON tr2.topic_id = t2.id\n WHERE tr2.user_id={$active_login_userid} \n AND t.deleted_at IS NULL \n AND tr.mask=0)\n GROUP BY tr.user_id) as ms ON ms.user_id = u.id\n WHERE (uq.user_two_id={$owner_profile_userid} AND uq.status=1)\n {$active_filter}\n LIMIT {$limit}\";\n \n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function users_can_be_retrieved_ordered_by_id_desc()\n {\n $user2 = User::factory()->create();\n\n $this\n ->get('nova-api/users')\n ->assertJson([\n 'label' => 'Users',\n 'resources' => [\n [\n 'id' => [\n 'value' => $user2->id,\n ],\n ],\n [\n 'id' => [\n 'value' => $this->user->id,\n ],\n ],\n ],\n ]);\n }", "function leader(){\n // instantiate database and product object\n $database = new Database();\n $db = $database->getConnection();\n\n //$result = $db->query('SELECT id,fb_id,name,status FROM users ORDER BY status desc');\n $result = $db->query('SELECT * FROM (SELECT id, fb_id, name, count(*) as score FROM shares GROUP BY id ORDER BY count(*) DESC) LIMIT 10');\n\n $list = array ();\n\n while ($row = $result->fetch_array(MYSQLI_ASSOC)) {\n /*\n echo json_encode(\n array(\n 'name' => $row->name,\n 'fb_id' => $row->fb_id,\n 'score' => $row->score,\n 'status_code' => 200,\n 'message' => 'Accepted request'\n );\n )*/\n $user_table = $db->query(\"SELECT city, college FROM users WHERE fb_id = '$row->fb_id'\")\n $row_1 = $user_table->fetch_array(MYSQLI_ASSOC);\n\n $list[$row->id]['fb_id'] = $row->fb_id;\n $list[$row->id]['name'] = $row->name;\n $list[$row->id]['score'] = $row->score;\n $list[$row->id]['city'] = $row_1->city;\n $list[$row->id]['college'] = $row_1->college;\n }\n echo json_encode($list);\n}", "function update_user_profile() {\n global $DB,$CFG;\n require_once($CFG->dirroot . '/local/elggsync/classes/curl.php');\n $config = get_config('local_elggsync');\n $elggdomainname = $CFG->wwwroot.$config->elggpath;\n $elggmethod = 'get.user.info';\n $elgg_api_key = $config->elggapikey;\n $curl = new local_elggsync\\easycurl;\n\n $results = $DB->get_records_sql(\"SELECT u.id,u.username,u.city, u.description FROM {user} AS u WHERE u.suspended = 0\");\n foreach($results as $result) {\n $url = $elggdomainname.'/services/api/rest/json/?method='.$elggmethod.'&api_key='.$elgg_api_key;\n $fetched = $curl->post($url,array('username'=>$result->username));\n $fetched = json_decode($fetched);\n if(isset($fetched) && $fetched->status == 0) {\n if(isset($fetched->result) && $fetched->result->success == true) {\n $dataobject = new stdClass;\n $dataobject->id = $result->id;\n if($fetched->result->firstname || $fetched->result->firstname !== null) {\n $dataobject->firstname = $fetched->result->firstname;\n }\n if($fetched->result->lastname || $fetched->result->lastname !== null) {\n $dataobject->lastname = $fetched->result->lastname;\n }\n if($fetched->result->email || $fetched->result->email !== null) {\n $dataobject->email = $fetched->result->email;\n }\n if($fetched->result->phone || $fetched->result->phone !== null) {\n $dataobject->phone1 = $fetched->result->phone;\n }\n if($fetched->result->mobile || $fetched->result->mobile !== null) {\n $dataobject->phone2 = $fetched->result->mobile;\n }\n if($fetched->result->city || $fetched->result->city !== null) {\n $dataobject->city = $fetched->result->city;\n $dataobject->country = 'BR';\n }\n if($fetched->result->description || $fetched->result->description !== null) {\n $dataobject->description = $fetched->result->description;\n }\n $DB->update_record('user',$dataobject);\n unset($dataobject);\n if($fetched->result->company || $fetched->result->company !== null) {\n $companyfieldid =[];\n try {\n $companyfieldid = $DB->get_record_sql(\"SELECT uid.id,uid.data\n FROM {user_info_data} AS uid\n JOIN {user_info_field} AS uif ON (uif.id = uid.fieldid)\n WHERE uid.userid = :userid\n AND uif.shortname = 'empresa'\",array('userid'=>$result->id),MUST_EXIST);\n if(strcmp($companyfieldid->data,$fetched->result->company) !== 0) {\n $DB->update_record('user_info_data',array('id'=>$companyfieldid->id,'data'=>$fetched->result->company));\n }\n }\n catch(Exception $e) {\n echo $e;\n }\n }\n }\n }\n }\n return true;\n}", "public function get_user_following($filters)\n {\n $active_login_userid = $filters['active_login_userid'];\n $owner_profile_userid = $filters['owner_profile_userid'];\n $filter = $filters['filter'];\n \n //Most Recent\n $active_filter = \" ORDER BY created_at DESC, u.first_name, u.last_name\";\n if($filter == 1) {\n //Alphabetical\n $active_filter = \" ORDER BY u.first_name, u.last_name\";\n } else if($filter == 2) {\n //By number of followers\n $active_filter = \" ORDER BY followers DESC, u.first_name, u.last_name\";\n } else if($filter == 3) {\n //By number of mutual friends\n $active_filter = \" ORDER BY mutual_friends DESC, u.first_name, u.last_name\";\n } else if($filter == 4) {\n //By number of similar interests\n $active_filter = \" ORDER BY similar_interest DESC, u.first_name, u.last_name\";\n }\n \n $limit = 20;\n \n $sql = \"SELECT u.id as user_id,\n u.profile_code,\n u.first_name,\n u.last_name,\n ub.profilephoto,\n ub.coverphoto,\n coalesce(a.total,0) as followers,\n coalesce(b.total,0) as following,\n round((coalesce(c.yaycount,0) + coalesce(d.yaycount,0) + (coalesce(e.yaycount,0) / 10)) / 3) as avg_rating,\n us.credential_type,\n us.credential_refid,\n (case us.credential_type\n when 1 then ugen.general_info\n when 2 then \n (case WHEN ucol.course IS NOT NULL THEN\n CONCAT(ucol.course, ', ', ucol.schoolname)\n ELSE ucol.schoolname\n end)\n when 3 then CONCAT(uwork.position, ', ', uwork.companyname,', ',uwork.location)\n end) 'credential',\n (case \n when uf2.status=1 then '1'\n when uf2.status=0 then '2'\n when uf3.status=0 then '3' \n else '4'\n end) 'friend_status',\n (case\n when ua.status=1 then \n case ua2.status\n when 1 then '6'\n else '1'\n end\n when ua.status=0 then '2'\n when ua2.status=1 then '3'\n when ua2.status=0 then '4' \n else '5'\n end) 'following_status',\n coalesce(mf.mutualfriends,0) as mutual_friends,\n coalesce(ms.mutualstrings,0) as similar_interest,\n uq.created_at\n FROM useracquiantances uq\n JOIN users u ON u.id = uq.user_two_id\n LEFT JOIN userbasicinfo ub on u.id = ub.user_id\n LEFT JOIN usersettings us on u.id = us.user_id\n LEFT JOIN usergeneralinfo ugen ON ugen.user_id = us.user_id AND ugen.id = us.credential_refid\n LEFT JOIN usereduccollege ucol ON ucol.user_id = us.user_id AND ucol.id = us.credential_refid\n LEFT JOIN userworkhistory uwork ON uwork.user_id = us.user_id AND uwork.id = us.credential_refid\n LEFT OUTER JOIN (select useracquiantances.user_two_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_two_id) as a ON a.user_two_id = u.id\n LEFT OUTER JOIN (select useracquiantances.user_one_id,\n COUNT(*) total\n FROM useracquiantances\n WHERE status=1\n GROUP BY useracquiantances.user_one_id) as b ON b.user_one_id = u.id\n LEFT OUTER JOIN (select postcontentapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postcontentapprovalrate\n LEFT JOIN postcontent ON postcontent.id = postcontentapprovalrate.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postcontentapprovalrate.mask = 0\n GROUP BY postcontentapprovalrate.user_id) as c ON c.user_id = u.id\n LEFT OUTER JOIN (select topicapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM topicapprovalrate\n LEFT JOIN topic ON topic.id = topicapprovalrate.string_id\n WHERE topic.deleted_at IS NULL AND topicapprovalrate.mask=0\n GROUP BY topicapprovalrate.user_id) as d ON d.user_id = u.id\n LEFT OUTER JOIN (select postopinionapprovalrate.user_id,\n sum(Case when approvalrate = 'Y' then 1 else 0 end) yaycount\n FROM postopinionapprovalrate\n LEFT JOIN postopinion ON postopinion.id = postopinionapprovalrate.postopinion_id\n LEFT JOIN postcontent ON postcontent.id = postopinion.postcontent_id\n WHERE postcontent.deleted_at IS NULL AND postopinion.deleted_at IS NULL\n AND postopinionapprovalrate.mask=0\n GROUP BY postopinionapprovalrate.user_id) as e ON e.user_id = u.id\n LEFT JOIN useracquiantances ua on ua.user_one_id = uq.user_two_id \n AND ua.user_two_id = {$active_login_userid}\n LEFT JOIN useracquiantances ua2 on ua2.user_one_id = {$active_login_userid} \n AND ua2.user_two_id = uq.user_two_id\n LEFT JOIN userfriends uf2 on uf2.user_one_id = uq.user_two_id \n AND uf2.user_two_id = {$active_login_userid}\n LEFT JOIN userfriends uf3 ON uf3.user_one_id={$active_login_userid} \n AND uf3.user_two_id=uq.user_two_id\n LEFT OUTER JOIN (select uf5.user_one_id,\n COUNT(*) mutualfriends\n FROM userfriends uf5\n WHERE uf5.status=1 AND\n uf5.user_two_id IN (SELECT uf6.user_two_id\n FROM userfriends uf6\n WHERE uf6.user_one_id={$active_login_userid} AND status=1)\n GROUP BY uf5.user_one_id) as mf ON mf.user_one_id = u.id\n LEFT OUTER JOIN (select tr.user_id,\n COUNT(*) mutualstrings\n FROM topictrack tr\n LEFT JOIN topic t ON t.id = tr.topic_id\n WHERE t.deleted_at IS NULL AND tr.mask=0 AND\n tr.topic_id IN (SELECT tr2.topic_id \n FROM topictrack tr2\n LEFT JOIN topic t2 ON tr2.topic_id = t2.id\n WHERE tr2.user_id={$active_login_userid} \n AND t.deleted_at IS NULL \n AND tr.mask=0)\n GROUP BY tr.user_id) as ms ON ms.user_id = u.id\n WHERE (uq.user_one_id={$owner_profile_userid} AND uq.status=1)\n {$active_filter}\n LIMIT {$limit}\";\n \n return collect($this->_helper->convert_sql_to_array( DB::select(DB::raw($sql)) )); \n }", "public function isSort()\n {\n $id = Input::get('id');\n $value = Input::get('value');\n $sort_ids = Company_has_contact::find($id);\n $sort_ids->sort_id = $value;\n if($sort_ids->save()){\n $response = array(\n 'status' => 'success',\n 'msg' => 'Successfully change',\n );\n }else{\n $response = array(\n 'status' => 'failure',\n 'msg' => 'Sorry the data could not be change',\n );\n }\n return Response::json($response);\n }", "public function view($post_id) {\n //user_id\n $user_id = $this->Session->read('Auth.User.id');\n //check validation \n if (!$this->ValidTo->isValid($user_id)){\n $this->Session->setFlash(__('Your USE period has expired! Please buy more searches to be able to use the system.'), 'cake-error');\n $this->redirect(array('controller'=>'buy','action' => 'index'));\n exit(1);\n }\n //Implement security ... if user has post_id\n //if \n if ($this->SocialPosts->hasAny(array('uid' => $user_id, 'id' => $post_id))) {\n //fb pages\n $get = array(\n //'limit' => 10,\n 'conditions' => array(array('id' => $post_id)),\n //'fields' => array('', ''),\n //'order' => array('date'=>'desc')\n );\n //get social post. Set it for view.\n $post = $this->SocialPosts->find('first',$get);\n //set post for view\n $this->set('post',$post);\n \n //build get\n $get = array(\n 'joins' => array(\n array(\n 'table' => 'user_fcb',\n 'alias' => 'TableAlias',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'FcbUserPosts.fcb_uid = TableAlias.fcb_id',\n ),\n ),\n ),\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id,'errorstatus' => 1,'inactive'=>0)),\n 'fields' => array('FcbUserPosts.id', 'FcbUserPosts.post_id', 'FcbUserPosts.fcb_uid', 'FcbUserPosts.fcb_post_id'\n , 'FcbUserPosts.errorstatus', 'FcbUserPosts.scheduled', 'FcbUserPosts.msg', 'TableAlias.full_name', 'TableAlias.p_picture'),\n 'order' => 'id DESC',\n //'order' => array('date'=>'desc')\n );\n //fb users\n $allfbuserpost = $this->FcbUserPosts->find('all', $get);\n if (!empty($allfbuserpost)) {\n $userdata = array();\n foreach ($allfbuserpost as $fbuserpost) {\n // set/reset \n $data = array();\n //print_r($fbuserpost);\n $result = $this->Social->getLikesAndComments($fbuserpost['FcbUserPosts']['fcb_post_id'], $fbuserpost['FcbUserPosts']['fcb_uid'], $user_id);\n if($result['status']=='success'){\n //set info for this user\n $data['profile'] = $fbuserpost['TableAlias'];\n $data['statistics'] = $result;\n //set data\n $userdata[] = $data;\n }\n else{\n //expired token...\n //name\n $fname = $this->Social->getFbName($fbuserpost['FcbUserPosts']['fcb_uid']);\n $this->Session->setFlash(__(\"There was something wrong with facebook acccount $fname. Propably an expired authentication of Facebook!\"), 'cake-error');\n $this->redirect(array('action'=>'expiredtoken',$fname));\n }\n }\n //set for view\n $this->set('fbuserspost', $userdata);\n }\n //build get\n $getpages = array(\n 'joins' => array(\n array(\n 'table' => 'fcb_pages',\n 'alias' => 'TableAlias',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'FcbPagePosts.fcb_page_id = TableAlias.fcb_page_id',\n ),\n ),\n ),\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id,'errorstatus' => 1,'inactive'=>0)),\n 'fields' => array('FcbPagePosts.id', 'FcbPagePosts.post_id', 'FcbPagePosts.fcb_uid', 'FcbPagePosts.fcb_post_id', 'FcbPagePosts.fcb_page_id'\n , 'FcbPagePosts.errorstatus', 'FcbPagePosts.scheduled', 'FcbPagePosts.msg', 'TableAlias.name', 'TableAlias.p_picture'),\n 'order' => 'id DESC',\n //'order' => array('date'=>'desc')\n );\n\n //fb pages\n $allfbpagespost = $this->FcbPagePosts->find('all', $getpages);\n if (!empty($allfbpagespost)) {\n //parse and get info\n foreach ($allfbpagespost as $fbpagespost) {\n // set/reset \n $data = array();\n //get info\n $result = $this->Social->getLikesAndComments($fbpagespost['FcbPagePosts']['fcb_post_id'], $fbpagespost['FcbPagePosts']['fcb_uid'], $user_id);\n //set info \n $data['profile'] = $fbpagespost['TableAlias'];\n $data['statistics'] = $result;\n //set data\n $pagedata[] = $data;\n }\n ///set for view\n //set for view\n $this->set('fbpagespost', $pagedata);\n }\n\n //build get\n $gettwitter = array(\n 'joins' => array(\n array(\n 'table' => 'user_tw',\n 'alias' => 'TableAlias',\n 'type' => 'LEFT',\n 'conditions' => array(\n 'TwUserPosts.tw_uid = TableAlias.tw_id',\n ),\n ),\n ),\n //'limit' => 10,\n 'conditions' => array(array('post_id' => $post_id,'errorstatus' => 1,'inactive'=>0)),\n 'fields' => array('TwUserPosts.id', 'TwUserPosts.post_id', 'TwUserPosts.tw_uid', 'TwUserPosts.tw_post_id'\n , 'TwUserPosts.errorstatus', 'TwUserPosts.scheduled', 'TwUserPosts.msg', 'TableAlias.name', 'TableAlias.p_picture'),\n 'order' => 'id DESC',\n //'order' => array('date'=>'desc')\n );\n //fb users\n $alltwitterac = $this->TwUserPosts->find('all', $gettwitter);\n //if something\n if (!empty($alltwitterac)) {\n //parse and get info\n foreach ($alltwitterac as $twitterac) {\n // set/reset \n $data = array();\n //get info\n $result = $this->Twitter->getTwitterLookup($twitterac['TwUserPosts']['tw_post_id'], \n $twitterac['TwUserPosts']['tw_uid'], $user_id);\n //check result\n if($result['status']=='success'){\n // set info \n $data['profile'] = $twitterac['TableAlias']; \n $data['statistics'] = $result['data'];\n // set info \n $twitterdata[]=$data;\n }\n }\n //set for view\n $this->set('twuserposts', $twitterdata);\n }\n } else {\n //hmmm somebody sending bad http requests \n //$this->Session->setFlash(__(\"You are not authorized to perform this operation!\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n }", "function status()\n{\n\t$username = $this->Session->read('user');\n\tif (!$username){\n\t$this->redirect('/users/login');}\n\t\n\t// set knownusers\n\t$this->set('knownusers', $this->User->findAll(null, array('id', 'username',\n\t'first_name', 'last_name', 'last_login'), 'id DESC'));\n}", "function findSortingDatas($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$sql = \"SELECT \".TABLE_MEMBER_FLAG.\" AS flag,\"\r\n\t\t\t\t .TABLE_MEMBER_GENDER.\" AS gender,\"\r\n\t\t\t\t .TABLE_MEMBER_BIRTHDAY.\" AS birthday,\"\r\n\t\t\t\t .TABLE_MEMBER_COUNT.\" AS count1,\"\r\n\t\t\t\t .TABLE_MEMBER_CITY.\" AS city,\"\r\n\t\t\t\t .TABLE_MEMBER_PICTURE.\" AS pic,\"\r\n\t\t\t\t .TABLE_MEMBER_ISACTIVE.\" AS isactive\r\n\t\t\t\t FROM \".TABLE_MEMBER.\" WHERE \".TABLE_MEMBER_USERNAME.\"= '$username' \";\r\n\t\t$rec = DBconnect::assoc_query_1D ($sql);\r\n\t\treturn $rec;\r\n\t}" ]
[ "0.5872242", "0.5781357", "0.57272124", "0.5667975", "0.5585086", "0.5539294", "0.55183214", "0.55114454", "0.5509544", "0.5448638", "0.54322916", "0.54302967", "0.54262", "0.54198194", "0.53976697", "0.5385467", "0.53835404", "0.53781843", "0.5373129", "0.5369948", "0.5366049", "0.5365585", "0.5362044", "0.5343597", "0.53355044", "0.5302808", "0.52897644", "0.5277129", "0.52761906", "0.5276065" ]
0.61690027
0
/ function LogIn check if this email exist in database or not and if exist return his info and if not exist return false $UserData is an array with his email
public function LogIn($UserData) { $db = new DB(); if(!empty($UserData)) { //Check whether user data already exists in database $querySelect = "SELECT * FROM ".$this->userTbl." WHERE email = '".$UserData['email']."'"; $result = $db->prepare($querySelect); $result->execute(); if($result->rowCount() > 0) { $data = $result->fetchAll(); return $data; } else { return false; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_email_exist(){\n //TODO syntize the query\n $this->SQL = \"SELECT id,private_name,family_name ,email,password FROM users\"\n . \" WHERE email = '\" . $this->params['email'] . \"';\" ;\n \n \n $this->selecet_query();\n \n \n if ( !empty( $this->results[0]['email'] ) ){\n //found mail - check password\n \n if ($this->results[0]['password'] === $this->params['password']){\n \n $this->success_login();\n \n \n } else {\n // if password incorrect\n $this->results =array( 'results'=>'fail');\n \n }\n \n \n } else {\n //didnt found email \n $this->results =array( 'results'=>'fail');\n \n }\n return $this->results;\n \n }", "public function userExist($data)\r\n {\r\n $this->db->select ('*');\r\n\t\t$this->db->from ( TABLES::$USER );\r\n\t\t$this->db->where ( 'email', $data['email'] );\r\n\t\t$query = $this->db->get ();\r\n\t\t$result = $query->result_array ();\r\n \treturn $result;\r\n \t}", "public function loginUser($data) {\n $email = $data['email'];\n $pass = $data['password'];\n $success = $this->_db->query(\"SELECT user_id FROM users WHERE user_email = '$email' AND user_password = '$pass'\");\n if ($success) {\n $user_id = [];\n while ($row = $success->fetch_assoc()) {\n $user_id[] = $row;\n }\n return $user_id;\n }\n return false;\n }", "public function checkLogin(){\n $dbQuery = new DBQuery(\"\", \"\", \"\");\n $this->email = $dbQuery->clearSQLInjection($this->email);\n $this->senha = $dbQuery->clearSQLInjection($this->senha);\n \n // Verificar quantas linhas um Select por Email e Senha realiza \n $resultSet = $this->usuarioDAO->select(\" email='\".$this->email.\"' and senha='\".$this->senha.\"' \");\n $qtdLines = mysqli_num_rows($resultSet);\n \n // Pegar o idUsuario da 1ª linha retornada do banco\n $lines = mysqli_fetch_assoc($resultSet);\n $idUsuario = $lines[\"idUsuario\"];\n \n\n \n // retorna aonde a função foi chamada TRUE ou FALSE para se tem mais de 0 linhas\n if ( $qtdLines > 0 ){\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n $_SESSION[\"idUsuario\"] = $idUsuario;\n $_SESSION[\"email\"] = $this->email;\n return(true);\n }else{\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n unset($_SESSION[\"idUsuario\"]);\n unset($_SESSION[\"email\"]);\n return(false);\n }\n }", "public function chkEmailExist() {\n ob_clean();\n $this->load->model('register_model');\n $user_email = $this->input->post('user_email');\n $table_to_pass = 'mst_users';\n $fields_to_pass = array('user_id', 'user_email');\n if ($this->input->post('action') != \"\") {\n $condition_to_pass = \"(user_type!=2) and (`user_email` = '\" . $user_email . \"' or `user_name` = '\" . $user_email . \"')\";\n } else {\n $condition_to_pass = array(\"user_email\" => $user_email);\n }\n $arr_login_data = $this->register_model->getUserInformation($table_to_pass, $fields_to_pass, $condition_to_pass, $order_by_to_pass = '', $limit_to_pass = '', $debug_to_pass = 0);\n if (count($arr_login_data)) {\n echo 'true';\n } else {\n echo 'false';\n }\n }", "public function DB_checkLogin($data){\n\t\ttry {\n\t\t\t\n\t\t\tparent::__construct(DB_DRIVER.':dbname='.DB_NAME.';host='.DB_HOST, DB_USERNAME, DB_PASSWORD);\n\t\t\t$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n\n\t\t\t$query = $this->prepare('SELECT email,password,first_name,last_name,date_of_birth,time_stamp FROM '.DB_TABLE.' WHERE email = :email');\n\t\t\t$query->execute(array(\n\t\t\t':email' => $data['email']\n\t\t\t));\n\n\t\t\tif($query->rowCount() === 1){\n\t\t\t\twhile ($row = $query->fetch(PDO::FETCH_OBJ)){\n\t\t\t\t\tif (password_verify($data['password'], $row->password)) {\t\t\n\t\t\t\t\t\tsetcookie('user', $row->first_name.'|'.$row->last_name.'|'.$row->date_of_birth.'|'.$row->time_stamp, time()+3600, \"/reg_form/\");\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader('Refresh: 2; url='.BASEPATH.'user/');\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\tdie('Incorrect details.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(PDOException $e){\n\t\t\techo 'ERROR: '.$e->getMessage();\n\t\t}\n\t}", "static function check_login_data($email, $password) {\n global $con;\n\n // generate password hash by password and salt stored in the user table\n $password_hash = sha1(self::get_salt_by_email($email) . $password);\n unset($password); // delete password variable after useage\n \n // check how many table entries fit the email and password\n // password hash comparison with \"LIKE BINARY\" to make sure both are exactly equal\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `password` LIKE BINARY '\".$password_hash.\"' AND `active` = 1;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) { \n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `active` = 1;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 0) {\n return 3;\n }\n return 0;\n } else { // an entry which fits email and password exists\n // check if the user has already confirmed their email address\n $sql = \"SELECT COUNT(`id`) AS 'count' FROM `user` WHERE `email` LIKE '\".$email.\"' AND `password` LIKE BINARY '\".$password_hash.\"' AND `active` = 1 AND `email_confirmed` = 0;\";\n $query = mysqli_query($con, $sql);\n $count = mysqli_fetch_object($query)->count;\n if ($count == 1) { // email has not been confirmed\n return 2;\n } else { // email has been confirmed\n return 1;\n }\n }\n }", "public function loginin($email,$password){\n if(!empty($email) && !empty($password)) { //if email and password are not empty\n $query='SELECT * FROM users WHERE UserEmail=?'; //selects all from the table where user email is the email that has been passed to the function\n $statement=$this->_dbConnection->prepare($query); //prepares the sql query\n $param=array(\"$email\"); //puts the email in to the array\n $statement->execute($param); //executes the sql statement\n $data=$statement->fetch(); //fetch to find the row that we need\n if ($data===false) {\n echo \"Your credentials were incorrect\";\n } else {\n $user=new UserData($data); //if data === true then the user object will be created\n if(password_verify($password,$user->getPassword())){ //password_verify is used in order to check the password that has been entered\n //with the password that has been stored as a hash\n $userType = $user->getUserType(); //get the user account type that has been stored in the database\n $userID = $user->getUserID(); // gets the user ID that has been auto incremented\n $_SESSION['login_user'] = $email; //store email in the session\n $_SESSION['user_permission'] = $userType; //store user permission in the session\n $_SESSION['userID'] = $userID; //store userID in the ssion\n return true;\n }\n }\n }else{\n die(\"Data Not Recieved\");\n }\n }", "public function login($data, $isEmail)\n {\n // Check if username or email exists\n $loginUserName = <<<SQL\n SELECT id, user, email, pwd FROM users WHERE user=:user;\n SQL;\n\n $loginUserEmail = <<<SQL\n SELECT user, email, pwd FROM users WHERE email=:user;\n SQL;\n\n try {\n if ($isEmail) {\n $statement = $this->pdo->prepare($loginUserEmail);\n } else {\n $statement = $this->pdo->prepare($loginUserName);\n }\n $statement->bindParam(':user', $data['user'], PDO::PARAM_STR);\n $statement->execute();\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n } catch (PDOException $e) {\n return false;\n }\n\n // If a user was found, check the password\n if ($result !== false) {\n if (password_verify($data['pwd'], $result['pwd'])) {\n return [\n 'user' => $result['user'],\n 'id' => $result['id'],\n ];\n } else {\n return false;\n }\n } else {\n return false;\n }\n // per default, return false\n return false;\n }", "function login() {\n\n // Validate user input\n $this->s_email = testInput($this->s_email);\n $this->s_password = testInput($this->s_password);\n\n // Fetch data from db with given email\n $result = $this->conn->query(\"SELECT * FROM $this->tableName WHERE s_email LIKE '$this->s_email'\");\n\n // Check that student exists in database\n if ($result->rowCount() === 1) {\n\n // Fetch user record from result\n $user = $result->fetch();\n\n // Check password match\n if (password_verify($this->s_password, $user[\"s_password\"])) {\n return true;\n }\n // Passwords do not match\n else {\n return false;\n }\n }\n // User with given email not in database\n else {\n return false;\n }\n }", "public function checkUser($data)\n {\n return $this->db->get_where('users',array('uEmail'=>$data['uEmail']))->result_array();\n //select * from users where uEmail=\"abc\"\n }", "public function getLoginData($email, $password) \r\n\t{//verify if user logged in or not\r\n\t\t$this->db->where('email', $email);\r\n\t\t$this->db->where('password', $passwrod);\r\n\t\t//check if user email and password match\r\n\r\n\t\t$query = $this->db->get('users');\r\n\r\n\t\tif($query->num_rows() > 0 )\r\n\t\t{\r\n\t\t\treturn TRUE;\r\n\t\t\t//logged in\r\n\t\t} else {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}", "public function signInUserByEmail($sign_data)\r\n {\r\n $result = array();\r\n $result['status'] = CommonDefinition::ERROR_CHECK_FIELD;\r\n $result['info'] = \"Email or password is empty or not valid\";\r\n\r\n $userSet = new UserInfoSet(null, null, trim($sign_data->user_email), trim($sign_data->user_password));\r\n\r\n // check user sign in data\r\n $userUtil = new SysUtility();\r\n\r\n if (! $userUtil->checkFormField($userSet->getEmail(), CommonDefinition::REG_EMAIL_ID)) {\r\n return ($result); // return due to check form item failed\r\n } else if (! $userUtil->checkFormField($userSet->getPassword(), CommonDefinition::REG_PASSWORD_ID)) {\r\n return ($result); // return due to check form item failed\r\n }\r\n\r\n // convert password to md5 hash\r\n $md5PwCode = md5($userSet->getPassword());\r\n // Set back to the user set\r\n $userSet->setPassword($md5PwCode);\r\n\r\n $signModel = new UserModel(SysDefinition::USER_DB_CONFIG);\r\n // Connect to Database\r\n $db_user_conn = $signModel->connect();\r\n\r\n if (! $db_user_conn) {\r\n $result['status'] = CommonDefinition::ERROR_CONN;\r\n $result['info'] = \"Failed to connect to Server!\";\r\n return ($result); // Connect to DB failed return without further handling\r\n }\r\n\r\n // get the user info table name by the received email\r\n $userDbTblName = $signModel->getUserAccountTblNameByEmail($userSet->getEmail());\r\n\r\n if (! is_bool($userDbTblName)) {\r\n // set the user db table name\r\n $signModel->setTableName($userDbTblName);\r\n $queryResult = $signModel->getUserAccountByEmail($userSet->getEmail());\r\n\r\n if (! is_bool($queryResult)) {\r\n if (strcasecmp($queryResult->getPassword(), $userSet->getPassword()) == CommonDefinition::SAME_RESULT) {\r\n // password match and user in active\r\n if (UserDefinition::USER_STATUS_ACTIVE == $queryResult->getUserStatus()) {\r\n $result['status'] = CommonDefinition::SUCCESS;\r\n $result['info'] = \"Your account is signed in successfully!\";\r\n $result['url'] = U('User/index'); // move to user login index page\r\n // Add user info to session\r\n session_start();\r\n $_SESSION['uid'] = $queryResult->getTagId();\r\n $_SESSION['user_name'] = $queryResult->getUserName();\r\n return ($result); // Connect to DB failed return without further handling\r\n }\r\n }\r\n }\r\n }\r\n\r\n $signModel->close();\r\n return ($result);\r\n }", "public function login_check($email, $password) {\n\n $query = $this -> conn -> prepare('SELECT * FROM users WHERE email = :email');\n $query -> execute(array(':email' => $email));\n $data = $query -> fetchObject();\n $salt = $data -> salt;\n $db_user_password = $data -> user_password;\n\n if ($this -> verify_hash_pass($password.$salt,$db_user_password) ) {\n\n\n $user[\"name\"] = $data -> name;\n $user[\"email\"] = $data -> email;\n $user[\"unique_id\"] = $data -> unique_id;\n return $user;\n\n } else {\n\n return false;\n }\n\n }", "public function check() {\n $check = $this->mysqli->query(\"SELECT * FROM user_info WHERE email='$this->email' && password ='$this->password' LIMIT 1\") or die($this->mysqli->error);\n $count = $check->num_rows;\n\n if ($count) {\n while($rows = $check->fetch_array(MYSQLI_ASSOC)){\n $this->loginID = $rows['loginID'];\n $_SESSION['loginID'] = $this->loginID;\n }\n $_SESSION['email'] = $this->email;\n $this->result .= \"Successfully Logged In\";\n } else {\n $this->result .= \"Sign In error!! Please try again\";\n }\n }", "function employeelogin($userdataarray){\n $this->db->where('email', $userdataarray['email']);\n $useravailable=$this->db->get('users')->result();\n if(sizeof($useravailable)==0){\n\t return 0; // email not exist\n }else{\n $this->db->where('email', $userdataarray['email']);\n $this->db->where('password', $userdataarray['password']);\n $useravailable=$this->db->get('users')->result();\n if(sizeof($useravailable)==0){\n return 1; // wrong password\n }else{\n $this->db->where('email', $userdataarray['email']);\n $this->db->where('password', $userdataarray['password']);\n $this->db->set('token', $userdataarray['token']);\n $this->db->update('users');\n \n return $useravailable[0];\n }\n }\n }", "function checkLogin() {\n /* Check if user has been remembered */\n if (isset($_COOKIE['cook_VenusetP_UserEmail']) && isset($_COOKIE['cook_Venueset_UserPassword'])) {\n $varUserEmail = $_COOKIE['cook_VenusetP_UserEmail'];\n $varUserPassword = $_COOKIE['cook_Venueset_UserPassword'];\n /* Confirm that username and password are valid */\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName');\n $varUserWhere = ' 1 AND UserEmail = \\'' . $varUserEmail . '\\' AND UserPassword = \\'' . md5(trim($varUserPassword)) . '\\'';\n //echo '<pre>';print_r($varUserWhere);exit;\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if (count($arrUserList) > 0) {\n /* $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName']; */\n }\n return true;\n } else {\n return false;\n }\n }", "function dbCheck($data){\n\t\t\t\t$sql = \"SELECT UID FROM user_info WHERE email = '$data'\";\n\n\t\t\t\t$result = mysqli_query($GLOBALS['db'], $sql);\n\t\t\t\t$count = mysqli_num_rows($result);\n\t\t\t\tif(!$result || $count == 0){\n\t\t\t\t\treturn \"This user does not exist.\";\n\t\t\t\t}//if\n\t\t\t\telse{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}//ifelse\n\t\t\t\treturn \"\";\n\n\t}", "function check($data)\n\t\t{\n\t\t\t$email = \"'\".$data['email'].\"'\";\n\t\t\t$password = \"'\".$data['password'].\"'\";\n\t\t\t$sql = $this->conn_id->query(\"select * from users where email = \".$email .\" and passwd = \".$password);\n\t\t\t\t$r = $sql->fetchALL(PDO::FETCH_ASSOC);\n\t\t\tif(!empty($r))\n\t\t\t\treturn TRUE;\n\t\t\telse\n\t\t\t\treturn FALSE;\n\t\t}", "protected static function checkUserToLogin($email)\n {\n \n try{\n $query = \"SELECT id,name,email,password FROM users \n WHERE email=?\";\n $user = DB::select($query,array($email));\n return $user;\n\n }catch(Exception $e){\n return $e->getMessage();\n }\n \n }", "public static function checkLogin()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n $user = $cont->prepare(\"SELECT `email` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\"); \n $user->execute([$email , $password]);\n $adminData = $user->fetchObject();\n\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../login.php\");\n }\n else\n {\n $_SESSION['email'] = $adminData->email; \n header(\"location:../index.php\");\n }\n }", "public function coustomer_login_data_check(){\n\t\t$dt = new DateTime('now', new DateTimezone('Asia/Dhaka'));\n\t\t$email \t\t\t= \t$this->input->post('email');\n\t\t$password \t\t=\tmd5($this->input->post('password'));\n\n\t\t$attar = array(\n\t\t\t'email'\t\t\t\t=>\t\t\t$email,\n\t\t\t'password'\t\t\t=>\t\t\t$password,\n\t\t\t);\n\t\t$result = $this->db->get_where('users',$attar);\n\t\tif($result->num_rows() == 1){\n\t\t\t$attr\t=\tarray(\n\t\t\t\t'current_user_id'\t\t=>\t$result->row(0)->id,\n\t\t\t\t'current_user_email'\t=>\t$email,\n\t\t\t\t'current_user_name'\t\t=>\t$result->row(20)->username,\n\t\t\t\t);\n\t\t\t$this->session->set_userdata($attr);\n\t\t\t$attard = array(\n\t\t\t\t'name'\t\t=>\t$this->session->userdata('current_user_id'),\n\t\t\t\t'user_name'\t=>\t$this->session->userdata('current_user_name'),\n\t\t\t\t'agent' \t=>\t$this->agent->browser(),\n\t\t\t\t'ip' \t\t=>\t$this->input->ip_address(),\n\t\t\t\t'platform'\t=> $this->agent->platform(),\n\t\t\t\t'date'\t\t=>\t$dt->format('F j, Y'),\n\t\t\t\t'time'\t\t=>\t$dt->format('g:i a'),\n\t\t\t\t'activity' \t=>\t1,\n\t\t\t);\n\t\t\t$this->db->insert('online_user_activity',$attard);\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function emailExists(){\r\n \r\n // query to check if email exists\r\n $query = \"SELECT id, fname, lname, password,role\r\n FROM user\r\n WHERE email = ?\r\n LIMIT 0,1\";\r\n \r\n // prepare the query\r\n $stmt = $this->conn->prepare( $query );\r\n \r\n // sanitize\r\n $this->email=htmlspecialchars(strip_tags($this->email));\r\n $this->password =htmlspecialchars(strip_tags($this->password));\r\n // bind given email value\r\n $stmt->bindParam(1, $this->email);\r\n \r\n // execute the query\r\n $stmt->execute();\r\n \r\n // get number of rows\r\n $num = $stmt->rowCount();\r\n \r\n // if email exists, assign values to object properties for easy access and use for php sessions\r\n if($num>0){\r\n \r\n // get record details / values\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // assign values to object properties\r\n $this->id = $row['id'];\r\n $this->fname = $row['fname'];\r\n $this->lname = $row['lname'];\r\n $this->password = $row['password'];\r\n $this->user_type = $row['user_type'];\r\n \r\n // return true because email exists in the database\r\n return true;\r\n }\r\n \r\n // return false if email does not exist in the database\r\n return false;\r\n }", "public function logIn(){\n\t\t$email = $_POST['log_email'];\n\t\t$email = filter_var($email, FILTER_SANITIZE_EMAIL); //sanitize email\n\t\t$s_email = self::$db->escape($email);\n\n\t\t\n\t\t$myquery = \"SELECT * FROM users WHERE email = $s_email;\";\n\t\tif(!self::$db->query($myquery)){\n\t\t\tarray_push($_SESSION['error'], \"does not match\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = self::$db->select($myquery);\n\t\t$hash = $user[0]['password'];\n\t\t$password = $_POST['log_password'];\n\t\t$unlocked = password_verify($password, $hash);\n\n\t\tif($unlocked){\n\t\t\t$this->setSessionVar($user[0]['id'],$hash);\n\t\t\t$_SESSION['allow']=true;\n\t\t\t$_SESSION['username'] = $user[0]['username'];\n \t\t\theader( \"refresh:0; url=index.php?page=home\");\n \t\t \t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tarray_push($_SESSION['error'] , 'does not match');\n\t\t\t$_SESSION['allow']=false;\n\t\t\treturn false ;\n\t\t}\n\t\tarray_push($_SESSION['error'] , 'does not match');\n\t\treturn false; \n\t}", "public function userLog($emailid, $password){ \n\t \t$conn = new Connection(); \n $db = $conn->connect();\n // use pass verify \n // sq= selet * where id then in if condition cheeck for the pass match using passverify\n //$userdata = $this->getUserDataByUserId($emailid);\n\n \t $query =\"SELECT * FROM users WHERE id = '\".$emailid.\"' \";\n $res = $db->query($query); \n $user_data = mysqli_fetch_array($res); \n $no_rows = mysqli_num_rows($res); \n \n if ($no_rows == 1) \n { $userdata = $this->getUserDataByUserId($emailid); \n // check if the pass user write match the one stored on the data base using verify pass method \n if(password_verify($password, $userdata['pwd'])) {\n $_SESSION['uid'] = $user_data['id']; \n $_SESSION['postion'] = $user_data['postion']; \n return TRUE; \n }\n \n /* $_SESSION['uid'] = $user_data['id']; \n $_SESSION['postion'] = $user_data['postion']; \n return password_verify($password, $userdata['pwd']); */\n } \n \n else \n { \n return FALSE; \n } \n \n }", "function isuserexistrecord($mail, $secret){\n\n $responsedb = $this->usuariogeneralmodel->validauserrecord($mail , $secret);\n /*Validamos que exista el usuario en la db*/ \n if (count($responsedb) == 1){\n /*Crear session*/ \n $idusuario = $responsedb[0][\"idusuario\"];\n $nombre = $responsedb[0][\"nombre\"];\n $email = $responsedb[0][\"email\"]; \n $fecha_registro = $responsedb[0][\"fecha_registro\"]; \n /*Response url*/ \n return $this->createsession($idusuario, $nombre , $email , $fecha_registro); \n\n }else{\n /*Response data error*/ \n return \"Error en en los datos de acceso\"; \n } \n }", "public function checkEmail($data){\n $this->stmt = $this->query('SELECT * FROM users WHERE email = :email');\n $this->stmt->bindValue(':email', $data['email']);\n $row = $this->single();\n // Check row\n if($this->stmt->rowCount() > 0){\n return true;\n } else {\n return false;\n }\n\n }", "function process_login_email($login_array_input = NULL){\n\t\tif(!isset($login_array_input) OR count($login_array_input) != 2)\n\t\t\treturn false;\n\t\t\t$email = $login_array_input[0];\n\t\t\t$password = $login_array_input[1];\n\t\t\t$query = $this->db->query(\"SELECT * FROM ci_user WHERE email= '\".$email.\"' and active = 0 LIMIT 1\");\n\t\t\tif ($query->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$row = $query->row();\n\t\t\t\t$user_id = $row->id;\n\t\t\t\t$user_pass = $row->password;\n\t\t\t\t$user_salt = $row->salt;\n\t\t\t\tif($this->CI_encrypts->encryptUserPwd($password,$user_salt) === $user_pass){\n\t\t\t\t\t$this->session->set_userdata('logged_user_email', $user_id);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\treturn false;\n\t}", "private function loginWithPostData() {\n \n $this->user_name = $this->connection->real_escape_string($_POST['user_name']); \n $checklogin = $this->connection->query(\"SELECT user_name, user_email, user_password_hash FROM users WHERE user_name = '\".$this->user_name.\"';\");\n \n if($checklogin->num_rows == 1) {\n \n $result_row = $checklogin->fetch_object();\n \n if (crypt($_POST['user_password'], $result_row->user_password_hash) == $result_row->user_password_hash) {\n \n /**\n * write user data into PHP SESSION [a file on your server]\n */\n $_SESSION['user_name'] = $result_row->user_name;\n $_SESSION['user_email'] = $result_row->user_email;\n $_SESSION['user_logged_in'] = 1;\n $_SESSION['user_name'] = $result_row->user_name;\n \n\t\t\t\t\t// session security\n $_SESSION['agent'] = $_SERVER['HTTP_USER_AGENT'] ;\n\t\t\t\t\t$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$_SESSION['count'] = 0; \n\t\t\t\t\t\t\t\t\t\t \n /**\n * write user data into COOKIE [a file in user's browser]\n */\n setcookie(\"user_name\", $result_row->user_name, time() + (3600*24*100));\n setcookie(\"user_email\", $result_row->user_email, time() + (3600*24*100));\n $this->user_is_logged_in = true;\n return true; \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false; \n } \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false;\n } \n }", "public function userCheckMailLogin($email,$password)\n {\n $query=\"select user_id from bimp_user where email='\".$email.\"' and password='\".$password.\"'\";\n $user= Yii::app()->db->createCommand($query)->queryAll();\n $count=count($user);\n if($count==1){\n return true;\n }else{\n return false;\n }\n }" ]
[ "0.72642404", "0.720837", "0.71959907", "0.7144561", "0.7100663", "0.7099993", "0.7095075", "0.7091552", "0.70264786", "0.70249707", "0.7015133", "0.6998184", "0.697854", "0.6940292", "0.6939051", "0.69311696", "0.69308746", "0.6913153", "0.68944097", "0.688037", "0.6878319", "0.6863281", "0.68371236", "0.6829747", "0.68031037", "0.678973", "0.6784664", "0.67625356", "0.6746804", "0.67228043" ]
0.75629336
0
/ update one column in one time $id id of user $col column i want to update $data data i want to set if updated reurn true else return false
public function updateuser($id,$col,$data) { $db = new DB(); $query = "UPDATE `".$this->userTbl."` SET `".$col."` = '".$data."' WHERE `id` = ".$id ; $stm = $db->prepare($query); if($stm->execute()) { $db = NULL; return TRUE; } else { $db = NULL; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update2($id, $data){\n // if(isset($data[$this->id]))unset($data[$this->id]);\n $query = $this->db->where('user_id', $id)->update(\n $this->table, $data\n );\n return ($this->db->affected_rows() != 1) ? false : true;\n\n }", "function update_users($data,$id){\n $conditions = array('user_id'=>$id);\n $qry = $this->common_update($data, $conditions);\n \n if($qry){\n return TRUE;\n } else{\n return FALSE;\n }\n\n }", "public function modify($tblname, $colname, $id, $data) {\n $this->db->where($colname, $id);\n $this->db->update($tblname, $data);\n return TRUE;\n }", "public function updateAdminData($data, $id) \n {\n $this->db->where('id', $id);\n if ($this->db->update('users', $data))\n return TRUE;\n else\n return FALSE;\n }", "private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update($data, $id){\n //update user data in users table\n $update = $this->db->update($this->userTbl, $data, array('id'=>$id));\n\n //return the status\n return $update?true:false;\n }", "public function update(array $data, $id): bool;", "public function updateRow($table, $col, $colVal, $data) {\n \t\t$this->db->where($col,$colVal);\n\t\t$this->db->update($table,$data);\n\t\treturn true;\n \t}", "function update_data($table,$col,$id,$data,$cn){\n $str=\"update `$table` set \";\n $cnt=1;\n foreach($data as $key=>$value){\n $str.=\"`$key`='\".addslashes($value).\"'\";\n if($cnt++<count($data))\n $str.=\",\";\n }\n $str.=\" where {$col}=$id\";\n $cn->query($str);\n\n }", "public function update($data, $id){ \r\r\n //update user data in users table\r\r\n $update = $this->db->update($this->wishlistTbl, $data, array('id'=>$id));\r\r\n \r\r\n //return the status\r\r\n return $update?true:false;\r\r\n }", "public function update($id, $data){\n if(isset($data[$this->id]))unset($data[$this->id]);\n $query = $this->db->where('id', $id)->update(\n $this->table, $data\n );\n return ($this->db->affected_rows() != 1) ? false : true;\n\n }", "public function update($data, $id) {\n if(!empty($data) && !empty($id)){\n // Add modified date if not included\n if(!array_key_exists(\"updated_date\", $data)){\n $data['updated_date'] = date(\"Y-m-d H:i:s\");\n }\n \n // Update users data\n $update = $this->db->update($this->table, $data, array('s_id' => $id));\n \n // Return the status\n return $update?true:false;\n }\n return false;\n }", "function update($data, $id) { \n $this->db->where('scattd_id', $id); //memasukkan berdasarkan id yg telah ada\n if ($this->db->update('fis_dservice_consult_attendances', $data)) { //proses untuk memasukan data yg baru\n return TRUE;\n } else {\n return FALSE;\n }\n }", "public function updateRow($input,$id)\n {\n $updateId = Members::where('id',$id)\n ->update($input);\n\t\treturn true;\n }", "function updateData($table,$data,$id){\n\t\treturn $this->db->update($table,$data,$id);\n\t}", "public static function updateById($id,$data){\n $model = static::findById($id);\n if ($model && $model->load($data) && $model->save()) {\n return true;\n }\n return false;\n }", "public function update(array $data): bool\n {\n if (!empty($data[$this->primaryKey])) {\n $id = $data[$this->primaryKey];\n unset($data[$this->primaryKey]);\n }\n\n return (bool) $this->connection->update($this->table, $data, array($this->primaryKey => $id));\n }", "public function update_user_data($id, $data) {\n //$data['modified_date'] = date('Y-m-d H:i:s');\n if (is_array($id)) {\n $this->db->where($id);\n } else {\n $this->db->where(['id' => $id]);\n }\n return $this->db->update('users', $data);\n }", "function update_data($update_data,$where_arr,$tbl_name)\n\t{\n\t\tif(!empty($update_data))\n\t\t{\n\t\t\t$this->db->where($where_arr);\n\t\t\t$this->db->update($tbl_name,$update_data);\n\t\t\t\n\t\t\tif($this->db->affected_rows()>0)\n\t\t\t{\n\t\t\t\treturn TRUE;\t\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "public function updatePengajar($data,$user_id){\n $this->db->update('m_user',['user_id'=>$user_id,'jenis_user'=>'pengajar']);\n return $this->db->affected_rows();\n }", "public function update($data,$id)\n {\n $this->plasma = $this->load->database('plasma', TRUE);\n $this->plasma->where('id', $id);\n $query = $this->plasma->update('rol', $data);\n if($query)\n return 'TRUE';\n else\n return 'FALSE';\n }", "public function updateByPMUserId($data, $pmUserId)\n { \n $fillable = ['username', 'username_canonical', 'email', 'email_canonical', 'enabled', 'salt', 'password',\n 'last_login', 'confirmation_token', 'password_requested_at', 'roles', 'first_name', 'last_name',\n 'user_type', 'ob_key', 'aa_token'];\n $column = [];\n foreach ($data as $key => $value) {\n if(in_array($key, $fillable))\n $column[$key] = $value;\n }\n\n // update on `pm_user` table\n $canditate = PmUser::where('id',$pmUserId)->update($column);\n\n return true;\n }", "public function update($data,$id)\n\t{\n\t\t$this->db->where('id',$id);\n\t\t$result = $this->db->update('pay_withs',$data);\n\t\tif ($result) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function update_status($data, $id){\n\t\t$this->db->where('training_id', $id);\n\t\tif( $this->db->update('training',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public static function update($id, $data){\n return false;\n }", "public function update_data($data,$id)\n {\n $this->db->where('id',$id);\n $this->db->update('user',$data);\n }", "public function update_ico($id,$data){\n\t\t $this->db->where('id',$id);\n\t\t $update = $this->db->update(DB_PREFIX.'setup',$data);\n\t\tif($update)\n {\n return true;\n }\n else\n {\n return false;\n }\n\t }", "public function updateUser($data,$id)\n\t{\n\t\t$this->db->where($this->pro->user.'_id',$id);\n\t\treturn $this->db->update($this->pro->prifix.$this->pro->user,$data);\n\t\t\n\t}", "public static function modeloUserUpdate ($userid, $userdat){\n $stmt=self::$db->prepare(self::$update);\n \n $stmt->bindValue(1,$userdat[0]);\n $stmt->bindValue(2,$userdat[1]);\n $stmt->bindValue(3,$userdat[2]);\n $stmt->bindValue(4,$userdat[3]);\n $stmt->bindValue(5,$userdat[4]);\n $stmt->bindValue(6,$userid);\n if($stmt->execute()) {\n return true;\n }\n return false;\n}", "public function update_record($data, $id){\n\t\t$this->db->where('training_id', $id);\n\t\tif( $this->db->update('training',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}" ]
[ "0.76036704", "0.7368375", "0.71382445", "0.7040295", "0.7012188", "0.6936716", "0.6921201", "0.69071096", "0.68866855", "0.68412846", "0.68332964", "0.6826474", "0.6786775", "0.6770361", "0.67296875", "0.6728437", "0.6727717", "0.6727002", "0.6710375", "0.66954046", "0.6677425", "0.6672038", "0.6671361", "0.6654489", "0.66508603", "0.6638239", "0.6628259", "0.6619666", "0.6616659", "0.6610118" ]
0.79858106
0
/ function selectuser used to select specific column in users table $id id of user $col column you want to select
public function selectuser($id,$col) { $db = new DB(); $query = "SELECT ".$col." FROM `users` WHERE `id` =".$id; $result = $db->prepare($query); $result->execute(); $ProductData = $result->fetchAll(); $db = NULL; return $ProductData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SelectUserId($con,$id){\n $command = \"SELECT * from user_ WHERE id = '$id' \";\n $result = mysqli_query($con,$command);\n $row = mysqli_fetch_row($result);\n return $row;\n }", "function selectfuntion($id_user)\n {\n $conn = new mysqli(SERVER, USER, PASSWORD, DB);\n $sql = \"SELECT * FROM tb_user WHERE id_user='\".$id_user.\"';\";\n $result = $conn->query($sql);\n if ($result->num_rows > 0)\n {\n // output data of each row\n while($row = $result->fetch_assoc())\n {\n $id_tip_user = $row['id_tip_user'];\n }\n return $id_tip_user;\n }\n }", "public function selectUserbyId($id){\r\n\r\n $query = 'SELECT * FROM user_tbl WHERE id = ?';\r\n $stmt = $this->_db->prepare($query);\r\n $stmt->execute([$id]);\r\n $users = $stmt->fetchAll(PDO::FETCH_OBJ);\r\n if ($stmt->rowCount()){\r\n return $users;\r\n }\r\n\r\n }", "function selectUser($id) {\n $connection = openDb();\n $id = (int) $id;\n\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM users_view WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function selectCol($tbl, $col, $nameid) {\n $sql = \"SELECT {$nameid}, {$col} FROM {$tbl}\";\n $rez = $this->sql($sql);\n return $rez;\n }", "public function selectUserById($id){\r\n //2 prepare la requete\r\n $stmt=$connexion->prepare(\r\n \"SELECT *\r\n FROM User\r\n WHERE id=:id\"\r\n );\r\n //3 execute la requete\r\n $stmt->execute(\r\n array('id'=>$id)\r\n );\r\n // 4 Recuperation resultat et stockage ds variable\r\n $user=$stmt->fetchObject('User');\r\n // 5 retourne la variable (reslutat)\r\n return $user;\r\n }", "function GetUserName($id,$field){\n $con = mysqli_connect('localhost','root','','bloodbank');\n $users = mysqli_fetch_all(mysqli_query($con,\"SELECT * FROM users WHERE id ='\".$id.\"' \"),MYSQLI_ASSOC);\n return $users[0][\"$field\"];\n\n}", "public function selectViaId($id){\n$sql = \"SELECT id, login, email, password, id_droits FROM utilisateurs WHERE id = :id\";\n$stmt = $this->pdo->prepare($sql);\n$stmt->execute([\n 'id' => $id\n]);\n$userid = $stmt->fetch(PDO::FETCH_ASSOC);\nif(!$userid)\n{\n return false;\n}\n else\n {\n return $userid;\n }\n}", "public function selectUsersById($user_id) {\n\t\t\n\t\t\n\t\t\n\t\t\t$query = \" \n\t\t\tselect * FROM users\n\t\t\tWHERE user_id = :user_id\n\t\t\t\t\"; \n\t\t\n\t\ttry \n { \n $stmt = $this->_db->prepare($query); \n\t\t\t\n\t\t\t$stmt->bindValue(':user_id',$user_id);\n\t\t\t\n $stmt->execute(); \n\t\t\n\t\t\t$result = $stmt->fetchAll();\n\t\t\treturn $result;\n } \n catch(PDOException $ex) \n { \n\t\t\t$h = $ex->getMessage ();\n die($h); \n }\n\n\t\t\n\t\t\n }", "public function selectuser(){\r\n\t\t$query = \"SELECT * FROM users\";\r\n\t\t$add_query = parent::get_results($query);\r\n\t\t\r\n\t\treturn $add_query;\r\n\t\t// echo '<pre>';\r\n\t\t// print_r( $add_query );\r\n\t\t// echo '</pre>';\r\n\t\t// exit;\r\n\t}", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "function getUserId($user_name){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_username='$user_name'\", 'user_id');\n}", "function one_col_value($conn,$col_name,$table_name,$user_id,$return_col)\r\n\t{\r\n\t\t$qry=\"select * from $table_name where $col_name='$user_id'\";\r\n\t\t//echo $qry;\r\n\t\t$res=mysql_query($qry);\r\n\t\tif($res){\r\n\t\t\t $result=mysql_fetch_array($res);\r\n\t\t\t return $result[$return_col];\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn \"0\";\r\n\t\r\n\t}", "public function selectUserDetails($db, $id)\n {\n\n $query = \"SELECT * FROM users WHERE id = :userid\";\n $pdostmt2 = $db->prepare($query);\n $pdostmt2->bindValue(\":userid\", $id);\n /*$result = */$pdostmt2->execute();\n $userFetch = $pdostmt2->fetch(PDO::FETCH_ASSOC);\n $pdostmt2->closeCursor();\n return $userFetch;\n }", "public function SelectUser($userId) \n\t{\n $sql = \"SELECT userid, siteuserid, email, firstname, middlename, lastname, role, phoneres, phonecell, isactive, islocked, comments,createdon\"\n . \" FROM user \"\n . \" WHERE userid LIKE '\" . $userId . \"' \"\n . \" LIMIT 1\";\n \n\t\t//print_r($sql);\n return parent::queryFirst($sql);\n }", "function getuserfield($field){\n \t$query=\"SELECT $field FROM users WHERE userID=\".$_SESSION['RCMS_user_id'];\n \tif ($query_run=mysqli_query($GLOBALS['link'],$query)) {\n \t\tif ($query_result=mysqli_fetch_row($query_run)) {\n \t\t\treturn $query_result[0];\n \t\t}\n \t}\n }", "public function getUserById($id){\n $this->db->query('SELECT * FROM users WHERE us_id = :id');\n // Bind values\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n\n }", "public function get_detail_user($id, $what='*'){\n\t\t$row = $this->fetch(\"select $what from admin where id='$id'\");\n\t\tif (empty($row)){header(\"location:\".APP_URL.\"/error-404\");exit();}\n return $row;\n\t}", "public function getUserById($id)\n {\n\t $result = $this->getUserDbTable()->select()\n \t\t\t\t\t\t\t\t\t ->where('user_id = ?', (int)$id, 'INT')\n \t\t\t\t\t\t\t\t\t ->query()->fetch();\n \tif($result) return $result;\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}", "function wck_get_entry_field_user_select($id){\r\n\t\tif( !empty ( $id ) && is_numeric( $id ) ){\t\t\t\t\r\n\t\t\t$user = get_user_by( 'id', $id );\r\n\t\t\tif ( $user ) \r\n\t\t\t\treturn '<pre>'.htmlspecialchars( $user->display_name );\r\n\t\t\telse\r\n\t\t\t\treturn 'Error - User ID not found in database';\r\n\t\t\t\t\r\n\t\t} else {\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "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}", "function getfield($field){\r\n\t$mysql_host='localhost';\r\n$mysql_user='root';\r\n$mysql_pass='';\r\n\r\n$mysql_db='userdata';\r\n\tif(!($con=mysqli_connect($mysql_host,$mysql_user,$mysql_pass,$mysql_db))){\r\n\t\tdie(\"could not connect\");\r\n\t}\r\n\t$user_id= $_SESSION['user_id'];\r\n\t$query=\"SELECT `$field` FROM `users` WHERE id='$user_id'\";\r\n\tif($query_run=mysqli_query($con,$query)){\r\n\t\t$row=mysqli_fetch_assoc($query_run);\r\n\t\treturn $row[$field];\r\n\t} \r\n\r\n}", "function getUserEmail($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id='$id'\", 'user_email');\n}", "function getUsername($id){\n return sqlSelectOne(\"SELECT * FROM users WHERE user_id={$id}\", 'user_username');\n}", "function getFieldById($tableName, $columnName, $userID)\n{\n $hn = 'db707393488.db.1and1.com';\n $db = 'db707393488';\n $un = 'dbo707393488';\n $pw = '1Lovecandy!';\n $conn = new mysqli($hn, $un, $pw, $db);\n if ($conn->connect_error) die($conn->connect_error);\n $query = \"SELECT * FROM $tableName WHERE id='$userID';\";\n $result = $conn->query($query);\n $conn->close();\n $ret = $result->fetch_assoc()[$columnName];\n return $ret;\n}", "public function getUserById($id){\n $sql=\"SELECT * FROM users WHERE (id = ?)\";\n $select=parent::connect_db()->prepare($sql);\n $select->bindValue(1, $id);\n $select->execute();\n if($select->rowCount() > 0):\n return $select->fetchAll(\\PDO::FETCH_ASSOC);\n //return $results;\n else:\n return [];\n endif;\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}", "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}", "function getUsersData($ids, $cols, $acl) {\n\t$userids = idsToArray($ids);\n\t$cols = colsToSql($cols);\n\t\n\t// Get student table data\n\t// SELECT * FROM users WHERE (id = 1 OR id = 2 OR id = 3)\n\t$sql = \"SELECT $cols FROM users WHERE (\";\n\tforeach($userids as $userid) {\n\t\t$sql .= \"id = \" . $userid;\n\t\tif (end($userids) != $userid) { $sql .= \" OR \"; }\n\t\telse { $sql .= \") \"; }\n\t}\n\tif (gettype($acl) != 'NULL') {\n\t\t$sql .= \" AND $acl = 1\";\n\t}\n\t$sql .= \" ORDER BY name ASC\";\n\t$users = queryTable($sql);\n\t\n\treturn $users;\n}" ]
[ "0.71715015", "0.71331936", "0.71267277", "0.6933618", "0.69049597", "0.68222815", "0.67801845", "0.67542744", "0.67275053", "0.6714938", "0.67014617", "0.66716355", "0.66312784", "0.6592336", "0.656688", "0.65628886", "0.6525276", "0.65194124", "0.64842224", "0.6479683", "0.64650846", "0.6458627", "0.64557195", "0.64452547", "0.64443433", "0.64407057", "0.6430782", "0.6414804", "0.63834774", "0.63722354" ]
0.83362377
0
/ function GetUsersByLIMIT get 10 rows from users in specific category if $pageid = 5 the limet get from 40 to 50
public function GetUsersByLIMIT($pageid) { $db = new DB(); $start = 10*($pageid-1); $row = 10; $query = "SELECT * FROM `users` LIMIT $start,$row"; $stm = $db->prepare($query); $stm->execute(); $result = $stm->fetchAll(); $db = NULL; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getLoggedUsers($limit = null, $offset = 0);", "public function getUsersList($page) {\n $NumberUserOf1Page = 10;\n $pos = ($page - 1) * $NumberUserOf1Page;\n\n //connect to db \n $db = CTSQLite::connect();\n\n // Count total number Products\n $SelectQuerry = 'SELECT * FROM ic_user';\n $res = $db->query($SelectQuerry);\n $totalRecord = 0;\n while ($rows = $res->fetchArray()) {\n $totalRecord++;\n }\n $totalPages = ceil($totalRecord / $NumberUserOf1Page);\n\n //getting users datas from db\n $getUsersQuery = \"SELECT * FROM ic_user limit \" . $pos . \",\" . $NumberUserOf1Page;\n $result = $db->query($getUsersQuery);\n\n //an array to store each user's datas\n $row_results = array();\n\n //to count how many row in users db\n $count = 0;\n\n //pushing datas to $row_results\n\n while ($row = $result->fetchArray()) {\n array_push($row_results, $row);\n $count++;\n }\n\n //pushing out users datas\n for ($i = 0; $i <= $count - 1; $i++) {\n $row_results[$i]['currentPage'] = $page;\n //print_r($row_results[$i]);\n if (empty($row_results[$i]['id'])) {\n return $row_results;\n } else {\n // getting avatar's url\n $getAvaQuery = 'SELECT * FROM ic_pictures WHERE type = 9 AND user_id=' . $row_results[$i]['id'];\n $avatars = $db->query($getAvaQuery);\n $avatar = $avatars->fetchArray();\n $avatarUrl = $avatar['url'];\n $row_results[$i]['avatarUrl'] = $avatarUrl;\n \n // Count total number Users\n $SelectQuerry = 'SELECT * FROM ic_user';\n $res = $db->query($SelectQuerry);\n $counts = 0;\n while ($rows = $res->fetchArray()) {\n $counts++;\n }\n $row_results[$i]['totalRecord'] = $counts;\n }\n }\n\n return $row_results;\n $db->close();\n unset($db);\n }", "public function getAllUsers($currentPage = 1, $limit = 5)\n {\n $query = $this->createQueryBuilder('u')\n ->orderBy('u.username', 'ASC')\n ->getQuery();\n\n $paginator = $this->paginate($query, $currentPage, $limit);\n\n return $paginator;\n }", "function get_users(){\n global $database;\n $posts_per_page = 10;\n if(isset($_GET['posts_per_page'])){\n $posts_per_page = $_GET['posts_per_page'];\n }\n $page = 1;\n if(isset($_GET['page'])){\n $page = $_GET['page'];\n }\n\n if(!isset($_GET['filterby'])){\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users ORDER BY ID DESC\";\n }else{\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users ORDER BY ID DESC LIMIT \" . $posts_per_page;\n }\n return $database->query( $query );\n\n}", "public function sidebar_hot_users($uid = 0, $limit = 5)\n\t{\n\t\tif ($users_list = $this->fetch_all('users', 'uid <> ' . intval($uid) . ' AND reputation > 5 AND forbidden = 0', 'RAND()', ($limit * 4)))\n\t\t{\n\t\t\tforeach($users_list as $key => $val)\n\t\t\t{\n\t\t\t\tif (!$val['url_token'])\n\t\t\t\t{\n\t\t\t\t\t$users_list[$key]['url_token'] = urlencode($val['user_name']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tshuffle($users_list);\n\n\t\treturn array_slice($users_list, 0, $limit);\n\t}", "function get_all_user( $conds = array(), $limit = false, $offset = false ) {\n\t\t//print_r($conds);die;\n\t\t\n\t\t$this->custom_conds( $conds );\n\t\t\n\t\t// from table\n\t\t$this->db->from( $this->table_name );\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\t\treturn $this->db->get();\n\t\t //print_r($this->db->last_query());die;\n\t}", "public function PaginatedListOfUsers ()\n {\n $url = \"https://reqres.in/api/users\";\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 }", "function getUsers($limit, $offset=0) {\n $this->db->select(\"userName, email, userID, roleDescription\");\n $this->db->join('user_role', 'user_role.roleID = user.roleID'); \n $this->db->where('user.status',1);\n $this->db->order_by(\"userName\", \"asc\");\n\t\t$this->db->limit($limit, $offset);\n $query = $this->db->get('user');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "function getUsers($limit = 0)\n {\n\n // define all the global variables\n global $database;\n\n if ($limit == 0) {\n $sql = \"SELECT * FROM \" . TBL_USERS;\n } else {\n $sql = \"SELECT * FROM \" . TBL_USERS . \" LIMIT \" . $limit;\n }\n\n // get the sql results\n if (!$results = $database->getQueryResults($sql)) {\n return false;\n }\n\n $users = array();\n\n if ($database->getQueryNumRows($results, true) < 1) {\n return false;\n }\n\n foreach ($database->getQueryEffectedRows($results, true) as $row) {\n $currentUser = new User();\n $currentUser->initInstance($row);\n\n $users[] = $currentUser;\n }\n return $users;\n }", "public function onUsers($startpoint, $limit){\n\t\t\t$sql = \"SELECT *,`users`.`id`, `users`.`username`, `users`.`email`, `users`.`status`, `users`.`postby_id` AS `postby_id`, `usergroup`.`title` FROM `users` INNER JOIN `usergroup` ON `users`.`usergroup_id` = `usergroup`.`id` WHERE `users`.`status` = 'ON' ORDER BY `users`.`id` DESC LIMIT {$startpoint} , {$limit}\";\n\t\t\t// echo '<br><br>'.$sql;\n\t\t\t// die();\n\t\t\t$result = $this->execute($sql);\n\n\t\t\t// while($rows = mysqli_fetch_assoc($result)){\n\t\t\t// \techo '<br><br>Info: '.$rows['fullname'];\n\t\t\t// }\n \t// die();\n\t\t\tif($result){\n\t return $result;\n\t }\n\t\t}", "function d4os_io_db_070_os_users_online_users_list_paged($page = 0, $limit = 5, $headers) {\n if (!isset($_GET['page'])) {\n $_GET['page'] = $page;\n }\n if (!isset($_GET['order'])) {\n $_GET['order'] = 'loginTime';\n }\n if (!isset($_GET['sort'])) {\n $_GET['sort'] = 'DESC';\n }\n /*\n * uuid\n * agentIP\n * agentPort\n * loginTime\n * logoutTime\n * currentRegion\n * currentRegionName\n * currentHandle\n * currentPos\n * currentLookAt\n */\n d4os_io_db_070_set_active('os_robust');\n $result = pager_query(\"SELECT * FROM {Presence} AS p\"\n . \" LEFT JOIN {UserAccounts} AS ua ON ua.PrincipalID=p.UserID\"\n . \" LEFT JOIN {Regions} AS r ON r.uuid=p.RegionID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=p.UserID\"\n . \" WHERE gu.Online = 'true'\"\n . \" AND gu.Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND gu.Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" %s\", $limit, 0, NULL, array(tablesort_sql($headers)));\n while ($user = db_fetch_object($result)) {\n $items[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $items;\n}", "function getAllUsers($max = null, $offset = null) {\n $argv = func_get_args();\n if (count($argv) == 0) {\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\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 $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;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildArrayResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n } else {\n /**\n * Gets all users by Paging\n *\n * @param max\n * - Maximum number of records to be fetched\n * @param offset\n * - From where the records are to be fetched\n *\n * @return the List that contains all User Object\n */\n Util::validateMax($max);\n Util::throwExceptionIfNullOrBlank($max, \"Max\");\n Util::throwExceptionIfNullOrBlank($offset, \"Offset\");\n $encodedMax = Util::encodeParams($max);\n $encodedOffset = Util::encodeParams($offset);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\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['max'] = $max;\n $signParams['offset'] = $offset;\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 . \"/paging/\" . $encodedMax . \"/\" . $encodedOffset;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildArrayResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }\n }", "function browseUserFriends($userID, $page = 1, $limit = 25) {\n $selectFrom = ($page - 1) * $limit;\n $sql = 'SELECT Users.id, Users.name\n FROM Users\n LEFT OUTER JOIN Friends On Friends.friendID = Users.id\n WHERE Friends.userID = \\'' . $userID . '\\'\n ORDER BY Users.name\n LIMIT ' . $selectFrom . ', ' . $limit;\n $db = new Database();\n $results = $db->select($sql);\n return $results;\n }", "public function getMembersCategoryAll($categoryId, $searchType = 'newest', $startLimit = 0, $limit = 4)\n {\n if ($searchType == 'newest') {\n $searchType = \"u.user_id DESC\";\n } else if ($searchType == 'rating') {\n $searchType = \"balance DESC\"; \n } else if ($searchType == 'alphabetical') {\n $searchType = \"u.username ASC\";\n } else {\n $searchType = \"u.user_id DESC\";\n }\n \n $select = $this->getTable()->select();\n $select->setIntegrityCheck(false)\n ->from(array('u' => 'job_user'), array('u.user_id', 'u.username', 'u.created_on', \n 'u.country', 'u.is_premium',\n 'u.profile_image', \n 'balance' => '(SELECT SUM(cb.balance) \n FROM job_credit_balance cb \n WHERE cb.user_id = u.user_id)'))\n ->joinLeft(array('pc' => 'job_primary_category'), \n 'u.primary_category_id = pc.primary_category_id', \n array('pc.category_title'))\n ->joinLeft(array('p'=>'job_project'), \n 'u.user_id = p.assigned_user_id AND p.project_status = \"closed\"', \n array('closed_projects' => 'COUNT(p.project_status)'));\n if ($categoryId != 'all') {\n $select->where('u.primary_category_id = ?', $categoryId);\n }\n $select->group('u.user_id')\n ->order($searchType)\n ->limit($limit, $startLimit);\n $rowSets = $this->getTable()->fetchAll($select);\n\n $info = array();\n foreach($rowSets as $k => $row) {\n $user = new Application_Model_User();\n $user->setUserId($row->user_id);\n $user->setUsername($row->username);\n $user->setCreatedOn($row->created_on);\n $user->setCountry($row->country);\n $user->setIsPremium($row->is_premium);\n $user->setProfileImage($row->profile_image);\n $user->setUserWorked($row->closed_projects);\n $user->setBalance($row->balance);\n $user->setRating($this->getUserRating($row->balance));\n $primaryCategory = new Application_Model_PrimaryCategory();\n $primaryCategory->setCategoryTitle($row->category_title);\n $user->setPrimaryCategory($primaryCategory);\n $info[] = $user;\n }\n \n return $info;\n }", "function users($limit = 20) {\n $this->auth(SUPPORT_ADM_LEVEL);\n $this->load->view('admin/support/v_list_users');\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 }", "public function GetByPaginated($offset, $limit, $userId);", "public function getOrderedPosts($idUser, $category, $private, $page, $limit);", "public function topContributors()\r\n {\r\n $this->paginatedResult->setLimit(35);\r\n $this->paginatedResult->setOffset(0);\r\n $query = \"SELECT count(b.id) as total , b.user_login, b.profile_image FROM links a inner join users b on a.ID_User = b.ID where a.id_status = 4 group by b.user_login order by total DESC\";\r\n $this->paginatedResult->setQuery( $query );\r\n\t$this->paginatedResult->setMethod( 'cache' );\r\n\t$this->paginatedResult->generatePagination();\r\n\treturn $this->paginatedResult;\r\n }", "function newsItem_PageLimit_Populer_All_Publik_ByKategori( $tbl_news, $idkategori, $tanggalhariini, $dataPerPage ){\n\t\t$sql = mysql_query(\"\n\t\tSELECT * FROM $tbl_news WHERE \n\t\t\tidkategori = '$idkategori' AND\n\t\t\ttgltampil <= '$tanggalhariini' AND\n\t\t\tstatustampil='1' AND\n\t\t\ttgltampil <= '$tanggalhariini' AND\n\t\t\tdilihat >= '5'\n\t\t\t\n\t\tORDER BY urutan DESC LIMIT $dataPerPage\");\n\t\treturn $sql;\n}", "function mentor_list($limit='',$start=0,$condition='')\n{\n\tglobal $DB;\n\t$sql =\"SELECT u.id,u.firstname,u.lastname,u.email,u.city,u.picture,u.department FROM {user} u left join {user_info_data} ud on ud.userid=u.id \";\n\t$sql.=\"WHERE ud.data='mentor data' and ud.acceptterms=1 and u.deleted=0 $condition order by u.timemodified desc limit $start,$limit\";\n\t//echo $sql;die;\n\t$result = $DB->get_records_sql($sql);\n\tif(count($result)>0){\n\t\tforeach($result as $mentordata)\n\t\t{\n\t\t\t$user = new stdClass();\n\t\t\t$user->id = $mentordata->id;\n\t\t\t//$picture = get_userprofilepic($user);\n\t\t\t$userurl = getuser_profilelink($user->id);\n\t\t\t$usrimg = get_userprofilepic($user);\n\t\t\t$picture ='<div class=\"left picture\"><a href=\"'.$userurl.'\" >'.$usrimg.'</a></div>'; \n\t\t\t$mentordata->picture = $picture;\n\t\t}\n\t}\n\treturn $result;\n}", "public function retrieve_portfolio_possible_view_users($condition, $count, $offset, $order_property);", "public function all($limit = 5, $offset = 0);", "public function all($limit = 5, $offset = 0);", "public function getUserPaginatedFeed($userId, $perPage);", "function fetchList($limit, $offset);", "function newsItem_PageLimit_Terkini( $tbl_news, $dataPerPage ){\n\n\t\t\t\t\t$sql = mysql_query(\"\n\t\t\t\t\t\tSELECT * FROM $tbl_news ORDER BY urutan DESC, timeunix DESC LIMIT $dataPerPage\n\t\t\t\t\t\");\n\t\t\t\t\treturn $sql;\n}", "function getCateByPage($page, $pageSize = 3)\n{\n $sql = \"select * from shopping_cate\";\n global $totalRowsCate;\n $totalRowsCate = getResultNum($sql);\n global $totalPageCate;\n // echo $totalRows;\n // $pageSize = 3;\n // ceil() 函数向上舍入为最接近的整数\n $totalPageCate = ceil($totalRowsCate / $pageSize);\n\n if ($page < 1 || $page == null || !is_numeric($page)) {\n $page = 1;\n }\n if ($page > $totalPageCate) {\n $page = $totalPageCate;\n }\n $offset = ($page - 1) * $pageSize;\n $sql = \"SELECT id,cName FROM shopping_cate ORDER BY id LIMIT {$offset},{$pageSize}\";\n // $rows = getAllAdmin();\n $rowsCate = &fetchAll($sql);\n return $rowsCate;\n}", "public static function get_items($limit=0, $category = null) {\r\n\t\t$dq = Doctrine_Query::create ()\r\n\t\t\t\t\t\t\t->from ( 'Wiki w' )\r\n\t\t\t\t\t\t\t->leftJoin ( 'w.WikiCategories wc' );\r\n\t\tif($limit > 0){\r\n\t\t\t$dq->limit($limit);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(is_numeric($category)){\r\n\t\t\t$dq->where('w.category_id = ?', $category);\r\n\t\t}\r\n\t\t\r\n\t\t$dq->orderBy('RAND()');\r\n\t\t\r\n\t\treturn $dq->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t}", "public static function getAllUsers($limit=null) {\n $query = sprintf(\" SELECT id FROM %s ORDER BY creation_date DESC \", self::DB_TABLE);\n $db = Db::instance();\n $result = $db->lookup($query);\n if(!mysql_num_rows($result))\n return null;\n else {\n $objects = array();\n while($row = mysql_fetch_assoc($result)) {\n $objects[] = self::loadById($row['id']);\n }\n return ($objects);\n }\n }" ]
[ "0.70817137", "0.6756101", "0.6747797", "0.6672366", "0.6536657", "0.6524269", "0.64828974", "0.64484155", "0.6348663", "0.62867594", "0.628042", "0.6267979", "0.62514126", "0.6235322", "0.62102246", "0.620263", "0.6182315", "0.61806136", "0.6150867", "0.6150841", "0.61402404", "0.6137555", "0.61250114", "0.61250114", "0.6123906", "0.61047834", "0.60778576", "0.60615057", "0.60589653", "0.6054928" ]
0.82997054
0
Add css file add single css file as asset
public function add_css($file) { $this->add("css", $file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "public function addCssFile($name)\n {\n $this->fileStyles[] = $name;\n }", "function css($file)\n {\n return assets('css', $file);\n }", "public function add_css ( $filename )\n {\n\n \n if(substr($filename,0,1) != \"/\"){\n $path = basedir . $this->templatePath . 'css' . DS . $filename;\n $fileLoc = DS . $this->templatePath . 'css' . DS . $filename;\n } else {\n $path = basedir . $filename;\n $fileLoc = $filename;\n }\n if( in_array( $fileLoc, $this->css_files ) == true )\n {\n return null;\n }\n \n if( file_exists($path) == false )\n {\n /*------------ERROR------------*/\n // $this->reg->debug->error('Error','Function add_css()', 'Css file not found. File: '.$path, DateTime, $this);\n \n //log::write(\"Css file not found. File: `$path`\", $this, 'add_css()');\n return false;\n }\n $this->css_files[] = str_replace(\"\\\\\",\"/\", $fileLoc);\n $this->includeLibs();\n }", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "public function addCss($file)\n\t{\n\t\t$this->_themeExtras['css'][] = array('file' => $file);\n\t}", "public function css()\n {\n $assets = array();\n foreach (Config::get('ImageUpload::assets.css') as $file) {\n $assets[] = new FileAsset(public_path($this->assetPath.'css/'.$file));\n }\n $css = new AssetCollection($assets, array(\n new CssMinFilter(),\n ));\n\n $response = Response::make($css->dump(), 200);\n $response->header('Content-Type', 'text/css');\n return $response;\n }", "public function addCSSFiles($css /* array */);", "public function addCss($fileAsset)\n {\n if (!$fileAsset instanceof FileAssetInterface) {\n $fileAsset = $this->setupAsset(new Stylesheet(), $fileAsset, func_get_args());\n }\n $fileAsset->setFileName($this->getAssetPath($fileAsset->getFileName()));\n $this->getApp()['asset.queue.file']->add($fileAsset);\n }", "public function addCss($path)\n {\n if ($this->_isAbsolute($path)) {\n return $this->data(self::CSS, $path);\n }\n $this->data(self::CSS, $this->staticPath() . '/css/' . $path);\n }", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "public function add_css($css) {\n $current = $this->dwoo_data->css_files;\n $current[] = $css;\n $this->dwoo_data->css_files = $current;\n }", "public function add_css($name, $data = array())\n\t{\n\t\t$this->add_asset('css', $name, $data);\n\t}", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "public function addCSS($css) {\r\n\t\t\t$this->css.= \"<link rel='stylesheet' type='text/css' href='$css.css' >\";\r\n\t\t}", "function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }", "protected function loadCss() {}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "static function emAddCssFile($cssPath, $media=\"all\", $levelStr=\"\") {\n\t$timestamp = filemtime( __DIR__ . \"/\" . $cssPath );\n self::$emHeader_line[] = \"<link rel='stylesheet' type='text/css' media='{$media}' href='{$levelStr}{$cssPath}?v={$timestamp}'>\";\n}", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "public function registerCss($file)\n {\n if ($file) {\n $bundle = \\backend\\assets\\AppAsset::register(\\Yii::$app->view);\n\n if (is_array($file)) {\n foreach ($file as $fi) {\n $bundle->css[] = $fi;\n }\n } else {\n $bundle->css[] = $file;\n }\n }\n }", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "function includeCss($fileName) {\n $data = '<link type=\"text/css\" rel=\"Stylesheet\" href=\"'.BASE_PATH.'/public/css/'.$fileName.'.css\" />';\n return $data;\n }", "public function addAssets() {}", "public function addAssets() {}" ]
[ "0.72234184", "0.69790673", "0.68115455", "0.6791187", "0.6777973", "0.6775224", "0.67675984", "0.6761759", "0.67209613", "0.6696885", "0.66819483", "0.6645986", "0.66286993", "0.6590916", "0.6580988", "0.65565956", "0.6554432", "0.65357906", "0.6527348", "0.6518446", "0.6512079", "0.65056694", "0.64909035", "0.6490272", "0.64809644", "0.64370507", "0.6375146", "0.6350268", "0.6331156", "0.6331156" ]
0.70641446
1
Add image file add single image file as asset
public function add_image($file) { $this->add("image", $file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addImageAction()\n\t\t{\n\n\t\t\tif(isset($_FILES['image']))\n\t\t\t{\n\t\t\t\t$imagename=$_FILES['image']['name'];\n\t\t\t\t$imagetemp=$_FILES['image']['tmp_name'];\n\t\t\t\t$imagesize=$_FILES['image']['size'];\n\t\t\t\t$imageext=pathinfo($imagename, PATHINFO_EXTENSION);\n\t\t\t\t$imagepath='Images/Projects/'.$imagename;\n\n\t\t\t\t$arrayext=array('jpg','JPG','jpeg','JPEG','png','PNG');\n\n\t\t\t\tif(in_array($imageext, $arrayext))\n\t\t\t\t{\n\t\t\t\t\tmove_uploaded_file($imagetemp, $imagepath);\n\n\t\t\t\t\techo $imagename;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function addAssets() {}", "public function addAssets() {}", "public function addImage(ImageMedia $image);", "public function add_image() {\n\t $this->use_layout=false;\n\t $this->page = new $this->model_class(Request::get('id'));\n\t\t$this->join_name = \"images\";\n\t if(Request::post(\"id\")) {\n\t\t $this->image = new WildfireFile(Request::post('id'));\n\t\t $this->image->join_order = Request::post('order');\n\t\t $this->page->images = $this->image;\n\t }\n\t}", "public function addPhotoAction(){\n $data = $this->getRequestData();\n $types = array('activity', 'operation', 'people');\n if(isset($data['photo']['name']) && isset($data['photo']['content']) && isset($data['type']) && in_array($data['type'], $types)){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/images/'.$data['type'].'/'.$user->getKey().'-'.$data['type']);\n if (!$folder) {\n switch($data['type']){\n case 'activity':\n $fid = 3;\n break;\n case 'operation':\n $fid = 4;\n break;\n case 'people':\n $fid = 7;\n break;\n }\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-\" . $data['type']);\n $folder->setParentId($fid);\n $folder->save();\n }\n\n $asset = new Asset_Image();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save photo!');\n }\n } else {\n $this->setErrorResponse('photo and type is mandatory for this request!');\n }\n\n $this->_helper->json(array('photo' => $asset->getId()));\n }", "public function addImage($url){\n //todo add images in xml simetamp\n $f=Francis::get($url);\n if ( $f->exists() && $f->isImage()) {\n $this->images[]=GiveMe::urlFile(Robert::fromImage($f->path)->jpg(80),true);\n }\n }", "function images($file)\n {\n return assets('images', $file);\n }", "public function addImage($url, $attributes = []);", "public function add()\n\t{\n\t\tforeach (func_get_args() as $script) {\n\t\t\t$asset = $this->input_path . $script;\n\t\t\tarray_push($this->files, $asset);\n\t\t}\n\t}", "function _asset_img(string $file, string $pack = '') {\n\t\treturn Asset::setThemePack($pack)->getImg($file);\n\t}", "public function add_asset(Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$storage = new Storage;\n \t\t$storage->name = $request->name;\n \t\t$storage->quantity = $request->quantity;\n \t\t$storage->category_id = $request->category;\n \t\t$image = $request->file('image');\n\t\t$image_name = time() . \".\" . $image->getClientOriginalExtension();\n\t\t$destination = \"images/\";\n\t\t$storage->image_url = $image->move($destination, $image_name);\n\t\t$storage->save();\n\t\tsession()->flash('success_message', 'Item Added successfully');\n\t\treturn redirect('/storage');\n \t}", "private function addAsset($src, $type)\n {\n if(file_exists($src))\n {\n $this->assets[$type][] = $src;\n $this->assetsRel[$type][] = str_replace($this->docroot, '', $src);\n }\n }", "protected function combineImages() {}", "protected function addImage($image)\n\t{\n\t\t$path = $this->config->get('import_image_dir', '');\t\t\n\t\t$imagePath = 'data/' . $path . $image;\n\t\t\n\t\tif (is_file(DIR_IMAGE . $imagePath)) {\n\t\t\treturn $imagePath;\n\t\t}\n\t\treturn '';\n\t}", "public function addFile($file);", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "function asset_image_tag($asset, $thumbnail_type = 'full', $options = array(), $relative_path = null)\n{\n if ($asset == null) {\n return '';\n }\n $options = array_merge(array(\n 'alt' => $asset->getDescription() . ' ' . $asset->getCopyright(),\n 'title' => $asset->getDescription() . ' ' . $asset->getCopyright()\n ), $options);\n\n if($asset->isImage())\n {\n $src = $asset->getUrl($thumbnail_type, $relative_path);\n }\n else\n {\n if($thumbnail_type == 'full')\n {\n throw new sfAssetException('Impossible to render a non-image asset in an image tag');\n }\n else\n {\n switch($asset->getType())\n {\n case 'txt':\n $src = '/sfAssetsLibraryPlugin/images/txt.png';\n break;\n case 'xls':\n $src = '/sfAssetsLibraryPlugin/images/xls.png';\n break;\n case 'doc':\n $src = '/sfAssetsLibraryPlugin/images/doc.png';\n break;\n case 'pdf':\n $src = '/sfAssetsLibraryPlugin/images/pdf.png';\n break;\n case 'html':\n $src = '/sfAssetsLibraryPlugin/images/html.png';\n break;\n case 'archive':\n $src = '/sfAssetsLibraryPlugin/images/archive.png';\n break;\n case 'bin':\n $src = '/sfAssetsLibraryPlugin/images/bin.png';\n break;\n default:\n $src = '/sfAssetsLibraryPlugin/images/unknown.png';\n }\n }\n }\n return image_tag($src, $options);\n}", "public function addImg($item_id, $imgfile)\n {\n // if this is the first added img, set it as defimg also\n $defimg = array();\n if ( ! $this->db->getOne(array('id'=>$item_id), array('imgs')))\n $defimg = array('defimg'=>$imgfile);\n\n if ( $this->db->update(array('id'=>$item_id), array_merge($defimg, array('$addToSet'=>array('imgs'=>$imgfile)))) )\n $msg = array('status'=>'success', 'action'=>'add_img', 'info'=>$imgfile);\n else if ( $error = $this->db->getError() )\n $msg = array('status'=>'failure', 'action'=>'add_img', 'info'=>$error);\n else\n $msg = array('status'=>'failure', 'action'=>'add_img', 'info'=>'unknown error');\n\n return $msg;\n }", "public function StaticImageUpload(){\n $design_id = $_POST['new_filename'];\n $uid = $_POST['uid'];\n $uid = empty($uid) ? 0 : $uid;\n $exp = explode(\".\", $_FILES[\"file\"][\"name\"])[1];\n $filename = $design_id.'.'.$exp;\n $new_file = 'public://files/'.$uid.'/kmds/images/static_image/' . $filename;\n $uploaded_image = file_get_contents($_FILES[\"file\"][\"tmp_name\"]);\n file_put_contents($new_file, $uploaded_image);\n $source_original = array(\"src\" => file_create_url($new_file));\n return new JsonResponse($source_original);\n }", "public function addImage(array $args = array()) {\n // Check input params\n if (!isset($args[\"path\"])) {\n throw new \\Exception(\"Param path is required. You can`t add image without path\");\n }else{\n if (!is_file($args[\"path\"])) {\n throw new \\Exception(\"Image dont found on {$args['path']}\");\n }\n }\n\n // Default values for image\n $defaults = array(\n \"type\" => \"image\",\n \"scale\" => 1, // Scale of image\n\t \"z-index\" => count($this->objects) // Z-index of element\n\t );\n\n // Merge default params and user params\n $params = array_merge($this->default_params, $args);\n $this->objects[] = array_merge($defaults, $params);\n\n return $this;\n }", "private function add($type, $file)\n {\n array_push($this->asset[$type], $file);\n }", "public function action_image()\n\t{\n\t\t//Image::load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')->preset('mypreset', DOCROOT.'/files/04_2021/ea7e8ed4bc9d6f7c03f5f374e30b183b.png');\n\t\t$image = Image::forge();\n\n\t\t// Or with optional config\n\t\t$image = Image::forge(array(\n\t\t\t\t'quality' => 80\n\t\t));\n\t\t$image->load(DOCROOT.'/files/04_2021/79199dcc06baf4cc230262fcbb4d1094.jpg')\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->rounded(100)\n\t\t\t\t\t->output();\n\t\t// Upload an image and pass it directly into the Image::load method.\n\t\tUpload::process(array(\n\t\t\t'path' => DOCROOT.DS.'files'\n\t\t));\n\n\t\tif (Upload::is_valid())\n\t\t{\n\t\t\t$data = Upload::get_files(0);\n\n\t\t\t// Using the file upload data, we can force the image's extension\n\t\t\t// via $force_extension\n\t\t\tImage::load($data['file'], false, $data['extension'])\n\t\t\t\t\t->crop_resize(200, 200)\n\t\t\t\t\t->save('image');\n\t\t} \n\t}", "private function addAssets()\n {\n foreach (config('asgard.media.assets.media-partial-assets', []) as $assetName => $path) {\n $path = $this->assetFactory->make($path)->url();\n $this->assetManager->addAsset($assetName, $path);\n }\n }", "function postImage($path)\n \t{\n return $path && file_exists('storage/'.$path) ? asset('storage/'.$path) : asset('img/product/noimage.jpg');\n \t}", "function file_image($imageType, $props = array(), $file = null)\n{\n if (!$file) {\n $file = get_current_record('file');\n }\n $fileMarkup = new Omeka_View_Helper_FileMarkup;\n return $fileMarkup->image_tag($file, $props, $imageType);\n}", "function add()\n\t{\n\t\t$CFG = $this->config->item('image_configure');\n\t\t$data[\"title\"] = _e(\"Image\");\n\t\t## for check admin or not ##\n\t\t$data[\"response\"] = addPermissionMsg( $CFG[\"sector\"][\"add\"] );\t\t\t\n\t\t## Other auxilary variable ##\n\t\t$data['var'] = array();\t\t\n\t\t$this->load->module('context/context_admin');\n\t\t$user_context = $this->context_admin->getContext();\n\t\t$data['var']['context_dd'] = ( array('' => _e('Choose Context') ) + $user_context );\n\t\t$data['var']['relation_dd'] = ( array('' => _e('Choose Relation') ) );\n\t\t$data[\"top\"] = $this->template->admin_view(\"top\", $data, true, \"image\");\t\n\t\t$data[\"content\"] = $this->template->admin_view(\"image_add\", $data, true, \"image\");\n\t\t$this->template->build_admin_output($data);\n\t}", "public static function createFileImage(array $img = [])\n {\n global $context, $modSettings;\n\n if (empty($img)) {\n $img = [\n 'key' => 'image',\n 'path' => $modSettings['elga_files_path'],\n 'maxsize' => 1024 * 1024 * 3,\n 'max_thumb_width' => empty($modSettings['elga_imgthumb_max_width']) ? 200 : $modSettings['elga_imgthumb_max_width'],\n 'max_thumb_height' => empty($modSettings['elga_imgthumb_max_height']) ? 200 : $modSettings['elga_imgthumb_max_height'],\n 'max_preview_width' => empty($modSettings['elga_imgpreview_max_width']) ? 450 : $modSettings['elga_imgpreview_max_width'],\n 'max_preview_height' => empty($modSettings['elga_imgpreview_max_height']) ? 450 : $modSettings['elga_imgpreview_max_height'],\n 'is_preview' => true,\n ];\n }\n\n $name = $_FILES[$img['key']]['name'];\n $tmpname = $_FILES[$img['key']]['tmp_name'];\n $fname = pathinfo($name, PATHINFO_FILENAME);\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $fsize = filesize($tmpname);\n\n if ( ! self::findFileUploadErrors($img['key'], $img['path'], $img['maxsize']) ) {\n return false;\n }\n\n $sha1 = sha1_file($tmpname);\n $nfname = $sha1 . '.' . $ext;\n $date = date('Y/m/d', time());\n $dest_dir = $img['path'].'/'.$date;\n if (!is_dir($dest_dir)) {\n if (!mkdir($dest_dir, 0777, true)) {\n fatal_error('Не получается создать директорию '.$dest_dir);\n }\n }\n $dest_name = $dest_dir.'/'.$nfname;\n\n // уже существует файл с таким же названием,\n // добавим к концу имени цифру\n if ( file_exists($dest_name) ) {\n // http://www.cowburn.info/2010/04/30/glob-patterns/\n $samefiles = glob($dest_dir.'/'.$sha1.'-[!_].*');\n natcasesort($samefiles);\n $last_same = array_pop($samefiles);\n if (preg_match('~-([0-9]+)\\.[\\w]+$~', $last_same, $ms)) {\n $nfname = $sha1 . '-' . ($ms[1] + 1) . '.' . $ext;\n } else {\n $nfname = $sha1 . '-1.' . $ext;\n }\n }\n\n $dest_name = $dest_dir.'/'.$nfname;\n if (file_exists($dest_name)) {\n fatal_error('уже существует файл с таким же названием');\n }\n\n if (!move_uploaded_file($tmpname, $dest_name) && $sha1 === sha1_file($dest_name)) {\n fatal_error('Ошибка копирования временного файла!', false);\n } else {\n // create thumb image\n $thumb_name = pathinfo($dest_name, PATHINFO_FILENAME).'_thumb.'.pathinfo($dest_name, PATHINFO_EXTENSION);\n self::thumb($dest_name, $dest_dir.'/'.$thumb_name, $img['max_thumb_width'], $img['max_thumb_height']);\n\n // create preview image\n if ( $img['is_preview'] ) {\n $preview_name = pathinfo($dest_name, PATHINFO_FILENAME).'_preview.'.pathinfo($dest_name, PATHINFO_EXTENSION);\n self::thumb($dest_name, $dest_dir.'/'.$preview_name, $img['max_preview_width'], $img['max_preview_height']);\n }\n\n return [\n 'name' => $date.'/'.$nfname,\n 'orig_name' => $name, // ? need sanitize?\n 'size' => $fsize,\n 'thumb' => $date.'/'.$thumb_name,\n 'preview' => $img['is_preview'] ? $date . '/' . $preview_name : '',\n 'fhash' => $sha1,\n ];\n }\n }", "public function addFileAction() \n {\n // Get the file name from GET variable\n $fileName = $this->params()->fromQuery('name', '');\n \n $userId = $this->params()->fromQuery('id', '');\n \n // Check whether the user needs a thumbnail or a full-size image\n $isThumbnail = (bool)$this->params()->fromQuery('thumbnail', false);\n \n // Validate input parameters\n if (empty($fileName) || strlen($fileName)>128) {\n throw new \\Exception('File name is empty or too long');\n }\n \n // Get path to image file\n $fileName = $this->imageManager->getAddImagePathByName($fileName, $userId);\n \n if($isThumbnail) { \n // Resize the image\n $fileName = $this->imageManager->resizeImage($fileName);\n }\n \n // Get image file info (size and MIME type).\n $fileInfo = $this->imageManager->getImageFileInfo($fileName); \n if ($fileInfo===false) {\n // Set 404 Not Found status code\n $this->getResponse()->setStatusCode(404); \n return;\n }\n \n // Write HTTP headers.\n $response = $this->getResponse();\n $headers = $response->getHeaders();\n $headers->addHeaderLine(\"Content-type: \" . $fileInfo['type']); \n $headers->addHeaderLine(\"Content-length: \" . $fileInfo['size']);\n \n // Write file content \n $fileContent = $this->imageManager->getImageFileContent($fileName);\n if($fileContent!==false) { \n $response->setContent($fileContent);\n } else { \n // Set 500 Server Error status code\n $this->getResponse()->setStatusCode(500);\n return;\n }\n \n if($isThumbnail) {\n // Remove temporary thumbnail image file.\n unlink($fileName);\n }\n \n // Return Response to avoid default view rendering.\n return $this->getResponse();\n }", "public function add($name)\n\t{\n\t\tif ( ! isset($this->assets[$name]))\n\t\t{\n\t\t\t$this->assets[$name] = new Asset($this->type, $name, $this, $this->app);\n\t\t}\n\t}" ]
[ "0.64331734", "0.64152443", "0.64152443", "0.62744707", "0.62731314", "0.6165895", "0.61588275", "0.612056", "0.6052848", "0.6032063", "0.6001741", "0.59735525", "0.596956", "0.57849073", "0.5762129", "0.57533777", "0.5750299", "0.5714915", "0.5708365", "0.57067305", "0.56991047", "0.5691753", "0.56825644", "0.56745297", "0.56648904", "0.5655881", "0.56550735", "0.56409276", "0.5608933", "0.55932105" ]
0.69768316
0
Add less file add single less file as asset
public function add_less($file) { $this->add("less", $file); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addLessFiles()\n {\n $less = new \\Shopware\\Components\\Theme\\LessDefinition(\n array(),\n array(__DIR__ . '/Views/frontend/_public/src/less/all.less'),\n __DIR__\n );\n\n return new Doctrine\\Common\\Collections\\ArrayCollection(array($less));\n }", "public function lessFileBundler()\n {\n return $this->fileFilter(\n 'scripts.less',\n $this->createPath('public/css'),\n new GlobAsset($this->createPath('assets/less/*')),\n $this->filters['less']\n );\n }", "public function less() {\r\n $head = pzk_element($this->scriptTo);\r\n debug($head);die();\r\n $head->append(pzk_parse('<script src=\"/3rdparty/less.min.js\"></script>'));\r\n if ($this->lessLink != false) {\r\n if(!$this->scriptTo) {\r\n $elem = pzk_element($this->scriptTo);\r\n $elem->append(pzk_parse('<html.less src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/less/'.$this->cssLink.'.less\" />'));\r\n } else {\r\n if($page = pzk_page())\r\n $page->addObjLess($this->cssLink);\r\n }\r\n\r\n }\r\n if ($this->lessExternalLink != false) {\r\n if($this->scriptTo) {\r\n $elem = pzk_element($this->scriptTo);\r\n $elem->append(pzk_parse('<html.less src=\"'.$this->cssExternalLink.'\" />'));\r\n } else {\r\n if($page = pzk_page()) {\r\n $page->addExternalLess($this->cssExternalLink);\r\n }\r\n }\r\n\r\n }\r\n\r\n }", "function _creative_include_layout_additional_assets($file_name) {\n foreach (array('css', 'js') as $type) {\n $file_relative_path = CREATIVE_THEME_PATH . \"/$type/includes/$file_name.$type\";\n\n if (file_exists(DRUPAL_ROOT . '/' . $file_relative_path)) {\n call_user_func(\"drupal_add_$type\", $file_relative_path, array(\n 'group' => constant(strtoupper($type) . '_THEME'),\n ));\n }\n }\n}", "function less($less){\n\n\t$css = substr($less, 0, -4).'css';\n\t\n\t$css_ = str_replace('/admin/', '/app/module/', $css);\n\t$les_ = str_replace('/admin/', '/app/module/', $less);\n\n\t$statCss = @stat(KROOT.$css_);\n\t$statLes = @stat(KROOT.$les_);\n\t\n\tif($statCss['mtime'] > $statLes['mtime']){\n\t\t$head = '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$css.'\" />'.PHP_EOL;\n\t#\tdefine('USELESS', false);\n\t}else{\n\t\t$head = '<link rel=\"stylesheet/less\" type=\"text/css\" href=\"'.$less.'\" />'.PHP_EOL;\n\t#\tdefine('USELESS', true);\n\t}\n\n\treturn $head;\n}", "public function renderAsset($file, $options = array()){\n \n $less = new lessc;\n \n if(is_array($this->import_dir) && count($this->import_dir) > 0){\n $less->setImportDir($this->import_dir);\n }\n \n if(array_key_exists('compress', $options) && $options['compress'] == true){\n $less->setFormatter('compressed');\n }else{\n $less->setFormatter('classic');\n }\n \n if(array_key_exists('remove_comments', $options) && $options['remove_comments'] == true){\n $less->setPreserveComments(false);\n }else{\n $less->setPreserveComments(true);\n }\n \n return $less->compileFile($file);\n }", "protected function get_less_file_name() {\n\t\t\treturn get_template_directory() . '/css/dynamic-less/shortcodes/breadcrumbs.less';\n\t\t}", "function enqueue_less_styles( $tag, $handle ) {\n global $wp_styles;\n $match_pattern = '/\\.less$/U';\n if ( preg_match( $match_pattern, $wp_styles->registered[$handle]->src ) ) {\n $handle = $wp_styles->registered[$handle]->handle;\n $media = $wp_styles->registered[$handle]->args;\n $href = $wp_styles->registered[$handle]->src . '?ver=' . $wp_styles->registered[$handle]->ver;\n $rel = isset($wp_styles->registered[$handle]->extra['alt']) && $wp_styles->registered[$handle]->extra['alt'] ? 'alternate stylesheet' : 'stylesheet';\n $title = isset($wp_styles->registered[$handle]->extra['title']) ? \"title='\" . esc_attr( $wp_styles->registered[$handle]->extra['title'] ) . \"'\" : '';\n $tag = \"<link rel='stylesheet/less' id='$handle' $title href='$href' type='text/less' media='$media' />\";\n }\n return $tag;\n}", "public function addLessFiles(Enlight_Event_EventArgs $args)\n {\n $less = new \\Shopware\\Components\\Theme\\LessDefinition(\n //configuration\n array(\n 'base_color' => $this->Config()->get('base_color'),\n 'fb_color' => $this->Config()->get('fb_color'),\n 'gp_color' => $this->Config()->get('gp_color'),\n 'tw_color' => $this->Config()->get('tw_color'),\n 'yt_color' => $this->Config()->get('yt_color')\n ),\n\n //less files to compile\n array(\n __DIR__ . '/Views/frontend/_public/src/less/all.less'\n ),\n\n //import directory\n __DIR__\n );\n\n return new Doctrine\\Common\\Collections\\ArrayCollection(array($less));\n }", "public function addAssets() {}", "public function addAssets() {}", "function addExtraAssets()\n\t{\n\t\t$base = JURI::base(true);\n\t\t$regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';\n\n\t\tforeach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {\n\t\t\t//full path\n\t\t\t$afile = $bpath . '/etc/assets.xml';\n\t\t\tif (is_file($afile)) {\n\n\t\t\t\t//load xml\n\t\t\t\t$axml = JFactory::getXML($afile);\n\n\t\t\t\t//process if exist\n\t\t\t\tif ($axml) {\n\t\t\t\t\tforeach ($axml as $node => $nodevalue) {\n\t\t\t\t\t\t//ignore others node\n\t\t\t\t\t\tif ($node == 'stylesheets' || $node == 'scripts') {\n\t\t\t\t\t\t\tforeach ($nodevalue->file as $file) {\n\t\t\t\t\t\t\t\t$compatible = $file['compatible'];\n\t\t\t\t\t\t\t\tif ($compatible) {\n\t\t\t\t\t\t\t\t\t$parts = explode(' ', $compatible);\n\t\t\t\t\t\t\t\t\t$operator = '='; //exact equal to\n\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\tif (count($parts) == 2) {\n\t\t\t\t\t\t\t\t\t\t$operator = $parts[0];\n\t\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t//compare with Joomla version\n\t\t\t\t\t\t\t\t\tif (!version_compare(JVERSION, $operand, $operator)) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$url = (string)$file;\n\t\t\t\t\t\t\t\tif (substr($url, 0, 2) == '//') { //external link\n\n\t\t\t\t\t\t\t\t} else if ($url[0] == '/') { //absolute link from based folder\n\t\t\t\t\t\t\t\t\t$url = is_file(JPATH_ROOT . $url) ? $base . $url : false;\n\t\t\t\t\t\t\t\t} else if (!preg_match($regurl, $url)) { //not match a full url -> sure internal link\n\t\t\t\t\t\t\t\t\t$url = T3Path::getUrl($url); // so get it\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($url) {\n\t\t\t\t\t\t\t\t\tif ($node == 'stylesheets') {\n\t\t\t\t\t\t\t\t\t\t$this->addStylesheet($url);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->addScript($url);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\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\n\t\t// template extended styles\n\t\t$aparams = $this->_tpl->params->toArray();\n\t\t$extras = array();\n\t\t$itemid = JFactory::getApplication()->input->get ('Itemid');\n\t\tforeach ($aparams as $name => $value) {\n\t\t\tif (preg_match ('/^theme_extras_(.+)$/', $name, $m)) {\n\t\t\t\t$extras[$m[1]] = $value;\n\t\t\t}\n\t\t}\n\t\tif (count ($extras)) {\n\t\t\tforeach ($extras as $extra => $pages) {\n\t\t\t\tif (!is_array($pages) || !count($pages) || in_array (0, $pages)) {\n\t\t\t\t\tcontinue; // disabled\n\t\t\t\t}\n\t\t\t\tif (in_array (-1, $pages) || in_array($itemid, $pages)) {\n\t\t\t\t\t// load this style\n\t\t\t\t\t$this->addCss ('extras/'.$extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addLessFiles(Enlight_Event_EventArgs $args)\n {\n $less = new \\Shopware\\Components\\Theme\\LessDefinition(\n //configuration\n array(),\n\n //less files to compile\n array(\n __DIR__ . '/Views/frontend/_public/src/less/all.less'\n ),\n\n //import directory\n __DIR__\n );\n\n return new Doctrine\\Common\\Collections\\ArrayCollection(array($less));\n }", "protected function addBootstrapMixins()\n {\n $objFile = new \\File($this->getBootstrapSrc('mixins.less'));\n\n if (str_replace('v', '', BOOTSTRAPVERSION) >= '3.2.0')\n {\n preg_match_all('/@import \"(.*)\";/', $objFile->getContent(), $arrImports);\n\n if (is_array($arrImports[1]))\n {\n foreach ($arrImports[1] as $strFile)\n {\n if (!file_exists(TL_ROOT . '/' . BOOTSTRAPLESSDIR . '/' . $strFile))\n {\n continue;\n }\n\n $objMixinFile = new \\File(BOOTSTRAPLESSDIR . '/' . $strFile);\n $this->objLess->parseFile($objMixinFile->value);\n }\n }\n\n return;\n }\n\n\n if ($objFile->size > 0)\n {\n $this->objLess->parseFile($objFile->value);\n }\n }", "public function lessFileFilter($lessFile)\n {\n return $this->fileFilter(\n $lessFile,\n $this->createPath('public/css'),\n new FileAsset($this->createPath('assets/less/' . $lessFile)),\n $this->filters['less']\n );\n }", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "public function addCssFile($name)\n {\n $this->fileStyles[] = $name;\n }", "public function asset_html_less($file, $https)\n {\n return $this->asset_html_setting(\"less\",$file, $https);\n }", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "public function styles() {\n $this->addStyle(CORE_WWW_ROOT.\"ressources/css/externals/bootstrap.core.min.css\", true);\n\n\n $this->addStyle($this->directory().\"css/reset.less\");\n $this->addStyle($this->directory().\"css/animations.less\");\n $this->addStyle($this->directory().\"css/main.less\");\n $this->addStyle($this->directory().\"css/overlay.less\");\n $this->addStyle($this->directory().\"css/header.less\");\n $this->addStyle($this->directory().\"css/footer.less\");\n\n // externals\n $this->addStyle(\"//fonts.googleapis.com/css?family=Lora:400,400i,700,700i\", true);\n $this->addStyle('//fonts.googleapis.com/css?family=Roboto:700', true);\n\n // blocks\n $this->addStyle($this->directory().\"css/blocks/rd_arrow.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_button.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_bigteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_smallteaser.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_longtext.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_forms.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_listings.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_collection.less\");\n $this->addStyle($this->directory().\"css/blocks/rd_components.less\");\n\n $this->addStyle($this->directory().\"css/responsive.less\");\n }", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "protected function addBootstrapAlerts()\n {\n $objFile = new \\File($this->getBootstrapSrc('alerts.less'));\n\n if ($objFile->size > 0)\n {\n $this->objLess->parseFile($objFile->value);\n }\n }", "public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }", "public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }", "function v2_mumm_include_asset($variable, $type) {\n $path = drupal_get_path('theme', 'v2_mumm');\n if ($type == 'css') {\n foreach ($variable as $key => $item) {\n drupal_add_css($path . '/css/' . $item . '.css', array(\n 'group' => CSS_THEME,\n 'type' => 'file',\n 'media' => 'screen',\n 'preprocess' => TRUE,\n 'every_page' => TRUE,\n 'group' => CSS_THEME,\n 'weight' => $key,\n ));\n }\n }\n if ($type == 'js') {\n foreach ($variable as $key => $item) {\n drupal_add_js($path . '/js/' . $item . '.js', array(\n 'type' => 'file',\n 'scope' => 'footer',\n 'group' => JS_THEME,\n 'every_page' => TRUE,\n 'preprocess' => TRUE,\n 'cache' => TRUE,\n 'weight' => $key,\n ));\n }\n }\n}", "public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }", "function addCss($name, $addresponsive = true)\n\t{\n\t\t$devmode = $this->getParam('devmode', 0);\n\t\t$themermode = $this->getParam('themermode', 1);\n\t\t$responsive = $addresponsive && !$this->responcls ? $this->getParam('responsive', 1) : false;\n\n\t\tif (($devmode || ($themermode && defined('T3_THEMER'))) && ($url = T3Path::getUrl('less/' . $name . '.less', '', true))) {\n\t\t\tT3::import('core/less');\n\t\t\tT3Less::addStylesheet($url);\n\t\t} else {\n\n\t\t\t$added = false;\n\t\t\tif ($this->direction == 'rtl') {\n\t\t\t\t$url = T3Path::getUrl('css/rtl/' . $name . '.css');\n\t\t\t\t// Add this css into template\n\t\t\t\tif ($url) {\n\t\t\t\t\t$this->addStyleSheet($url);\n\t\t\t\t\t$added = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!$added){\n\t\t\t\t$url = T3Path::getUrl('css/' . $name . '.css');\n\t\t\t\t// Add this css into template\n\t\t\t\tif ($url) {\n\t\t\t\t\t$this->addStyleSheet($url);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($responsive && !$this->responcls) {\n\t\t\t$this->addCss($name . '-responsive', false);\n\t\t}\n\t}", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "function st_asset($file, $echo = false){\r $file = ST_THEME_URL.'assets/'.$file;\r if($echo){\r echo $file;\r }else{\r return $file;\r }\r}" ]
[ "0.6756741", "0.67278326", "0.6663929", "0.65156645", "0.638577", "0.6186389", "0.61289984", "0.5959664", "0.5947982", "0.5851643", "0.5851643", "0.58344716", "0.58246636", "0.5763957", "0.57509065", "0.56020766", "0.55885637", "0.55787414", "0.55721724", "0.5535377", "0.5510304", "0.5497915", "0.5484172", "0.54663974", "0.5462928", "0.5449987", "0.54291844", "0.54227275", "0.54133195", "0.5394332" ]
0.6909719
0
Compares two mappings and returns true if changes detected.
public function checkMapping($oldMapping, $newMapping) { $updated = false; // Find out which types don't exist anymore. $typeDiff = array_diff_key($oldMapping, $newMapping); foreach ($typeDiff as $oldTypeName => $oldType) { $this->removedTypes[] = $oldTypeName; $updated = true; } // Search for differences in types. foreach ($newMapping as $type => $properties) { $diff = null; if (array_key_exists($type, $oldMapping)) { $diff = $this->symDifference($properties, $oldMapping[$type]); } // Empty array type properties hasn't changed, NULL - new type. if ($diff !== [] || $diff === null) { $this->updatedTypes[$type] = $properties; $updated = true; } } return $updated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function equals(Map $map): bool;", "public function hasMapping();", "function MappedDiff($from_lines, $to_lines,\r\n $mapped_from_lines, $mapped_to_lines) {\r\n\r\n assert(sizeof($from_lines) == sizeof($mapped_from_lines));\r\n assert(sizeof($to_lines) == sizeof($mapped_to_lines));\r\n\r\n $this->Diff($mapped_from_lines, $mapped_to_lines);\r\n\r\n $xi = $yi = 0;\r\n // Optimizing loop invariants:\r\n // http://phplens.com/lens/php-book/optimizing-debugging-php.php\r\n for ($i = 0, $max = sizeof($this->edits); $i < $max; $i++) {\r\n $orig = &$this->edits[$i]->orig;\r\n if (is_array($orig)) {\r\n $orig = array_slice($from_lines, $xi, sizeof($orig));\r\n $xi += sizeof($orig);\r\n }\r\n\r\n $final = &$this->edits[$i]->final;\r\n if (is_array($final)) {\r\n $final = array_slice($to_lines, $yi, sizeof($final));\r\n $yi += sizeof($final);\r\n }\r\n }\r\n }", "function cp_arrayIsSame($array1, $array2,$keys){\r\n\r\n foreach($keys as $key){\r\n if($array1[$key] != $array2[$key]){\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function areSimilar($a, $b) {\n if($a==$b) return true;\n \n if(sizeof($a)!=sizeof($b)||array_sum($a)!=array_sum($b)) return false;\n \n $index1 = 0; $index2 = 0; $diff = 0;\n \n foreach($a as $key=>$var){\n if($var!=$b[$key]){\n $diff++;\n if($diff==1)\n $index1 = $key;\n else if($diff==2)\n $index2 = $key;\n }\n }\n \n return ($diff==2&&$a[$index1]==$b[$index2]&&$a[$index2]==$b[$index1]);\n}", "public function checkDiff()\n {\n if ($this->tokensOriginal !== $this->tokensMutated) {\n return true;\n }\n\n return false;\n }", "public function hasContentChanged($one, $two)\n\t{\n\t\t// lazy, compare in both directions (duplicates effort, but simple...)\n\t\tforeach([[$one,$two], [$two,$one]] as $pair) {\n\t\t\tlist($first, $second) = $pair;\n\t\t\t// for each key in array\n\t\t\tforeach($first as $key => $value) {\n\t\t\t\t// does the other one have that key?\n\t\t\t\tif (!array_key_exists($key, $second)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t// if they are both arrays, then recursively compare them\n\t\t\t\tif (is_array($first[$key]) && is_array($second[$key])) {\n\t\t\t\t\tif($this->hasContentChanged($first[$key],$second[$key])) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// otherwise check if the values are different\n\t\t\t\telse if ($first[$key] !== $second[$key]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// no differences\n\t\treturn false;\n\t}", "public function isValid() : bool {\n if($valid = parent::isValid()){\n // check if source/target system are not equal\n // check if source/target belong to same map\n if(\n is_object($this->source) &&\n is_object($this->target) &&\n $this->get('source', true) === $this->get('target', true) ||\n $this->source->get('mapId', true) !== $this->target->get('mapId', true)\n ){\n $valid = false;\n }\n }\n\n return $valid;\n }", "function arrays_are_similar($a, $b) {\n\tif (count(array_diff_assoc($a, $b))) {\n\t\treturn false;\n\t}\n\t// we know that the indexes, but maybe not values, match.\n\t// compare the values between the two arrays\n\tforeach($a as $k => $v) {\n\t\tif ($v !== $b[$k]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t// we have identical indexes, and no unequal values\n\treturn true;\n}", "function atkArrayCompare($array1, $array2)\n{\n\t$difference = atkArrayDiff($array1, $array2);\n\n\treturn !is_array($difference) ? false : true;\n}", "function _is_geometry_modified($old_slice, $new_slice) {\n $old_nodes_ids = array_keys($old_slice['nodes']);\n $new_nodes_ids = array_keys($new_slice['nodes']);\n if ($old_nodes_ids != $new_nodes_ids)\n return true;\n\n foreach ($new_slice['nodes'] as $node) {\n if (isset($node['action']))\n return true;\n }\n\n return false;\n }", "function DiferentKeys($keys_home, $keys_sync) {\r\n \tif (count($keys_home) != count($keys_sync)) {\r\n \treturn true;\r\n }\r\n\r\n for ($i = 0; $i < count($keys_home); $i++) {\r\n \tif ($keys_home[$i] != $keys_sync[$i]) {\r\n \treturn true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "function is_equal(tree $other): bool {\n // We must treat the triples array as an unordered set\n // (where the two sets are equal even if values are present\n // in a different order).\n // Therefore, we cannot simply check if array_values()\n // for each set is equal.\n foreach($this->triples as $k => $t) {\n $o = @$other->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n foreach($other->triples as $k => $t) {\n $o = @$this->triples[$k];\n if(!$o || !$t->is_equal($o)){\n return false;\n }\n }\n return true;\n }", "function slow_equals($a, $b)\n{\n $diff = strlen($a) ^ strlen($b);\n for($i = 0; $i < strlen($a) && $i < strlen($b); $i++)\n {\n $diff |= ord($a[$i]) ^ ord($b[$i]);\n }\n return $diff === 0; \n}", "public static function compareParams(array $oldParams, array $newParams): bool\n\t{\n\t\treturn $oldParams === $newParams;\n\t}", "public static function diff($origin1, $origin2) : bool\n {\n if ((! \\is_object($origin1)) || (! \\is_object($origin2))) {\n return true;\n }\n if (\\get_class($origin1) !== \\get_class($origin2)) {\n return true;\n }\n\n if (($origin1 instanceof Entity) && ($origin2 instanceof Entity)) {\n return $origin1->getPk() !== $origin2->getPk();\n }\n\n if (($origin1 instanceof Model) && ($origin2 instanceof Model)) {\n // Diff All Properties of origins\n return Model::diff($origin1, $origin2, []) ? true : false;\n }\n\n return $origin1 != $origin2;\n }", "public function validateChangedPasswordsIsTheSame(): bool\n {\n return $this->newPassword1 === $this->newPassword2;\n }", "public function arrays_are_similar($a, $b)\n {\n if (count(array_diff_assoc($a, $b))) {\n return false;\n }\n // we know that the indexes, but maybe not values, match.\n // compare the values between the two arrays\n foreach ($a as $k => $v) {\n if ($v !== $b[$k]) {\n return false;\n }\n }\n // we have identical indexes, and no unequal values\n return true;\n }", "function _are_attrs_modified($old_slice, $new_slice) {\n return $old_slice['index'] != $new_slice['index'];\n }", "public function hasChangedEntries();", "function compareObjects(&$ob1, &$ob2) {\n\tprint_pre('o1 == o2 : ' . bool2str($ob1 == $ob2));\n\tprint_pre('o1 != o2 : ' . bool2str($ob1 != $ob2));\n\tprint_pre('o1 === o2 : ' . bool2str($ob1 === $ob2));\n\tprint_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2));\n}", "public function isChanged()\n {\n return ! empty(array_diff_assoc($this->items, $this->clone));\n }", "function d2d_public_key_eql($key1, $key2) {\n\t$key1 = d2d_clean_public_key($key1);\n\t$key2 = d2d_clean_public_key($key2);\n\treturn $key1 === $key2;\n}", "public function testMap2()\n\t{\n\t\tTestReflection::invoke($this->_state, 'set', 'content.type', 'tag');\n\t\t$a = TestReflection::invoke($this->_instance, 'map', 1, array(5), true);\n\t\t$this->assertEquals(true, $a);\n\n\t\tTestReflection::invoke($this->_state, 'set', 'tags.content_id', '1');\n\t\t$actual = TestReflection::invoke($this->_instance, 'getList');\n\n\t\t$this->assertEquals(1, count($actual));\n\t}", "function cmp_slow_equals($a, $b)\n{\n $diff = strlen($a) ^ strlen($b);\n for($i = 0; $i < strlen($a) && $i < strlen($b); $i++)\n {\n $diff |= ord($a[$i]) ^ ord($b[$i]);\n }\n return $diff === 0;\n}", "protected function areEqual($a, $b)\n {\n return ($a['points'] == $b['points'])\n && ($a['positions'] == $b['positions'])\n && ($a['fastestLap'] == $b['fastestLap']);\n }", "protected function _combine($input)\n {\n $inp_len = count($input);\n foreach($this->NP['replacemaps'] as $np_src => $np_target)\n {\n if($np_target[0] != $input[0])\n continue;\n if(count($np_target) != $inp_len)\n continue;\n $hit = false;\n foreach($input as $k2 => $v2)\n {\n if($v2 == $np_target[$k2])\n {\n $hit = true;\n }\n else\n {\n $hit = false;\n break;\n }\n }\n if($hit)\n return $np_src;\n }\n return false;\n }", "public function hasTranslationChanges();", "public function arraysAreSimilar($a, $b) {\n // if the indexes don't match, return immediately\n if (count(array_diff($a, $b)) > 0) {\n return false;\n }\n // we have identical indexes, and no unequal values\n return true;\n }", "function isLineChanged($v1, $v2) {\r\n $belongTo = new BelongTo();\r\n $lineV1 = $belongTo->getLines($v1);\r\n $lineV2 = $belongTo->getLines($v2);\r\n foreach ($lineV1 as $line1) {\r\n foreach ($lineV2 as $line2) {\r\n if ($line1 == $line2) return false;\r\n }\r\n }\r\n return true;\r\n }" ]
[ "0.6495992", "0.574157", "0.5690296", "0.5592114", "0.5453602", "0.5449998", "0.5350635", "0.531861", "0.5208121", "0.5168192", "0.5167816", "0.5156022", "0.5135318", "0.508137", "0.5078118", "0.5071873", "0.5053129", "0.5052004", "0.5044716", "0.504448", "0.5038735", "0.5035409", "0.5012736", "0.4998661", "0.49786386", "0.49668536", "0.49586517", "0.4955836", "0.4931661", "0.49238908" ]
0.61030805
1
Returns type names with new properties which has been updated.
public function getUpdatedTypes() { return $this->updatedTypes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUpdatedProperties() {}", "public function getupdatedproperties($type) {\n\n // Dont filter for now\n $type = '';\n\n // Filter by type\n if ( $type != '' ) {\n foreach ( $this->data as $k => $property ) {\n if ( $property['strChangeLog'] !== $type ) {\n unset($this->data[$k]);\n }\n }\n }\n\n return $this->data;\n }", "public function getChangedFields() {}", "function changed_properties() {\r\n \t$changed = array();\r\n \tforeach($this->_frozen_properties as $var => $val) {\r\n \t\tif ($this->$var != $this->_frozen_properties[$var])// This property has changed:\r\n \t\t\t$changed[$var] = $val;\r\n \t}\r\n \treturn $changed;\r\n }", "public function getToUpdate()\n\t{\n\t\t$tToUpdate = array();\n\t\tif ($this->_tPropertyToUpdate) {\n\t\t\tforeach ($this->_tPropertyToUpdate as $sVar) {\n\t\t\t\t$tToUpdate[$sVar] = $this->_tProperty[$sVar];\n\t\t\t}\n\t\t}\n\t\treturn $tToUpdate;\n\t}", "public function getChangedFields()\n\t{\n\t\t$changed_fields = array();\n\t\tforeach ($this->tracker->getAllChangedProperties() as $prop => $info) {\n\t\t\tswitch ($prop) {\n\t\t\t\tcase 'agent':\n\t\t\t\t\t$changed_fields[] = 'ticket.agent_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'agent_team':\n\t\t\t\t\t$changed_fields[] = 'ticket.agent_team_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'category':\n\t\t\t\t\t$changed_fields[] = 'ticket.category_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'department':\n\t\t\t\t\t$changed_fields[] = 'ticket.department_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'priority':\n\t\t\t\t\t$changed_fields[] = 'ticket.priority_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'product':\n\t\t\t\t\t$changed_fields[] = 'ticket.product_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'workflow':\n\t\t\t\t\t$changed_fields[] = 'ticket.workflow_id';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'status':\n\t\t\t\t\t$changed_fields[] = 'ticket.status';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'is_hold':\n\t\t\t\t\t$changed_fields[] = 'ticket.is_hold';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hidden_status':\n\t\t\t\t\t$changed_fields[] = 'ticket.hidden_status';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'participants':\n\t\t\t\t\t$changed_fields[] = 'ticket.participants';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'labels':\n\t\t\t\tcase 'label_added':\n\t\t\t\tcase 'label_removed':\n\t\t\t\t\t$changed_fields[] = 'ticket.labels';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$this->logMessage(\"Raw Changed: \" . implode(', ', array_keys($this->tracker->getAllChangedProperties())));\n\n\t\t$this->logMessage(\"Changed fields: \" . implode(', ', $changed_fields));\n\n\t\treturn $changed_fields;\n\t}", "function updateProperties($mutations);", "public function getFieldsWithUpdate()\n {\n return array_filter($this->fieldChanges, function ($fieldChange) {\n return $fieldChange->hasChange();\n });\n }", "public function getChangedFields()\n {\n return $this->_changedFields;\n }", "public function getPropertyNames() {\n // {PropertyName(property-name, property-type),}\n $nameSet = array();\n foreach ($this->tree->getPropertyNames() as $name) {\n $nameSet[] = new Mobi_Mtld_DA_PropertyName(\n substr($name, 1),\n self::getPropertyTypeAsByte($name[0])\n );\n }\n return $nameSet;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public function __sleep()\n {\n $this->clearAllReferences();\n\n $cls = new \\ReflectionClass($this);\n $propertyNames = [];\n $serializableProperties = array_diff($cls->getProperties(), $cls->getProperties(\\ReflectionProperty::IS_STATIC));\n\n foreach($serializableProperties as $property) {\n $propertyNames[] = $property->getName();\n }\n\n return $propertyNames;\n }", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public static function getPropertyTypes() {\n\t\treturn self::$PROPERTY_TYPES;\n\t}", "public function getChangedFields()\n {\n\n $fields = [];\n\n if ($this->synchronized || !static::$track) {\n return $fields;\n }\n\n foreach ($this->savedData as $key => $value) {\n\n if ($value != $this->data[$key]) {\n $fields[] = $key;\n }\n }\n\n return $fields;\n\n }", "public function getUpdated();", "public function getUpdated();", "public static function _getPropertyNames(): array\n {\n return [\n 'name',\n ];\n }", "public static function _getPropertyNames(): array\n {\n return [\n 'traveler',\n 'watcher',\n 'distance',\n ];\n }", "public function getPropertyNames();", "protected function buildPropertyInfoAlter() {\n }" ]
[ "0.7023245", "0.66637874", "0.6199403", "0.61565226", "0.6130374", "0.6117848", "0.5777192", "0.5756414", "0.5643433", "0.55620307", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5548266", "0.5516398", "0.5516398", "0.5516398", "0.544719", "0.54420877", "0.54420877", "0.54403925", "0.5417793", "0.54154557", "0.5360414" ]
0.7151951
0
Counts scalar values recursively in array.
private function countRecursiveScalars($array) { $count = 0; if (!is_array($array)) { return 1; } foreach ($array as $element) { if (is_array($element)) { $count += $this->countRecursiveScalars($element); } else { $count++; } } return $count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_count_recursive($arr)\n{\n $count = 0;\n foreach (array_values($arr) as $val) {\n $count++;\n if (is_array($val)) {\n $count += array_count_recursive($val);\n }\n }\n\n return $count;\n}", "public function recursiveCount($array): int\n {\n return (int) count($array, COUNT_RECURSIVE);\n }", "public function countArrayValuesRecursive(&$arr, $cnt = 0)\n {\n \\array_walk_recursive($arr, function ($v, $k) use (&$cnt) {\n $cnt++;\n });\n return $cnt;\n }", "function countdim($array)\n{\n\tif (is_array(reset($array)))\n\t$return = countdim(reset($array)) + 1;\n\telse\n\t$return = 1;\n\n\treturn $return;\n}", "public function countNodeArrayValue(): int\n {\n return count($this->nodeValue);\n }", "public function conta($array){\n\t\treturn count($array);\n\t}", "public function count()\n {\n // NOTE: Cannot use \\COUNT_RECURSIVE because that counts the arrays\n // as well as their contents. We want a count only of Properties.\n $count = 0;\n foreach ($this->data as $key=>$values)\n {\n if (is_array($this->data[$key]))\n $count += count($values);\n else\n $count += 1;\n }\n return $count;\n }", "function countempty($checkarray) {\n\t\n\t$ret = 0;\n\t\t\n\tforeach($checkarray as $value) {\n\t\tif(is_array($value)) $ret += countempty($value);\n\t\telseif(trim($value) == \"\") $ret++;\n\t}\n\t\t\n\treturn $ret;\n}", "public function count($path)\n\t{\n\t\t// Get the element, always returning a full set.\n\t\t$temp = $this->path($path, true);\n\n\t\t// Start at zero, then count up all the numeric keys.\n\t\t$i = 0;\n\t\tforeach ($temp->array as $item)\n\t\t{\n\t\t\tif (is_array($item))\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\n\t\treturn $i;\n\t}", "function contar($array)\n {\n\n $contador = 0;\n foreach ($array as $valor) {\n $contador++;\n }\n return $contador;\n }", "public function countValue($value);", "public static function arrayValuesToCounts($array)\n {\n $newArray = [];\n foreach ($array as $key => $row) {\n $newArray[$key] = count($row);\n }\n\n return $newArray;\n }", "static function count(array &$data, $path) {\n\t\t$keys = explode('.', $path);\n\t\t$last = array_pop($keys);\n\t\tforeach($keys as $k){\n\t\t\tif(isset($data[$k]) && is_array($data[$k])){\n\t\t\t\t$data = & $data[$k];\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn isset($data[$last]) && is_array($data[$last]) ? sizeOf($data[$last]) : null;\n\t}", "public function count() {\n\t\treturn count($this->array);\n\t}", "function N ($array) {\n return sizeof($array);\n}", "public function count(): int\n {\n if (is_array($this->data)) {\n return count($this->data);\n }\n if ($this->data instanceof Countable) {\n return $this->data->count();\n }\n $this->dataToArray();\n\n return count($this->data);\n }", "function get_point_count($data) {\n $sum = 0;\n if (!is_array($data)) {\n # TODO: This should not happen\n error_log($data);\n return -1;\n }\n foreach ($data as $line) {\n $sum += count($line);\n }\n return $sum;\n}", "function array_counts($arr,$key,$data = 'rows')\n {\n foreach($arr as $item) {\n $item['rows'] =1;\n if (!isset($res[$item[$key]])) {\n $res[$item[$key]] = $item;\n }else{\n $res[$item[$key]][$data] +=$item['rows'] ;\n }\n }\n return $res;\n }", "function rekSumArray(array $array): int\n {\n if(count($array) >= 1)\n {\n return array_shift($array) + rekSumArray($array);\n }\n return 0;\n }", "function expression_function_count($data)\n{\n if (is_array($data)) {\n return count($data);\n } else if ($data instanceof \\Iterator) {\n return iterator_count($data);\n } else {\n throw new \\InvalidArgumentException('Collection must be an array or an Iterator');\n }\n}", "public static function arrayMultiCount($array, $limit = -1)\n {\n if (!Arrays::isArray($array, false)) {\n return false;\n }\n $cnt = 0;\n $limit = $limit > 0 ? (int)$limit : -1;\n $arrs[] = $array;\n for ($i = 0; isset($arrs[$i]) && is_array($arrs[$i]); ++$i) {\n foreach ($arrs[$i] as $value) {\n if (!is_array($value))\n ++$cnt;\n elseif ($limit == -1 || $limit > 1) {\n if ($limit > 1)\n --$limit;\n $arrs[] = $value;\n }\n }\n }\n\n return $cnt;\n }", "public static function COUNTA(...$args)\n {\n $returnValue = 0;\n\n // Loop through arguments\n $aArgs = Functions::flattenArrayIndexed($args);\n foreach ($aArgs as $k => $arg) {\n // Nulls are counted if literals, but not if cell values\n if ($arg !== null || (!Functions::isCellValue($k))) {\n ++$returnValue;\n }\n }\n\n return $returnValue;\n }", "private function array_count($data){\r\n $last_element = 0;\r\n foreach($data as $key=>$value){\r\n if(!is_null($value) AND $value !== \"\"){\r\n $last_element = $key + 1;\r\n }\r\n }\r\n return $last_element;\r\n }", "function printValues($arr) {\n global $count;\n global $values;\n global $keys;\n \n // Check input is an array\n if(!is_array($arr)){\n die(\"ERROR: Input is not an array\");\n }\n \n /*\n Loop through array, if value is itself an array recursively call the\n function else add the value found to the output items array,\n and increment counter by 1 for each value found\n */\n foreach($arr as $key => $value){\n if(is_array($value)){\n printValues($value);\n } else{\n $values[] = $value;\n $count++;\n $keys[] = $key;\n }\n }\n \n // Return total count and values found in array\n return array('total' => $count, 'keys' => $keys, 'values' => $values);\n }", "#[Pure]\nfunction iterator_count(#[LanguageLevelTypeAware(['8.2' => 'Traversable|array'], default: 'Traversable')] $iterator): int {}", "public static function count($value) : int\n\t{\n\t\tif (is_object($value)) {\n\t\t\treturn Obj::count($value);\n\t\t}\n\n\t\treturn count($value);\n\t}", "function is_countable($value)\n {\n return (is_array($value) || $value instanceof Countable);\n }", "abstract public function count();", "abstract public function count();", "abstract public function count();" ]
[ "0.72786635", "0.6785292", "0.6730845", "0.6688027", "0.6179349", "0.6175523", "0.6076271", "0.6056161", "0.60080636", "0.59598696", "0.59471285", "0.5831497", "0.57201034", "0.5719407", "0.5616957", "0.55908394", "0.5589544", "0.55303365", "0.54823357", "0.5424541", "0.54211646", "0.5408473", "0.5329391", "0.53244925", "0.5289005", "0.52589595", "0.525356", "0.5242913", "0.5242913", "0.5242913" ]
0.78210175
0
Returns true if this class supports the given resource.
public function supports($resource) { return is_string($resource) && 'xml' === pathinfo($resource, PATHINFO_EXTENSION); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function supports($resource, $type = null)\n {\n return true;\n }", "public function supports($resource, $type = null)\n {\n return is_string($resource) &&\n 'xml' === pathinfo($resource, PATHINFO_EXTENSION) &&\n 'rest' === $type;\n }", "public function isResource(): bool\n {\n return $this->phpType === self::RESOURCE;\n }", "public static function isEnabled($resource)\n\t{\n\t\treturn static::$_enabled and static::$_resources[$resource] === true;\n\t}", "public function isResource() {\n\t\treturn $this->resource;\n\t}", "public function supports($resource, $type = null)\n {\n return is_string($resource) && 'yml' === pathinfo(\n $resource,\n PATHINFO_EXTENSION\n );\n }", "public function supports($resource, $type = null)\n {\n return preg_match('/\\.ya?ml$/i', $resource);\n }", "function is_resource(string $resource): bool\n {\n return is_resource_route($resource);\n }", "public function supports($resource, $type = null)\n {\n return is_string($resource) && 'php' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'php' === $type);\n }", "public function isValid($resource = null)\r\n {\r\n if ($resource === null) {\r\n $resource = $this->_resource;\r\n } \r\n return is_resource($resource);\r\n }", "public function supports($resource, $type = null)\n {\n if (!\\is_string($resource) || 'xml' !== \\pathinfo($resource, \\PATHINFO_EXTENSION)) {\n return false;\n }\n\n $file = $this->getLocator()->locate($resource);\n $document = XmlUtils::loadFile($file);\n $namespaces = $document->documentElement->attributes->getNamedItem('schemaLocation')->nodeValue;\n\n $start = \\strpos($namespaces, static::XML_NAMESPACE_URI) + \\strlen(static::XML_NAMESPACE_URI) + 1;\n $namespace = \\substr($namespaces, $start);\n\n $end = \\strpos($namespace, ' ');\n if (false !== $end) {\n $namespace = \\substr($namespace, 0, $end);\n }\n\n return $namespace === static::SCHEMA_URI;\n }", "public function supports($resource, $type = null)\n {\n return is_string($resource)\n && preg_match(\n '/^(?:\\\\\\\\?[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)+$/',\n $resource\n )\n && (!$type || 'attribute' === $type);\n }", "public function supports($resource, $type = null)\n {\n return is_string($resource) && 'yml' === pathinfo($resource, PATHINFO_EXTENSION) && (!$type || 'yaml' === $type);\n }", "public function supports($resource, $type = null)\n {\n return $type === 'rollerworks_autowiring';\n }", "protected function needResourceClass(): bool\n {\n return $this->resourceClass() !== null;\n }", "public function isSupported()\n\t{\n\t\treturn $this->isSupported;\n\t}", "protected function checkSupports($ext, $resource)\n {\n if (!is_string($resource)) {\n return false;\n }\n\n $info = pathinfo($resource);\n $extension = $info['extension'];\n\n if ('dist' === $extension) {\n $extension = pathinfo($info['filename'], PATHINFO_EXTENSION);\n }\n\n if (is_string($ext)) {\n return ($ext === $extension);\n }\n\n if (is_array($ext)) {\n $supported = false;\n\n foreach ($ext as $value) {\n if ($value === $extension) {\n $supported = true;\n break;\n }\n }\n\n return $supported;\n }\n\n return false;\n }", "public function supports(string $resourceClass, string $operationName = null, array $context = []): bool\n {\n return Catalog::class === $resourceClass;\n }", "public function hasResource($resource)\n {\n if (is_string($resource)) {\n return $this->resourceProvider->hasResource($resource);\n }\n if ($resource instanceof ResourceInterface) {\n return $this->resourceProvider->hasResource($resource->getResourceId());\n }\n\n return false;\n }", "function is_readable(ResourceInterface $resource): bool\n {\n $modes = [\n 'r' => true,\n 'w+' => true,\n 'r+' => true,\n 'x+' => true,\n 'c+' => true,\n 'rb' => true,\n 'w+b' => true,\n 'r+b' => true,\n 'x+b' => true,\n 'c+b' => true,\n 'rt' => true,\n 'w+t' => true,\n 'r+t' => true,\n 'x+t' => true,\n 'c+t' => true,\n 'a+' => true,\n 'a+b' => true,\n ];\n\n if ($resource->eof()) {\n return false;\n }\n\n $metadata = stream_get_meta_data($resource->getResource());\n\n return isset($modes[$metadata['mode']]);\n }", "public function isSupported()\n {\n return null !== $this->name();\n }", "public function has(Resource $resource);", "public function supports(string $class): bool;", "public function supports($resource, $type = null)\n {\n return 'elcodi_metric_input' === $type;\n }", "public function isSupported()\n {\n return $this->supported;\n }", "private function _isResource() {\n $Info = explode('.', $_SERVER[\"REQUEST_URI\"]);\n $rVal = false;\n\n if ( count($Info) > 1 ) { $rVal = true; }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function supportsCapability(string $capability): bool;", "static public function isSupported();", "public function getIsSupported() {\n return $this->get(self::IS_SUPPORTED);\n }", "public function isUserAllowedToAccessResource($resource){\n return Model::isUserAllowedToAccessResource($resource);\n }" ]
[ "0.80015546", "0.74155545", "0.72928834", "0.72284806", "0.7120093", "0.71096295", "0.7100976", "0.7093729", "0.7075715", "0.70406914", "0.6972983", "0.69695854", "0.6965278", "0.69574946", "0.69564766", "0.6895414", "0.68718696", "0.6845603", "0.6826013", "0.676752", "0.67545694", "0.6754526", "0.67541957", "0.67515117", "0.6733744", "0.67076063", "0.67023087", "0.6685032", "0.6669598", "0.6649198" ]
0.773804
1
Checks if a given str is a controller
private static function isController($str) { $str = self::formatAsController($str); if (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function formatAsController($str) {\n\t\tif (strpos($str, 'Controller') === false) {\n\t\t\t$str = ucfirst(strtolower($str)).'Controller';\n\t\t}\n\t\t\n\t\treturn $str;\n\t}", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "private function isControllerAction()\n {\n return is_string($this->attributes[self::ACTION]);\n }", "public function checkControllerExists(string $controller)\n {\n if(!class_exists($this->ctlrStrSrc.$controller))\n {\n die(\"Defined Controller doesn't exists\");\n }\n }", "public function isController($action)\n {\n return (bool) preg_match(\"/^[A-Za-z0-9\\\\\\]+@[A-Za-z0-9_]+$/\", $action);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "protected function isControllerAction()\n {\n return is_string($this->action['uses']);\n }", "function my_is_current_controller($names)\n {\n $names = array_map('trim', explode(',', $names));\n $current = explode('.', Route::currentRouteName())[0];\n return in_array($current, $names, true);\n }", "public function validateController( $input = '' )\n {\n if( ! is_string( $input ) )\n {\n throw new \\Exception(\n 'Route Validation Error :: String type expected'\n . ' - Current type ( ' . gettype( $input ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n if( mb_strlen( $input ) > 0 )\n {\n if( preg_match( Route::BLACKLIST_CONTROLLER_CHARS, $input, $matched ) === 0 ) {\n $input = trim( mb_strtolower( $input ) );\n return $input;\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation'\n . ' - Invalid chars found ( ' . escaped( $matched['deny'] ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation [ No input ]'\n , Status::BAD_REQUEST\n );\n }", "private function controllerExist($controller)\r\n {\r\n $controller = ucfirst($controller . self::$postfix);\r\n if (file_exists(\"controllers/{$controller}.php\")) {\r\n $this->controller = new $controller;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "static function isCntrl($str) {\n return ctype_cntrl($str);\n }", "protected function validController($path) {\r\n return file_exists($path) && is_readable($path);\r\n }", "function _class_check($str){\n }", "private function ControllerExist($controller) {\n $ControllerExist = false;\n\n foreach ($this->folders as $folder) {\n\n if (class_exists($folder.'\\\\'.$controller)) {\n\n $ControllerExist = true;\n $this->namespace = $folder;\n $this->controller = $controller;\n\n }\n\n }\n\n return $ControllerExist;\n\n }", "protected function parseController($str_controller)\n {\n return $this->str_controller_namespace . str_replace([' ', \"\\t\"], ['', '\\\\'], ucwords(str_replace('-', ' ', strtolower($str_controller))));\n }", "function hasMockClass($type) {\n\t\t$type = strtolower($type);\n\t\treturn $type == 'controller';\n\t}", "public function set_controller($value)\n\t{\n\t\tif(empty($this->controller))\n\t\t{\n\t\t\t$this->controller = 'Controller_' . $value;\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public static function nav($path, $str)\n {\n // Remove namespace from controllers if it exists\n $controller = \\str_replace('controllers\\\\', '', f::info()['controller']);\n\n // Check if the path is an alternative route\n if ($controller == $path) {\n\n // Return the provided string\n return $str;\n }\n\n // Check if the path equals the controller plus a wildcard\n if ($path == explode('/', $controller)[0].'/*') {\n\n // Return the provided string\n return $str;\n }\n // Check if the path equals the controller action\n else if ($path == $controller.'/'.f::info()['action']) {\n\n // Return the provided string\n return $str;\n }\n\n // Check if the path is equal to the REQUEST_URI\n if ($_SERVER['REQUEST_URI'] == $path) {\n\n // Return the provided string\n return $str;\n }\n\n // Does not match\n return false;\n }", "private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\n\t\t\tif (file_exists($controllerPatch)) {\n\t\t\t\tif (class_exists('App\\\\'.self::$app.'\\controller\\\\'.$controller)) {\n\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\tif ( ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\treturn false ;\n\t\t\t\t\t}\n\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\treturn true ;\n\t\t\t\t} else {\n\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\treturn false ;\n\t\t\t\t}\n\t\t\t} elseif ( is_dir(self::$appPatch.self::$app )) {\n\t\t\t\t$files = file::get_files_by_pattern(self::$appPatch,'*'.DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php');\n\t\t\t\tif ( is_array($files) and count($files) > 0 ){\n\t\t\t\t\t$appProvider = strings::deleteWordFirstString(strings::deleteWordLastString($files[0] ,DIRECTORY_SEPARATOR.'app_provider'.DIRECTORY_SEPARATOR.self::$app.DIRECTORY_SEPARATOR.$controller.'.php'),self::$appPatch);\n\t\t\t\t\tif (class_exists('App\\\\'.$appProvider.'\\app_provider\\\\'.self::$app.'\\\\'.$controller)) {\n\t\t\t\t\t\tarray_shift(self::$url);\n\t\t\t\t\t\tif ( ! self::checkAppIsInstalled($appProvider,true) or ! self::checkAppIsInstalled(self::$app,false) ){\n\t\t\t\t\t\t\tself::$app = 'core';\n\t\t\t\t\t\t\tself::$controller = 'httpErrorHandler';\n\t\t\t\t\t\t\tself::$method = 'E404';\n\t\t\t\t\t\t\treturn false ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tself::$controller = $controller;\n\t\t\t\t\t\tself::$appProvider = $appProvider;\n\t\t\t\t\t\treturn true ;\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t\treturn true ;\n\t}", "function url_parse_controllerAction(&$value)\n{\n if (!$value) {\n return false;\n } else {\n return preg_match('/^[a-z][a-z\\_0-9]{1,30}$/i', (string)$value);\n }\n}", "public function ifStr($str);", "public function getController($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['controller_regex'])){\r\n\t\t\tif($this->matchedRoute['controller_regex'] == true){\r\n\t\t\t\t$this->controller = 'Reg'.sha1($this->matchedRoute['controller']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->controller);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->controller);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}", "public static function hasController($modname, $type)\n {\n return (bool)self::getClass($modname, $type);\n }", "public function say_controller()\n\t{\n return $this->controller ? $this->controller : false;\n }", "public function testGetControllerClassNoControllerName()\n {\n $request = new ServerRequest([\n 'url' => 'test_plugin_three/ovens/index',\n 'params' => [\n 'plugin' => 'Company/TestPluginThree',\n 'controller' => 'Ovens',\n 'action' => 'index',\n ],\n ]);\n $result = $this->factory->getControllerClass($request);\n $this->assertSame('Company\\TestPluginThree\\Controller\\OvensController', $result);\n }", "public function checkRoute(){\n $pathController = \"../app/controllers/\".$this->controllerName.\".class.php\";\n\n if( !file_exists($pathController) ){\n //echo \"Le fichier du controller n'existe pas\";\n return false;\n }\n include $pathController;\n\n if ( !class_exists($this->controllerName) ){\n //echo \"Le fichier du controller existe mais il n'y a pas de classe\";\n return false;\n }\n if( !method_exists($this->controllerName, $this->actionName) ){\n //echo \"L'action n'existe pas\";\n return false;\n }\n return true;\n }", "private function universal_controller($c)\n\t{\n\t\tif ( !isset($this->ucontrollers[$c]) ){\n\t\t\treturn false;\n\t\t}\n\t\tif ( $this->ucontrollers[$c] === 1 ){\n\t\t\t$this->ucontrollers[$c] = is_file(self::cpath.$c.'.php') ? self::cpath.$c.'.php' : false;\n\t\t}\n\t\treturn $this->ucontrollers[$c];\n\t}", "private static function check_route($a_route){\n\t\t$args=explode(\"/\",$a_route);\n\t\t\n\t\tarray_shift($args);\n\t\tif(count($args)>1){\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=$args[0];\n\t\t\tarray_shift($args);\n\t\t}else{\n\t\t\t$controller=$args[0];\n\t\t\tarray_shift($args);\n\t\t\t$action=\"index\";\n\t\t}\n\t\t\n\t\ttry{\n\t\t\tif(file_exists('controllers/'.$controller.'_controller.php')){\n\t\t\t\trequire_once('controllers/'.$controller.'_controller.php');\n\t\t\t\t$maj_controller=ucfirst($controller).'Controller';\n\t\t\t\tif(method_exists($maj_controller,$action)){\n\t\t\t\t\t//print \"Found\";\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}catch(Exception $e){\n\t\t\t//print \"Error\";\n\t\t\t$controller=new ErrorController();\n\t\t\t$controller->server();\n\t\t\tdie();\n\t\t}\n\t}", "private function veriFyControllerOnUrl()\n {\n if (!empty($this->urlParameters[3])) {\n $this->existControllerOnRoute = true;\n }\n if ($this->urlParameters && array_key_exists(0, $this->urlParameters)) {\n $this->controller = ucfirst($this->urlParameters[0]) . 'Controller';\n $this->controllerNameAliases = $this->urlParameters[0];\n }\n }", "private function hasController($page) {\r\n return file_exists($this->getController($page));\r\n }" ]
[ "0.66163033", "0.6606014", "0.65214247", "0.6458779", "0.62580234", "0.62219995", "0.62219995", "0.6218298", "0.6018374", "0.59708786", "0.5970059", "0.5929887", "0.591216", "0.58663994", "0.58535594", "0.58518803", "0.58222216", "0.5806617", "0.5799853", "0.56931084", "0.56358296", "0.55927914", "0.5590593", "0.55761164", "0.5550902", "0.5530741", "0.54702264", "0.5405553", "0.5326642", "0.5304437" ]
0.83331805
0
Checks if a given str is a view in the pages folder.
private static function isPageView($view) { if (file_exists(APP_DIR.'/Mvc/View/'.$view.'.php')) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function isPage($view) \n {\n $view = strtolower($view);\n\n $redirect = ltrim($_SERVER['REDIRECT_URL'], '/');\n \n return $redirect === $view;\n }", "private function hasView($page) {\r\n return file_exists($this->getView($page));\r\n }", "public function checkViewExists($view);", "private static function isView($controller, $view) {\n\t\tif (file_exists(APP_DIR.'/Mvc/View/'.$controller.'/'.$view.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function view_exists($view, $viewtype = 'default') {\n global $CONFIG;\n\n if (isset($CONFIG->views->locations[$viewtype][$view]))\n return true;\n\n $result = view($view, $viewtype);\n if ($result)\n return true;\n\n return false;\n}", "public function isPage()\n {\n if(is_string($this->url)) return false;\n return $this->url->hasTarget();\n }", "protected function is_view_page() {\n\t\treturn false;\n\t}", "private function isPage( )\n\t{\n\t\t/**\n\t\t * The only pages with directories are mobile pages and dynamic pages (commerce & blog)\n\t\t */\n\t\tif( isset( $this->request['directories'] ) === true\n\t\t\t&& count( $this->request['directories'] ) > 0\n\t\t\t&& $this->request['directories'] !== 'mobile' && $this->isDynamicPage( ) === false\n\t\t)\n\t\t{\n\t\t\t$this->request['isPage'] = false;\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( preg_match( '/.html\\Z/', $this->request['file'] ) > 0 || preg_match( '/.htm\\Z/', $this->request['file'] ) > 0 )\n\t\t{\n\t\t\t$this->request['isPage'] = true;\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->request['isPage'] = false;\n\t\treturn false;\n\t}", "private function _view_file_exists()\n {\n $route = Rails::application()->dispatcher()->router()->route();\n # Build a simple path for the view file, as there's no support for\n # stuff like modules.\n # Note that the extension is PHP, there's no support for different\n # request formats.\n $base_path = Rails::config('views_path');\n $view_path = $base_path . '/' . $route->path() . '.php';\n return is_file($view_path);\n }", "public function locate($path)\n {\n $path = 'storage::fizl/views/content/' . implode(\n '/',\n array_map(\n function ($segment) {\n return str_slug(str_replace('.', '-', $segment), '-');\n },\n explode('/', $path)\n )\n );\n\n if ($this->view->exists($path) || $this->view->exists($path .= '/index')) {\n return $path;\n }\n\n return false;\n }", "function on_page($path, $type = \"name\")\n {\n switch ($type) {\n case \"url\":\n $result = ($path == request()->is($path));\n break;\n\n default:\n $result = ($path == request()->route()->getName());\n }\n\n return $result;\n }", "private function checkForView($name)\n {\n $viewFile = $this->config['views'] . '/' . $name . '.blade.php';\n if (!file_exists($viewFile)) {\n return false;\n }\n\n return true;\n }", "public function findView($view, $path, $extension)\n {\n if (file_exists($path . $view . $extension)) {\n return true;\n }\n\n return false;\n }", "private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private function isPage($file) {\n\t\t$tmp = explode('.', $file);\n\t\t\n\t\treturn in_array(strtolower(end($tmp)), $this->formatPages);\n\t}", "public static function isValid(){\n\n\t\t$valid=false;\n\t\tif(isset($_GET[\"view\"])){\n\t\t\t$url =\"\";\n\t\t\tif(Core::$root==\"\"){\n\n\n\t\t\t\t$url = \"core/app/view/\".$_GET['view'].\"-view.php\";\n\n\t\t\t}\n\n\t\t\tif(file_exists($file = $url)){\n\t\t\t\t$valid = true;\n\t\t\t}\n\t\t}\n\t\treturn $valid;\n\t}", "public function canManagePages();", "private function isStaticPage($url) {\n\t\treturn substr($url, 0, 1) !== '_' && file_exists($this->getTemplateForPage($url));\n\t}", "public static function pageInPath($strId)\n {\n $page = $GLOBALS['objPage'];\n while (true) {\n if (intval($strId) == $page->id || $strId == $page->alias) {\n return true;\n }\n if ($page->pid > 0) {\n $page = \\PageModel::findByPk($page->pid);\n } else {\n return false;\n }\n }\n }", "public static function isPage();", "public function hasPages();", "public function hasPages();", "private function isDynamicPage()\n\t{\n\t\tif ( isset( $this->request['directories'] ) === true && count( $this->request['directories'] ) > 0 )\n\t\t{\n\t\t\t/**\n\t\t\t * Check if either the base directory is a store or a call to a file in the apps folder\n\t\t\t * or if it is the base directory for a blog (meaning the base directory is also a file in published data)\n\t\t\t */\n\t\t\tif ( $this->isDynamicRoute( $this->request['directories'][0] ) ||\n\t\t\t\t( is_numeric( $this->request['directories'][0] ) === true )\n\t\t\t)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function checkAccessToPage($path){\n\t\t//Get current authenticated user data\n\t\t$admin = Auth::user();\n\t\t//Get user role\n\t\t$admin_roles = Roles::select('slug', 'access_pages')->where('slug', '=', $admin['role'])->first();\n\t\t//Check for Grant-access rules\n\t\tif($admin_roles->access_pages == 'grant_access'){\n\t\t\treturn true;\n\t\t}\n\n\t\t//Get accesses list for current role (access_pages is forbidden pages list)\n\t\t$forbidden_pages = (array)json_decode($admin_roles->access_pages);\n\t\t//get path for current page\n\t\t$natural_path = $this->getNaturalPath($path);\n\t\t//Get current page data\n\t\t$current_page = AdminMenu::select('id', 'slug')->where('slug', '=', $natural_path)->first();\n\n\t\t//if there is no id of current page in forbidden pages list\n\t\tif(!in_array($current_page->id, array_keys($forbidden_pages))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//Check for CRUD restrictions\n\t\t\t$forbidden_pages = json_decode($admin_roles->access_pages);\n\t\t\t$current_page_id = $current_page->id;\n\n\t\t\t//convert current page path to full-slash view\n\t\t\t$path = (substr($path, 0,1) != '/')? '/'.$path: $path;\n\t\t\t//create path to links array\n\t\t\t$path_array = array_values(array_diff(explode('/',$path), ['']));\n\t\t\t//check for action-path\n\t\t\tswitch($path_array[count($path_array) -1]){\n\t\t\t\tcase 'edit':\n\t\t\t\tcase 'update':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'u') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'create':\n\t\t\t\tcase 'store':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'c') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'r') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "function nav_is($url)\n{\n $current = URL::makeAbsolute(URL::getCurrentWithQueryString());\n\n return $url === $current || Str::startsWith($current, $url . '/');\n}", "function sc_is_page( $page_name ){\n\tglobal $global_options;\n\t$options = (array)$global_options;\n\treturn (int)$options[$page_name] > 0 && is_page((int)$options[$page_name]);\n}", "public static function page($strId)\n {\n global $objPage;\n\n return is_numeric($strId) && intval($strId) == $objPage->id ||\n $strId == $objPage->alias;\n }", "private function determineView($url){\n\t\t\n\t\t$view = false;\n\t\t$view_section = false;\n\t\t$url_parts = explode('/', $url);\n\t\t\n\t\t//TODO: Here should come the part, where the url sheme should be analized according to the system configuration\n\t\tif($url_parts[0] == \"admin\"){\n\t\t\t$view = \"Admin_Index\";\n\t\t} else {\n\t\t\t$view = \"Frontend_Content\";\n\t\t}\n\t\t\n\t\t$_GET['BD']['core']['view']['name'] = $this->view;\n\t\t$_GET['BD']['core']['url'] = $url;\n\t\t$_GET['BD']['core']['path'] = $url;\n\t\t\n\t\treturn $view;\n\t}", "public function hasView() {\n\t\treturn is_object($this->view);\n\t}", "public function is_page();" ]
[ "0.6764893", "0.66470164", "0.6254008", "0.6242993", "0.61892945", "0.61081576", "0.60895896", "0.6070232", "0.6036533", "0.600138", "0.597976", "0.5944098", "0.59296477", "0.5889524", "0.5856082", "0.57967836", "0.5772895", "0.5757424", "0.5753627", "0.5735197", "0.5725386", "0.5725386", "0.5711749", "0.5638988", "0.5608516", "0.5577394", "0.5563761", "0.5537848", "0.5465137", "0.54537857" ]
0.7225363
0
Formats a given str as a controller
private static function formatAsController($str) { if (strpos($str, 'Controller') === false) { $str = ucfirst(strtolower($str)).'Controller'; } return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function parseController($str_controller)\n {\n return $this->str_controller_namespace . str_replace([' ', \"\\t\"], ['', '\\\\'], ucwords(str_replace('-', ' ', strtolower($str_controller))));\n }", "public function formatController()\n {\n if ($this->controllerFormatter) {\n return call_user_func($this->controllerFormatter, $this);\n }\n return 'Controller' . StringObject::create($this->getController())->toClass();\n }", "private static function formatAsAction($str) {\n\t\tif (strpos($str, '_') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '_');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\t\t\t\t\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '_') !== false);\n\t\t\t\n\t\t\treturn $str;\n\t\t}\n\t\telseif (strpos($str, '-') !== false) {\n\t\t\tdo {\n\t\t\t\t$uPos = strpos($str, '-');\n\t\t\t\t$str = substr_replace($str, '', $uPos, 1);\n\n\t\t\t\t$str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1);\n\t\t\t}\n\t\t\twhile(strpos($str, '-') !== false);\n\n\t\t\treturn $str;\n\t\t}\n\t\telse {\n\t\t\treturn $str;\n\t\t}\n\t}", "public function getController() : string\n {\n return preg_replace($this->match, $this->replacement, $this->uri);\n }", "public function getController() : string\n {\n return preg_replace($this->match, $this->replacement, $this->uri);\n }", "public function formatControllerName($unformatted)\n {\n\t return ucfirst($this->_formatName($unformatted)) . 'Controller';\n }", "abstract protected function formatString($str);", "public function formatControllerName($unformatted)\n {\n return ucfirst($this->_formatName($unformatted)) . 'Controller';\n }", "public static function format($str, $template) {}", "public function CompleteControllerName ($controllerNamePascalCase);", "private static function convert_controller_uri($s_controller)\n\t{\n\t\t$uri = explode('\\\\',$s_controller);\n\t\t$uri = explode('_',$uri[1]);\n\t\treturn strtolower($uri[1]);\n\t}", "public function getController() : string\n {\n return substr($this->uri, 0, -strlen($this->match)) .\n $this->replacement;\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "private function format_string($str)\n {\n $str = str_replace(\"\\t\", \"%09\", $str);\n $str = str_replace(\"+\", \"%2B\", $str);\n $str = str_replace(\":\", \"%3A\", $str);\n $str = str_replace(\"/\", \"%2F\", $str);\n return $str;\n }", "public function urlToController($url) {\n $urlParts = explode('/', trim($url, '/'));\n $servicePart = empty($urlParts[0]) ? 'Default' : $urlParts[0];\n $methodPart = empty($urlParts[1]) ? 'index' : $urlParts[1];\n $method = $this->dashedToCamelCase($methodPart);\n $service = ucfirst($this->dashedToCamelCase($servicePart)) . 'Controller';\n return sprintf('%s:%s', $service, $method);\n }", "private static function isController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t\n\t\tif (file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php')) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "static function makeNewRout($str,$arr){\n Route::$routeName = trim(strip_tags($str));\n Route::$routeName = $arr['as'];\n $func=explode($arr,'@');\n Route::$controller=$func['0'];\n if (isset($func[1])){\n Route::$method=$func[1];\n }else{\n Route::$method='index';\n }\n return false;\n }", "public function getController($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['controller_regex'])){\r\n\t\t\tif($this->matchedRoute['controller_regex'] == true){\r\n\t\t\t\t$this->controller = 'Reg'.sha1($this->matchedRoute['controller']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->controller);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->controller);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}", "function controller($shortName)\n{\n list($shortClass, $shortMethod) = explode('/', $shortName);\n\n return sprintf('KnpU\\\\ActivityRunner\\\\Controller\\\\%sController::%sAction', ucfirst($shortClass), $shortMethod);\n}", "public function formatUrlKey($str)\n {\n return $this->filter->translitUrl($str);\n }", "public static function WriteInController($controller)\n {\n return \"<?php \\n\n namespace App\\Controller; \\n \n use Speeder\\Controller\\Controller; \\n \n /**\n * generer par Consolino de Speeder-Framework\n * @author sele shabani <[email protected]>\n */\\n\n class $controller extends Controller\n {\\n\n public function index()\\n\n {\\n \n //this->Render('');\\n\n }\\n\n }\";\n }", "private static function toClass( $controller )\n {\n $classString = str_replace( ' ', '', ucwords( str_replace( '-', ' ', $controller ) ) );\n \n return 'controller\\\\' . $classString;\n }", "protected function formatParam( $str )\n\t{\n\t\treturn \"__\".$str.\"__\";\n\t}", "public function getControllerName()\n {\n return preg_replace(\"/(.*)[\\\\\\\\](.*)(Controller)/\", '$2', get_class($this));\n }", "private static function formatStr($str)\n {\n $roomType = '';\n $roomClass = '';\n $arr = array();\n\n if (isset($str) and ! empty($str)) {\n $arr = explode(\";\", $str);\n }\n\n $deli = \"\";\n for ($i = 0; $i < count($arr) - 2; $i ++) {\n $tempStr = $arr[$i];\n $roomType .= $deli . substr($tempStr, 0, strpos($tempStr, \"/\"));\n $roomClass .= $deli . $tempStr;\n }\n\n return ($roomType . \"*\" . $roomClass);\n }", "public function validateController( $input = '' )\n {\n if( ! is_string( $input ) )\n {\n throw new \\Exception(\n 'Route Validation Error :: String type expected'\n . ' - Current type ( ' . gettype( $input ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n if( mb_strlen( $input ) > 0 )\n {\n if( preg_match( Route::BLACKLIST_CONTROLLER_CHARS, $input, $matched ) === 0 ) {\n $input = trim( mb_strtolower( $input ) );\n return $input;\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation'\n . ' - Invalid chars found ( ' . escaped( $matched['deny'] ) . ' )'\n , Status::BAD_REQUEST\n );\n }\n\n throw new \\Exception(\n 'Route Validation Error :: Input string failed validation [ No input ]'\n , Status::BAD_REQUEST\n );\n }", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function __construct($str_controller_namespace = '\\\\')\n {\n $this->str_controller_namespace = $str_controller_namespace;\n }", "public function labelMaker($str) {\n $str_out = ucwords(\\strtr($str,'_',' ')); \n return $str_out; \n }", "public function formatUrlKey(string $str): string\n {\n return $this->filter->translitUrl($str);\n }" ]
[ "0.6970797", "0.6738775", "0.65079224", "0.6025618", "0.6025618", "0.60249835", "0.57851666", "0.57725537", "0.5745035", "0.5727837", "0.5700719", "0.5695559", "0.56453604", "0.5628388", "0.55458844", "0.5442368", "0.5432827", "0.5406672", "0.53965557", "0.5357598", "0.53435636", "0.53414017", "0.5310855", "0.53034115", "0.5294079", "0.5278368", "0.52313983", "0.5221784", "0.52145964", "0.52122295" ]
0.8081607
0
Formats a given string as an action (Capitalcase)
private static function formatAsAction($str) { if (strpos($str, '_') !== false) { do { $uPos = strpos($str, '_'); $str = substr_replace($str, '', $uPos, 1); $str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1); } while(strpos($str, '_') !== false); return $str; } elseif (strpos($str, '-') !== false) { do { $uPos = strpos($str, '-'); $str = substr_replace($str, '', $uPos, 1); $str = substr_replace($str, strtoupper(substr($str, $uPos, 1)), $uPos, 1); } while(strpos($str, '-') !== false); return $str; } else { return $str; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function toCamelCase($action) {\n\t\tif (strpos($action, '-') !== false) {\n\t\t\t$camelCaseName = str_replace(' ', '', ucwords(str_replace('-', ' ', $action)));\n\t\t\t$camelCaseName[0] = strtolower($camelCaseName[0]);\n\t\t\t$action = $camelCaseName;\n\t\t}\n\t\treturn $action;\n\t}", "public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1) . 'Action';\n }", "public function formatActionName($unformatted)\n {\n return strtolower(substr($this->_formatName($unformatted),0,1)) . substr($unformatted,1) . 'Action';\n }", "protected function getActionMethod(string $action): string\n {\n $sentence = preg_replace('/[\\W_]+/', ' ', $action);\n return lcfirst(str_replace(' ', '', ucwords($sentence)));\n }", "public function formatActionName($unformatted)\n {\n $formatted = $this->_formatName($unformatted, true);\n return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1);\n }", "public function urlToActionName($name){\n // just turn dash-format into upperCamelCaseFormat\n return preg_replace(\"/\\-(.)/e\", \"strtoupper('\\\\1')\", $name) . 'Action';\n }", "function class_to_event_str($str, $action, $uppercase = true) {\n if (!is_string($str)) {\n $str = get_class($str);\n }\n\n $str = $str.\"\\\\\".$action;\n\n $str = str_replace(\"\\\\\", \"_\", $str);\n\n if ($uppercase) {\n $str = strtoupper($str);\n }\n\n return $str;\n }", "public static function action()\n {\n return strtolower(static::name());\n }", "private static function toMethod( $action )\n {\n $actionString = str_replace( ' ', '', ucwords( str_replace( '-', ' ', $action ) ) );\n $actionString[0] = strtolower( $actionString[0] );\n \n return 'action_' . $actionString;\n }", "protected function parseAction($actionName)\n {\n if (strpos($actionName, '-') !== false) {\n return camel_case($actionName);\n }\n\n return $actionName;\n }", "function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }", "function get_action() {\n \t\tglobal $argv;\n\t\treturn strtolower(trim($argv['1']));\n\t}", "public function getAction($ucfirst=true){\r\n\t\tif(is_array($this->matchedRoute) && isset($this->matchedRoute['action_regex'])){\r\n\t\t\tif($this->matchedRoute['action_regex'] == true){\r\n\t\t\t\t$this->action = 'Reg'.sha1($this->matchedRoute['action']);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif($ucfirst){\r\n\t\t\t$o = ucfirst($this->action);\r\n\t\t} else {\r\n\t\t\t$o = strtolower($this->action);\r\n\t\t}\r\n\t\treturn $o;\r\n\t}", "public static function formatStringToMethodName(string $input) : string\n {\n $methodName = implode('', array_map('ucfirst', explode('_', strtolower($input))));\n\n return $methodName;\n }", "function formatInput($param1)\n{\n return ucwords(strtolower($param1));\n}", "public function setAction($str);", "function _toCamel($str) {\r\n if (!is_string($str)) return '';\r\n $func = create_function('$c', 'return strtoupper($c[1]);');\r\n return ucfirst(preg_replace_callback('/_([a-z])/', $func, $str));\r\n}", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "public function obfuscateMethodNames($action)\n\t{\n\treturn $action;\t\n\t}", "function manipulateChars($string,$action,$from,$to) {\n\t\t$stringtemp=\"\";\n\t\t$from=$from-1;\n\t\t$to=$to-1;\n\t\t$len=strlen($string);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif ($sub>=$from and $sub<=$to) {\n\t\t\t\tif ($action=='toUpper') $stringtemp.=strtoupper(substr($string,$sub,1));\n\t\t\t\tif ($action=='toLower') $stringtemp.=strtolower(substr($string,$sub,1));\n\t\t\t} else $stringtemp.=substr($string,$sub,1);\n\t\t}\n\t\t\n\t\treturn $stringtemp;\n\t}", "function formatWord ($param1)\n{\n return ucfirst($param1);\n}", "function macro_convert_camel_to_human_readable($camel)\n{\n $camel = str_replace('_', ' ', $camel);\n $camel = str_replace('\\\\', ' ', $camel);\n $camel = preg_replace_callback(\n '/ ([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return ' ' . strtolower($matches[1]) . $matches[2];\n },\n $camel\n );\n $camel = preg_replace_callback(\n '/([a-z0-9])([A-Z])([a-z0-9])/Ss',\n function (array $matches) {\n return $matches[1] . ' ' . strtolower($matches[2]) . $matches[3];\n },\n $camel\n );\n\n return ucfirst($camel);\n}", "function acf_str_camel_case($string = '')\n{\n}", "function fmtCase($text) {\n\t\tglobal $assoc_case;\n\n\t\tif ($assoc_case == \"lower\") $newtext\t= strtolower($text);\n\t\telse if ($assoc_case == \"upper\") $newtext\t= strtoupper($text);\n\t\treturn $newtext;\n\n\t}", "function atk_strtoupper($str)\n{\n\treturn atkString::strtoupper($str);\n}", "static public function to_camel_case($str, $capitalise_first_char = FALSE) {\n if($capitalise_first_char) {\n $str[0] = strtoupper($str[0]);\n }\n $func = create_function('$c', 'return strtoupper($c[1]);');\n return preg_replace_callback('/_([a-z])/', $func, $str);\n }", "public function get_usable_action_name( $action_name ) {\n\n\t\t$action_name = sanitize_title_with_dashes( $action_name, false, 'save' );\n\t\t$action_name = str_replace( '-', '_', $action_name );\n\n\t\treturn $action_name;\n\n\t}", "private function getActionName()\n {\n return strtolower($this->_request->getActionName());\n }", "function map_action($action) {\n return $action . '_action';\n }", "private function _to_camel_case($str, $capitalise_first_char = false)\n\t{\n\t\tif ($capitalise_first_char) {\n\t\t\t$str[0] = strtoupper($str[0]);\n\t\t}\n\n\t\t$func = create_function('$c', 'return strtoupper($c[1]);');\n\t\t\n\t\treturn preg_replace_callback('/_([a-z])/', $func, $str);\n\t}" ]
[ "0.7624825", "0.7171836", "0.712573", "0.7119662", "0.68596286", "0.67322934", "0.67312527", "0.64850795", "0.6424997", "0.6414933", "0.64109814", "0.6386412", "0.6340044", "0.62734395", "0.6226518", "0.6158293", "0.6085061", "0.6052864", "0.6027305", "0.60209054", "0.5996528", "0.59824896", "0.5938023", "0.5936653", "0.59254616", "0.5918651", "0.5910798", "0.59004647", "0.5888891", "0.58813024" ]
0.7201377
1
Retorna todos os municipios
function getAll() { $municipios = array(); $conexao = Conexao::con(); $sql[] = "SELECT * FROM municipio m ORDER by m.nome"; $query = mysqli_query( $conexao, join( '', $sql ) ); while ( $row = mysqli_fetch_array( $query ) ) { $municipio = new stdClass(); $municipio->idMunicipio = $row['id_municipio']; $municipio->idUf = $row['id_uf']; $municipio->nome = utf8_encode( $row['nome'] ); $municipios[] = $municipio; } return $municipios; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getListaMunicipios() {\n $droptions = Municipio::find()->orderBy('nombre_municipio')->asArray()->all();\n return ArrayHelper::map($droptions, 'id', 'nombre_municipio');\n }", "public function actualizarMunicipiosTodos()\n\t\t{\n\t\t\t$this->load->model(\"modpersona\");\n\t\t\t$dpto=$this->input->post(\"id\");\n\t\t\t$mpio=$this->modpersona->consultarTodosMpios($dpto);\n\t\t\techo '<option value=\"\">Seleccione el municipio</option>';\n \t\t\tfor($i=0;$i<count($mpio);$i++)\n \t\t\t{\n \t\t\t\techo '<option value=\"'.$mpio[$i][\"VALOR_MINIMO\"].'\">'.$mpio[$i][\"DESCRIPCION\"].'</option>';\n \t\t\t}\n\t\t}", "public function actualizarMunicipios()\n\t\t{\n\t\t\t$this->load->model(\"modpersona\");\n\t\t\t$dpto=$this->input->post(\"id\");\n\t\t\t$mpio=$this->modpersona->consultarMpio($dpto);\n\t\t\techo '<option value=\"\">Seleccione el municipio</option>';\n \t\t\tfor($i=0;$i<count($mpio);$i++)\n \t\t\t{\n \t\t\t\techo '<option value=\"'.$mpio[$i][\"VALOR_MINIMO\"].'\">'.$mpio[$i][\"DESCRIPCION\"].'</option>';\n \t\t\t}\n\t\t}", "public function getconsultaMunicipio($municipio){\n try{\n $consulta = $this->DB->query(\"select municipios.Municipio, Latitud, Longitud, tipositio.NombreSitio, \n estadooperacion.EstadoOperacion, Toneladas_por_dia, Anios_vida_util, CASE WHEN Proyecto_Ejecutivo = 1 THEN 'Si' ELSE 'No' END as Proyecto_Ejecutivo, \n CASE WHEN Cumple_Norma = 1 THEN 'Si' ELSE 'No' END as Cumple_Norma, CASE WHEN Pepena = 1 THEN 'Si' ELSE 'No' END as Pepena\n from sitios, municipios, tipositio, estadooperacion\n where sitios.Municipio = municipios.idMunicipios\n and tipositio.idTipoSitio = sitios.TipoSitio\n and estadooperacion.idEstadoOperacion = sitios.Estado_Operacion\n and municipios.idMunicipios = '$municipio'\");\n while($registro = $consulta->fetch(PDO::FETCH_ASSOC)){\n $this->puntos[] = $registro;\n }\n\n $DB = null;\n return $this->puntos;\n }\n catch(Exception $e){\n echo \"linea de error\".$e->getLine().\"<br>\";\n echo \"excepcion\".$e->getMessage();\n }\n /*\n finally{\n $DB = null;\n }*/\n }", "public function actionListMunicipio($i)\n {\n \n\n $ListMunicipios = Municipios::find()->where('estado =:estado', [':estado' => $i])\n //->andwhere('inactivo =:inactivo', [':inactivo' => 0])\n ->all();\n \n\n if ( $ListMunicipios > 0 ) {\n echo \"<option value='0'>\" . \"Select...\" . \"</option>\";\n foreach ( $ListMunicipios as $solicitud ) {\n echo \"<option value='\" . $solicitud->municipio . \"'>\" . $solicitud->nombre . \"</option>\";\n }\n } else {\n echo \"<option> - </option>\";\n }\n }", "public function getMunicipio($region){\n try{\n $consulta = $this->DB->query(\"select idMunicipios,Municipio from municipios\n where LEFT(IdMunicipios, 4) = '$region'\n order by municipios.Municipio \");\n while($registro = $consulta->fetch(PDO::FETCH_ASSOC)){\n $this->puntos[] = $registro;\n }\n\n $DB = null;\n return $this->puntos;\n }\n catch(Exception $e){\n echo \"linea de error\".$e->getLine().\"<br>\";\n echo \"excepcion\".$e->getMessage();\n }\n\n }", "function getMunicipios() {\n $Estaciones = new EstacionHidrometrica();\n echo json_encode($Estaciones->getMunicipios(filter_input(INPUT_POST, \"query\")));\n}", "public function cargarMunicipio() {\n $municipio = Municipio::all(['id','nombre','departamento_id']);\n return response()->json([\n 'municipio'=>$municipio\n ]);\n }", "public function getOudtshoornCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '102'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function show(municipios $municipios)\n {\n //\n }", "function consultarMunicipios(){\n\t\t$this->output->set_header('Content-type: application/json');\n\t\t$resultado = $this->reg->consultarMunicipios($this->input->post('codpai'),$this->input->post('coddep'));\n\t if($resultado!=false){\n\t\t $data = array();\n\t\t\t foreach ($resultado as $row){\n\t\t\t\t \t$fila = array('codigo'=>$row['codmun'],'nombre'=>$row['nommun']);\n\t\t\t\t \t$data[] = $fila;\n\t\t }\n\t\t echo json_encode($data);\n\t\t }else{echo '{\"msg\":\"1\"}';}\n\t}", "public function crearMunicipios()\n {\n\n/**\n * Database `encuesta`\n */\n\n/* `encuesta`.`municipios` */\n$municipios = array(\n array('id' => '1','nombre' => 'Tres de Abril','url' => 'http://www.corrientesintensa.com/destino/tres-de-abril/','logo' => 'images/municipios/tres-de-abril.jpg','microrregion_id' => '4','indec_id' => '0','indec_nombre' => NULL,'departamento_id' => NULL),\n array('id' => '2','nombre' => '9 de Julio','url' => 'http://www.corrientes.gov.ar/home/9-de-julio/municipio','logo' => 'images/municipios/9_de_julio.png','microrregion_id' => '4','indec_id' => '0399','indec_nombre' => '9 de Julio (Est. Pueblo 9 de Julio)','departamento_id' => '161'),\n array('id' => '3','nombre' => 'Alvear','url' => '','logo' => 'images/municipios/alvear.jpg','microrregion_id' => '2','indec_id' => '0098','indec_nombre' => 'Alvear','departamento_id' => '056'),\n array('id' => '4','nombre' => 'Bella Vista','url' => 'http://www.bellavista.gob.ar/','logo' => 'images/municipios/bellavista.png','microrregion_id' => '4','indec_id' => '0007','indec_nombre' => 'Bella Vista','departamento_id' => '007'),\n array('id' => '5','nombre' => 'Berón de Astrada','url' => '','logo' => 'images/municipios/escudo-beron-de-estrada.png','microrregion_id' => '6','indec_id' => '0014','indec_nombre' => 'Berón de Astrada','departamento_id' => '014'),\n array('id' => '6','nombre' => 'Bonpland','url' => 'https://www.corrientes.gov.ar/home/bonpland/municipio','logo' => 'images/municipios/bonpland.png','microrregion_id' => '3','indec_id' => '0280','indec_nombre' => 'Bonpland','departamento_id' => '119'),\n array('id' => '7','nombre' => 'Caá Catí','url' => '','logo' => 'images/municipios/caa_cati.png','microrregion_id' => '6','indec_id' => '0112','indec_nombre' => 'Nuestra Señora del Rosario de Caá Catí ','departamento_id' => '063'),\n array('id' => '8','nombre' => 'Colonia Carlos Pellegrini','url' => 'http://www.corrientes.gov.ar/home/colonia-carlos-pellegrini/municipio','logo' => 'images/municipios/cnia-carlos pellegrini.png','microrregion_id' => '2','indec_id' => '0357','indec_nombre' => 'Colonia Carlos Pellegrini','departamento_id' => '147'),\n array('id' => '9','nombre' => 'Colonia Carolina','url' => '','logo' => 'images/municipios/carolina.png','microrregion_id' => '4','indec_id' => '0137','indec_nombre' => 'Colonia Carolina','departamento_id' => '070'),\n array('id' => '10','nombre' => 'Chavarría','url' => 'http://www.corrientes.gov.ar/home/chavarria/municipio','logo' => 'images/municipios/chavarria.jpg','microrregion_id' => '4','indec_id' => '0413','indec_nombre' => 'Chavarría','departamento_id' => '161'),\n array('id' => '11','nombre' => 'Colonia Libertad','url' => 'http://www.corrientes.gov.ar/home/colonia-libertad/municipio','logo' => 'images/municipios/colonia-libertad.jpg','microrregion_id' => '3','indec_id' => '0252','indec_nombre' => 'Colonia Libertad','departamento_id' => '112'),\n array('id' => '12','nombre' => 'Colonia Liebig','url' => 'https://www.corrientes.gov.ar/home/colonia-liebig/municipio','logo' => 'images/municipios/colonia_liebig.png','microrregion_id' => '2','indec_id' => '0161','indec_nombre' => 'Colonia Liebigs','departamento_id' => '084'),\n array('id' => '13','nombre' => 'Colonia Pando','url' => 'http://www.corrientes.gov.ar/home/colonia-pando/municipio','logo' => 'images/municipios/pando.jpg','microrregion_id' => '4','indec_id' => '0417','indec_nombre' => 'Colonia Pando','departamento_id' => '161'),\n array('id' => '14','nombre' => 'Concepción','url' => '','logo' => 'images/municipios/escudo-concepcion.png','microrregion_id' => '5','indec_id' => '0042','indec_nombre' => 'Concepción','departamento_id' => '028'),\n array('id' => '15','nombre' => 'Corrientes','url' => 'http://ciudaddecorrientes.gov.ar/','logo' => 'images/municipios/capital.png','microrregion_id' => '1','indec_id' => '0021','indec_nombre' => 'Corrientes','departamento_id' => '021'),\n array('id' => '16','nombre' => 'Cruz de los Milagros','url' => '','logo' => 'images/municipios/cruz_de_los_milagros.png','microrregion_id' => '4','indec_id' => '0189','indec_nombre' => 'Cruz de los Milagros','departamento_id' => '091'),\n array('id' => '17','nombre' => 'Curuzú Cuatiá','url' => '','logo' => 'images/municipios/curuzu_cuatia.png','microrregion_id' => '3','indec_id' => '0056','indec_nombre' => 'Curuzú Cuatiá','departamento_id' => '035'),\n array('id' => '18','nombre' => 'Empedrado','url' => '','logo' => 'images/municipios/empedrado.png','microrregion_id' => '5','indec_id' => '0077','indec_nombre' => 'Empedrado','departamento_id' => '042'),\n array('id' => '19','nombre' => 'Esquina','url' => 'http://www.esquinacorrientes.gob.ar/','logo' => 'images/municipios/esquina.jpg','microrregion_id' => '4','indec_id' => '0084','indec_nombre' => 'Esquina','departamento_id' => '049'),\n array('id' => '20','nombre' => 'Estación Torrent','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0105','indec_nombre' => 'Estación Torrent','departamento_id' => '056'),\n array('id' => '21','nombre' => 'Felipe Yofre','url' => 'https://www.corrientes.gov.ar/home/felipe-yofre/municipio','logo' => 'images/municipios/felipe-yofre.jpg','microrregion_id' => '3','indec_id' => '0231','indec_nombre' => 'Felipe Yofré','departamento_id' => '105'),\n array('id' => '22','nombre' => 'Garabí','url' => 'https://es.wikipedia.org/wiki/Garab%C3%AD_(Corrientes)','logo' => 'images/municipios/garabi.jpg','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '23','nombre' => 'Garruchos','url' => 'https://www.corrientes.gov.ar/home/garruchos/municipio','logo' => 'images/municipios/garrucho.bmp','microrregion_id' => '2','indec_id' => '0427','indec_nombre' => 'Garruchos','departamento_id' => '168'),\n array('id' => '24','nombre' => 'Gobernador Martinez','url' => '','logo' => 'images/municipios/gobernador_martinez.png','microrregion_id' => '4','indec_id' => '0196','indec_nombre' => 'Gobernador Juan E. Martínez','departamento_id' => '091'),\n array('id' => '25','nombre' => 'Gobernador V. Virasoro','url' => 'http://www.virasoro.gob.ar/','logo' => 'images/municipios/virasoro.jpg','microrregion_id' => '2','indec_id' => '0434','indec_nombre' => 'Gobernador Igr. Valentín Virasoro ','departamento_id' => '168'),\n array('id' => '26','nombre' => 'Goya','url' => '','logo' => 'images/municipios/goya.png','microrregion_id' => '4','indec_id' => '0140','indec_nombre' => 'Goya','departamento_id' => '070'),\n array('id' => '27','nombre' => 'Guaviraví','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0364','indec_nombre' => 'Guaviraví','departamento_id' => '147'),\n array('id' => '28','nombre' => 'Herliztka','url' => '','logo' => 'images/municipios/escudo-herliztka.png','microrregion_id' => '6','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '29','nombre' => 'Ita Ibaté','url' => 'http://www.corrientes.gov.ar/home/ita-ibate/municipio','logo' => 'images/municipios/itaibate.jpg','microrregion_id' => '6','indec_id' => '0119','indec_nombre' => 'Itá Ibaté','departamento_id' => '063'),\n array('id' => '30','nombre' => 'Itatí','url' => '','logo' => 'images/municipios/escudo-itati.png','microrregion_id' => '6','indec_id' => '0147','indec_nombre' => 'Itatí','departamento_id' => '077'),\n array('id' => '31','nombre' => 'Ituzaingó','url' => '','logo' => 'images/municipios/ituzaingo.jpg','microrregion_id' => '2','indec_id' => '0168','indec_nombre' => 'Ituzaingó','departamento_id' => '084'),\n array('id' => '32','nombre' => 'José Rafael Gomez','url' => '','logo' => 'images/municipios/escudo-jose-r-gomez.png','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '33','nombre' => 'Juan Pujol','url' => '','logo' => 'images/municipios/escudo-juan-pujol.png','microrregion_id' => '3','indec_id' => '0259','indec_nombre' => 'Juan Pujol','departamento_id' => '112'),\n array('id' => '34','nombre' => 'La Cruz','url' => 'http://www.lacruz.gov.ar/','logo' => 'images/municipios/la-cruz.png','microrregion_id' => '2','indec_id' => '0371','indec_nombre' => 'La Cruz','departamento_id' => '147'),\n array('id' => '35','nombre' => 'San Isidro','url' => '','logo' => 'images/municipios/escudo-san-isidro.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '36','nombre' => 'Lomas de Vallejos','url' => 'http://www.corrientes.gov.ar/home/lomas-de-vallejos/municipio','logo' => 'images/municipios/loma-de-vallejos.jpg','microrregion_id' => '6','indec_id' => '0126','indec_nombre' => 'Lomas de Vallejos','departamento_id' => '063'),\n array('id' => '37','nombre' => 'Loreto','url' => 'https://www.corrientes.gov.ar/home/loreto/municipio','logo' => 'images/municipios/loreto.jpg','microrregion_id' => '5','indec_id' => '0385','indec_nombre' => 'Loreto','departamento_id' => '154'),\n array('id' => '38','nombre' => 'Mariano I. Loza','url' => 'http://www.corrientes.gov.ar/home/mariano-i-loza/municipio','logo' => 'images/municipios/mariano-loza.jpg','microrregion_id' => '3','indec_id' => '0238','indec_nombre' => 'Mariano I. Loza (Est. Justino Solari)','departamento_id' => '105'),\n array('id' => '39','nombre' => 'Mburucuyá','url' => 'http://www.corrientes.gov.ar/home/mburucuya/municipio','logo' => 'images/municipios/mburucuya.jpg','microrregion_id' => '5','indec_id' => '0224','indec_nombre' => 'Mburucuyá','departamento_id' => '098'),\n array('id' => '40','nombre' => 'Mercedes','url' => '','logo' => 'images/municipios/mercedes.png','microrregion_id' => '3','indec_id' => '0245','indec_nombre' => 'Mercedes','departamento_id' => '105'),\n array('id' => '41','nombre' => 'Mocoretá','url' => 'http://www.corrientes.gov.ar/home/mocoreta/municipio','logo' => 'images/municipios/mocoreta.JPG','microrregion_id' => '3','indec_id' => '0266','indec_nombre' => 'Mocoretá','departamento_id' => '112'),\n array('id' => '42','nombre' => 'Monte Caseros','url' => 'http://www.corrientes.gov.ar/home/monte-caseros/municipio','logo' => 'images/municipios/monte-caseros.gif','microrregion_id' => '3','indec_id' => '0273','indec_nombre' => 'Monte Caseros','departamento_id' => '112'),\n array('id' => '43','nombre' => 'Pago de los Deseos','url' => '','logo' => 'images/municipios/escudo-pago-de-los-deseos.png','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '44','nombre' => 'Palmar Grande','url' => '','logo' => 'images/municipios/escudo-palmar-grande.png','microrregion_id' => '6','indec_id' => '0133','indec_nombre' => 'Palmar Grande','departamento_id' => '063'),\n array('id' => '45','nombre' => 'Parada Pucheta','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0287','indec_nombre' => 'Parada Pucheta','departamento_id' => '119'),\n array('id' => '46','nombre' => 'Paso de la Patria','url' => '','logo' => 'images/municipios/escudo-paso-de-la-patria.png','microrregion_id' => '6','indec_id' => '0322','indec_nombre' => 'Paso de la Patria','departamento_id' => '133'),\n array('id' => '47','nombre' => 'Paso de los Libres','url' => 'http://pasodeloslibres.gob.ar/','logo' => 'images/municipios/paso-de-los-libres.jpg','microrregion_id' => '3','indec_id' => '0294','indec_nombre' => 'Paso de los Libres','departamento_id' => '119'),\n array('id' => '48','nombre' => 'Pedro R. Fernandez','url' => '','logo' => 'images/municipios/escudo-pedro-r-Fernandez.png','microrregion_id' => '4','indec_id' => '0406','indec_nombre' => 'Pedro R. Fernández (Est. Manuel F. Mantilla)','departamento_id' => '161'),\n array('id' => '49','nombre' => 'Perugorria','url' => 'http://www.corrientes.gov.ar/home/perugorria/municipio','logo' => 'images/municipios/perugorria.gif','microrregion_id' => '3','indec_id' => '0070','indec_nombre' => 'Perugorría','departamento_id' => '035'),\n array('id' => '50','nombre' => 'Pueblo Libertador','url' => '','logo' => 'images/municipios/escudo-libertador.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '51','nombre' => 'Lavalle','url' => 'http://www.corrientes.gov.ar/home/lavalle/municipio','logo' => 'images/municipios/lavalle.jpg','microrregion_id' => '4','indec_id' => '0203','indec_nombre' => 'Lavalle','departamento_id' => '091'),\n array('id' => '52','nombre' => 'Ramada Paso','url' => '','logo' => 'images/municipios/escudo-ramada-paso.png','microrregion_id' => '6','indec_id' => '0154','indec_nombre' => 'Ramada Paso','departamento_id' => '077'),\n array('id' => '53','nombre' => 'Riachuelo','url' => 'http://www.municipioriachuelo.gov.ar/','logo' => 'images/municipios/riachuelo.jpg','microrregion_id' => '1','indec_id' => '0028','indec_nombre' => 'Riachuelo','departamento_id' => '021'),\n array('id' => '54','nombre' => 'Saladas','url' => '','logo' => 'images/municipios/escudo-saladas.png','microrregion_id' => '5','indec_id' => '0308','indec_nombre' => 'Saladas','departamento_id' => '126'),\n array('id' => '55','nombre' => 'San Antonio de Apipe','url' => 'http://www.corrientes.gov.ar/home/san-antonio/municipio','logo' => 'images/municipios/san-antonio-de-apipe.png','microrregion_id' => '2','indec_id' => '0175','indec_nombre' => 'San Antonio','departamento_id' => '084'),\n array('id' => '56','nombre' => 'San Carlos','url' => '','logo' => 'images/municipios/escudo-san-carlos.png','microrregion_id' => '2','indec_id' => '0182','indec_nombre' => 'San Carlos','departamento_id' => '084'),\n array('id' => '58','nombre' => 'San Cosme','url' => 'https://www.corrientes.gov.ar/home/san-cosme/municipio','logo' => 'images/municipios/sancosme-escudo.gif','microrregion_id' => '6','indec_id' => '0329','indec_nombre' => 'San Cosme','departamento_id' => '133'),\n array('id' => '59','nombre' => 'San Lorenzo','url' => 'http://www.corrientes.gov.ar/home/san-lorenzo/municipio','logo' => 'images/municipios/sanlorenzo.png','microrregion_id' => '5','indec_id' => '0315','indec_nombre' => 'San Lorenzo','departamento_id' => '126'),\n array('id' => '60','nombre' => 'San Luis del Palmar','url' => '','logo' => 'images/municipios/sanluisdelpalmar.png','microrregion_id' => '6','indec_id' => '0350','indec_nombre' => 'San Luis del Palmar','departamento_id' => '140'),\n array('id' => '61','nombre' => 'San Miguel','url' => 'https://www.corrientes.gov.ar/home/san-miguel/municipio','logo' => 'images/municipios/San-Miguel.jpg','microrregion_id' => '5','indec_id' => '0392','indec_nombre' => 'San Miguel','departamento_id' => '154'),\n array('id' => '62','nombre' => 'San Roque','url' => 'http://www.sanroquemunicipio.gob.ar/','logo' => 'images/municipios/san-roque.jpg','microrregion_id' => '4','indec_id' => '0420','indec_nombre' => 'San Roque','departamento_id' => '161'),\n array('id' => '63','nombre' => 'Santa Ana de los Guacaras','url' => 'http://www.santaanadelosguacaras.com/','logo' => 'images/municipios/santa-ana-escudo.png','microrregion_id' => '6','indec_id' => '0336','indec_nombre' => 'Santa Ana','departamento_id' => '133'),\n array('id' => '64','nombre' => 'Santa Lucía','url' => '','logo' => 'images/municipios/santa_lucia.png','microrregion_id' => '4','indec_id' => '0210','indec_nombre' => 'Santa Lucía','departamento_id' => '091'),\n array('id' => '65','nombre' => 'Colonia Santa Rosa','url' => 'http://www.corrientes.gov.ar/home/colonia-santa-rosa/municipio','logo' => 'images/municipios/santa-rosa.jpg','microrregion_id' => '5','indec_id' => '0035','indec_nombre' => 'Santa Rosa','departamento_id' => '028'),\n array('id' => '66','nombre' => 'Santo Tome','url' => 'http://municipalidadstome.com.ar/','logo' => 'images/municipios/santo_tome.jpg','microrregion_id' => '2','indec_id' => '0448','indec_nombre' => 'Santo Tomé','departamento_id' => '168'),\n array('id' => '67','nombre' => 'Sauce','url' => 'http://www.corrientes.gov.ar/home/sauce/municipio','logo' => 'images/municipios/sauce.jpg','microrregion_id' => '3','indec_id' => '0455','indec_nombre' => 'Sauce','departamento_id' => '175'),\n array('id' => '68','nombre' => 'Tabay','url' => '','logo' => 'images/municipios/escudo-tabay.png','microrregion_id' => '5','indec_id' => '0049','indec_nombre' => 'Tabay','departamento_id' => '028'),\n array('id' => '69','nombre' => 'Tapebicuá','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0301','indec_nombre' => 'Tapebicuá','departamento_id' => '119'),\n array('id' => '70','nombre' => 'Tatacua','url' => 'https://www.corrientes.gov.ar/home/tatacua/municipio','logo' => 'images/municipios/tatacua.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '71','nombre' => 'Villa Olivari','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0186','indec_nombre' => 'Villa Olivari','departamento_id' => '084'),\n array('id' => '72','nombre' => 'Yapeyú','url' => 'https://www.corrientes.gov.ar/home/yapeyu/municipio','logo' => 'images/municipios/yapeyu.jpg','microrregion_id' => '2','indec_id' => '0378','indec_nombre' => 'Yapeyú','departamento_id' => '147'),\n array('id' => '73','nombre' => 'Yatayti Calle','url' => 'http://www.corrientes.gov.ar/home/yatayti-calle/municipio','logo' => 'images/municipios/yatayti_calle.jpg','microrregion_id' => '4','indec_id' => '0217','indec_nombre' => 'Yatayti Calle','departamento_id' => NULL),\n array('id' => '75','nombre' => 'El Sombrero','url' => 'http://elsombrero.corrientes.gob.ar/','logo' => 'images/municipios/sombrero.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'El Sombrero','departamento_id' => '042')\n);\n\n\n foreach ($municipios as $key => $value)\n {\n $m = new Municipio();\n $m->construct($value);\n }\n\n\n\n\n }", "public function index()\n {\n $municipalities = Municipality::orderBy('municipality_name','asc')->get();\n return view('admin.municipalities.index')->with([\n 'municipalities' => $municipalities\n ]);\n }", "public function listCategorias()\n\t{\n\t\t$em = $this->getEntityManager();\n\t\t\n\t\ttry{\n\t\t\t$dql = 'SELECT cat, sin FROM MbpPersonalBundle:Categorias cat JOIN cat.idSindicato sin\n\t\t\t\t\tWHERE cat.inactivo = 0';\n\t\t\t$query = $em->createQuery($dql);\n\t\t\t$res = $query->getArrayResult();\n\t\t\t\n\t\t\t$rec = array();\n\t\t\t$i=0;\n\t\t\tforeach($res as $reg){\n\t\t\t\t$rec[$i] = $reg;\n\t\t\t\t$rec[$i]['sindicato'] = $reg['idSindicato']['sindicato'];\n\t\t\t\t$rec[$i]['idCategoria'] = $reg['id'];\n\t\t\t\t$rec[$i]['idSindicato'] = $reg['idSindicato']['id'];\n\t\t\t\tunset($rec[$i]['id']);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$jsonRes = json_encode(array(\n\t\t\t\t'items' => $rec\n\t\t\t));\n\t\t\t\n\t\t\techo $jsonRes;\t\n\t\t}catch(\\Doctrine\\ORM\\ORMException $e){\n\t\t\t$this->get('logger')->error($e->getMessage());\n\t\t}\n\t\t\n\t}", "protected function operatingCountries()\n {\n return OperatingCountry::all();\n }", "public function getMunicipioEstado($estado){\n try{\n $consulta = $this->DB->query(\"select idMunicipios,Municipio from municipios, estado \n where LEFT(IdMunicipios, 2) = '$estado'\n group by municipios.idMunicipios\n order by municipios.Municipio\");\n while($registro = $consulta->fetch(PDO::FETCH_ASSOC)){\n $this->puntos[] = $registro;\n }\n\n $DB = null;\n return $this->puntos;\n }\n catch(Exception $e){\n echo \"linea de error\".$e->getLine().\"<br>\";\n echo \"excepcion\".$e->getMessage();\n }\n\n }", "public function getBitouCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '107'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function teste(){\n\t\t$client = new SoapClient(\"http://localhost:8080/ProdUNICAMPServices/services/Servicos?wsdl\");\n\t\t$result = $client->getListCategoria();\n\t\t$ret = array();\n\t\tforeach ($result->return as $a){\n\t\t\tif ($a->supercategoria == \"\"){\n\t\t\t\tarray_push($ret, $a->nome);\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function index(Request $request)\n {\n \n $municipalities=Municipality::filterAndPaginate($request);\n $regions=Region::orderBy('name','ASC')->pluck('name', 'id')->prepend('',''); \n return view('admin.municipality.index')->with('municipalities',$municipalities)->with('regions',$regions);\n }", "function SELECT_COUNT_alunosMunicipal (){\n $sql = 'SELECT COUNT(i.`tipo_instituicao`) AS `Escolas Municipais` FROM `visita` as v INNER JOIN `agendamento_institucional` as ai on v.`agendamento_institucional_ID` = ai.`ID` INNER JOIN `professor_instituicao` as pii on ai.`professor_instituicao_ID` = pii.`ID` INNER JOIN `instituicao` AS i ON pii.`instituicao_ID` = i.`ID` WHERE i.`tipo_instituicao`= \"Municipal\"';\n $stmt = $this->dataBase->query($sql);\n $row = $stmt->fetch_assoc();\n return $row; \n }", "public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }", "public function obterUnidadesCidMunicipio($cids, $atendimentoDomicilio, $municipio, $municipiosProximos, $tipologiaId = '') {\n $filtro = new BSFilter();\n $condicoes = array();\n $joins= array();\n\n\n if(!empty($cids) && count($cids) > 0 && !empty($cids[0])){\n $cids[] = 0;//garantia de mais de um elemento\n $joins[] = array(\n 'table' => 'unidade_atendimento_cid',\n 'alias' => 'UnidadeAtendimentoCid',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoCid.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n $condicoes['UnidadeAtendimentoCid.cid_id in'] = $cids;\n }\n $condicoes['Endereco.municipio_id'] = $municipio;\n\n if($atendimentoDomicilio == true){\n $condicoes['UnidadeAtendimento.atendimento_domicilio'] = true;\n }\n\n \n $filtro->setJoins($joins);\n $filtro->setTipo('all');\n $filtro->setCamposRetornadosString('id', 'nome');\n $filtro->setCamposOrdenados('UnidadeAtendimento.id');\n $filtro->setCondicoes($condicoes);\n\n\n $resultado = $this->listar($filtro);\n \n\n if($municipiosProximos == true){\n \n\n $joins2[] = array(\n 'table' => 'unidade_atendimento_cid',\n 'alias' => 'UnidadeAtendimentoCid',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoCid.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n\n $joins2[] = array(\n 'table' => 'unidade_atendimento_municipio',\n 'alias' => 'UnidadeAtendimentoMunicipio',\n 'type' => 'inner',\n 'conditions' => array('UnidadeAtendimentoMunicipio.unidade_atendimento_id = UnidadeAtendimento.id')\n );\n\n $filtro2 = new BSFilter();\n $condicoes2 = array(); \n\n // $condicoes2['UnidadeAtendimentoCid.cid_id'] = $cidId;\n if(isset($cids) && !empty($cids)){\n $condicoes2['UnidadeAtendimentoCid.cid_id in'] = $cids;\n }\n $condicoes2['UnidadeAtendimentoMunicipio.municipio_id'] = $municipio;\n $condicoes2['UnidadeAtendimento.atendimento_domicilio'] = true;\n $filtro2->setJoins($joins2);\n $filtro2->setTipo('all');\n $filtro2->setCamposRetornadosString('id', 'nome');\n $filtro2->setCamposOrdenados('UnidadeAtendimento.id');\n $filtro2->setCondicoes($condicoes2);\n $filtro2->setCamposAgrupados('UnidadeAtendimento.id');\n\n $resultado2 = $this->listar($filtro2);\n $resultado = array_merge($resultado, $resultado2);\n }\n\n $retorno = array();\n foreach ($resultado as $registro) {\n $retorno[$registro['UnidadeAtendimento']['id']] = $registro['UnidadeAtendimento']['nome'];\n }\n\n // return $this->listar($filtro);\n // pr($retorno);die;\n return $retorno;\n }", "public function getOudtshoornSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '102'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public static function getListado(){\n return Dispositivo::model()->findAll();\n }", "public function listar()\n {\n return $this->request('GET', 'unidadesmedida');\n }", "function cunsultas()\n {\n \t $data['categoria']=categoria::get();\n \t\t$data['unidad']=unidad::get();\n\n \t\treturn $data;\n }", "function getMunicipiosCuencaEstacionClimatologica($query)\n{\n $EstacionClimatologica = new EstacionClimatologica();\n echo json_encode($EstacionClimatologica->getMunicipiosCuenca($query));\n}", "public function getStellenboschCities($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT c.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM cities c\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON c.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '99'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$cities = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$city = new City();\n\t\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t\t$city->setMunicipality($municipality);\n\t\t\t\t\t\t$city->setCityCode($row['city_code']);\n\t\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t\t$city->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$city->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$city->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$cities[] = $city; // or array_push($cities, $city);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $cities;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getCountries();", "public function index()\n {\n #Trayendo los datos de bd\n $municipios = Municipio::all();\n return view('municipios.index') -> with('municipios', $municipios);\n }" ]
[ "0.7378004", "0.7024294", "0.6721125", "0.6482744", "0.6448985", "0.64091337", "0.6386243", "0.63768035", "0.6228357", "0.61784434", "0.6177079", "0.61615837", "0.60742235", "0.5915569", "0.5898404", "0.5894277", "0.58845884", "0.5868372", "0.58510417", "0.583896", "0.5828839", "0.5819447", "0.57827824", "0.5781377", "0.5778166", "0.57689077", "0.5761935", "0.5754962", "0.5746338", "0.5746158" ]
0.7075843
1
Condition method to turn output into JSON. This condition sets a before and an after filter for the request and response. The before filter decodes the request body if the request content type is JSON, while the after filter encodes the response body into JSON.
protected function json(){ $this->before(function ($request) { if ($request->contentType == "application/json; charset=utf-8") { $request->data = json_decode($request->data); } }); $this->after(function ($response) { $response->contentType = "application/json; charset=utf-8"; if (isset($_GET['jsonp'])) { $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');'; } else { $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function afterFilter() {\n \t\n\t\treturn Response::json(array(\n 'status' => 'success',\n\t\t\t'statusCode' => '200',\n 'result' => $rest_result),\n 200\n\t\t\t\t);\n\t \n\t}", "private function json() {\n if( $this->format === 'application/hal+json' ) {\n header('Content-Type: application/hal+json; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\JsonWriter(true);\n return $writer->execute($hal_response);\n } else {\n header('Content-Type: application/json; charset=utf-8', TRUE, $this->status);\n return json_encode($this->content, JSON_NUMERIC_CHECK);\n }\n }", "public function onResponse(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n\n $request = $event->getRequest();\n $response = $event->getResponse();\n $content = $response->getContent();\n\n // convert content to content container\n if (!$content instanceof ResponseContainer) {\n $content = ResponseContainer::createAutoDetect($response);\n }\n\n // override http status code if needed\n $statusCode = $content->getStatusCode();\n if (!empty($statusCode)) {\n $response->setStatusCode($content->getStatusCode());\n }\n\n // set 204 header for empty content\n if ($content->isEmpty() && !$response->isRedirect()) {\n $response->setStatusCode(Response::HTTP_NO_CONTENT);\n $content->setStatusCode(Response::HTTP_NO_CONTENT);\n }\n\n // put statusCode in response and force 200 OK in header?\n if ($request->headers->has('X-Force-Status-Code-200')\n || ($request->getRequestFormat() == self::FORMAT_JSON && $request->query->has('callback'))\n ) {\n $content->setReturnStatusCode(true);\n $response->setStatusCode(Response::HTTP_OK);\n $response->headers->set('X-Status-Code', Response::HTTP_OK);\n }\n\n // serialize content container\n try {\n $context = new SerializationContext();\n $context->setSerializeNull(true);\n $format = $event->getRequest()->getRequestFormat();\n $contentSerialized = $this->serializer->serialize($content->toArray(), $format, $context);\n switch ($format) {\n case self::FORMAT_XML:\n $response->setContent($contentSerialized);\n break;\n default:\n $headers = $response->headers;\n $response = new JsonResponse(null, $response->getStatusCode());\n $response->headers = $headers;\n $response->setContent($contentSerialized);\n break;\n }\n } catch (\\Exception $e) {\n $response = new JsonResponse([\n 'error' => [\n 'code' => 'error.api.middleware',\n 'message' => $e->getMessage()\n ]\n ]);\n }\n\n // force empty output on a no-content response\n if ($content->isEmpty() && $response->isEmpty()) {\n $response->setContent('');\n }\n\n $event->setResponse($response);\n }", "private function _createJson()\n {\n return new SlimBootstrap\\ResponseOutputWriter\\Json(\n $this->_request,\n $this->_response,\n $this->_headers,\n $this->_shortName\n );\n }", "public function getFormattedResponse($before='', $after=''){\n\n if( $this->rawResponse )\n $formatted = @json_encode( @json_decode($this->rawResponse), JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES );\n else\n $formatted = '{}';\n\n return ($before . $formatted . $after );\n\n }", "public function beforeFilter(Event $event)\n {\n $result = parent::beforeFilter($event);\n if ($result instanceof ResponseInterface) {\n return $result;\n }\n }", "public function wantsJson(){\n return true;\n }", "public function filter($request, $response);", "public function onResponseLate(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n $request = $event->getRequest();\n $response = $event->getResponse();\n if ($request->getRequestFormat() === self::FORMAT_JSON\n && $request->query->has('callback')\n && $response instanceof JsonResponse\n ) {\n switch ($request->query->get('_wrapper')) {\n case self::WRAPPER_POST_MESSAGE:\n $response->setContent(\n $this->twig->render(\n 'MediaMonksRestApiBundle::post_message.html.twig',\n [\n 'request' => $request,\n 'response' => $response,\n 'callback' => $request->query->get('callback'),\n 'origin' => $this->getOrigin()\n ]\n )\n )->headers->set('Content-Type', 'text/html');\n break;\n default:\n $response->setCallback($request->query->get('callback'));\n break;\n }\n }\n }", "function handleRequest($request, &$response){ \n switch($request->getHeader($HEADER_CONTENT_TYPE)){\n case $CONTENT_TYPE_JSON:\n if(json_decode($request)!=null){ // basic JSON validation\n $response->getBody()->write($SAMPLE_RESPONSE_JSON);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_JSON);\n $response->withStatus(200, $STATUS_REASON_200);\n }else\n $response->withStatus(400, $STATUS_REASON_400);\n break;\n case $CONTENT_TYPE_HTML:\n $response->getBody()->write($SAMPLE_RESPONSE_HTML);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_HTML);\n $response->withStatus(200, $STATUS_REASON_200);\n break;\n // other content types can be added as needed\n default:\n $response->withStatus(400, $STATUS_REASON_400);\n }\n}", "public function isJson(){\n\t\t\n\t\treturn $this['request']['json'];\n\t\t\n\t}", "public function isJson()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/json');\n\t}", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "public function isJSON()\n {\n return isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json';\n }", "public function onKernelResponse(FilterResponseEvent $event)\n {\n if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {\n return;\n }\n\n $response = $event->getResponse();\n $request = $event->getRequest();\n\n // do not capture redirects or modify XML HTTP Requests\n if ($request->isXmlHttpRequest()) {\n return;\n }\n\n if (!$this->enabled\n || !$response->headers->has('X-Debug-Token')\n || $response->isRedirection()\n || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))\n || 'html' !== $request->getRequestFormat()\n ) {\n return;\n }\n\n $this->injectScript($response);\n }", "private function isApplicationJson(): bool\n\t{\n\t\tif (is_null($this->isJson)) {\n\t\t\t$contentType = $this->getDI()->getShared('request')->getHeader('CONTENT_TYPE');\n\n\t\t\t$this->isJson = ($contentType && explode(';', $contentType)[0] === 'application/json');\n\t\t}\n\n\t\treturn $this->isJson;\n\t}", "function add_json_filter()\n{\n add_filter( 'json_prepare_post', 'apply_json_filter', 10, 3 );\n}", "public function isJSON()\n\t{\n\t\treturn $this->hasHeader('Content-Type')\n\t\t\t&& $this->header('Content-Type')->getValue() === 'application/json';\n\t}", "public function toResponse($request): JsonResponse\n {\n return tap(response()->json(\n $this->resource->resolve($request),\n $this->calculateStatus()\n ), function ($response) use ($request) {\n $response->original = $this->resource->resource;\n\n $this->resource->withResponse($request, $response);\n });\n }", "public function json()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: application/json');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // if cli add time\n if ($cli = Utility::isCli()) {\n echo \"[\". date('Y-m-d H:i:s') . \"] \";\n }\n // set varibales data\n if ($cli && version_compare(phpversion(), '5.4.0') > 0) {\n $results = json_encode($this->vars, JSON_PRETTY_PRINT);\n } else {\n $results = json_encode($this->vars);\n }\n // send\n echo $results;\n // if cli add \\n\n if ($cli) {\n echo \"\\n\";\n }\n }\n }", "public function getFilterResponse();", "public function isJson()\n {\n return $this->request->isJson() || ($this->request->header('CONTENT_TYPE') === 'application/vnd.api+json');\n }", "function beforeFilterHandler($request, stdClass $context) {\n $self = $this;\n try {\n $afterFilterHandler = $this->afterFilterHandler;\n $response = $afterFilterHandler($this->inputFilter($request, $context), $context)\n ->then(null, function($error) use ($self, $context) {\n return $self->delayError($error, $context);\n });\n }\n catch (Exception $error) {\n $response = $this->delayError($error, $context);\n }\n return $response->then(function($value) use ($self, $context) {\n return $self->outputFilter($value, $context);\n });\n }", "private function expectsJson()\r\n {\r\n $request = \\Yii::$app->request;\r\n return !$request->getIsPjax() && (in_array('application/json', explode(',', $request->headers->get('accept'))));\r\n }", "protected function _getJSONEncodedResponse()\n {\n if (function_exists('__json_encode'))\n {\n return json_encode($this->_Response);\n }\n else\n {\n return $this->_prepareJSONToEval($this->_jsonEncode($this->_Response));\n }\n\n }", "public function prepareResponse();", "private function wantsJson(Request $request): bool\n {\n $acceptable = $request->getAcceptableContentTypes();\n\n return isset($acceptable[0]) && $this->stringHelper->contains($acceptable[0], ['/json', '+json']);\n }", "public function after()\n\t{\n\t\t// Set headers to not cache anything\n\t\t$this->response->headers('cache-control', 'no-cache, no-store, max-age=0, must-revalidate');\n\n\t\t// Set the content-type header\n\t\t$this->response->headers('content-type', 'application/json');\n\n\t\t// Set and encode the body data\n\t\t$this->response->body(json_encode($this->body));\n\t}", "function json_response() {\n return app(JsonResponse::class);\n }", "protected function responseIsJson() : bool\n {\n $type = json_encode($this->responseHeaders->get('Content-Type'));\n\n return Str::contains($type, 'json');\n }" ]
[ "0.6116133", "0.6049016", "0.56869304", "0.54177105", "0.54147065", "0.53644615", "0.5338232", "0.53232694", "0.53001356", "0.52962744", "0.5165756", "0.5162192", "0.5134927", "0.512463", "0.511019", "0.5095197", "0.5084023", "0.5063892", "0.50604165", "0.5038454", "0.5026544", "0.5021297", "0.5016091", "0.5003198", "0.4966498", "0.4930623", "0.4929609", "0.4921996", "0.49178466", "0.49174643" ]
0.6370126
0
Condition method to turn output into JSON. This condition sets a before and an after filter for the request and response. The before filter decodes the request body if the request content type is JSON, while the after filter encodes the response body into JSON.
protected function json(){ $this->before(function ($request) { if ($request->contentType == "application/json; charset=utf-8") { $request->data = json_decode($request->data); } }); $this->after(function ($response) { $response->contentType = "application/json; charset=utf-8"; if (isset($_GET['jsonp'])) { $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');'; } else { $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function afterFilter() {\n \t\n\t\treturn Response::json(array(\n 'status' => 'success',\n\t\t\t'statusCode' => '200',\n 'result' => $rest_result),\n 200\n\t\t\t\t);\n\t \n\t}", "private function json() {\n if( $this->format === 'application/hal+json' ) {\n header('Content-Type: application/hal+json; charset=utf-8', TRUE, $this->status);\n $hal_response = (new Resource())\n ->setURI(\"/{$this->resource}\". (isset($this->filters['id']) ? $this->filters['id'] : ''))\n ->setLink($this->resource, new Link(\"/{$this->resource}\"))\n ->setData($this->content);\n\n $writer = new Hal\\JsonWriter(true);\n return $writer->execute($hal_response);\n } else {\n header('Content-Type: application/json; charset=utf-8', TRUE, $this->status);\n return json_encode($this->content, JSON_NUMERIC_CHECK);\n }\n }", "public function onResponse(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n\n $request = $event->getRequest();\n $response = $event->getResponse();\n $content = $response->getContent();\n\n // convert content to content container\n if (!$content instanceof ResponseContainer) {\n $content = ResponseContainer::createAutoDetect($response);\n }\n\n // override http status code if needed\n $statusCode = $content->getStatusCode();\n if (!empty($statusCode)) {\n $response->setStatusCode($content->getStatusCode());\n }\n\n // set 204 header for empty content\n if ($content->isEmpty() && !$response->isRedirect()) {\n $response->setStatusCode(Response::HTTP_NO_CONTENT);\n $content->setStatusCode(Response::HTTP_NO_CONTENT);\n }\n\n // put statusCode in response and force 200 OK in header?\n if ($request->headers->has('X-Force-Status-Code-200')\n || ($request->getRequestFormat() == self::FORMAT_JSON && $request->query->has('callback'))\n ) {\n $content->setReturnStatusCode(true);\n $response->setStatusCode(Response::HTTP_OK);\n $response->headers->set('X-Status-Code', Response::HTTP_OK);\n }\n\n // serialize content container\n try {\n $context = new SerializationContext();\n $context->setSerializeNull(true);\n $format = $event->getRequest()->getRequestFormat();\n $contentSerialized = $this->serializer->serialize($content->toArray(), $format, $context);\n switch ($format) {\n case self::FORMAT_XML:\n $response->setContent($contentSerialized);\n break;\n default:\n $headers = $response->headers;\n $response = new JsonResponse(null, $response->getStatusCode());\n $response->headers = $headers;\n $response->setContent($contentSerialized);\n break;\n }\n } catch (\\Exception $e) {\n $response = new JsonResponse([\n 'error' => [\n 'code' => 'error.api.middleware',\n 'message' => $e->getMessage()\n ]\n ]);\n }\n\n // force empty output on a no-content response\n if ($content->isEmpty() && $response->isEmpty()) {\n $response->setContent('');\n }\n\n $event->setResponse($response);\n }", "private function _createJson()\n {\n return new SlimBootstrap\\ResponseOutputWriter\\Json(\n $this->_request,\n $this->_response,\n $this->_headers,\n $this->_shortName\n );\n }", "public function getFormattedResponse($before='', $after=''){\n\n if( $this->rawResponse )\n $formatted = @json_encode( @json_decode($this->rawResponse), JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES );\n else\n $formatted = '{}';\n\n return ($before . $formatted . $after );\n\n }", "public function beforeFilter(Event $event)\n {\n $result = parent::beforeFilter($event);\n if ($result instanceof ResponseInterface) {\n return $result;\n }\n }", "public function wantsJson(){\n return true;\n }", "public function filter($request, $response);", "public function onResponseLate(FilterResponseEvent $event)\n {\n if (!$this->isActive($event)) {\n return;\n }\n $request = $event->getRequest();\n $response = $event->getResponse();\n if ($request->getRequestFormat() === self::FORMAT_JSON\n && $request->query->has('callback')\n && $response instanceof JsonResponse\n ) {\n switch ($request->query->get('_wrapper')) {\n case self::WRAPPER_POST_MESSAGE:\n $response->setContent(\n $this->twig->render(\n 'MediaMonksRestApiBundle::post_message.html.twig',\n [\n 'request' => $request,\n 'response' => $response,\n 'callback' => $request->query->get('callback'),\n 'origin' => $this->getOrigin()\n ]\n )\n )->headers->set('Content-Type', 'text/html');\n break;\n default:\n $response->setCallback($request->query->get('callback'));\n break;\n }\n }\n }", "function handleRequest($request, &$response){ \n switch($request->getHeader($HEADER_CONTENT_TYPE)){\n case $CONTENT_TYPE_JSON:\n if(json_decode($request)!=null){ // basic JSON validation\n $response->getBody()->write($SAMPLE_RESPONSE_JSON);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_JSON);\n $response->withStatus(200, $STATUS_REASON_200);\n }else\n $response->withStatus(400, $STATUS_REASON_400);\n break;\n case $CONTENT_TYPE_HTML:\n $response->getBody()->write($SAMPLE_RESPONSE_HTML);\n $response->withHeader($HEADER_CONTENT_TYPE, $CONTENT_TYPE_HTML);\n $response->withStatus(200, $STATUS_REASON_200);\n break;\n // other content types can be added as needed\n default:\n $response->withStatus(400, $STATUS_REASON_400);\n }\n}", "public function isJson(){\n\t\t\n\t\treturn $this['request']['json'];\n\t\t\n\t}", "public function isJson()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/json');\n\t}", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "public function isJSON()\n {\n return isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/json';\n }", "public function onKernelResponse(FilterResponseEvent $event)\n {\n if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {\n return;\n }\n\n $response = $event->getResponse();\n $request = $event->getRequest();\n\n // do not capture redirects or modify XML HTTP Requests\n if ($request->isXmlHttpRequest()) {\n return;\n }\n\n if (!$this->enabled\n || !$response->headers->has('X-Debug-Token')\n || $response->isRedirection()\n || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))\n || 'html' !== $request->getRequestFormat()\n ) {\n return;\n }\n\n $this->injectScript($response);\n }", "private function isApplicationJson(): bool\n\t{\n\t\tif (is_null($this->isJson)) {\n\t\t\t$contentType = $this->getDI()->getShared('request')->getHeader('CONTENT_TYPE');\n\n\t\t\t$this->isJson = ($contentType && explode(';', $contentType)[0] === 'application/json');\n\t\t}\n\n\t\treturn $this->isJson;\n\t}", "function add_json_filter()\n{\n add_filter( 'json_prepare_post', 'apply_json_filter', 10, 3 );\n}", "public function isJSON()\n\t{\n\t\treturn $this->hasHeader('Content-Type')\n\t\t\t&& $this->header('Content-Type')->getValue() === 'application/json';\n\t}", "public function toResponse($request): JsonResponse\n {\n return tap(response()->json(\n $this->resource->resolve($request),\n $this->calculateStatus()\n ), function ($response) use ($request) {\n $response->original = $this->resource->resource;\n\n $this->resource->withResponse($request, $response);\n });\n }", "public function json()\n {\n // if dirty data exists\n $this->swallow();\n // if redirecting\n if ($this->redirect) {\n /*header(\"Location: {$this->redirect}\");\n // more headers\n foreach ( $this->headers as $header ) {\n header($header);\n }*/\n $this->redirect($this->redirect, array(), false);\n } else {\n // header json data\n header('Content-Type: application/json');\n // more headers\n foreach ($this->headers as $header) {\n header($header);\n }\n //过滤$CFG\n if (!empty($this->vars['CFG'])) {\n unset($this->vars['CFG']);\n }\n // if cli add time\n if ($cli = Utility::isCli()) {\n echo \"[\". date('Y-m-d H:i:s') . \"] \";\n }\n // set varibales data\n if ($cli && version_compare(phpversion(), '5.4.0') > 0) {\n $results = json_encode($this->vars, JSON_PRETTY_PRINT);\n } else {\n $results = json_encode($this->vars);\n }\n // send\n echo $results;\n // if cli add \\n\n if ($cli) {\n echo \"\\n\";\n }\n }\n }", "public function getFilterResponse();", "public function isJson()\n {\n return $this->request->isJson() || ($this->request->header('CONTENT_TYPE') === 'application/vnd.api+json');\n }", "function beforeFilterHandler($request, stdClass $context) {\n $self = $this;\n try {\n $afterFilterHandler = $this->afterFilterHandler;\n $response = $afterFilterHandler($this->inputFilter($request, $context), $context)\n ->then(null, function($error) use ($self, $context) {\n return $self->delayError($error, $context);\n });\n }\n catch (Exception $error) {\n $response = $this->delayError($error, $context);\n }\n return $response->then(function($value) use ($self, $context) {\n return $self->outputFilter($value, $context);\n });\n }", "private function expectsJson()\r\n {\r\n $request = \\Yii::$app->request;\r\n return !$request->getIsPjax() && (in_array('application/json', explode(',', $request->headers->get('accept'))));\r\n }", "protected function _getJSONEncodedResponse()\n {\n if (function_exists('__json_encode'))\n {\n return json_encode($this->_Response);\n }\n else\n {\n return $this->_prepareJSONToEval($this->_jsonEncode($this->_Response));\n }\n\n }", "private function wantsJson(Request $request): bool\n {\n $acceptable = $request->getAcceptableContentTypes();\n\n return isset($acceptable[0]) && $this->stringHelper->contains($acceptable[0], ['/json', '+json']);\n }", "public function prepareResponse();", "public function after()\n\t{\n\t\t// Set headers to not cache anything\n\t\t$this->response->headers('cache-control', 'no-cache, no-store, max-age=0, must-revalidate');\n\n\t\t// Set the content-type header\n\t\t$this->response->headers('content-type', 'application/json');\n\n\t\t// Set and encode the body data\n\t\t$this->response->body(json_encode($this->body));\n\t}", "protected function responseIsJson() : bool\n {\n $type = json_encode($this->responseHeaders->get('Content-Type'));\n\n return Str::contains($type, 'json');\n }", "function json_response() {\n return app(JsonResponse::class);\n }" ]
[ "0.61155456", "0.60492903", "0.5686187", "0.5417137", "0.54134905", "0.5364112", "0.5338936", "0.53225195", "0.52989024", "0.5295661", "0.5166813", "0.5163791", "0.5133972", "0.5126113", "0.5109468", "0.50963867", "0.50846684", "0.50657225", "0.5060272", "0.50382364", "0.5026707", "0.50227505", "0.50152487", "0.500393", "0.49656072", "0.49313453", "0.49289623", "0.49207833", "0.49185953", "0.4917965" ]
0.63693625
1
Get response update User success.
protected function responseUpdateSuccess($user) { $this->response = MessageUtility::getResponse( trans('api.CODE_INPUT_SUCCESS'), trans('api.DESCRIPTION_UPDATE_SUCCESS'), trans('api.MSG_UPDATE_SUCCESS',['attribute' => 'User', 'id' => $user->id]), $user->toArray() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function updateUser(){\n \n $name = htmlspecialchars($_POST['name']);\n $surname = htmlspecialchars($_POST['surname']);\n $phone = htmlspecialchars($_POST['phone']);\n $address = htmlspecialchars($_POST['address']);\n $jmbg = htmlspecialchars($_POST['jmbg']);\n $email = htmlspecialchars($_POST['email']);\n $username = htmlspecialchars($_POST['username']);\n \n $response = array(\n 'code' => 1,\n 'msg' => \"\",\n 'user' => NULL\n );\n \n $user = array(\n 'name' => $name,\n 'surname' => $surname,\n 'phone' => $phone,\n 'address' => $address,\n 'jmbg' => $jmbg,\n 'email'=> $email,\n 'username' => $username\n );\n \n if (!validateUpdateUserEmpty($user)){\n $response['code'] = 0;\n $response['msg'] = \"Sva polja moraju biti popunjena!\";\n }\n \n else if (!validateUpdateUsername($user, $this->modelUser, $this->curUser) ){\n $response['code'] = 0;\n $response['msg'] = \"Zauzeto korisnicko ime!\";\n }\n else {\n $this->modelUser->updateUser($this->curUser->idUser, $name, $surname, $address,\n $phone, $jmbg, $email, $username);\n $this->curUser = $this->modelUser->getUserById($this->curUser->idUser);\n $response['user']= $this->curUser; \n }\n \n header(\"Content-Type: application/json\");\n echo json_encode($response);\n \n }", "function updateUser()\r\n {\r\n return $this->UD->user_update($_GET['uid']);\r\n }", "public function updateUser()\n {\n $data = $_POST;\n if (isNull($data['id'])) {\n return false;\n }\n $id = $data['id'];\n $user = array(\"email\"=>$data['email'],\n \"first_name\"=>$data['firstName'],\n \"last_name\"=>$data['lastName']);\n if ($data['password'] != '')\n {\n $user[\"password\"] = password_hash($data['password'],PASSWORD_BCRYPT);\n }\n $updatedUser = $this->usersController->updateUser($id,$user);\n echo json_encode($updatedUser);\n if ($updatedUser)\n {\n return true;\n } else\n {\n return false;\n }\n }", "function updateUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"PUT\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t\texit;\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['user_name']) && isset($_POST['password']) && isset($_POST['_id'])){\n\t\t\t\t\t$user_id = $_POST['_id'];\n\t\t\t\t\t$array['user_name'] = $_POST['user_name'];\n\t\t\t\t\t$array['password'] = $_POST['password'];\n\t\t\t\t\t$result = $this->model->setUser($array, \"_id='\".$user_id.\"'\");\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 updated.';\n\t\t\t\t\t\t$update = $this->model->getUser('*',\"_id = \".\"'\".$user_id.\"'\");\n\t\t\t\t\t\t$response_array['data']=$update;\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']='no record updated';\n\t\t\t\t\t\t$response_array['data']='';\n\t\t\t\t\t\t$this->rest->response($response_array, 304);\n\t\t\t\t\t}\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\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\t\n\t\t\t}\n\t\t\t\n\n\t\t}", "public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }", "public function userupdatesuccessAction()\n {\n }", "public function updateSuccess();", "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 update()\n {\n $updateUser = new UpdateUser($this->_user->getID(), $this->_user->account);\n if (CSRF::validate() && $updateUser->execute()) {\n return new RedirectResponse('/account/bewerken');\n }\n\n return $this->edit();\n }", "public function postUserupdate(){\n \n $uid = Input::get('user_id');\n $user = User::find($uid);\n if($user != ''){\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->category = Input::get('category');\n $user->language = Input::get('language');\n $user->enable = Input::get('enable');\n $user->save();\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'User data updated!');\n }else{\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'No such user!');\n }\n\n }", "public function updateAction()\n {\n $result = [\n 'type' => 'error',\n 'message' => 'Missing parameters, this functionality expects a POST array called `user` with `id`, `given_name`, and `family_name` keys!'\n ];\n\n if ($this->request->hasPost('user')) {\n $formData = $this->request->getPost('user');\n $userService = new UserService(new Users());\n // validating the data\n if ($userService->validateData($formData, ['id', 'given_name', 'family_name'])) {\n $userService->updateUser($formData);\n }\n }\n return $this->response->setJsonContent($result);\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 }", "public function verify_user_post()\n {\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n $id = $data['id'];\n $status = $data['status'];\n $data = array(\n 'is_verified' => $status\n );\n $where = array(\n 'id' => $id\n );\n $this->model->update('users', $data, $where);\n \n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }", "public function testUpdateUser()\n {\n }", "public function updateUser() {\n //validations\n if ($this->updateUserValidator()->fails()) {\n return redirect()->back()\n ->withErrors($this->updateUserValidator())\n ->withInput();\n }\n\n //update logic\n $updateArray = [\n \"first_name\" => $this->request->input(\"first_name\"),\n \"last_name\" => $this->request->input(\"last_name\"),\n \"username\" => $this->request->input(\"username\"),\n \"email\" => $this->request->input(\"email\"),\n \"address\" => $this->request->input(\"address\"),\n \"country\" => $this->request->input(\"country\"),\n \"pincode\" => $this->request->input(\"pincode\"),\n \"mobileno\" => $this->request->input(\"mobileno\"),\n \"updated_by\" => $this->request->session()->get('user_id'),\n ];\n\n\n if (strlen($this->request->input(\"password\")) > 0) {\n $updateArray[\"password\"] = Hash::make($this->request->input(\"password\"));\n }\n\n\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function update(User $user){\n $user->update($this->_cleaned);\n return $this->respond($user);\n }", "function updateProfile(){\n\t\t\t\t$this->__dataDecode();\n\t\t\t\t//pr($this->data);die;\n\t\t\t\t\n\t\t\t\tif(!empty($this->data)){\n\t\t\t\t\t$data['User']['firstname'] = $this->data['User']['firstName'];\n\t\t\t\t\t$data['User']['wieght'] = $this->data['User']['wieght'];\n\t\t\t\t\t$data['User']['school'] = $this->data['User']['school'];\n\t\t\t\t\t$data['User']['id'] = $this->data['User']['playerId'];\n\t\t\t\t\t$data['User']['secToken'] = $this->data['User']['secToken'];\n\t\t\t$details = $this->User->find('first', array('conditions' => array('User.id' => $data['User']['id'],'User.secToken' => $data['User']['secToken'])));//pr($details);die;\n\t\t\t\tif(!empty($details)){\n\t\t\t\t\t\tif($this->User->save($data)){\n\t\t\t\t\t\t\t$response['error']\t\t\t= 0;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'success';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'Profile does not updated successfully.';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\telse\n{\n\t\t\t\t\t\t\t$response['error']\t\t\t= 1;\n\t\t\t\t\t\t\t$response['response']['result'] \t= 'failure';\n\t\t\t\t\t\t\t$response['response']['message']\t= 'UnAuthorized User';\n\t\t\t\t\t\t\t$this->set('response', $response);\n\t\t\t\t\t\t\techo json_encode($response);\n\t\t\t\t\t\t\tdie();\n}\n}\n\t\t\t}", "function update($conn)\n{\n $response[\"loggedIn\"] = getSessionValue(\"user\", \"\") != \"\";\n if (!$response[\"loggedIn\"])\n {\n $response[\"error\"] = \"You must login to edit your user account.\";\n return $response;\n } \n \n // get the logged in user...\n $userID = getSessionValue(\"user\", \"\")[\"userID\"];\n \n // validate input values...\n $userName = getValue(\"userName\", \"\");\n if ($userName == \"\")\n {\n $response[\"error\"] = \"Username is required.\";\n return $response;\n }\n $userFullName = getValue(\"userFullName\", \"\");\n if ($userFullName == \"\")\n {\n $response[\"error\"] = \"User's full name is required.\";\n return $response;\n }\n $userPass = getValue(\"userPass\", \"\");\n if (strlen($userPass) < 8 || strlen($userPass) > 20)\n {\n $response[\"error\"] = \"Password is required and must be at least 8 and no more than 20 characters.\";\n return $response;\n }\n \n // make sure the user exists...\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 // hash the password...\n $userPass = password_hash($userPass, PASSWORD_DEFAULT);\n\n // update the user...\n $stmt = $conn->prepare(\"UPDATE USER SET USER_NAME = ?, USER_FULLNAME = ?, USER_PASSWORD = ? WHERE USER_ID = ?\");\n $stmt->bind_param(\"sssi\", $userName, $userFullName, $userPass, $userID);\n $stmt->execute();\n\n // return response...\n $user[\"userID\"] = $userID;\n $user[\"userName\"] = $userName;\n $user[\"userFullName\"] = $userFullName;\n setSessionValue(\"user\", $user);\n $response[\"user\"] = $user;\n\n return $response;\n}", "function UpdateUser() {\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_TYPE] = $this->reseller->getUserType();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USERNAME] = $this->reseller->getUserLoginName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EMAIL_ID] = $this->reseller->getEmailId();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CONTACT_NO] = $this->reseller->getMobileNo();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_FULL_NAME] = $this->reseller->getFullName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ADDRESS] = $this->reseller->getAddress();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_CITY] = $this->reseller->getCity();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_REGION] = $this->reseller->getRegion();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_COUNTRY] = $this->reseller->getCountry();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DOMAIN_NAME] = $this->reseller->getDomainName();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_EXPIRY_DATE] = $this->reseller->getExpiryDate();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_ENABLE_CMS] = $this->reseller->getEnableCMS();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_USER_STATUS] = $this->reseller->getUserStatus();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_NEWPASSWORD] = $this->reseller->getNewPassword();\n\t\t\t$this->data[sgc_reseller_user_api_params::API_RESELLER_USER_PARAM_DLT_ENTITY_ID] = $this->reseller->getDltEntityId();\n $response = new sgc_callapi(sgc_constant::SGC_API, sgc_constant::SGC_ENDPOINT_RESELLER_UPDATE_USER, $this->data, $this->header, sgc_common_api_params::API_COMMON_METHOD_POST, $this->useRestApi);\n\t\t\treturn $response->getResponse();\n\t\t}", "public function updateUser_put()\n\t{\n\t\t$data = [\n\t\t\t\"id\"=>$this->put('id'),\n\t\t\t\"nama\"=>$this->put('nama',true),\n\t\t\t\"alamat\"=>$this->put('alamat',true),\n\t\t\t\"telp\"=>$this->put('telp',true),\n\t\t\t\"username\"=>$this->put('username',true)\n\t\t];\n\t\t$id = $this->put('id');\n\n\t\tif ($this->User->updateUser($data,$id)>0) {\n\t\t\t$this->response([\n\t\t\t\t'error'=>false,\n\t\t\t\t'message'=>'User berhasil diupdate',\n\t\t\t\t'user'=>$data\n\t\t\t],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'=>'User gagal diupdate'\n\t\t\t],200);\n\t\t}\n\t}", "public function update_account()\n\t{\n\t\t$data = $this->input->post();\n\t\t\n\t\t$success = $this->user_model->safe_update($this->user->id, $data);\n\t\t\n\t\tif ( $success )\n\t\t{\n\t\t\t$this->json['message'] = 'Your account details have been successfully updated.';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->json['status'] = 'error';\n\t\t\t$this->json['message'] = 'There were errors when attempting update your account.';\n\t\t}\n\t\t\n\t\t$this->json['content'] = $this->update_account_content();\n\t\t\n\t\treturn $this->ajax_response();\n\t}", "public function actionUpdateStatus()\n { \n $user_id = Yii::$app->user->identity->id;\n $model = Users::find()->where(['id'=>$user_id])->one();\n $model->step_validate = 2;\n $model->load(Yii::$app->getRequest()->getBodyParams(), '');\n if ($model->validate()) {\n $model->save();\n $response = \\Yii::$app->getResponse();\n $response->setStatusCode(202);\n return $model->getUsersStatusValues();\n }\n else {\n throw new HttpException(422, json_encode($model->errors, JSON_UNESCAPED_UNICODE));\n }\n }", "function updateUser() {\n\t\t$rating = $this -> getTaskRating();\n\t\t$sql = \"Update Users set finishedBasic=1, userRating=userRating+\" . $rating . \" where UID= (Select t.UID from Task t WHERE t.TaskId=\" . $this -> data[0]['TaskId'] . \")\";\n\t\t$stmt = $this -> DB -> prepare($sql);\n\t\tif ($stmt -> execute()) {\n\t\t\t$this -> checkforLast();\n\t\t} else {\n\t\t\tinclude_once \"Email.php\";\n\t\t\tnew Email('failed', 'to update user with TaskId=' . $this -> data[0]['TaskId'], $this -> id);\n\t\t}\n\t}", "public function voxy_update_user_info()\n {\n $data = $this->input->post();\n\n if(!(isset($data['external_user_id']) && $data['external_user_id'])){\n $this->ajax_data_return['msg'] = 'ID người dùng không hợp lệ !';\n return $this->ajax_response();\n }\n if(isset($data['expiration_date']) && $data['expiration_date'] != ''){\n $data['expiration_date'] = strtotime($data['expiration_date']);\n }\n if(isset($data['date_of_next_vpa']) && $data['date_of_next_vpa'] != ''){\n $data['date_of_next_vpa'] = strtotime($data['date_of_next_vpa']);\n }\n if(isset($data['can_reserve_group_sessions']) && $data['can_reserve_group_sessions'] != ''){\n $data['can_reserve_group_sessions'] = strtolower($data['can_reserve_group_sessions']);\n }\n\n if(isset($data['feature_group']) && $data['feature_group'] != ''){\n $api_data = $this->m_voxy_connect->add_user_to_feature_group($data['external_user_id'], $data['feature_group']);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n return $this->ajax_response();\n }\n }\n\n $api_data = $this->m_voxy_connect->update_profile_of_one_user($data['external_user_id'], $data);\n if($api_data && isset($api_data['error_message'])) {\n $this->ajax_data_return['msg'] = $api_data['error_message'];\n } else {\n $this->ajax_data_return['status'] = TRUE;\n $this->ajax_data_return['msg'] = 'Cập nhật thông tin người dùng thành công !';\n $this->ajax_data_return['data'] = $api_data;\n }\n\n return $this->ajax_response();\n }", "public function updateProfile() {\n\t\t\n\t\treturn $this->_post(self::URL_USERS_UPDATE_PROFILE, $this->_query);\n\t}", "public function updateUser(Request $request, Response $response){\n\n $id = $request->getAttribute('id');\n\n $nombre = $request->getParam('nombre');\n $telefono = $request->getParam('telefono');\n $direccion = $request->getParam('direccion');\n $email = $request->getParam('email');\n $username = $request->getParam('username');\n $pass = $request->getParam('pass');\n\n $sql = \"UPDATE usuarios SET \n nombre = :nombre,\n telefono = :telefono,\n direccion = :direccion,\n email = :email,\n username = :username,\n pass = :pass\n WHERE id = $id\";\n\n try{\n $db = new db();\n $db = $db->connectionDB();\n $result = $db->prepare($sql);\n\n $result->bindParam(':nombre', $nombre);\n $result->bindParam(':telefono', $telefono);\n $result->bindParam(':direccion', $direccion);\n $result->bindParam(':email', $email);\n $result->bindParam(':username', $username);\n $result->bindParam(':pass', md5($pass));\n\n if($result->execute())\n echo json_encode(array(['mensaje' => 'Usuario con id '.$id.': Modificado Correctamente!']));\n else\n echo json_encode(array(['mensaje' => 'Error usuario con id '.$id.': No modificado!']));\n\n $result->closeCursor();\n $db = null;\n $result = null;\n\n }catch(PDOException $e){\n echo '{\"error\" : { \"text\": \"'.$e->getMessage().'\"}';\n }\n\n }", "public function updateUserinfo()\n\t{\n\t\t$user_array = Session::all();\n\n \t$userID = Session::get('id');\n\t\t$data = $this->request->all();\n\t\t$data['user'] = Auth::user();\n\t\t\t$rules = array(\n \t\t'full_name' => 'required',\n\t\t\t\t'zip_code' => 'required',\n\t\t\t\t'aniversary_date' => 'required',\n\t\t\t\t'phone_number' => 'required',\n\t\t\t\t'dob' => 'required',\n\t\t\t\t'gender' => 'required',\n\t\t\t\t'location_id' => 'required'\t\t\t\t\n\t\t\t);\n\n\t\t\t$message = array(\n\t\t\t\t'required' => 'The :attribute is required', \n\t\t\t);\n\n\t\t\t$validation = Validator::make($data, $rules, $message);\n\n\t\t\tif($validation->fails())\n\t\t\t{\n\t\t\t\treturn Redirect::to('/users/updateinfo')->withErrors($validation);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n \t$arrResponse=Profile::updateProfileWeb($data, $userID);\n \treturn Redirect::to('/users/myaccount')\n\t\t ->with('flash_notice', '');\n\t\t }\n\t}", "public function profileUpdate(UpdateUserRequest $request,$user_id)\n {\n\t\t$data=array();\n\t\t $result =array();\n\t\t $requestData = User::where('id',$user_id);\n\t\t $stored_data = User::where('id',$user_id)->first()->toArray();\n\t\t \n\t\tif($request->ajax()){\n\t\t\t$data =array();\n\t\t\t$data['first_name']= $request->first_name;\n\t\t\t$data['last_name']= $request->last_name;\n\t\t\n\t\t\t$requestData->update($data);\n\t\t\t\n\t\t\t//UPDATE PROFILE EVENT LOG END \n\t\t\t$result['success'] = true;\n\t\t\t$result['message'] = 'Your details has been successfully changed.';\n\t\t \n\t\t return Response::json($result, 200);\n\t\t}\n\t\t\n }", "private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}" ]
[ "0.78672194", "0.7509651", "0.75094706", "0.7479402", "0.74409956", "0.7154879", "0.71055937", "0.70627874", "0.7044481", "0.70439357", "0.6894009", "0.68866616", "0.6779675", "0.67748547", "0.6765457", "0.675899", "0.6721133", "0.66978645", "0.6687805", "0.66629726", "0.6646571", "0.6644388", "0.6640169", "0.66285884", "0.66258144", "0.6602972", "0.65809643", "0.6577733", "0.6570759", "0.655707" ]
0.77241457
1
Instatiates the userRepo variable
public function __construct(UserRepository $userRepo) { $this->userRepo = $userRepo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(UserRepository $userRepo)\n {\n $this->userRepo = $userRepo;\n }", "public function __construct(UserRepository $userRepo)\n {\n $this->userRepo = $userRepo;\n }", "public function __construct(UserRepository $repo)\n {\n $this->repo = $repo;\n }", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "function __construct( $user = 'imath' ) {\n\t\t$this->github_user = $user;\n\t\t$this->get_repos();\n\t}", "public function github() {\n\t\t$user = Socialize::with ( 'github' )->user ();\n\t\t// Do your stuff with user data.\n\t\tprint_r ( $user );\n\t\tdie ();\n\t}", "public function __construct(UserRepositoryInterface $userRepo)\n {\n $this->userRepo = $userRepo;\n }", "public function setRepo($user, $repo)\n {\n $this->apibase = \"https://api.github.com/repos/$user/$repo/\";\n }", "public function __construct(UserRepositoryEloquent $user)\n {\n $this->usersrepo = $user;\n }", "public function __construct(UserRepository $usersRepo){\n // $this->middleware('guest', ['except' => 'logout']);\n $this->usersRepo = $usersRepo;\n }", "public function __construct(UserRepository $userRepo)\n {\n $this->middleware('authByRole:credit');\n \n $this->userRepo = $userRepo;\n }", "protected function getRepository() {}", "public function __construct(UserRepo $userRepo)\n {\n $this->middleware('guest');\n $this->userRepo=$userRepo;\n }", "protected function _initAuth()\n {\n $dm = Registry::getInstance()->get('dm');\n $user = $dm->getRepository('Domain\\User\\Entity\\User')->find('4de999713eecad69a02e4145');\n \n // Simulate logged in User.\n Registry::getInstance()->set('user', $user);\n }", "public function testInstanceOfUserRepository()\n\t{\n\t\t$this->assertInstanceOf('\\Orchestra\\Support\\Memory\\Driver', $this->stub);\n\t\t$this->assertInstanceOf('\\Orchestra\\Support\\Memory\\Driver', \n\t\t\tnew \\Orchestra\\Repository\\User);\n\t\n\t\t$refl = new \\ReflectionObject($this->stub);\n\t\t$storage = $refl->getProperty('storage');\n\t\t$key_map = $refl->getProperty('key_map');\n\n\t\t$storage->setAccessible(true);\n\t\t$key_map->setAccessible(true);\n\n\t\t$this->assertEquals('usermeta', $storage->getValue($this->stub));\n\t\t$this->assertTrue(is_array($key_map->getValue($this->stub)));\n\t}", "public function __construct(UserRepository $userRepo, PaymentRepository $paymentRepo, FeesRepository $feesRepository, InvoiceRepository $invoiceRepo) {\n $this->userRepo = $userRepo;\n $this->paymentRepo = $paymentRepo;\n $this->invoiceRepo = $invoiceRepo;\n $this->feesRepository = $feesRepository;\n $this->currentDateTime = Carbon::now()->toDateTimeString();\n }", "public function __construct()\n {\n parent::__construct();\n $this->userRepository = new UserRepository();\n }", "public function getRepo()\n {\n return $this->repo;\n }", "public function __construct(\n UserRepo $userRepo,\n DoctorRepo $doctorRepo,\n PatientRepo $patientRepo,\n RoleUserRepo $roleUserRepo,\n RoleRepo $roleRepo,\n SocialProviderRepo $socialProviderRepo,\n DetUserSocialProviderRepo $detUserSocialProviderRepo,\n UserPhoneRepo $userPhoneRepo\n ) {\n $this->userRepo = $userRepo;\n $this->doctorRepo = $doctorRepo;\n $this->patientRepo = $patientRepo;\n $this->roleUserRepo = $roleUserRepo;\n $this->roleRepo = $roleRepo;\n $this->socialProviderRepo = $socialProviderRepo;\n $this->detUserSocialProviderRepo = $detUserSocialProviderRepo;\n $this->userPhoneRepo = $userPhoneRepo;\n }", "public function __construct(IUserRepository $user)\n {\n $this->user = $user;\n }", "function user_user_construct_($user){\n\t\t$CI =& get_instance();\n\t\t//if($user->is_logged() && $user->get()->avatar == '') $user->update('avatar',$CI->gears->user->avatar->default);\n\t}", "public function __construct(IUserRepo $user_repo)\n {\n $this->user_repo = $user_repo;\n\n $this->middleware('admin.guest');\n }", "public function __construct(UserRepository $users)\n {\n $this->users = $users;\n }", "public function __construct(UserRepository $users)\n {\n $this->users = $users;\n }", "public function baseRepository() {\n $userRepository = $this->getDoctrine()\n ->getManager()\n ->getRepository('Application\\UserBundle\\Entity\\User');\n return $userRepository;\n }", "function repositoryCustom()\n {\n }", "public function __construct()\n {\n parent::__construct();\n $this->repository = app(UserGroup::class);\n }", "public function __construct(UserRepositoryInterface $user_repository)\n {\n $this->user_repository = $user_repository;\n }", "public function setupUser() {\n parent::setupGlobalVariables();\n $session = (new SessionService())->getNewSession();\n if (!$session->isStarted()) $session->start();\n if ($session->get('user')) {\n $variables = array(\n 'username' => $session->get('user')['username'],\n 'role' => $session->get('user')['role']\n );\n $this->mergeToTemplateVariables($variables);\n }\n }", "public function __construct()\r\n {\r\n global $mysqli;\r\n\r\n $this->mysqli = $mysqli;\r\n $this->userRepository = new UserRepository($this->mysqli);\r\n }" ]
[ "0.64404494", "0.64404494", "0.6407422", "0.6384732", "0.6361367", "0.6352584", "0.6281507", "0.62178504", "0.618155", "0.61694765", "0.61385554", "0.5871681", "0.5863017", "0.5844516", "0.58336765", "0.5767627", "0.5758448", "0.5752608", "0.5721541", "0.5708664", "0.56913656", "0.5686867", "0.5675981", "0.5675981", "0.56685555", "0.5637103", "0.5611459", "0.5601059", "0.5587021", "0.5584184" ]
0.672416
0
Returns all available operating systems
public static function getAvailableOperatingSystems(): array { return self::$operatingSystems; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getOperatingSystems()\n\t\t{\n\t\t\treturn self::$operatingSystems;\n\t\t}", "public function listOs()\n {\n return $this->api->apiRequest('/os/list');\n }", "static public function grabOsInfos() {\n $distro = false;\n if (file_exists('/etc/redhat-release')) {\n $distro = preg_replace('/\\s+$/S', '', file_get_contents('/etc/redhat-release'));\n }\n $os = [\n 'family' => php_uname('s'),\n 'distribution' => ($distro ?: ''),\n 'version' => php_uname('r')\n ];\n return $os;\n }", "public function getAllOSes()\n {\n return array_keys($this->getDeviceOsVerMap());\n }", "protected function getOperatingSystem() {}", "public function getOS() {\n\n return array(\n 'AIX' => 'AIX',\n 'AND' => 'Android',\n 'AMG' => 'AmigaOS',\n 'ATV' => 'Apple TV',\n 'ARL' => 'Arch Linux',\n 'BTR' => 'BackTrack',\n 'SBA' => 'Bada',\n 'BEO' => 'BeOS',\n 'BLB' => 'BlackBerry OS',\n 'QNX' => 'BlackBerry Tablet OS',\n 'BMP' => 'Brew',\n 'CES' => 'CentOS',\n 'COS' => 'Chrome OS',\n 'CYN' => 'CyanogenMod',\n 'DEB' => 'Debian',\n 'DFB' => 'DragonFly',\n 'FED' => 'Fedora',\n 'FOS' => 'Firefox OS',\n 'FIR' => 'Fire OS',\n 'BSD' => 'FreeBSD',\n 'GNT' => 'Gentoo',\n 'GTV' => 'Google TV',\n 'HPX' => 'HP-UX',\n 'HAI' => 'Haiku OS',\n 'IRI' => 'IRIX',\n 'INF' => 'Inferno',\n 'KNO' => 'Knoppix',\n 'KBT' => 'Kubuntu',\n 'LIN' => 'GNU/Linux',\n 'LBT' => 'Lubuntu',\n 'VLN' => 'VectorLinux',\n 'MAC' => 'Mac',\n 'MAE' => 'Maemo',\n 'MDR' => 'Mandriva',\n 'SMG' => 'MeeGo',\n 'MCD' => 'MocorDroid',\n 'MIN' => 'Mint',\n 'MLD' => 'MildWild',\n 'MOR' => 'MorphOS',\n 'NBS' => 'NetBSD',\n 'MTK' => 'MTK / Nucleus',\n 'WII' => 'Nintendo',\n 'NDS' => 'Nintendo Mobile',\n 'OS2' => 'OS/2',\n 'T64' => 'OSF1',\n 'OBS' => 'OpenBSD',\n 'PSP' => 'PlayStation Portable',\n 'PS3' => 'PlayStation',\n 'RHT' => 'Red Hat',\n 'ROS' => 'RISC OS',\n 'REM' => 'Remix OS',\n 'RZD' => 'RazoDroiD',\n 'SAB' => 'Sabayon',\n 'SSE' => 'SUSE',\n 'SAF' => 'Sailfish OS',\n 'SLW' => 'Slackware',\n 'SOS' => 'Solaris',\n 'SYL' => 'Syllable',\n 'SYM' => 'Symbian',\n 'SYS' => 'Symbian OS',\n 'S40' => 'Symbian OS Series 40',\n 'S60' => 'Symbian OS Series 60',\n 'SY3' => 'Symbian^3',\n 'TDX' => 'ThreadX',\n 'TIZ' => 'Tizen',\n 'UBT' => 'Ubuntu',\n 'WTV' => 'WebTV',\n 'WIN' => 'Windows',\n 'WCE' => 'Windows CE',\n 'WIO' => 'Windows IoT',\n 'WMO' => 'Windows Mobile',\n 'WPH' => 'Windows Phone',\n 'WRT' => 'Windows RT',\n 'XBX' => 'Xbox',\n 'XBT' => 'Xubuntu',\n 'YNS' => 'YunOs',\n 'IOS' => 'iOS',\n 'POS' => 'palmOS',\n 'WOS' => 'webOS'\n );\n }", "public function listOperatingSystems()\n {\n $response = $this->_performRequest(self::OP_OPERATINGSYSTEMS);\n\n \tif ($response->isSuccessful()) {\n\t\t\t$result = $this->_parseResponse($response);\n\n \t\tif (!$result->OperatingSystem) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t if (count($result->OperatingSystem) > 1) {\n \t\t $xmlServices = $result->OperatingSystem;\n \t\t} else {\n \t\t $xmlServices = [$result->OperatingSystem];\n \t\t}\n\n\t\t\t$services = [];\n\t\t\tif (!is_null($xmlServices)) {\n\n\t\t\t\tfor ($i = 0; $i < count($xmlServices); $i++) {\n\t\t\t\t\t$services[] = new Zend_Service_WindowsAzure_Management_OperatingSystemInstance(\n\t\t\t\t\t (string)$xmlServices[$i]->Version,\n\t\t\t\t\t (string)$xmlServices[$i]->Label,\n\t\t\t\t\t ((string)$xmlServices[$i]->IsDefault == 'true'),\n\t\t\t\t\t ((string)$xmlServices[$i]->IsActive == 'true'),\n\t\t\t\t\t (string)$xmlServices[$i]->Family,\n\t\t\t\t\t (string)$xmlServices[$i]->FamilyLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $services;\n\t\t} else {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }", "function determineOs() {\n\t\n\t$ret\t\t\t= \"undef\";\n\t\n\tob_start();\n\teval(\"phpinfo();\");\n\t$info \t\t\t= ob_get_contents();\n\tob_end_clean();\n\t\n\tforeach(explode(\"\\n\", $info) as $line) \t{\n\t \n\t if(strpos($line, \"System\")!== false) {\n\t \n\t $show \t= trim(str_replace(\"System\",\"\", strip_tags($line)));\n\t \n\t }\n\t}\n\t\n\tif( preg_match('/WIN/i', $show) ) {\n\t \n\t $ret\t= \"windows\";\n\t} else {\n\t $ret\t= \"unix\";\n\t}\n\n\treturn( $ret );\n}", "public function getOS() { \n \n $server_data = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"Unknown OS Platform\";\n\n $os_array = array(\n '/windows nt 10/i' => 'Windows',\n '/windows nt 6.3/i' => 'Windows',\n '/windows nt 6.2/i' => 'Windows',\n '/windows nt 6.1/i' => 'Windows',\n '/windows nt 6.0/i' => 'Windows',\n '/windows nt 5.2/i' => 'Windows',\n '/windows nt 5.1/i' => 'Windows',\n '/windows xp/i' => 'Windows',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $server_data)) {\n $os_platform = $value;\n }\n } \n\n return $os_platform;\n }", "public function getOperatingSystem() {\n\t\t$event = $this->Controller->Event->trigger('findOperatingSystem');\n\t\tif (isset($event['findOperatingSystem'][$this->Controller->plugin]) && is_string($event['findOperatingSystem'][$this->Controller->plugin])) {\n\t\t\treturn $event['findOperatingSystem'][$this->Controller->plugin];\n\t\t}\n\n\t\t$agent = env( 'HTTP_USER_AGENT' );\n\t\tConfigure::load('operating_systems');\n\t\t$operatingSystems = Configure::read('OperatingSystems');\n\n\t\tforeach ( $operatingSystems as $key => $value) {\n\t\t\tif ( preg_match( \"/$value/i\", $agent ) ) {\n\t\t\t\treturn $operatingSystems[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn 'Unknown';\n\t}", "public function getOSList()\n {\n $data = $this->doGet('compute/list/os');\n return collect($data['__data']);\n }", "function operating_system_detection()\n {\n if (isset( $_SERVER )) {\n $agent = $_SERVER['HTTP_USER_AGENT'] ;\n } else {\n global $HTTP_SERVER_VARS ;\n if (isset( $HTTP_SERVER_VARS )) {\n $agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ;\n } else {\n global $HTTP_USER_AGENT ;\n $agent = $HTTP_USER_AGENT ;\n }\n }\n $ros[] = array('Windows XP', 'Windows XP');\n $ros[] = array('Windows NT 5.1|Windows NT5.1)', 'Windows XP');\n $ros[] = array('Windows 2000', 'Windows 2000');\n $ros[] = array('Windows NT 5.0', 'Windows 2000');\n $ros[] = array('Windows NT 4.0|WinNT4.0', 'Windows NT');\n $ros[] = array('Windows NT 5.2', 'Windows Server 2003');\n $ros[] = array('Windows NT 6.0', 'Windows Vista');\n $ros[] = array('Windows NT 7.0', 'Windows 7');\n $ros[] = array('Windows NT 10.0', 'Windows 10');\n $ros[] = array('Windows CE', 'Windows CE');\n $ros[] = array('(media center pc).([0-9]{1,2}\\.[0-9]{1,2})', 'Windows Media Center');\n $ros[] = array('(win)([0-9]{1,2}\\.[0-9x]{1,2})', 'Windows');\n $ros[] = array('(win)([0-9]{2})', 'Windows');\n $ros[] = array('(windows)([0-9x]{2})', 'Windows');\n // Doesn't seem like these are necessary...not totally sure though..\n //$ros[] = array('(winnt)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'Windows NT');\n //$ros[] = array('(windows nt)(([0-9]{1,2}\\.[0-9]{1,2}){0,1})', 'Windows NT'); // fix by bg\n $ros[] = array('Windows ME', 'Windows ME');\n $ros[] = array('Win 9x 4.90', 'Windows ME');\n $ros[] = array('Windows 98|Win98', 'Windows 98');\n $ros[] = array('Windows 95', 'Windows 95');\n $ros[] = array('(windows)([0-9]{1,2}\\.[0-9]{1,2})', 'Windows');\n $ros[] = array('win32', 'Windows');\n $ros[] = array('(java)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,2})', 'Java');\n $ros[] = array('(Solaris)([0-9]{1,2}\\.[0-9x]{1,2}){0,1}', 'Solaris');\n $ros[] = array('dos x86', 'DOS');\n $ros[] = array('unix', 'Unix');\n $ros[] = array('Mac OS X', 'Mac OS X');\n $ros[] = array('Mac_PowerPC', 'Macintosh PowerPC');\n $ros[] = array('(mac|Macintosh)', 'Mac OS');\n $ros[] = array('(sunos)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'SunOS');\n $ros[] = array('(beos)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'BeOS');\n $ros[] = array('(risc os)([0-9]{1,2}\\.[0-9]{1,2})', 'RISC OS');\n $ros[] = array('os/2', 'OS/2');\n $ros[] = array('freebsd', 'FreeBSD');\n $ros[] = array('openbsd', 'OpenBSD');\n $ros[] = array('netbsd', 'NetBSD');\n $ros[] = array('irix', 'IRIX');\n $ros[] = array('plan9', 'Plan9');\n $ros[] = array('osf', 'OSF');\n $ros[] = array('aix', 'AIX');\n $ros[] = array('GNU Hurd', 'GNU Hurd');\n $ros[] = array('(fedora)', 'Linux - Fedora');\n $ros[] = array('(kubuntu)', 'Linux - Kubuntu');\n $ros[] = array('(ubuntu)', 'Linux - Ubuntu');\n $ros[] = array('(debian)', 'Linux - Debian');\n $ros[] = array('(CentOS)', 'Linux - CentOS');\n $ros[] = array('(Mandriva).([0-9]{1,3}(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?)', 'Linux - Mandriva');\n $ros[] = array('(SUSE).([0-9]{1,3}(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?)', 'Linux - SUSE');\n $ros[] = array('(Dropline)', 'Linux - Slackware (Dropline GNOME)');\n $ros[] = array('(ASPLinux)', 'Linux - ASPLinux');\n $ros[] = array('(Red Hat)', 'Linux - Red Hat');\n // Loads of Linux machines will be detected as unix.\n // Actually, all of the linux machines I've checked have the 'X11' in the User Agent.\n //$ros[] = array('X11', 'Unix');\n $ros[] = array('(linux)', 'Linux');\n $ros[] = array('(amigaos)([0-9]{1,2}\\.[0-9]{1,2})', 'AmigaOS');\n $ros[] = array('amiga-aweb', 'AmigaOS');\n $ros[] = array('amiga', 'Amiga');\n $ros[] = array('AvantGo', 'PalmOS');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1}-([0-9]{1,2}) i([0-9]{1})86){1}', 'Linux');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1} i([0-9]{1}86)){1}', 'Linux');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1})', 'Linux');\n $ros[] = array('[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3})', 'Linux');\n $ros[] = array('(webtv)/([0-9]{1,2}\\.[0-9]{1,2})', 'WebTV');\n $ros[] = array('Dreamcast', 'Dreamcast OS');\n $ros[] = array('GetRight', 'Windows');\n $ros[] = array('go!zilla', 'Windows');\n $ros[] = array('gozilla', 'Windows');\n $ros[] = array('gulliver', 'Windows');\n $ros[] = array('ia archiver', 'Windows');\n $ros[] = array('NetPositive', 'Windows');\n $ros[] = array('mass downloader', 'Windows');\n $ros[] = array('microsoft', 'Windows');\n $ros[] = array('offline explorer', 'Windows');\n $ros[] = array('teleport', 'Windows');\n $ros[] = array('web downloader', 'Windows');\n $ros[] = array('webcapture', 'Windows');\n $ros[] = array('webcollage', 'Windows');\n $ros[] = array('webcopier', 'Windows');\n $ros[] = array('webstripper', 'Windows');\n $ros[] = array('webzip', 'Windows');\n $ros[] = array('wget', 'Windows');\n $ros[] = array('Java', 'Unknown');\n $ros[] = array('flashget', 'Windows');\n // delete next line if the script show not the right OS\n //$ros[] = array('(PHP)/([0-9]{1,2}.[0-9]{1,2})', 'PHP');\n $ros[] = array('MS FrontPage', 'Windows');\n $ros[] = array('(msproxy)/([0-9]{1,2}.[0-9]{1,2})', 'Windows');\n $ros[] = array('(msie)([0-9]{1,2}.[0-9]{1,2})', 'Windows');\n $ros[] = array('libwww-perl', 'Unix');\n $ros[] = array('UP.Browser', 'Windows CE');\n $ros[] = array('NetAnts', 'Windows');\n $file = count ( $ros );\n $os = '';\n for ($n=0; $n<$file; $n++) {\n if (preg_match('/'.$ros[$n][0].'/i', $agent, $name)) {\n $os = @$ros[$n][1].' '.@$name[2];\n break;\n }\n }\n return trim ( $os );\n }", "public static function getAvailableOperatingSystemFamilies(): array\n {\n return self::$osFamilies;\n }", "public function getSupportedEngines()\n {\n return array_keys($this->engine_supported);\n }", "static function getOS(){\n\t\trequire_once(\"knj/functions_array.php\");\n\t\t$bots = array(\n\t\t\t\"yahoo! slurp\",\n\t\t\t\"msnbot\",\n\t\t\t\"googlebot\",\n\t\t\t\"adsbot\",\n\t\t\t\"ask jeeves\",\n\t\t\t\"conpilot crawler\",\n\t\t\t\"yandex\",\n\t\t\t\"exabot\",\n\t\t\t\"hostharvest\",\n\t\t\t\"dotbot\",\n\t\t\t\"ia_archiver\",\n\t\t\t\"httpclient\",\n\t\t\t\"spider.html\",\n\t\t\t\"comodo-certificates-spider\",\n\t\t\t\"sbider\",\n\t\t\t\"speedy spider\",\n\t\t\t\"spbot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"scoutjet\",\n\t\t\t\"com_bot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"robot.html\",\n\t\t\t\"robot.htm\",\n\t\t\t\"catchbot\",\n\t\t\t\"baiduspider\",\n\t\t\t\"setoozbot\",\n\t\t\t\"sslbot\",\n\t\t\t\"browsershots\",\n\t\t\t\"perl\",\n\t\t\t\"wget\",\n\t\t\t\"w3c_validator\"\n\t\t);\n\t\t\n\t\tif (array_key_exists(\"HTTP_USER_AGENT\", $_SERVER)){\n\t\t\t$ua = strtolower($_SERVER[\"HTTP_USER_AGENT\"]);\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t\t\n\t\tif (strpos($ua, \"windows\") !== false){\n\t\t\treturn \"windows\";\n\t\t}elseif(strpos($ua, \"linux\") !== false){\n\t\t\treturn \"linux\";\n\t\t}elseif(strpos($ua, \"mac\") !== false){\n\t\t\treturn \"mac\";\n\t\t}elseif(strpos($ua, \"playstation\") !== false){\n\t\t\treturn \"playstation\";\n\t\t}elseif(strpos($ua, \"nintendo wii\") !== false){\n\t\t\treturn \"wii\";\n\t\t}elseif(knjarray::stringsearch($ua, $bots)){\n\t\t\treturn \"bot\";\n\t\t}elseif(strpos($ua, \"sunos\") !== false){\n\t\t\treturn \"sun\";\n\t\t}elseif(trim($ua) == \"\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t}", "function getOS($request) {\n $user_agent = $request->server('HTTP_USER_AGENT');\n $os_platform = $user_agent . \" - Unknown OS Platform\";\n $os_array = array(\n '/windows nt 10/i' => 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n foreach ($os_array as $regex => $value)\n if (preg_match($regex, $user_agent))\n $os_platform = $value;\n return $os_platform;\n }", "public function getOsName(): array\n {\n $os_name = \"ubuntu\";\n $os_release = \"16.04\";\n foreach (self::$releases as $path => $fields) {\n if (file_exists($path)) {\n $lsb_data = trim(file_get_contents($path));\n foreach (explode(\"\\n\", $lsb_data) as $line) {\n list($key, $value) = explode(\"=\", $line, 2);\n if ($key == $fields[\"id\"]) {\n $os_name = strtolower($value);\n } elseif ($key == $fields[\"version\"]) {\n $os_release = $value;\n }\n }\n }\n }\n return [$os_name, $os_release, self::FAMILY];\n }", "function fetch_os()\n\t{\n\t\t$useragent = strtolower($this->my_getenv('HTTP_USER_AGENT'));\n\t\t\n\t\tif ( strstr( $useragent, 'mac' ) )\n\t\t{\n\t\t\treturn 'mac';\n\t\t}\n\t\t\n\t\tif ( preg_match( '#wi(n|n32|ndows)#', $useragent ) )\n\t\t{\n\t\t\treturn 'windows';\n\t\t}\n\t\t\n\t\treturn 'unknown';\n\t}", "public function getOsAllowableValues()\r\n {\r\n return [\r\n self::OS_WINDOWS,\r\n self::OS_LINUX,\r\n ];\r\n }", "public function getOperatingSystem(): int\n {\n switch (true) {\n case stristr(PHP_OS, 'DAR'):\n return self::OS_OSX;\n case stristr(PHP_OS, 'WIN'):\n return self::OS_WIN;\n case stristr(PHP_OS, 'LINUX'):\n return self::OS_LINUX;\n default:\n return self::OS_UNKNOWN;\n }\n }", "protected function getOperatingSystem()\n {\n $osRaw = strtolower(PHP_OS);\n \n if (strpos($osRaw, 'linux') !== false) {\n return RequestAbstract::OS_LINUX;\n } else if (strpos($osRaw, 'windows') !== false) {\n return RequestAbstract::OS_WINDOWS;\n } else {\n return RequestAbstract::OS_UNKNOWN;\n }\n }", "static public function getOS(): string\n {\n return php_uname('s');\n }", "protected function getSystem()\n {\n $uname = strtolower( php_uname() );\n\n if (str_contains( $uname, 'darwin' )) {\n return 'macosx';\n } elseif (str_contains( $uname, 'win' )) {\n return 'windows';\n } elseif (str_contains( $uname, 'linux' )) {\n return PHP_INT_SIZE === 4 ? 'linux-i686' : 'linux-x86_64';\n } else {\n throw new \\RuntimeException( 'Unknown operating system.' );\n }\n }", "public function getOsFeatures() : array\n {\n return $this->osFeatures;\n }", "public function getSupportedFS()\n\t{\n\t\t$list = array();\n\t\t$list['ext2'] = 'ext2';\n\t\t$list['ext3'] = 'ext3';\n\t\t$list['ext4'] = 'ext4';\n\t\t$list['linux-swap'] = 'linux-swap';\n\t\t$list['reiserfs'] = 'reiserfs';\n\t\t$list['efi-boot'] = 'efi-boot';\n\t\treturn($list);\n\t}", "public function getOperatingSystem() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = '';\n\t\t\t$cmd = 'sw_vers';\n\t\t\t\n\t\t\t// Execute Command/Parse Results\n\t\t\tself::execute($cmd, $output);\n\t\t\t\n\t\t\t$name = explode(':', $output[0]);\n\t\t\t$name = trim($name[1]);\n\t\t\t\n\t\t\t$version = explode(':', $output[1]);\n\t\t\t$version = trim($version[1]);\n\t\t\t\n\t\t\t$result = $name . ' (' . $version . ')';\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}", "function olc_get_system_information() {\n\n\t$db_query = olc_db_query(SELECT.\"now() as datetime\");\n\t$db = olc_db_fetch_array($db_query);\n\n\tlist($system, $host, $kernel) = preg_split('/[\\s,]+/', @exec('uname -a'), 5);\n\n\treturn array('date' => olc_datetime_short(date('Y-m-d H:i:s')),\n\t'system' => $system,\n\t'kernel' => $kernel,\n\t'host' => $host,\n\t'ip' => gethostbyname($host),\n\t'uptime' => @exec('uptime'),\n\t'http_server' => $_SERVER['SERVER_SOFTWARE'],\n\t'php' => PHP_VERSION,\n\t'zend' => (function_exists('zend_version') ? zend_version() : EMPTY_STRING),\n\t'db_server' => DB_SERVER,\n\t'db_ip' => gethostbyname(DB_SERVER),\n\t'db_version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : EMPTY_STRING),\n\t'db_date' => olc_datetime_short($db['datetime']));\n}", "function get_os () {\n $uname = php_uname('s');\n if ($uname == \"Darwin\") {\n return OS_MAC;\n }\n if ($uname == \"Linux\") {\n return OS_LINUX;\n }\n if (strtoupper(substr($uname, 0, 3)) === 'WIN') {\n return OS_WIN;\n }\n\n throw new \\Exception(\"Did not recognize operating system. uname: '$uname'\");\n}", "function getOS() { \n\n $user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"UnknownOS\";\n\n $os_array = array(\n '/Windows Phone/i' => 'Windows Phone',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $user_agent)) {\n $os_platform = $value;\n }\n\n } \n\n return $os_platform;\n\n}", "function getOS($userAgent) {\n // Create list of operating systems with operating system name as array key \n\t$oses = array (\n\t\t'iPhone' => '(iPhone)',\n\t\t'Windows 3.11' => 'Win16',\n\t\t'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', // Use regular expressions as value to identify operating system\n\t\t'Windows 98' => '(Windows 98)|(Win98)',\n\t\t'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',\n\t\t'Windows XP' => '(Windows NT 5.1)|(Windows XP)',\n\t\t'Windows 2003' => '(Windows NT 5.2)',\n\t\t'Windows Vista' => '(Windows NT 6.0)|(Windows Vista)',\n\t\t'Windows 7' => '(Windows NT 6.1)|(Windows 7)',\n\t\t'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',\n\t\t'Windows ME' => 'Windows ME',\n\t\t'Open BSD'=>'OpenBSD',\n\t\t'Sun OS'=>'SunOS',\n\t\t'Linux'=>'(Linux)|(X11)',\n\t\t'Safari' => '(Safari)',\n\t\t'Macintosh'=>'(Mac_PowerPC)|(Macintosh)',\n\t\t'QNX'=>'QNX',\n\t\t'BeOS'=>'BeOS',\n\t\t'OS/2'=>'OS/2',\n\t\t'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp/cat)|(msnbot)|(ia_archiver)'\n\t);\n\n\tforeach($oses as $os=>$pattern){ // Loop through $oses array\n // Use regular expressions to check operating system type\n\t\tif(eregi($pattern, $userAgent)) { // Check if a value in $oses array matches current user agent.\n\t\t\treturn $os; // Operating system was matched so return $oses key\n\t\t}\n\t}\n\treturn 'Unknown'; // Cannot find operating system so return Unknown\n}" ]
[ "0.8015602", "0.7616731", "0.74327266", "0.7398827", "0.7251474", "0.71278465", "0.7024587", "0.6999605", "0.69612885", "0.6932211", "0.6916772", "0.68616235", "0.67843914", "0.66213155", "0.6589583", "0.65619653", "0.65121305", "0.6511049", "0.6481422", "0.6473114", "0.6463628", "0.6416982", "0.64076066", "0.64067566", "0.6386359", "0.63326323", "0.6310513", "0.62947726", "0.6256147", "0.62459" ]
0.8501449
0
Returns all available operating system families
public static function getAvailableOperatingSystemFamilies(): array { return self::$osFamilies; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAvailableOperatingSystems(): array\n {\n return self::$operatingSystems;\n }", "public function listOperatingSystemFamilies()\n {\n $response = $this->_performRequest(self::OP_OPERATINGSYSTEMFAMILIES);\n\n \tif ($response->isSuccessful()) {\n\t\t\t$result = $this->_parseResponse($response);\n\n \t\tif (!$result->OperatingSystemFamily) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t if (count($result->OperatingSystemFamily) > 1) {\n \t\t $xmlServices = $result->OperatingSystemFamily;\n \t\t} else {\n \t\t $xmlServices = [$result->OperatingSystemFamily];\n \t\t}\n\n\t\t\t$services = [];\n\t\t\tif (!is_null($xmlServices)) {\n\n\t\t\t\tfor ($i = 0; $i < count($xmlServices); $i++) {\n\t\t\t\t\t$services[] = new Zend_Service_WindowsAzure_Management_OperatingSystemFamilyInstance(\n\t\t\t\t\t (string)$xmlServices[$i]->Name,\n\t\t\t\t\t (string)$xmlServices[$i]->Label\n\t\t\t\t\t);\n\n\t\t\t\t\tif (count($xmlServices[$i]->OperatingSystems->OperatingSystem) > 1) {\n\t\t \t\t $xmlOperatingSystems = $xmlServices[$i]->OperatingSystems->OperatingSystem;\n\t\t \t\t} else {\n\t\t \t\t $xmlOperatingSystems = [$xmlServices[$i]->OperatingSystems->OperatingSystem];\n\t\t \t\t}\n\n\t\t\t\t\t$operatingSystems = [];\n\t\t\t\t\tif (!is_null($xmlOperatingSystems)) {\n\t\t\t\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/OperatingSystemInstance.php';\n\t\t\t\t\t\tfor ($i = 0; $i < count($xmlOperatingSystems); $i++) {\n\t\t\t\t\t\t\t$operatingSystems[] = new Zend_Service_WindowsAzure_Management_OperatingSystemInstance(\n\t\t\t\t\t\t\t (string)$xmlOperatingSystems[$i]->Version,\n\t\t\t\t\t\t\t (string)$xmlOperatingSystems[$i]->Label,\n\t\t\t\t\t\t\t ((string)$xmlOperatingSystems[$i]->IsDefault == 'true'),\n\t\t\t\t\t\t\t ((string)$xmlOperatingSystems[$i]->IsActive == 'true'),\n\t\t\t\t\t\t\t (string)$xmlServices[$i]->Name,\n\t\t\t\t\t\t\t (string)$xmlServices[$i]->Label\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\t$services[ count($services) - 1 ]->OperatingSystems = $operatingSystems;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $services;\n\t\t} else {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }", "static public function grabOsInfos() {\n $distro = false;\n if (file_exists('/etc/redhat-release')) {\n $distro = preg_replace('/\\s+$/S', '', file_get_contents('/etc/redhat-release'));\n }\n $os = [\n 'family' => php_uname('s'),\n 'distribution' => ($distro ?: ''),\n 'version' => php_uname('r')\n ];\n return $os;\n }", "public function getSupportedFS()\n\t{\n\t\t$list = array();\n\t\t$list['ext2'] = 'ext2';\n\t\t$list['ext3'] = 'ext3';\n\t\t$list['ext4'] = 'ext4';\n\t\t$list['linux-swap'] = 'linux-swap';\n\t\t$list['reiserfs'] = 'reiserfs';\n\t\t$list['efi-boot'] = 'efi-boot';\n\t\treturn($list);\n\t}", "public static function getOperatingSystems()\n\t\t{\n\t\t\treturn self::$operatingSystems;\n\t\t}", "public function getOS() {\n\n return array(\n 'AIX' => 'AIX',\n 'AND' => 'Android',\n 'AMG' => 'AmigaOS',\n 'ATV' => 'Apple TV',\n 'ARL' => 'Arch Linux',\n 'BTR' => 'BackTrack',\n 'SBA' => 'Bada',\n 'BEO' => 'BeOS',\n 'BLB' => 'BlackBerry OS',\n 'QNX' => 'BlackBerry Tablet OS',\n 'BMP' => 'Brew',\n 'CES' => 'CentOS',\n 'COS' => 'Chrome OS',\n 'CYN' => 'CyanogenMod',\n 'DEB' => 'Debian',\n 'DFB' => 'DragonFly',\n 'FED' => 'Fedora',\n 'FOS' => 'Firefox OS',\n 'FIR' => 'Fire OS',\n 'BSD' => 'FreeBSD',\n 'GNT' => 'Gentoo',\n 'GTV' => 'Google TV',\n 'HPX' => 'HP-UX',\n 'HAI' => 'Haiku OS',\n 'IRI' => 'IRIX',\n 'INF' => 'Inferno',\n 'KNO' => 'Knoppix',\n 'KBT' => 'Kubuntu',\n 'LIN' => 'GNU/Linux',\n 'LBT' => 'Lubuntu',\n 'VLN' => 'VectorLinux',\n 'MAC' => 'Mac',\n 'MAE' => 'Maemo',\n 'MDR' => 'Mandriva',\n 'SMG' => 'MeeGo',\n 'MCD' => 'MocorDroid',\n 'MIN' => 'Mint',\n 'MLD' => 'MildWild',\n 'MOR' => 'MorphOS',\n 'NBS' => 'NetBSD',\n 'MTK' => 'MTK / Nucleus',\n 'WII' => 'Nintendo',\n 'NDS' => 'Nintendo Mobile',\n 'OS2' => 'OS/2',\n 'T64' => 'OSF1',\n 'OBS' => 'OpenBSD',\n 'PSP' => 'PlayStation Portable',\n 'PS3' => 'PlayStation',\n 'RHT' => 'Red Hat',\n 'ROS' => 'RISC OS',\n 'REM' => 'Remix OS',\n 'RZD' => 'RazoDroiD',\n 'SAB' => 'Sabayon',\n 'SSE' => 'SUSE',\n 'SAF' => 'Sailfish OS',\n 'SLW' => 'Slackware',\n 'SOS' => 'Solaris',\n 'SYL' => 'Syllable',\n 'SYM' => 'Symbian',\n 'SYS' => 'Symbian OS',\n 'S40' => 'Symbian OS Series 40',\n 'S60' => 'Symbian OS Series 60',\n 'SY3' => 'Symbian^3',\n 'TDX' => 'ThreadX',\n 'TIZ' => 'Tizen',\n 'UBT' => 'Ubuntu',\n 'WTV' => 'WebTV',\n 'WIN' => 'Windows',\n 'WCE' => 'Windows CE',\n 'WIO' => 'Windows IoT',\n 'WMO' => 'Windows Mobile',\n 'WPH' => 'Windows Phone',\n 'WRT' => 'Windows RT',\n 'XBX' => 'Xbox',\n 'XBT' => 'Xubuntu',\n 'YNS' => 'YunOs',\n 'IOS' => 'iOS',\n 'POS' => 'palmOS',\n 'WOS' => 'webOS'\n );\n }", "public function getAllOSes()\n {\n return array_keys($this->getDeviceOsVerMap());\n }", "function operating_system_detection()\n {\n if (isset( $_SERVER )) {\n $agent = $_SERVER['HTTP_USER_AGENT'] ;\n } else {\n global $HTTP_SERVER_VARS ;\n if (isset( $HTTP_SERVER_VARS )) {\n $agent = $HTTP_SERVER_VARS['HTTP_USER_AGENT'] ;\n } else {\n global $HTTP_USER_AGENT ;\n $agent = $HTTP_USER_AGENT ;\n }\n }\n $ros[] = array('Windows XP', 'Windows XP');\n $ros[] = array('Windows NT 5.1|Windows NT5.1)', 'Windows XP');\n $ros[] = array('Windows 2000', 'Windows 2000');\n $ros[] = array('Windows NT 5.0', 'Windows 2000');\n $ros[] = array('Windows NT 4.0|WinNT4.0', 'Windows NT');\n $ros[] = array('Windows NT 5.2', 'Windows Server 2003');\n $ros[] = array('Windows NT 6.0', 'Windows Vista');\n $ros[] = array('Windows NT 7.0', 'Windows 7');\n $ros[] = array('Windows NT 10.0', 'Windows 10');\n $ros[] = array('Windows CE', 'Windows CE');\n $ros[] = array('(media center pc).([0-9]{1,2}\\.[0-9]{1,2})', 'Windows Media Center');\n $ros[] = array('(win)([0-9]{1,2}\\.[0-9x]{1,2})', 'Windows');\n $ros[] = array('(win)([0-9]{2})', 'Windows');\n $ros[] = array('(windows)([0-9x]{2})', 'Windows');\n // Doesn't seem like these are necessary...not totally sure though..\n //$ros[] = array('(winnt)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'Windows NT');\n //$ros[] = array('(windows nt)(([0-9]{1,2}\\.[0-9]{1,2}){0,1})', 'Windows NT'); // fix by bg\n $ros[] = array('Windows ME', 'Windows ME');\n $ros[] = array('Win 9x 4.90', 'Windows ME');\n $ros[] = array('Windows 98|Win98', 'Windows 98');\n $ros[] = array('Windows 95', 'Windows 95');\n $ros[] = array('(windows)([0-9]{1,2}\\.[0-9]{1,2})', 'Windows');\n $ros[] = array('win32', 'Windows');\n $ros[] = array('(java)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,2})', 'Java');\n $ros[] = array('(Solaris)([0-9]{1,2}\\.[0-9x]{1,2}){0,1}', 'Solaris');\n $ros[] = array('dos x86', 'DOS');\n $ros[] = array('unix', 'Unix');\n $ros[] = array('Mac OS X', 'Mac OS X');\n $ros[] = array('Mac_PowerPC', 'Macintosh PowerPC');\n $ros[] = array('(mac|Macintosh)', 'Mac OS');\n $ros[] = array('(sunos)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'SunOS');\n $ros[] = array('(beos)([0-9]{1,2}\\.[0-9]{1,2}){0,1}', 'BeOS');\n $ros[] = array('(risc os)([0-9]{1,2}\\.[0-9]{1,2})', 'RISC OS');\n $ros[] = array('os/2', 'OS/2');\n $ros[] = array('freebsd', 'FreeBSD');\n $ros[] = array('openbsd', 'OpenBSD');\n $ros[] = array('netbsd', 'NetBSD');\n $ros[] = array('irix', 'IRIX');\n $ros[] = array('plan9', 'Plan9');\n $ros[] = array('osf', 'OSF');\n $ros[] = array('aix', 'AIX');\n $ros[] = array('GNU Hurd', 'GNU Hurd');\n $ros[] = array('(fedora)', 'Linux - Fedora');\n $ros[] = array('(kubuntu)', 'Linux - Kubuntu');\n $ros[] = array('(ubuntu)', 'Linux - Ubuntu');\n $ros[] = array('(debian)', 'Linux - Debian');\n $ros[] = array('(CentOS)', 'Linux - CentOS');\n $ros[] = array('(Mandriva).([0-9]{1,3}(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?)', 'Linux - Mandriva');\n $ros[] = array('(SUSE).([0-9]{1,3}(\\.[0-9]{1,3})?(\\.[0-9]{1,3})?)', 'Linux - SUSE');\n $ros[] = array('(Dropline)', 'Linux - Slackware (Dropline GNOME)');\n $ros[] = array('(ASPLinux)', 'Linux - ASPLinux');\n $ros[] = array('(Red Hat)', 'Linux - Red Hat');\n // Loads of Linux machines will be detected as unix.\n // Actually, all of the linux machines I've checked have the 'X11' in the User Agent.\n //$ros[] = array('X11', 'Unix');\n $ros[] = array('(linux)', 'Linux');\n $ros[] = array('(amigaos)([0-9]{1,2}\\.[0-9]{1,2})', 'AmigaOS');\n $ros[] = array('amiga-aweb', 'AmigaOS');\n $ros[] = array('amiga', 'Amiga');\n $ros[] = array('AvantGo', 'PalmOS');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1}-([0-9]{1,2}) i([0-9]{1})86){1}', 'Linux');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1} i([0-9]{1}86)){1}', 'Linux');\n //$ros[] = array('(Linux)([0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3}(rel\\.[0-9]{1,2}){0,1})', 'Linux');\n $ros[] = array('[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,3})', 'Linux');\n $ros[] = array('(webtv)/([0-9]{1,2}\\.[0-9]{1,2})', 'WebTV');\n $ros[] = array('Dreamcast', 'Dreamcast OS');\n $ros[] = array('GetRight', 'Windows');\n $ros[] = array('go!zilla', 'Windows');\n $ros[] = array('gozilla', 'Windows');\n $ros[] = array('gulliver', 'Windows');\n $ros[] = array('ia archiver', 'Windows');\n $ros[] = array('NetPositive', 'Windows');\n $ros[] = array('mass downloader', 'Windows');\n $ros[] = array('microsoft', 'Windows');\n $ros[] = array('offline explorer', 'Windows');\n $ros[] = array('teleport', 'Windows');\n $ros[] = array('web downloader', 'Windows');\n $ros[] = array('webcapture', 'Windows');\n $ros[] = array('webcollage', 'Windows');\n $ros[] = array('webcopier', 'Windows');\n $ros[] = array('webstripper', 'Windows');\n $ros[] = array('webzip', 'Windows');\n $ros[] = array('wget', 'Windows');\n $ros[] = array('Java', 'Unknown');\n $ros[] = array('flashget', 'Windows');\n // delete next line if the script show not the right OS\n //$ros[] = array('(PHP)/([0-9]{1,2}.[0-9]{1,2})', 'PHP');\n $ros[] = array('MS FrontPage', 'Windows');\n $ros[] = array('(msproxy)/([0-9]{1,2}.[0-9]{1,2})', 'Windows');\n $ros[] = array('(msie)([0-9]{1,2}.[0-9]{1,2})', 'Windows');\n $ros[] = array('libwww-perl', 'Unix');\n $ros[] = array('UP.Browser', 'Windows CE');\n $ros[] = array('NetAnts', 'Windows');\n $file = count ( $ros );\n $os = '';\n for ($n=0; $n<$file; $n++) {\n if (preg_match('/'.$ros[$n][0].'/i', $agent, $name)) {\n $os = @$ros[$n][1].' '.@$name[2];\n break;\n }\n }\n return trim ( $os );\n }", "public function listOs()\n {\n return $this->api->apiRequest('/os/list');\n }", "public function getOsName(): array\n {\n $os_name = \"ubuntu\";\n $os_release = \"16.04\";\n foreach (self::$releases as $path => $fields) {\n if (file_exists($path)) {\n $lsb_data = trim(file_get_contents($path));\n foreach (explode(\"\\n\", $lsb_data) as $line) {\n list($key, $value) = explode(\"=\", $line, 2);\n if ($key == $fields[\"id\"]) {\n $os_name = strtolower($value);\n } elseif ($key == $fields[\"version\"]) {\n $os_release = $value;\n }\n }\n }\n }\n return [$os_name, $os_release, self::FAMILY];\n }", "public function getOS() { \n \n $server_data = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"Unknown OS Platform\";\n\n $os_array = array(\n '/windows nt 10/i' => 'Windows',\n '/windows nt 6.3/i' => 'Windows',\n '/windows nt 6.2/i' => 'Windows',\n '/windows nt 6.1/i' => 'Windows',\n '/windows nt 6.0/i' => 'Windows',\n '/windows nt 5.2/i' => 'Windows',\n '/windows nt 5.1/i' => 'Windows',\n '/windows xp/i' => 'Windows',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $server_data)) {\n $os_platform = $value;\n }\n } \n\n return $os_platform;\n }", "public function getOsFeatures() : array\n {\n return $this->osFeatures;\n }", "function determineOs() {\n\t\n\t$ret\t\t\t= \"undef\";\n\t\n\tob_start();\n\teval(\"phpinfo();\");\n\t$info \t\t\t= ob_get_contents();\n\tob_end_clean();\n\t\n\tforeach(explode(\"\\n\", $info) as $line) \t{\n\t \n\t if(strpos($line, \"System\")!== false) {\n\t \n\t $show \t= trim(str_replace(\"System\",\"\", strip_tags($line)));\n\t \n\t }\n\t}\n\t\n\tif( preg_match('/WIN/i', $show) ) {\n\t \n\t $ret\t= \"windows\";\n\t} else {\n\t $ret\t= \"unix\";\n\t}\n\n\treturn( $ret );\n}", "function get_font_families() {\n\n\t\treturn array(\n\t\t\t'Arial' => 'Arial',\n\t\t\t'Georgia' => 'Georgia',\n\t\t\t\"돋움\" => \"돋움\"\n\t\t);\n\t}", "public function getSupportedEngines()\n {\n return array_keys($this->engine_supported);\n }", "public function getAvailableManufacturers()\n {\n return self::$availableManufacturers;\n }", "public function getFamily() {}", "public function listOperatingSystems()\n {\n $response = $this->_performRequest(self::OP_OPERATINGSYSTEMS);\n\n \tif ($response->isSuccessful()) {\n\t\t\t$result = $this->_parseResponse($response);\n\n \t\tif (!$result->OperatingSystem) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t if (count($result->OperatingSystem) > 1) {\n \t\t $xmlServices = $result->OperatingSystem;\n \t\t} else {\n \t\t $xmlServices = [$result->OperatingSystem];\n \t\t}\n\n\t\t\t$services = [];\n\t\t\tif (!is_null($xmlServices)) {\n\n\t\t\t\tfor ($i = 0; $i < count($xmlServices); $i++) {\n\t\t\t\t\t$services[] = new Zend_Service_WindowsAzure_Management_OperatingSystemInstance(\n\t\t\t\t\t (string)$xmlServices[$i]->Version,\n\t\t\t\t\t (string)$xmlServices[$i]->Label,\n\t\t\t\t\t ((string)$xmlServices[$i]->IsDefault == 'true'),\n\t\t\t\t\t ((string)$xmlServices[$i]->IsActive == 'true'),\n\t\t\t\t\t (string)$xmlServices[$i]->Family,\n\t\t\t\t\t (string)$xmlServices[$i]->FamilyLabel\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $services;\n\t\t} else {\n\t\t\trequire_once 'Zend/Service/WindowsAzure/Management/Exception.php';\n\t\t\tthrow new Zend_Service_WindowsAzure_Management_Exception($this->_getErrorMessage($response, 'Resource could not be accessed.'));\n\t\t}\n }", "protected function getOperatingSystem() {}", "function fetch_os()\n\t{\n\t\t$useragent = strtolower($this->my_getenv('HTTP_USER_AGENT'));\n\t\t\n\t\tif ( strstr( $useragent, 'mac' ) )\n\t\t{\n\t\t\treturn 'mac';\n\t\t}\n\t\t\n\t\tif ( preg_match( '#wi(n|n32|ndows)#', $useragent ) )\n\t\t{\n\t\t\treturn 'windows';\n\t\t}\n\t\t\n\t\treturn 'unknown';\n\t}", "function getOS($userAgent) {\n // Create list of operating systems with operating system name as array key \n\t$oses = array (\n\t\t'iPhone' => '(iPhone)',\n\t\t'Windows 3.11' => 'Win16',\n\t\t'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', // Use regular expressions as value to identify operating system\n\t\t'Windows 98' => '(Windows 98)|(Win98)',\n\t\t'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',\n\t\t'Windows XP' => '(Windows NT 5.1)|(Windows XP)',\n\t\t'Windows 2003' => '(Windows NT 5.2)',\n\t\t'Windows Vista' => '(Windows NT 6.0)|(Windows Vista)',\n\t\t'Windows 7' => '(Windows NT 6.1)|(Windows 7)',\n\t\t'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',\n\t\t'Windows ME' => 'Windows ME',\n\t\t'Open BSD'=>'OpenBSD',\n\t\t'Sun OS'=>'SunOS',\n\t\t'Linux'=>'(Linux)|(X11)',\n\t\t'Safari' => '(Safari)',\n\t\t'Macintosh'=>'(Mac_PowerPC)|(Macintosh)',\n\t\t'QNX'=>'QNX',\n\t\t'BeOS'=>'BeOS',\n\t\t'OS/2'=>'OS/2',\n\t\t'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp/cat)|(msnbot)|(ia_archiver)'\n\t);\n\n\tforeach($oses as $os=>$pattern){ // Loop through $oses array\n // Use regular expressions to check operating system type\n\t\tif(eregi($pattern, $userAgent)) { // Check if a value in $oses array matches current user agent.\n\t\t\treturn $os; // Operating system was matched so return $oses key\n\t\t}\n\t}\n\treturn 'Unknown'; // Cannot find operating system so return Unknown\n}", "function getOS($request) {\n $user_agent = $request->server('HTTP_USER_AGENT');\n $os_platform = $user_agent . \" - Unknown OS Platform\";\n $os_array = array(\n '/windows nt 10/i' => 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n foreach ($os_array as $regex => $value)\n if (preg_match($regex, $user_agent))\n $os_platform = $value;\n return $os_platform;\n }", "public function getOperatingSystem() {\n\t\t$event = $this->Controller->Event->trigger('findOperatingSystem');\n\t\tif (isset($event['findOperatingSystem'][$this->Controller->plugin]) && is_string($event['findOperatingSystem'][$this->Controller->plugin])) {\n\t\t\treturn $event['findOperatingSystem'][$this->Controller->plugin];\n\t\t}\n\n\t\t$agent = env( 'HTTP_USER_AGENT' );\n\t\tConfigure::load('operating_systems');\n\t\t$operatingSystems = Configure::read('OperatingSystems');\n\n\t\tforeach ( $operatingSystems as $key => $value) {\n\t\t\tif ( preg_match( \"/$value/i\", $agent ) ) {\n\t\t\t\treturn $operatingSystems[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn 'Unknown';\n\t}", "public function getDeviceFamily()\n {\n return $this->device_family;\n }", "public static function findServerOS()\n {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n return 'WIN';\n }\n\n return 'LINUX';\n }", "private function lookupDistribution(): string\n {\n $res = self::$wmi->ExecQuery('SELECT * FROM Win32_OperatingSystem');\n\n foreach ($res as $os) {\n return $os->Caption;\n }\n\n return 'Windows NT';\n }", "public function getOSList()\n {\n $data = $this->doGet('compute/list/os');\n return collect($data['__data']);\n }", "static function getOS(){\n\t\trequire_once(\"knj/functions_array.php\");\n\t\t$bots = array(\n\t\t\t\"yahoo! slurp\",\n\t\t\t\"msnbot\",\n\t\t\t\"googlebot\",\n\t\t\t\"adsbot\",\n\t\t\t\"ask jeeves\",\n\t\t\t\"conpilot crawler\",\n\t\t\t\"yandex\",\n\t\t\t\"exabot\",\n\t\t\t\"hostharvest\",\n\t\t\t\"dotbot\",\n\t\t\t\"ia_archiver\",\n\t\t\t\"httpclient\",\n\t\t\t\"spider.html\",\n\t\t\t\"comodo-certificates-spider\",\n\t\t\t\"sbider\",\n\t\t\t\"speedy spider\",\n\t\t\t\"spbot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"scoutjet\",\n\t\t\t\"com_bot\",\n\t\t\t\"aihitbot\",\n\t\t\t\"robot.html\",\n\t\t\t\"robot.htm\",\n\t\t\t\"catchbot\",\n\t\t\t\"baiduspider\",\n\t\t\t\"setoozbot\",\n\t\t\t\"sslbot\",\n\t\t\t\"browsershots\",\n\t\t\t\"perl\",\n\t\t\t\"wget\",\n\t\t\t\"w3c_validator\"\n\t\t);\n\t\t\n\t\tif (array_key_exists(\"HTTP_USER_AGENT\", $_SERVER)){\n\t\t\t$ua = strtolower($_SERVER[\"HTTP_USER_AGENT\"]);\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t\t\n\t\tif (strpos($ua, \"windows\") !== false){\n\t\t\treturn \"windows\";\n\t\t}elseif(strpos($ua, \"linux\") !== false){\n\t\t\treturn \"linux\";\n\t\t}elseif(strpos($ua, \"mac\") !== false){\n\t\t\treturn \"mac\";\n\t\t}elseif(strpos($ua, \"playstation\") !== false){\n\t\t\treturn \"playstation\";\n\t\t}elseif(strpos($ua, \"nintendo wii\") !== false){\n\t\t\treturn \"wii\";\n\t\t}elseif(knjarray::stringsearch($ua, $bots)){\n\t\t\treturn \"bot\";\n\t\t}elseif(strpos($ua, \"sunos\") !== false){\n\t\t\treturn \"sun\";\n\t\t}elseif(trim($ua) == \"\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn \"unknown\";\n\t\t}\n\t}", "public function getProductFamily(array $parameters);", "function getOS() { \n\n $user_agent = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"UnknownOS\";\n\n $os_array = array(\n '/Windows Phone/i' => 'Windows Phone',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $user_agent)) {\n $os_platform = $value;\n }\n\n } \n\n return $os_platform;\n\n}" ]
[ "0.69905764", "0.6849564", "0.6609255", "0.65403044", "0.64711607", "0.6245432", "0.6210936", "0.61985224", "0.6037535", "0.6001642", "0.5962709", "0.595865", "0.5948134", "0.59306985", "0.5930036", "0.5875574", "0.58694535", "0.58492076", "0.58415836", "0.5793703", "0.57466567", "0.5668391", "0.5645018", "0.5595604", "0.55781734", "0.55764645", "0.55581105", "0.5552486", "0.55415946", "0.55308247" ]
0.7995154
0
Create request for operation 'createShippingQuote'.
public function createShippingQuoteRequest($x_ebay_c_marketplace_id, $shipping_quote_request) { // Verify the required parameter 'x_ebay_c_marketplace_id' is set. if ($x_ebay_c_marketplace_id === null || (\is_array($x_ebay_c_marketplace_id) && count($x_ebay_c_marketplace_id) === 0)) { throw new \InvalidArgumentException('Missing the required parameter $x_ebay_c_marketplace_id when calling createShippingQuote'); } // Verify the required parameter 'shipping_quote_request' is set. if ($shipping_quote_request === null || (\is_array($shipping_quote_request) && count($shipping_quote_request) === 0)) { throw new \InvalidArgumentException('Missing the required parameter $shipping_quote_request when calling createShippingQuote'); } $resourcePath = '/shipping_quote'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // header params if ($x_ebay_c_marketplace_id !== null) { $headerParams['X-EBAY-C-MARKETPLACE-ID'] = ObjectSerializer::toHeaderValue($x_ebay_c_marketplace_id); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/json'] ); } // For model (json/xml) if (isset($shipping_quote_request)) { if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($shipping_quote_request)); } else { $httpBody = $shipping_quote_request; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem, ]; } } // For HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // For HTTP post (form) $httpBody = ObjectSerializer::buildQuery($queryParams); } } // this endpoint requires OAuth (access token) if (! empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken(); } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'POST', $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createFromShippingQuoteRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createFromShippingQuote'\n );\n }\n\n $resourcePath = '/shipment/create_from_shipping_quote';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 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\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getShippingQuoteRequest($shipping_quote_id)\n {\n // Verify the required parameter 'shipping_quote_id' is set.\n if ($shipping_quote_id === null || (\\is_array($shipping_quote_id) && count($shipping_quote_id) === 0)) {\n throw new \\InvalidArgumentException('Missing the required parameter $shipping_quote_id when calling getShippingQuote');\n }\n\n $resourcePath = '/shipping_quote/{shippingQuoteId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($shipping_quote_id !== null) {\n $resourcePath = str_replace(\n '{shippingQuoteId}',\n ObjectSerializer::toPathValue($shipping_quote_id),\n $resourcePath\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 []\n );\n }\n\n // For model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\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\n // For HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // For HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($queryParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\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 = ObjectSerializer::buildQuery($queryParams);\n\n return new Request(\n 'GET',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function createShipmentRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createShipment'\n );\n }\n\n $resourcePath = '/shipping/v1/shipments';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createQuote()\n\t{\n\t\t$this->setType($_POST['frmquotetype']);\n\t\t$this->setDate($_POST['frmquotedate']);\n\t\t$this->setStatus('Open');\n\t\t$this->setJobName($_POST['frmjobname']);\n\t\t$this->setJobAddress($_POST['frmjobaddress']);\n\t\t$this->setJobCity($_POST['frmjobcity']);\n\t\t$this->setJobZipcode($_POST['frmjobzipcode']);\n\t\t$this->setAttention($_POST['frmattn']);\n\t\t// Here we are going to post the tax rate and turn it into a float.\n\t\t$unformatted_tax_rate = $_POST['frmtaxrate'];\n\t\t$this->setTaxRate((float)$unformatted_tax_rate);\n\t\t$this->setCostBeforeTax($_POST['cartBeforeTaxCost']);\n\t\t$this->setTotalCost($_POST['cartTotalCost']);\n\t\t$this->setSalesTax($_POST['cartTax']);\n\t\t$this->setMonthlyTotal($_POST['cartMonthlyTotal']);\n\t\t$this->setDeliveryTotal($_POST['cartDeliveryTotal']);\n\t\t$this->setHidden(null);\n\n\t\t// Need to insert the new order into the database.\n\t\t$this->getDB()->insert('quotes', [\n\t\t\t\t'quote_customer' \t\t=> $this->getCustomer(),\n\t\t\t\t'quote_customer_id' \t=> $this->getCustomerId(),\n\t\t\t\t'quote_date' \t\t\t=> $this->getDate(),\n\t\t\t\t'quote_status' \t\t\t=> $this->getStatus(),\n\t\t\t\t'quote_type' \t\t\t=> $this->getType(),\n\t\t\t\t'job_name' \t\t\t\t=> $this->getJobName(),\n\t\t\t\t'job_city' \t\t\t\t=> $this->getJobCity(),\n\t\t\t\t'job_address' \t\t\t=> $this->getJobAddress(),\n\t\t\t\t'job_zipcode' \t\t\t=> $this->getJobZipcode(),\n\t\t\t\t'attn' \t\t\t\t\t=> $this->getAttention(),\n\t\t\t\t'tax_rate' \t\t\t\t=> $this->getTaxRate(),\n\t\t\t\t'cost_before_tax' \t\t=> $this->getCostBeforeTax(),\n\t\t\t\t'total_cost' \t\t\t=> $this->getTotalCost(),\n\t\t\t\t'sales_tax' \t\t\t=> $this->getSalesTax(),\n\t\t\t\t'monthly_total' \t\t=> $this->getMonthlyTotal(),\n\t\t\t\t'delivery_total'\t\t=> $this->getDeliveryTotal(),\n\t\t\t\t'hidden'\t\t\t\t=> $this->getHidden()\n\t\t\t]);\n\n\t\t// If properly inserted, grab the ID, else throw error.\n\t\tif($this->getDB()->lastId() != null)\n\t\t{\n\t\t\t$this->id = $this->getDB()->lastId();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tthrow new Exception(\"There was an error inserting the quote into the database.\");\n\t\t}\n\t\t\n\t}", "protected function purchaseShipmentRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling purchaseShipment'\n );\n }\n\n $resourcePath = '/shipping/v1/purchaseShipment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function createQuote()\n {\n $isRegular = true;\n $negotiableQuote =\n $this->createPartialMock(\\Magento\\NegotiableQuote\\Model\\NegotiableQuote::class, ['getIsRegularQuote']);\n $negotiableQuote->expects($this->any())\n ->method('getIsRegularQuote')\n ->will($this->returnValue($isRegular));\n $extension = $this->getMockForAbstractClass(\n \\Magento\\Quote\\Api\\Data\\CartExtensionInterface::class,\n [],\n '',\n false,\n false,\n true,\n ['getNegotiableQuote']\n );\n $extension->expects($this->any())\n ->method('getNegotiableQuote')\n ->willReturn($negotiableQuote);\n $this->quote = $this->getMockForAbstractClass(\n \\Magento\\Quote\\Api\\Data\\CartInterface::class,\n ['getExtensionAttributes', 'getId'],\n '',\n false,\n false,\n true,\n ['getAppliedRuleIds']\n );\n $this->quote->expects($this->any())\n ->method('getExtensionAttributes')\n ->willReturn($extension);\n $this->quote->expects($this->any())\n ->method('getAppliedRuleIds')\n ->will($this->returnValue('1'));\n $this->quoteRepository->expects($this->any())\n ->method('get')\n ->willReturn($this->quote);\n }", "function create() {\n\n if ( ! authCheck(['salesperson', 'manager']) ) {\n\n return json_encode(['success' => false, 'authorised' => false]);\n\n } else {\n\n $requestBody = file_get_contents('php://input');\n $data = json_decode($requestBody);\n\n // make quote\n $quote = new \\App\\Quote;\n $quote->owner = $_COOKIE['userid'];\n $quote->customer_name = getPropertySafely($data, 'customer_name');\n $quote->address = getPropertySafely($data, 'address');\n $quote->date = (getPropertySafely($data, 'date')) ? getPropertySafely($data, 'date') . ' 00:00:00': '1970-01-01 00:00:00';\n $quote->appointment_number = getPropertySafely($data, 'appointment_number');\n $quote->product_price = getPropertySafely($data, 'total_product_price');\n $quote->installation_price = getPropertySafely($data, 'total_installation_price');\n $quote->cost_price = getPropertySafely($data, 'total_price');\n $quote->save();\n $quoteId = $quote->id;\n\n foreach($data->products as $productName => $product) {\n\n foreach ($product as $rowId => $row) {\n\n // make quote product (\"Item\")\n $quoteProduct = new \\App\\QuoteProduct;\n $quoteProduct->quote_id = $quoteId;\n $quoteProduct->product = $productName;\n $quoteProduct->row = $rowId;\n $quoteProduct->save();\n $quoteProductId = $quoteProduct->id;\n\n foreach ($row as $settingName => $value) {\n\n // make quote product setting (could specify product to remove quote products table)\n $qpSetting = new \\App\\QuoteProductSetting;\n $qpSetting->quote_id = $quoteId;\n $qpSetting->quote_product_id = $quoteProductId;\n $qpSetting->setting = $settingName;\n if ($settingName == \"location\" || $settingName == \"description\" ) {\n $qpSetting->valueString = $value;\n } else {\n $qpSetting->value = $value;\n }\n $qpSetting->save();\n\n }\n }\n }\n\n //die();\n \n return json_encode(['success' => true, 'id' => $quoteId]);\n }\n }", "public function newQuote($options = array())\n {\n return $this->newItem('quote', 'quotes', $options);\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\n }", "public function create_order( $args = array() )\n {\n return $this->_request('createorder', $args);\n }", "public function store(Request $request)\n {\n $quote = Quote::create($request->only('name', 'quote'));\n return $quote;\n }", "protected function getShippingMethodsRequest()\n {\n $resourcePath = '/shipping-methods';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function create()\n {\n return view(\"admin.shipping-management.create-shipping\",[\"shipping\" => false]);\n \n }", "protected function createOrderRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createOrder'\n );\n }\n $resourcePath = '/orders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\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 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\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function store(CreateShippingAddressRequests $request)\n {\n try {\n $userId = Auth::id();\n $shipping = ShippingAddress::create([\n 'user_id' => $userId,\n 'address' => $request->address,\n 'is_default' => ShippingAddress::ADDRESS,\n ]);\n return $this->successResponse($shipping->load('user'), Response::HTTP_OK);\n } catch (Exception $e) {\n return $this->errorResponse(trans('errors.create_fail'), Response::HTTP_UNPROCESSABLE_ENTITY);\n }\n }", "protected function craeteQuoteOrder(Request $request, Address $shippingBilling, Address $pickup, $quote)\n {\n $total = $quote->quoteItems()->sum('estimate_price');\n $couponDiscount = $coupon = $couponValidity = null;\n if ($quote->supplier_type == \"companies\") {\n $data = array_merge(\n $request->only([\n 'delivery_date', 'delivery_time', 'pickup_time', 'delivery_note', 'pickup_date', 'pickup_note', 'package_id', 'sales_rep'\n ]),\n [\n 'company_id' => $quote->supplier_id,\n 'billing_addr_id' => $shippingBilling->id,\n 'shipping_addr_id' => $shippingBilling->id,\n 'pickup_addr_id' => $pickup->id,\n 'order_no' => $this->orderNo(),\n 'order_status' => 'converted',\n 'amount' => $total,\n 'package_amount' => $total,\n 'sales_rep' => $request->sales_rep ?: \"\",\n 'delivery_charge' => $request->input('delivery_appartment', 0),\n 'pickup_charge' => $request->input('pickup_appartment', 0)\n ]\n );\n } else {\n $data = array_merge(\n $request->only([\n 'delivery_date', 'delivery_time', 'pickup_time', 'delivery_note', 'pickup_date', 'pickup_note', 'package_id', 'sales_rep'\n ]),\n [\n 'client_id' => $quote->supplier_id,\n 'billing_addr_id' => $shippingBilling->id,\n 'shipping_addr_id' => $shippingBilling->id,\n 'pickup_addr_id' => $pickup->id,\n 'order_no' => $this->orderNo(),\n 'amount' => $total,\n 'package_amount' => $total,\n 'order_status' => 'converted',\n 'sales_rep' => $request->sales_rep ?: \"\",\n 'delivery_charge' => $request->input('delivery_appartment', 0),\n 'pickup_charge' => $request->input('pickup_appartment', 0)\n ]\n );\n }\n $order = Order::create($data);\n $this->orderQuoteItems($order, $quote->quoteItems);\n\n //Create invoice\n // $invoice = $this->invoice($data, $order);\n $invoice = $this->reInvoice($data, $order, $quote);\n $this->quoteInvoiceItems($invoice, $quote->quoteItems);\n $this->invoiceShippings($request, $invoice);\n return $order;\n }", "public function store(CreateQuoteRequest $request)\n {\n $quote = Quote::create($request->all());\n\n return redirect()->route('gjadmin.quotes.index');\n }", "public function createInvoice($quote)\n {\n $this->clearSessionData();\n if (get_class($quote) == \"Mage_Sales_Model_Quote\") {\n $array_key = \"quoteId\";\n $currency_code_key = \"quote_currency_code\";\n } else {\n $array_key = \"orderId\";\n $currency_code_key = \"order_currency_code\";\n }\n $base_price = $quote->getData(\"grand_total\");\n $base_ccy = $quote->getData($currency_code_key);\n $quote_id = $quote->getData(\"entity_id\");\n\n /// create the ipn url based on the site configuration\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => true, \"id\" => base64_encode($quote_id)));\n }else{\n $ipnUrl = Mage::getUrl(\"bitcoin/index/ipn\", array(\"_secure\" => false, \"id\" => base64_encode($quote_id)));\n }\n $this->log( \"GENERATED IPN URL : \" . $ipnUrl);\n $http_client = $this->getHTTPClient();\n $yellow_payment_data = array(\n \"base_price\" => $base_price, /// Set to 0.30 for testing\n \"base_ccy\" => $base_ccy, /// Set to \"USD\" for testing\n \"callback\" => $ipnUrl\n );\n $post_body = json_encode($yellow_payment_data);\n $nonce = round(microtime(true) * 1000);\n $url = $this->server_root . $this->api_uri_create_invoice;\n $message = $nonce . $url . $post_body;\n $private_key = Mage::helper('core')->decrypt($this->getConfiguration(\"private_key\"));\n $hash = hash_hmac(\"sha256\", $message, $private_key, false);\n\n $http_client->setHeaders($this->getHeaders($nonce, $hash));\n $http_client->setMethod(\"POST\")\n ->setUri($url);\n $http_client->setRawData($post_body);\n try {\n $response = $http_client->request();\n if ($response->getStatus() == \"200\") {\n $body = $response->getBody();\n $data = json_decode($body, true);\n $this->log(\"Response: \" . $response, $data[\"id\"]);\n /* save the invoice in the database */\n $invoice_data = array(\n $array_key => $quote_id,\n \"invoice_id\" => $data[\"id\"],\n \"url\" => $data[\"url\"],\n \"status\" => $data[\"status\"],\n \"address\" => $data[\"address\"],\n \"invoice_price\" => $data[\"invoice_price\"],\n \"invoice_ccy\" => $data[\"invoice_ccy\"],\n \"server_time\" => $data[\"server_time\"],\n \"expiration_time\" => $data[\"expiration\"],\n \"raw_body\" => $yellow_payment_data,\n \"base_price\" => $yellow_payment_data[\"base_price\"],\n \"base_ccy\" => $yellow_payment_data[\"base_ccy\"],\n \"hash\" => $hash\n );\n /// replace https with http on the invoice url in case the store doesn't have ssl certificate\n $helper = Mage::helper(\"bitcoin\");\n if(!$helper->doesTheStoreHasSSL())\n {\n $invoice_data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n $data[\"url\"] = $helper->replaceHttps($data[\"url\"]);\n }\n\n Mage::getModel(\"bitcoin/ipn\")->saveInvoice($invoice_data);\n /* end saving invoice */\n Mage::getSingleton('core/session')->setData('invoice', $data);\n Mage::getSingleton('core/session')->setData('has_invoice', true);\n return $data;\n } else {\n Mage::throwException($response->getBody());\n $this->log(\"Error code response received: {$response->getStatus()}\", $array_key . \":\" . $quote_id);\n $this->log(\"Response body:\" . json_encode($response->getBody()), $array_key . \":\" . $quote_id);\n return false;\n }\n } catch (Exception $exc) {\n $this->log($exc->getMessage(), $array_key . \":\" . $quote_id);\n $this->log(\"EXCEPTION: \" . json_encode($exc), $array_key . \":\" . $quote_id);\n Mage::throwException(\n Mage::helper('bitcoin')->__(\n \"{$exc->getMessage()}\\n We're sorry, an error has occurred while completing your request. Please refresh the page to try again. If the error persists, please send us an email at [email protected]\"\n )\n );\n }\n }", "public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }", "public function getCreateQuoteModel()\n {\n return $this->_quoteCreate;\n }", "public function makeQuoteOrder(Request $request, Quote $quote)\n {\n \\DB::beginTransaction();\n try {\n $order = $this->craeteQuoteOrder(\n $request,\n $this->quoteShippingAddress($request, $quote),\n $this->quotePickupAddress($request, $quote),\n $quote\n );\n\n \\DB::commit();\n return response()->json([\n \"message\" => \"Order Added Successfully.\",\n \"data\" => $order\n ]);\n } catch (\\Exception $e) {\n \\DB::rollBack();\n return response([\"message\" => $e->getMessage()], 500);\n }\n }", "public static function create(array $options)\n {\n static::guardAgainstMissingRequirements($options);\n\n $options = static::setImplicitDefaults($options);\n\n $packages = static::buildPackages($options);\n\n $shipper = ShipperFactory::create($options['from']);\n\n $shipTo = ShipToFactory::create($options['to']);\n\n $service = new Service($options['service']);\n\n $rateInformation = new RateInformation($options['negotiatedRates']);\n\n return new Shipment($options['description'], $shipper, $shipTo, $service, $rateInformation, $packages);\n }", "public function sCreateTemporaryOrder()\n {\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ? $this->sShippingData['AmountNumeric'] : '0';\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n $net = '0';\n if ($this->isTaxFree(\n $this->sSYSTEM->sUSERGROUPDATA['tax'],\n $this->sSYSTEM->sUSERGROUPDATA['id']\n )) {\n $net = '1';\n }\n\n $dispatchId = '0';\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n if (empty($this->sBasketData['AmountWithTaxNumeric'])) {\n $this->sBasketData['AmountWithTaxNumeric'] = '0';\n }\n if (empty($this->sBasketData['AmountNetNumeric'])) {\n $this->sBasketData['AmountNetNumeric'] = '0';\n }\n\n $data = [\n 'ordernumber' => '0',\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => $this->sShippingcostsNumericNet,\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'status' => -1,\n 'paymentID' => $this->getPaymentId(),\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $this->getSession()->offsetGet('sPartner'),\n 'temporaryID' => $this->getSession()->offsetGet('sessionId'),\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'deviceType' => $this->deviceType,\n ];\n\n try {\n $affectedRows = $this->db->insert('s_order', $data);\n $orderID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf('##sOrder-sTemporaryOrder-#01:%s', $e->getMessage()), 0, $e);\n }\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception('##sOrder-sTemporaryOrder-#01: No rows affected or no order id saved', 0);\n }\n\n // Create order attributes\n $this->attributePersister->persist($this->orderAttributes, 's_order_attributes', $orderID);\n\n foreach ($this->sBasketData['content'] as $basketRow) {\n if (!$basketRow['price']) {\n $basketRow['price'] = '0,00';\n }\n\n $basketRow['articlename'] = html_entity_decode($basketRow['articlename']);\n $basketRow['articlename'] = strip_tags($basketRow['articlename']);\n\n $basketRow['articlename'] = $this->sSYSTEM->sMODULES['sArticles']->sOptimizeText($basketRow['articlename']);\n\n if (!$basketRow['esdarticle']) {\n $basketRow['esdarticle'] = '0';\n }\n if (!$basketRow['modus']) {\n $basketRow['modus'] = '0';\n }\n if (!$basketRow['taxID']) {\n $basketRow['taxID'] = '0';\n }\n if (!$basketRow['releasedate']) {\n $basketRow['releasedate'] = '0000-00-00';\n }\n\n $data = [\n 'orderID' => $orderID,\n 'ordernumber' => 0,\n 'articleID' => $basketRow['articleID'],\n 'articleDetailID' => $basketRow['additional_details']['articleDetailsID'],\n 'articleordernumber' => $basketRow['ordernumber'],\n 'price' => $basketRow['priceNumeric'],\n 'quantity' => $basketRow['quantity'],\n 'name' => $basketRow['articlename'],\n 'status' => 0,\n 'releasedate' => $basketRow['releasedate'],\n 'modus' => $basketRow['modus'],\n 'esdarticle' => $basketRow['esdarticle'],\n 'taxID' => $basketRow['taxID'],\n 'tax_rate' => $basketRow['tax_rate'],\n ];\n\n try {\n $this->db->insert('s_order_details', $data);\n $orderDetailId = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(\n sprintf('##sOrder-sTemporaryOrder-Position-#02:%s', $e->getMessage()),\n 0,\n $e\n );\n }\n\n // Create order detail attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderDetailId);\n } // For every product in basket\n }", "public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}", "public function create()\n {\n return view('backend.shipping.create');\n }", "public function query(QueryServiceQuotesRequest $request)\n {\n $payload = $request->input('payload');\n $currency = $request->input('currency');\n $facilitator = $request->input('facilitator');\n $scheduledAt = $request->input('scheduled_at');\n $service = $request->input('service', 'all'); // the specific service rate to query - defaults to `all`\n $serviceType = $request->input('service_type'); // the specific type of service rate to query\n $single = $request->boolean('single');\n $isRouteOptimized = $request->boolean('is_route_optimized', true);\n $requestId = ServiceQuote::generatePublicId('request');\n\n if (Utils::isPublicId($payload)) {\n $payload = Payload::with(['pickup', 'dropoff', 'waypoints', 'entities'])\n ->where('public_id', $payload)\n ->first();\n }\n\n if (!$payload instanceof Payload) {\n return $this->queryFromPreliminary($request);\n }\n\n // if facilitator is an integrated partner resolve service quotes from bridge\n if ($facilitator && Str::startsWith($facilitator, 'integrated_vendor')) {\n $integratedVendor = IntegratedVendor::where('public_id', $facilitator)->first();\n $serviceQuotes = [];\n\n if ($integratedVendor) {\n try {\n $serviceQuotes = $integratedVendor->api()->setRequestId($requestId)->getQuoteFromPayload($payload, $serviceType, $scheduledAt, $isRouteOptimized);\n } catch (\\Exception $e) {\n return response()->json([\n 'errors' => [$e->getMessage()]\n ], 400);\n }\n }\n\n // send single quote back\n if ($single) {\n return new ServiceQuoteResource($serviceQuotes);\n }\n\n if (!is_array($serviceQuotes)) {\n $serviceQuotes = [$serviceQuotes];\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n\n // get all waypoints\n $waypoints = $payload->getAllStops()->mapInto(Place::class);\n\n // if quote for single service\n if ($service && $service !== 'all') {\n $serviceRate = ServiceRate::where('uuid', $service)->where(function ($q) use ($currency) {\n if ($currency) {\n $q->where(DB::raw(\"lower(currency)\"), strtolower($currency));\n }\n })->first();\n $serviceQuotes = collect();\n\n if ($serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n\n // if single quotation requested\n if ($single) {\n return new ServiceQuoteResource($quote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n }\n\n // get all service rates\n $serviceRates = ServiceRate::getServicableForPlaces(\n $waypoints,\n $serviceType,\n $currency,\n function ($query) use ($request) {\n $query->where('company_uuid', $request->session()->get('company'));\n }\n );\n $serviceQuotes = collect();\n\n // calculate quotes\n foreach ($serviceRates as $serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n }\n\n // if single quotation requested\n if ($single) {\n // find the best quotation\n $bestQuote = $serviceQuotes->sortBy('amount')->first();\n\n return new ServiceQuoteResource($bestQuote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }", "protected function getAccountRequest()\n {\n\n $resourcePath = '/shipping/v1/account';\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\\build_query($formParams);\n }\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'GET', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "private function _generateShippingData(){\n \n $shipping = new PagSeguroShipping();\n $shipping->setAddress($this->_generateShippingAddressData());\n $shipping->setType($this->_generateShippingType());\n $shipping->setCost(number_format($this->context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING), 2));\n \n return $shipping;\n }", "public function createShippingInfo(array $parameters = []) {\n return $this->oauth()->requestObject('POST', '/listings/:listing_id/shipping/info', $parameters);\n }", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }" ]
[ "0.7238129", "0.6566285", "0.60706496", "0.6030362", "0.5712165", "0.5692138", "0.56609404", "0.5478283", "0.5444429", "0.5417243", "0.5377607", "0.53761643", "0.5329675", "0.5310164", "0.53094894", "0.5297839", "0.529622", "0.5292557", "0.52867323", "0.52506346", "0.5237196", "0.52229", "0.5203298", "0.520044", "0.51776963", "0.5170285", "0.5160907", "0.5145728", "0.5136614", "0.5129698" ]
0.7237792
1
Create request for operation 'getShippingQuote'.
public function getShippingQuoteRequest($shipping_quote_id) { // Verify the required parameter 'shipping_quote_id' is set. if ($shipping_quote_id === null || (\is_array($shipping_quote_id) && count($shipping_quote_id) === 0)) { throw new \InvalidArgumentException('Missing the required parameter $shipping_quote_id when calling getShippingQuote'); } $resourcePath = '/shipping_quote/{shippingQuoteId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // path params if ($shipping_quote_id !== null) { $resourcePath = str_replace( '{shippingQuoteId}', ObjectSerializer::toPathValue($shipping_quote_id), $resourcePath ); } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], [] ); } // For model (json/xml) if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; foreach ($formParamValueItems as $formParamValueItem) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValueItem, ]; } } // For HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // For HTTP post (form) $httpBody = ObjectSerializer::buildQuery($queryParams); } } // this endpoint requires OAuth (access token) if (! empty($this->config->getAccessToken())) { $headers['Authorization'] = 'Bearer '.$this->config->getAccessToken(); } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = ObjectSerializer::buildQuery($queryParams); return new Request( 'GET', $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), $headers, $httpBody ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createShippingQuoteRequest($x_ebay_c_marketplace_id, $shipping_quote_request)\n {\n // Verify the required parameter 'x_ebay_c_marketplace_id' is set.\n if ($x_ebay_c_marketplace_id === null || (\\is_array($x_ebay_c_marketplace_id) && count($x_ebay_c_marketplace_id) === 0)) {\n throw new \\InvalidArgumentException('Missing the required parameter $x_ebay_c_marketplace_id when calling createShippingQuote');\n }\n // Verify the required parameter 'shipping_quote_request' is set.\n if ($shipping_quote_request === null || (\\is_array($shipping_quote_request) && count($shipping_quote_request) === 0)) {\n throw new \\InvalidArgumentException('Missing the required parameter $shipping_quote_request when calling createShippingQuote');\n }\n\n $resourcePath = '/shipping_quote';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // header params\n if ($x_ebay_c_marketplace_id !== null) {\n $headerParams['X-EBAY-C-MARKETPLACE-ID'] = ObjectSerializer::toHeaderValue($x_ebay_c_marketplace_id);\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // For model (json/xml)\n if (isset($shipping_quote_request)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($shipping_quote_request));\n } else {\n $httpBody = $shipping_quote_request;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n\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\n // For HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n } else {\n // For HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($queryParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\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 = ObjectSerializer::buildQuery($queryParams);\n\n return new Request(\n 'POST',\n $this->config->getHost().$resourcePath.($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function createFromShippingQuoteRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createFromShippingQuote'\n );\n }\n\n $resourcePath = '/shipment/create_from_shipping_quote';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 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\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getShippingMethodsRequest()\n {\n $resourcePath = '/shipping-methods';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getQuote($request)\n {\n\n // $this->quoteAPIController->getQuote($request);\n // $this->quoteAPIController->getBoundaryQuotes($request);\n }", "protected function getAccountRequest()\n {\n\n $resourcePath = '/shipping/v1/account';\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\\build_query($formParams);\n }\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'GET', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getOrderShipping()\n {\n $model = $this->getOrder() ?: $this->getQuote();\n\n $shippingDetail = new OrderShipping();\n\n $address = $model->getShippingAddress();\n $isPickup = $model->getIsVirtual() || $address == null;\n $shippingDetail->setPickup($isPickup);\n $region = $address->getRegion();\n\n if (!$isPickup) {\n $shippingAddress = new Address();\n\n $shippingAddress\n ->setFirstName($address->getFirstName())\n ->setLastName($address->getLastName())\n ->setLine1($address->getStreet1())\n ->setLine2($address->getStreet2())\n ->setCountry($address->getCountryId())\n ->setPostalCode($address->getPostcode())\n ->setState(empty($region) ? $address->getCity() : $region)\n ->setCity($address->getCity());\n\n $shippingDetail->setAddress($shippingAddress);\n\n // TODO: implementation for tracking\n // $shippingDetail->setTracking()\n }\n\n return $shippingDetail;\n }", "public function getTransferwiseQuote(Request $request){\n $source = $request->get('source');\n $target = $request->get('target');\n $amount = $request->get('amount');\n\n // Call Transferwise API to get temporary quotes\n $result = Transferwise::temporaryQuotes($source, $target, $amount);\n\n // Return response\n if($result){\n // Success\n if(empty($result['errors'])){\n $response = [\n 'status' => [\n 'code' => 0,\n 'message' => 'OK'\n ],\n 'data' =>[\n 'fee' => $result['fee'],\n 'targetAmount' => $result['targetAmount'],\n 'sourceAmount' => $result['sourceAmount'],\n ]\n ];\n // Get error result from Transferwise API\n }else{\n $response = [\n 'status' => [\n 'code' => 1,\n 'message' => $result['errors'][0]['message']\n ]\n ];\n }\n // Cant get result from Transferwise\n }else{\n $response = [\n 'status' => [\n 'code' => 2,\n 'message' => \"Can't get result from Transferwise\"\n ]\n ];\n }\n\n return response()->json($response);\n }", "public function query(QueryServiceQuotesRequest $request)\n {\n $payload = $request->input('payload');\n $currency = $request->input('currency');\n $facilitator = $request->input('facilitator');\n $scheduledAt = $request->input('scheduled_at');\n $service = $request->input('service', 'all'); // the specific service rate to query - defaults to `all`\n $serviceType = $request->input('service_type'); // the specific type of service rate to query\n $single = $request->boolean('single');\n $isRouteOptimized = $request->boolean('is_route_optimized', true);\n $requestId = ServiceQuote::generatePublicId('request');\n\n if (Utils::isPublicId($payload)) {\n $payload = Payload::with(['pickup', 'dropoff', 'waypoints', 'entities'])\n ->where('public_id', $payload)\n ->first();\n }\n\n if (!$payload instanceof Payload) {\n return $this->queryFromPreliminary($request);\n }\n\n // if facilitator is an integrated partner resolve service quotes from bridge\n if ($facilitator && Str::startsWith($facilitator, 'integrated_vendor')) {\n $integratedVendor = IntegratedVendor::where('public_id', $facilitator)->first();\n $serviceQuotes = [];\n\n if ($integratedVendor) {\n try {\n $serviceQuotes = $integratedVendor->api()->setRequestId($requestId)->getQuoteFromPayload($payload, $serviceType, $scheduledAt, $isRouteOptimized);\n } catch (\\Exception $e) {\n return response()->json([\n 'errors' => [$e->getMessage()]\n ], 400);\n }\n }\n\n // send single quote back\n if ($single) {\n return new ServiceQuoteResource($serviceQuotes);\n }\n\n if (!is_array($serviceQuotes)) {\n $serviceQuotes = [$serviceQuotes];\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n\n // get all waypoints\n $waypoints = $payload->getAllStops()->mapInto(Place::class);\n\n // if quote for single service\n if ($service && $service !== 'all') {\n $serviceRate = ServiceRate::where('uuid', $service)->where(function ($q) use ($currency) {\n if ($currency) {\n $q->where(DB::raw(\"lower(currency)\"), strtolower($currency));\n }\n })->first();\n $serviceQuotes = collect();\n\n if ($serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n\n // if single quotation requested\n if ($single) {\n return new ServiceQuoteResource($quote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }\n }\n\n // get all service rates\n $serviceRates = ServiceRate::getServicableForPlaces(\n $waypoints,\n $serviceType,\n $currency,\n function ($query) use ($request) {\n $query->where('company_uuid', $request->session()->get('company'));\n }\n );\n $serviceQuotes = collect();\n\n // calculate quotes\n foreach ($serviceRates as $serviceRate) {\n [$subTotal, $lines] = $serviceRate->quote($payload);\n\n $quote = ServiceQuote::create([\n 'request_id' => $requestId,\n 'company_uuid' => $serviceRate->company_uuid,\n 'service_rate_uuid' => $serviceRate->uuid,\n 'amount' => $subTotal,\n 'currency' => $serviceRate->currency,\n ]);\n\n $items = $lines->map(function ($line) use ($quote) {\n return ServiceQuoteItem::create([\n 'service_quote_uuid' => $quote->uuid,\n 'amount' => $line['amount'],\n 'currency' => $line['currency'],\n 'details' => $line['details'],\n 'code' => $line['code'],\n ]);\n });\n\n $quote->setRelation('items', $items);\n $serviceQuotes->push($quote);\n }\n\n // if single quotation requested\n if ($single) {\n // find the best quotation\n $bestQuote = $serviceQuotes->sortBy('amount')->first();\n\n return new ServiceQuoteResource($bestQuote);\n }\n\n return ServiceQuoteResource::collection($serviceQuotes);\n }", "public function quotations()\n {\n if (! $this->isValid()) {\n throw new ShippingException(\"This shipping was not filled correctly\", 1);\n }\n\n if (! $this->response) {\n $request = $this->newRequest(static::$token);\n $this->response = $request->consultShipping($this->toJson());\n $this->quotation_token = $this->response->getQuotationToken();\n }\n\n return $this->response->quotations();\n }", "protected function purchaseShipmentRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling purchaseShipment'\n );\n }\n\n $resourcePath = '/shipping/v1/purchaseShipment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getShippingTrackingTypesRequest()\n {\n $resourcePath = '/shipping-tracking-types';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function createShipmentRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling createShipment'\n );\n }\n\n $resourcePath = '/shipping/v1/shipments';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getQuote()\n {\n return $this->quoteFactory->create()->load($this->getReservedOrderId(), 'reserved_order_id');\n }", "public function getShipping();", "private function getQuoteShippingAddress()\n {\n $shippingAddressData = null;\n\n if ($this->getQuoteId() === null) {\n return $shippingAddressData;\n }\n\n $quote = null;\n\n try {\n $quote = $this->quoteRepository->get($this->getQuoteId(), ['*']);\n } catch (NoSuchEntityException $e) {\n // If no such entity, skip\n }\n\n if ($quote !== null && $quote->getShippingAddress() !== null\n && $quote->getShippingAddress()->getCustomerAddressId() !== null\n ) {\n $shippingAddressData = $quote->getShippingAddress()->getData();\n }\n\n return $shippingAddressData;\n }", "protected function _buildRequest()\n {\n // prepare API\n $this->setShippingMethod('Other');\n $this->setCustomerIP(Mage::helper('core/http')->getRemoteAddr());\n $version = Mage::helper('ewayrapid')->getExtensionVersion();\n $this->setDeviceID('Magento ' . Mage::getEdition() . ' ' . Mage::getVersion().' - eWAY '.$version);\n if (Mage::helper('ewayrapid')->isBackendOrder()) {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_MOTO);\n } else {\n $this->setTransactionType(Eway_Rapid31_Model_Config::TRANSACTION_PURCHASE);\n }\n $this->setCustomerReadOnly(true);\n\n // add Billing Address\n $billingAddress = $this->_quote->getBillingAddress();\n $customerParam = Mage::getModel('ewayrapid/field_customer');\n \n $title = $this->_fixTitle($billingAddress->getPrefix());\n \n $customerParam->setTitle($title)\n ->setFirstName($billingAddress->getFirstname())\n ->setLastName($billingAddress->getLastname())\n ->setCompanyName($billingAddress->getCompany())\n ->setJobDescription($billingAddress->getJobDescription())\n ->setStreet1($billingAddress->getStreet1())\n ->setStreet2($billingAddress->getStreet2())\n ->setCity($billingAddress->getCity())\n ->setState($billingAddress->getRegion())\n ->setPostalCode($billingAddress->getPostcode())\n ->setCountry(strtolower($billingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($billingAddress->getEmail())\n ->setPhone($billingAddress->getTelephone())\n ->setMobile($billingAddress->getMobile())\n ->setComments('')\n ->setFax($billingAddress->getFax())\n ->setUrl('');\n $this->setCustomer($customerParam);\n\n // add Shipping Address\n $shippingAddress = $this->_quote->getShippingAddress();\n\n // copy BillingAddress to ShippingAddress if checkout with guest or register\n $checkoutMethod = $this->_quote->getCheckoutMethod();\n if ($checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_GUEST\n || $checkoutMethod == Mage_Checkout_Model_Type_Onepage::METHOD_REGISTER\n ) {\n $shippingAddress = $billingAddress;\n }\n\n $shippingParam = Mage::getModel('ewayrapid/field_shippingAddress');\n $shippingParam->setFirstName($shippingAddress->getFirstname())\n ->setLastName($shippingAddress->getLastname())\n ->setStreet1($shippingAddress->getStreet1())\n ->setStreet2($shippingAddress->getStreet2())\n ->setCity($shippingAddress->getCity())\n ->setState($shippingAddress->getRegion())\n ->setPostalCode($shippingAddress->getPostcode())\n ->setCountry(strtolower($shippingAddress->getCountryModel()->getIso2Code()))\n ->setEmail($shippingAddress->getEmail())\n ->setPhone($shippingAddress->getTelephone())\n ->setFax($shippingAddress->getFax());\n $this->setShippingAddress($shippingParam);\n\n return $this;\n }", "public function get(array $extraParam = null)\n {\n $endpoint = 'shipments';\n\n if ($extraParam) {\n $endpoint = $endpoint . '?' . http_build_query($extraParam);\n }\n\n return $this->getRequest($endpoint);\n }", "private function _generateShippingData(){\n \n $shipping = new PagSeguroShipping();\n $shipping->setAddress($this->_generateShippingAddressData());\n $shipping->setType($this->_generateShippingType());\n $shipping->setCost(number_format($this->context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING), 2));\n \n return $shipping;\n }", "protected function getRatesRequest($body)\n {\n // verify the required parameter 'body' is set\n if ($body === null || (is_array($body) && count($body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $body when calling getRates'\n );\n }\n\n $resourcePath = '/shipping/v1/rates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($body)) {\n $_tempBody = $body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n\n $sign = new SignatureSellingPartner();\n $headersX = $sign->calculateSignature($this->config->getApiKey(\"accessKey\"),\n $this->config->getApiKey(\"secretKey\"), $this->config->getApiKey(\"region\"),\n $this->config->getAccessToken(), $this->config->getUserAgent(), str_replace(\"https://\", \"\", $this->config->getHost()),\n 'POST', $resourcePath, $query);\n\n $headers = array_merge(\n $headerParams,\n $headers,\n $headersX\n );\n\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function gETShippingMethodIdMarketRequest($shipping_method_id)\n {\n // verify the required parameter 'shipping_method_id' is set\n if ($shipping_method_id === null || (is_array($shipping_method_id) && count($shipping_method_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipping_method_id when calling gETShippingMethodIdMarket'\n );\n }\n\n $resourcePath = '/shipping_methods/{shippingMethodId}/market';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($shipping_method_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shippingMethodId' . '}',\n ObjectSerializer::toPathValue($shipping_method_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (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\\build_query($formParams);\n }\n }\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function craeteQuoteOrder(Request $request, Address $shippingBilling, Address $pickup, $quote)\n {\n $total = $quote->quoteItems()->sum('estimate_price');\n $couponDiscount = $coupon = $couponValidity = null;\n if ($quote->supplier_type == \"companies\") {\n $data = array_merge(\n $request->only([\n 'delivery_date', 'delivery_time', 'pickup_time', 'delivery_note', 'pickup_date', 'pickup_note', 'package_id', 'sales_rep'\n ]),\n [\n 'company_id' => $quote->supplier_id,\n 'billing_addr_id' => $shippingBilling->id,\n 'shipping_addr_id' => $shippingBilling->id,\n 'pickup_addr_id' => $pickup->id,\n 'order_no' => $this->orderNo(),\n 'order_status' => 'converted',\n 'amount' => $total,\n 'package_amount' => $total,\n 'sales_rep' => $request->sales_rep ?: \"\",\n 'delivery_charge' => $request->input('delivery_appartment', 0),\n 'pickup_charge' => $request->input('pickup_appartment', 0)\n ]\n );\n } else {\n $data = array_merge(\n $request->only([\n 'delivery_date', 'delivery_time', 'pickup_time', 'delivery_note', 'pickup_date', 'pickup_note', 'package_id', 'sales_rep'\n ]),\n [\n 'client_id' => $quote->supplier_id,\n 'billing_addr_id' => $shippingBilling->id,\n 'shipping_addr_id' => $shippingBilling->id,\n 'pickup_addr_id' => $pickup->id,\n 'order_no' => $this->orderNo(),\n 'amount' => $total,\n 'package_amount' => $total,\n 'order_status' => 'converted',\n 'sales_rep' => $request->sales_rep ?: \"\",\n 'delivery_charge' => $request->input('delivery_appartment', 0),\n 'pickup_charge' => $request->input('pickup_appartment', 0)\n ]\n );\n }\n $order = Order::create($data);\n $this->orderQuoteItems($order, $quote->quoteItems);\n\n //Create invoice\n // $invoice = $this->invoice($data, $order);\n $invoice = $this->reInvoice($data, $order, $quote);\n $this->quoteInvoiceItems($invoice, $quote->quoteItems);\n $this->invoiceShippings($request, $invoice);\n return $order;\n }", "protected function getShopRequest()\n {\n $resourcePath = '/shop';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function quoteAction()\n {\n $result = array();\n \n try {\n \n //hash to get quote\n $hash = $this->getRequest()->getParam('hash');\n \n if (!$hash){\n //json post\n if ($postBody = file_get_contents('php://input')){\n \n $data = (array)json_decode($postBody);\n \n } else {\n \n $data = $this->getRequest()->getPost();\n }\n \n if (is_array($data) && count($data)>0){\n \n $model = $this->getModel();\n $productIdOrSku = $data['product'];\n $model->loadOptions($productIdOrSku);\n $result = $model->validateCartData($data);\n \n if (!$result['error']){\n \n $result = $model->addToCart($data);\n \n if (!$result['error']){\n \n $quoteUrl = Mage::getUrl('customconfigurable/index/quote/hash/'.$result['data']);\n $result = array('Location' => $quoteUrl);\n }\n }\n \n } else {\n \n $result['error'] = true;\n $result['data'] = 'No post data';\n }\n \n } else {\n \n $model = $this->getModel();\n $model->loadOptions();\n \n $result = $model->getQuote($hash);\n \n if (!$result['error']){ \n unset($result['error']);\n $result['hash'] = $hash;\n $result['quote'] = $result['data'];\n unset($result['data']);\n }\n \n }\n \n } catch (Exception $e) {\n \n $result['error'] = true;\n $result['data'] = $e->getMessage();\n }\n \n $this->getResponse()->clearHeaders()->setHeader('Content-type','application/json',true)->setBody(Mage::helper('core')->jsonEncode($result));\n \n }", "function _canadapostGetQuote() {\r\n\t$strXML = \"<?xml version=\\\"1.0\\\" ?>\";\r\n\r\n\t// set package configuration.\r\n\t$strXML .= \"<eparcel>\\n\";\r\n\t$strXML .= \" <language>\" . $this->language . \"</language>\\n\";\r\n\t$strXML .= \" <ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \" <merchantCPCID>\" . $this->CPCID . \"</merchantCPCID>\\n\";\r\n\t$strXML .= \" <fromPostalCode>\" . $this->_canadapostOriginPostalCode . \"</fromPostalCode>\\n\";\r\n\t$strXML .= \" <turnAroundTime>\" . $this->turnaround_time . \"</turnAroundTime>\\n\";\r\n\t$strXML .= \" <itemsPrice>\" . (string)$this->items_price . \"</itemsPrice>\\n\";\r\n\t\r\n\t// add items information.\r\n\t$strXML .= \" <lineItems>\\n\";\r\n\tfor ($i=0; $i < $this->items_qty; $i++) {\r\n\t $this->item_description[$i] = str_replace(\"&\", \"and\", $this->item_description[$i]);\r\n\t\t$strXML .= \"\t <item>\\n\";\r\n\t\t$strXML .= \" <quantity>\" . $this->item_quantity[$i] . \"</quantity>\\n\";\r\n\t\t$strXML .= \" <weight>\" . ($this->item_weight[$i]) . \"</weight>\\n\";\r\n\t\t$strXML .= \" <length>\" . $this->item_length[$i] . \"</length>\\n\";\r\n\t\t$strXML .= \" <width>\" . $this->item_width[$i] . \"</width>\\n\";\r\n\t\t$strXML .= \" <height>\" . $this->item_height[$i] . \"</height>\\n\";\r\n\t\t$strXML .= \" <description>\" . $this->item_description[$i] . \"</description>\\n\";\r\n\t\tif ($this->item_readytoship[$i]) $strXML .= \" <readyToShip/>\\n\";\r\n\t\t$strXML .= \"\t </item>\\n\";\r\n\t}\r\n\t$strXML .= \" </lineItems>\\n\";\r\n\t\r\n\t// add destination information.\r\n\t$strXML .= \" <city>\" . $this->dest_city . \"</city>\\n\";\r\n\t$strXML .= \" <provOrState>\" . $this->dest_province . \"</provOrState>\\n\";\r\n\t$strXML .= \" <country>\" . $this->dest_country . \"</country>\\n\";\r\n\t$strXML .= \" <postalCode>\" . $this->dest_zip . \"</postalCode>\\n\";\r\n\t$strXML .= \" </ratesAndServicesRequest>\\n\";\r\n\t$strXML .= \"</eparcel>\\n\";\r\n\t\r\n\t//print $strXML;\r\n\tif ($resultXML = $this->_sendToHost($this->server,$this->port,'POST','',$strXML)) {\r\n\t\treturn $this->_parserResult($resultXML);\r\n\t} else {\r\n\t return false;\r\n\t}\r\n }", "public function delete_quote_get() {\n extract($_GET);\n $response = $this->QuotationForEnquiry_model->delete_quote($quotation_id);\n return $this->response($response);\n }", "protected function getCurrenciesRequest()\n {\n $resourcePath = '/currencies';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function gETOrderIdShippingAddressRequest($order_id)\n {\n // verify the required parameter 'order_id' is set\n if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $order_id when calling gETOrderIdShippingAddress'\n );\n }\n\n $resourcePath = '/orders/{orderId}/shipping_address';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($order_id !== null) {\n $resourcePath = str_replace(\n '{' . 'orderId' . '}',\n ObjectSerializer::toPathValue($order_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n []\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n [],\n []\n );\n }\n\n // for model (json/xml)\n if (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\\build_query($formParams);\n }\n }\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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function createQuote()\n\t{\n\t\t$this->setType($_POST['frmquotetype']);\n\t\t$this->setDate($_POST['frmquotedate']);\n\t\t$this->setStatus('Open');\n\t\t$this->setJobName($_POST['frmjobname']);\n\t\t$this->setJobAddress($_POST['frmjobaddress']);\n\t\t$this->setJobCity($_POST['frmjobcity']);\n\t\t$this->setJobZipcode($_POST['frmjobzipcode']);\n\t\t$this->setAttention($_POST['frmattn']);\n\t\t// Here we are going to post the tax rate and turn it into a float.\n\t\t$unformatted_tax_rate = $_POST['frmtaxrate'];\n\t\t$this->setTaxRate((float)$unformatted_tax_rate);\n\t\t$this->setCostBeforeTax($_POST['cartBeforeTaxCost']);\n\t\t$this->setTotalCost($_POST['cartTotalCost']);\n\t\t$this->setSalesTax($_POST['cartTax']);\n\t\t$this->setMonthlyTotal($_POST['cartMonthlyTotal']);\n\t\t$this->setDeliveryTotal($_POST['cartDeliveryTotal']);\n\t\t$this->setHidden(null);\n\n\t\t// Need to insert the new order into the database.\n\t\t$this->getDB()->insert('quotes', [\n\t\t\t\t'quote_customer' \t\t=> $this->getCustomer(),\n\t\t\t\t'quote_customer_id' \t=> $this->getCustomerId(),\n\t\t\t\t'quote_date' \t\t\t=> $this->getDate(),\n\t\t\t\t'quote_status' \t\t\t=> $this->getStatus(),\n\t\t\t\t'quote_type' \t\t\t=> $this->getType(),\n\t\t\t\t'job_name' \t\t\t\t=> $this->getJobName(),\n\t\t\t\t'job_city' \t\t\t\t=> $this->getJobCity(),\n\t\t\t\t'job_address' \t\t\t=> $this->getJobAddress(),\n\t\t\t\t'job_zipcode' \t\t\t=> $this->getJobZipcode(),\n\t\t\t\t'attn' \t\t\t\t\t=> $this->getAttention(),\n\t\t\t\t'tax_rate' \t\t\t\t=> $this->getTaxRate(),\n\t\t\t\t'cost_before_tax' \t\t=> $this->getCostBeforeTax(),\n\t\t\t\t'total_cost' \t\t\t=> $this->getTotalCost(),\n\t\t\t\t'sales_tax' \t\t\t=> $this->getSalesTax(),\n\t\t\t\t'monthly_total' \t\t=> $this->getMonthlyTotal(),\n\t\t\t\t'delivery_total'\t\t=> $this->getDeliveryTotal(),\n\t\t\t\t'hidden'\t\t\t\t=> $this->getHidden()\n\t\t\t]);\n\n\t\t// If properly inserted, grab the ID, else throw error.\n\t\tif($this->getDB()->lastId() != null)\n\t\t{\n\t\t\t$this->id = $this->getDB()->lastId();\n\t\t} \n\t\telse \n\t\t{\n\t\t\tthrow new Exception(\"There was an error inserting the quote into the database.\");\n\t\t}\n\t\t\n\t}", "public function getQuoteShippingAddressesItems()\n {\n if ($this->_quoteShippingAddressesItems !== null) {\n return $this->_quoteShippingAddressesItems;\n }\n $items = array();\n $addresses = $this->getQuote()->getAllAddresses();\n foreach ($addresses as $address) {\n foreach ($address->getAllItems() as $item) {\n if ($item->getParentItemId()) {\n continue;\n }\n if ($item->getProduct()->getIsVirtual()) {\n $items[] = $item;\n continue;\n }\n if ($item->getQty() > 1) {\n for ($i = 0, $n = $item->getQty(); $i < $n; $i++) {\n if ($i == 0) {\n $addressItem = $item;\n } else {\n $addressItem = clone $item;\n }\n $addressItem->setQty(1)\n ->setCustomerAddressId($address->getCustomerAddressId())\n ->save();\n $items[] = $addressItem;\n }\n } else {\n $item->setCustomerAddressId($address->getCustomerAddressId());\n $items[] = $item;\n }\n }\n }\n $this->_quoteShippingAddressesItems = $items;\n return $items;\n }", "protected function getShippingMethodRequest($shipping_method_id)\n {\n // verify the required parameter 'shipping_method_id' is set\n if ($shipping_method_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $shipping_method_id when calling getShippingMethod'\n );\n }\n if ($shipping_method_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$shipping_method_id\" when calling DefaultApi.getShippingMethod, must be bigger than or equal to 1.');\n }\n $resourcePath = '/shipping-methods/{shippingMethodId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($shipping_method_id !== null) {\n $resourcePath = str_replace(\n '{' . 'shippingMethodId' . '}',\n ObjectSerializer::toPathValue($shipping_method_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\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\\build_query($formParams);\n }\n }\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\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
[ "0.6969493", "0.6634543", "0.6323052", "0.59027535", "0.5900383", "0.5751124", "0.57479954", "0.57234234", "0.5673346", "0.55803466", "0.55318564", "0.54888606", "0.54851717", "0.5465457", "0.54310185", "0.5415367", "0.54075694", "0.5387344", "0.53695905", "0.53483164", "0.53378385", "0.53034455", "0.52978724", "0.526601", "0.5245599", "0.52178246", "0.52101463", "0.52073556", "0.52022666", "0.5172569" ]
0.7415156
0
function one_out_of_two($str) retuns the string given one out of two letter in uppercase input : $str String
function one_out_of_two($str) { $concat = ""; for ($i = 0; $i < strlen($str); $i++) { if ($i % 2 == 0) { $concat = $concat . strtoupper($str[$i]); } else { $concat = $concat . $str[$i]; } } return $concat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function upper( $str ) {\r\nreturn preg_match( \"/[A-Z]/\", $str );\r\n}", "function block_multi_capital($str)\n\t{\n\t\t$pattern = \"/[A-Z]{2,}/\";\n\t\t$matched = array();\n\t\tpreg_match_all( $pattern, $str, $matched );\n\t\t$count = count( $matched,1 );\n\t\t$count = ( $count - 1 );\n\t\treturn ( $count > 1 ) ? FALSE : TRUE;\n\t}", "function up($str) {\n\t\treturn strtoupper($str);\n\t}", "function stringcut($str,$a,$b){\n \t$ap=strpos($str,$a);\n \tfor($i=0;$i<strlen($str)-$ap-1;$i++){\n \tif($str[$ap+strlen($a)+$i]!=$b)\n \t$result=$result.$str[$ap+strlen($a)+$i];\n \telse\n \tbreak;\n \t}\n \treturn $result;\n \t}", "public function toAlternateCase(){\n $alternative = str_split(strtolower($this->string),1);\n for($i=0;$i<sizeof($alternative);$i++){\n if(($i+1)%2==0){\n $alternative[$i]=strtoupper($alternative[$i]);\n } \n }\n return $alternative = implode(\"\",$alternative);\n }", "public function ssbos($string1, $string2) {\r\n if ($this->sex === Cfg::read('db.sex.female')) {\r\n return $string1;\r\n }\r\n return $string2;\r\n }", "function car_to_upper($car)\n{\n global $caracteres;\n foreach ($caracteres as $letter) {\n for ($i = 0; $i < my_strlen($letter); $i++) {\n if ($letter[$i] == $car) {\n return $letter[1];\n }\n }\n }\n return $car;\n}", "function true_uppercase($string) {\n\treturn str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($string))));\n}", "function convertcharstoupper($str)\n{\n\treturn mb_convert_case($str, MB_CASE_UPPER, \"UTF-8\");\n}", "protected function partTwo(string $input): string\n {\n $lines = explode(\"\\n\", $input);\n $validPasswordCounter = 0;\n\n foreach ($lines as $line) {\n preg_match('/(\\d*)-(\\d*) (\\w): (\\w*)/', $line, $matches);\n\n [1 => $positionOne, 2 => $positionTwo, 3 => $letter, 4 => $subject] = $matches;\n\n $letterPositionOne = substr($subject, (int) $positionOne - 1, 1);\n $letterPositionTwo = substr($subject, (int) $positionTwo - 1, 1);\n\n if ($letterPositionOne === $letter && $letterPositionTwo === $letter) {\n continue;\n }\n\n if ($letterPositionOne === $letter || $letterPositionTwo === $letter) {\n $validPasswordCounter++;\n }\n }\n\n return (string) $validPasswordCounter;\n }", "static public function upperCamel($string) {\n $string = str_replace(' ', '_', $string);\n $parts = explode('_', $string);\n foreach($parts as $part) {\n $output .= ucfirst($part);\n }\n return $output;\n\t}", "function detect_any_uppercase($string){\r\n\treturn strtolower($string) != $string;\r\n}", "public static function pearCase($str) {}", "function LetterCapitalize($str) { \r\n return ucwords($str); \r\n}", "public static function convertUpperString($string){\r\n\t//$string = ucfirst(strtolower($string));\r\n\t$string = ucwords(strtolower($string));\r\n\t\treturn $string;\r\n\t}", "function atk_strtoupper($str)\n{\n\treturn atkString::strtoupper($str);\n}", "function from_camel_case($input)\n{\n preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);\n $ret = $matches[0];\n foreach ($ret as &$match) {\n $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);\n }\n return implode('_', $ret);\n}", "function accronym($string) {\n $out = '';\n foreach (explode(' ', $string) as $value) {\n if ($value) {\n $out .= strtoupper($value[0]);\n }\n }\n return $out;\n}", "function the_champ_first_letter_uppercase($word){\r\n\treturn ucfirst($word);\r\n}", "public function part2(string $input)\n {\n }", "function uv_first_capital($string){\n //Patron para reconocer y no modificar numeros romanos\n $pattern = '/\\b(?![LXIVCDM]+\\b)([A-Z_-ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ]+)\\b/';\n $output = preg_replace_callback($pattern, function($matches) {\n return mb_strtolower($matches[0], 'UTF-8');\n }, $string);\n $output = ucfirst($output);\n return $output;\n }", "function manipulateChars($string,$action,$from,$to) {\n\t\t$stringtemp=\"\";\n\t\t$from=$from-1;\n\t\t$to=$to-1;\n\t\t$len=strlen($string);\n\t\tfor($sub=0;$sub<$len;$sub++) {\n\t\t\tif ($sub>=$from and $sub<=$to) {\n\t\t\t\tif ($action=='toUpper') $stringtemp.=strtoupper(substr($string,$sub,1));\n\t\t\t\tif ($action=='toLower') $stringtemp.=strtolower(substr($string,$sub,1));\n\t\t\t} else $stringtemp.=substr($string,$sub,1);\n\t\t}\n\t\t\n\t\treturn $stringtemp;\n\t}", "function genCredential($strOne = '', $strTwo = '')\n{\n if (empty($strOne) && empty($strTwo))\n {\n return generateRandomString();\n }\n else\n {\n $symbols = '@#$%*-+';\n $result = strtolower($strTwo).ucwords($strOne);\n $result .= $symbols[rand(0, strlen($symbols) - 1)];\n $result .= generateRandomString(3,1,2,1);\n return $result;\n }\n}", "function fromCamelCase($str)\n{\n\t$str[0] = strtolower($str[0]);\n\t$func = create_function('$c', 'return \"_\" . strtolower($c[1]);');\n\treturn preg_replace_callback('/([A-Z])/', $func, $str);\n}", "public function suffix(string $str1, string $str2, bool $toCamelCase = false):string\n {\n return self::prefix($str2, $str1, $toCamelCase);\n }", "public function uppercase($str='')\n\t{\n\t\t$lines = explode(\"\\n\",$str);\t\n\t\tforeach ($lines as $line) {\n\t\t\t$result[] = (ctype_upper(preg_replace(\"/[^A-Za-z]/\", '', $line)));\n\t\t}\n\t\treturn (bool) array_sum($result); \n\t}", "protected function myStrtoupper($n)\n {\n return mb_strtoupper($n, 'utf-8'); \n }", "public function testUppercaseSingleLetter() : void\n {\n $word = 'A';\n $this->assertEquals(1, score($word));\n }", "public function upper_case_string($emp_name){\n\t\t$let = ucwords($emp_name);\n\t\treturn $let;\t\n\t}", "public function upper_case_string($emp_name){\n\t\t$let = ucwords($emp_name);\n\t\treturn $let;\t\n\t}" ]
[ "0.61913323", "0.6167676", "0.6089395", "0.59637666", "0.59364605", "0.5900712", "0.5844875", "0.5827377", "0.57681215", "0.57481426", "0.5745288", "0.5715605", "0.57083565", "0.56774837", "0.56773305", "0.56624764", "0.56207806", "0.561763", "0.558802", "0.5582162", "0.55732423", "0.5562052", "0.5560003", "0.55254006", "0.5525256", "0.5505305", "0.54964054", "0.54791224", "0.54725605", "0.54725605" ]
0.82260644
0
/ Gives search suggestions based on what is being searched for
public function suggest() { $suggestions = $this->Role->get_search_suggestions($this->input->post('q'),$this->input->post('limit')); echo implode("\n",$suggestions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function suggest()\n\t{\n\t\t$suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_encode($suggestions);\n }", "function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }", "function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function getSuggestData()\n {\n \tif(!$this->helper('findologic')->isAlive()){\n \t\treturn parent::getSuggestData();\n \t}\t\n \t\n if (!$this->_suggestData) {\n \t$this->_suggestData = array();\n \t\n\t\t\t$query = $this->helper('catalogsearch')->getQueryText();\n \t$result = $this->helper('findologic')->autocomplete($query);\n\n \tif(isset($result->suggestions)) {\n \t $counter = 0;\n \t $data = array();\n \t \n\t foreach ($result->suggestions as $suggestion) {\n\t \t$suggestion = explode('|', $suggestion);\n\t \t\n\t $_data = array(\n\t 'title' => $suggestion[0],\n\t 'row_class' => ++$counter % 2 ? 'odd' : 'even',\n\t 'num_of_results' => $suggestion[1]\n\t );\n\t\n\t if ($_data['title'] == $query) {\n\t array_unshift($data, $_data);\n\t }\n\t else {\n\t $data[] = $_data;\n\t }\n\t }\n\t $this->_suggestData = $data;\n \t}\n }\n\n\t\treturn $this->_suggestData;\n }", "public function suggests() : array;", "public function suggest() {\n \n $query = ['query' => ['match_all' => []]];\n if (Request::has('q')) {\n $query = [\n 'query' => [\n 'nested' => [\n 'path' => 'prefLabels',\n 'query' => [\n 'bool' => [\n 'must' => [\n [ 'prefix' => [ 'prefLabels.label' => Request::get('q') ] ],\n [ 'match' => [ 'prefLabels.lang' => 'en' ] ]\n ]\n ]\n ]\n ]\n ]\n ];\n }\n \n $hits = Subject::suggest($query, 'resource');\n return response()\n ->json($hits)\n ->header(\"Vary\", \"Accept\");\n }", "function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}", "public function suggest() {\n\t\tif(isset($_POST['query'])) $this->query_str = $_POST['query'];\n\t\telse return;\n\n\t\t$raw = null;\n\n\t\t//check if jar exists\n\t\tif(file_exists('../executable/app.jar')) $raw = shell_exec('cd ../executable/ && java -jar app.jar suggest ' . escapeshellarg($this->query_str));\n\t\telse return;\n\n\t\t$this->results = json_decode($raw);\n\t}", "function get_search_suggestions($search,$limit=25)\n\t{\n\t\t$suggestions = array();\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_name', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_name = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->select('skill_name_kh');\n\t\t$this->db->from('skill');\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->distinct();\n\t\t$this->db->like('skill_name_kh', $search);\n\t\t$this->db->limit($limit);\n\t\t$by_name_kh = $this->db->get();\n\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name_kh->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_name_kh;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->from('skill');\n\t\t$this->db->like('skill_major_code', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_skill_major_code = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_skill_major_code->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->skill_major_code;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\n\t\treturn $suggestions;\n\t}", "public function suggest($count = 1) {\n\n $person = $this->randomItem('Tim Berners-Lee', 'Super Mario', 'Jean-Michel Basquiat', 'Levon Helm', 'Barack Obama', 'Shigeru Miyamoto', 'Eero Aarnio', 'Martin Scorsese', 'Twyla Tharp', 'Edward Tufte');\n\n $safePlaces = array('104 Franklin Street, NYC', 'Grand Central Station', 'Corsica', 'Geneva', 'Portland', 'Tokyo', 'Atlantis', 'Waldo', 'Hot Coffee');\n\n $allPlaces = array_merge($safePlaces, array('Dublin', 'Heaven on Earth'));\n\n $things = array('3d printer', 'planet', 'goat', 'raccoon', 'computer program', 'skyscraper', 'data visualization', 'double-neck guitar', 'vinyl record', 'pdp-11', 'Baobab Tree', 'large hadron collider');\n\n $thingsIncludingIrregulars = array_merge($things, array('arcade game', 'salmon', 'javascript', 'zorbing', 'democracy', 'ARP 2600', 'IBM 701'));\n\n $resourceSearch = $this->randomItem('Find me', 'Search for', 'Get me', 'Run a search for', 'Look for', 'Find');\n\n $randomTypes = array_keys($this->_resourceTypes);\n\n $suggestions = array();\n\n $suggestionCases = array();\n\n for($i = 0; $i < $count; $i++) {\n\n shuffle($randomTypes);\n $type = $randomTypes[0];\n if($type == 'searchImages') {\n $preposition = $this->randomItem('of', 'with');\n } else {\n $preposition = $this->randomItem('of', 'about', 'with');\n }\n if($type == 'searchTweets') {\n $type = \"tweets\"; // No other dignified synonyms\n } else {\n $type = $this->randomItem($this->_resourceTypes[$type]) . 's';\n }\n\n // Don't repeat suggestion types until we have to\n if(count($suggestionCases) < 1) {\n $suggestionCases = range(0, 6);\n }\n shuffle($suggestionCases);\n $suggestionCase = array_shift($suggestionCases);\n\n switch($suggestionCase) {\n case 0:\n $thing = $this->randomItem($things) . 's';\n $number = $this->randomItem('two', 'three', 'four', 'five', 'ten', 'twenty', 'some', 'all the');\n $suggestions[] = implode(' ', array($resourceSearch, $number, $type, $preposition, $thing)) . '.';\n break;\n case 1:\n $thing = $this->randomItem($thingsIncludingIrregulars);\n $number = rand(2, 20);\n $suggestions[] = implode(' ', array($resourceSearch, $number, $thing, $type)) . '.';\n break;\n case 2:\n $suggestions[] = $this->randomItem(\"Define \" . $this->randomItem($thingsIncludingIrregulars) . \".\", \"What is a \" . $this->randomItem($things) . \"?\");\n break;\n case 3:\n $suggestions[] = $this->randomItem('Where is ', 'Where can I find ', 'Locate ') . $this->randomItem($allPlaces) . '?';\n break;\n case 4:\n $suggestions[] = $this->randomItem('Who is ', 'Do you know ') . $person . '?';\n break;\n case 5:\n $suggestions[] = $this->randomItem('How can I ', 'Where can I ') . $this->randomItem('help ', 'donate to ') . $this->randomItem('schools', 'kids', 'teachers') . '?';\n break;\n case 6:\n $suggestions[] = $this->randomItem('Is it safe in', 'Am I safe in', 'How safe is it in') . ' ' . $this->randomItem($safePlaces) . '?';\n }\n }\n return count($suggestions) == 1 ? $suggestions[0] : $suggestions;\n }", "function search() {}", "function get_search_suggestions($search,$limit=5)\n\t{\n\t\t$suggestions = array();\n\t\t\n\t\t$this->db->from('designation');\n\t\t\n\t\t$this->db->where(\"(designation_name LIKE '%\".$this->db->escape_like_str($search).\"%') AND is_status = 0\");\n\t\t\n\t\t$this->db->limit($limit);\t\n\t\t$by_name = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->designation_name;\n\t\t}\n\t\t\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\t\t\n\t\t}\n\t\t\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\t\treturn $suggestions;\n\t\n\t}", "public function search($searchTerm)\n {\n $results = array(\n 'snippet' => [],\n 'snippet_code' => [],\n 'page' => [],\n 'product' => [],\n 'actions' => [],\n 'word' => [],\n 'post' => []\n );\n\n $snippets = Yii::$app->user->identity->portal->hasMany(Snippet::className(), ['id' => 'snippet_id'])\n ->viaTable('snippet_portal', ['portal_id' => 'id'])\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'description', $searchTerm],\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippets as $snippet) {\n $results['snippet'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet->id\n ]),\n 'name' => $snippet->name,\n 'id' => $snippet->id,\n 'class' => 'suggest-snippet'\n ];\n }\n\n // SNIPPET CODES / ALTERNATIVES\n\n /** @var SnippetCode[] $snippet_codes */\n $snippet_codes = SnippetCode::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'code', $searchTerm]\n ])\n ->limit(10)\n ->all();\n\n foreach ($snippet_codes as $snippet_code) {\n $results['snippet_code'][] = [\n 'link' => Url::to([\n '/snippet/edit',\n 'id' => $snippet_code['snippet_id'],\n '#' => 'code' . $snippet_code['id'],\n ]),\n 'name' => $snippet_code->getSnippet()->one()->name . ' -> ' . $snippet_code->name,\n 'id' => $snippet_code->id,\n 'class' => 'suggest-snippet-code'\n ];\n }\n\n // Slovnik\n $words = (new Query())->select(\"id, identifier\")->from(\"word\")->where(['like', 'identifier', $searchTerm])\n ->limit(10)->all();\n\n foreach ($words as $word) {\n $results['word'][] = [\n 'link' => Url::to([\n '/word/edit',\n 'id' => $word['id']\n ]),\n 'name' => $word['identifier'],\n 'id' => $word['id'],\n 'class' => 'suggest-word'\n ];\n }\n\n // PAGES\n\n $pages = Page::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($pages as $page) {\n $results['page'][] = [\n 'link' => Url::to(['/page/edit', 'id' => $page['id']]),\n 'id' => $page->id,\n 'name' => $page->breadcrumbs,\n 'class' => 'suggest-page'\n ];\n }\n\n // POSTS\n\n $posts = Post::find()->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ['like', 'title', $searchTerm],\n ])\n ->andWhere([\n 'portal_id' => Yii::$app->user->identity->portal_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($posts as $post) {\n $results['post'][] = [\n 'link' => Url::to(['/post/edit', 'id' => $post['id']]),\n 'id' => $post->id,\n 'name' => $post->name,\n 'class' => 'suggest-post'\n ];\n }\n\n // PRODUCTS\n\n $products = Product::find()\n ->filterWhere([\n 'or',\n ['like', 'name', $searchTerm],\n ['like', 'identifier', $searchTerm],\n ])\n ->andWhere([\n 'language_id' => Yii::$app->user->identity->portal->language_id\n ])\n ->limit(10)\n ->all();\n\n foreach ($products as $product) {\n $results['product'][] = [\n 'link' => Url::to([\n '/product/edit',\n 'id' => $product['id']\n ]),\n 'name' => $product->breadcrumbs,\n 'id' => $product->id,\n 'class' => 'suggest-product'\n ];\n }\n\n $processActions = function ($searchTerm, $list, $prefix, $urlSuffix = '') {\n $actions = [];\n foreach ($list as $item) {\n $name = $prefix . $item[0];\n\n if ($searchTerm == '' || (mb_strlen($name) >= mb_strlen($searchTerm) && mb_substr(mb_strtolower($name), 0, mb_strlen($searchTerm)) == mb_strtolower($searchTerm))) {\n $actions[] = [\n 'link' => Url::to([\n '/' . $item[1] . '/' . $urlSuffix,\n ]),\n 'name' => $name,\n 'class' => 'suggest-action'\n ];\n }\n };\n return $actions;\n };\n\n $listActions = [['stránok', 'page'], ['ďakovačiek', 'thanks'], ['prekladov', 'word'], ['multimédii', 'multimedia'], ['snippetov', 'snippet'], ['produktov', 'product'], ['produktových premenných', 'product-var'], ['typov produktu', 'product-type'], ['tagov', 'tag'], ['šablón', 'template'], ['portálov', 'portal'], ['používateľov', 'user'], ['krajín', 'language']];\n $addActions = [['stránku', 'page'], ['ďakovačku', 'thanks'], ['preklad', 'word'], ['snippet', 'snippet'], ['produkt', 'product'], ['produktovú premennú', 'product-var'], ['typ produktu', 'product-type'], ['tag', 'tag'], ['šablónu', 'template'], ['portál', 'portal'], ['používateľa', 'user'], ['krajinu', 'language']];\n\n $results['actions'] += $processActions($searchTerm, $listActions, 'Zoznam ');\n $results['actions'] += $processActions($searchTerm, $addActions, 'Pridať ', 'edit');\n\n return $results;\n }", "public function getSearch();", "public function getAutocomplete()\n {\n // get a suggester query instance\n $query = $this->client->createSuggester();\n $query->setQuery(strtolower(Input::get('term')));\n $query->setDictionary('suggest');\n $query->setOnlyMorePopular(true);\n $query->setCount(10);\n $query->setCollate(true);\n\n // this executes the query and returns the result\n $resultset = $this->client->suggester($query);\n\n $suggestions = array();\n\n foreach ($resultset as $term => $termResult) {\n foreach ($termResult as $result) {\n $suggestions[] = $result;\n }\n }\n\n return Response::json($suggestions);\n }", "public function search();", "public function search();", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "function get_search_suggestions($search,$limit=25)\n\t{\n\t\t$suggestions = array();\n\n\t\t$this->db->from('department_type');\n\t\t$this->db->like('dept_title', $search);\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->limit($limit);\n\t\t$by_name = $this->db->get();\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->dept_title;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t$this->db->from('university');\n\t\t$this->db->where('is_status',0);\n\t\t$this->db->like('dept_title_kh', $search);\n\t\t$this->db->limit($limit);\n\t\t$by_name_kh = $this->db->get();\n\n\t\t$temp_suggestions = array();\n\t\tforeach($by_name_kh->result() as $row)\n\t\t{\n\t\t\t$temp_suggestions[] = $row->dept_title_kh;\n\t\t}\n\n\t\tsort($temp_suggestions);\n\t\tforeach($temp_suggestions as $temp_suggestion)\n\t\t{\n\t\t\t$suggestions[]=array('label'=> $temp_suggestion);\n\t\t}\n\n\t\t//only return $limit suggestions\n\t\tif(count($suggestions > $limit))\n\t\t{\n\t\t\t$suggestions = array_slice($suggestions, 0,$limit);\n\t\t}\n\n\t\treturn $suggestions;\n\t}", "function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "function plugin_suggest_callback() {\r\n\t\t\tglobal $wpdb, $post;\r\n\t\t\t\r\n\t\t\t$posttype = $wpdb->escape($_GET['type']);\r\n\t\t\t$in = $wpdb->escape($_GET['q']);\r\n\r\n\t\t\t$query = \"SELECT ID from $wpdb->posts where post_type = '$posttype' AND post_title like '%$in%' \";\r\n\t\t\t$mypostids = $wpdb->get_col($query);\r\n\r\n\t\t\tforeach ($mypostids as $key => $value) {\r\n\t\t\t\tprint get_the_title($value) . \" [#\" . $value . \"]\" . \"\\n\";\r\n\t\t\t}\r\n\t\t\tdie(); // this is required to return a proper result\r\n\t\t}", "function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }", "public function autocompleteAction() {\n $suggestions = array(\n 'Application',\n 'Big',\n 'Computer',\n 'Development',\n 'Environment',\n 'Failure',\n 'Green',\n 'Hope',\n 'Injection',\n 'Java',\n 'Kilo'\n );\n\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n\n echo json_encode($suggestions);\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }" ]
[ "0.7573277", "0.7514065", "0.74069816", "0.73813087", "0.72494006", "0.7203232", "0.7102418", "0.7070972", "0.7050754", "0.6954871", "0.69452465", "0.69212514", "0.6898926", "0.6870231", "0.6820383", "0.6818585", "0.6801141", "0.6792956", "0.6764503", "0.67517304", "0.67517304", "0.67128754", "0.66780853", "0.6662949", "0.6556676", "0.65425336", "0.65363914", "0.65071213", "0.65071213", "0.65071213" ]
0.75762
0
/ / / / Everything under this bar relates to the angular side only / / / / Get Initial Data / / This is the function called upon page load that grabs all the data via an ajax call. We return the information for the file from the workspace entry | as well as all of the items within the document, the unit data, the constant data, and the permissions. | /
public function getInitialData() // { $this->autorender = false; // $this->layout = null; // $this->render('ajax'); // $params = json_decode(file_get_contents('php://input'),true); // // $fileURL=$params['fileURL']; // Controller::loadModel('Bugs'); // $bugData=$this->Bugs->find('all', array('conditions' => array('status' => '0', 'parentid' => '0'))); // echo(json_encode($bugData)); // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }", "protected function LoadData()\n\t{\n\t\t$head = $this->GetProject()->GetHeadCommit();\n\t\t$this->tpl->assign(\"head\",$head);\n\n\t\t$this->tpl->assign('page', $this->params['page']);\n\t\t$skip = $this->params['page'] * 100;\n\n\t\t$headlist = $this->GetProject()->GetHeadList()->GetOrderedHeads('-committerdate', 101, $skip);\n\t\tif (isset($headlist) && (count($headlist) > 0)) {\n\t\t\tif (count($headlist) > 100) {\n\t\t\t\t$headlist = array_slice($headlist, 0, 100);\n\t\t\t\t$this->tpl->assign('hasmoreheads', true);\n\t\t\t}\n\t\t\t$this->tpl->assign(\"headlist\", $headlist);\n\t\t}\n\t}", "function get_data()\n {\n }", "function getData()\n\t{\n\t\t$this->_pending = false;\n\n\t\t// Get items using files VIA (single property) field types (that store file ids) by using main query\n\t\t$s_assigned_via_main = false;\n\n\t\t// Files usage my single / multi property Fields,\n\t\t// -- Single property field types: store file ids\n\t\t// -- Multi property field types: store file id or filename via some property name\n\n\t\t$s_assigned_fields = array('file', 'mediafile');\n\t\t$m_assigned_fields = array('image');\n\n\t\t$m_assigned_props = array('image'=>array('originalname', 'existingname'));\n\t\t$m_assigned_vals = array('image'=>array('filename', 'filename'));\n\n\t\t// Lets load the files if it doesn't already exist\n\t\tif ($this->_data === null)\n\t\t{\n\t\t\t$query = $s_assigned_via_main\n\t\t\t\t? $this->_buildQuery($s_assigned_fields)\n\t\t\t\t: $this->_buildQuery();\n\n\t\t\tif ($query === false)\n\t\t\t{\n\t\t\t\t$this->_data = array();\n\t\t\t\t$this->_total = 0;\n\t\t\t\treturn $this->_data;\n\t\t\t}\n\n\t\t\t$this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));\n\t\t\t$this->_db->setQuery(\"SELECT FOUND_ROWS()\");\n\t\t\t$this->_total = $this->_db->loadResult();\n\n\t\t\t$filter_order = $this->getState('filter_order');\n\t\t\t$default_size_message = $filter_order != 'a.size' ? null : '\n\t\t\t\t<span class=\"hasTooltip\" title=\"' . JText::sprintf('FLEXI_PLEASE_REINDEX_FILE_STATISTICS', JText::_('FLEXI_INDEX_FILE_STATISTICS')) . '\">\n\t\t\t\t\t<span class=\"icon-warning\"></span>\n\t\t\t\t\t<span class=\"icon-loop\"></span>\n\t\t\t\t</span>';\n\t\t\t$this->_data = flexicontent_images::BuildIcons($this->_data, $default_size_message);\n\n\n\t\t\t/**\n\t\t\t * Single property fields, get file usage (# assignments), if not already done by main query\n\t\t\t */\t\t\t\n\t\t\tif ( !$s_assigned_via_main && $s_assigned_fields)\n\t\t\t{\n\t\t\t\tforeach ($s_assigned_fields as $field_type)\n\t\t\t\t{\n\t\t\t\t\t$this->countFieldRelationsSingleProp($this->_data, $field_type);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\n\t\t\t/**\n\t\t\t * Multi property fields, get file usage (# assignments)\n\t\t\t */\n\t\t\tif ($m_assigned_fields)\n\t\t\t{\n\t\t\t\tforeach ($m_assigned_fields as $field_type)\n\t\t\t\t{\n\t\t\t\t\t$field_prop_arr = $m_assigned_props[$field_type];\n\t\t\t\t\t$value_prop_arr = $m_assigned_vals[$field_type];\n\t\t\t\t\t$this->countFieldRelationsMultiProp($this->_data, $value_prop_arr, $field_prop_arr, $field_type);\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t/**\n\t\t\t * Files in download links created via the XTD-editor file button, get file usage (# of download links)\n\t\t\t */\n\t\t\t$this->countUsage_FcFileBtn_DownloadLinks($this->_data);\n\n\n\t\t\t// These can be used by the items manager without need to recalculate\n\t\t\tif ($this->sess_assignments)\n\t\t\t{\n\t\t\t\t$session = JFactory::getSession();\n\n\t\t\t\t$fileid_to_itemids = $session->get('fileid_to_itemids', array(),'flexicontent');\n\t\t\t\tforeach ($this->_data as $row)\n\t\t\t\t{\n\t\t\t\t\t// we have multiple item list indexed by field type, concatanate these\n\t\t\t\t\t$itemids_list = !empty($row->item_list) ? implode(',', $row->item_list) : '';\n\t\t\t\t\t// now create a item ids array that contains duplicates\n\t\t\t\t\t$itemids_dup = ($itemids_list=='') ? array() : explode(',', $itemids_list);\n\t\t\t\t\t// make an array of unique item ids\n\t\t\t\t\t$itemids = array(); $n = 0;\n\t\t\t\t\tforeach ($itemids_dup as $itemid) $itemids[$itemid] = $n++;\n\t\t\t\t\t$fileid_to_itemids[$row->id] = $row->itemids = array_flip($itemids);\n\t\t\t\t}\n\n\t\t\t\t$session->set('fileid_to_itemids', $fileid_to_itemids, 'flexicontent');\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_data;\n\t}", "protected function get_main_file_data() {\n\t\treturn $this->main_file_data;\n\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 loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }", "public function get_data();", "public function loaddataAction(){\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$conf = new GroupDocsComparison_GroupDocs();\n\t\t$this->_helper->json(array('configs' =>\n\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '5',\n\t\t\t\t\t\t'cid' => json_decode($conf->getConfig('data'), true)['cid'],\n\t\t\t\t\t\t'pkey' => json_decode($conf->getConfig('data'), true)['pkey'],\n\t\t\t\t\t\t'baseurl' => json_decode($conf->getConfig('data'), true)['baseurl'],\n\t\t\t\t\t\t'firstfileid' => json_decode($conf->getConfig('data'), true)['firstfileid'],\n\t\t\t\t\t\t'secondfileid' => json_decode($conf->getConfig('data'), true)['secondfileid'],\n\t\t\t\t\t\t'resfileid' => json_decode($conf->getConfig('data'), true)['resfileid'],\n\t\t\t\t\t\t'embedKey' => json_decode($conf->getConfig('data'), true)['embedKey'],\n\t\t\t\t\t\t'frameborder' => $conf->getConfig('frameborder'),\n\t\t\t\t\t\t'width' => $conf->getConfig('width'),\n\t\t\t\t\t\t'height' => $conf->getConfig('height')\n\t\t\t\t)\n\t\t));\n\t}", "public function loadFilesLaunch()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalAndPublicFiles = $project->filesByType(array('public','clientVendor'));\r\n foreach($internalAndPublicFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'projectId'=>$id];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "Public function get_data()\n\t{\n\t\t$data = array();\n\t\t$data = $this->store->get_data();\n\t\techo json_encode($data);\n\n\t}", "public function get_data() {\n $rv = [\n 'standard' => [],\n 'counties' => []\n ];\n // echo 'url: '. $this->url;\n if ($this->is_remote($this->url)) {\n // Remote fetch\n // echo 'is remote';\n if ($this->user && $this->passwd) {\n // echo 'user:'.$this->user;\n $auth = base64_encode($this->user . \":\" . $this->passwd);\n $context = stream_context_create(['http' => ['header' => \"Authorization: Basic $auth\"]]);\n // $data_standards = file_get_contents($this->url . FileFetcher::FILE_STANDARDS, false, $context );\n $data_standards = file($this->url . FileFetcher::FILE_STANDARDS, false, $context );\n // echo '$data_standards: '. $data_standards;\n // $data_counties = file_get_contents($this->url . FileFetcher::FILE_COUNTIES, false, $context );\n $data_counties = file($this->url . FileFetcher::FILE_COUNTIES, false, $context );\n // echo '$data_counties: '. $data_counties;\n }\n else {\n $data_standards = file_get_contents($this->url . FileFetcher::FILE_STANDARDS);\n $data_counties = file_get_contents($this->url . FileFetcher::FILE_COUNTIES);\n }\n }\n else {\n // Local files\n $data_standards = file_get_contents($this->url . FileFetcher::FILE_STANDARDS);\n $data_counties = file_get_contents($this->url . FileFetcher::FILE_COUNTIES);\n }\n // $rv['standard'] = $this->read_standards_file($data_standards);\n // $rv['counties'] = $this->read_counties_file($data_counties, $data_standards);\n\n // return $rv;\n\n $standards_and_committees = $this->read_standards_file($data_standards);\n // var_dump($standards_and_committees[0]);\n $listings = $this->read_counties_file($data_counties, $standards_and_committees[0], $standards_and_committees);\n $listings['committees'] = $standards_and_committees[1];\n return $listings;\n }", "public function getData() {\r\n $data = [];\r\n\r\n $model = Factory::getModel('landing-page-templates');\r\n $templates = $model->getTemplates();\r\n foreach ($templates as $template) {\r\n if ($template->showDetailed) {\r\n $data[] = [\r\n 'loc' => home_url($template->slug),\r\n 'priority' => '0.5',\r\n 'changefreq' => 'daily'\r\n ];\r\n }\r\n }\r\n\r\n return $data;\r\n }", "function get_initial_results()\n{\n\tinclude('global_vars_insert.php');\n\n\t////////////////////////////////////////////\n\t/////\tBING INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n\t\n\tinclude('bing_search_initial.php');\n\n ////////////////////////////////////////////\n\t/////\tENTIREWEB INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n \n\tinclude('entireweb_search_initial.php');\n\n\t////////////////////////////////////////////\n\t/////\tBLEKKO INITIAL SEARCH REQUEST \n\t//////////////////////////////////////////// \n\t\n\tinclude('blekko_search_initial.php');\n\t\n\t////////////////////////////////////////////\n\t/////\tCURL MULTI-SESSION DATA \n\t////////////////////////////////////////////\n\n\tinclude('curl.php');\n}", "public function initData()\r\n {\r\n $this->data['page_class'] = strtolower('page-' . $this->classname . '-' . $this->methodname) . ' ';\r\n $this->data['class_name'] = $this->classname;\r\n $this->data['method_name'] = $this->methodname;\r\n\r\n //default description and keyword\r\n $this->data['keywords'] = '';\r\n $this->data['description'] = '';\r\n \r\n $this->data['language'] = $this->session->userdata('language');\r\n\r\n if ($this->config->item('test_mode') == TRUE)\r\n {\r\n $this->output->enable_profiler('true');\r\n }\r\n \r\n //see any notifications to display\r\n if (!empty($this->session->flashdata('notification'))) {\r\n $this->data['notification'] = $this->session->flashdata('notification');\r\n $this->data['notification_type'] = $this->session->flashdata('notification_type');\r\n }\r\n\r\n // set csrf\r\n $this->data['csrf'] = array(\r\n 'token_name' => $this->security->get_csrf_token_name(),\r\n 'hash' => $this->security->get_csrf_hash(),\r\n 'cookie_name' => $this->config->item('csrf_cookie_name'),\r\n );\r\n }", "public function getData(): ContuctUsPage;", "public function loadFilesAdmin()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null){\r\n $files = $project->files;\r\n }\r\n return json_encode($files);\r\n }", "public function getViewData() {\n $analyses = $this->model->Analysis->find('all', ['conditions' => ['set_code' => $this->set_code]]);\n $analysisItems = [];\n foreach ($analyses as $index => $analysis) {\n $analysisItems[$analysis['Analysis']['title']] = [\n 'links' => [\n [\n 'text' => [\n 'id' => 'processedDataFile',\n 'set' => 'Analysis'\n ],\n 'url' => $analysis['Analysis']['derived_results']\n //'url' => 'data/files/analysis/' . $analysis['Analysis']['derived_results'] //removed to get correct urls for processedDataFile\n ],\n [\n 'text' => [\n 'id' => 'resultsDataFile',\n 'set' => 'Analysis'\n ],\n 'url' => $analysis['Analysis']['processed']\n //'url' => 'data/files/analysis/' . $analysis['Analysis']['processed'] //removed to get correct urls for resultsDataFile (Additional)\n ]\n ]\n ];\n }\n \n $DataFileLink =[];\n $DataFileLink['metaData'] = [\n 'links' => [\n 'text' => 'metaData File',\n 'url' =>$this->metaFile\n ]\n ];\n //var_dump($analysisItems['Analysis_One']);\n //var_dump($metaDataFileLink);\n \n $data = [\n 'submitter' => [\n 'text' => $this->submitter],\n 'submitter_email' => [\n 'text' => $this->submitter_email],\n 'team' => [\n 'text' => $this->team],\n 'chemist' => [\n 'text' => $this->chemist],\n 'set_code' => [\n 'text' => $this->set_code],\n 'type' => [\n 'text' => $this->type],\n 'crop' => [\n 'text' => $this->crop],\n 'sample_number' => [\n 'text' => $this->number],\n 'p_name' => [\n 'text' => $this->p_name],\n 'p_code' => [\n 'text' => $this->p_code],\n 'exp_reference' => [\n 'text' => $this->exp_reference],\n 'compounds' => [\n 'text' => $this->compounds],\n 'set_reason' => [\n 'text' => $this->set_reason],\n 'comments' => [\n 'text' => $this->comments],\n 'date' => [\n 'text' => $this->date],\n 'sample_loc' => [\n 'text' => $this->sample_loc],\n 'containment' => [\n 'text' => $this->containment],\n 'containment_details' => [\n 'text' => $this->containment_details],\n //'metaFile' => [\n // 'text' => $this->metaFile],\n 'status' => [\n 'text' => $this->status]\n ];\n return array_merge($data, $analysisItems, $DataFileLink);\n }", "function directory_contents()\n\t{\n\t\t$this->datatables();\n\n\t\t$dir_id\t= ee()->input->get('directory_id');\n\t\t$dir\t= $this->directory($dir_id, FALSE, TRUE);\n\n\t\t$offset\t= ee()->input->get('offset');\n\t\t$limit\t= ee()->input->get('limit');\n\n\t\t$data = $dir ? call_user_func($this->config['directory_contents_callback'], $dir, $limit, $offset) : array();\n\n\t\tif (count($data) == 0)\n\t\t{\n\t\t\techo '{}';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['files'] = $this->find_thumbs($dir, $data['files']);\n\n\t\t\tforeach ($data['files'] as &$file)\n\t\t\t{\n\t\t\t\tunset($file['encrypted_path']);\n\t\t\t}\n\n\t\t\t$data['id'] = $dir_id;\n\t\t\techo json_encode($data);\n\t\t}\n\t\texit;\n\t}", "function getData() {\n checkIfNotAjax();\n $this->libauth->check(__METHOD__);\n $cpData = $this->BeOnemdl->getDataTable();\n $this->BeOnemdl->outputToJson($cpData);\n }", "function getData() {\r\n // get srId from URL\r\n $srID = URL::getParameter('sr_id');\r\n if (!$srID) {\r\n // get srID from incident\r\n if (!$incidentID = intval(URL::getParameter('i_id'))) {\r\n echo $this->reportError('Invalid ID');\r\n return;\r\n }\r\n $incident = RNCPHP\\Incident::fetch(intval($incidentID));\r\n if (!is_null($incident)) {\r\n $srID = $incident->CustomFields->Accelerator->siebel_sr_id;\r\n }\r\n }\r\n\r\n // render data to javascript\r\n $this->data['js']['sr_id'] = $srID;\r\n $this->data['js']['ext_server_type'] = $this->extServerType;\r\n $this->data['js']['development_mode'] = IS_DEVELOPMENT;\r\n }", "static public function get_standard_data() {\n\n $_types = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/types' ) ) );\n $_fields = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/fields' ) ) );\n $_groups = json_decode( wp_remote_retrieve_body( wp_remote_get( WPP_API_URL_STANDARDS . '/groups' ) ) );\n\n return (object) array(\n 'types' => $_types->data,\n 'fields' => $_fields->data,\n 'groups' => $_groups->data,\n );\n\n }", "function main() {\n\t\t// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!\n\t\tglobal $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// set the path for navigation bar\n\t\t$infoPath = $this->pObj->getFolderNavBar($this->pObj->pathInfo);\n\n\t\t// create a instance of dam object\n\t\t$damObj = &t3lib_div::getUserObj('tx_dam');\n\n\t\t// create a html table with the informations from local server\n\t\t$table = '';\n\t\t$table .= '<table class=\"typo3-dblist typo3-filelist\" cellspacing=\"0\" border=\"0\" style=\"width:100%\">';\n\t\t$table .= '<tr>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"filename\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"size\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"status\").'</td>';\n\t\t$table .= '</tr>';\n\n\n\t\t$dh = dir($this->pObj->pathInfo['dir_path_absolute']);\n\t\t$count = 0;\n\t\twhile (false !== ($entry = $dh->read()))\n\t\t{\n\t\t\tif($entry!=='.' and $entry!=='..' and is_file($this->pObj->pathInfo['dir_path_absolute'].$entry))\n\t\t\t{\n\t\t\t\tif(($count%2) == 0)\n\t\t\t\t\t$rowColor = '#FAFAFA';\n\t\t\t\telse\n\t\t\t\t\t$rowColor = '#F5F5F5';\n\n\t\t\t\t$fieldList = 'uid,pid,file_name, file_path, file_size,tx_damivsvideobasic_encode,tx_damivsvideobasic_status';\n\t\t\t\t$meta = $damObj->meta_getDataForFile($this->pObj->pathInfo['dir_path_absolute'].$entry, $fieldList);\n\t\t\t\t//t3lib_div::devLog('File Meta', 'dam_ivs_videobasic', 1, array('result' => $meta));\n\t\t\t\t$table .= '<tr style=\"background-color:'.$rowColor.';\">';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_name'].'</td>';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_size'].'</td>';\n\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='0')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"notsubmitted\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='1')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"wait\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='2')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"encodingerror\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='3')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"ready\");\n\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['tx_damivsvideobasic_status'].'</td>';\n\t\t\t\t$table .= '</tr>';\n\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$table .= '</table>';\n\n\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section($LANG->getLL(\"title\"),$table,0,1);\n\n\t\t$theOutput.=$this->pObj->doc->divider(5);\n\n\t\t$menu=array();\n\t\t$menu[]=t3lib_BEfunc::getFuncCheck($this->pObj->id,\"SET[tx_dam_ivs_videobasic_modfunc_status_check]\",$this->pObj->MOD_SETTINGS[\"tx_dam_ivs_videobasic_modfunc_status_check\"]).$LANG->getLL(\"checklabel\");\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section(\"Menu\",implode(\" - \",$menu),0,1);\n\n\t\treturn $theOutput;\n\t}", "public function get_data()\n {\n\n\n }", "private function getData()\n {\n $data = array();\n\n $data = array_merge($data,\n $this->services->CalendarData->currentUserData(),\n $this->services->Common->subPageName( $this->timber->translator->trans('Calendar') . \" | \" ),\n $this->services->Common->runtimeScripts( 'calendar' ),\n $this->services->Common->injectScripts(array(\n 'projectsEvents' => $this->services->CalendarData->projectsEvents(),\n 'tasksEvents' => $this->services->CalendarData->tasksEvents(),\n 'projectsEventsColor' => '#ecf0f1',\n 'projectsEventsTextColor' => '#2c3e50',\n 'tasksEventsColor' => '#bdc3c7',\n 'tasksEventsTextColor' => '#2980b9',\n 'calEvent_id' => $this->timber->translator->trans('ID'),\n 'calEvent_iden' => $this->timber->translator->trans('Identifier'),\n 'calEvent_type' => $this->timber->translator->trans('Type'),\n 'calEvent_mi_id' => $this->timber->translator->trans('Milestone ID'),\n 'calEvent_mi_title' => $this->timber->translator->trans('Milestone Title'),\n 'calEvent_pr_id' => $this->timber->translator->trans('Project ID'),\n 'calEvent_owner_id' => $this->timber->translator->trans('Owner ID'),\n 'calEvent_assign_to' => $this->timber->translator->trans('Assignee ID'),\n 'calEvent_assign_to_name' => $this->timber->translator->trans('Assignee Name'),\n 'calEvent_assign_to_email' => $this->timber->translator->trans('Assignee Email'),\n 'calEvent_title' => $this->timber->translator->trans('Title'),\n 'calEvent_description' => $this->timber->translator->trans('Description'),\n 'calEvent_status' => $this->timber->translator->trans('Status'),\n 'calEvent_progress' => $this->timber->translator->trans('Progress'),\n 'calEvent_priority' => $this->timber->translator->trans('Priority'),\n 'calEvent_start_at' => $this->timber->translator->trans('Start at'),\n 'calEvent_end_at' => $this->timber->translator->trans('End at'),\n 'calEvent_created_at' => $this->timber->translator->trans('Created at'),\n 'calEvent_updated_at' => $this->timber->translator->trans('Updated at'),\n 'calEvent_currency' => $this->timber->translator->trans('Currency'),\n 'calEvent_reference' => $this->timber->translator->trans('Reference'),\n 'calEvent_ref_id' => $this->timber->translator->trans('Reference ID'),\n 'calEvent_version' => $this->timber->translator->trans('Version'),\n 'calEvent_budget' => $this->timber->translator->trans('Budget'),\n 'calEvent_tax_value' => $this->timber->translator->trans('Tax Value'),\n 'calEvent_tax_type' => $this->timber->translator->trans('Tax Type'),\n 'calEvent_discount_value' => $this->timber->translator->trans('Discount Value'),\n 'calEvent_discount_type' => $this->timber->translator->trans('Discount Type'),\n 'calEvent_attach' => $this->timber->translator->trans('Attachments'),\n 'calEvent_owners' => $this->timber->translator->trans('Owners'),\n 'calEvent_staff' => $this->timber->translator->trans('Staff'),\n 'calEvent_clients' => $this->timber->translator->trans('Clients'),\n 'calEvent_staff_ids' => $this->timber->translator->trans('Staff IDs'),\n 'calEvent_clients_ids' => $this->timber->translator->trans('Clients IDs'),\n ))\n );\n\n return $data;\n }", "public function getData()\n {\n // {\n // $data = $this->model->getUsername;\n // $this->buffer->addData('home', $data);\n // } else {\n // $data = \"signin\";\n // $this->buffer->addData('home', $data);\n // }\n $this->data['action'] = \"Sorry\";\n $this->data['entity'] = \"This page does not exist\";\n $this->data['home'] = \"signin\";\n\n $this->data['scripts'] = [];\n }" ]
[ "0.6340298", "0.5886928", "0.5797166", "0.5773532", "0.5747859", "0.5736553", "0.5736553", "0.5736553", "0.57359314", "0.5723723", "0.57021576", "0.5700536", "0.5697103", "0.5683941", "0.5634051", "0.5600706", "0.5598977", "0.5584233", "0.5582235", "0.5574006", "0.5569263", "0.5566924", "0.5564481", "0.5542325", "0.55418676", "0.55397224", "0.553187", "0.55043113", "0.5501127", "0.5484669" ]
0.6554595
0
/ / / SAVE AN ITEM / / This is the function that saves a bug after it has been edited. | /
public function saveItem() // { $this->autorender = false; // $this->layout = null; // $this->render('ajax'); // $params = json_decode(file_get_contents('php://input'),true); // $thisItem=$params['fullData']; // Controller::loadModel('Bugs'); // $data = array(); // $data['Bugs']['parentid'] = 0; // $data['Bugs']['bugorfeature'] = $thisItem['bugorfeature']; // $data['Bugs']['fileid'] = 0; // $data['Bugs']['dataObject'] = json_encode($thisItem['dataObject']); // $data['Bugs']['userid']=$this->Auth->user('id'); // $data['Bugs']['user']=$this->Auth->user('username'); // $data['Bugs']['status'] = 0; // $this->Bugs->id=$thisItem['id']; // $this->Bugs->save($data); // // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Save($item)\n {\n $item->Save();\n }", "abstract protected function saveItems();", "public function saveitem()\r\n\t{ /*{{{*/\r\n // check for required data \r\n if(!isset(self::$input['post-title']) || empty(self::$input['post-title']))\r\n ImMsgReporter::setClause('err_required_field', \r\n array('fieldname' => ImMsgReporter::getClause('title')));\r\n if(!isset(self::$input['post-category']) || empty(self::$input['post-category']))\r\n ImMsgReporter::setClause('err_required_field', \r\n array('fieldname' => ImMsgReporter::getClause('category')));\r\n if(!ImCategory::is_cat_valid(self::$input['post-category']))\r\n ImMsgReporter::setClause('invalid_category', \r\n array('fieldname' => ImMsgReporter::getClause('category')));\r\n $msg = ImMsgReporter::msgs();\r\n if(!empty($msg))\r\n return false;\r\n if(!ImCategory::setCategory(self::$input['post-category']))\r\n return false;\r\n \r\n \r\n $fields = self::custom_fields();\r\n\r\n\t\t$id = clean_urls(to7bits(self::$input['post-title']));\r\n $title = safe_slash_html_input(self::$input['post-title']);\r\n \r\n $orig_file = isset(self::$input['id']) ? ITEMDATA.self::$input['id'].'.xml' : ''.'.xml';\r\n\t\tif(file_exists($orig_file) && $id != self::$input['id'])\r\n\t\t\tunlink($orig_file);\r\n\r\n // validate category\r\n if(!ImCategory::is_cat_valid(self::$input['post-category']))\r\n {\r\n ImMsgReporter::setClause('invalid_category');\r\n return false;\r\n }\r\n $category = safe_slash_html_input(self::$input['post-category']);\r\n // avoid id duplication within same category (new item only)\r\n if(!self::$input['edititem'])\r\n {\r\n if(in_array($id, $this->item_ids()))\r\n {\r\n ImMsgReporter::setClause('err_item_exists', array('std_name' => $title));\r\n return false;\r\n }\r\n } \r\n $page = isset(self::$input['post-page']) ? safe_slash_html_input(self::$input['post-page']) : '';\r\n\t\t$content = isset(self::$input['post-content']) ? safe_slash_html_input(self::$input['post-content']) : '';\r\n\t\tif (!$data_date = $this->get_item_data($id, 'date', true))\r\n\t\t\t$date = date('j M Y');\r\n\t\telse\r\n\t\t\t$date = $data_date;\r\n \r\n\t\t$xml = @new SimpleXMLExtended(XMLTAG.'<item></item>');\r\n\t\t$xml->addChild('title', empty($title) ? '(no title)' : $title);\r\n\t\t$xml->addChild('slug', $id);\r\n\t\t$xml->addChild('visible', isset(self::$input['post-visible']) \r\n ? (string)self::$input['post-visible'] : 1);\r\n $xml->addChild('promo', isset(self::$input['post-promo']) \r\n ? (string)self::$input['post-promo'] : 0);\r\n\t\t$xml->addChild('date', $date);\r\n\t\t$xml->addChild('category', $category);\r\n $xml->addChild('page', $page);\r\n\t\t$note = $xml->addChild('content'); \r\n\t\t$note->addCData($content);\r\n\r\n $FILE = ITEMDATA . $id . '.xml';\r\n \r\n if(!isset($fields) || !is_array($fields) || count($fields) < 1)\r\n {\r\n XMLsave($xml, $FILE);\r\n if (!is_writable($FILE))\r\n {\r\n ImMsgReporter::setClause('err_unable_to_write', array('data_file' => $FILE));\r\n return false;\r\n }\r\n ImMsgReporter::setClause('succesfull_saved', array('data_file' => $FILE));\r\n return true;\r\n }\r\n\r\n\t\tforeach($fields as $field)\r\n\t\t{\r\n\t\t\tif($field['type'] == 'uploader')\r\n\t\t\t{\r\n\r\n\t\t\t\t$fieldname = 'post-'.$field['key'];\r\n\t\t\t\tif(!isset(self::$input[$fieldname]))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t$imgname = basename(self::$input[$fieldname]);\r\n\t\t\t\t// Get file (old item field value)\r\n\t\t\t\t$filename = $this->get_item_data($id, $field['key'], true);\r\n\t\t\t\t// File field isn't empty\r\n\t\t\t\tif(!empty($imgname) /*&& ( file_exists(SPLUGINPATH.'imanager/uploadscript/tmp/' . basename($imgname))\r\n\t\t\t\t\t\t|| ( file_exists(ITEMUPLOADPATH . basename($imgname)) ))*/)\r\n\t\t\t\t{\r\n\t\t\t\t\t// New file, empty field or bullshit\r\n\t\t\t\t\tif(self::$input[$fieldname] != $filename)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Check new file and file in use\r\n\t\t\t\t\t\tif(file_exists(GSPLUGINPATH.'imanager/uploadscript/tmp/' . basename($imgname)))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t@list($uid, $datetime, $stdname) = explode('_', $imgname, 3);\r\n\t\t\t\t\t\t\t$newfile = '/' . ITEMUPLOADDIR . $stdname;\r\n\t\t\t\t\t\t\tif($this->is_file_in_use(ITEMUPLOADPATH . basename($stdname), $field['key'], $id))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tImMsgReporter::setClause('err_file_exists', array('std_name' => $stdname));\r\n\t\t\t\t\t\t\t\tself::$input[$fieldname] = $filename;\r\n\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif (!copy(GSPLUGINPATH.'imanager/uploadscript/tmp/' . basename($imgname), ITEMUPLOADPATH . basename($newfile))) {\r\n\t\t\t\t\t\t\t\t\tImMsgReporter::setClause('err_copy_fail', array('old_file' => $oldfile));\r\n\t\t\t\t\t\t\t\t\tself::$input[$fieldname] = $filename;\r\n\t\t\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif(file_exists(ITEMUPLOADPATH . basename($filename)))\r\n\t\t\t\t\t\t\t\t\t\t@unlink(ITEMUPLOADPATH . basename($filename));\r\n\t\t\t\t\t\t\t\t\tself::$input[$fieldname] = $newfile;\r\n\t\t\t\t\t\t\t\t}\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// Old file\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tself::$input[$fieldname] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else\r\n\t\t\t\t{\r\n\t\t\t\t\tif(file_exists(ITEMUPLOADPATH . basename($filename)) &&\r\n\t\t\t\t\t\t!$this->is_file_in_use(ITEMUPLOADPATH . basename($filename), $field['key'], $id, true))\r\n\t\t\t\t\t\t@unlink(ITEMUPLOADPATH . basename($filename));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*// overwrite with old value or delete file\r\n\t\t\t$msg = ImMsgReporter::msgs();\r\n\t\t\tif(!empty($msg))\r\n\t\t\t\tif($this->get_item_data(self::$input['id'], $field['key'], true) != self::$input[$fieldname])\r\n\t\t\t\t\tself::$input[$fieldname] = $this->get_item_data(self::$input['id'], $field['key'], true);\r\n\t\t\t\telseif($this->get_item_data(self::$input['id'], $field['key'], true) != self::$input[$fieldname])\r\n\t\t\t\t\tif(file_exists($this->get_item_data(self::$input['id'], $field['key'], true)))\r\n\t\t\t\t\t\tunlink($this->get_item_data(self::$input['id'], $field['key'], true));*/\r\n \r\n\t\t\tif(isset(self::$input['post-'.$field['key']])) \t\t\r\n\t\t\t{\r\n\t\t\t if($field['key'] != 'content' && $field['key'] != 'excerpt')\t\t\t\r\n\t\t\t\t{\r\n\t\t\t\t\t$tmp = $xml->addChild(safe_slash_html_input($field['key']));\r\n\t\t\t\t\t$tmp->addCData(safe_slash_html_input(self::$input['post-'.$field['key']]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n \r\n XMLsave($xml, $FILE);\r\n\t\tif (!is_writable($FILE))\r\n {\r\n ImMsgReporter::setClause('err_unable_to_write', array('data_file' => basename($FILE)));\r\n return false;\r\n }\r\n ImMsgReporter::setClause('succesfull_saved', array('data_file' => basename($FILE)));\r\n return true;\r\n }", "function saveItem(cacheItem $item);", "protected function save()\n\t{\n\t\t$this->saveItems();\n\t\t//$this->saveAssignments();\n\t\t//$this->saveRules();\n\t}", "function save(List8D_Model_Item $item) {\n\t\t//$this->_db->setFetchMode(Zend_Db::FETCH_OBJ);\n\t\t\n\t\t$objectData = $this->getObjectDataArray($item);\n\t\t\n\t\tif($item->getId() === null){\n\t\t\t//insert\n\t\t\t$objectData['created'] = date('Y-m-d H:m:s');\n\t\t\t$objectData['updated'] = date('Y-m-d H:m:s');\n\t\t\t$this->getDbTable()->insert($objectData);\n\t\t\t$item->setId($this->getDbTable()->getAdapter()->lastInsertId());\n\t\t\t\n\t\t\t// creating a new item, so add some data by default\n\t\t\t//$item->setPrivateNotes('');\n\t\t\t//$item->setCoreText(0);\n\t\t\t//$item->setRecommendedForPurchase(0);\n\t\t\t\n\t\t\t// log the insert/duplicate\n\t\t\tif ($item->getDuplicate()) {\n\t\t\t\t$item->log(array('action'=>'duplicate', 'table'=>$this->getDbTable()->info('name'), 'id'=>$item->getId(), 'column'=>'', 'value_from'=>$item->getDuplicate(), 'value_to'=>''));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$item->log(array('action'=>'insert', 'table'=>$this->getDbTable()->info('name'), 'id'=>$item->getId()));\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t//update\n\t\t\t$objectData['updated'] = date('Y-m-d H:m:s');\n\t\t\t\n\t\t\t// we have to do a select first to find out what the current values are for logging (see below)\n\t\t\t$existingData = $this->getDbTable()->fetchAll($this->getDbTable()->select()->where( 'id = ?', $item->getId()));\n\t\t\t\n\t\t\t$this->getDbTable()->update($objectData, \"id = \".$item->getId());\n\t\t\t\n\t\t\t// log changes\n\t\t\t// go through every piece of data for the object and if it's changed, make a separate log entry for it\n\t\t\tforeach ($objectData as $key=>$value) {\n\t\t\t\tif ($objectData[$key] != $existingData[0][$key]) {\n\t\t\t\t\t$item->log(array('action'=>'update', 'table'=>$this->getDbTable()->info('name'), 'id'=>$item->getId(), 'column'=>$key, 'value_from'=>$existingData[0][$key], 'value_to'=>$objectData[$key]));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->saveData($item);\n\t}", "function beforesave(){\n\t\t// if it returns true, the item will be saved; if it returns false, it won't\n\t\treturn true;\n\t}", "function save(){\n\t\t// returns the item's id if successful\n\t\tif($this->beforesave()){\n\t\t\t$query = ($this->id?\"UPDATE \":\"INSERT INTO \").$this->tablename.\" SET \";\n\t\t\t$qvalues = \"\";\n\t\t\tforeach($this->dbvariables as $key){\n\t\t\t\t$qvalues .= ($qvalues == \"\"?\"\":\", \").$key.\"='\".trim(addslashes($this->$key)).\"'\";\n\t\t\t}\n\t\t\t$query .= $qvalues;\n\t\t\tif($this->id){\n\t\t\t\t$query .= \" WHERE id=\".$this->id;\n\t\t\t}else{\n\t\t\t\t$query .= \", item_order=\".get_neworder($this->tablename, $this->neworder_where());\n\t\t\t}\n\t\t\tmy_debug(\"Attempting query: \".$query,__FILE__,__LINE__,\"green\");\n\t\t\tif(mysql_query($query)){\t\t\t\t\n\t\t\t\tif(!$this->id && mysql_insert_id())\t$this->id = mysql_insert_id();\n\t\t\t\t$this->onsave();\n\t\t\t\treturn $this->id;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\n\t}", "function onAfterSaveField( &$field, &$post, &$file, &$item ) {\r\n\t}", "public function hookAfterSaveItem($args) {\n $item = $args['record'];\n if ($item->item_type_id != get_option('iiifitems_annotation_item_type')) {\n $json = IiifItems_Util_Canvas::buildCanvas($item);\n IiifApiBridge_Util_JsonTransform::transformCanvas($json, $item);\n if ($args['insert']) {\n IiifApiBridge_Queue_Canvas::create($item, $json);\n } else {\n IiifApiBridge_Queue_Canvas::update($item, $json);\n }\n if (!empty($item->collection_id)) {\n $this->hookAfterSaveCollection(array(\n 'record' => get_record_by_id('Collection', $item->collection_id),\n 'insert' => false,\n ));\n }\n } else {\n $annotatedItem = IiifItems_Util_Annotation::findAnnotatedItemFor($item);\n $json = IiifItems_Util_Annotation::buildAnnotation($item);\n IiifApiBridge_Util_JsonTransform::transformAnnotation($json, $item, $annotatedItem);\n if ($args['insert']) {\n IiifApiBridge_Queue_Annotation::create($item, $json);\n } else {\n IiifApiBridge_Queue_Annotation::update($item, $json);\n }\n if (!empty($annotatedItem->collection_id)) {\n $this->hookAfterSaveCollection(array(\n 'record' => get_record_by_id('Collection', $annotatedItem->collection_id),\n 'insert' => false,\n ));\n }\n }\n }", "public function save()\n {\n if($this->changed) {\n Item::saveNewValues($this->id, $this->name, $this->status);\n } else {\n echo 'Nothing changed!';\n }\n }", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "public function ___save(Saveable $item) {\n\n\t\t$blank = $this->makeBlankItem();\n\t\t\n\t\tif(!$item instanceof $blank) {\n\t\t\t$className = $blank->className();\n\t\t\tthrow new WireException(\"WireSaveableItems::save(item) requires item to be of type: $className\");\n\t\t}\n\n\t\t$database = $this->wire()->database; \n\t\t$table = $database->escapeTable($this->getTable());\n\t\t$sql = \"`$table` SET \";\n\t\t$id = (int) $item->id;\n\t\t$this->saveReady($item); \n\t\t$data = $item->getTableData();\n\t\t$binds = array();\n\n\t\tforeach($data as $key => $value) {\n\t\t\tif(!$this->saveItemKey($key)) continue; \n\t\t\tif($key === 'data') $value = is_array($value) ? $this->encodeData($value) : '';\n\t\t\t$key = $database->escapeTableCol($key);\n\t\t\t$bindKey = $database->escapeCol($key);\n\t\t\t$binds[\":$bindKey\"] = $value; \n\t\t\t$sql .= \"`$key`=:$bindKey, \";\n\t\t}\n\n\t\t$sql = rtrim($sql, \", \"); \n\n\t\tif($id) {\n\t\t\t\n\t\t\t$query = $database->prepare(\"UPDATE $sql WHERE id=:id\");\n\t\t\tforeach($binds as $key => $value) {\n\t\t\t\t$query->bindValue($key, $value); \n\t\t\t}\n\t\t\t$query->bindValue(\":id\", $id, \\PDO::PARAM_INT);\n\t\t\t$result = $query->execute();\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$query = $database->prepare(\"INSERT INTO $sql\"); \n\t\t\tforeach($binds as $key => $value) {\n\t\t\t\t$query->bindValue($key, $value); \n\t\t\t}\n\t\t\t$result = $query->execute();\n\t\t\tif($result) {\n\t\t\t\t$item->id = (int) $database->lastInsertId();\n\t\t\t\t$this->getAll()->add($item);\n\t\t\t\t$this->added($item);\n\t\t\t}\n\t\t}\n\n\t\tif($result) {\n\t\t\t$this->saved($item); \n\t\t\t$this->resetTrackChanges();\n\t\t} else {\n\t\t\t$this->error(\"Error saving '$item'\"); \n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function adminQuickSave(array &$item_info, $type)\r\n\t{\r\n\t\treturn;\r\n\t}", "public function saveItem(Item $item) {\n\t\tif ($item->getId() == -1) {\n\t\t\t$q = $this->bdd->prepare('INSERT INTO items SET created = :created, expired = :expired, title = :title, link = :link, affiliate_link = :affiliate_link, content = :content, photo_link = :photo_link, code = :code, normal_price = :normal_price, promo_price = :promo_price, discount = :discount, quantity = :quantity, shop = :shop, status = :status');\n\t\t} else {\n\t\t\t$q = $this->bdd->prepare('UPDATE items SET created = :created, expired = :expired, title = :title, link = :link, affiliate_link = :affiliate_link, content = :content, photo_link = :photo_link, code = :code, normal_price = :normal_price, promo_price = :promo_price, discount = :discount, quantity = :quantity, shop = :shop, status = :status WHERE id = :id');\n\t\t\t$q->bindValue(':id', $item->getId(), PDO::PARAM_INT);\n\t\t}\n\t\t$q->bindValue(':created', $item->getCreated(), PDO::PARAM_STR);\n\t\t$q->bindValue(':expired', $item->getExpired(), PDO::PARAM_STR);\n\t\t$q->bindValue(':title', $item->getTitle(), PDO::PARAM_STR);\n\t\t$q->bindValue(':link', $item->getLink(), PDO::PARAM_STR);\n\t\t$q->bindValue(':affiliate_link', $item->getAffiliateLink(), PDO::PARAM_STR);\n\t\t$q->bindValue(':content', $item->getContent(), PDO::PARAM_STR);\n\t\t$q->bindValue(':photo_link', $item->getPhotoLink(), PDO::PARAM_STR);\n\t\t$q->bindValue(':code', $item->getCode(), PDO::PARAM_STR);\n\t\t$q->bindValue(':normal_price', $item->getNormalPrice(), PDO::PARAM_STR);\n\t\t$q->bindValue(':promo_price', $item->getPromoPrice(), PDO::PARAM_STR);\n\t\t$q->bindValue(':discount', $item->getDiscount(), PDO::PARAM_INT);\n\t\t$q->bindValue(':quantity', $item->getQuantity(), PDO::PARAM_INT);\n\t\t$q->bindValue(':shop', $item->getShop(), PDO::PARAM_STR);\n\t\t$q->bindValue(':status', $item->getStatus(), PDO::PARAM_STR);\n\n\n\t\t$q->execute();\n\t\tif ($item->getId() == -1) $item->setId($this->bdd->lastInsertId());\n\t}", "public function saved(Item $item) {\n if ($item->quantity <= $item->minimum_quantity && !$item->depleted) {\n $item->depleted = true;\n $item->save();\n\n // send email to manager\n $managerRole = Role::where('name', 'manager')->first();\n $manager = $managerRole->users->first();\n\n Mail::to($manager->email)->send(new InventoryDepletionMail(), compact('item'));\n }\n }", "public function testSaveTimesheetItem() {\n\n $timesheetItem = TestDataService::fetchObject('TimesheetItem', 1);\n\n $this->assertEquals(\"Good\", $timesheetItem->getComment());\n\n $timesheetItem->setComment(\"Bad\");\n\n\n $this->timesheetDao->saveTimesheetItem($timesheetItem);\n $savedTimesheetItem = TestDataService::fetchObject('TimesheetItem', $timesheetItem->getTimesheetItemId());\n\n\n $this->assertEquals($timesheetItem->getDuration(), $savedTimesheetItem->getDuration());\n $this->assertEquals($timesheetItem->getComment(), $savedTimesheetItem->getComment());\n $this->assertEquals($timesheetItem->getDate(), $savedTimesheetItem->getDate());\n }", "public function onAfterSaveField(&$field, &$post, &$file, &$item)\n\t{\n\t}", "function save()\r\n {\r\n $GLOBALS['DB']->exec(\"INSERT INTO inventory_items (name) VALUES ('{$this->getName()}')\");\r\n $this->id = $GLOBALS['DB']->lastInsertId();\r\n }", "function saveItem($db, $resource_pk, $item) {\r\n\r\n $prefix = DB_TABLENAME_PREFIX;\r\n if (!isset($item->item_pk)) {\r\n $sql = <<< EOD\r\nINSERT INTO {$prefix}item (resource_link_pk, item_title, item_text, item_url, max_rating, step, visible, sequence, created, updated)\r\nVALUES (:resource_pk, :item_title, :item_text, :item_url, :max_rating, :step, :visible, :sequence, :created, :updated)\r\nEOD;\r\n } else {\r\n $sql = <<< EOD\r\nUPDATE {$prefix}item\r\nSET item_title = :item_title, item_text = :item_text, item_url = :item_url, max_rating = :max_rating, step = :step, visible = :visible,\r\n sequence = :sequence, updated = :updated\r\nWHERE (item_pk = :item_pk) AND (resource_link_pk = :resource_pk)\r\nEOD;\r\n }\r\n $query = $db->prepare($sql);\r\n $item->updated = new DateTime();\r\n if (!isset($item->item_pk)) {\r\n $item->created = $item->updated;\r\n $item->sequence = getNumItems($db, $resource_pk) + 1;\r\n $query->bindValue('created', $item->created->format('Y-m-d H:i:s'), PDO::PARAM_STR);\r\n } else {\r\n $query->bindValue('item_pk', $item->item_pk, PDO::PARAM_INT);\r\n }\r\n $query->bindValue('item_title', $item->item_title, PDO::PARAM_STR);\r\n $query->bindValue('item_text', $item->item_text, PDO::PARAM_STR);\r\n $query->bindValue('item_url', $item->item_url, PDO::PARAM_STR);\r\n $query->bindValue('max_rating', $item->max_rating, PDO::PARAM_INT);\r\n $query->bindValue('step', $item->step, PDO::PARAM_INT);\r\n $query->bindValue('visible', $item->visible, PDO::PARAM_INT);\r\n $query->bindValue('sequence', $item->sequence, PDO::PARAM_INT);\r\n $query->bindValue('updated', $item->updated->format('Y-m-d H:i:s'), PDO::PARAM_STR);\r\n $query->bindValue('resource_pk', $resource_pk, PDO::PARAM_INT);\r\n\r\n return $query->execute();\r\n\r\n }", "private function _store(Yourdelivery_Model_Inventory $item) {\n $request = $this->getRequest();\n $form = new Yourdelivery_Form_Administration_Inventory_Create();\n if ($form->isValid($request->getPost())) {\n\n if (!$this->_subChecks($form)) {\n return;\n }\n\n $values = $form->getSubForm('item')->getValues();\n $values['item']['printerNextDate'] = date('Y-m-d H:i:s', strtotime($values['item']['printerNextDate']));\n $item->setData($values['item']);\n $item->save();\n\n //store all the stati for creation \n $item->addComment('needs', $form->getSubform('status')->getValue('statusCommentNeeds'), $form->getSubform('status')->getValue('statusNeeds'), $this->session->admin->getId());\n $item->addComment('printer', $form->getSubform('status')->getValue('statusCommentPrinterCost'), $form->getSubform('status')->getValue('statusPrinterCost'), $this->session->admin->getId());\n $item->addComment('website', $form->getSubform('status')->getValue('statusCommentWebsite'), $form->getSubform('status')->getValue('statusWebsite'), $this->session->admin->getId());\n $item->addComment('flyer', $form->getSubform('status')->getValue('statusCommentFlyer'), $form->getSubform('status')->getValue('statusFlyer'), $this->session->admin->getId());\n $item->addComment('terminal', $form->getSubform('status')->getValue('statusCommentTerminal'), $form->getSubform('status')->getValue('statusTerminal'), $this->session->admin->getId());\n\n $this->_redirect('administration_inventory/overview');\n }\n else {\n $this->view->post = $request->getPost();\n $this->error($form->getMessages());\n $this->error(__b(\"Konnte Posten nicht anlegen\"));\n }\n }", "function save()\n {\n }", "function save()\n {\n }", "public function save()\n {\n // Quantity is reset to 1 if it's not specified, so make sure it's included\n if (count($this->updatedFields) AND !in_array('Quantity', $this->updatedFields)) {\n $this->updatedFields[] = 'Quantity';\n }\n\n // Need to save custom fields first\n $this->saveCustom();\n parent::save();\n }", "function saveItem(cacheItem $item){\n\t\tif(empty($item->content))\n\t\t\t$this->removeItem($item);\n\t\t$item->cacheTime = date('Y-m-d H:i:s');\n\t\t$values = $this->db->process_conds(array('(?)',$item->datas));\n\t\treturn $this->db->query('REPLACE INTO '.self::$tableName.' (name,content,cacheTime) VALUES '.$values);\n\t}", "public\tfunction\tsave()\n\t\t{\n\t\t}", "protected function _postSave()\r\n\t{\r\n\t}", "protected function _save($item) {\n $save = array(\n 'item_latitude' => filter($this->input->post('item_latitude', TRUE), 'float'),\n 'item_longitude' => filter($this->input->post('item_longitude', TRUE), 'float'),\n 'item_category' => filter($this->input->post('item_category', TRUE), 'str', 30),\n 'item_address' => filter($this->input->post('item_address', TRUE), 'str', 200),\n 'item_message' => filter($this->input->post('item_message', TRUE), 'text', 5000),\n 'item_status' => STATUS_INWORK,\n );\n\n $this->point->update($item, $save);\n $this->point->update_status($item, $save['item_status']);\n\n log_write(LOG_INFO, 'Point save, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n\n return $this->_send_backend($item, $save);\n }", "public function autosave() {\n\t $this->use_layout=false;\n\t $this->use_view=false;\n\t $content = new $this->model_class(Request::get(\"id\"));\n\t if($content->primval) {\n\t $content->update_attributes($_POST[\"cms_content\"]);\n\t echo date(\"H:i:s\");\n\t }else{\n\t throw new WXRoutingException('Tried to save in a non-existing database entry!', \"Page not found\", '404');\n\t }\n\t exit;\n\t}" ]
[ "0.7169478", "0.69773275", "0.6822178", "0.67539", "0.6736882", "0.67155355", "0.6656941", "0.6631331", "0.65431476", "0.65350354", "0.6516757", "0.65034693", "0.6444046", "0.64094305", "0.6404104", "0.637812", "0.63746905", "0.63365066", "0.6309502", "0.6296409", "0.6296367", "0.6293263", "0.62702924", "0.62702924", "0.6268018", "0.6253683", "0.6226552", "0.61948025", "0.6194723", "0.61868376" ]
0.69943875
1
Get view images data from themes
private function getViewImages(array $themes) : array { $viewImages = []; foreach ($themes as $theme) { $config = $this->viewConfig->getViewConfig([ 'area' => Area::AREA_FRONTEND, 'themeModel' => $theme, ]); $images = $config->getMediaEntities('Magento_Catalog', ImageHelper::MEDIA_TYPE_CONFIG_NODE); foreach ($images as $imageId => $imageData) { $uniqIndex = $this->getUniqueImageIndex($imageData); $imageData['id'] = $imageId; $viewImages[$uniqIndex] = $imageData; } } return $viewImages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getThemeImagesUrl()\n {\n return $this->themeObjects[self::CURRENT_THEME]->getStaticImagesUrl();\n }", "function get_theme_data($theme_file)\n {\n }", "public static function theme_images() {\r\n add_image_size('slideshow-980', 980, 420, true);\r\n add_image_size('slideshow-1200', 1180, 550, true);\r\n add_image_size('slideshow-1560', 1540, 550, true);\r\n add_image_size('slideshow-720', 600, 550, true);\r\n add_image_size('grid-thumbnail', 370, 270, true);\r\n add_image_size('icon-60', 60, 60, true);\r\n add_image_size('icon-100', 100, 100, true);\r\n add_image_size('icon-40', 40, 40, true);\r\n }", "function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}", "function load_theme_image_cache($db, $site, $true_theme, $true_lang)\n{\n global $THEME_IMAGES_CACHE, $THEME_IMAGES_SMART_CACHE_LOAD, $SMART_CACHE;\n\n if ($THEME_IMAGES_SMART_CACHE_LOAD == 0) {\n $THEME_IMAGES_CACHE[$site] = $SMART_CACHE->get('theme_images_' . $true_theme . '_' . $true_lang);\n if (is_null($THEME_IMAGES_CACHE[$site])) {\n $THEME_IMAGES_CACHE[$site] = array();\n }\n } elseif ($THEME_IMAGES_SMART_CACHE_LOAD == 1) {\n $test = $db->query_select('theme_images', array('id', 'path'), array('theme' => $true_theme, 'lang' => $true_lang));\n $THEME_IMAGES_CACHE[$site] = collapse_2d_complexity('id', 'path', $test);\n }\n\n $THEME_IMAGES_SMART_CACHE_LOAD++;\n}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "function get_themes()\n {\n }", "public function getViews(){\n\n if($this->safe($this->views)){\n //extract vlozi obsah z promenne do pohledu\n extract($this->data);\n extract($this->data, EXTR_PREFIX_ALL, \"\");\n require \"Views/\" . $this->views . \".phtml\";\n }\n }", "public function getTheme();", "public function get_theme_info(){\n\t\treturn (array)$this->theme_info;\n\t}", "public function get_lightbox_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_lightbox_themes();\n\n }", "function getThemes() {\n\n\t$themesPath = '../../content/themes';\n\n\t$list = scandir($themesPath);\n\t$baseUrl = \\Raindrop\\Core\\Config\\Config::item('baseUrl');\n\t$themes = [];\n\n\tif(!empty($list)) {\n\t\tunset($list[0]);\n\t\tunset($list[1]);\n\n\t\tforeach($list as $dir) {\n\t\t\t$pathThemeDir = $themesPath . '/' . $dir;\n\t\t\t$pathConfig = $pathThemeDir . '/theme.json';\n\t\t\t$pathScreen = $baseUrl . '/content/themes/' . $dir . '/screen.jpg';\n\n\t\t\tif(is_dir($pathThemeDir) and is_file($pathConfig)) {\n\t\t\t\t$config = file_get_contents($pathConfig);\n\t\t\t\t$info = json_decode($config);\n\n\t\t\t\t$info->screen = $pathScreen;\n\t\t\t\t$info->dirTheme = $dir;\n\n\t\t\t\t$themes[] = $info;\n\t\t\t}\n\t\t}\n\n\t}\n\treturn $themes;\n}", "public function getCurrentImagesSettings()\n {\n $currentSkinModule = \\XLite\\Core\\Database::getRepo('XLite\\Model\\Module')\n ->getCurrentSkinModule();\n\n $skinModuleName = $currentSkinModule && $currentSkinModule->getActualName() !== \"XC\\ColorSchemes\"\n ? $currentSkinModule->getActualName()\n : 'default';\n\n return \\XLite\\Core\\Database::getRepo('XLite\\Model\\ImageSettings')\n ->findByModuleName($skinModuleName);\n }", "public function getThumbnail()\n {\n return Kuler_Api::getThemeThumbnail((int) $this->ID);\n }", "protected function getGetImgResourceHookObjects() {}", "function getImageDifferentPlaces($limitImages=0) {\n \tif ($this->config['mode']=='DIRECTORY') {\n \t\t$content.=$this->getImagesDirectory($limitImages);\n \t} elseif ($this->config['mode']=='RECORDS') {\n \t\t$content.=$this->getImagesRecords($limitImages);\n } elseif ($this->config['mode']=='DAM') {\n \t\t$content.=$this->getImagesDam($limitImages);\n } elseif ($this->config['mode']=='DAMCAT') {\n \t\t$content.=$this->getImagesDamCat($limitImages);\n } \n \n // hook\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'])) {\n foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$content = $_procObj->extraBeginGalleryProcessor($content, $limitImages,$this);\n }\n } \n \treturn $content;\n }", "protected function get_image_vars()\n\t{\n\t\t$download_link = ($this->has_thumbnail()) ? $this->get_url(array('mode' => 'view')) : $this->get_url();\n\n\t\treturn array(\n\t\t\t'U_DOWNLOAD_LINK'\t=> $download_link,\n\t\t\t'L_DOWNLOAD_COUNT'\t=> 'VIEWED_COUNTS',\n\t\t\t'S_IMAGE'\t\t\t=> true,\n\t\t\t'U_INLINE_LINK'\t\t=> $download_link,\n\t\t\t'IS_PREVIEW'\t\t=> $this->is_preview(),\n\t\t);\n\t}", "private function getThemes() {\n $path = sprintf('%s/../../%s/%s/', __DIR__, PUBLIC_PATH, THEME_PATH);\n\n $themes = scandir($path);\n\n $output = [];\n foreach($themes as $theme) {\n // Check if the theme has an info.php file a && file_exists($path.$theme.'/icon.png)nd a thumbnail\n if(file_exists($path.$theme.'/info.php') && file_exists($path.$theme.'/icon.png')) {\n // Store the theme information\n require($path.$theme.'/info.php');\n $output[$theme]['name'] = $name;\n $output[$theme]['author'] = $author;\n $output[$theme]['url'] = $url;\n $output[$theme]['version'] = $version;\n $output[$theme]['path'] = $theme;\n }\n }\n\n return $output;\n }", "public function index()\n {\n return view('admin.list.images', [\n 'pageImages' => Image::where('imageType', '=', 'page')->get(),\n 'backgroundImages' => Image::where('imageType', '=', 'background')->get()\n ]);\n }", "function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}", "public function get_gallery_themes() {\n\n $instance = Envira_Gallery_Common::get_instance();\n return $instance->get_gallery_themes();\n\n }", "public function images()\n {\n return view('pages.images');\n }", "function getTeaserImages() \t{\n \t\treturn $this->teaserImagesArray;\n \t}", "public static function data_images() {\n\t\tif ( empty( self::$images ) ) {\n\t\t\tself::$images = glob( dirname( dirname( __FILE__ ) ) . '/images/*' );\n\t\t}\n\n\t\treturn self::$images;\n\t}", "function GetThemeInfo ($filename) { \n $dataBack = array();\n if ($filename != '') {\n $default_headers = array(\n 'label' => 'label',\n 'file' => 'file',\n 'columns' => 'columns'\n );\n \n $dataBack = get_file_data($filename,$default_headers,'');\n $dataBack['file'] = preg_replace('/.css$/','',$dataBack['file']); \n }\n \n return $dataBack;\n }", "function getImages() \t{\n \t\treturn $this->images_array;\n \t}", "public function presentation_images()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$data['presentation_images'] = $this->pim->get_all();\n $data['presentation_act'] = $this->pim->get_link();\n\t\t\t$this->load->view('presentation_images-admin', $data);\n\t\t}", "public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}", "public function getImageUrl();", "function find_theme_image($id, $silent_fail = false, $leave_local = false, $theme = null, $lang = null, $db = null, $pure_only = false)\n{\n global $THEME_IMAGES_CACHE, $USER_LANG_CACHED, $THEME_IMAGES_SMART_CACHE_LOAD, $RECORD_THEME_IMAGES_CACHE, $SMART_CACHE, $SITE_INFO;\n\n if ((substr($id, 0, 4) == 'cns_') && (is_file(get_file_base() . '/themes/default/images/avatars/index.html'))) { // Allow debranding of theme img dirs\n $id = substr($id, 4);\n }\n\n if ((isset($_GET['keep_theme_seed'])) && (get_param_string('keep_theme_seed', null) !== null) && (function_exists('has_privilege')) && (has_privilege(get_member(), 'view_profiling_modes'))) {\n require_code('themewizard');\n $test = find_theme_image_themewizard_preview($id, $silent_fail);\n if ($test !== null) {\n return $test;\n }\n }\n\n if ($db === null) {\n $db = $GLOBALS['SITE_DB'];\n }\n\n $true_theme = $GLOBALS['FORUM_DRIVER']->get_theme();\n if ($theme === null) {\n $theme = $true_theme;\n }\n\n $true_lang = ($USER_LANG_CACHED === null) ? user_lang() : $USER_LANG_CACHED;\n if ($lang === null) {\n $lang = $true_lang;\n }\n\n $truism = ($theme == $true_theme) && ($lang == $true_lang);\n\n $site = ($GLOBALS['SITE_DB'] == $db) ? 'site' : 'forums';\n\n if (!isset($THEME_IMAGES_CACHE[$site])) {\n load_theme_image_cache($db, $site, $true_theme, $true_lang);\n }\n\n if ((!$truism) && (!$pure_only)) { // Separate lookup, cannot go through $THEME_IMAGES_CACHE\n $path = $db->query_select_value_if_there('theme_images', 'path', array('theme' => $theme, 'lang' => $lang, 'id' => $id));\n if ($path !== null) {\n if ((url_is_local($path)) && (!$leave_local)) {\n if (is_forum_db($db)) {\n $path = get_forum_base_url() . '/' . $path;\n } else {\n if ((substr($path, 0, 22) == 'themes/default/images/') || (!is_file(get_custom_file_base() . '/' . rawurldecode($path)))) {\n $path = get_base_url() . '/' . $path;\n } else {\n $path = get_custom_base_url() . '/' . $path;\n }\n }\n }\n\n $ret = cdn_filter($path);\n if ($THEME_IMAGES_SMART_CACHE_LOAD >= 2) {\n $SMART_CACHE->append('theme_images_' . $theme . '_' . $lang, $id, $ret);\n }\n return $ret;\n }\n }\n\n if ((!$pure_only) && ($site == 'site') && (!array_key_exists($id, $THEME_IMAGES_CACHE[$site])) && ($THEME_IMAGES_SMART_CACHE_LOAD < 2)) {\n // Smart cache update\n load_theme_image_cache($db, $site, $true_theme, $true_lang);\n find_theme_image($id, true, true, $theme, $lang, $db, $pure_only);\n }\n\n if (($pure_only) || (!isset($THEME_IMAGES_CACHE[$site][$id])) || (!$truism)) {\n // Disk search...\n\n $path = null;\n\n $priorities = array();\n if (!$pure_only) { // Should do \"images_custom\" first, as this will also do a DB search\n $priorities = array_merge($priorities, array(\n array($theme, $lang, 'images_custom'),\n array($theme, '', 'images_custom'),\n ($lang == fallback_lang()) ? null : array($theme, fallback_lang(), 'images_custom'),\n ));\n }\n // This will not do a DB search, just a filesystem search. The Theme Wizard makes these though\n $priorities = array_merge($priorities, array(\n array($theme, $lang, 'images'),\n array($theme, '', 'images'),\n ($lang == fallback_lang()) ? null : array($theme, fallback_lang(), 'images'),\n ));\n if ($theme != 'default') {\n if (!$pure_only) {\n $priorities = array_merge($priorities, array(\n array('default', $lang, 'images_custom'),\n array('default', '', 'images_custom'),\n ($lang == fallback_lang()) ? null : array('default', fallback_lang(), 'images_custom'),\n ));\n }\n $priorities = array_merge($priorities, array(\n array('default', $lang, 'images'),\n array('default', '', 'images'),\n ($lang == fallback_lang()) ? null : array('default', fallback_lang(), 'images'),\n ));\n }\n\n foreach ($priorities as $i => $priority) {\n if ($priority === null) {\n continue;\n }\n\n if (($priority[2] == 'images_custom') && ($priority[1] != '')) { // Likely won't auto find\n $smap = array('id' => $id, 'theme' => $priority[0], 'lang' => $priority[1]);\n $nql_backup = $GLOBALS['NO_QUERY_LIMIT'];\n $GLOBALS['NO_QUERY_LIMIT'] = true;\n $truism_b = ($priority[0] == $true_theme) && ((!multi_lang()) || ($priority[1] == '') || ($priority[1] === $true_lang));\n $path = $truism_b ? null : $db->query_select_value_if_there('theme_images', 'path', $smap);\n $GLOBALS['NO_QUERY_LIMIT'] = $nql_backup;\n\n if ($path !== null) { // Make sure this isn't just the result file we should find at a lower priority\n if (strpos($path, '/images/' . $id . '.') !== false) {\n continue;\n }\n if ((array_key_exists('lang', $smap)) && (strpos($path, '/images/' . $smap['lang'] . '/' . $id . '.') !== false)) {\n continue;\n }\n break;\n }\n }\n\n $test = _search_img_file($priority[0], $priority[1], $id, $priority[2]);\n if ($test !== null) {\n $path_bits = explode('/', $test);\n $path = '';\n foreach ($path_bits as $bit) {\n if ($path != '') {\n $path .= '/';\n }\n $path .= rawurlencode($bit);\n }\n break;\n }\n }\n\n if (!is_forum_db($db)) { // If guard is here because a MSN site can't make assumptions about the file system of the central site\n if ((($path !== null) && ($path != '')) || (($silent_fail) && (!$GLOBALS['SEMI_DEV_MODE']))) {\n $nql_backup = $GLOBALS['NO_QUERY_LIMIT'];\n $GLOBALS['NO_QUERY_LIMIT'] = true;\n $db->query_delete('theme_images', array('id' => $id, 'theme' => $theme, 'lang' => $lang)); // Allow for race conditions\n $db->query_insert('theme_images', array('id' => $id, 'theme' => $theme, 'path' => ($path === null) ? '' : $path, 'lang' => $lang), false, true); // Allow for race conditions\n $GLOBALS['NO_QUERY_LIMIT'] = $nql_backup;\n Self_learning_cache::erase_smart_cache();\n }\n }\n\n if ($path === null) {\n if (!$silent_fail) {\n require_code('site');\n attach_message(do_lang_tempcode('NO_SUCH_THEME_IMAGE', escape_html($id)), 'warn');\n }\n if ($THEME_IMAGES_SMART_CACHE_LOAD >= 2) {\n $SMART_CACHE->append('theme_images_' . $theme . '_' . $lang, $id, '');\n }\n return '';\n }\n if ($truism) {\n $THEME_IMAGES_CACHE[$site][$id] = $path; // only cache if we are looking up for our own theme/lang\n }\n } else {\n $path = $THEME_IMAGES_CACHE[$site][$id];\n\n // Decache if file has disappeared\n if (($path != '') && ((!isset($SITE_INFO['disable_smart_decaching'])) || ($SITE_INFO['disable_smart_decaching'] != '1')) && (url_is_local($path)) && ((!isset($SITE_INFO['no_disk_sanity_checks'])) || ($SITE_INFO['no_disk_sanity_checks'] == '0')) && (!is_file(get_file_base() . '/' . rawurldecode($path))) && (!is_file(get_custom_file_base() . '/' . rawurldecode($path)))) { // Missing image, so erase to re-search for it\n unset($THEME_IMAGES_CACHE[$site][$id]);\n $ret = find_theme_image($id, $silent_fail, $leave_local, $theme, $lang, $db, $pure_only);\n if ($THEME_IMAGES_SMART_CACHE_LOAD >= 2) {\n $SMART_CACHE->append('theme_images_' . $theme . '_' . $lang, $id, $ret);\n }\n return $ret;\n }\n }\n\n // Make absolute\n if ((url_is_local($path)) && (!$leave_local) && ($path != '')) {\n if (is_forum_db($db)) {\n $base_url = get_forum_base_url();\n } else {\n global $SITE_INFO;\n $missing = (!$pure_only) && (((!isset($SITE_INFO['disable_smart_decaching'])) || ($SITE_INFO['disable_smart_decaching'] != '1')) && (!is_file(get_custom_file_base() . '/' . rawurldecode($path))));\n if ((substr($path, 0, 22) == 'themes/default/images/') || ($missing) || ((!isset($SITE_INFO['no_disk_sanity_checks'])) || ($SITE_INFO['no_disk_sanity_checks'] == '0')) && (!is_file(get_custom_file_base() . '/' . rawurldecode($path)))) { // Not found, so throw away custom theme image and look in default theme images to restore default\n if (($missing) && (!is_file(get_file_base() . '/' . rawurldecode($path)))) {\n $ret = find_theme_image($id, $silent_fail, $leave_local, $theme, $lang, $db, true);\n if ($THEME_IMAGES_SMART_CACHE_LOAD >= 2) {\n $SMART_CACHE->append('theme_images_' . $theme . '_' . $lang, $id, $ret);\n }\n return $ret;\n }\n\n $base_url = get_base_url();\n } else {\n $base_url = get_custom_base_url();\n }\n }\n\n $path = $base_url . '/' . $path;\n }\n\n $ret = cdn_filter($path);\n if ($THEME_IMAGES_SMART_CACHE_LOAD >= 2) {\n $SMART_CACHE->append('theme_images_' . $theme . '_' . $lang, $id, $ret);\n }\n\n if ($RECORD_THEME_IMAGES_CACHE) {\n global $RECORDED_THEME_IMAGES;\n if (!is_on_multi_site_network()) {\n $RECORDED_THEME_IMAGES[serialize(array($id, $theme, $lang))] = true;\n }\n }\n\n return $ret;\n}" ]
[ "0.6498976", "0.61749893", "0.60132146", "0.59806126", "0.59705937", "0.59434456", "0.59127134", "0.5794312", "0.57875776", "0.5784079", "0.57726866", "0.5767138", "0.5751623", "0.5745894", "0.5736395", "0.57327205", "0.56987864", "0.5692004", "0.56638587", "0.56636286", "0.56619084", "0.5651631", "0.5650747", "0.56074893", "0.55859196", "0.55759084", "0.5556234", "0.5543355", "0.55304855", "0.55204135" ]
0.65779144
0
Get unique image index
private function getUniqueImageIndex(array $imageData) : string { ksort($imageData); unset($imageData['type']); return md5(json_encode($imageData)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImageId();", "public function getHashIndex();", "public function getImageId()\n {\n return $this->_imageId;\n }", "public function getImageId()\n {\n return $this->imageid;\n }", "function generate_id() {\n $this->last_image_id ++;\n return $this->last_image_id;\n }", "public function getImageid()\n {\n return $this->imageid;\n }", "function checkImageNum() {\n $db=connectDB();\n $email=$_SESSION['username'];\n $retrieve = \"SELECT * FROM notes WHERE email = '$email'\";\n $reRetrieve = mysqli_query($db,$retrieve) or die(mysqli_error($db));\n $reArr = mysqli_fetch_assoc($reRetrieve);\n //the current available index for storing image\n global $indexImag;\n for($indexImag = 1;$indexImag <= 4;$indexImag++) {\n $name = \"image\" . $indexImag;\n if($reArr[\"$name\"]=== NULL) {\n break;\n }\n }\n mysqli_close($db);\n return $indexImag;\n\n}", "function imageID( )\r\n {\r\n return $this->ImageID;\r\n }", "function getImgNumber ($userDir) {\r\n $arrayFile = getFilesFromDir($userDir);\r\n if (!empty($arrayFile)) {\r\n // the lagest number is first\r\n rsort($arrayFile);\r\n // get first filename from array\r\n $fileName = current($arrayFile);\r\n // get the filename without extension\r\n $fileName = substr($fileName, 0, -4);\r\n }\r\n // if directory is empty - first filename must be 0.jpg\r\n else {\r\n $fileName = 0;\r\n }\r\n return $fileName;\r\n}", "function getIndex() ;", "public function getIdx()\n {\n return $this->get(self::_IDX);\n }", "public function key(): int\n {\n return $this->index;\n }", "function getUniqueId()\n {\n $a = count($this->_ref_store);\n while(in_array($a, $this->_ref_store)) {\n $a++;\n }\n return $a;\n }", "public function key(): int\n {\n return $this->_index;\n }", "public function get_image_id() {\r\n return $this->image_id;\r\n }", "public function sel_next_image_id()\n\t{\n\t\t$image_id = null;\n\t\ttry{\n\t\t\t$m_image = new Model_M_Image($this->db, $this->client_id);\n\t\t\t$image_id = $m_image->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$image_id = null;\n\t\t}\n\t\treturn $image_id;\n\t}", "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "public function getId()\n {\n return $this->_imageId;\n }", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "function key() {\r\n return $this->i >= 0 ? $this->i : NULL;\r\n }", "public function getHashIndex() {\n\t\treturn $this->_hashIndex;\n\t}", "public function getHashIndex()\n {\n return $this->hashIndex;\n }", "public function key(){\n return $this->index;\n }", "public function key() {\n\t\t\treturn $this->index;\n\t\t}", "public function getImagesId()\n {\n $ids = array();\n foreach ($this->images as $image) {\n $ids[] = $image->getId();\n }\n return $ids;\n }", "public function key() {\n return $this->_iterableFiles [$this->_position] ['name'];\n }", "public static function getKeyIndex(): int\n {\n if (self::$keyIndex == PHP_INT_MAX) {\n self::$keyIndex = 0;\n } else {\n self::$keyIndex++;\n }\n\n return self::$keyIndex;\n }", "public static function getIndex(): int\n {\n return static::$index;\n }" ]
[ "0.6532543", "0.6468178", "0.63341403", "0.62252027", "0.61052215", "0.6097336", "0.60240626", "0.5986888", "0.5984016", "0.59376705", "0.5922786", "0.5906034", "0.588998", "0.5858627", "0.5855631", "0.58263767", "0.58073246", "0.5767967", "0.57591665", "0.57591665", "0.57333416", "0.57239515", "0.5710804", "0.5697565", "0.5635841", "0.5623236", "0.5600011", "0.55789095", "0.55785555", "0.5569341" ]
0.73284274
0