A while ago, I wrote a tutorial about installing logon WindowsAzure. However, the home page of Phalconphp.com still does not mention Tianqing as a supported environment section "fercon can be installed ":
A while ago, I wrote a installation tutorial on Windows Azure. However, the home page of Phalconphp.com still does not mention Tianqing as a supported environment section "fercon can be installed ":
In this tutorial, we will clone the Phalconphp.com website and update the local PuPHPet virtual machine to include new information about a supported environment, and submit a pull request to the project owner. This article is a spiritual inheritance of my Dillinger. i/O pull request tutorial, so be sure to check it before moving, because this tutorial focuses more on the PuPHPet workflow than the actual pull requirement workflow.
Please note that although I will use PuPHPet to prepare the environment in which the website will be started, you will never be subject to this restriction-if you want, just clone it to the local environment you have set up, please do this at any time, although I personally think the PuPHPet method is, if you just do what I do faster.
Initial configuration
If you are not familiar with PuPHPet, please refer to the tutorial of the Gospel of Matthew 2. Let's visit PuPHPet and create our VM. We need to keep in mind to make things easier for us one thing, that is, the file root directory of the ferkang website there, so we can bind it to our virtual machine. If we check their Github, we can see that they use the main "website" repo in the standard public folder, and this is exactly what we have to do.
I have selected the following options to follow my steps or download my final version at any time here (what I do not mention is left in the default value ):
- Environment: Local
- Server: Apache
- Operating system: Ubuntu's 12.04 precise x64-VirtualBox's 4.3
- Product Name: Upgrade-phalconphp
- Installed software package: VIM
- Time zone: Europe/Zagreb (if you want)
- XDebug is installed: Yes
- MySQL options: DB1, user 1, PASS1
On the Apache virtual host, the value is as follows:
Create and download a compressed package, place it in the location of your travel box, and decompress it.
Next, let's add the following lines to the shell sub-folder from the article that provides scripts to faircon and add the following lines according to all the required modules in Vagrantfile:
config.vm.provision :shell, :path => "shell/install_phalcon.sh"
This will ensure that ferkang is installed in the virtual machine to start.
Next, we need to make sure that the website is running when the virtual machine is started. First, we need to go to the table's website database. Go to https://github.com/phalcon/website.
Clone your fork into the root directory of the folder:
git clone http://github.com/YOUR_USERNAME/website
After cloning, my folder structure is as follows:
If you use the above PuPHPet program, run vagrant up and wait for the VM to boot. If you select Apache as the server, you may need to disable the default virtual host after the VM is started. You can use ssh to connect to the vagrant cabinet and perform the following operations:
sudo a2dissite 15-default.conf sudo service apache2 reload
This eliminates the default configuration and leaves only the "virtual host" established in PuPHPet. Because the faircon website does not use databases (most of the materials are static), we can run them locally immediately without any further modification:
It may be about PHP being unable to write in the cache directory in the source code folder, but we will not deal with it as it is not an important warning for this special quick fix.
Your repurchase is connected to the original upstream, then a new branch is called adding-azure and switched to it by executing:
git remote add --track master upstream http://github.com/phalcon/website git branch adding-azure git checkout adding-azure
Theoretically, we can add the default VM disabling command and git process to finally provide shell files. I will leave, your experiment.
Update website
Finally, we can start working.
The related files will be:
- App/views/index. volt
- App/views/pages/hosting. volt
We also need a new image file as the logo for Windows Azure. You can download one:
Add this image to public/images/hosting. We can see that because the images of all hosting service providers in this folder have their corresponding colors, even if the color version is never used, let us respect this tradition and add ourselves.
Next, we need to edit the home page, including the image to image settings link. Open index. volt and add it to the managed image, ending with something like this:
Now go to hosting. volt and copy it.Block, mention Rackspace. Change this content to reflect Azure, just like this:
Windows Azure {{ tr('hosting_azure_1', 'http://www.windowsazure.com') }}
{{ tr('hosting_azure_2', 'http://www.sitepoint.com/phalcon-windows-azure/') }}
Note that we have used some placeholders for translation, such as hosting_azure_1. This is because Erkang uses a language file as a multilingual website and introduces the actual text of the content on the website, which is defined elsewhere.
These language files are in app/var/languages. They are an array of simple key => values defined in the PHP file and can be easily edited.
Open the en. php English file and find the managed description (which should be part of Line 198. At the bottom of this section, add our own:
'hosting_azure_1' => "The Windows Azure cloud provides you with highly scalable and manageable Windows hosting for your web apps. Use Phalcon to reduce your instance costs.", 'hosting_azure_2' => "To install Phalcon, follow the step by step procedure in this SitePoint article.",
The final result should look like this:
When you reload the page host:
If you feel extra generous, add some other translations to other language files-I am sure, the ER Kang team will be very grateful.
Send a pull request
Once everything we add goes to Git with git add, and promises to "add" messages with a message like an individual to Azure's hosting service provider, either on the home page or on the host page. Link to the process described in the article .", We can put the repurchase online.
Once pushed, we submit a pull request.
Conclusion
All you have to do now is wait, and developers will accept it. Regardless of whether PR works or not, this article tells you how simple it actually contributes to an open-source project.
If you want your contribution to be counted, or you just need some experience, slowly and steadily looking for projects that require help and assistance. Starting from a trivial matter, just like what we do in this article-by modifying HTML and text, and then slowly, you will see some missing functions to move.
If you have a story about your contribution and want to share it with you, a specific request, or just a general feedback to this article, please do not hesitate to leave it in the following comments!
Bruno Skvorc