elgg2.0 does not allow me to call start.php
now how can i connect dartabase
i show on your document but i could not understand so please clear it
// Don't do this
! dirname(__DIR__) . "/engine/start.php";
To boot Elgg manually, you can use the class Elgg\Application.
// boot Elgg in mod/myplugin/foo.php
require_once dirname(dirname(__DIR__)) . '/vendor/autoload.php';
\Elgg\Application::start();
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
Just to make sure you're using the correct approach in the first place: What is your use case? Why you need to start Elgg engine manually as opposed to e.g. registering a page handler or an action?
ok thanks
There are some use cases when it's justifiable to start the engine manually. If you tell more about your use case, it's easier to suggest the best approach.
like newsletter plugin my plugin is running some task in backgroud. which take longer time like 2-3 minutes or so.
Is there a reason why it has been calling start.php manually?
obviously to make call to elgg function lke get_entity() etc . I need to start the engine.?
You could do for example this instead:
but cron will die after 30 seconds.(as per php.ini) no PHP (including cron) can run for a longer time.
I some time need to run a very long process, becuuse task is heavy or task is waiting for some external event.
How do you handle the time limit in your current script?
the current script is forked by php exec command so ,it runs with separate php command and separate php.ini
I learned this trick from newsletter plugin. you can check cli.php
newsletter/procedure/cli.php line 38
this script is invoked from newsletter/lib/function.php line no 46 like this
- Previous
- 1
- 2
- Next
You must log in to post replies.