Would it be quicker to make wordpress theme direct on FTP? - php

Would it be quicker to make wordpress theme direct on FTP? Because client want to see the progress and if I will work on local XAMPP then it would not be possible to update any changes quickly.
How to setup theme development environment with any free and lightweight IDE for windows XP?

Sounds like you're not considering the benefits of using Revision Control. if you're not using it, change your workflow so you can. It will make your development much more secure. Working with a local copy of code will make using revision control an easier goal.
On windows, mercurial is probably a good bet, or its simple wrapping program, tortoisehg.
You want to be able to make changes fast and not have to worry about whether you can roll them back. to me that says "use a locally running development copy, use source control, and take the short time to upload a finished point in time to the server."
Fast development, a secure change history, and never having to wonder whether your code is backed up: local development, with source control.

You have a lot of choises:
A plugin for your IDE to automatically upload your saved files to FTP.
Open your local server to the world using something like no-ip and few router configurations.
The least AND the worse, edit your files via FTP as you said using some FTP Client that allows it like Smart FTP (paid) or FileZilla (free).
All options should work... But for gods sake, don't upload to production server! Always keep an development server to test the things before uploading do production machine. This is safer to you and you client, trust me.
A great free (and heavy) IDE for Windows, MAC and UNIX is the Eclipse.
A lightweight and free IDE for Windows is Notepad++.

You can save urself lot of trouble by installing a plugin called theme test drive.
Basically, only the people logged in as admins can see the new on-going theme as it is being developped.
Visitors will have their regular view
You can edit the theme directly then on the live website for your manager to see
( this is an alternative solution to solve ur problem)
synchronizing theme files via FTP should not be a problem since each file is only a couple of KB. so if ur editing locally, u can re-upload when ur admin wants to see

Related

web deployement

I have a home headless server for dev+testing.For small projects my workflow is just drag throught sftp several files to a temp folder on my workmachine and then upload them to the "production" server. But now I face a big project that dapends on the release files has no changes. Production server is a shared hosting with apache. I don't want to waste time neither bandwidth. Seems that a revision control software could suit the purpose. But i can't install software above apache. What could the workflow be? Is there any "subversion","git", (...) for web deployement?Any other solution?
Thanks in advance
You need ssh (or direct) access to do this(svn or git deploy) but you can use phing deployment and composer for the dependencies.
https://github.com/composer/composer
http://www.phing.info/trac/
You can use rsync the same way you use sftp (obviusly, the server has to support it) and is instantaneos for something like 65000 files (wen only maybe 2 have changed).
Something like GIT or SVN can be much better, and have other features, but if you want something simple, and you are a single dev, you can use a backup system + rsync + a diff tool like Meld or WinMerge.
Possible workflow:
You develop in workstation A, in folder "dev/".
You review changes, and transfer changes with diff/winmerge to folder "rc/".
You upload "rc/" to "public_html/" in the public server with rsync.
Wen you copy changes from "dev/" to "rc/" you re-read then, and check if make sense, only transfering the changes that make sense and don't make rc/ unstable. If all changes are safe, you can do it just a single button.
This is a inferior system to using something based on git/svn.
VCS-systems and Deploy-systems are, really, different classes for different jobs and tasks. You have to ask, "How to deploy web application", I think.
Phing already was recommended, from other side you can (using tools of your SCM, if any used) export changed files after each changeset and transfer on shared hosting using any available transport. Can't see problem here.
For small projects my workflow is just drag throught sftp several
files to a temp folder on my workmachine and then upload them to the
"production" server
is perfectly applicable to big projects also

Portable version control?

Currently I do all of my work off of a flash drive. Keeps things portable, and I'm able to learn web development while I'm at work. Currently I run Portableapps with XAMPP, Notepad++, and Chrome installed on it.
My question is, does anyone know of a version control system that would work portably on a flash drive? I just learned about the importance of Version control, and I want to get started, I just need something that will work with my setup.
Edit: Just to clarify, the whole thing should be able to run off the flash drive alone on a completely foreign computer. So if I go to Aunt Edna's house for a family get together, I can go on her computer, plug in my flash drive and just go. The Aunt Edna's of the world get very offended if you install anything but solitaire on their fancy new computer. So it can't leave anything behind
This question was asked before: https://stackoverflow.com/questions/1109838/recommend-portable-source-control-setup and Version control on a 2GB USB drive - the second one has an accepted answer (darcs looks good too).
Pick a distributed one.
GIT or Mercurial for example.
Expanding off of Dan's Answer.
Git is almost completely file based. As long as you have the files, it will work the same with any computer (given you have the command line stuff installed).
This is also good if you switch between a GUI Editor and the Command Line, as pretty much everything will stay saved (the files waiting to be committed, for example)
Mercurial is a good start. A repository does not need to be stored on any server, you just create it where your data files are. Also, there is a nice interface called TortoiseHG, which lets you use Mercurial out of Windows Explorer with ease.

A way to work on web projects with others without over writing files.. etc

I am a web freelancer and had been doing all coding by myself using netbeans (set up to use a remote server (ftp)).
Recently, I started working with 2 other guys. They help me with php and css. The problem is that sometimes we want to work at the same time. Obviously one can immediately see the problems were having. Files being over writting / lost.
What do you recommend we do? Is there something like netbeans that allows checking in and out of files. I like netbeans as my editor and would prefer to keep it.
To give you a little extra information on our workflow. Usually I set up a dev site (generally a subdomain, dev.site.com) and a live site (site.com). All work is done on the dev site which I then move to live site once all is finished. I never use localhost sites.
Also
Surely you need a version control system. Subversion and Mercurial (amongst others) integrate fairly well with Netbeans.
Simply use some versioning system to prevent data loss.
Git
CVS
SVN
Other option is to use some file locking system.
Take a look at some source code management tools. Netbeans supports at least SVN and CVS. They should be listed under the Team menu. It has a FAQ on which it supports
Sounds like a job for Github
Assembla provides a free SVN hosting for collaborative projects.

OSX: Convert all files in folder to same encoding

I have a rather large php project with all kinds of different third party includes. Its all managed with Netbeans PHP. I have a few problems i would like some oppinions on.
Does anyone build there php-project? When i upload to server via ftp i get all kinds of project files which doesnt belong to live environment.
Would be nice if a build solution could encode all files when building (actually copying files to new location and leaving out project files and files like that).
Let me hear how you handle your php projects (development, test, build/deploy) with OS X.
Thanks
Well you could write a shell (or scripting language of your choice) script to selectively copy the files you want to your remote server.
Alternately, you could put the code to be published (again, leaving out the undesired files) into a version control system (git, svn, etc) and pull the code to the remote machine that way. There are lots of other benefits of using VCS as well.
You could also use something like ant to write a "build" script which does any manipulation needed for deployment.
I use Eclipse PDT and mount server with Macfusion. Eclipse File Sync plugin then syncs everytihing to mounted drive (can exclude unwanted files/directories).
Also using a SVN and opening project directly from remote drive with Eclipse and including libraries from project properties. So there is two projects - one for local development and other is live in server - syncronized with SVN
(Eclipse plugin Clay for database diagrams is awsome too)
Though I am not an OSX user I am a Mac-in-the know. Basically I get invited to their house parties and politely decline to run amok with Windows and Linux/Unix (who is OSX's older sister, it is all so very confusing). In any case, Mac adds extra files to everything. I know when a designer is using a mac vs a pc. I get extra files and directories in their attachments if there is a folder. As far as project files, there needs to be a way to set up netbeans to keep the files for project in a different location from your working on files. If not then shame on your IDE. Well, if nothing works, since Linux/Unix is close to my heart I can write a script for you to pull all files of a list of extensions out and copy them to a new directory with subfolders in tact. Here ya are:
This should work
find . -name '*.php' | xargs rsync -avuzb '{}' exportdirectory/
I do not have a machine to test it on right now and Cygwin, for all it's effort just fails sometimes. Let me know how it goes, otherwise use Unix wizardy :D Because yes, as we know OSX uses Unix command line. The crude script is mainly to give you an idea of a way you can do it. I am sure there is php, html, css, js, and other files and on rare occasion (god lets hope not) just knowing extensions isn't going to be enough.
Personally I use gvim and refuse to use project managers, I use gvim and command line and though I have used both, I am highly preferential to the current way I am doing everything. Hey, it's a choice though. No criticism here if you walk another journey.

How should I set up my development environment for rolling code into a live website?

In the past, I've always edited all my sites live; wasn't too concerned about my 2 visitors seeing an error message.
However, there may come a day when I get more than 2 visitors. What would be the best approach to testing my changes and then making all the changes go live simultaneously?
Should I copy and paste ever single file into a sub-folder and edit these, then copy them back when I'm done? What if I have full URLs in my code (they'll break if I move them)? Maybe I can use some .htaccess hackery to get around this? What about database dummy test data? Should I dupe all my MySQL tables and reference those instead?
I'm using CakePHP for the particular project I'm concerned about, but I'm curious to know what approaches people are taking both with Cake (which may have tools to assist with this?), and without a framework.
I've been getting a lot of recommendations for SVN, which sounds great, but unfortunately my host doesn't support it :\
The best thing you can do is to create a staging environment in which you test your changes. The staging environment (ideally) is a complete, working duplicate of your production system. This will prevent you from experiencing many headaches and inadvertent production crashes.
If you are working on a small project the best thing to do is to recreate your remote site locally (including the database). Code all your changes there and then, once you are satisfied that you are finished, deploy the changes to your remote site in one go.
I would recommend putting your website code under full version control (git or subversion). Test and maintain your source in a separate, private sandbox server, and just check out the latest stable version at the production site whenever it's ready for release.
For database support, even for small projects I maintain separate development and production databases. You can version the SQL used to generate and maintain your schema and testing or bootstrapping data along with the rest of your site. Manage the database environment used by your site from an easily separated configuration file, and tell your version control solution to ignore it.
Absolute URLs are going to be a problem. If you can't avoid them, you could always store the hostname in the same configuration file and read it as needed... except within stylesheets and Javascript resources, of course. My second choice for that problem would be URL-rewriting magic or its equivalent in the development server, and my last choice would be just messing with the /etc/hosts file when I wanted to test features that depend on them.
I set up a development server on my laptop that duplicates my web server as closely as possible (server software and configuration, operating system, filesystem layout, installed software, etc.) That way I can write the code on my laptop and test it locally; once I've gotten things working there, I copy it to the server. Sometimes a few problems arise because of slight differences between the two computers, but those are always quickly resolved (and just in case they're not, I have my site in an SVN repository so I can always revert it).
On another website I used to maintain, I used a slightly different tactic: I designated a URL path within the site that would be a development version of the base site. That is, http://www.example.com/devweb would ordinarily mirror http://www.example.com, http://www.example.com/devweb/foo/bar.php would mirror http://www.example.com/foo/bar.php, etc. I created a folder devweb under the document root, but instead of copying all the files, I configured the server so that if a requested file didn't exist in the /devweb directory, it would look for it under the document root. That was a more fragile setup than having a separate development server, though.
I have a number of websites written in CakePHP. I develop and test on my local machine, using the database on my production server (I just have a MySQL login that works for my static IP address).
All code is checked into Subversion, and I then have a continuous integration server - Hudson:
https://hudson.dev.java.net/
This builds and deploys my project on the production machine. It just checks out the code in subversion for a specific project then runs a simple script to SSH/copy the files into the staging or production location on the server. You can either set this up to be a manual process (which I have currently) or you can set this up so that it deploys once code has been checked in. There's lots of other CI tools that can be setup to do this (have a look at Xinc as well).
http://code.google.com/p/xinc/
As for absolute URLs you can always setup something in your host file to resolve the site locally on your machine instead. It works for me, just don't forget to take it out afterwards : )
Hope that helps...
I have a version of config/database.php that uses the php server variable "SERVER NAME" to determine which system the app is running on. Then when I clone my git repo across my home system, development site (which shares the same specs as the live machine), and the live machine they all connect to their respective databases.
I pasted here, but I also believe its available on thebakery.
http://pastebin.com/f1a701145

Categories