Photophysics of mesoporphyrin IX in solution and confined in sol–gel-derived matrices