Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Many projects with one framework and tasks.
  • Firstly, I'd like to say: Hi everyone :)
    And now my beginner problem -  have never created anything with fuelPHP. Not yet.
    I created folder structure like in http://fuelphp.com/forums/discussion/comment/8865#Comment_8865 suggest. That's OK, in browser everything looks OK - no errors. But I've read about tasks and here is my problem.
    How can I call task for my project directory (/fuelPHP/app/fueldemo) if "oil" is only within fuel directory?
    In Example task there is a namespace: namespace Fuel\Tasks; but how can I set namespaces for my application? This is my folder structure
    fuelPHP (directory in docroot)
    |-app
      |- fueldemo
        |-cache
        |-classes
        |-...
        |-tasks
          |-example.php
        |-...
        |-bootstrap.php
    |-fuel
      |-core
      |-packages
    |-public
      |-fueldemo
        |-assets
        |-index.php
  • HarroHarro
    Accepted Answer
    OIl knows where to find tasks. Tasks are in a fixed namespace, they don't follow the cascading file system rules, and are not loaded by the autoloader. like Migrations, they are a special type of class.

    For a beginner when it comes fo FuelPHP, you have choosen a very complex folder construction. A non-standard installation inside the docroot, and a multi-app setup?

    Because of this multiapp setup, you'll need a front-controller for every application, or use a single front-controller that contains logic to set the correct APPPATH. For web requests, that is the index.php. You've solved this by creating folders in public for every app, so each app has it's own index.php front-controller.

    For the commandline, 'oil' is your front-controller. So you have to do the same there. Either create multiple versions of 'oil', each with it's own APPPATH, or add logic to it so that you can for example specify the app name on the commandline (so you can for example do 'php oil fueldemo r example').

    I think, while you're trying to get familiar with FuelPHP, it's easier just to use the normal setup and recommended installation, and worry about these multiapp problems later. Migrating from a standard setup to this one is simply copying the app and public folders and changing the paths, so you're not going to lose time by doing it this way.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion