To make the pastry, sift the flour into a bowl. In a food processor preferably, add flour and the butter. Pulse until the mixture resembles fine breadcrumbs. Add egg yolk and water gradually to form dough. Press, don’t knead, the dough together into a ball – handle gently. Wrap in a plastic wrap and chill for 20 minutes.
Preheat oven to 375 degree Fahrenheit.
To make the filling:
In a large frying pan, melt butter and add onions and let cook on low heat for about 20 - 25 minutes while stirring occasionally to prevent burning. Add brown sugar and continue to cook over low heat about 15 minutes while stirring to prevent burning. Turn off heat and set aside.
With a rolling pin, roll out the dough on a lightly floured surface. Always roll from the center outwards, rotating the dough than rolling backwards and forwards. (Roll out to make the shape of the dish.) Roll the pastry back over the rolling pin so it is hanging, and ease it into the tin or pie dish.
Gently press dough inside tin or dish, gently press the sides of the dough with your thumbs to flatten and lift it a little and cut any excess dough. Line the shell with baking paper. Pour some baking beads, dried beads or dried beans. Bake for 15 minutes. Remove beads or beans and paper and bake again for 5 minutes. Remove and let cool.
In a large bowl, beat eggs and stir in heavy cream. Add prosciutto or ham, thyme, basil, and cheese and continue stirring to mix. Add onions mixture and mix. Add salt and pepper to taste only. Pour mixture onto tin shell or pie dish and bake on middle rack in the oven for about 40 minutes or until golden brown and fully baked. (If tin shell or piecrust is browning too fast, cover sides with aluminum foil to prevent burning.