/** * Filesystem method detection * */ function UpdateFilesystem() { global $page; $filesystem_method = $page->DetectFileSystem(); self::AssertEquals($filesystem_method, 'gp_filesystem_direct'); $this->FileSystem = \gp\tool\FileSystem::set_method('gp_filesystem_direct'); }
/** * Determine how we'll be writing the new code to the server (ftp or direct) * */ function DetectFileSystem() { global $dataDir; //already determined if (isset($_POST['filesystem_method'])) { $this->FileSystem = \gp\tool\FileSystem::set_method($_POST['filesystem_method']); if ($this->FileSystem) { return $_POST['filesystem_method']; } } $this->curr_step = 1; //make sure we don't attempt anything beyond step 1 $context[$dataDir] = 'file'; // Need to be able to write to the dataDir $context[$dataDir . '/include'] = 'file'; // Need to be able to rename or delete the include directory $context[$dataDir . '/themes'] = 'dir'; // These may have user content in them and should not be completely replaced $context[$dataDir . '/addons'] = 'dir'; $this->FileSystem = \gp\tool\FileSystem::init($context); if (!$this->FileSystem) { return false; } return $this->FileSystem->method; }