本文整理匯總了PHP中SplFileInfo::__toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP SplFileInfo::__toString方法的具體用法?PHP SplFileInfo::__toString怎麽用?PHP SplFileInfo::__toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SplFileInfo
的用法示例。
在下文中一共展示了SplFileInfo::__toString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: up
public function up()
{
require $this->fileInfo->__toString();
$migrationName = $this->getName();
$this->container->create($migrationName)->up();
$this->adapter->initialize();
$this->adapter->up($this->getId(), file_get_contents($this->fileInfo));
}
示例2: validateSetting
/**
* Validate directory
*
* Checks to see if file is directory and if permissions match expected
*
* @param SplFileInfo $file File to check
* @param array $badFiles current array of bad files to report
*
* @return array
* @access public
*/
public function validateSetting(SplFileInfo $file, array $badFiles)
{
if ($file->isDir()) {
$path = substr_replace($file->__toString(), '', 0, strlen(Mage::getBaseDir()) + 1);
if (Mage::helper('bronto_verify/permissionchecker')->accept($path)) {
$octalPerms = substr(sprintf('%o', $file->getPerms()), -$this->_permLen);
if ($octalPerms != $this->_permission) {
$badFiles[$path]['directory permission'] = $octalPerms;
}
}
}
return parent::validateSetting($file, $badFiles);
}
示例3: validateSetting
/**
* Validate Group
*
* Checks to see if file group setting matches expected
*
* @param SplFileInfo $file File to check
* @param array $badFiles current array of bad files to report
*
* @return array
* @access public
*/
public function validateSetting(SplFileInfo $file, array $badFiles)
{
if (!empty($this->_targetGroup)) {
// Account for name and/or gid
if (filter_var($this->_targetGroup, FILTER_VALIDATE_INT)) {
$actualGroup = $file->getGroup();
} else {
$group = posix_getgrgid($file->getGroup());
$actualGroup = $group['name'];
}
if ($actualGroup != $this->_targetGroup) {
$path = substr_replace($file->__toString(), '', 0, strlen(Mage::getBaseDir()) + 1);
$badFiles[$path]['group'] = $actualGroup;
}
}
return parent::validateSetting($file, $badFiles);
}
示例4: __toString
/**
* Get text string with the correct height="yyy" width="xxx" string that
* can be used directly in an IMG tag
*
* @return string
*/
public function __toString()
{
parent::__toString();
return $this->toString;
}
示例5: saveClass
/**
*
* @param string $code
* @param \SplFileInfo $filename
*/
protected function saveClass($code, \SplFileInfo $filename)
{
@mkdir($filename->getPath(), 0777, TRUE);
return file_put_contents($filename->__toString(), $code);
}