How do Download Jumla
Click to Download
Let master Joomla developer and co-founder Andrew Eddie (that's me) walk you through the art of mastering the art of building Joomla websites and extensions.
All the content on this site is free to access. However, there are advertising opportunities available if you wish to support the work I am doing please visit the Sponsoring page for more information.
Noel Dixon
I'm absolutely loving the course. The videos and sound are very high quality, and the content is informative and easy to follow along with.
Adam Wooding
Well what can I say. Looked over the first few videos and was very impressed. I fully accept the need for coding protocol and your efforts to impress the importance of standards.
Phil Boville
Here's how to start a command line application using the Joomla Framework and just get it to work. The application is going to be a utility for scanning a Github repository and generating change log reports based on the tags in the repository.
The source code for this tutorial is available on Github.
To do this, we need a "composer.json" file that tells Composer what to install.
This is what the "composer.json" file looks like in order for us to get the basics for our command line application:
At the time of writing, the Joomla Framework is still in 'beta' so we set the minimum stability to "beta".
We 'require' the application package ("joomla\application") from the Joomla Framework, setting the version to "1.0-beta2".
Finally, we are telling composer where to autoload our custom files for the application. I'm going to give my application the namespace of "Tagaliser" and telling Composer that it can find classes in that namespace in the "src" folder.
You might also like to read:
...........More Tutorials are Very Coming Soon...........
Click to Download
Learn the Art of Joomla!® from master developer Andrew Eddie
Joomla is the most popular content management system in the world, and this is due to the fact that it is easy to use, and easy extend ... when you know the right way! Let us take you on a journey of discovery into the world of Joomla extension development and site building. We'll do this through a combination of video, slide and text tuorials in structured lesson and unstructured formats.Let master Joomla developer and co-founder Andrew Eddie (that's me) walk you through the art of mastering the art of building Joomla websites and extensions.
All the content on this site is free to access. However, there are advertising opportunities available if you wish to support the work I am doing please visit the Sponsoring page for more information.
What are people saying?
Lessons have been absolutely awesome. Very informative and valuable beyond the cost of the course/s. Video is very good, player works very well, very stable even though I pause and un-pause it throughout each lesson.Noel Dixon
I'm absolutely loving the course. The videos and sound are very high quality, and the content is informative and easy to follow along with.
Adam Wooding
Well what can I say. Looked over the first few videos and was very impressed. I fully accept the need for coding protocol and your efforts to impress the importance of standards.
Phil Boville
It Works!
Command line utilities are useful for many things, especially if you want to do something quickly and keep the code light.Here's how to start a command line application using the Joomla Framework and just get it to work. The application is going to be a utility for scanning a Github repository and generating change log reports based on the tags in the repository.
The source code for this tutorial is available on Github.
Basic Files
The following tree is how I set out the folder and file structure for the basic application, and you'd probably be storing in some sort of source control system like git/Github.|- bin
| \- tagaliser.php
|- src
| \- Tagaliser
| \- Application.php
|- composer.json
Those are all the files we need for a start.composer.json
The Joomla Framework is distributed in package via a utility called Composer. It's an awesome system that allows us to pull in code from many different sources (and not just Joomla sources) and wire it all up to do amazing things.To do this, we need a "composer.json" file that tells Composer what to install.
Application.php
This will hold the main application object that will make everything work.tagaliser.php
This is our executable PHP file that is going to load and execute the application.Installing dependancies using Composer
To perform the next steps, you need to install Composer within your development environment. Instructions for how to install Composer can be found by clicking here.This is what the "composer.json" file looks like in order for us to get the basics for our command line application:
{
"minimum-stability" : "beta",
"require" : {
"joomla/application" : "1.0-beta2"
},
"autoload" : {
"psr-0" : {
"Tagaliser\\" : "src"
}
}
}
There is a mountain of documentation on the schema for Composer but there are a few things to note.At the time of writing, the Joomla Framework is still in 'beta' so we set the minimum stability to "beta".
We 'require' the application package ("joomla\application") from the Joomla Framework, setting the version to "1.0-beta2".
Finally, we are telling composer where to autoload our custom files for the application. I'm going to give my application the namespace of "Tagaliser" and telling Composer that it can find classes in that namespace in the "src" folder.
Running Composer
When running Composer for the first time, you'll use thecomposer install command. Running will give you output similar to the following:$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing psr/log (1.0.0)
Loading from cache
- Installing joomla/filesystem (1.0-beta2)
Loading from cache
<snip>
- Installing joomla/application (1.0-beta2)
Loading from cache
- Installing joomla/http (1.0-beta2)
Downloading: 100%
- Installing joomla/github (1.0-beta2)
Downloading: 100%
joomla/registry suggests installing symfony/yaml
(Install 2.* if you require YAML support.)
joomla/filter suggests installing joomla/language
(Required only if you want to use `OutputFilter::stringURLSafe`.)
Writing lock file
Generating autoload files
After it's done all its work, the file tree is going to look something like this:|- bin
| \- tagaliser.php
|- src
| \- Tagaliser
| \- Application.php
|- vendor
| |- composer
| | \- ...
| |- joomla
| | \- ...
| |- psr
| | \- ...
| \- autoload.php
|- composer.json
|- composer.lock
Composer has added a "composer.lock" file and a "vendor" folder. The
lock file simply contains a manifest of all the things that it
installed. The "vendor" folder contains all the code and dependancies
that Composer downloaded. It has a few of its own files to manage the
autoloading, but you can see it pulled down all of the dependencies for
the Joomla Framework's Application package (and there are quite a few of
them).Running the application
To run the application, we just have to run the "bin\tagaliser.php" file through the PHP interpreter.$ php -f bin/tagaliser.php
It works!
There's also a help option in the basic application.$ php -f bin/tagaliser.php -- --help
Tagaliser 1.0
Usage: php -f tagaliser.php -- [switches]
tagaliser [switches]
Switches: -h | --help Prints this usage information.
Examples: tagaliser -h
End of Part 1
So, that's how to get a basic command line application up and running with Composer and the Joomla Framework. In the next part, we'll have a look at how the application files work.You might also like to read:


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