Exemplo n.º 1
0
         if (empty(\GO::config()->title)) {
             \GO::config()->title = 'Group-Office';
         }
         //set this to a default otherwise GO will keep autodetecting values
         if (empty(\GO::config()->db_user)) {
             \GO::config()->db_user = '******';
         }
         $f = new \GO\Base\Fs\Folder($_POST['file_storage_path']);
         if (!$f->exists()) {
             \GO\Base\Html\Input::setError("file_storage_path", "File storage folder doesn't exist. Please make sure it exists and it must be writable for the webserver user.");
         } elseif (!$f->isWritable()) {
             \GO\Base\Html\Input::setError("file_storage_path", "File storage must be writable for the webserver user.");
         }
         \GO::config()->file_storage_path = $f->path() . '/';
         $f = new \GO\Base\Fs\Folder($_POST['tmpdir']);
         if (!$f->exists() && !$f->create(0777)) {
             \GO\Base\Html\Input::setError("tmpdir", "Temporary folder doesn't exist. Please make sure it exists and it must be writable for the webserver user.");
         } elseif (!$f->isWritable()) {
             \GO\Base\Html\Input::setError("tmpdir", "Temporary folder must be writable for the webserver user.");
         }
         \GO::config()->tmpdir = $f->path() . '/';
         \GO::config()->save($config);
         if (!\GO\Base\Html\Input::hasErrors()) {
             redirect("regional.php");
         }
     }
 } catch (Exception $e) {
     \GO\Base\Html\Input::setError("form", $e->getMessage());
 }
 printHead();
 //check if config root_path matches the current Group-Office in case an /etc/groupoffice/config.php was found that conflicts with this installation.
Exemplo n.º 2
0
 public function getFileStorageCronJobClasses($folderName = 'cron')
 {
     $foundCronJobClasses = array();
     $folderPath = \GO::config()->file_storage_path . 'php/' . $folderName;
     $folder = new \GO\Base\Fs\Folder($folderPath);
     \GO::debug("CRONFILE SEARCH IN FOLDER: " . $folder->path());
     if ($folder->exists()) {
         $items = $folder->ls();
         $reflectionClasses = array();
         foreach ($items as $item) {
             if (is_file($item)) {
                 $className = 'GOFS\\Cron\\' . $item->nameWithoutExtension();
                 $reflectionClasses[] = new \ReflectionClass($className);
             }
         }
         foreach ($reflectionClasses as $reflectionClass) {
             if ($this->_checkIsCronJobClassFile($reflectionClass)) {
                 \GO::debug("CRONFILE FOUND: " . $reflectionClass->name);
                 $cronJob = new $reflectionClass->name();
                 $foundCronJobClasses[$reflectionClass->name] = $cronJob->getLabel();
             }
         }
     }
     return $foundCronJobClasses;
 }
Exemplo n.º 3
0
 /**
  * Find classes in a folder
  *
  * @param string $path Relative from $config['file_storage_path'].'php/'
  * @return \ReflectionClass[]
  */
 public static function findFsClasses($subfolder, $subClassOf = null)
 {
     $classes = array();
     $folder = new \GO\Base\Fs\Folder(\GO::config()->file_storage_path . 'php/' . $subfolder);
     if ($folder->exists()) {
         $items = $folder->ls();
         foreach ($items as $item) {
             if ($item instanceof \GO\Base\Fs\File) {
                 $className = 'GOFS\\';
                 $subFolders = explode('/', $subfolder);
                 foreach ($subFolders as $sf) {
                     $className .= ucfirst($sf) . '\\';
                 }
                 $className .= $item->nameWithoutExtension();
                 $rc = new \ReflectionClass($className);
                 if ($subClassOf == null || $rc->isSubclassOf($subClassOf)) {
                     $classes[] = $rc;
                 }
             }
         }
     }
     return $classes;
 }