Often for a complete web page, two or more scripts are used, that might also share a common library. For example a script that produces an on-line poll might also have another script for the administrator of the poll.


A project in Optiperl is a set of perl scripts and/or html pages that all belong to the same web site. It is useful to organize many such scripts and html pages if needed in a single project so you can:


  • Load the project in the project window and quickly access the script you want to edit,
  • Publish all modified scripts to your web server,
  • Save properties that have to do with all the scripts in the project.


Creating a new project


To create a project select from the project menu the item "New". You can add files to the project by selecting "Add" that will add the script that you are currently editing, or "Add Files" to see an open files dialog to add manually one or more files. You can also import an entire folder from "Import folder"


Each file is listed in the Project Window in a tree view. Double clicking a file will open it in the editor. Right-clicking will bring up a pop-up menu to edit the properties for each field.


The tree view you see in the project manager should look like the remote folder you upload files to:




To make it look like your remote folder, you will need to follow the directory structure used. If you use any king of html authoring software, then probably you have your entire site offline. Select from Project Options / Local starting directory, the folder that contains all the files and folders of your web site. Add afterwards the scripts you are interested in. You may also add html files that may be necessary to call those scripts when testing so they are easy to access, plus other files used.


icon_idea You don't need to add in the project manager every single file of your web site, if you use other software for publishing html files. However if you prefer OptiPerl to publish your entire site, that can be done also.


icon_idea For larger sites, you may also want to create many projects, each managing a part of the web site. For example one for it's forums, another for customer support scripts, etc.


After specifying the starting folder, you should see all the files in a tree like view, following the directory structure of your server. To publish you will also need to select the corresponding path on the web server from Project Options / "Corresponds to directory on remote server". This is usually " / " but depending on your servers operating system and whether is serves many accounts, your remote path may be different.


icon_idea Read the section "Possible scenarios", for some possible real-world configurations.


Project manager window


The project window consists of 6 fields:


  • File: The filename of an item in the project
  • Mode: The unix permission that will apply when you publish the file.
  • Publish: Whether the file will be uploaded to your server.
  • Transfer: Transfer mode for the file. For perl scripts and html pages this is "Text"
  • Status: After publishing, this field will show the status.


icon_idea The trasfer field must be set as "text" to enable changing the shebang and converting the version, if enabled in the transfer setup.


The last 4 fields may be changed by right clicking on a file or folder. Note that perl scripts, and the folders that contain them should have a permission of 755. Also upload scripts with "text" transfer.


Publishing the Project


After the remote path and the remote session have been selected, pressing "Publish" will upload all files, and recreate the directory structure of folders do not exist on the remote server. If folders are created, then their permissions as specified are also set.


Publishing is optimized for speed; it will not check each remote path of the remote server for files that do not exist in the project and delete them. It will just upload files that were modified since the last publishing from OptiPerl.


If selected in the remote session setup, the uploaded script can also have it's shebang changed and it's version converted to SERVER.


Overriding the destination path of a single local folder


In rare cases you might need to specify the destination path of a single folder. Do this by right clicking it and selecting "override destination path". Note that you will need to do the same thing for each of it's subfolders.


How publishing works


Most synchronization software needs to get a list of all the files of each path and compare their time stamp to the local copy. However because scripts will probably be uploaded very frequently, especially while developing, OptiPerl's publishing does not work this way and has been optimized for speed. Before uploading it will make the necessary conversions to the script (the shebang and version) and extract the file's CRC value. If the CRC has been changed, then the upload will occur. Keep this in mind if you upload a script with a third-party FTP client; OptiPerl will not know that the file has been already uploaded.


icon_idea Use publishing; The fact that the shebang gets changed automatically and the version gets converted to SERVER can speed up developing dramatically.


icon_exclaim See also "Project Options"


Non-published folder


You can add files out of the local starting directory; They will all be bundled under a folder call "Not published" or in the root of the tree if the option "Display in root" is selected under Project Options / "Files not under starting folder". These files will never be published, unless you change the starting folder to include them also.


Overriding options of the environment per project


Many options selected from menu Tools / Options may need to be overridden at a per project basis. For example, you may want each project to set the root dir of the internal server to it's own setting. Enable this option from Project options / Override default settings, so the rest of the tabs can be enabled.


icon_idea Before setting up a complicated project with scripts that use absolute paths, check out the section "Using absolute paths".


Top  Previous  Next