Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Bee-color framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jordan Breton
Bee-color framework
Commits
394ec3b7
Commit
394ec3b7
authored
Aug 12, 2019
by
Jordan Breton
✏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unecessary files cleaned up + removal of references to the tester
parent
acabf49b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
36064 deletions
+0
-36064
cli/backup/BackupLauncher.php
cli/backup/BackupLauncher.php
+0
-1
cli/wfw/WFWGlobalLauncher.php
cli/wfw/WFWGlobalLauncher.php
+0
-5
cli/wfw/WFWLauncher.php
cli/wfw/WFWLauncher.php
+0
-8
cli/zipCode/converter.php
cli/zipCode/converter.php
+0
-64
cli/zipCode/parser.php
cli/zipCode/parser.php
+0
-85
cli/zipCode/zipCodes.csv
cli/zipCode/zipCodes.csv
+0
-35856
engine/install.txt
engine/install.txt
+0
-45
No files found.
cli/backup/BackupLauncher.php
View file @
394ec3b7
#!/usr/bin/php -q
<?php
use
wfw\cli\backup\Backup
;
use
wfw\cli\backup\BackupManager
;
use
wfw\cli\backup\conf\BackupManagerConf
;
...
...
cli/wfw/WFWGlobalLauncher.php
View file @
394ec3b7
...
...
@@ -539,11 +539,6 @@ try{
$backup
->
set
(
"mysql"
,
$mysqlPath
);
$backup
->
set
(
"mysqldump"
,
$wfwConf
->
getString
(
"mysqldump_path"
)
??
"mysqldump"
);
$backup
->
save
();
//tester's confs :
$tester
=
new
FileBasedConf
(
"
$path
/cli/tester/config/conf.tests.json"
);
$tester
->
set
(
"msserver/addr"
,
$msConf
->
getSocketPath
());
$tester
->
save
();
fwrite
(
STDOUT
,
"Project configured.
\n
"
);
//then, set the unix owner for the new project and give-it to the given user (apache,ngnix..)
$exec
(
"chmod -R
$unixPerm
$path
"
);
...
...
cli/wfw/WFWLauncher.php
View file @
394ec3b7
...
...
@@ -23,11 +23,6 @@ $argvReader = new ArgvReader(new ArgvParser(new ArgvOptMap([
'service'
,
"Gestion des services wfw : service -help pour plus d'informations."
,
null
,
null
,
true
),
new
ArgvOpt
(
'test'
,
"Lancement de tests wfw : test -help pour plus d'informations."
,
null
,
null
,
true
)
])),
$argv
);
...
...
@@ -64,9 +59,6 @@ try{
case
'service'
:
$path
=
dirname
(
__DIR__
,
2
)
.
'/daemons/sctl/SCTLClientLauncher.php'
;
break
;
case
'test'
:
$path
=
dirname
(
__DIR__
)
.
'/tester/testsLauncher.php'
;
break
;
default
:
throw
new
InvalidArgumentException
(
"Unknown command
$argv[1]
. --help to display the command list."
);
}
...
...
cli/zipCode/converter.php
deleted
100755 → 0
View file @
acabf49b
#!/usr/bin/php -q
<?php
use
wfw\engine\lib\cli\argv\ArgvOpt
;
use
wfw\engine\lib\cli\argv\ArgvOptMap
;
use
wfw\engine\lib\cli\argv\ArgvParser
;
use
wfw\engine\lib\cli\argv\ArgvReader
;
/**
* Permet de traduire le csv produit par le script parser.php en un fichier php indexant les villes
* par code postaux.
* Le tableau résultant est tri dans l"ordre des codes postaux du plus petit au plus grand.
*/
require_once
dirname
(
__DIR__
)
.
"/init.environment.php"
;
$argvReader
=
new
ArgvReader
(
new
ArgvParser
(
new
ArgvOptMap
([
new
ArgvOpt
(
"-s"
,
"Fichier CSV contenant les données"
,
1
,
function
(
$dirname
){
return
file_exists
(
$dirname
);},
false
,
"[$0] n'est pas un fichier valide !"
),
new
ArgvOpt
(
"-d"
,
"Nom du fichier de sortie"
,
1
,
function
(
$fileName
){
return
is_dir
(
dirname
(
$fileName
));
},
false
,
"[$0] existe déjà."
)
])),
$argv
);
$source
=
$argvReader
->
get
(
'-s'
)[
0
];
$dest
=
$argvReader
->
get
(
'-d'
)[
0
];
$codes
=
[];
$toRead
=
fopen
(
$source
,
'r'
);
fgets
(
$toRead
);
//On passe la première ligne, qui contient l'intitulé des colonnes.
while
(
!
feof
(
$toRead
)){
$line
=
explode
(
';'
,
str_replace
(
"
\n
"
,
''
,
fgets
(
$toRead
)));
if
(
is_array
(
$line
)
&&
count
(
$line
)
===
2
){
if
(
isset
(
$codes
[
$line
[
0
]]))
$codes
[
$line
[
0
]][]
=
$line
[
1
];
else
$codes
[
$line
[
0
]]
=
[
$line
[
1
]];
}
}
fclose
(
$toRead
);
ksort
(
$codes
);
$totalLength
=
count
(
$codes
);
$current
=
0
;
$toWrite
=
fopen
(
$dest
,
'w'
);
fwrite
(
$toWrite
,
"<?php
\n
return [
\n
"
);
foreach
(
$codes
as
$code
=>
$cities
){
if
(
!
empty
(
$code
)){
$str
=
"
\t\"
$code
\"
=>[
\"
"
.
implode
(
'","'
,
$cities
)
.
"
\"
]"
;
if
(
$current
<
$totalLength
-
1
)
$str
.
=
','
;
fwrite
(
$toWrite
,
"
$str
\n
"
);
}
}
fwrite
(
$toWrite
,
"];"
);
fclose
(
$toWrite
);
\ No newline at end of file
cli/zipCode/parser.php
deleted
100755 → 0
View file @
acabf49b
#!/usr/bin/php -q
<?php
use
wfw\engine\lib\cli\argv\ArgvOpt
;
use
wfw\engine\lib\cli\argv\ArgvOptMap
;
use
wfw\engine\lib\cli\argv\ArgvParser
;
use
wfw\engine\lib\cli\argv\ArgvReader
;
/**
* Note à moi même :
*
* Ce script permet d'extraire les noms des communes et les codes postaux des fichiers
* trouvés sur http://bano.openstreetmap.fr/BAN_odbl/csv/
* Les fichiers doivent tous se trouver dans le même dossier et être préalablement décompressés.
* Les fichiers à telecharger sont au format csv, pour un traitement ligne par ligne.
* Il les aggrége dans un nouveau fichier au format csv contenant code_postal;commune
* Un autre script permet ensuite de convertir ce fichier en un fichier PHP important
* un tableau indéxé par code postal : converter.php
* Ce fichier PHP est à utiliser lorsque OPCACHE est activé.
* Sinon le jeu de données CSV peut être utilisé pour remplire une base mysql ou autre systeme.
*/
require_once
dirname
(
__DIR__
)
.
"/init.environment.php"
;
$argvReader
=
new
ArgvReader
(
new
ArgvParser
(
new
ArgvOptMap
([
new
ArgvOpt
(
"-s"
,
"Chemin d'accés au dossier contenant les fichiers à traiter"
,
1
,
function
(
$dirname
){
return
is_dir
(
$dirname
);},
false
,
"[$0] n'est pas un dossier"
),
new
ArgvOpt
(
"-d"
,
"Nom du fichier de sortie"
,
1
,
function
(
$fileName
){
return
is_dir
(
dirname
(
$fileName
));
},
false
,
"[$0] existe déjà."
),
new
ArgvOpt
(
'-sep'
,
'Séparateur (défaut : , )'
,
1
,
null
,
true
),
new
ArgvOpt
(
'-z'
,
'ZipCode index (défaut : 6)'
,
1
,
function
(
$data
){
return
intval
(
$data
)
>=
0
;
},
true
,
"L'index doit être positif"
),
new
ArgvOpt
(
'-c'
,
'Commune index (défaut : 11)'
,
1
,
function
(
$data
){
return
intval
(
$data
)
>=
0
;
},
true
,
"L'index doit être positif"
)
])),
$argv
);
$d
=
$argvReader
->
get
(
'-d'
)[
0
];
$source
=
$argvReader
->
get
(
"-s"
)[
0
];
$sep
=
$argvReader
->
exists
(
'-sep'
)
?
$argvReader
->
get
(
'-sep'
)[
0
]
:
','
;
$zIndex
=
$argvReader
->
exists
(
'-z'
)
?
$argvReader
->
get
(
'-z'
)[
0
]
:
6
;
$cIndex
=
$argvReader
->
exists
(
'-c'
)
?
$argvReader
->
get
(
'-c'
)[
0
]
:
11
;
$start
=
microtime
(
true
);
$files
=
0
;
$lines
=
0
;
$cache
=
[];
$dest
=
fopen
(
$d
,
'w'
);
fwrite
(
$dest
,
"code_postal;commune
\n
"
);
foreach
(
array_diff
(
scandir
(
$source
),[
'.'
,
'..'
])
as
$f
){
fwrite
(
STDOUT
,
"Reading file
$source
/
$f
...
\n
"
);
$files
++
;
$current
=
fopen
(
"
$source
/
$f
"
,
'r'
);
//on passe la première ligne qui contient les intitulés de colonnes
fgets
(
$current
);
while
(
!
feof
(
$current
)){
$tmp
=
explode
(
$sep
,
$line
=
fgets
(
$current
));
if
(
count
(
$tmp
)
>
1
){
$lines
++
;
$cacheKey
=
"
$tmp[$zIndex];$tmp[$cIndex]
"
;
if
(
!
isset
(
$cache
[
$cacheKey
])){
$cache
[
$cacheKey
]
=
true
;
fwrite
(
$dest
,
"
$cacheKey
\n
"
);
}
}
}
fclose
(
$current
);
}
fclose
(
$dest
);
fwrite
(
STDOUT
,
"Done ("
.
((
microtime
(
true
)
-
$start
))
.
"s to parse
$files
files and
$lines
lines)
\n
"
);
\ No newline at end of file
cli/zipCode/zipCodes.csv
deleted
100644 → 0
View file @
acabf49b
This diff is collapsed.
Click to expand it.
engine/install.txt
deleted
100755 → 0
View file @
acabf49b
//--------> Apache
sudo apt-get install apache2
//--------> configuration apache 2 :
//mod_rewrite
sudo a2enmod rewrite
sudo a2enmod headers
//module de compression
sudo a2enmod deflate
//mod_filter
sudo a2enmod filter
//---------> Mysql
sudo apt-get install mysql
//---------> PHP 7.2 :
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2 php7.2-common php7.2-curl php7.2-xml php7.2-zip php7.2-gd php7.2-mysql php7.2-mbstring php-apcu
sudo phpenmod apcu
//retoucher php.ini : sudo nano /etc/php/7.1/apache2/php.ini
//display_errors=On // important pour les logs d'erreurs clients.
[opcache]
opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.optimization_level=0xffffffff
//---------->phpmyadmin
sudo apt-get install phpmyadmin
//créer l'utilisateur wfw
//sudo systemctl restart apache2.service
// cli/installer
sudo ./install.sh -global
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment