本文整理汇总了PHP中file_exists_incpath函数的典型用法代码示例。如果您正苦于以下问题:PHP file_exists_incpath函数的具体用法?PHP file_exists_incpath怎么用?PHP file_exists_incpath使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了file_exists_incpath函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLoginPath
public function checkLoginPath()
{
$n = $_SERVER['SERVER_NAME'];
$this->login_path = reset(explode('?', $this->login_path));
if (stripos($this->login_path, $n) === false) {
return;
}
if ('http://' . $n . $_SERVER['REQUEST_URI'] == $this->login_path) {
return;
}
$name = str_replace(array($n, 'http://'), '', $this->login_path);
$dirs = array_filter(explode('/', $name));
global $access_groups;
$path = null;
foreach ($dirs as $dir) {
if (!$path) {
$path = 'pages/' . $dir . '/';
} else {
$path .= $dir . '/';
}
$settings_file = $path . $dir . '-settings.php';
if (file_exists_incpath($settings_file)) {
include $settings_file;
}
}
}
示例2: parse_file_comments
function parse_file_comments($file_name)
{
$custom_file_name = AMP_LOCAL_PATH . '/custom/' . $file_name . '.ini.php';
if (!file_exists($custom_file_name)) {
$custom_file_name = 'Config/' . $file_name . '.ini.php';
if (!file_exists_incpath($custom_file_name)) {
return array();
}
}
$fileRef = fopen($custom_file_name, 'r');
$result = array();
$current_header = '';
while ($line = fgets($fileRef)) {
if (strlen($line) < 2) {
continue;
}
if (substr($line, 0, 1) == ';') {
$current_header .= substr($line, 1);
continue;
}
if (!$current_header) {
continue;
}
$line_name = str_replace(array('[', ']'), '', reset(split('=', $line)));
$result[$line_name] = $current_header;
$current_header = '';
}
return $result;
}
示例3: _load_template_file
function _load_template_file($request_path)
{
$path_verified = false;
$path_exists = file_exists_incpath($request_path);
if ($path_exists) {
$path_verified = $path_exists;
} else {
$test_path = $this->_path_default . basename($request_path);
if ($path_exists = file_exists_incpath($test_path)) {
$path_verified = $path_exists;
}
}
if (file_exists($path_verified)) {
return file_get_contents($path_verified);
}
/*
$paths = explode(PATH_SEPARATOR, get_include_path());
foreach ($paths as $path)
{
// Formulate the absolute path
$fullpath = $path . DIRECTORY_SEPARATOR . $path_verified;
// Check it
if (file_exists($fullpath)) {
return file_get_contents( $fullpath );
}
}
return false;
*/
}
示例4: getFile
function getFile()
{
$fullpath = $this->locateFile();
if (!file_exists_incpath($fullpath)) {
return false;
}
return file_get_contents($fullpath, true);
}
示例5: getFile
function getFile()
{
//$fullpath = AMP_pathFlip( $this->locateFile() );
$fullpath = $this->locateFile();
if (!($fullpath && file_exists_incpath($fullpath))) {
return false;
}
return file_get_contents($fullpath, true);
}
示例6: globalAqlModelLoader
/**
* loads aql model classes
* models/{name}/class.{name}.php
* @param string $name
* @return boolean
* @global $sky_aql_model_path
*/
public static function globalAqlModelLoader($name)
{
global $sky_aql_model_path;
$path = sprintf('%s/%s/class.%s.php', $sky_aql_model_path, $name, $name);
if (file_exists_incpath($path)) {
include $path;
if (class_exists($className)) {
return true;
}
}
return false;
}
示例7: _getFieldOverrides
function _getFieldOverrides($file_name)
{
$override_file_name = str_replace('.xml', '_Override.xml', $file_name);
$override_file_path = file_exists_incpath($override_file_name);
if (!$override_file_name) {
return array();
}
$field_overrides = $this->_readXML($override_file_path);
if (!$field_overrides) {
return array();
}
return $field_overrides;
}
示例8: evalnavhtml
function evalnavhtml($string)
{
global $base_path, $dbcon, $MM_type, $MM_parent, $MM_typename, $list, $id, $MM_issue, $MM_region, $navalign;
global $rNAV_HTML_1, $rNAV_HTML_2, $rNAV_HTML_3, $rNAV_HTML_4, $rNAV_HTML_5;
global $lNAV_HTML_1, $lNAV_HTML_2, $lNAV_HTML_3, $lNAV_HTML_4, $lNAV_HTML_5;
if (!isset($start)) {
$start = '';
}
$pos = strpos($string, '<?php', $start);
$start = 0;
/* Loop through to find the php code in html... */
while (!($pos === FALSE)) {
/* Find the end of the php code.. */
$pos2 = strpos($string, "?>", $pos + 5);
/* Eval outputs directly to the buffer. Catch / Clean it */
$code = substr($string, $pos + 5, $pos2 - $pos - 5);
$variables = preg_replace('/.*\\$([^\\s]*)\\s*=\\s*["\']{0,1}([^"\']*)["\']{0,1}.*/', "\$1 \$2", $code);
$va_args = split(" ", $variables);
if ($va_args[0] == 'regionlink') {
$regionlink = $va_args[1];
}
if ($va_args[0] == 'navalign') {
$navalign = $va_args[1];
}
//echo $regionlink.'<br>';
$include_args = preg_replace("/.*include\\s*[\\(\\s*]?\\s*\"?([^\\)\"\\s]*)\"?[\\)\\s*]?.*/", "\$1", $code);
$incl = str_replace('"', '', $include_args);
#echo $incl.'<br>';
ob_start();
$customfile = AMP_LOCAL_PATH . DIRECTORY_SEPARATOR . 'custom' . DIRECTORY_SEPARATOR . $incl;
if (file_exists($customfile)) {
include $customfile;
} else {
$basefile = 'AMP/Nav/' . $incl;
if (file_exists_incpath($basefile)) {
include $basefile;
} elseif (file_exists_incpath($incl)) {
$file = $incl;
include $file;
}
}
$value = ob_get_contents();
ob_end_clean();
/* Grab that chunk! */
$start = $pos + strlen($value);
$string = substr($string, 0, $pos) . $value . substr($string, $pos2 + 2);
$pos = strpos($string, '<?php', $start);
}
return $string;
}
示例9: _register_fields_dynamic
function _register_fields_dynamic()
{
$options = $this->getOptions();
if (!(isset($options['override_file']) && $options['override_file'])) {
return;
}
if (!file_exists_incpath($options['override_file'])) {
trigger_error("can't find override file {$options['override_file']}");
return;
}
$override_fields = $this->_read_xml_fields($options['override_file']);
if (!$override_fields) {
trigger_error("XML read failed for override file {$options['override_file']}");
return;
}
$this->udm->fields = array_merge($this->udm->fields, $override_fields);
}
示例10: _loadItemType
function _loadItemType($type)
{
if (!isset($this->_content_item_types[$type])) {
return false;
}
if (class_exists($this->_content_item_types[$type])) {
return true;
}
$load_filename = 'AMP/Content/' . ucfirst($type) . '.inc.php';
if (isset($this->_content_item_paths[$type])) {
$load_filename = $this->_content_item_paths[$type];
}
if (!file_exists_incpath($load_filename)) {
return false;
}
include_once $load_filename;
return $this->_content_item_paths[$type];
}
示例11: execute
function execute()
{
if ($badge_id = $this->nav->getBadgeId()) {
return $this->do_badge($badge_id);
}
if (!($filename = $this->nav->getIncludeFile())) {
return false;
}
$fullpath = file_exists_incpath($filename);
if (!$fullpath) {
$fullpath = file_exists_incpath('AMP/Nav/' . $filename);
}
if (!$fullpath) {
return false;
}
$nav_class = $this->nav->getIncludeClass();
$nav_function = $this->nav->getIncludeFunction();
if (!$nav_class && !$nav_function) {
return $this->_raw_include($fullpath);
}
//include the file -- don't make a mess in these guys!
include_once $fullpath;
if (!$nav_class && is_callable($nav_function)) {
return $nav_function($this->get_arguments());
}
return $this->_raw_include($fullpath);
/*
$nav = false;
if ( $nav_class && class_exists( $nav_class )) {
$nav = &new $nav_class( );
}
if ( $nav ) {
if ( is_callable( array( $nav, $nav_function ))) {
return $nav->$nav_function( );
}
if ( method_exists( $nav, 'execute' )) {
return $nav->execute( );
}
}
*/
}
示例12: str_replace
function &makeCopier($classname)
{
$filename = 'AMP/System/' . str_replace("_", DIRECTORY_SEPARATOR, $classname) . '/Copy.inc.php';
if (file_exists_incpath($filename)) {
include_once $filename;
}
$new_class = 'AMPSystem_' . $classname . '_Copy';
if (class_exists($new_class)) {
return new $new_class($this->dbcon);
}
trigger_error('AMPSystem_Copier: ' . $new_class . ' not found');
return false;
}
示例13: get_available_dbms
/**
* Returns an array of available DBMS with some data, if a DBMS is specified it will only
* return data for that DBMS and will load its extension if necessary.
*/
function get_available_dbms($dbms = false, $return_unavailable = false)
{
global $lang;
$available_dbms = array('firebird' => array('LABEL' => 'FireBird', 'SCHEMA' => 'firebird', 'MODULE' => 'interbase', 'DELIM' => ';;', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'firebird', 'AVAILABLE' => true), 'mysqli' => array('LABEL' => 'MySQL with MySQLi Extension', 'SCHEMA' => 'mysql', 'MODULE' => 'mysqli', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'mysqli', 'AVAILABLE' => true), 'mysql' => array('LABEL' => 'MySQL', 'SCHEMA' => 'mysql', 'MODULE' => 'mysql', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'mysql', 'AVAILABLE' => true), 'mssql' => array('LABEL' => 'MS SQL Server 2000+', 'SCHEMA' => 'mssql', 'MODULE' => 'mssql', 'DELIM' => 'GO', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql', 'AVAILABLE' => true), 'mssql_odbc' => array('LABEL' => 'MS SQL Server [ ODBC ]', 'SCHEMA' => 'mssql', 'MODULE' => 'odbc', 'DELIM' => 'GO', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql_odbc', 'AVAILABLE' => true), 'oracle' => array('LABEL' => 'Oracle', 'SCHEMA' => 'oracle', 'MODULE' => 'oci8', 'DELIM' => '/', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'oracle', 'AVAILABLE' => true), 'pgsql' => array('LABEL' => 'PostgreSQL 7.x/8.x', 'SCHEMA' => 'postgres', 'MODULE' => 'pgsql', 'DELIM' => ';', 'COMMENTS' => 'remove_comments', 'DRIVER' => 'postgres', 'AVAILABLE' => true), 'sqlite' => array('LABEL' => 'SQLite', 'SCHEMA' => 'sqlite', 'MODULE' => 'sqlite', 'DELIM' => ';', 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'sqlite', 'AVAILABLE' => true));
if ($dbms) {
if (isset($available_dbms[$dbms])) {
$available_dbms = array($dbms => $available_dbms[$dbms]);
} else {
return array();
}
}
// now perform some checks whether they are really available
foreach ($available_dbms as $db_name => $db_ary) {
$dll = $db_ary['MODULE'];
if (!@extension_loaded($dll) || !file_exists_incpath("MDB2" . DIRECTORY_SEPARATOR . "Driver" . DIRECTORY_SEPARATOR . $db_name . ".php")) {
#if (!can_load_dll($dll))
#{
if ($return_unavailable) {
$available_dbms[$db_name]['AVAILABLE'] = false;
} else {
unset($available_dbms[$db_name]);
}
continue;
#}
}
$any_db_support = true;
}
if ($return_unavailable) {
$available_dbms['ANY_DB_SUPPORT'] = $any_db_support;
}
return $available_dbms;
}
示例14: _getIncludeFilename
function _getIncludeFilename($code)
{
$include_args = preg_replace("/.*include\\s*[\\(\\s*]?\\s*\"?([^\\)\"\\s]*)\"?[\\)\\s*]?.*/", "\$1", $code);
$incl = str_replace('"', '', $include_args);
$customfile = AMP_LOCAL_PATH . DIRECTORY_SEPARATOR . 'custom' . DIRECTORY_SEPARATOR . $incl;
if (file_exists($customfile)) {
return $customfile;
}
$basefile = 'AMP/Nav/' . $incl;
if (file_exists_incpath($basefile)) {
return $basefile;
}
if (file_exists_incpath($incl)) {
return $incl;
}
return false;
}
示例15: inc
/**
* Includes the template and sets the body of the email with it
* @param string $name name of template or path to php file
* @param array $data
* @return $this
* @throws Exception if using a Mailer template and there is no inc_dir
* @throws Excpetion if the file to include does not exist
*/
public function inc($name, array $data = array())
{
if (strpos($name, '.php')) {
$include = $name;
} else {
if (!self::$inc_dir) {
throw new Exception('Mailer::$inc_dir not set.');
}
$include = self::$inc_dir . $name . '.php';
}
if (!file_exists_incpath($include)) {
throw new Exception('Mailer "' . $include . '" does not exist');
}
return $this->setBody($this->_includeTemplate($include, $data));
}