Mise à jour de la documentation
This commit is contained in:
parent
026c95cd32
commit
e688ef3dad
114
docs/README
Normal file
114
docs/README
Normal file
@ -0,0 +1,114 @@
|
||||
WebService
|
||||
==========
|
||||
|
||||
- Créer le vhost, voir le fichier VHOST pour les exemples
|
||||
|
||||
- Installer les librairies avec composer
|
||||
|
||||
$ composer install
|
||||
|
||||
- Configurer l'application
|
||||
|
||||
La config (fichier application.ini) est à placer dans "application/configs/"
|
||||
|
||||
Exemple de la config dans "docs/config/application.ini"
|
||||
(Modifier selon les besoins)
|
||||
|
||||
- APPLICATION_ENV
|
||||
|
||||
Différent niveau peuvent être utilisé dans l'application pour gérer les erreurs et le comportement.
|
||||
|
||||
production
|
||||
staging
|
||||
development
|
||||
testing
|
||||
|
||||
Cette variable est accessible dans PHP.
|
||||
|
||||
- Créer les repertoires de données nécessaires
|
||||
|
||||
[WORKSPACE]/data/backoffice/
|
||||
- clients => lien symbolique vers les fichiers clients
|
||||
- conso => données à conserver, dossier persistent
|
||||
- datafile => lien symbolique vers les fichiers PDF, et autres des partenaires
|
||||
- export
|
||||
- import
|
||||
- log
|
||||
- sources => lien symbolique vers les données des sources
|
||||
- stats
|
||||
- upload
|
||||
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
Obtenir les WSDL
|
||||
Pour le service Entreprise
|
||||
|
||||
- En mode développement : http://hostname/entreprise/version?wsdl-auto
|
||||
- Générer le WSDL : http://hostname/entreprise/version?wsdl-generate
|
||||
- Utiliser le WSDL généré : http://hostname/entreprise/version?wsdl
|
||||
|
||||
Pour le service Interne
|
||||
|
||||
http://hostname/interne/version?wsdl
|
||||
|
||||
Pour les clients
|
||||
|
||||
http://hostname/clients/nom_du_client/version?wsdl
|
||||
|
||||
N.B : Le fichier WSDL est généré automatiquement en appelant
|
||||
http://hostname/service?wsdl afin de ne pas provoquer d'erreur
|
||||
après une mise en production
|
||||
|
||||
Pour définir le mode (vhost d'apache)
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
SetEnv APPLICATION_ENV "staging"
|
||||
|
||||
En appelant l'url http://hostname/service, le contoller de l'application,
|
||||
"service" est automatiquement utiliser.
|
||||
Tout ce qui est visible dans la class est utilisé par le controller et se
|
||||
retrouve visible dans le service (wsdl, requête)
|
||||
|
||||
Si des fonctions ne doivent pas être rendu visible il faut donc les séparer
|
||||
dans un autre controller utilisant une autre class.
|
||||
|
||||
|
||||
Documentation des méthodes et ajout spécial
|
||||
===========================================
|
||||
|
||||
La documentation est géneré en automatique.
|
||||
|
||||
Voici comment définir simplement la documentation d'une méthode
|
||||
|
||||
/**
|
||||
* Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
* @param string $key Siren de l'entreprise ou siret de l'établissement
|
||||
* @return Identite
|
||||
*/
|
||||
public function test($key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Attention ces informations servent aussi pour la structure du WSDL
|
||||
|
||||
Pour spécifier un lien vers un fichier ou pour générer un fichier depuis une
|
||||
requête SQL à partir de la documentation du service.
|
||||
Ajouter dans le docblock :
|
||||
- Pour un fichier
|
||||
@ref fichier:libellé:{nom_du_fichier.ext}
|
||||
- Pour une requête SQL
|
||||
@ref mysql:libellé:{nom_du_fichier.sql}
|
||||
|
||||
Les fichiers a télécharger sont à placer dans le répértoire public/fichier et
|
||||
les fichiers sql dans public/sql
|
||||
|
||||
Pour spécifier des éléments de taille (non pris en compte sur le WSDL)
|
||||
@xsd minLength=9
|
||||
@xsd maxLength=15
|
||||
|
||||
|
||||
|
||||
|
||||
|
141
docs/VHOST
Normal file
141
docs/VHOST
Normal file
@ -0,0 +1,141 @@
|
||||
|
||||
PHP Variables
|
||||
=============
|
||||
|
||||
. mod_php
|
||||
|
||||
Add in <VirtualHost/>
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
|
||||
. php-fpm
|
||||
|
||||
Add a file in document root path (public/) a file .user.ini
|
||||
env[APPLICATION_ENV] = "development"
|
||||
|
||||
See the .user.dev.ini file
|
||||
|
||||
Variables
|
||||
---------
|
||||
<mode> : production, staging, development
|
||||
Défini le mode de fonctionnement pour les erreurs, etc
|
||||
|
||||
|
||||
Development
|
||||
===========
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName webservice.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
<IfModule mod_xsendfile.c>
|
||||
XSendFile On
|
||||
XSendFilePath /home/vhosts/webservice/shared
|
||||
</IfModule>
|
||||
|
||||
DocumentRoot /home/vhosts/webservice/public
|
||||
<Directory /home/vhosts/webservice/public/>
|
||||
EnableSendfile Off
|
||||
AllowOverride none
|
||||
Require all granted
|
||||
<Files ~ "^\.user.ini">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/public/themes/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/public/libs/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/public/assets/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog ${APACHE_LOG_DIR}/webservice-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webservice-access.log combined
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
Production
|
||||
==========
|
||||
|
||||
<VirtualHost *:8000>
|
||||
ServerName webservice.scores-decisions.com
|
||||
AddDefaultCharset utf-8
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
ServerSignature Off
|
||||
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
|
||||
<IfModule mod_xsendfile.c>
|
||||
XSendFile On
|
||||
XSendFilePath /home/vhosts/webservice/shared
|
||||
</IfModule>
|
||||
|
||||
DirectoryIndex index.php
|
||||
DocumentRoot /home/vhosts/webservice/current/public
|
||||
<Directory /home/vhosts/webservice/current/public/>
|
||||
Options FollowSymLinks Indexes
|
||||
AllowOverride none
|
||||
Require all granted
|
||||
<Files ~ "^\.user.ini">
|
||||
Order allow,deny
|
||||
Deny from all
|
||||
</Files>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/current/public/themes/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/current/public/libs/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
<Directory /home/vhosts/webservice/current/public/assets/>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine Off
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog ${APACHE_LOG_DIR}/webservice-error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/webservice-access.log combined
|
||||
</VirtualHost>
|
||||
|
9
docs/config/.user.dev.ini
Normal file
9
docs/config/.user.dev.ini
Normal file
@ -0,0 +1,9 @@
|
||||
upload_max_filesize=513M
|
||||
post_max_size=513M
|
||||
memory_limit=512M
|
||||
mbstring.func_overload=0
|
||||
always_populate_raw_post_data=-1
|
||||
default_charset='UTF-8'
|
||||
date.timezone='Europe/Paris'
|
||||
soap.wsdl_cache_enabled=0
|
||||
env[APPLICATION_ENV] = "development"
|
74
docs/config/application.dev.ini
Normal file
74
docs/config/application.dev.ini
Normal file
@ -0,0 +1,74 @@
|
||||
[production]
|
||||
phpSettings.soap.wsdl_cache_dir = "PROJECT_DIR/shared/sessions/wsdl"
|
||||
phpSettings.date.timezone = "Europe/Paris"
|
||||
phpSettings.display_startup_errors = 0
|
||||
phpSettings.display_errors = 0
|
||||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
|
||||
bootstrap.class = "Bootstrap"
|
||||
appnamespace = "Application"
|
||||
resources.session.save_path = "PROJECT_DIR/shared/sessions"
|
||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||
resources.frontController.plugins.Auth = "Application_Controller_Plugin_Auth"
|
||||
resources.frontController.plugins.Services = "Application_Controller_Plugin_Services"
|
||||
resources.frontController.plugins.Menu = "Application_Controller_Plugin_Menu"
|
||||
resources.frontController.params.displayExceptions = 0
|
||||
resources.layout.layout = "layout"
|
||||
resources.layout.layoutPath = APPLICATION_PATH "/views"
|
||||
resources.view.basePath = APPLICATION_PATH "/views"
|
||||
|
||||
; Scores configuration
|
||||
profil.server.name = development
|
||||
profil.mail.method = smtp
|
||||
profil.mail.host = smtp.free.fr
|
||||
profil.mail.email.support = supportdev@scores-decisions.com
|
||||
profil.mail.email.supportdev = supportdev@scores-decisions.com
|
||||
profil.mail.email.contact = supportdev@scores-decisions.com
|
||||
profil.mail.email.production = supportdev@scores-decisions.com
|
||||
profil.wkhtmltopdf.path = "/usr/local/bin/wkhtmltopdf"
|
||||
profil.path.shared = "PROJECT_DIR/shared"
|
||||
|
||||
; Metier - Infogreffe
|
||||
profil.infogreffe.wsdl = "infogreffe.wsdl"
|
||||
profil.infogreffe.url = "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE"
|
||||
profil.infogreffe.uri = "https://webservices.infogreffe.fr/"
|
||||
profil.infogreffe.user = 85000109
|
||||
profil.infogreffe.password = 166
|
||||
profil.infogreffe.cache.path = "PROJECT_DIR/shared/cache"
|
||||
profil.infogreffe.cache.time = 8
|
||||
profil.infogreffe.storage.path = "PROJECT_DIR/shared/datafile/greffes"
|
||||
|
||||
; Sphinx configuration
|
||||
profil.sphinx.ent.host = "192.168.78.249"
|
||||
profil.sphinx.ent.port = 9312
|
||||
profil.sphinx.ent.version = 2
|
||||
profil.sphinx.dir.host = "192.168.78.249"
|
||||
profil.sphinx.dir.port = 9312
|
||||
profil.sphinx.dir.version = 2
|
||||
profil.sphinx.act.host = "192.168.78.249"
|
||||
profil.sphinx.act.port = 9312
|
||||
profil.sphinx.act.version = 2
|
||||
profil.sphinx.histo.host = "192.168.78.249"
|
||||
profil.sphinx.histo.port = 9312
|
||||
profil.sphinx.histo.version = 2
|
||||
|
||||
; For old configuration - see Configure.php
|
||||
profil.db.metier.adapter=mysqli
|
||||
profil.db.metier.params.host=192.168.78.249
|
||||
profil.db.metier.params.username=wsuser
|
||||
profil.db.metier.params.password=scores
|
||||
profil.db.metier.params.dbname=sdv1
|
||||
profil.db.metier.params.driver_options.MYSQLI_INIT_COMMAND = "SET NAMES utf8mb4"
|
||||
|
||||
[staging : production]
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[development : production]
|
||||
phpSettings.soap.wsdl_cache_enabled = 0
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 0
|
||||
resources.frontController.params.displayExceptions = 1
|
||||
|
||||
[testing : production]
|
||||
phpSettings.display_startup_errors = 1
|
||||
phpSettings.display_errors = 1
|
Loading…
Reference in New Issue
Block a user