Setting up write flags for Aerospike list operation using PHP - aerospike

I am trying to add unique elements to the lists. I found that there is write flag option ADD_UNIQUE but I failed to make it work using the PHP client. I can not find this option in the list of available options for the appendList method (for example). I am using client for php 7.

Not familiar with PHP - but in Java, I recommend OR-ing 3 flags - ADD_UNIQUE, NO_FAIL and PARTIAL to successfully add unique items to a list.

Related

Does apache server SSI (Server Side Includes) support arrays and loops?

I want to generate an array of key-value-paired items and use a looping mechanism to generate a list of content from them in HTML tags format. Is this possible to do it using apache server SSI?
From what I observed, it seems that it is possible to do it using the w3 jigsaw. But I didn't find anything similar for apache and I must use apache.
this is the way that it can be done using the jigsaw:
https://www.w3.org/Jigsaw/Doc/User/SSI.html#loop

Generating CRUD in symfony 4

After releasing Symfony 4.0, there is no support for SensioGeneratorBundle. hence the command php app/console generate:doctrine:crud is not available.
They suggest to use MakerBundle, but I could not find appropriate replacement for CRUD generation.
Could anyone help?
You can use the make command in Symfony4+ (and it's quite an improvement!), from the MakerBundle:
php bin/console make:crud
It'll prompt you for which entity you want the crud for. It generates a controller with index, new, update, view and delete methods in /src/controller, with matching templates in /templates.
Useful to know: If you run make:entity, and later run that command again and enter an existing entity, it responds with:
Your entity already exists! So let's add some new fields!
At the moment MakerBundle supports just a few core commands. You can see the list here. Unfortunately there's no CRUD generator. But there some discussion about it in the issues so you can follow what will be done.
If what you need is just a generator for boilerplate code and not a more structured solution like EasyAdminBundle you should consider creating your own maker.
Symfony4 (thanks to #jelle)
composer require symfony/maker-bundle --dev
composer require symfony/form symfony/validator symfony/twig-bundle symfony/orm-pack symfony/security-csrf
php bin\console make:crud
The class name of the entity to create CRUD (e.g. BravePuppy):
>
first install pre-req packages
composer require twig-bundle security-csrf
and then you can run
php bin/console make:crud
after that just enter your entity name which you want to curd
The class name of the entity to create CRUD (e.g. BlogPosts):
>

Update build definition in team foundation 2015 API

I am busy with configuring our new TFS 2015 server (on premises) and trying to get the new vnext builds to work properly.
What I now have are some extra powershell scripts that increase the version number of my assemblies.
It also changes the buildnumber in TFS by calling the API method (see tfs rest api). My json body only sends the new build number (eg. {"buildNumber": "1.0.1.1234"}) and this works fine.
Now I have added some major, minor and patch version variables in the build definition for the version. Once the build is done this should be updated and so I thought to do the same kind of thing and just send an update API call to the corresponding builddefinition endpoint. The documentation says the revision number is mandatory so I have added that. For the rest I only added the changed variables.
The api call works, but the nasty thing is that it will update the whole definition and clear out all the other settings which I did not provide in the json body. I also tried first getting the defintion through the API, changing the json values for the variables and send that back but that didnt work correct also.
So does anybody know a good solution for this?
As a workaround what I did for now is adding a dummy build definition (eg. "_ProjectVersion") totally empty except for the variables and my build task now uses that build definition to get the latest version numbers and update them. So the api call still empties that whole build definition but since it only contains my variables I dont mind.
I am also doing this in powershell since all scripting should be automated and done in powershell.
The problem I have is that the API call to get the json of an existing BuildDefinition returns invalid json when managed in powershell.
For example the "#{multipliers=[]; will fail with 'must have at least one value' even though a 'json validator' may report as Valid. The correct json is {"multipliers": "[]",

SuiteCRM developing a custom module

I am trying to build a custom module based on the 'basic' template, with extra fields without using the module builder.
I have looked trough the SugarCRM 6.5 documentation, bought the book SuiteCRM for Developers and looked trough the sources of existing modules, but I still can not figure out how to put a working module together.
Does a minimal module template exists anywhere? What I am looking for is a fully working module with one extra field, which can be deployed on a SuiteCRM instance. I can take it from there.
There's no minimal module template that I know of, you may want to consider creating a test module through module builder and exporting that to see what the parts are.
Usually though modules have the following files. Example uses the module ABC_Sport.
custom/Extension/application/Ext/Include/ABC_Sport.php
This adds the module to the module list and adds the beans. I.e.
$beanList['ABC_Sport'] = 'ABC_Sport';
$beanFiles['ABC_Sport'] = 'modules/ABC_Sport/ABC_Sport.php';
$moduleList[] = 'ABC_Sport';
custom/Extension/application/Ext/Include/en_us.ABC_Sport.php
(Note you may want to add files for different languages).
Next up you'll need to create the bean file in
modules/ABC_Sport/ABC_Sport.php
and the vardefs in
modules/ABC_Sport/vardefs.php
I'm not totally sure if the metadata files are required or not but you'll also likely want to add the editviewdefs,detailviewdefs and listviewdefs.

First method being called by Advanced Database Crawler

Currently I'm using sitecore 6.6 and using advanced database crawler.
My sitecore environment currently is 1 cm on premise and 1 cd at cloud.
The ADC is working fine now.
Can I know which line of sitecore call the ADC method?
And what is the first method to be called by sitecore to ADC?
Which line of configuration in sitecore specifying the ADC's method being called?
The ADC is a data access library, so Sitecore itself does not natively call it, you need to call it in your code for your front-end components (Layouts, Sublayouts, WebControls). The ADC configuration defines the name of your search index and what to include and/or exclude from it.
Here's an overview video of the ADC: http://sitecoreblog.alexshyba.com/2010/11/sitecore-searcher-and-advanced-database.html
The latest code base is no longer the ADC but rather called scSearchContrib: https://github.com/sitecorian/SitecoreSearchContrib