CodeIgniter Forums

Full Version: Can I use external helpers or modules? (external = external URL)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Michal P[/eluser]
Hi,

I want to make some code, but I want to use external module or helper (external, in my opinion means external url module, not attached on local code).

In example:
- User A, use my code without changes (as it as)
- User B, use my code with some changes (he wanted to change something, and he did it)
- both Users must use external module or helper on my server, that they can`t change, If I change something, they use changed module/helper.

El Forum

[eluser]solid9[/eluser]
Are you trying to avoid piracy of your codes?
Is this the reason?

I think the external module/helper is possible but have you tried it?
You need to try and experiment with it.

El Forum

[eluser]Michal P[/eluser]
[quote author="solid9" date="1350902308"]Are you trying to avoid piracy of your codes?
Is this the reason?[/quote]
Somethink like that, but a little less professional usage - If I change something, all users have the latest version of module, because it`s still on my server... and i`m avoiding installing script without my knowledge by the way :-)

[quote author="solid9" date="1350902308"]I think the external module/helper is possible but have you tried it?
You need to try and experiment with it.[/quote]
I`m little nooby so I don`t know how to do it to use external module/helper... I`ve done some experiments but without success...

Code:
$this->load->model('http://myownserver.com/application/modules/module.php', '', true);

I`ve checked some posibilities, and It didn`t work...

El Forum

[eluser]solid9[/eluser]
I'm not sure about the inclusion of the external php script from different server URL.
But there is more solutions to your problem.
You can try IonCube to encrypt your codes.
you can also use iFrame, just google it.

El Forum

[eluser]solid9[/eluser]
I think this will help you,
http://stackoverflow.com/questions/27527...r-with-php

El Forum

[eluser]Michal P[/eluser]
I`ve tried, but I`ve failed... I know link you write about, but I did some experiments again...

Code:
<?php include("http://mysecondserver.com/application/models/nameofmymodel.php"); ?>
Code:
<?php include("http://mysecondserver.com/assets/temp/nameofmytempfile.php"); ?>

both failed, allow_url_include is ON

file_get_contents and file_put_contents failed


I have no idea to use tips attached in link above.

Encryption of my codes isn`t best solution I`m seeking for, I`ll be the last one. Are there any other ideas to include model/helper, or some other PHP code, from other server in CodeIgniter?


El Forum

[eluser]Michal P[/eluser]
I remind you my topic.
I want to use external (ex. the other server, other domain) module, library, somethink, that I could change in one place... and then it`ll be working in new version everywhere it was installed and script used my external source...

So, in the begining it could be something easy, function hello_word, execute via external source?

If it`s possible in CodeIgniter?