CodeIgniter Forums
possible to have a global file folder model multiple site? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: possible to have a global file folder model multiple site? (/showthread.php?tid=38707)



possible to have a global file folder model multiple site? - El Forum - 02-16-2011

[eluser]Spectruman[/eluser]
assuming I have multiple site, the folder model has a file with methods are the same for all, how to put a global this file has folder model for all. Just as today you can put a single core for all


possible to have a global file folder model multiple site? - El Forum - 02-16-2011

[eluser]Spectruman[/eluser]
[quote author="Spectruman" date="1297887162"]assuming I have multiple site, the folder model has a file with methods are the same for all, how to put a global this file has folder model for all. Just as today you can put a single core for all[/quote]

HELP!!
nobody can help?


possible to have a global file folder model multiple site? - El Forum - 02-16-2011

[eluser]ecsyle31[/eluser]
You could probably accomplish this with symlinks. Create a symlink to the shared model file.


possible to have a global file folder model multiple site? - El Forum - 02-16-2011

[eluser]Spectruman[/eluser]
[quote author="rlindauer" date="1297903552"]You could probably accomplish this with symlinks. Create a symlink to the shared model file.[/quote]

how would this idea into practice, please show an example because I did not understand how it would work.


possible to have a global file folder model multiple site? - El Forum - 02-16-2011

[eluser]ecsyle31[/eluser]
You have a directory for the shared model, then you would just create a symlink to those shared files in your applications model directory.

For example your shared model directory is under /home, say: /home/shared/models/my_model.php

Then in your application directory, you create a symlink to that file. Say your app directory is at /var/www/html/application

You'd do this:
Code:
ln -s /home/shared/models/my_model.php /var/www/html/application/models/my_model.php

Now codeigniter will see that model file in your model directory.

Symlinks = http://ss64.com/bash/symlink.html


possible to have a global file folder model multiple site? - El Forum - 02-17-2011

[eluser]Spectruman[/eluser]
[quote author="rlindauer" date="1297925191"]You have a directory for the shared model, then you would just create a symlink to those shared files in your applications model directory.

For example your shared model directory is under /home, say: /home/shared/models/my_model.php

Then in your application directory, you create a symlink to that file. Say your app directory is at /var/www/html/application

You'd do this:
Code:
ln -s /home/shared/models/my_model.php /var/www/html/application/models/my_model.php

Now codeigniter will see that model file in your model directory.

Symlinks = http://ss64.com/bash/symlink.html[/quote]

assuming that I can not make a symbolic link by limitations of web hosting. Have a way to put this by the framework this global model include or variable constate call php?

as is done in core ci could do something similar or has other means more accurate
Code:
$system_path = "../ci_core";
$model_path_global = "../model";



possible to have a global file folder model multiple site? - El Forum - 02-18-2011

[eluser]Spectruman[/eluser]
[quote author="Spectruman" date="1297960977"][quote author="rlindauer" date="1297925191"]You have a directory for the shared model, then you would just create a symlink to those shared files in your applications model directory.

For example your shared model directory is under /home, say: /home/shared/models/my_model.php

Then in your application directory, you create a symlink to that file. Say your app directory is at /var/www/html/application

You'd do this:
Code:
ln -s /home/shared/models/my_model.php /var/www/html/application/models/my_model.php

Now codeigniter will see that model file in your model directory.

Symlinks = http://ss64.com/bash/symlink.html[/quote]

assuming that I can not make a symbolic link by limitations of web hosting. Have a way to put this by the framework this global model include or variable constate call php?

as is done in core ci could do something similar or has other means more accurate
Code:
$system_path = "../ci_core";
$model_path_global = "../model";
[/quote]

HELP!!
nobody can help? anyone have a good idea or solution to the case.


possible to have a global file folder model multiple site? - El Forum - 02-21-2011

[eluser]Spectruman[/eluser]
[quote author="Spectruman" date="1298047333"][quote author="Spectruman" date="1297960977"][quote author="rlindauer" date="1297925191"]You have a directory for the shared model, then you would just create a symlink to those shared files in your applications model directory.

For example your shared model directory is under /home, say: /home/shared/models/my_model.php

Then in your application directory, you create a symlink to that file. Say your app directory is at /var/www/html/application

You'd do this:
Code:
ln -s /home/shared/models/my_model.php /var/www/html/application/models/my_model.php

Now codeigniter will see that model file in your model directory.

Symlinks = http://ss64.com/bash/symlink.html[/quote]

assuming that I can not make a symbolic link by limitations of web hosting. Have a way to put this by the framework this global model include or variable constate call php?

as is done in core ci could do something similar or has other means more accurate
Code:
$system_path = "../ci_core";
$model_path_global = "../model";
[/quote]

HELP!!
nobody can help?[/quote]

Anyone have a good idea or solution to the case.