MUlt1mate / cron-manager

A PHP cron task manager for MVC-type applications
MIT License
405 stars 70 forks source link

How to install the cron-manager into the CI framework? #3

Closed linjunjie closed 8 years ago

linjunjie commented 8 years ago

hi ~ , I want to import your great work cron-manager to my CI project, but I just don't konw how.

I follow your CI readme.md:

Enable Composer in application/config.php $config['composer_autoload'] = true;

Install package via Composer

composer require mult1mate/cron-manager

but I did not get the expected results.

I see the example directory below has the CodeIgniter dir, but I had not got the right dir.

Could you give me a hint about how to install into the CI framework? Just copy the example/codeigniter dir? Or some other way? thank you : ) .

MUlt1mate commented 8 years ago

Hi. You should merge application folder with your. After that, create tables. Sql queries in application/vendor/mult1mate/cron-manager/src/DbHelper.php Default uri for the controller: /TasksController/index This is how it should looks like. Green color is for copied files. preview

MUlt1mate commented 8 years ago

Hey. How is it going? Please write me if you have any troubles with the tool.

linjunjie commented 8 years ago

Thanks for your help, it's very helpful.But I still can't make the composer works for my CI project, So my solution is just add one row in the top of TaskController.php:

include "./vendor/autoload.php";

and It works now.

If just copy the Application folder to my CI project, It seems like doesn't work.

Did I make something wrong?

And there is a manager_action.js in your application folder, where shoud I put it to?

MUlt1mate commented 8 years ago

Maybe you have CodeIgniter v2? Composer is not enabled there by default. Here is a manual. Just change your index.php

require FCPATH . 'vendor/autoload.php';
require_once BASEPATH.'core/CodeIgniter.php';

manager_action.js should be in the web root directory. You can change the path in views/tasks/template.php