I am currently developing php scripts, But At some point I wanted to connect to drupal database with my php scripts, I google about accessing drupal api with external php scripts, as many people suggested use bootstrap.inc file in your external php script, I like to ask here, lets say if I added this bootstrap.inc file and related code after that can i get access to use drupal api with its database?
I wanted to register a user with drupal database and also need to read some tables from drupal database, So can i achieved all this? including bootstrap.inc is enough or need to add any other module from drupal side, i external php script get access to drupal database?
Thanks.
If you still want to work outside Drupal, in a standalone script, you should include Drupal's include/bootstrap.inc and call drupal_bootstrap() function to initialize Drupal environment (connect to database, load modules, session, etc.). You can select the phase to bootstrap depending on what you need from Drupal.
define('DRUPAL_ROOT', 'YOUR DRUPAL ROOT');
require_once('includes/bootstrap.inc');
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
// Drupal is fully loaded here, you can access everything.
information source: https://drupal.stackexchange.com/a/24117
drupal information: http://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_bootstrap/7
Related
I'm trying to create a php script and add it with vTiger crm, this script will add to vTiger the functionality to add a single csv file to a multiple database tables.
I don't know how can i add this script to vTiger
Any suggestions, Documentation, Help ?
I am working with Vtiger CRM version 6.0
There are a lot of ways to accomplish this.
The first one is register a new module in your CRM, (searching google for the Payslip example module).
Broadly, a vtiger Module is structured in two parts, the first in PHP that you using to process all your data, your functions, the second is passing what you had processed into the Smarty Template engine.
About the main methods, consider that vtiger generally pass 2 URL parameters:
"module", is used to retrive the module name -> directory -> privileges and all the rest
"action", is used to call a specific php file into the module.
In all this you should consider the implementation of the all the basic vtiger framework, controls, privileges, ecc.
About the database, Vtiger use the adb method.
Take a look to the include/database/PearDatabase.php for a comprehensive overview of all the database functions.
A second way, highly raccomended, is process your CSV file using the vtiger Webservice https://wiki.vtiger.com/index.php/Webservices_tutorials
and so, use an external PHP file.
This way is more less flexibile, but you can workaround all the basic implementation and focus on the data.
First off, this isn't really a programming question but more of a programming concept question. Basically, I've built a bespoke PHP framework to speed up deployment on my end and I want some kind of plugin system in place that will allow me to add specific features to the base of the framework (like the SQL class or maybe a Twitter package) that will allow me to throw them into a folder and not have to actually edit the base for every new project.
Any ideas of the best way of going about this?
Here is a nicely written post by #ircmaxell on how to do that and what are the options:
Handling Plugins In PHP
Also check out:
Best way to allow plugins for a PHP application
what im doing in my cms:
for each plugin i make a folder latin-named of this plugin's name.
i create a /translations folder in there too. Check here.
have a single php file that has 2 basic functions, the plugin_install and plugin_uninstall (you know, things to happen on install/unistall like tables creation/drop)
create a special page of your system that reads these plugins, installed and not and give an on/off switch so users can install/unistall them.
load these single files mentioned above by a single call to include_once on top of your index page (or administration page) so to include whatever functionality they offer.
enabled plugins will be loaded (include_once) from your main page, and also their functionality, so each plugin can call each other's as well.
I am looking to create a web site that will need to exchange information with a Filemaker Pro (version 11) database. Using PHP I can create simple web apps that submit and retrieve data from Filemaker. I would however like to use a CMS framework (such as Drupal) to allow users to control access to the site and update site content (blog posts, images, etc ...).
Is it possible to use Drupal as a "shell", controlling access to certain pages and allowing site editors to modify content, while embedding a PHP page/form to interact with the Filemaker data? I would be planning to use MySQL for Drupal and the custom "web apps" would access Filemaker. Thanks for any help.
Have you ever heard of the expression "there's a module for that?" It's used quite a bit in the Drupal world. And yes, for Filemaker, there is a Module for That!. It's called, the Filemaker module, see more detail at http://drupal.org/project/filemaker.
Now I've never tested it, so it may not give you everything you want. But the beauty of open source is that you can always contribute what it doesn't already have. Or at least see how they did it to see if its worth it for you to try your own integration.
Now this module is one version behind current, so maybe you can learn Drupal by learning to upgrade the module. There's great guides on how to do this.
Good day, I would like to know if there is a way to run a php application within the moodle LMS.
Prior to implementation in php, the information was in the form of static html documents, which were simply uploaded into folder and accessing the files gave the appearance of a site hosted within moodle.
Can such a functionality be replicated using PHP files that require service processing for desired features.
If not what are the best options for giving users a similar experience.
thanks
You can use plugins(Blocks or Module) to develop applications within Moodle. The pre-condition is that you need to follow Moodle programming guidelines to create a plugin.
More details here:
http://docs.moodle.org/dev/Modules
http://docs.moodle.org/dev/Blocks
However, you need to decide whether you need a Block or an Activity Module and it can be determined only after seeing the requirements.
It's not a problem to set cron intervals using xml-config file, but it'll be great to have ability to do that using config panel of custom module any time if needed. Friendly GUI instead of "terrible" XML, which could be accessible via FTP.
I have one idea only: catch some event when admin updates configuration of a given module and rewrite that xml-file by custom mechanism, but I don't like this solution. Maybe you know better or/and standard way?
Magento usually grabs all the cron data from the XML files you don't seem to be in favor of, but there's no reason you couldn't override it to use some other data model that gets retrieved from the database. Then you could have a simple interface to manage the cron details in the admin.