install the resource extension on the server
494505
public static void installResourceExtension(String host, int port, String user, String password, Authentication authType)
    throws IOException
  {
    // create the client
    DatabaseClient client = DatabaseClientFactory.newClient(host, port, user, password, authType);

    // create a manager for resource extensions
    ResourceExtensionsManager resourceMgr = client.newServerConfigManager().newResourceExtensionsManager();

    // specify metadata about the resource extension
    ExtensionMetadata metadata = new ExtensionMetadata();
    metadata.setTitle("Document Splitter Resource Services");
    metadata.setDescription("This plugin supports splitting input into multiple documents");
    metadata.setProvider("MarkLogic");
    metadata.setVersion("0.1");

    // acquire the resource extension source code
    InputStream sourceStream = Util.openStream(
      "scripts"+File.separator+DocumentSplitter.NAME+".xqy");
    if (sourceStream == null)
      throw new RuntimeException("Could not read example resource extension");

    // create a handle on the extension source code
    InputStreamHandle handle = new InputStreamHandle(sourceStream);
    handle.set(sourceStream);

    // write the resource extension to the database
    resourceMgr.writeServices(DocumentSplitter.NAME, handle, metadata,
      new MethodParameters(MethodType.POST));

    System.out.println("Installed the resource extension on the server");

    // release the client
    client.release();
  }
1085136
function installExtensionDlls(source_dir_path, dest_folder_object) {
        var app_files = readDir.readSync(source_dir_path);
        app_files.forEach(function (name) {
            var suffix = name.substring(name.length - ".dll".length);
            if (suffix && suffix.toLowerCase() === ".dll") {
                AddFileComponent(dest_folder_object, source_dir_path, name);
            }
        });
    }
1135780
def apply(client, prune: true)
      server_resources = client.get_resources(resources)

      resources.zip(server_resources).map do |resource, server_resource|
        if !server_resource
          logger.info "Create resource #{resource.apiVersion}:#{resource.kind}/#{resource.metadata.name} in namespace #{resource.metadata.namespace} with checksum=#{resource.checksum}"
          keep_resource! client.create_resource(prepare_resource(resource))
        elsif server_resource.metadata.annotations[@checksum_annotation] != resource.checksum
          logger.info "Update resource #{resource.apiVersion}:#{resource.kind}/#{resource.metadata.name} in namespace #{resource.metadata.namespace} with checksum=#{resource.checksum}"
          r = prepare_resource(resource)
          if server_resource.can_patch?(@last_config_annotation)
            keep_resource! client.patch_resource(server_resource, server_resource.merge_patch_ops(r.to_hash, @last_config_annotation))
          else
            # try to update with PUT
            keep_resource! client.update_resource(server_resource.merge(prepare_resource(resource)))
          end
        else
          logger.info "Keep resource #{server_resource.apiVersion}:#{server_resource.kind}/#{server_resource.metadata.name} in namespace #{server_resource.metadata.namespace} with checksum=#{server_resource.metadata.annotations[@checksum_annotation]}"
          keep_resource! server_resource
        end
      end

      prune(client, keep_resources: true) if prune
    end
975853
def main(extension, strict_extensions, default_extension, x):
    

    # install a logbook handler before performing any other operations
    logbook.StderrHandler().push_application()
    create_args(x, zipline.extension_args)
    load_extensions(
        default_extension,
        extension,
        strict_extensions,
        os.environ,
    )
851382
function installServer()
    {
        $this->files->ensureDirExists('/usr/local/etc/nginx/valet');

        $this->files->putAsUser(
            '/usr/local/etc/nginx/valet/valet.conf',
            str_replace(
                ['VALET_HOME_PATH', 'VALET_SERVER_PATH', 'VALET_STATIC_PREFIX'],
                [VALET_HOME_PATH, VALET_SERVER_PATH, VALET_STATIC_PREFIX],
                $this->files->get(__DIR__.'/../stubs/valet.conf')
            )
        );

        $this->files->putAsUser(
            '/usr/local/etc/nginx/fastcgi_params',
            $this->files->get(__DIR__.'/../stubs/fastcgi_params')
        );
    }
1139482
def nginx(ctx, hostname):
    """"""

    install_nginx(ctx.obj['dbhost'], ctx.obj['dbname'], ctx.obj['port'], hostname)
1006082
def _setup_qos_extension(self):
        """"""
        if not CONF.AGENT.enable_qos_extension:
            return
        self._qos_ext = qos_extension.QosAgentExtension()
        self._qos_ext.consume_api(self)
        self._qos_ext.initialize(self._connection, 'hyperv')
948280
def _mount_resources(self):
        ''''''
        rules = []
        self.callback_map = {}
        for ep in Resource:
            for rule, callback in ep.get_routing_tuples():
                log.debug('Path "{}" mapped to "{}"'.format(
                    rule.rule, rule.endpoint))
                rules.append(rule)
                self.callback_map[rule.endpoint] = callback
        self.url_map = Map(rules)
119331
function serve(name, options, init) {
    var _pkg = pkg();
    if (chek_1.isPlainObject(name)) {
        init = options;
        options = name;
        name = undefined;
    }
    if (chek_1.isBoolean(options)) {
        init = options;
        options = undefined;
    }
    var defaults = {
        server: {
            baseDir: './dist'
        }
    };
    name = name || 'dev-server';
    options = chek_1.extend({}, defaults, options);
    var bsync = chek_1.tryRootRequire('browser-sync');
    if (!bsync)
        logger_1.log.error('browser-sync not found try >> npm install browser-sync -s');
    var server = bsync.create(name);
    if (init !== false)
        server.init(options, function (err) {
            if (err) {
                logger_1.log.error(err);
            }
            else {
                logger_1.log.notify("browser Sync server " + name + " started.");
            }
        });
    return server;
}
932945
def _handle_install():
    
    from pyci.server import Server
    if args["install"]:
        server = Server(testmode=args["nolive"])
        for xpath in args["install"]:
            server.install(xpath)
            okay("Installed {} into the CI server.".format(xpath))
    if args["uninstall"]:
        server = Server(testmode=args["nolive"])
        for xpath in args["uninstall"]:
            server.uninstall(xpath)
            okay("Uninstalled {} from the CI server.".format(xpath))
856593
public function install()
    {
        $disk = Storage::createLocalDriver([
            'driver' => 'local',
            'root'   => app_path(),
        ]);
        
        $this->info('Publishing required files', 1);
        $this->call('vendor:publish', ['--provider' => TwoStreamServiceProvider::class, '--tag' => ['required']], 2);
        
        $this->info('Applying your app\'s namespace <comment>[' . $this->appNamespace . ']</comment>', 1);
        foreach (TwoStreamServiceProvider::pathsToPublish(TwoStreamServiceProvider::class, 'required') as $required) {
            $required = str_replace(app_path(), '', $required);
            $originalFile = $disk->get($required);
            $file = str_replace('{{namespace}}', $this->appNamespace, $originalFile);
            
            if ($file != $originalFile) {
                $this->info('Setting namespace for <comment>[/app' . str_replace([app_path(), '.php', '.stub'], '', $required) . ']</comment>', 2);
                $disk->put($required, $file);
            }
            
            if (! $disk->exists(str_replace('.stub', '.php', $required))) {
                $disk->move($required, str_replace('.stub', '.php', $required));
            }
        }
        
        $this->info('Cleaning up...', 1);
        $this->level(0);
        $files = array_merge($disk->allFiles('Ws'), $disk->allFiles('Exceptions'));
        foreach ($files as $key => $file) {
            if (preg_match('/\\.stub$/', $file)) {
                $disk->delete($file);
            }
        }
    }
1090216
function init_extensions()
	{
		$filename = $this->froot.'cfg/extensions.php';
		if (is_file($filename))
		{
			include_once($filename);
		}

		$this->extensions = new EresusExtensions();
	}
1373452
def install_extensions(extensions, **connection_parameters):
    

    from postpy.connections import connect

    conn = connect(**connection_parameters)
    conn.autocommit = True

    for extension in extensions:
        install_extension(conn, extension)
117581
public static function load()
    {
        if (!extension_loaded('opencensus')) {
            trigger_error('opencensus extension required to load Memcached integrations.', E_USER_WARNING);
            return;
        }

        // bool Memcached::add ( string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'add', [self::class, 'handleAttributes']);

        // bool Memcached::addByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'addByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::append ( string $key , string $value )
        opencensus_trace_method('Memcached', 'append', [self::class, 'handleAttributes']);

        // bool Memcached::appendByKey ( string $server_key , string $key , string $value )
        opencensus_trace_method('Memcached', 'appendByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::cas ( float $cas_token , string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'cas', [self::class, 'handleCas']);

        // bool Memcached::casByKey ( float $cas_token , string $server_key , string $key , mixed $value
        //                            [, int $expiration ] )
        opencensus_trace_method('Memcached', 'casByKey', [self::class, 'handleCasByKey']);

        // int Memcached::decrement ( string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
        opencensus_trace_method('Memcached', 'decrement', [self::class, 'handleAttributes']);

        // int Memcached::decrementByKey ( string $server_key , string $key [, int $offset = 1 [, int $initial_value = 0
        //                                 [, int $expiry = 0 ]]] )
        opencensus_trace_method('Memcached', 'decrementByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::delete ( string $key [, int $time = 0 ] )
        opencensus_trace_method('Memcached', 'delete', [self::class, 'handleAttributes']);

        // bool Memcached::deleteByKey ( string $server_key , string $key [, int $time = 0 ] )
        opencensus_trace_method('Memcached', 'deleteByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::flush ([ int $delay = 0 ] )
        opencensus_trace_method('Memcached', 'flush');

        // mixed Memcached::get ( string $key [, callable $cache_cb [, int &$flags ]] )
        opencensus_trace_method('Memcached', 'get', [self::class, 'handleAttributes']);

        // mixed Memcached::getByKey ( string $server_key , string $key [, callable $cache_cb [, int $flags ]] )
        opencensus_trace_method('Memcached', 'getByKey', [self::class, 'handleAttributesByKey']);

        // mixed Memcached::getMulti ( array $keys [, int $flags ] )
        opencensus_trace_method('Memcached', 'getMulti', [self::class, 'handleAttributes']);

        // array Memcached::getMultiByKey ( string $server_key , array $keys [, int $flags ] )
        opencensus_trace_method('Memcached', 'getMultiByKey', [self::class, 'handleAttributesByKey']);

        // int Memcached::increment ( string $key [, int $offset = 1 [, int $initial_value = 0 [, int $expiry = 0 ]]] )
        opencensus_trace_method('Memcached', 'increment', [self::class, 'handleAttributes']);

        // int Memcached::incrementByKey ( string $server_key , string $key [, int $offset = 1 [, int $initial_value = 0
        //                                 [, int $expiry = 0 ]]] )
        opencensus_trace_method('Memcached', 'incrementByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::prepend ( string $key , string $value )
        opencensus_trace_method('Memcached', 'prepend', [self::class, 'handleAttributes']);

        // bool Memcached::prependByKey ( string $server_key , string $key , string $value )
        opencensus_trace_method('Memcached', 'prependByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::replace ( string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'replace', [self::class, 'handleAttributes']);

        // bool Memcached::replaceByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'replaceByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::set ( string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'set', [self::class, 'handleAttributes']);

        // bool Memcached::setByKey ( string $server_key , string $key , mixed $value [, int $expiration ] )
        opencensus_trace_method('Memcached', 'setByKey', [self::class, 'handleAttributesByKey']);

        // bool Memcached::setMulti ( array $items [, int $expiration ] )
        opencensus_trace_method('Memcached', 'setMulti', [self::class, 'handleSetMulti']);

        // bool Memcached::setMultiByKey ( string $server_key , array $items [, int $expiration ] )
        opencensus_trace_method('Memcached', 'setMultiByKey', [self::class, 'handleSetMultiByKey']);
    }
950627
private void addResourceToModule(String resourcePath, CmsModule module) {

        List<String> currentRessources = Lists.newArrayList(module.getResources());
        for (String resource : currentRessources) {
            if (resourcePath.startsWith(resource)) {
                return;
            }
        }
        currentRessources.add(resourcePath);
        module.setResources(currentRessources);
    }
480864
public function boot()
    {
        $finder = $this->app->make('orchestra.extension.finder');

        foreach ($this->extensions as $name => $path) {
            if (\is_numeric($name)) {
                $finder->addPath($path);
            } else {
                $finder->registerExtension($name, $path);
            }
        }
    }
120899
def InstallTemplatePackage():
  """"""
  virtualenv_bin = os.path.dirname(sys.executable)
  extension = os.path.splitext(sys.executable)[1]
  pip = "%s/pip%s" % (virtualenv_bin, extension)

  # Install the GRR server component to satisfy the dependency below.
  major_minor_version = ".".join(
      pkg_resources.get_distribution("grr-response-core").version.split(".")
      [0:2])
  # Note that this version spec requires a recent version of pip
  subprocess.check_call([
      sys.executable, pip, "install", "--upgrade", "-f",
      "https://storage.googleapis.com/releases.grr-response.com/index.html",
      "grr-response-templates==%s.*" % major_minor_version
  ])