Exemplo n.º 1
0
 /**
  * Returns the path of wp-cli within the project.
  * @return string
  */
 protected function getWpCliPath()
 {
     $filename = sprintf("%sbin/wp", Strata::getVendorPath());
     if (!is_executable($filename) && !chmod($filename, 755)) {
         $this->output->writeLn(sprintf("Could not grant execute permissions to %s. Command will fail.", $filename));
     }
     return $filename;
 }
Exemplo n.º 2
0
 /**
  * Returns the path to where phpunit's bootstrap file should be.
  * @return string
  */
 protected function getBootstrapFile()
 {
     $path = array(Strata::getVendorPath(), 'strata-mvc', 'strata', 'src', 'Scripts', 'test_runner.php');
     return implode(DIRECTORY_SEPARATOR, $path);
 }
 /**
  * Generates the API documentation contents
  * @return null
  */
 protected function generateAPI()
 {
     $srcPath = Strata::getSRCPath();
     $vendorPath = Strata::getVendorPath();
     $tmpPath = Strata::getTmpPath();
     $this->output->writeLn("<info>Generating API</info>");
     $this->output->writeLn($this->tree(true) . "Scanning {$srcPath}");
     $this->nl();
     if (!file_exists($tmpPath . "phploc.xml")) {
         touch($tmpPath . "phploc.xml");
     }
     if (!file_exists($tmpPath . "phpcs.xml")) {
         touch($tmpPath . "phpcs.xml");
     }
     system(sprintf("%sbin/phploc  --log-xml %sphploc.xml test", $vendorPath, $tmpPath));
     system(sprintf("%sbin/phpcs src --standard=PSR2 --report-xml=%sphpcs.xml", $vendorPath, $tmpPath));
     system(sprintf("%sbin/phpdox", $vendorPath));
 }
Exemplo n.º 4
0
 /**
  * Extracts gettext string from predefined areas within the project.
  * @return Translation
  */
 private function extractGettextStrings()
 {
     $translation = null;
     $translationObjects = array();
     $lookupDirectories = array(Strata::getVendorPath() . 'strata-mvc' . DIRECTORY_SEPARATOR . 'strata' . DIRECTORY_SEPARATOR . 'src', Strata::getSrcPath(), Strata::getThemesPath());
     foreach ($lookupDirectories as $directory) {
         $translationObjects = $this->recurseThroughDirectory($directory);
         // Merge all translation objects into a bigger one
         foreach ($translationObjects as $t) {
             if (is_null($translation)) {
                 $translation = $t;
             } else {
                 $translation->mergeWith($t);
             }
         }
     }
     return $translation;
 }
Exemplo n.º 5
0
 /**
  * Includes Composer's generator autoloader from the vendor
  * directory
  * @return boolean
  */
 public static function requireVendorAutoload()
 {
     return include Strata::getVendorPath() . 'autoload.php';
 }