I have a PHP project setup in Netbeans (v6.8) where all the PHP files are on a remote server and in a single directory. Whenever I save files locally they are updated on the remote server via SFTP.
I now need to edit a remote JavaScript file to add some jQuery logic but the file is located within a different directory on the webserver. How to I add this JavaScript file such that when it is saved or updated it is transferred to it's own location on the server?
When I attempt to create the file locally within NetBeans it saves to the same directory as my PHP files. I would like to be able to continue using NetBeans rather than doing this all manually using an SFTP client and a text editor. Thanks in advance.
Since you're not getting any answers I'll offer a limited suggestion. I use netbeans, but not to automatically upload like you're doing so I may be way off here.
It sounds like you would either need to change your project to have a larger directory structure that would contain everything for this to work like you want it to. Gan you go up a level or two in the directory structure, and add containing folders in your local project to match?
The other option might be to create a second project for the javascript directory, and set that to go were it needs to go. You can create "project groups" in the project view which you can use to link them together. I know this is probably not ideal, but is hopefully easier than doing your uploads manually.
Related
I'm developing an application with Symfony2, and my users get to look at their folders (located in alfresco) but at a certain point some files need to be moved from one folder to another.
I tried ftp_rename but didn't have much luck with it. I could rename a file's name with it but I couldn't move it from one location to another.
I tried looking at the alfresco docs but didn't find anything helpful because I'm developing an api and I can't use Cmis Js.
The ftp_rename can rename/move a single file only. You cannot use it to move all files in a directory to another.
So you have to:
list all files in the source directory, e.g. using the ftp_nlist.
call the ftp_rename for each, one-by-one.
I'm currently trying to teach myself PHP and MySQL using the MAMP stack. Everything has been going good up until I came across this problem.
I am reading a book and completing the exercises as I go and I'm at the point where I have to let the user upload an image and then store that image on the web server. The book states that to do that, you make use of HOST_WWW_ROOT to set the location for the web files that will be uploaded.
I have done exactly how the book says to, however it is not working.
Is it possible to use this HOST_WWW_ROOT on localhost or can it only be used on a live server?
Every book will use something like SITE_ROOT or HOST_WWW_ROOT to refer to the location where your web server's public directory is located at.
MAMP FAQ:
Where should I store my HTML and PHP pages?
By default, PHP and HTML Pages should be stored inside the MAMP "htdocs" folder which is located in the MAMP Application directory /Applications/MAMP. This folder is called "Document Root". You can change the path for the Document Root in the MAMP application's Preferences Panel:
Now, depending on the platform you are developing your application on, some books would use something like SITE_ROOT, WWW_PUB, WWW_ROOT, etc. but they all refer, as you said, to the location where your 'web files' are.
See if there are some side notes indicating the book conventions.
I'm having a little trouble understanding a couple of concepts.
I am new to Netbeans and using it for PHP development. I am previously using JEdit. In JEdit, I just simply open the file browser and start editing files.
In Netbeans, it wants me to create projects and import files.
My questions are:
When I import a project, it sets up data files that Netbeans needs and leaves the original directory in tact, correct? I noticed I could open and edit a project and it affected the original.
Sometimes I like to quickly switch between projects and just want to view the /www/ directory of my wamp server to grab files, look at past projects, etc. Why can't I simply do this? (must I always import projects to see my /www/ folder)
What is the point between creating a project versus just opening files?
Thanks all!
The point of creating a project vs just opening files in an editor is that Netbeans knows that all these files go together. They are part of the same project. That allows you, for instance, to refactor function names or class names and have Netbeans automatically apply the changes everywhere those are used within your project.
If you create a project from existing sources, those existing files will be the ones you're editing. If you have your files under version control, you can simply create a Netbeans project in the directory where you checked out your code. You can then do commits and all from within Netbeans.
Does anyone know of a simple online file editor that I could put in a folder on the server to enable users to view and modify files? It would have read/write access to source code files (html & css) and open those up in a web-based code editor.
Then when they save it, it would need to have a hook to be able to commit the changes back to whatever revision control system is in place.
Basically I need github.com's capability to edit files that are in a repository without checking the project out.
PHP would probably be the easiest to be able to just drop into a folder, but whatever works.
The Github wiki is open source: https://github.com/github/gollum - it stores the files in the git repository. I don't know of a pure file editor, though.
I was just wondering if i can find php backend which can be used as alternative to poedit to enter translations.
Sometimes we need update view files directly to live server and its painful to download all source to local machine and generate .po files and translate them using poedit and upload again. Can anyone help?
It's not PHP, but there is Transifex, in both download and hosted form. </shamelessplug>
i am using FTP for uploading and downloading PHP files as well as folders, so in that case if you want to edit/update only some of the source in the FTP you can right click on file name where you get the option for "View/edit" which can be open in any of your editor and its still connected with FTP so whenever you done change in that file and save it will automatically save on your live server too.
So if your query what i have understood then you can use my answer.
Thank you.
I'm using WordPress for my website. There is a plugin for WordPress that can edit po-files and generate mo-files.
CodeStyling Localization (plugin for WordPress):
http://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en
Unfortunately, if you're not using WordPress you have nothing.