HOWTO: Setup project properties in PhpED?
PhpED helps you manage your files with workspaces and projects. Typically project is the set of files associated with one website. Workspace may contain one or multiple projects. If you develop or maintain mulitple websites with something in common (functionality or customer etc.) you may choose to create separate projects for each website but add all of these projects to the same workspace. A new workspace is automatically created when you first start PhpED. You will see it in the Workspace tab on the left-hand side of PhpED main window. Makes sense? Excellent, now to the project:
- As we said, project is your website. PhpED's project's files structure is very simple and similar to that of the web. Just like Apache's web root is defined by htdoc directory, PhpED's project is defined by its own root directory as well. Select File->New Project menu item and new Project dialog appears. Second from the top is Project Root Directory. Just like web recognizes files under htdoc, PhpED project will recognize all subfolders and files residing under Root Directory as belonging to the same project and will display them in Project tree of the Workspace Tab. Should you add another file to any folder or subfolder under root directory or remove existing file - the Project will update itself automatically.
- Each project with all its files "lives" on a local disk (or sometimes on a shared network disk). It makes sense because opening, editing and saving are very common and frequently used operations. By placing all the project files on the local disk(s) phped saves your time.
- In case if you need your project to be published on a remote development or live sever you have to setup an FTP, WEBDAV or SFTP account and select this account in the project publishing account setting. You will have to set top publishing directory there too.
Suppose your project root is c:\myproject1 and web tree starts in /var/www/html/, and ftp server shows this tree as ftp://yourserver/www/html/. In this case you should a) create an FTP account with yourserver hostname b) select this account in publishing account setting and finally c) set /www/html/ as top publishing directory. (alternatively you may want to set top publishing to / and set /www/html as root in the account settings)
With these settings your project or its directory or single file can be published by just one click. See popup menu "Upload" or Smart Sync->Upload (see p4), or Project->Upload Project in the main menu.
- Sometimes projects are big enough. In this case it may make sense to skip files that are already synchronized. Unfortunately, phped has no ability to compare file contents before publishing. It simply is not supported by FTP or DAV. Luckily, PhpED can compare file size and datetime stamp. This feature is available as "Smart Sync". You may publish your project by selecting Smart Sync -> Upload. Sometimes, remote servers are located in different timezones and keep datetime stamps for all files shifted by some hours. In this case you have to specify this value in Time Offset property for your publishing account.
If you need to download files that are modified, you may run Smart Sync->Download. In this case phped will replace local files that have either different size or older datetime stamp.
Finally, two-way syncronization is available with Smart Sync->Sync choise. In this case phped will get to local computer all newer remote files and vice versa all new local files will be sent back to the remote server.
If you have some files on the project tree that should not be published, add their file masks to the Do not publish files setting (see project properties and directory properties). It should be semicolon delimited list, for example *.exe;*.bat;*.csv
- When you debug your files on a remote host, it's important to have Remote root directory properly set. In the sample shown above, this directory is /var/www/html/.
If you work with local web server (such as Apache or IIS), it's necessary to have both project directory and remote root directory pointing to Apache htdocs directory (or Home directory in case of IIS).
- With either local or remote web servers you need to set project Root URL. It's very simple. In case of local server this url should look like http://localhost/ and in case of remote server localhost should be replaced with your remote host name. You can add port number if you run server on a port other than 80 (443 in case of https) or change http to https if you run ssl enabled server.
- If you want phped to hide some files in the project tree, just add corresponding masks to Hide files list. For example *.~*;*.bak;*.exe;*.dll
- Whenever you work with Apache or IIS you have to set Run Mode to HTTP Mode (3rd party Web Server).
- If you have one file to be run every time you want to debug (for example c:\myproject1\www\html\index.php) you may set this file in Default File To Run setting.