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