-
Notifications
You must be signed in to change notification settings - Fork 0
Devbox installation guide
You can perform this task either from Git Bash or from Git GUI:
From the Git GUI, use the following URL:
https://YourGitHubLogin@github.com/WindowsAzure/azure-sdk-for-php.git
From Git Bash, type the following command
git clone -b dev https://YourGitHubLogin@github.com/WindowsAzure/azure-sdk-for-php.git
You need the thread safe version of PHP to be able to run the unit tests. Development is currently done using PHP v5.3.
Download:
-
MSI: make sure to select the
Fileinfo
andXSL
extensions when prompted by the installer as they are not selected by default. -
.zip: you should get a copy of
go-pear
because sometimes it's not included with the download. You may need to manually install theFileinfo
andXSL
extensions.
During installation, please choose a target path that doesn't contain spaces, as this will prohibit some scripts to run correctly on Windows.
This document assumes that PHP is installed in C:\PHP
The complete instruction on configuring PHP on your machine is available here at this link.
In practice, PHP configuration comprises making the following changes in php.ini:
-
Search for
cgi.force_redirect
, uncomment it by removing the;
at the begging of the line, and set the value to 0:cgi.force_redirect = 0
-
Search for
cgi.fix_pathinfo
, uncomment it by removing the;
at the beginning of the line:cgi.fix_pathinfo = 1
-
Search for
fastcgi.impersonate
, uncomment it by removing the;
at the beginning of the line, and set the value to 0:fastcgi.impersonate = 0
-
Search for
fastcgi.logging
, uncomment it by removing the;
at the beginning of the line, and set the value to 0:fastcgi.logging = 0
-
Search for
extension=php_mbstring.dll
, uncomment it by removing the;
at the beginning of the line:extension=php_mbstring.dll
From PHP source directory, type
go-pear.bat
- select system for the system|local
- type enter for all the questions.
- when go-pear.bat is completed, a new file
C:\PHP\PEAR_ENV.reg
will be created. Double click this file to register it. - upgrade PEAR to the latest version by executing this command:
pear upgrade PEAR
Note: If you face any problems, try executing these commands:
pear clear-cache
pear config-set preferred_state beta
Requires libraries are:
-
HTTP_Request2:
pear install http_request2
-
Mail_Mime:
pear install mail_mime
-
Mail_mimeDecode:
pear install Mail_mimeDecode
Optional libraries are:
-
PEAR_PackageFileManager2:
pear install PEAR_PackageFileManager2
-
pear channel-discover pear.pirum-project.org
pear install pirum/Pirum
Azure SDK PHP build include PHP documentation, unit testing and more. It is driven by ANT build system.
PHP unit test suite depends on properly installed xDebug and the right Azure account credential. For xDebug installation, please refer to xDebug installation page
The full installation manual for ant is available at Ant installation page
The ant tool can be download from a mirror at Ant Binary Distributions
Installation bottom line:
- Extract the Ant to a place on your disk, e.g.
C:\ant
- Add the bin directory to your path. (add
C:\ant\bin
to yourPATH
environment variable) - Set the
ANT_HOME environment
variable to the directory where you installed Ant.
PHP QA tools include the unit test, checkstyle, code analysis and many other tools that is useful to ensure high quality PHP coding standard.
pear config-set auto_discover 1
pear install pear.phpqatools.org/phpqatools pear.netpirates.net/phpDox
Use the following three commands to install Autoload:
pear channel-discover pear.netpirates.net
pear channel-discover components.ez.no
pear install theseer/Autoload
Note: Autoload requires that PHP has the fileinfo module enabled. To enable, make sure that php_fileinfo.dll
reside in ext directory. If php_fileinfo.dll
doesn't exist in ext directory, please download the zip file, and manually copy php_fileinfo.dll
to the ext directory.
The package page is at phpDocumentor, and can be installed through PEAR using:
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor-alpha
This tool is used by PHP Documentor to generate class diagram. Install it from Graphviz - Graph Visualization Software
Ensure that the following bat files reference the correct path to php.exe within them:
- pdependent.bat
- phpab.bat
- phpcb.bat
- phpcpd.bat
- phpdoc.bat
- phploc.bat
- phpmd.bat
- phpunit.bat
To install vfsStream, use the following commands:
pear channel-discover pear.php-tools.net
pear install pat/vfsStream-alpha
The binary of xDebug can be found here, please find one according to your machine's configuration. If you luckily using a Windows Machine, you can find the installation wizard which can help you through the installation process from here http://www.xdebug.org/wizard.php.
The unit test requires authenticated access of Windows Azure, a few environment variables need to be configured on the dev box to enable unit test to get authorized properly.
The storage service unit tests use the following environment variables:
-
AZURE_STORAGE_ACCOUNT
: name of the storage account used. -
AZURE_STORAGE_KEY
: name of the storage account used.
The Service Management unit tests use the following environment variables:
-
SERVICE_MANAGEMENT_SUBSCRIPTION_ID
: the subscription id. -
SERVICE_MANAGEMENT_CERTIFICATE_PATH
: path to an already added certificate toSERVICE_MANAGEMENT_SUBSCRIPTION_ID
.
The \
sign in the path need to be escaped. For example c:\certificate\testCert.pem
should be c:/certificate/testCert.pem
.
The Service Bus unit tests use the following environment variables:
-
SERVICE_BUS_NAMESPACE
: The name space of the service bus. -
WRAP_AUTHENTICATION_NAME
: The user name of the WRAP service. -
WRAP_PASSWORD
: The password of the WRAP service.
To to have these credentials you just need Windows Azure subscription Id which will let you:
- Create storage service (
AZURE_STORAGE_ACCOUNT
andAZURE_STORAGE_KEY
) - Add management certificate to this subscription then use it is *.pem path. (
SERVICE_MANAGEMENT_CERTIFICATE_PATH
)
To add a management certificate read more about Managing Certificates in Windows Azure
using cmd.exe, navigate to the PHP SDK project directory, type ant
Download Java Runtime from Java SE Development Kit 7 Downloads and install. For 32 bit operating system, install jdk-7u3-windows-i586.exe
, for 64 bit operating system, install jdk-7u3-windows-x64.exe
.
You can use Netbeans as your PHP editor. Download NetBeans full version from NetBeans IDE 7.1.2 Download and install following the instruction. This version of Netbeans has dependency of Java Runtime, as a result, please make sure JDK with version number > 1.6 installed properly.
- When I type
ant
the build fail inphpunit
task without specifying any errors
- Make sure that you've installed all required libraries and PHP extensions.
- Make sure that you've added the environment variables and they are reflected in the cmd or NetBeans.
- When I type ant phpab, the phpab doesn't work for me, what shall I do? The root cause of this problem is finfo method think that our php code is like c++ code, as a result, as a result, the phpab ignore it because it is not a php file. The fix is to modify your PHP\PEAR\TheSeer\DirectoryScanner\phpfilter.php to to by pass this logic.
use this line return ((strpos($finfo->file($this->current()->getPathname()), 'text /x-php') === 0) || (strpos($finfo->file($this->current()->getPathname()), 'text/ x-c++') === 0));
to replace the original return (strpos($finfo->file($this->current()->getPathname()), 'text /x-php') === 0;