Adding the Github and DI packages
Like most modern PHP frameworks these days, the Joomla Framework is designed to expand to suit your needs. You just need to import the libraries that you need rather than having one, monolithic stack (just in case you need it).Because this is an application that is going to need to access a Github server (either github.com or an in-house enterprise server), we need to add the Github package from the Joomla Framework. While we are at it, I'm going to add the DI package as well because this is a new toy that allows us to make service providers. More on that next time.
First of all, I'm going to start working in a new branch off master.
$ git checkout -b adding-github
Switched to a new branch 'adding-github'
This is good practice when you are working on any new code. It allows
you to keep the master branch clean and allows you to swap between
sub-projects when you need to (for example, when you find a bug in
master and you need to do a hot fix).Next we need to add the new dependencies to
composer.json.{
"minimum-stability" : "beta",
"require" : {
"joomla/application" : "1.0-beta2",
"joomla/di" : "1.0-beta2",
"joomla/github" : "1.0-beta2"
},
"autoload" : {
"psr-0" : {
"Tagaliser\\" : "src"
}
}
}
So you can see we've added two new lines for "joomla/di" and
"joomla/github". Now, because we've already used Composer once, we do an
update instead of an install.$ composer update --no-dev
Loading composer repositories with package information
Updating dependencies
- Installing joomla/http (1.0-beta2)
Downloading: 100%
- Installing joomla/github (1.0-beta2)
Downloading: 100%
- Installing joomla/di (1.0-beta2)
Downloading: 100%
Writing lock file
Generating autoload files
You'll notice that we also got the HTTP package. That's because the
Github package has marked it as a dependency and Composer automatically
installs it for you.<!-- Begin BidVertiser code -->
<SCRIPT LANGUAGE="JavaScript1.1" SRC="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=588136%26bid=1469748" type="text/javascript"></SCRIPT>
<noscript><a href="http://www.bidvertiser.com">affiliate program</a></noscript>
<!-- End BidVertiser code -->
Semantic Versioning
We are about to introduce a change which involves new features so I need to think about a version strategy. Fortunately we semver.org to draw on. In simple terms, it recommends a X.Y.Z strategy. When you introduce a backward compatible change, you should increment the X number. When you introduce new features, you should increment the Y number. When you are fixing bugs, you should increment the Z number.In our case, we are actually adding some new features (connecting to Github), I'm going to change the version number in the application class to "1.1".
class Application extends AbstractCliApplication
{
const VERSION = '1.1';
// <snip>
}

0 comments:
একটি মন্তব্য পোস্ট করুন