本文整理匯總了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);
}