I must edit an php-file - but the ending is .jpg

Hi,

I need a dynamic picture - it must be .jpg. So I have a directory where the server will parse .jpg.

But now I can't edit that file in PHPstorm (intellij 138.1980.1). Is it possible to edit .jpg like php-file (in fact it is php) - but only in ONE directory (because in all other directories of course the .jpg - Files are real .jpg files)

cu

5 comments
Comment actions Permalink

You can tell the IDE to treat this file as PHP - in Settings/File Types/PHP Files (PHP) add <your file name>.jpg to registered patterns list

0
Comment actions Permalink

Hi,

yes, thank you - but is it possible to do that just for one directory - or just for one project?

cu

0
Comment actions Permalink

Don't understand what you mean by doing it for one directory... Do you mean that you have same-named .jpg files in different folders, and like to treat foo.jpg in one folder as PHP and foo.jpg in another one - as JPG?

0
Comment actions Permalink

Hi,

I want the IDE to treat all jpg-Files like jpg-files - EXCEPT in on folder.
In this folder is an .htaccess file:

 
AddType application/x-httpd-php .php .jpg
  
...
  
So in this special folder I want to treat .jpg - Files as php-fils. All of them.
  
cu
0
Comment actions Permalink
but is it possible to do that just for one directory - or just for one project?

No -- "Settings | File Types" is an IDE-wide setting that affects ALL projects.

Better use URL-rewriting capabilities of your web-server (or routing mechanism of your framework) and redirect requests to such .jpg files to a .php file.

0

Please sign in to leave a comment.