require

why include instead of require in php cms?

I see php CMS using include instead of require for their important files. SHouldn't this files such as header.php be required? THe script continues if the file is unable to be opened! ...

Include does nothing

Hi. I want to chceck files before I'll connect domain on my server. I've added them in direct admin, I've uploaded files - but I don't know how to get to them. I have 4 domains connected, but i have acces only to one. I saw that it's possible to include file from higher level include('../../panele-podlogowe.eu/adm/img/edit.gif') Tha...

require wp-load.php 3 directories back

I'm trying to include a file (/wp-load.php) at the beginning of the /html/ directory. I'm trying to include it from /wp-content/themes/pw-steel-orange/index-load.php, but I always get the error message Warning: require_once(../wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /nfs/c07/h01/mnt/1...

PHP include chain not working

Here's the folder structure of my project: /ping --/Controller ----Ping_Conntroller_Main.php ----Ping_Conntroller_Db.php --/Model ----dbCredentials.php --/View ----output.html.php 'ping' is the folder that contains my project and it sits inside the 'xampp/htdocs/' directory on my computer (C:/xampplite/htdocs/) Here is the initia...

Include/Require HTTP Address

I'm in need to include a PHP file that I can only reach with a complete HTTP address. I'm confused about this topic, I've heard it's a bad practice. How can I solve that? ...

When to call a "require" in Rails?

I have a more conceptual question in Rails... or Ruby for that matter: Is it best to call a require right before the method that needs it, group my requires at the beginning of the class or somewhere in an initializer when Rails boots? Does it matter from a performance point of view? From a readability point of view? Does it make a dif...

Difference between "include" and "require" in php

Is there any difference between them? Is using them a matter of preference? Does using one over the other produce any advantages? Which is better for security? ...

Loading ruby packages outside rails Mac OS X

Hi, I've recently downloaded a ruby extension (Nokogiri) using the gem install command and I would like to use it outside rails, in a small script I'm writing. When I use it in rails, it works perfectly, but how to load it outside rails? Which files should I need to 'require'? (I don't seem to find the downloaded source) Thank you if y...

passing parameters to php include/require construct

I've read quite a few posts that are very similar to the question I'm about to ask, but I just wanted to be sure that there wasn't a more sophisticated way to do this. Any feedback is greatly appreciated. I want to create a mechanism to check whether or not a logged-in user has access to the php script that is currently being called. ...

Including a whole directory in PHP or Wildcard for use in PHP Include?

I have a command interpreter in php. It lives inside the commands directory and needs access to every command in the command file. Currently I call require once on each command. require_once('CommandA.php'); require_once('CommandB.php'); require_once('CommandC.php'); class Interpreter { // Interprets input and calls the required ...

What is the equivalent of "require" (Ruby) in Python?

I am coming to python from ruby. What is the equivalent statement of require (Ruby) in Python? ...

Lua: require() not working on iPhone

Hi guys, I am working on a shooting game on iPhone and I need lua for scripting levels, enemies, and etc. So I wrote a bullet script like this: -- circular_bullet.lua local time_between_bullets = 0.2; ... function InitializeCircularBullet(objectName) ... end and an enemy script: -- level1_D2.lua require("circular_bullet.lua"); ....

PHP file_get_contents after php has evaluated

Hey guys, I know how to use file_get_contents and fopen etc, but when I do it to one of my own file, I get the literal string, meaning, the code is not preprocessed! How can i import text from a file without using require etc. because I want to store the value into a string ...

Neither ruby and nor irb can load .rb file in current directory

I'm having a really noob problem with importing files in Ruby. I'm making a Ruby app in Windows XP. All the class files for the app are in "C:/Documents/Prgm/Surveyor_Ruby/lib". But when I require a file in another file, neither ruby nor irb can find the required file. The current directory's contents: C:\Documents\Prgm\Surveyor_Ruby\l...

Simple ruby interpreter problem : `require': no such file to load -- (LoadError)

I get this when I run a main.rb file from OSX command line `require': no such file to load -- EngineAPIWrapper (LoadError) I have tried putting all the files that it references within the same folder instead of sym links but I still get the problem if I require 'rubygems' at the top of the main.rb file I get this error instead: link...

explicit require in Rails 3

I am converting my Rails 2 app to Rails 3. So far, I've been successful. However, there is this strange issue that I have to explicitly require any external files. Here is my original (i.e. Rails 2) ActiveRecord model: class Book < ActiveRecord::Base belongs_to :author has_many :translations, :dependent => :destroy include Freebas...

SWIG: Ruby overloading problems

Hi, I have a sinatra web application and a C++ library that I can 'require' in sinatra (ruby) using bindings created by swig. I also have a second -very similar- library, in which the function names are partially the same as in the first one. When I require them both, the one that is loaded first 'wins', i.e. calls to the ambiguous fun...

Why PHP "require" does not find a file ?

I have the following files structure: temp main index.php a.php b.php Here are the files; index.php echo "index.php ---> " . __DIR__ . "<br />"; require('../a.php'); echo "OK<br />" a.php echo "a.php ---> " . __DIR__ . "<br />"; require('./b.php'); echo "a is here<br />" b.php echo "b is here<br />" W...

Need help with PHP "include" - How to save the path to my website in variable ?

I use the following scheme to include PHP files: require($_SERVER['DOCUMENT_ROOT'] . "Path/To/My/Website/Path/To/My/File.php"); I would like to save $_SERVER['DOCUMENT_ROOT'] . 'Path/To/My/Website' in some variable, say $my_website, and write: require("$my_website/Path/To/My/File.php"); This way, if I decide to change the path ...

SWIG: Avoid name clashes

What is the best way to avoid name clashes in SWIG generated functions? I have two different C++ classes with partially identical function names. When I call such a function on an object, given both classes are loaded in the target language, it seems related to which library was loaded first, which function gets actually executed. It ha...