I cloned a git, how to make it live? - php

im very frustrated because i lost a lot of hours reading and testing, and could not find how to make it live.
I cloned and downloaded Zidisha git
Then i followed these instruction: image
At the stage 5. -vagrant up calls a file that doesn't have on the server.
I need to find a server with this saucy.box or exists a easier/another method?
Thank you

This project is using ubuntu-saucy which has been deprecated (see https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions) so the link referenced on cloud-images is not available anymore, and the box itself (larryli/saucy64) is not available on vagrant atlas.
You are left with 2 options:
build your vagrant box yourself using the same ubuntu release (can be found https://cloud-images.ubuntu.com/releases/13.10/)
upgrade the ubuntu release to a more recent one and still supported (you can use trusty64 or xenial64)
Note: this project has not been updated for the last 3 years - there are many chances that you will find a lot of obsolete things in it.

Related

Where do I use Composer for PHP?

I'm still new to coding and I'm learning everything on my own. This is a silly question for you but after reading a dozen of articles I am still confused.
I have a php based website on a shared host. After reading the various articles on benefits of using repositories and Composer, I decided to give it a try. These are my difficulties so far:
Which version of the operating system of Composer should I download, to enable me to install/update repositories of my cPanel based shared hosting?
If I am to install Windows version, how do I connect to my shared hosting to install/update the repositories?
My apologies for my silly questions, but it would really help.
If you are using shared hosting, you are unlikely to be able to use Composer on the host itself. Furthermore, you are not encouraged to use Composer "on production".
I would recommend you use Composer locally (on the O/S of your local machine), to compose your project and install your dependent packages. Once it's all working and tested with your own code, you upload your entire development directory tree including the resulting vendor library - as one big FTP/SCP upload of "flat files".
Once you get more advanced you could adventure into automated deployment techniques, but I feel for now you would be best to stick to using Composer as a local development tool to manage your codebase.
Update, further details:
Composer is really a tool to help you manage your codebase in development. It's not intended as a "deployment" tool. Previously you used to find a library you liked, download it, unzip it into your codebase somewhere random like "lib/stuff" and then link to it, and commit it into your version control system (VCS). OK, but they a year later you want to update it and you have to download it again, figure out where you saved it and how to overwrite the files, or delete old ones... it gets hard. Also your VCS repository gets full of 3rd-party components - even duplicates of the same one! Composer solved this by bringing order to this long-term dependency management chaos.
The reason you don't want to run Composer "on production" (i.e. your live website), is that during the process of download, update, composition your website will probably be broken. Even if the composer process works, this could be several minutes of broken site. After the update has finished - you now have a completely new set of 3rd party packages: how do you know they are compatible with your codebase?
So therefore you only do composer updates locally, test everything, amend your code to work the shiny new updates, and only then do you decide to upload the whole new site to the server - just as if you'd cobbled it all together manually. The deployment is independent.

Sublime Text 3 PHP UNIT

In Sublime Text 3 PHP Unit doesn't work. Bundle has installed correctly but plugin is inactive. Has anyone resolved the problem?
Thanks in advance.
I strongly suggest you to use this package which isn't available on Package Control:
Sublime-PHPUnit
You need to pull this in manually by navigating to ~/Library/Application Support/Sublime Text 3/Packages and paste it in. If you setup a few key binding, the workflow is very snappy. Watch this video for more info:
Instant PHPUnit Feedback and Workflow
At the time of writing, there is a working ST3 version in the develop branch:
https://github.com/stuartherbert/sublime-phpunit/tree/develop
I got it to work by cloning the develop branch into my {ST3}/Packages folder and then restarting ST3.
At the time when I installed the plugin (a couple of months ago), the ST3 compatible version of sublime-phpunit was not available through Package Control, which is why I installed it with git.
Hope this helps!
Try PHPUnitKit, a Sublime Text plugin for running tests on different granularities. It's available on Package Control!
FEATURES
Run Test File
Run Test Suite
Run Nearest Test
Run Last Test
Fully customisable configuration
Supports Composer installed PHPUnit
Supports colour results, diffs, errors, etc.
Jump to next and jump to previous failure

NetBeans + FTP + BitBucket

I know this has been asked before, but I couldn't get the answer I needed.
Currently I'm developing an website using PHP and was using Notepad++ before, and it all worked well because I'm developing with a co-worker so we both keep on changing different files on the FTP.
Switched to NetBeans. All went ok, pulled the entire website via FTP to my local computer and everytime I edited a file and saved it uploaded to the FTP. But, there is a problem. If my colleague updates a file, it doesn't update on my local folder. So, I thought: "Let's try versioning".
Created a team on bitbucket, created a repository. All went ok.
But now, I'm in a struggle to get everything up and running on both NetBeans (mine and colleague's) so that my colleague is editing a file on his NetBeans and constantly saving so that it gets saved on FTP and only when he stops working on that file push it to BitBucket so that I can pull after.
Suggestions?
About setting up your work environment :
In order to set up your bitbucket repository and local clone, go read this link (official doc).
You will need to repeat the cloning part once for each PC (e.g : once on yours, once on your colleague's).
Read the account management part to see how you can tag your actions with your account, and your colleague's action with his own account.
Start using your git workflow ; when you are tired of always typing your password to upload modifications to your bitbucket account, take the time to read the ssh keys setup part - read carefully, you will need to execute the procedure once for you and once for your colleague.
Using your local git repository with Netbeans is pretty straightforward :
From netbeans, run the File > New Project ... command (default: Ctrl+Shift+N),
Select PHP application with Existing Sources and click Next >,
For the Sources Folder: line, select your local git directory,
Fill the remaining fields, and if you want the last Run configuration screen, then click Finish.
After the project is created in netbeans, you can modify the Run configuration part by right clicking on the project's icon, selecting the Properties menu entry, and going to the Run configuration item.
About solving your workflow "problem" :
Your current FTP workflow can lead you to blindly squash your colleague's modifications (when uploading), or have your colleague's modification blindly squash your own local modifications (when downloading). This is bad, and you will generally notice it only after the bad stuff happened - too late.
Correctly using version control allows you to be warned when this could potentially happen, and to keep an almost infinite undo stack on the modifications of the project's files. The cost, however, is that both of you will have to add several actions in your day to day workflow - some choices can not be made automatically.
You may find it cumbersome in the beginning, but it really pays off, and quite quickly - we're talking big bucks here. So use it and learn.
On top of using Ctrl+S to save your modifications on disk, you and your colleague will need to integrate 3 extra commands in your daily work :
Save your work to your local repository (git add / git commit)
Download the latest modifications shared by your colleague (git pull)
Upload your work to the central repository (git push)
You can access these commands :
from a terminal,
from a GUI frontend : you can try TortoiseGit for windows, or gitk for linux,
from Netbeans :
in the contextual menu of the files/folders in the project tree (right click on the item, there is a "Git" entry),
using the Team > Git > ... menu
Since you provided a git tag, I'll describe what's to do for Git.
set up a remote bare repo on a server that you both could access (BitBucket in your case):
http://git-scm.com/book/en/Git-on-the-Server-Getting-Git-on-a-Server
you both clone that remote repo to your local machines:
http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository#Cloning-an-Existing-Repository
each of you works in her part of the application. When one is done, publish the work to the server:
http://git-scm.com/book/en/Git-Basics-Working-with-Remotes#Pushing-to-Your-Remotes
By now, the remote server holds the version that was just pushed. What's missing is the deployment of the website. This has been discussed here:
Using GIT to deploy website
Doing so, you will decouple your work from that of your colleague since you're not changing files over FTP all the time. You work in your part, your partner works on her part. The work is getting merged and then a new version of the website gets published.
You can create git or Mercurial repositories in Atlassian Bitbucket (http://bitbucket.org). If your team is new to version control, i advise you no forks in your first project.
The easy solution ins to use Atlassian SourceTree (http://www.sourcetreeapp.com/) to control your code since there is a bug in netbeans. See NetBeans + Git on BitBucket
You need to create a new repository in bitbucket. I assume you already configure the ssh2 keys. Using Git you need:
git clone --bare --shared php_project php_project.git
git commit
Using Mercurial you need:
hg init
hg commit
Good luck / boa sorte
Pedro

subclipse - Sudden error about too old SVN client

I use Easyeclipse for PHP with the Subclipse plugin for a long time without any problem.
This morning I committed my project without any problem. This afternoon I try to commit it again and it gives this error, which concerns only a subfolder.
Unsupported working copy format
svn: This client is too old to work with working copy
'My subfolder'; please get a newer Subversion client
I found several questions where the solution was an update of the client, like the error suggests. But in my case, I didn't change any configuration nor installed anything.
I fear that some files got corrupted.
It could have happened during a manual copy-paste process on my local copy, but I have no indication for this.
Is there a way to know for sure if the problem is with the server side or with the client side.
What are possible steps to restore the situation ?
The problem is with the client side, server is not contacted at this stage. Your local repository checkout might have been silently upgraded by another svn client you use. Or it might also be damaged and Subclipse errorneously reports it as an upgrade it doesn't understand.
If you don't want to upgrade Subclipse, your only way is to do a fresh checkout from server, and copy over your changes from this upgraded repository.
This probably means you used another SVN client that was a newer version and upgraded the working copy to a newer format. Subclipse has versions that support all versions of Subversion. Most likely you need to install Subclipse 1.10.x which contains support for the SVN 1.8 working copy format.
http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA
Once you upgrade Subclipse to the right version it will immediately work again. Your existing working copy ought to still be fine.
In my case I move eclipse workspace place to another then problem is occured. For solving problem I checkout project form the svn repo. Then in old project I clean all svn files. (simple search .svn and delete ) then I copy the content to the just checkedout one my changes become visible and my project is up to date. This method can be applied for other annoying errors. Hope help someone

Capturing all changes made to a system after installation

This may be more of a systems question, but as I need it for a Vagrant development environment, I thought I would ask it here.
I am using Vagrant and Chef to create a PHP development environment. It's working correctly, but the setup takes forever because I'm installing PHP from source because I need some custom configurations.
Is there a way to install PHP through Vagrant once, capture all changes made by the build in an archive, so I can just unpack the archive?
It is worth considering building the custom-configured PHP into a deb (or any other) package, so you actually install already compiled PHP with your custom stuff inside.
It still depends how customizable you still want your build to be - I have no idea what you're actually trying to achieve as you haven't mentioned specifics of your custom PHP build.

Categories