include-path

PHP how to find application root?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 12:09:13
问题 I'm having problems with my include files. I don't seem to be able to figure out how to construct my URLs when I use require_once('somefile.php'). If I try to use an include file in more than one place where the directory structures are different, I get an error that the include file cannot be found. In asp.net, to get my application root path, I can use ~/directory/file.aspx. The tild forward slash always knows that I am referencing from my website root and find the file no matter where the

PHP include absolute path

百般思念 提交于 2019-11-27 09:03:49
I have a variable on my site called $basePath which is set as: $basePath = '/Systems/dgw/'; I am using it on all my css, js and images tags as so (shortened for better visibility): <link href="<?php echo $basePath; ?>include/assets/css/bootstrap.min.css"> I have no problem with those includes and they work fine in wherever file and in whatever folder I am. I have a certain included page which has the following line: <img src="<?php echo $basePath; ?>images/new_logo.png" alt="logo"/> And the image shows just fine. The line after it states: <?php include($basePath.'include/assets/common

How to make g++ search for header files in a specific directory?

雨燕双飞 提交于 2019-11-27 06:27:42
I have a project (a library) that is subdivided into a few directories with code in them. I'd like to to have g++ search for header files in the project's root directory, so I can avoid different include paths for same header files across multiple source files. Mainly, the root/ directory has sub-directories A/ , B/ and C/ , all of which have .hpp and .cpp files inside. If some source file in A wanted to include file.hpp , which was in B, it would have to do it like this: #include "../B/file.hpp" . Same for another source file that was in C. But, if A itself had sub-directories with files that

php relative and absolute paths

跟風遠走 提交于 2019-11-27 02:41:41
问题 I have read that when including a php file that using absolute paths has a faster processing time than relative paths. What would you suggest to use? include("includes/myscript.php"); or include("/home/ftpuser/public_html/includes/myscript.php"); or even set_include_path("/home/ftpuser/public_html/includes"); include("myscript.php"); Or is it something that I really shouldn't worry about? 回答1: I usually set a constant, either manually or like this: define('ROOT', dirname(__FILE__)); Then do

python pip specify a library directory and an include directory

删除回忆录丶 提交于 2019-11-27 00:02:16
I am using pip and trying to install a python module called pyodbc which has some dependencies on non-python libraries like unixodbc-dev, unixodbc-bin, unixodbc. I cannot install these dependencies system wide at the moment, as I am only playing, so I have installed them in a non-standard location. How do I tell pip where to look for these dependencies ? More exactly, how do I pass information through pip of include dirs (gcc -I) and library dirs (gcc -L -l) to be used when building the pyodbc extension ? pip has a --global-option flag You can use it to pass additional flags to build_ext . For

vscode "#include errors detected. Please update your includePath

笑着哭i 提交于 2019-11-26 22:07:46
问题 I'm trying to use vscode with arduino but have no success. The problem seems to be something with the libraries path. But I havent been able to fix that ! I'm on linux. "message": "#include errors detected. Please update your includePath. IntelliSense features for this translation unit (/home/harold/Arduino/Saaf_Curing/Saaf_Curing.ino) will be provided by the Tag Parser.", I don't know how to find my includePath. I'm not able to do any advices given in vscode. I wonder if vs code is the right

Get calling file name from include()

守給你的承諾、 提交于 2019-11-26 20:44:05
问题 I want to get the name of the file that includes another file from inside the included file. I know there is the __FILE__ magic constant, but that doesn't help, since it returns the name of the included file, not the including one. Is there any way to do this? Or is it impossible due to the way PHP is interpreted? 回答1: This is actually just a special case of what PHP templating engines do. Consider having this function: function ScopedInclude($file, $params = array()) { extract($params);

How to include file outside document root?

两盒软妹~` 提交于 2019-11-26 16:11:38
问题 What I want do to is to include 'file1.php' from 'domain1' into 'file2.php' on 'domain2'. So what I figured I should do is something like this: file2.php require_once '/var/www/vhosts/domain1/httpdocs/file1.php'; But this won't work for reasons I can't truly grasp. So what I did was to add my path to the include path. Something like: file2.php set_include_path(get_include_path() . PATH_SEPARATOR . "/var/www/vhosts/domain1/httpdocs"); require_once 'file1.php'; So can you please give me some

Cannot find corecrt.h: $(UniversalCRT_IncludePath) is wrong

房东的猫 提交于 2019-11-26 15:37:03
问题 I've just installed Visual Studio 2015 on my working laptop with Windows 10. I've cloned a repository with a solution created with the same version of Visual Studio (update 3) on another PC, always with windows 10. When I try to build the solution on my laptop I obtain the following error: c:\program files (x86)\microsoft visual studio 14.0\vc\include\crtdefs.h(10): fatal error C1083: Cannot open include file: 'corecrt.h': No such file or directory In this page I've read that I must add $

PHP include absolute path

我怕爱的太早我们不能终老 提交于 2019-11-26 14:21:46
问题 I have a variable on my site called $basePath which is set as: $basePath = '/Systems/dgw/'; I am using it on all my css, js and images tags as so (shortened for better visibility): <link href="<?php echo $basePath; ?>include/assets/css/bootstrap.min.css"> I have no problem with those includes and they work fine in wherever file and in whatever folder I am. I have a certain included page which has the following line: <img src="<?php echo $basePath; ?>images/new_logo.png" alt="logo"/> And the