meta, 'webserver') && $data->meta->webserver && $this->_conf->getKey('webserver') == "Apache") { // Create .htaccess file if it does not exist. $file = self::$_path . DIRECTORY_SEPARATOR . '.htaccess'; if (!is_file($file)) { $writtenBytes = @file_put_contents( $file, 'Allow from none' . PHP_EOL . 'Deny from all' . PHP_EOL, LOCK_EX ); if ($writtenBytes === false || $writtenBytes < 30) { throw new Exception('unable to write to file ' . $file, 11); } } } } /** * store the data * * @access protected * @static * @param string $filename * @param string $data * @throws Exception * @return string */ protected static function _store($filename, $data) { self::_initialize(); $file = self::$_path . DIRECTORY_SEPARATOR . $filename; $writtenBytes = @file_put_contents($file, $data, LOCK_EX); if ($writtenBytes === false || $writtenBytes < strlen($data)) { throw new Exception('unable to write to file ' . $file, 13); } @chmod($file, 0640); // protect file access return $file; } }