2

I'm deeply interested in getting a very basic Joomla Framework site going, but constantly run into ancient or missing documentation on how to get started. The "official" site points to a 5 year old build, and anything I find online presumes a lot of existing knowledge with the answers. Additionally, we don't install 3rd party apps to be real handy at Composer, Git, etc., so just understanding the basic directory structure has been impossible

In my case, the only functions I'm looking for are the CLI and Database functions. I've stumbled around the installation tools, but end up with all sorts of test, src, vendor type folders with repositories, etc., and frankly, it leaves me completely baffled.

Is there some downloadable "zip" type file, or other resource that can show what the finished "product" should look like? In other words, a VERY basic, but complete folder to say, make the CLI package work? I have all these repositories, folders, and Git files, but have no idea where which ones belong in my "\site" folder.

Update With the always-amazing assistance from Lodder, I managed to get this installed and apparently working. The composer.json was the trick (along with a plain statement that IT does the downloading, not me). Then after upgrading to PHP7 and properly using Composer, I managed to get a composer.json (see below) that brought it altogether as needed.

For future reference, the accepted answer is a compilation of all the disjointed links about The Framework, and bringing them together for a successful installation of the Application, database, and CLI. (--- Thanks again Lodder)

{
    "name": "joomla/application",
    "type": "joomla-package",
    "description": "Joomla Application Package",
    "keywords": ["joomla", "framework", "application"],
    "homepage": "https://github.com/joomla-framework/application",
    "license": "GPL-2.0-or-later",
    "require": {
        "php": "^5.3.10|~7.0",
        "joomla/input": "~1.2",
        "joomla/registry": "^1.4.5|~2.0",
        "psr/log": "~1.0",
        "joomla/string": "~2.0",
        "symfony/console": "~3.4|~4.0"    },
    "require-dev": {
        "joomla/coding-standards": "~2.0@alpha",
        "joomla/event": "~1.2|~2.0",
        "joomla/session": "^1.2.1|~2.0",
        "joomla/test": "~1.1",
        "joomla/uri": "~1.1",
        "phpunit/phpunit": "^4.8.35|^5.4.3|~6.0"
    },
    "suggest": {
        "joomla/session": "To use AbstractWebApplication with session support, install joomla/session",
        "joomla/uri": "To use AbstractWebApplication, install joomla/uri"
    },
    "autoload": {
        "psr-4": {
            "Joomla\\Application\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Joomla\\Application\\Tests\\": "Tests/"
        }
    },
    "minimum-stability": "dev",
    "extra": {
        "branch-alias": {
            "dev-master": "1.x-dev"
        }
    }
}

1 Answer 1

2

I had the same issue once and I solved with with a lot of trial and error. You're going to really struggle doing this without composer though, so I strongly suggest using it.


You'll firstly need to install Composer.

The Joomla framework packages can be found here and have been separated so they're easier to maintain and allows you to fetch whichever you require, rather than all at once.

In your composer.json, you'll need to add the following:

{
    "require": {
        "joomla/database": "~1.0",
        "joomla/console": "~2.0@dev"
    }
}

Here is a basic example of a composer.json file (save it in the root of your project)

{
    "name": "vendor_name/package_name",
    "type": "project",
    "description": "Some Description here",
    "homepage": "https://github.com/company/project",
    "license": "GPL-2.0+",
    "config": {
        "platform": {
            "php": "7.2.9"
        },
        "vendor-dir": "framework/vendor" << CHANGE TO  INSTALLATION LOCATION
    },
    "require": {
        "joomla/database": "~1.0",
        "joomla/console": "~2.0@dev"
    }
}

Then open the command line and cd into the root of your project and run composer install.

This will install the packages you need and any dependencies they require.


You can then include composer's autoload file in the main file of your application

require __DIR__ . '/framework/vendor/autoload.php';

(change framework/vendor to whatever you chose in the composer file)


All packages have been installed at this point and you're ready to start using them.

Include your Use statements and instantiate a database connection as shown here:

https://github.com/joomla-framework/database#introduction


The only "ZIP" file I know of that use the Joomla framework packages is the Joomla CMS.

You've most likely seen the link here, but on the off chance you haven't, have a look: https://joomla.stackexchange.com/a/15306/168

6
  • Why am I not surprised that it's you with the answer, lol. Dumb question you say "in my composer.json". I've downloaded the database and console packages, unzipped them both into their own folders...do I make that change in each of the downloaded folders and run composer in each of the 2 folders?
    – GDP
    Commented Sep 6, 2018 at 13:25
  • Anything to get those flowers haha. You dont manually download them. Add tge lines to your omposer.json, then run composer install. This will download the packages for you and generate the autoload.php file that you include.
    – Lodder
    Commented Sep 6, 2018 at 13:52
  • Okay...that basic Composer stuff again....any suggestions on a link to figure out the folder to run Composer from, what has to be in that folder to begin with, and what the composer.json starting point is? (I HATE having to ask THIS kinda thing) And if I actually get this working, I may have to actually find a florist in the UK!
    – GDP
    Commented Sep 6, 2018 at 14:10
  • @GDP - I've updated my answer with some more information and an example of the composer.json file I used in the project
    – Lodder
    Commented Sep 6, 2018 at 14:30
  • you are TRULY an amazing resource - whoever you work with and for oughta thank their lucky stars!!
    – GDP
    Commented Sep 6, 2018 at 15:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.