예제 #1
0
 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     $this->_outln("Removing links for vendor '{$vendor}' ...");
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // the base system dir
     $system = Solar::$system;
     // the links to remove (reverse order from make-vendor)
     $links = array("script/{$this->_dashes}", "include/Mock/{$this->_studly}", "include/Test/{$this->_studly}", "include/{$this->_studly}");
     // remove the links
     foreach ($links as $link) {
         $this->_out("    Removing '{$link}' ... ");
         $path = "{$system}/{$link}";
         if (Solar_File::exists($path)) {
             unlink($path);
             $this->_outln("done.");
         } else {
             $this->_outln("missing.");
         }
     }
     // done!
     $this->_outln("... done.");
     // reminders
     $this->_outln("Remember to remove '{$this->_studly}_App' from the " . "['Solar_Controller_Front']['classes'] element " . "in your config file.");
     $this->_outln("Remember to remove '{$this->_studly}_Model' from the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file.");
     // need to write a recursive-remove method for Solar_Dir that will
     // delete only the symlinked files (not the real files)
     $this->_outln("You will need to remove the " . "'docroot/public/{$this->_studly}' directory yourself, as it " . "may contain copies of public assets (not links).");
 }
예제 #2
0
 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR');
     }
     $this->_outln("Making links for vendor '{$vendor}' ...");
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     $links = array(array('dir' => "include", 'tgt' => $this->_studly, 'src' => "../source/{$this->_dashes}/{$this->_studly}"), array('dir' => "include/Test", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Test/{$this->_studly}"), array('dir' => "include/Mock", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Mock/{$this->_studly}"), array('dir' => "include/Fixture", 'tgt' => $this->_studly, 'src' => "../../source/{$this->_dashes}/tests/Fixture/{$this->_studly}"), array('dir' => "script", 'tgt' => $this->_dashes, 'src' => "../source/solar/script/solar"));
     $system = Solar::$system;
     foreach ($links as $link) {
         // $dir, $src, $tgt
         extract($link);
         // make it
         $this->_out("    Making link '{$dir}/{$tgt}' ... ");
         try {
             Solar_Symlink::make($src, $tgt, "{$system}/{$dir}");
             $this->_outln("done.");
         } catch (Exception $e) {
             $this->_out($e->getMessage());
             $this->_outln(" ... failed.");
         }
     }
     // done with this part
     $this->_outln("... done.");
     // make public links
     $link_public = Solar::factory('Solar_Cli_LinkPublic');
     $link_public->exec($vendor);
     // done for real
     $this->_outln("Remember to add '{$this->_studly}_App' to the " . "['Solar_Controller_Front']['classes'] element " . "in your config file so that it finds your apps.");
     $this->_outln("Remember to add '{$this->_studly}_Model' to the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file so that it finds your models.");
 }
예제 #3
0
 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // create dirs, files, and symlinks
     $this->_createDirs();
     $this->_createFiles();
     $this->_createLinks();
 }
예제 #4
0
 /**
  * 
  * Write out a series of dirs and symlinks for a new Vendor source.
  * 
  * @param string $vendor The Vendor name.
  * 
  * @return void
  * 
  */
 protected function _exec($vendor = null)
 {
     // we need a vendor name, at least
     if (!$vendor) {
         throw $this->_exception('ERR_NO_VENDOR_NAME');
     }
     // build "foo-bar" and "FooBar" versions of the vendor name.
     $this->_inflect = Solar_Registry::get('inflect');
     $this->_dashes = $this->_inflect->camelToDashes($vendor);
     $this->_studly = $this->_inflect->dashesToStudly($this->_dashes);
     // create dirs, files, and symlinks
     $this->_createDirs();
     $this->_createFiles();
     $this->_createLinks();
     // done!
     $this->_outln("Done!");
     $this->_outln("Remember to add '{$this->_studly}_App' to the " . "['Solar_Controller_Front']['classes'] element " . "in your config file so that it finds your apps.");
     $this->_outln("Remember to add '{$this->_studly}_Model' to the " . "['Solar_Sql_Model_Catalog']['classes'] element " . "in your config file so that it finds your models.");
 }