We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Load EE libraries for use in php

Development and Programming

Ivan Waumans's avatar
Ivan Waumans
7 posts
15 years ago
Ivan Waumans's avatar Ivan Waumans

I am writing a function that will import product data from an existing database into the Expression Engine database (and structure). This means creating entries in both the channel titles as data tables.

To do this I would like to use the EE Database and localize classes. The problem is that this script cannot reside inside an expression engine template or module. Is there a way to include these classes outside of the EE structure?

I have tried adapting the code inside the index.php file. At a certain point my browser redirected to the default website page although my htaccess rewrite rules prevent this for existing files and folders.

Is there a bootstrap file to include only what is necessary to use the EE classes?

Thanks in advance, Ivan.

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
15 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

This may be of use to you. I came across it recently:

https://github.com/blocka/ExpressionEngine-Bootstrap

       
Ivan Waumans's avatar
Ivan Waumans
7 posts
15 years ago
Ivan Waumans's avatar Ivan Waumans

I have tried it but it doesn’t seem to be working. It is including files that no longer exist in EE2:

require(BASEPATH.'core/Compat'.EXT);
...
require(BASEPATH.'core/Base5'.EXT);

I retrieved these files from EE 1.6.x

At the end there is

class A extends Controller {
   
}

$EE = new A;

The script stops working after the line where an instance is made of class A.

I also searched for the function _initialize_core. It only exists in the file Core.php inside

system/expressionengine/libraries

And I have the feeling that this class is not loaded by the bootstrap file.

It seems to me that the bootstrap file is only loading codeigniter classes. Am I wrong or is the ‘core’ parameter in the load_class calls referring to the core folder inside the codeigniter folder?

$CFG =& load_class('Config', 'core');

Any ideas?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Also if I might butt in on this one, does this work for ExpressionEngine v1.7.x? I see it references the older version in the readme file but not really sure if it will work or not.

Best wishes,

Mark

       
Ivan Waumans's avatar
Ivan Waumans
7 posts
15 years ago
Ivan Waumans's avatar Ivan Waumans

This is the original post:

Bootstrapping ExpressionEngine to integrate with other scripts

It does mention EE2. I posted a request for some help.

But if anybody else can figure out what is possibly wrong or how to use it, please do!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.