Hello everyone,
we agreed some time ago, that we would use PSR-2 code style for xRes
development.
http://confluence.app.infra.gs.xtrav.de/display/Entwicklung/Codestyles
PSR-2 however is a very general recommendation. Many things we do
intuitively, I believe it's time to extend a little bit a list of our
rules, to make them more clear. My proposal is to partially adopt
Symfony Framework Coding Stadard, since it shares a lot of rules with
what we already do.
https://symfony.com/doc/3.3/contributing/code/standards.html
Specifically:
- Follow the standards defined in the PSR-0, PSR-1, PSR-2 and PSR-4
documents.
- Add a single space after each comma delimiter (E.g. func($a, $b, $c);
or [$a, $b, $c])
- Add a single space around binary operators (==, &&, ...).
I suggest always use spaces around concatenation as well. (E.g. $a .
$b, $a == $b)
- Place unary operators (!, --, ...) adjacent to the affected variable
(E.g. !$a, not ! $a)
- Use braces to indicate control structure body regardless of the number
of statements it contains; (E.g. if ($a) { doThis(); })
- Declare class properties before methods;
- Use parentheses when instantiating classes regardless of the number of
arguments the constructor has; (E.g. new Obj(); not new Obj;)
- Do not use spaces around [ offset accessor and before ] offset
accessor. (E.g. $a[$b[1]], not $a[ $b[1] ])
- Use camelCase, not underscores, for variable, function and method
names, arguments;
- Prefix abstract classes with Abstract
- Suffix interfaces with Interface
- Suffix traits with Trait
- Suffix exceptions with Exception
- Use alphanumeric characters and underscores for file names (Letters
and numbers, no special characters)
- For type-hinting in PHPDocs and casting, use bool (instead of boolean
or Boolean), int (instead of integer), float (instead of double or real);
- Omit the @return tag if the method does not return anything;
- The @package and @subpackage annotations are not used.
These are just, what I believe we can easily agree on without much
discussion. There are more rules in the Symfony document. If you feel
some other should also be included - please let everyone know.
Best regards
Viktoras Bezaras
--
Mit freundlichen Grüßen
Viktoras Bezaras
- Entwickler -
________________________________________________________
TraSo GmbH
Nonnenstraße 42
D-04229 Leipzig
Tel.: +49 341 355 740 44
E-Mail: v.bezaras(a)traso.de
Internet: http://www.traso.de
________________________________________________________
Geschäftsführer: Haiko Gerdes
Handelsregister: Amtsgericht Leipzig, HRB 21850
Hi,
damit sich die Daten im Elasticsearch besser darstellen lassen hier auch
das Kibana für die Entwickler
http://kibana.app.infra.rz1.xtrav.de
--
Mit freundlichen Grüßen
Thomas Kölzow
- Systemadministration -
_______________________________________________
TraSo GmbH
Nonnenstraße 42
D-04229 Leipzig
E-Mail: t.koelzow(a)traso.de
Internet: https://www.traso.de
_______________________________________________
Geschäftsführer: Haiko Gerdes
Handelsregister: Amtsgericht Leipzig (HRB 21850)
Hi,
das neue elasticsearch Cluster steht jetzt bereit.
Es sind aktuell 3 Nodes die noch über Port 9200 angesprochen werden können.
curl -XGET 'elastic01.app.infra.rz1.xtrav.de:9200/'
{
"name" : "elastic03",
"cluster_name" : "app_xtrav",
"cluster_uuid" : "44rFXMjDSuyqpS7VGrD0PQ",
"version" : {
"number" : "5.5.0",
"build_hash" : "260387d",
"build_date" : "2017-06-30T23:16:05.735Z",
"build_snapshot" : false,
"lucene_version" : "6.6.0"
},
"tagline" : "You Know, for Search"
}
Nodes:
elastic01.app.infra.rz1.xtrav.de
elastic02.app.infra.rz1.xtrav.de
elastic03.app.infra.rz1.xtrav.de
Aktuell sind es 3 Nodes die noch zum großen Teilen defaut werte haben
und erst angepasst oder erweitert werden, wenn sie die Last erhöht.
Aktuell sollen die Node 10 Shards mit 2 Replicas bilden, damit das
System gut skalierbar und die Daten Redundant abgelegt werden können.
Viel spaß beim Testen.
--
Mit freundlichen Grüßen
Thomas Kölzow
- Systemadministration -
_______________________________________________
TraSo GmbH
Nonnenstraße 42
D-04229 Leipzig
E-Mail: t.koelzow(a)traso.de
Internet: https://www.traso.de
_______________________________________________
Geschäftsführer: Haiko Gerdes
Handelsregister: Amtsgericht Leipzig (HRB 21850)