当前位置: 首页>>代码示例>>PHP>>正文


PHP join_paths函数代码示例

本文整理汇总了PHP中join_paths函数的典型用法代码示例。如果您正苦于以下问题:PHP join_paths函数的具体用法?PHP join_paths怎么用?PHP join_paths使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了join_paths函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: list_dir

function list_dir($root)
{
    global $script_path;
    $files = array();
    $dirs = array();
    $dir = opendir($root);
    while (($entry = readdir($dir)) !== false) {
        if (in_excludes($entry)) {
            continue;
        }
        $full_path = join_paths($root, $entry);
        if (is_dir($full_path) && $full_path != $script_path) {
            $dirs[] = $entry;
        }
        if (is_file($full_path)) {
            $files[] = array("name" => $entry, "size" => big_filesize($full_path), "path" => $full_path);
        }
    }
    closedir($dir);
    sort($files);
    sort($dirs);
    reset($files);
    reset($dirs);
    return array($files, $dirs);
}
开发者ID:Boris-de,项目名称:autoindex,代码行数:25,代码来源:index.php

示例2: initialize_logger

function initialize_logger($name)
{
    if (!IN_DEBUG) {
        return;
    }
    global $logger;
    Logger::configure(array('rootLogger' => array('appenders' => array('default')), 'appenders' => array('default' => array('class' => 'LoggerAppenderRollingFile', 'layout' => array('class' => 'LoggerLayoutPattern', "params" => array("ConversionPattern" => "%d{ISO8601} [%p] %m (at %F line %L)%n")), 'params' => array('file' => join_paths(QWP_LOG_DIR, $name . '.log'), 'append' => true, 'MaxFileSize' => '10MB', 'MaxBackupIndex' => '3')))));
    $logger = Logger::getRootLogger();
}
开发者ID:steem,项目名称:qwp,代码行数:9,代码来源:logger.php

示例3: get_partial_path

 function get_partial_path($name, $partials_base_dir = 'partials', $extension = 'php')
 {
     // Replace periods in the name with the directory separator if the developer used dot notation
     $name = str_replace('.', DIRECTORY_SEPARATOR, $name);
     // By default, it should just be the extension without the period
     // If the period was included by accident, remove it
     if ($extension[0] === '.') {
         $extension = substr($extension, 1);
     }
     return join_paths(get_template_directory(), $partials_base_dir, $name . '.' . $extension);
 }
开发者ID:jakelisby,项目名称:suttonOutdoor,代码行数:11,代码来源:get-partial-path.php

示例4: qwp_create_dialog_with_file

function qwp_create_dialog_with_file($dialog_id, $options, $file_name)
{
    global $QWP_DIALOGS;
    if (!isset($QWP_DIALOGS)) {
        $QWP_DIALOGS = array();
    }
    if (!isset($options['url']) && !isset($options['content'])) {
        $options['tmpl'] = $dialog_id;
    }
    $QWP_DIALOGS[$dialog_id] = $options;
    global $MODULE_ROOT;
    require_once join_paths($MODULE_ROOT, $file_name . '.php');
}
开发者ID:steem,项目名称:qwp,代码行数:13,代码来源:dialog.php

示例5: __autoload

function __autoload($sClassName)
{
    foreach ($_ENV['SETTINGS']['INCLUDE_DIRS'] as $sIncludeDir) {
        $sFileName = join_paths(getcwd(), "server/{$sIncludeDir}/class.{$sClassName}.php");
        if (file_exists($sFileName)) {
            require_once $sFileName;
            if (!class_exists($sClassName, false)) {
                throw new Exception("Class {$sClassName} could not be loaded, check syntax errors");
            }
            return;
        }
    }
    throw new Exception("Class {$sClassName} is not found");
}
开发者ID:apodgorny,项目名称:minimum,代码行数:14,代码来源:bootstrap.php

示例6: define

<?php

/*!
 * qwp: https://github.com/steem/qwp
 *
 * Copyright (c) 2015 Steem
 * Released under the MIT license
 */
define('QWP_TOOLS_ROOT', dirname(__FILE__));
define('QWP_ROOT', QWP_TOOLS_ROOT . '/..');
require_once QWP_ROOT . '/include/common.php';
if (count($argv) > 1) {
    $object = $argv[1];
    $template = file_get_contents(join_paths(QWP_ROOT, 'modules', 'users', 'home.js.php'));
    $template = str_replace('user', $object, $template);
    $template = str_replace('User', camel_case($object), $template);
    file_put_contents(join_paths(QWP_TOOLS_ROOT, $object . '.js.php'), $template);
} else {
    echo_line('please specify the object name, eg. user');
}
开发者ID:steem,项目名称:qwp,代码行数:20,代码来源:crud_generator.php

示例7: _finalize_url

 /**
  * Called on a fully-resolved URL before returning it.
  * Once all aliases in a URL have been expanded, it is expanded to the root if
  * {@link $resolve_to_root} is True. URLs beginning with a {@link $local_anchor}
  * or a domain are not expanded (both can be resolved without a relative context).
  * @see _can_have_root()
  * @param string $url
  * @param boolean $root_override Overrides {@link $resolve_to_root} if set to {@link Force_root_on}.
  * @return string
  * @access private
  */
 protected function _finalize_url($url, $root_override)
 {
     if ($this->_needs_root($url, $root_override)) {
         $url = join_paths($this->root_url, $url, $this->_url_options);
     }
     if (isset($this->_parent_resources)) {
         $url = $this->_parent_resources->_finalize_url($url, $root_override);
     }
     return $url;
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:21,代码来源:resources.php

示例8: append

 /**
  * Append a url to the current one
  * Handles separate merging and resolves all '..' marks
  * @param string $url
  */
 public function append($url)
 {
     $opts = $this->options();
     $is_file = is_file_name($url, $opts);
     $this->_text = join_paths($this->_text, $url, $opts);
     if (!$is_file && !$this->ends_with_delimiter()) {
         $this->_text .= $opts->path_delimiter;
     }
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:14,代码来源:url.php

示例9: foreach

    echo $db->authorizeKey($options["hash"]);
} else {
    if ($task === "addUser") {
        $db = new \mfoley\StudentSQL("students.db");
        echo $db->addKey($options["userID"]);
    } else {
        if ($task === "generateQR") {
            $db = new \mfoley\StudentSQL("students.db");
            $outfile = $options["outputDir"];
            $array = $db->getAll();
            $filenames = [];
            foreach ($array as $str) {
                array_push($filenames, base64_decode($str));
            }
            if (!is_dir($outfile)) {
                echo "Path does not exist or is not a directory\n\t" . $outfile . "\n";
                die;
            } else {
                if (!is_writeable($outfile)) {
                    echo "Path could not be written to.\n\t" . $outfile . "\n";
                    die;
                }
            }
            include 'qr/qrlib.php';
            # Generates a png QR code for each user to exist in the database
            for ($i = 0; $i < count($array); $i += 1) {
                QRcode::png($array[$i], join_paths($outfile, $filenames[$i] . ".png"));
            }
        }
    }
}
开发者ID:JC-ComputerScience,项目名称:StudentCheckInServer,代码行数:31,代码来源:student_cli.php

示例10: EL

            </ul>
            <form class="navbar-form navbar-right">
                <input type="text" class="form-control" placeholder="Search...">
            </form>
        </div>
    </div>
</nav>
<?php 
if (qwp_tmpl_has_sub_modules($MODULE[0])) {
    ?>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
            <?php 
    if (file_exists(join_paths($MODULE_ROOT, 'home.php'))) {
        ?>
                <li class="<?php 
        echo $PAGE ? '' : 'active';
        ?>
"><a href="<?php 
        echo qwp_uri_current_home();
        ?>
"><?php 
        EL('Dashboard');
        ?>
<span class="sr-only">(current)</span></a></li>
            <?php 
    }
    ?>
            <?php 
开发者ID:steem,项目名称:qwp,代码行数:31,代码来源:header.php

示例11: scandir

 * lms is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jorani.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * @copyright  Copyright (c) 2014 - 2015 Benjamin BALET
 */
//Utility script that converts PHP array i18n files to a POT file
//Include all translation files
$files = scandir('english/');
foreach ($files as $file) {
    if ($file != '.' && $file != '..' && $file != 'index.html') {
        $path = join_paths("english", $file);
        include $path;
    }
}
$strings = array();
//Array of unique strings
//File content
$messages = 'msgid ""' . PHP_EOL;
$messages .= 'msgstr ""' . PHP_EOL;
$messages .= '"Project-Id-Version: Jorani\\n"' . PHP_EOL;
$messages .= '"POT-Creation-Date: \\n"' . PHP_EOL;
$messages .= '"PO-Revision-Date: \\n"' . PHP_EOL;
$messages .= '"Last-Translator: \\n"' . PHP_EOL;
$messages .= '"Language-Team: Jorani <jorani@googlegroups.com>\\n"' . PHP_EOL;
$messages .= '"MIME-Version: 1.0\\n"' . PHP_EOL;
$messages .= '"Content-Type: text/plain; charset=UTF-8\\n"' . PHP_EOL;
开发者ID:bodun,项目名称:jorani,代码行数:31,代码来源:ci2pot.php

示例12: process_file_upload

function process_file_upload()
{
    global $UPLOAD_DIR;
    if (!is_dir($UPLOAD_DIR)) {
        mkdir($UPLOAD_DIR);
    }
    header('Content-Type: application/json');
    $protocol = empty($_SERVER['HTTPS']) ? 'http://' : 'https://';
    $ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
    $upload_name = randomish() . '.' . $ext;
    $upload_file = join_paths($UPLOAD_DIR, $upload_name);
    $public_url = $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "/?i=" . $upload_name;
    if (move_uploaded_file($_FILES['file']['tmp_name'], $upload_file)) {
        jecho(["public_url" => $public_url]);
    } else {
        jecho(['error' => "Unable to process file upload"]);
    }
}
开发者ID:csexton,项目名称:captured-php,代码行数:18,代码来源:captured.php

示例13: _test_join_paths

 private function _test_join_paths()
 {
     $this->_check_equal('/a/b/c/d/', join_paths('/a/', 'b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a/', 'b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a/', 'b/././c/d'));
     $this->_check_equal('/a/b/c/d/', join_paths('/a', 'b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a', 'b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a', 'b/././c/d'));
     $this->_check_equal('/a/b/c/d/', join_paths('/a', '/b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a', '/b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a', '/b/././c/d'));
     $this->_check_equal('/a/b/c/d/', join_paths('/a/', '/b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a/', '/b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a/', '/b/././c/d'));
     $this->_check_equal('/a/b/c/d/', join_paths('/a/b/c/', '../../b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a/b/c/', '../../b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a/b/c/', '../../b/././c/d'));
     $this->_check_equal('/a/b/c/d/', join_paths('/a/b/c', '../../b/././c/d/'));
     $this->_check_equal('a/b/c/d/', join_paths('a/b/c', '../../b/././c/d/'));
     $this->_check_equal('/a/b/c/d', join_paths('/a/b/c', '../../b/././c/d'));
 }
开发者ID:mvonballmo,项目名称:earthli-webcore,代码行数:21,代码来源:file_tests.php

示例14: array

    $paths = array();
    foreach (func_get_args() as $arg) {
        if ($arg !== '') {
            $paths[] = $arg;
        }
    }
    return preg_replace('#/+#', '/', join('/', $paths));
}
$source = filter_input(INPUT_GET, 'source');
$name = filter_input(INPUT_GET, 'name');
if (is_null($source)) {
    die('Missing "source".');
} else {
    if (is_null($name)) {
        die('Missing "name".');
    }
}
$path = join_paths($jsonObject->backend->file_store->directory, 'temp', $source);
if (!file_exists($path)) {
    die('File not found.');
}
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $name . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($path));
readfile($path);
unlink($path);
die;
开发者ID:Hjalmarinho,项目名称:thea,代码行数:31,代码来源:download.php

示例15: rename_files_with_suffix

function rename_files_with_suffix($src, $dst, $suffix)
{
    $files = scandir($src);
    foreach ($files as $file) {
        if (is_dot_dir($file) || !ends_with($file, $suffix)) {
            continue;
        }
        $src_file = join_paths($src, $file);
        if (file_exists($src_file)) {
            @rename($src_file, join_paths($dst, $file));
        }
    }
}
开发者ID:steem,项目名称:qwp,代码行数:13,代码来源:common.php


注:本文中的join_paths函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。