本文整理汇总了PHP中Common::isDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::isDir方法的具体用法?PHP Common::isDir怎么用?PHP Common::isDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::isDir方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createDir
public static function createDir($path)
{
if (true === Common::isDir($path)) {
return true;
}
return @mkdir($path, GWF_CHMOD, true);
}
示例2: createTempDir
private static function createTempDir()
{
if (Common::isDir(GWF_PATH . 'extra/temp/baim')) {
return '';
}
if (false === mkdir(GWF_PATH . 'extra/temp/baim', GWF_CHMOD)) {
return GWF_HTML::err('ERR_WRITE_FILE', array(GWF_PATH . 'extra/temp/baim'));
}
return '';
}
示例3: installDirs
private static function installDirs(Module_PageBuilder $module, $dropTable)
{
$path = GWF_WWW_PATH . 'dbimg/content';
$path = $module->getContentPath();
if (Common::isDir($path)) {
return '';
}
if (false === mkdir($path, GWF_CHMOD)) {
return GWF_HTML::err('ERR_WRITE_FILE', array($path));
}
// if (false === chmod($path, GWF_CHMOD))
// {
// return GWF_HTML::err('ERR_WRITE_FILE', array($path));
// }
return '';
}
示例4: initModulesDir
private static function initModulesDir($dir)
{
if (false === ($files = @scandir(DOG_PATH . 'dog_modules/' . $dir))) {
return Dog_Log::warn('Dog_Init::initModulesDir() - Directory not found: ' . (DOG_PATH . 'dog_modules/' . $dir));
}
foreach ($files as $filename) {
if ($filename[0] !== '.') {
$path = DOG_PATH . 'dog_modules/' . $dir . '/' . $filename;
if (Common::isDir($path)) {
$modf = $path . '/DOGMOD_' . $filename . '.php';
require_once $modf;
Dog_Module::createModule($path . '/', $filename);
}
}
}
}
示例5: loadLanguage
public function loadLanguage($path)
{
if ($this->lang === NULL) {
$mod = $this->getName();
# Check for branch first
$path2 = Common::substrFrom($path, 'lang/', $path);
# remove lang/ from beginning.
$branchfile = GWF_WWW_PATH . 'lang/module/' . $mod . '/' . $path2;
# Branchfile
if (Common::isDir(dirname($branchfile))) {
$path3 = $branchfile;
} else {
# No branch
$path3 = sprintf('%smodule/%s/%s', GWF_CORE_PATH, $mod, $path);
}
$this->lang = new GWF_LangTrans($path3);
}
return $this->lang;
}
示例6: initCityQuests
public static function initCityQuests()
{
foreach (self::$cities as $city) {
$city instanceof SR_City;
$fullpath = self::getShadowDir() . 'city/' . $city->getName() . '/quest';
if (Common::isDir($fullpath)) {
GWF_File::filewalker($fullpath, array($city, 'initQuests'));
}
}
}
示例7: includeTables
public function includeTables()
{
$path = $this->getTablePath();
if (Common::isDir($path)) {
foreach (scandir($path) as $entry) {
if (Common::endsWith($entry, '.php')) {
require_once $path . $entry;
}
}
}
}
示例8: getAllMethods
public static function getAllMethods(GWF_Module $module)
{
$back = array();
$name = $module->getName();
$path = GWF_CORE_PATH . "module/{$name}/method";
if (!Common::isDir($path)) {
return array();
}
if (false === ($dir = scandir($path))) {
GWF3::logDie('Cannot access ' . $path . ' in ' . __METHOD__ . ' line ' . __LINE__);
}
foreach ($dir as $file) {
# starts with .
if ($file[0] === '.' || false === Common::endsWith($file, '.php')) {
continue;
}
$path2 = $path . '/' . $file;
if (Common::isFile($path2)) {
if (false === ($method = $module->getMethod(substr($file, 0, -4)))) {
GWF3::logDie('NO METHOD for ' . $file);
}
$back[] = $method;
}
}
return $back;
}
示例9: tempnam
<?php
$dirname = $home . '/level/4';
if (!Common::isDir($dirname)) {
GWF_File::removeDir($dirname);
$dirname2 = "/root/kwd";
@mkdir($dirname2, 0700, true);
@chmod($dirname2, 0700);
@chown($dirname2, $username);
@chgrp($dirname2, $username);
@rename($dirname2, $dirname);
}
$filename = $home . '/level/4/README.txt';
if (!Common::isFile($filename)) {
$filename2 = tempnam("/tmp", "kwf");
@file_put_contents($filename2, "The solution to level 4 is 'AndIknowchown' without the quotes.\n");
@chmod($filename2, 00);
@chown($filename2, $username);
@chgrp($filename2, $username);
@rename($filename2, $filename);
}