Example #1
0
 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));
 }
Example #2
0
 /**
  * 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);
 }
 /**
  * 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);
 }
 /**
  * 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;
 }
 /**
  *
  * @param string $code
  * @param \SplFileInfo $filename
  */
 protected function saveClass($code, \SplFileInfo $filename)
 {
     @mkdir($filename->getPath(), 0777, TRUE);
     return file_put_contents($filename->__toString(), $code);
 }