« Previous - Version 42/222 (diff) - Next » - Current version
Etienne Pallier, 04/20/2016 11:54 am


Labinvent 2.0 (cakephp3)

RECUPERATION DU LOGICIEL

Authenticate to https://gitlab.irap.omp.eu/epallier/labinvent

In order to get this software, you must first authenticate on the IRAP gitlab.

For this, just go to https://gitlab.irap.omp.eu/epallier/labinvent
and either sign in with your LDAP account (if you are from IRAP),
or register via the "Sign up" form (then, confirm your registration by answering an email sent by gitlab,
and wait for the "SI" to authorize your registration)

Browse the code (from gitlab)

https://gitlab.irap.omp.eu/epallier/labinvent/tree/master

Download it (static version, not synchronized)

You can download the current version of the software.

Go to https://gitlab.irap.omp.eu/epallier/labinvent/tree/master

Click on "Download zip" on the up right hand corner.

Double-click on it to unzip it.

You should get a "labinvent.git" folder.

In this documentation, this software folder will be referenced as "labinvent".

(you can rename "labinvent.git" as "labinvent" if you want : "mv labinvent.git labinvent")

Get it from GIT (dynamic version, synchronized)

(If you are using Windows, you must first get the git software, see below "Get git for Windows")

By getting the software from git, you will get a dynamically synchronized version,
which means that you will be able to update your version as soon as a new version is available
(with the command : "git pull").

  • From Eclipse : See below, section "NOTES FOR ECLIPSE USERS"
  • From the terminal
git clone https://gitlab.irap.omp.eu/epallier/labinvent.git labinvent

(or also : git clone :epallier/labinvent.git labinvent)

If you ever get this error message... :

fatal: unable to access 'https://gitlab.irap.omp.eu/epallier/labinvent.git/': Peer's certificate issuer has been marked as not trusted by the user.

...then, type this command (and then run again the "git clone" command):

$ git config --global http.sslVerify false

Then check that your config is ok:

$ cat ~/.gitconfig 
[user]
    name = Etienne Pallier
    email = epallier@irap.omp.eu
[http]
    sslVerify = false
[push]
    default = simple

(Also, the first time you get the project, git will ask you for a login and password)

This creates a labinvent/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)

(Windows only) : Get git for Windows

You can now use your git from the cmd or the graphic client !


Installation

A/ PREREQUIS

  • Un serveur web (apache avec le mod_rewrite actif)
  • Un serveur de base de données (MySQL)
  • PHP 5.5.9 ou plus
  • Extension PHP "mbstring"
  • Extension PHP "intl"
  • Librairie "gd"
  • Librairie PHP "php-gd" (même version que PHP)
  • Librairie "zlib"

Il est aussi conseillé d'avoir un "phpmyadmin" installé pour pouvoir gérer manuellement la base de données.

  • Après avoir installé tous les prérequis, récupérer l'archive "labinvent.tar.gz".
  • Placer cette archive à l'endroit voulu, 2 possibilités :
    - (1) soit vous placez cette archive directement dans le repertoire des sites webs du serveur web (par exemple /var/www/html/localhost/public_html/)
    - (2) soit vous la placez n'importe où ailleurs (par exemple dans votre repertoire home), et ensuite vous indiquerez au serveur web où trouver ce projet
  • Dézipper l'archive :
    "tar xvfz labinvent.tar.gz"

cela crée un dossier labinvent.git/

B/ INSTALLATION

Nous vous préconisons d'installer le logiciel en mode "SANS LDAP", et d'activer le mode "AVEC LDAP" par la suite, si vous en avez besoin.

  • Aller dans le repertoire d'installation :
    cd labinvent/install/
  • Exécuter le script d'installation :
    ./installation.sh
    (vous pouvez le faire en tant qu'administrateur "root", mais ça n'est pas nécessaire, le script fera quelques petits "sudo" seulement quand nécessaire).
    (Conseil : à la plupart des questions, laissez les réponses par défaut)
    (Comme expliqué au début, faites une installation en mode "sans LDAP")
  • Configuration BD
    - Après avoir terminé le script d'installation, ouvrir le fichier ./config/app.php
    - Aller à la section Datasources
    - Modifier les attributs "host", "username", "password" et "database" pour qu'ils correspondent à votre base de données.

Dans le fichier apache2.conf de Apache, si vous avez déja quelque chose comme ceci, cela suffit :

<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>

Sinon, vous pouvez ajouter ceci, uniquement pour Labinvent :

<Directory /labinvent>
Options FollowSymLinks
AllowOverride All
</Directory>

NB : si labinvent n'est pas dans le repertoire des sites webs, il faut mettre son chemin absolu a la place de /labinvent :

<Directory /chemin/abosolu/vers/labinvent>

Remarques :

Dans CakePHP3 un serveur de développement est disponible, il faut se placer à la racine du projet faire la commande "bin/cake server".
L'application devrait être accessible à l'adresse suivante par défaut : http://localhost:8765/

Installation from scratch (Développeurs only) (Sous UBuntu)

Création projet avec Composer

  • Avec le Composer créer un nouveau projet :
    "php composer.phar create-project --prefer-dist cakephp/app labinvent_2.0"

Voir structure projet : http://book.cakephp.org/3.0/fr/intro/cakephp-folder-structure.html

  • On rempli la base de données avec le fichier sql
  • On indique la BD utilisé à CakePHP dans le fichier config/app.php, propriété "Datasources".
  • On se place à la racine du projet
  • On génère le code Scaffold :
    "bin/cake bake all nom_table" --> ça génére les modeles, les vues, et les controlleurs.

Commande (en une fois) :

bin/cake bake all categories && bin/cake bake all emprunts && bin/cake bake all groupes_metiers && bin/cake bake all groupes_thematiques && bin/cake bake all organismes && bin/cake bake all sites && bin/cake bake all sous_categories && bin/cake bake all suivis && bin/cake bake all sur_categories && bin/cake bake all type_suivis && bin/cake bake all documents && bin/cake bake all utilisateurs && bin/cake bake all materiels

Modification de la base de données

Une version du sql corrigée au fur et à mesure est disponible dans le git :

Dans database/, le fichier labinvent_2.0_19-04-16 correspond à la création de la base.
Dans database/, le fichier labinvent_2.0_insert-irap_19-04-16 correspond aux insertions.

  • Table "fichiers" en doublon de "documents" => supprimer
  • Attribut organisme inutile dans la table matériel => supprimer

Autres remarques lors du dévellopement

instalation.sh

  • "phpqrcode" et "fpdf" dans dossier vendor
  • CakePHP oblige à changer le grain de sel (security.salt) par rapport a la config par défaut
  • Remplisage du fichier config app.php par l'utilisateur (BD, grain de sel, ...) ?

Réunion 1.odt - Compte Rendu de la Réunion du 20/07/18 (18.8 KB) Anonymous, 07/24/2018 01:46 pm

Labinvent.odt (297 KB) Anonymous, 08/23/2018 12:38 pm

DocumentationTechnique.odt (19.8 KB) Anonymous, 08/23/2018 12:38 pm