How to call a "mymodule" function outside drupal

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by spideep on November 22, 2012 at 3:41pm

I have my drupal directory here: www/ext/drupal/
I have made a index.php in : www/ext/index.php

I've made my module with these instructions:
http://www.bobbymods.com/faq/drupal-modules/how-do-i-add-my-own-php-func...

After that my ext/index.php looks like these:

<?php
$path = $_SERVER['DOCUMENT_ROOT'];
chdir($path."/drupal");
define('DRUPAL_ROOT', getcwd());
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

/call mymodule function/

myfunctionlibtwo("block");

After that I see:
Fatal error: Call to undefined function myfunctionlibtwo() in my index.php

Thanks for help.

Comments

Algo más...

Posted by spideep on November 22, 2012 at 3:44pm

Es DRUPAL 6


Alexis Rengifo

I think php not installed or

Posted by abhishek.kumar on November 22, 2012 at 4:11pm

I think php not installed or may be directory www is not your root directory.

Hmmm

Posted by spideep on November 22, 2012 at 4:21pm

I think yes,
I test module_list() and works ok, that means bootstrapping is ok right?

But this module list is uncomplete, there is no my module and other modules I have like JS Agregator, this is strange.


Alexis Rengifo

Did you enable the module in

Posted by berliner on November 22, 2012 at 4:11pm

Did you enable the module in the drupal installation?

Yes

Posted by spideep on November 22, 2012 at 4:19pm

Yes, double checked


Alexis Rengifo

He leído esto:

Posted by spideep on November 22, 2012 at 4:17pm

http://lima2011.drupal.lat/sites/default/files/Drupal%20BootStrapping.pdf

Y ciertamente estoy haciendo buen uso del bootstrapping porque cuando hago
<?php module_list()

me aparece la lista de módulos sin embargo no todos, por ejemplo tengo el modulo JS Agregator habilitado pero tampoco aparece en esta lista.

Extraño...


Alexis Rengifo

<?php $path =

Posted by diegodalr on November 22, 2012 at 4:44pm

<?php
$path = $_SERVER['DOCUMENT_ROOT'];
chdir($path."/ext/drupal");

...

Right, just an example

Posted by spideep on November 22, 2012 at 4:51pm

Actually /ext/ was just an example, bootstrapping works, but my module doesn't appear.


Alexis Rengifo

How do you call the index.php

Posted by berliner on November 22, 2012 at 4:53pm

How do you call the index.php file?

Like this

Posted by spideep on November 22, 2012 at 5:02pm

I have my drupal directory here: www/ext/drupal/
I have made a index.php in : www/ext/index.php

Is the index.php in a one level superior to the drupal installation

http://mydomain.com/ext/index.php

and my drupal is here:

http://mydomain.com/ext/drupal/


Alexis Rengifo

That should normally work. I

Posted by berliner on November 22, 2012 at 5:14pm

That should normally work. I just tested it on my local machine.

Anything special about your drupal installation? Are all modules in sites/all/modules? A settings.php file in sites/default?

Modulo list

Posted by diegodalr on November 22, 2012 at 5:08pm

Listando module_list(TRUE,FALSE) tampoco aparece???

Spain

Group organizers

Group categories

Región geográfica

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /