Beispiel #1
0
 protected function loadData($autoloadFile, $returns = array())
 {
     if (file_exists($autoloadFile)) {
         $content = $this->getFileManager()->getContents($autoloadFile);
         $arrayContent = Json::getArrayData($content);
         if (!empty($arrayContent)) {
             return $arrayContent;
         }
         $GLOBALS['log']->error('Autoload::unify() - Empty file or syntax error - [' . $autoloadFile . ']');
     }
     return $returns;
 }
Beispiel #2
0
 protected function getAddData($currData, $routeFile)
 {
     if (file_exists($routeFile)) {
         $content = $this->getFileManager()->getContents($routeFile);
         $arrayContent = Json::getArrayData($content);
         if (empty($arrayContent)) {
             $GLOBALS['log']->error('Route::unify() - Empty file or syntax error - [' . $routeFile . ']');
             return $currData;
         }
         $currData = $this->addToData($currData, $arrayContent);
     }
     return $currData;
 }
Beispiel #3
0
 /**
  * Merge layout data
  * Ex. $scope= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
  *
  * @param JSON string $data
  * @param string $scope - ex. Account
  * @param string $name - detail
  *
  * @return bool
  */
 public function merge($data, $scope, $name)
 {
     $scope = $this->sanitizeInput($scope);
     $name = $this->sanitizeInput($name);
     $prevData = $this->get($scope, $name);
     $prevDataArray = Json::getArrayData($prevData);
     $dataArray = Json::getArrayData($data);
     $data = Util::merge($prevDataArray, $dataArray);
     $data = Json::encode($data);
     return $this->set($data, $scope, $name);
 }
Beispiel #4
0
 /**
  * Merge layout data
  * Ex. $controller= Account, $name= detail then will be created a file layoutFolder/Account/detail.json
  *
  * @param JSON string $data
  * @param string $controller - ex. Account
  * @param string $name - detail
  *
  * @return bool
  */
 public function merge($data, $controller, $name)
 {
     $prevData = $this->get($controller, $name);
     $prevDataArray = Json::getArrayData($prevData);
     $dataArray = Json::getArrayData($data);
     $data = Util::merge($prevDataArray, $dataArray);
     $data = Json::encode($data);
     return $this->set($data, $controller, $name);
 }