Using PHP Storm to create a new project using the Cubex Framework.
In PHP Storm
File > New project.
You need to do three things:
- give the project a name
- choose a location
- choose a project type
The first two are up to you, for the project type, choose “Composer project”.
Next you will be asked if you want to use your existing composer or to download composer.phar from getcomposer.org, choose whats best – you may have composer already installed, mine is in /usr/bin/composer, so i choose use existing composer.phar and enter
/usr/bin/composer (which phpStorm validates :))
From the Available Packages, choose cubex/project, and then in Version to install select dev-master (this will of course change when a stable release comes).
Ok. phpStorm will do its magic and set you up a project.
Run composer install
Next go into the project directory:
and run composer install:
[code]$ composer install[/code]
You’ll see composer successfully install and generate all the necessary files:
Loading composer repositories with package information
– Installing cubex/figlet (dev-master c8a4b58)
– Installing psr/log (1.0.0)
– Installing cubex/cubex (dev-master 7b11c3b)
– Installing bundl/debugger (dev-master a6718db)
cubex/cubex suggests installing mobiledetect/mobiledetectlib (Supported platform detection library)
cubex/cubex suggests installing phpseclib/phpseclib (PHP Secure Communications Library – Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.)
cubex/cubex suggests installing cubex/cassandra (Cassandra Connections)[/code]
Setting up your Virtual Host
You will also need a vhost container for your project, but you know that :)
An environment variable needs setting:
SetEnv CUBEX_ENV development[/code]
and also a simple rewrite rule to route everything through index.php:
RewriteRule ^(.*)$ index.php?__path__=$1 [L,QSA]
Just for clarity, my vhost looks like this: (though i use a script to generate mine, there may be parts you do not need)
CustomLog "/Users/stuart/Sites/CubexProject2/logs/access_log" common
Options Indexes FollowSymLinks MultiViews
Allow from all
then restart the Apache.
One other thing my script does is set up a hostname for this, so i can access it locally .
This is done in
Browse to your hostname (mine is http://CubexProject2.dev for instance) and you are ready to go.
The next posts in the Cubex category will be tutorials based on my learning of the framework.