本文整理汇总了PHP中Auth_OpenID::ensureDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth_OpenID::ensureDir方法的具体用法?PHP Auth_OpenID::ensureDir怎么用?PHP Auth_OpenID::ensureDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Auth_OpenID
的用法示例。
在下文中一共展示了Auth_OpenID::ensureDir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setup
/**
* Make sure that the directories in which we store our data
* exist.
*
* @access private
*/
function _setup()
{
return Auth_OpenID::ensureDir($this->nonce_dir) && Auth_OpenID::ensureDir($this->association_dir) && Auth_OpenID::ensureDir($this->temp_dir);
}
示例2: ensureDir
/**
* Create dir_name as a directory if it does not exist. If it
* exists, make sure that it is, in fact, a directory. Returns
* true if the operation succeeded; false if not.
*
* @access private
*/
function ensureDir($dir_name)
{
if (is_dir($dir_name) || @mkdir($dir_name)) {
return true;
} else {
if (Auth_OpenID::ensureDir(dirname($dir_name))) {
return is_dir($dir_name) || @mkdir($dir_name);
} else {
return false;
}
}
}
示例3: ensureDir
/**
* Create dir_name as a directory if it does not exist. If it
* exists, make sure that it is, in fact, a directory. Returns
* true if the operation succeeded; false if not.
*
* @access private
*/
static function ensureDir($dir_name)
{
if (is_dir($dir_name) || @mkdir($dir_name)) {
return true;
} else {
$parent_dir = dirname($dir_name);
// Terminal case; there is no parent directory to create.
if ($parent_dir == $dir_name) {
return true;
}
return Auth_OpenID::ensureDir($parent_dir) && @mkdir($dir_name);
}
}
示例4: ensureDir
/**
* Create dir_name as a directory if it does not exist. If it
* exists, make sure that it is, in fact, a directory. Returns
* true if the operation succeeded; false if not.
*
* @access private
*/
function ensureDir($dir_name)
{
if (is_dir($dir_name)) {
return true;
}
error_log("Making {$dir_name}");
if (@mkdir($dir_name)) {
return true;
}
error_log("Failed!");
$parent_dir = dirname($dir_name);
// Terminal case; there is no parent directory to create.
if ($parent_dir == $dir_name) {
return true;
}
return Auth_OpenID::ensureDir($parent_dir) && @mkdir($dir_name);
}