Run web application
551725
protected function runWebApp()
    {
        $this->response->getSwooleResponse()->end($this->getHttpResponse($this->request, $this->response));
    }
447932
def start():
    """"""
    global app
    bottle.run(app, host=conf.WebHost, port=conf.WebPort,
               debug=conf.WebAutoReload, reloader=conf.WebAutoReload,
               quiet=conf.WebQuiet)
483845
def run(port, like, use_json, server):
    """"""
    if not port and not server[0]:
        raise click.UsageError("Please specify a port")

    if server[0]:
        app.run(host=server[0], port=server[1])
        return

    ports = get_ports(port, like)
    if not ports:
        sys.stderr.write("No ports found for '{0}'\n".format(port))
        return

    if use_json:
        print(json.dumps(ports, indent=4))
    else:
        table = get_table(ports)
        print(table)
396123
public function run()
    {
        echo Html::tag('div', '', ['id' => $this->id, 'align' => 'center']);
        $this->getView()->registerJs($this->js);
    }
392717
public function run()
	{
		list($name,$id)=$this->resolveNameID();

		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$this->htmlOptions['id']=$id;
		if(isset($this->htmlOptions['name']))
			$name=$this->htmlOptions['name'];

		if($this->hasModel())
			echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);
		else
			echo CHtml::textField($name,$this->value,$this->htmlOptions);

		if($this->sourceUrl!==null)
			$this->options['source']=CHtml::normalizeUrl($this->sourceUrl);
		else
			$this->options['source']=$this->source;

		$options=CJavaScript::encode($this->options);
		Yii::app()->getClientScript()->registerScript(__CLASS__.'#'.$id,"jQuery('#{$id}').autocomplete($options);");
	}
160259
public function run() {
		$this->load_hooks();

		// Need to ensure these classes are activated here for hooks to fire.
		if ( $this->is_current_page( [ 'options.php', 'options-general.php', 'settings.php' ] ) ) {
			Singleton::get_instance( 'Install', $this )->run();
			Singleton::get_instance( 'Remote_Management', $this )->load_hooks();
		}
	}
166799
def run(self):
        """"""
        for wsock in self.wsocks:
            wsock.run()
        for api in self.apis:
            api.run()
1307330
public function run()
    {
        $stime = microtime(true);
        $this->header('Content-Type: text/html');

        $sandbox = new \Runkit_Sandbox([
            'safe_mode' => true,
            'open_basedir' => '/var/www/users/jdoe/',
            'allow_url_fopen' => 'false',
            'disable_functions' => 'exec,shell_exec,passthru,system',
            'disable_classes' => '',
            'output_handler' => [$this, 'out']
        ]);

        $sandbox->ini_set('html_errors', true);
        $sandbox->call_user_func(function () {
            echo "Hello World!";
        });
    }
355208
public function run()
    {
        if (PHP_SAPI === 'cli' && is_subclass_of($this, ConsoleAppInterface::class))
        {
            $this->execConsoleApp();
        }
        else if (is_subclass_of($this, WebAppInterface::class))
        {
            $this->execWebApp();
        }
        else
        {
            throw new \Exception("No interface was implemented");
        }
    }
293133
public function run()
    {
        echo CHtml::openTag($this->tagName, $this->htmlOptions);
        echo CHtml::closeTag($this->tagName);
        $this->registerClientScript();
    }
197008
def main(**kwargs):
    """"""
    options = ApplicationOptions(**kwargs)
    Event.configure(is_logging_enabled=options.event_logging)
    application = Application(options)
    application.run(options.definition)
1120954
public function run()
    {
        if ('cli' === php_sapi_name()) {
            // do run console application

            $input = new ArgvInput();
            $env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
            $debug = '0' !== getenv('SYMFONY_DEBUG') && !$input->hasParameterOption(['--no-debug', '']) && 'prod' !== $env;

            if ($debug || $this->debug) {
                Debug::enable();
            }

            $application = new Application($this->getKernel());
            $application->run($input);
        } else {
            // do run web application
            $request = Request::createFromGlobals();

            $kernel = $this->getKernel();

            if (!$this->debug) {
                $kernel->loadClassCache();
            }

            if ($this->cacheClass && class_exists($this->cacheClass)) {
                // add (or uncomment) this new line!
                // wrap the default AppKernel with the AppCache one
                $cacheClass = $this->cacheClass;
                $kernel = new $cacheClass($kernel);
            }

            // actually execute the kernel, which turns the request into a response
            // by dispatching events, calling a controller, and returning the response
            $response = $kernel->handle($request);

            // send the headers and echo the content
            $response->send();

            // triggers the kernel.terminate event
            $kernel->terminate($request, $response);
        }
    }
233460
def main():
    
    e = mod_env.Internet('VAIS - Load testing',  'Simulation of several websites')
    e.create(800)
    print(e)
    
    #Create some users to browse the web and load test website
    print(npc.web_users.params)
950929
def run(host='0.0.0.0', port=5000, reload=True, debug=True):
    
    from werkzeug.serving import run_simple

    app = bootstrap.get_app()
    return run_simple(
        hostname=host,
        port=port,
        application=app,
        use_reloader=reload,
        use_debugger=debug,
    )
1212224
public function run()
    {
        list($name, $id) = $this->resolveNameID();
        $id = $this->resolveId($id);

        echo TbHtml::openTag('div', array('class' => 'select2'));
        if ($this->hasModel()) {
            if ($this->asDropDownList) {
                echo TbHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
            } else {
                echo TbHtml::activeHiddenField($this->model, $this->attribute, $this->htmlOptions);
            }
        } else {
            if ($this->asDropDownList) {
                echo TbHtml::dropDownList($name, $this->value, $this->data, $this->htmlOptions);
            } else {
                echo TbHtml::hiddenField($name, $this->value, $this->htmlOptions);
            }
        }
        echo '</div>';

        if ($this->assetPath !== false) {
            $this->publishAssets($this->assetPath);
            $this->registerCssFile('/select2.css');

            if ($this->registerJs) {
                $this->registerScriptFile('/select2.js', CClientScript::POS_END);
            }
        }

        if ($this->bindPlugin) {
            $options = !empty($this->pluginOptions) ? CJavaScript::encode($this->pluginOptions) : '';
            $this->getClientScript()->registerScript(
                __CLASS__ . '#' . $id,
                "jQuery('#{$id}').select2({$options});"
            );
        }
    }
1293657
def run!(runtime_config = {})
			@websocket_config.merge! runtime_config

			EM.run do
				if @websocket_config[:tick_interval]
					EM.add_periodic_timer(@websocket_config[:tick_interval]) do
						socket_trigger(:on_tick, @socket_connected)
					end
				end

				EventMachine::WebSocket.run(host: @websocket_config[:socket_host], port: @websocket_config[:socket_port]) do |socket|
					@socket_active = socket
					socket.onopen do |handshake|
						@socket_connected = true
						socket_trigger(:on_socket_open, handshake)
					end

					socket.onmessage do |msg| 
						process_message(msg)
					end

					socket.onclose do 
						socket_trigger(:on_socket_close)
						@socket_connected = false 
					end
				end
			 
				Launchy.open("http://#{@websocket_config[:http_host]}:#{@websocket_config[:http_port]}/")
				WebsocketGui::SinatraWrapper.view_path = @websocket_config[:view]
				WebsocketGui::SinatraWrapper.run!(
					port: @websocket_config[:http_port], 
					bind: @websocket_config[:http_host])
			end
		end
78279
public function run() {
		$isPost = $_SERVER["REQUEST_METHOD"] == 'POST';
		$src    = $_SERVER["REQUEST_METHOD"] == 'POST' ? $_POST : $_GET;
		if ($isPost && !$src && $rawPostData = @file_get_contents('php://input')) {
			// for support IE XDomainRequest()
			$parts = explode('&', $rawPostData);
			foreach($parts as $part) {
				list($key, $value) = array_pad(explode('=', $part), 2, '');
				$src[$key] = rawurldecode($value);
			}
			$_POST = $this->input_filter($src);
			$_REQUEST = $this->input_filter(array_merge_recursive($src, $_REQUEST));
		}
		$cmd    = isset($src['cmd']) ? $src['cmd'] : '';
		$args   = array();
		
		if (!function_exists('json_encode')) {
			$error = $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_JSON);
			$this->output(array('error' => '{"error":["'.implode('","', $error).'"]}', 'raw' => true));
		}
		
		if (!$this->elFinder->loaded()) {
			$this->output(array('error' => $this->elFinder->error(elFinder::ERROR_CONF, elFinder::ERROR_CONF_NO_VOL), 'debug' => $this->elFinder->mountErrors));
		}
		
		// telepat_mode: on
		if (!$cmd && $isPost) {
			$this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UPLOAD, elFinder::ERROR_UPLOAD_TOTAL_SIZE), 'header' => 'Content-Type: text/html'));
		}
		// telepat_mode: off
		
		if (!$this->elFinder->commandExists($cmd)) {
			$this->output(array('error' => $this->elFinder->error(elFinder::ERROR_UNKNOWN_CMD)));
		}
		
		// collect required arguments to exec command
		foreach ($this->elFinder->commandArgsList($cmd) as $name => $req) {
			$arg = $name == 'FILES' 
				? $_FILES 
				: (isset($src[$name]) ? $src[$name] : '');
				
			if (!is_array($arg)) {
				$arg = trim($arg);
			}
			if ($req && (!isset($arg) || $arg === '')) {
				$this->output(array('error' => $this->elFinder->error(elFinder::ERROR_INV_PARAMS, $cmd)));
			}
			$args[$name] = $arg;
		}
		
		$args['debug'] = isset($src['debug']) ? !!$src['debug'] : false;
		
		$this->output($this->elFinder->exec($cmd, $this->input_filter($args)));
	}