WIP: Untested, solo caricati file di test
This commit is contained in:
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
/*
|
||||
* Questo script viene lanciato sempre dall'entrypoint, quindi va usato con cautela e deve semplicemente assicurarsi
|
||||
* che i vincoli di versione siano rispettati
|
||||
* generateDefaults.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 09 gen 2017
|
||||
*/
|
||||
|
||||
$buildName = getenv("ASD_BUILDNAME");
|
||||
require_once ("/home/asdynamics/private/$buildName/load.php");
|
||||
|
||||
use ASD\DB\DaoRegistry;
|
||||
|
||||
try{
|
||||
|
||||
// $dao = DaoRegistry::getDefaultMongo();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
var_dump($ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
/*
|
||||
* Questo dovrebbe essere uno script di inizializzazione del progetto, andrebbe usato solo una volta
|
||||
*
|
||||
* generateDefaults.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 09 gen 2017
|
||||
*/
|
||||
|
||||
$buildName = getenv("ASD_BUILDNAME");
|
||||
require_once ("/home/asdynamics/private/$buildName/load.php");
|
||||
|
||||
try{
|
||||
|
||||
|
||||
exit(0);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
var_dump($ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
/******************************************
|
||||
* Author : Riccardo Di Dato
|
||||
* Created On : Tue Sep 22 2020
|
||||
* File : processJobs.php
|
||||
*******************************************/
|
||||
|
||||
use ASD\Context;
|
||||
use ASD\DB\DaoRegistry;
|
||||
use ASD\Job\JobExecutor;
|
||||
use ASD\Job\LocalFilesystemComunicationStrategy;
|
||||
use ASD\Job\LogManagerLoggingStrategy;
|
||||
use ASD\Job\MongoJobStorageClass;
|
||||
use ASD\Job\RunnableJobFactory;
|
||||
use ASD\Job\SingleJobExecutionStrategy;
|
||||
|
||||
$buildName = getenv("ASD_BUILDNAME");
|
||||
require_once ("/home/asdynamics/private/$buildName/load.php");
|
||||
|
||||
try{
|
||||
|
||||
$jobFactory = new RunnableJobFactory();
|
||||
|
||||
|
||||
$storageClass = new MongoJobStorageClass(DaoRegistry::getDefaultMongo(), $jobFactory);
|
||||
$comStrategy = new LocalFilesystemComunicationStrategy(
|
||||
Context::getEnvironment()->getFilePath("comunication.shutdown"),
|
||||
Context::getEnvironment()->getFilePath("comunication.execution"),
|
||||
Context::getEnvironment()->getFilePath("comunication.idle")
|
||||
);
|
||||
$execStrat = new SingleJobExecutionStrategy();
|
||||
$logStrategy = new LogManagerLoggingStrategy("job");
|
||||
|
||||
$executor = new JobExecutor($storageClass, $comStrategy, $execStrat, $logStrategy );
|
||||
$executor->run();
|
||||
exit(0);
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
var_dump($ex);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
* catalogue.en.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 08 gen 2019
|
||||
*/
|
||||
|
||||
require_once("/home/asdynamics/private/asdphp/common/catalogue.default.en.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/******************************************
|
||||
* Author : Riccardo Di Dato
|
||||
* Created On : Wed Nov 13 2019
|
||||
* File : catalogue.it.php
|
||||
*******************************************/
|
||||
|
||||
require_once("/home/asdynamics/private/asdphp/common/catalogue.default.it.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
Author: Riccardo Di Dato
|
||||
Creation Date: 07/gen/2016
|
||||
*/
|
||||
|
||||
// SMTP
|
||||
|
||||
use ASD\Context;
|
||||
|
||||
Context::setDefaultMultilanguageLocaleName("en");
|
||||
Context::setCurrentLocale("gui","en");
|
||||
Context::setCurrentLocale("system","en");
|
||||
Context::setCurrentLocale("api","en");
|
||||
|
||||
Context::getEnvironment()->addDirectoryPath("comunication", "/jobComunication");
|
||||
Context::getEnvironment()->addFilePath("comunication.shutdown", Context::getEnvironment()->getDirectoryPath("comunication")."/shutdown" );
|
||||
Context::getEnvironment()->addFilePath("comunication.execution", Context::getEnvironment()->getDirectoryPath("comunication")."/execution" );
|
||||
Context::getEnvironment()->addFilePath("comunication.idle", Context::getEnvironment()->getDirectoryPath("comunication")."/idle" );
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.inclusion.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 03 lug 2020
|
||||
*/
|
||||
|
||||
use ASD\Context;
|
||||
|
||||
$supportedLanguages = array("en", "it");
|
||||
|
||||
$commonFolder = Context::getEnvironment()->getDirectoryPath("common");
|
||||
|
||||
foreach ($supportedLanguages as $language){
|
||||
if (file_exists($commonFolder."/catalogue.$language.php") ){
|
||||
ASD\CatalogueManager::addCatalogue(
|
||||
$language,
|
||||
new ASD\Catalogue(
|
||||
new ASD\CatalogueFileRetriever($commonFolder."/catalogue.$language.php"),
|
||||
new ASD\KeyValueCatalogueTokenizer()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* Comment this file content if the service doesn't use any database
|
||||
*
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 14 dic 2016
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__)."/mongo/lib.config.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.include.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 18 gen 2019
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__)."/mongo/lib.inclusion.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.include.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 18 gen 2019
|
||||
*/
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/*
|
||||
* Comment this file content if the service doesn't use any database
|
||||
*
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 14 dic 2016
|
||||
*/
|
||||
|
||||
use ASD\DB\DaoRegistry;
|
||||
use ASD\DB\Mongo\MongoDao;
|
||||
|
||||
$dbName = getenv("ASD_MONGO_DBNAME");
|
||||
$dbUser = getenv("ASD_MONGO_USER");
|
||||
$dbPass = getenv("ASD_MONGO_PASSWORD");
|
||||
$dbLocation = getenv("ASD_MONGO_LOCATION");
|
||||
|
||||
$connectionString = "mongodb://".$dbUser.":".$dbPass."@".$dbLocation."/".$dbName;
|
||||
if ($dbUser === false || $dbPass === false) {
|
||||
$connectionString = "mongodb://".$dbLocation."/".$dbName;
|
||||
}
|
||||
|
||||
DaoRegistry::addDao(new MongoDao("main", $dbName, $connectionString), true);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.include.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 18 gen 2019
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__)."/models/lib.inclusion.php");
|
||||
require_once(dirname(__FILE__)."/customFields/lib.inclusion.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.include.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 18 gen 2019
|
||||
*/
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.inclusion.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 03/lug/2020
|
||||
*/
|
||||
|
||||
use ASD\Context;
|
||||
use ASD\FileSystemManager;
|
||||
use ASD\FileSystemRuleset;
|
||||
|
||||
// Lettura e scrittura su file system di log
|
||||
FileSystemManager::addRuleset(Context::getEnvironment()->getDirectoryPath("log"), new FileSystemRuleset(FileSystemRuleset::PERMISSION_READ + FileSystemRuleset::PERMISSION_WRITE));
|
||||
|
||||
// Lettura e scrittura su storage
|
||||
FileSystemManager::addRuleset(Context::getEnvironment()->getDirectoryPath("storage"), new FileSystemRuleset(FileSystemRuleset::PERMISSION_READ + FileSystemRuleset::PERMISSION_WRITE));
|
||||
|
||||
// Lettura e scrittura su tmp
|
||||
FileSystemManager::addRuleset(Context::getEnvironment()->getDirectoryPath("tmp"), new FileSystemRuleset(FileSystemRuleset::PERMISSION_READ + FileSystemRuleset::PERMISSION_WRITE));
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/******************************************
|
||||
* Author : Riccardo Di Dato
|
||||
* Created On : Mon Jul 22 2019
|
||||
* File : lib.configs.php
|
||||
*******************************************/
|
||||
|
||||
|
||||
$modules = array(
|
||||
"fileSystem",
|
||||
"db",
|
||||
"catalogue",
|
||||
"logger"
|
||||
);
|
||||
|
||||
if (sizeof($modules)>0){
|
||||
foreach ($modules as $module){
|
||||
require_once(dirname(__FILE__)."/$module/lib.config.php");
|
||||
}
|
||||
}
|
||||
date_default_timezone_set("Europe/Rome");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.inclusions.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 07 dic 2018
|
||||
*/
|
||||
|
||||
// require_once(dirname(__FILE__)."/plugins/autoload.php");
|
||||
|
||||
$modules = [
|
||||
"db"
|
||||
];
|
||||
|
||||
if (sizeof($modules)>0){
|
||||
foreach ($modules as $module){
|
||||
require_once(dirname(__FILE__)."/$module/lib.inclusion.php");
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/*
|
||||
* lib.inclusion.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 03/lug/2020
|
||||
*/
|
||||
|
||||
use ASD\API\Client\HttpClient;
|
||||
use ASD\Context;
|
||||
use ASD\Log\FileLogger;
|
||||
use ASD\Log\GELFLogger;
|
||||
use ASD\Log\Logger;
|
||||
use ASD\Log\LogManager;
|
||||
|
||||
if (Context::getEnvironment()->get("name") == "local") {
|
||||
LogManager::addLogger(new FileLogger("core", Context::getEnvironment()->getFilePath("log.core") , Logger::LEVEL_DEBUG));
|
||||
LogManager::addLogger(new FileLogger("dao", Context::getEnvironment()->getFilePath("log.dao"), Logger::LEVEL_DEBUG));
|
||||
}
|
||||
else {
|
||||
$httpClient = new HttpClient();
|
||||
LogManager::addLogger(new GELFLogger("core", "http://graylog3:12201/gelf", $httpClient, Logger::LEVEL_NOTICE));
|
||||
LogManager::addLogger(new GELFLogger("dao", "http://graylog3:12201/gelf", $httpClient, Logger::LEVEL_NOTICE));
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* load.php
|
||||
* Author: Riccardo Di Dato
|
||||
* Creation Date: 01/nov/2016
|
||||
*
|
||||
*/
|
||||
|
||||
require_once("/home/asdynamics/private/asdphp/load.php");
|
||||
|
||||
require_once(dirname(__FILE__)."/common/config.php");
|
||||
|
||||
require_once(dirname(__FILE__)."/lib/lib.inclusions.php");
|
||||
|
||||
require_once(dirname(__FILE__)."/lib/lib.configs.php");
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user