Merge branch 'master' of ssh://172.20.0.1/var/git/espo/backend

This commit is contained in:
yuri
2017-04-10 11:18:09 +03:00
4 changed files with 48 additions and 2 deletions
@@ -125,12 +125,24 @@ class Converter
//check if exist files in "Tables" directory and merge with ormMetadata
$ormMeta = Util::merge($ormMeta, $this->getCustomTables($ormMeta));
if (isset($ormMeta['unsetIgnore'])) {
$protectedOrmMeta = array();
foreach ($ormMeta['unsetIgnore'] as $protectedKey) {
$protectedOrmMeta = Util::merge( $protectedOrmMeta, Util::fillArrayKeys($protectedKey, Util::getValueByKey($ormMeta, $protectedKey)) );
}
unset($ormMeta['unsetIgnore']);
}
//unset some keys in orm
if (isset($ormMeta['unset'])) {
$ormMeta = Util::unsetInArray($ormMeta, $ormMeta['unset']);
unset($ormMeta['unset']);
} //END: unset some keys in orm
if (isset($protectedOrmMeta)) {
$ormMeta = Util::merge($ormMeta, $protectedOrmMeta);
}
if (isset($entityList)) {
$entityList = is_string($entityList) ? (array) $entityList : $entityList;
+2 -1
View File
@@ -55,7 +55,7 @@ class ScheduledJob
protected $cronSetup = array(
'linux' => '* * * * * cd {DOCUMENT_ROOT}; {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1',
'windows' => '{PHP-BIN-DIR}.exe -f {FULL-CRON-PATH}',
'windows' => '{PHP-BINARY} -f {FULL-CRON-PATH}',
'mac' => '* * * * * cd {DOCUMENT_ROOT}; {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1',
'default' => '* * * * * cd {DOCUMENT_ROOT}; {PHP-BIN-DIR} -f {CRON-FILE} > /dev/null 2>&1',
);
@@ -165,6 +165,7 @@ class ScheduledJob
$data = array(
'PHP-BIN-DIR' => $this->getSystemUtil()->getPhpBin(),
'PHP-BINARY' => $this->getSystemUtil()->getPhpBinary(),
'CRON-FILE' => $this->cronFile,
'DOCUMENT_ROOT' => $this->getSystemUtil()->getRootDir(),
'FULL-CRON-PATH' => Util::concatPath($this->getSystemUtil()->getRootDir(), $this->cronFile),
+12 -1
View File
@@ -28,6 +28,7 @@
************************************************************************/
namespace Espo\Core\Utils;
class System
{
/**
@@ -105,7 +106,17 @@ class System
*/
public function getPhpBin()
{
return (defined("PHP_BINDIR"))? PHP_BINDIR.DIRECTORY_SEPARATOR.'php' : 'php';
return defined("PHP_BINDIR") ? PHP_BINDIR . DIRECTORY_SEPARATOR . 'php' : 'php';
}
/**
* Get PHP binary
*
* @return string
*/
public function getPhpBinary()
{
return defined("PHP_BINARY") ? PHP_BINARY : 'php';
}
/**
+22
View File
@@ -580,5 +580,27 @@ class Util
return $diff;
}
/**
* Fill array with specified keys
*
* @param array|string $keys
* @param mixed $value
*
* @return array
*/
public static function fillArrayKeys($keys, $value)
{
$arrayKeys = is_array($keys) ? $keys : explode('.', $keys);
$array = array();
foreach (array_reverse($arrayKeys) as $i => $key) {
$array = array(
$key => ($i == 0) ? $value : $array,
);
}
return $array;
}
}