...
 
Commits (3)
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
# Change these settings to your own preference
indent_style = tab
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = true
[*.{yaml,yml,py}]
indent_style = space
indent_size = 2
www/cache
!www/cache/.gitkeep
www/logs
#Installation de docker sur Debian / Ubuntu
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo usermod -aG docker $USER
#Installation de docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
#Execution du docker labonneformation: écoute dur le port 8080 => http://localhost:8080
docker-compose up -d --build
#Attention cette installation n'est pas adaptée à un environnement de production
version: "3"
services:
web:
hostname: web
restart: always
build:
context: .
dockerfile: dockerfile_web
ports:
- "8080:80"
database:
hostname: database
restart: always
build:
context: .
dockerfile: dockerfile_database
volumes:
- "labonneformation:/var/lib/database"
volumes:
labonneformation:
FROM ubuntu:trusty
VOLUME labonneformation
RUN mkdir -p /var/lib/database/mysql /var/lib/database/sphinx; \
ln -sfn /var/lib/database/sphinx /home/sphinx; \
ln -sfn /var/lib/database/mysql /var/lib/mysql;
RUN export DEBIAN_FRONTEND=noninteractive; \
apt-get update && \
apt-get -y install mariadb-server && \
apt-get -y install sphinxsearch && \
apt-get -y install wget bzip2
RUN wget http://sphinxsearch.com/files/sphinxsearch_2.2.10-release-0ubuntu12~trusty_amd64.deb && \
dpkg -i --force-all sphinxsearch_2.2.10-release-0ubuntu12~trusty_amd64.deb && \
apt-get -y -f install
RUN sed -i 's/=no/=yes/' /etc/default/sphinxsearch; \
mkdir -p /home/sphinx/log /home/sphinx/indexes/lbf; \
chown -R sphinxsearch: /home/sphinx /home/sphinx/*; \
echo "[mysqld]\nbind-address = 0.0.0.0" >/etc/mysql/conf.d/55-server.cnf;
ARG SCHEMA=labonneformation
RUN echo "service mysql start" >>/tmp/init.sh; \
echo "if [ ! -d /var/lib/mysql/${SCHEMA} ]; then" >>/tmp/init.sh; \
echo "mysql -e \"CREATE USER 'root'@'%' IDENTIFIED BY ''\";" >>/tmp/init.sh; \
echo "mysql -e \"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'\";" >>/tmp/init.sh; \
echo "mysql -e \"FLUSH PRIVILEGES\";" >>/tmp/init.sh; \
echo "mysql -e \"INSTALL SONAME 'ha_sphinx';\";" >>/tmp/init.sh; \
echo "mysql -e \"CREATE DATABASE ${SCHEMA}\";" >>/tmp/init.sh; \
echo "bzip2 -dcq /home/lbf_database.sql.bz2 | mysql -uroot ${SCHEMA}" >>/tmp/init.sh; \
echo "indexer --all --rotate" >>/tmp/init.sh; \
echo "fi" >>/tmp/init.sh; \
echo "service sphinxsearch start >>/var/log/sphinx.log" >>/tmp/init.sh;
COPY ./web/home/www/labonneformation/config/sphinx.conf /etc/sphinxsearch/
COPY ./database/home/database/lbf_database.sql.bz2 /home/
CMD bash /tmp/init.sh; \
sleep infinity;
FROM ubuntu:bionic
ARG PHP_VER=7.2
RUN apt-get update && \
apt-get -y install php${PHP_VER}-gd php${PHP_VER}-cli php${PHP_VER}-mysql php${PHP_VER}-mysqli \
php${PHP_VER}-mbstring php${PHP_VER}-bz2 php${PHP_VER}-xml php${PHP_VER}-tidy php${PHP_VER}-curl && \
apt-get -y install mariadb-client
RUN mkdir -p /home/www;
COPY ./web/home/www /home/www
CMD cd /home/www/labonneformation; \
php -S 0.0.0.0:80 batch/quarky.php
<?php
$path=pathinfo(__FILE__)['dirname'].DIRECTORY_SEPARATOR;
if(file_exists($path.'config.dev.php'))
require_once($path.'config.dev.php');
$protocol=(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS']!=='off' || (array_key_exists('SERVER_PORT',$_SERVER) && $_SERVER['SERVER_PORT']==443))?'https':'http';
if(!defined('DOMAIN')) define('DOMAIN',array_key_exists('HTTP_HOST',$_SERVER)?$_SERVER['HTTP_HOST']:'labonneformation.pole-emploi.fr');
......@@ -11,31 +9,13 @@
if(!defined('SHOW_INTERCARIF')) define('SHOW_INTERCARIF',false);
if(!defined('SMTP_SERVER')) define('SMTP_SERVER','lbfsmtp');
if(!defined('MAILTO_404')) define('MAILTO_404','');
if(!defined('TOKEN_LBB')) define('TOKEN_LBB','');
if(!defined('LBB_HMACKEY')) define('LBB_HMAC_KEY','');
if(!defined('ENV_DEV')) define('ENV_DEV',true);
if(!defined('ENV_NAME')) define('ENV_NAME','oss');
if(!defined('DOWNLOAD_PATH')) define('DOWNLOAD_PATH','');
if(!defined('URL_WSINTERCARIF')) define('URL_WSINTERCARIF','');
if(!defined('URL_TREFLE')) define('URL_TREFLE','http://trefle.pole-emploi.fr');
if(!defined('TREFLE_API_VERSION')) define('TREFLE_API_VERSION','0.7');
if(!defined('URL_API_TREFLE')) define('URL_API_TREFLE',URL_TREFLE.(TREFLE_API_VERSION?"/".TREFLE_API_VERSION:""));
if(!defined('CRYPT_PASS')) define('CRYPT_PASS','');
if(!defined('KEY_STATS')) define('KEY_STATS','');
if(!defined('EMAIL_MODALCONTACT')) define('EMAIL_MODALCONTACT','');
if(!defined('EMAIL_CONTACT')) define('EMAIL_CONTACT','');
if(!defined('TAG_SEO_PROD')) define('TAG_SEO_PROD','');
if(!defined('TAG_SEO_RECETTE')) define('TAG_SEO_RECETTE','');
if(!defined('TAG_ANALYTICS_PROD')) define('TAG_ANALYTICS_PROD','');
if(!defined('TAG_ANALYTICS_RECETTE')) define('TAG_ANALYTICS_RECETTE','');
if(!defined('TAG_OPTIMIZE_PROD')) define('TAG_OPTIMIZE_PROD','');
if(!defined('TAG_OPTIMIZE_RECETTE')) define('TAG_OPTIMIZE_RECETTE','');
if(!defined('TAG_HOTJAR_PROD')) define('TAG_HOTJAR_PROD','');
if(!defined('TAG_HOTJAR_RECETTE')) define('TAG_HOTJAR_RECETTE','');
if(!defined('TAG_CRISP_PROD')) define('TAG_CRISP_PROD','');
if(!defined('TAG_CRISP_RECETTE')) define('TAG_CRISP_RECETTE','');
if(!isset($databaseRead)) $databaseRead=array('host'=>'','user'=>'','password'=>'','db'=>'');
if(!isset($databaseWrite)) $databaseWrite=array('host'=>'','user'=>'','password'=>''),'db'=>'');
if(!isset($databaseRead)) $databaseRead=array('host'=>'database','user'=>'root','password'=>'','db'=>'labonneformation');
if(!isset($databaseWrite)) $databaseWrite=array('host'=>'database','user'=>'root','password'=>'','db'=>'labonneformation');
if(!isset($database)) $database=$databaseWrite;
?>
......@@ -9,10 +9,10 @@ source data_lbf_referenceformacode
#####################################################################
# some straightforward parameters for SQL source types
sql_host = 127.0.0.1
sql_user =
sql_host = localhost
sql_user = root
sql_pass =
sql_db =
sql_db = labonneformation
sql_port = 3306 # optional, default is 3306
mysql_connect_flags = 32 # enable compression
......@@ -74,10 +74,10 @@ source data_lbf_reference
#####################################################################
# some straightforward parameters for SQL source types
sql_host = 127.0.0.1
sql_user =
sql_host = localhost
sql_user = root
sql_pass =
sql_db =
sql_db = labonneformation
sql_port = 3306 # optional, default is 3306
mysql_connect_flags = 32 # enable compression
......@@ -127,13 +127,13 @@ source data_lbf_ad
## SQL settings (for 'mysql' and 'pgsql' types)
#####################################################################
#alter table sphad connection='sphinx://127.0.0.1:3312/lbfad';
#alter table sphad connection='sphinx://localhost:3312/lbfad';
# some straightforward parameters for SQL source types
sql_host = 127.0.0.1
sql_user =
sql_host = localhost
sql_user = root
sql_pass =
sql_db =
sql_db = labonneformation
sql_port = 3306 # optional, default is 3306
mysql_connect_flags = 32 # enable compression
......
<?php
//Classe type API.
class AdSearch
{
protected $codesFinanceurs=array(
......
This diff is collapsed.