non-specific php functions

Share your ideas and comments.

Moderators: rcrisler1, saltybeagle

non-specific php functions

Postby rin » Wed Sep 20, 2006 3:19 pm

I am suggesting when making the php templates to use non-specific php functions.

i.e. the current php templates use virtual() to include the sharedcode files. The better approach would be to use include since virtual is an Apache-specific function and unfortunately not all of us are running Apache web servers.

It's quite time consuming with the unnecessary step of opening every php file in an editor outside of dreamweaver just to change the way the files are included.
rin
 
Posts: 21
Joined: Thu Jul 27, 2006 8:48 am

Postby saltybeagle » Wed Sep 20, 2006 3:44 pm

I would open the php.unlstandardtemplate.dwt.php, and the other php dwt's and change the statements there. Then hit save, and update all the pages. Then you won't have to make replacements on every new page.

We use virtual because most people using PHP are on Apache... and the virtual function allows the location of the files to be relative to the server root. Whereas, include looks to the local filesystem... so we would have to know where the ucomm files are stored in the local filesystem '/var/www/ucomm/' or 'c:\inetpub\www\ucomm\' etc etc. This is what we don't know.

So now, some might ask why not $_SERVER['DOCUMENT_ROOT']... but this is once again something webserver specific, and not all servers populate that variable... and once again points to the filesystem, so that will not work for people with virtual hosts which alias the /ucomm/ directory for every virtual host since a copy of /ucomm/ might not be stored in the filesystem for that virtual host.

With any solution there are many pros and cons. A lot of thought has gone into how the templates should be packaged... but we could always use more thought. The goal is something that works out of the box for the majority of users.
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin

Postby rin » Wed Sep 20, 2006 3:48 pm

I would like to change the teomplates, but in the beginning and the end, the includes are contained in noneditable fields. Can I change that?

I understand why you would use virtual. Believe me, I wish I had an Apache server instead.
rin
 
Posts: 21
Joined: Thu Jul 27, 2006 8:48 am

Postby saltybeagle » Wed Sep 20, 2006 3:53 pm

Well, I wouldn't recommend this to anyone unless they know what they're doing... within Dreamweaver you can edit the .dwt templates themselves, which define the regions which are locked.

You should be able to open the php.unlstandardtemplate.dwt.php file and change virtual to include or do a site-wide search & replace for virtual('/ucomm with include('c:/path/to/ucomm

Which could fix it also.
Brett Bieber
Image
saltybeagle
 
Posts: 376
Joined: Fri Jan 16, 2004 3:10 pm
Location: 321 Admin


Return to Suggestion Box

Who is online

Users browsing this forum: No registered users and 1 guest

cron