developmentseed / featureserver Goto Github PK
View Code? Open in Web Editor NEWA simple feature server for Drupal.
A simple feature server for Drupal.
In write_package_info() - fserver.drush.inc, there is Unescaped ereg mask.
It is - '.info', but it should be rather '.info' , because now it matches to filesname like some_name_info.tpl.php or not_info_file.php
Hi. I have been using FServer with manually generated releases, but I cannot find how to have them be automatically built from git tags, although code to do this seems to be present in the sources, like FserverProject_git::create_package().
drush fserver-package looks like it should build releases, but it constantly says "up to date", and nothing happens. Any pointers ?
I modified the fserver.module file to add the url to the 'add new release' link. The code is: (this is the first function in fserver.module)
function fserver_link($type, $object, $teaser = FALSE) {
// Only allow releases to be added if packaging method is 0 => 'Manual'.
$links = array();
if ($type == 'node' && $object->type == 'fserver_project' && empty($object->field_fserver_method[0]['value'])) {
$item = menu_get_item('node/add/fserver-release');
if ($item && $item['access']) {
$links['fserver-add-release'] = array(
'title' => t('Add new @Release', array('@Release' => strtolower($item['title']))),
'href' => 'node/add/fserver-release/' . $object->nid,
);
}
}
return $links;
}
Notice /' . $object->nid,
The object->nid is what I added.
I couldn't find out why my installation of feature server was not working until I noticed a little message left by Drupal "file featurex-6.x-1.0.tar.gz has been renamed to featurex-6.x-1.0._tar.gz" ... or something along those lines.
I have subsequently had to add the following line to my settings.php file to make it work:
$conf['allow_insecure_uploads'] = TRUE;
I followed the guide on this website to setup my feature server: http://developmentseed.org/blog/2009/sep/03/5-minute-feature-server with some slight changes to the drush make file.
I see it as a flaw/bug in the setup if by default drupal won't let you upload tar files, I hear that you can update the allow_insecure_uploads configuration in the database during a module install so would it not make sense to do that when you install fserver? otherwise it should be made clear in the admin area that releases are disabled until you change this value.
Hello,
as far I see the feature server and pear channel having very close aim, but however the PEAR and it's channel server a bit more famous in php world(at least for me, because used it even before drupal) and have a some successful integration examples in others projects like Symfony or Magento I am curious is it were on radar when development of feature server began and why it's were not chosen?
I might be wrong, but would like to hear something back if it's so :)
Thank you!
Guess there is nothing more to explain. That is a regext, so will match
somfile_info_fo_bar.tpl.php
what it should not do. (writing down the package infos in some tpl files then .. )
git diff --no-color
diff --git a/fserver.drush.inc b/fserver.drush.inc
index a9d4f85..8c66322 100644
--- a/fserver.drush.inc
+++ b/fserver.drush.inc
@@ -273,7 +273,7 @@ class FserverProject {
$packaging[] = "version = "{$tag['version']}"";
$packaging = "\n" . implode("\n", $packaging);
$files = file_scan_directory($this->backend->path, '.info', $exclude_mask);
$files = file_scan_directory($this->backend->path, '.info$', $exclude_mask);
This is because drush_shell_exec()
parses the arguments through sprintf. So when sprintf
encounters %20 in the command string, it looks for the 20th argument which is obviously not there ;-).
Also see the drush api documenation on http://drupalcontrib.org/api/drupal/contributions--drush--includes--exec.inc/function/drush_shell_exec/7 which documents the parameter $cmd
.
I submitted a pull-request which solves this: #15.
Currently FServer causes the main project page and the associated "all releases" page to have an identical title, which gets reported in Google webmasters tools.
A possible quick fix is to modify the head title when the page template is the one for releases, indicating that this is the releases page:
/** * Implements hook_preprocess_page(). */ function fserver_preprocess_page(&$vars) { if (in_array('page-node-releases', $vars['template_files'])) { list($title, $site) = explode(' | ', $vars['head_title']); $vars['head_title'] = t('@title: All releases | @site', array( '@title' => $title, '@site' => $site, )); } }
Upon testing a feature server, I expected admin/build/features to also check for updates against the feature server. Considering it displays "checking..." and takes a decent amount of time to run through all of your enabled features, this doesn't seem like an unrealistic expectation.
I'd recommend either some simple documentation to say that updates to features are shown on admin/reports/updates or actually working on showing the available updates within the admin/build/features interface. The second approach seems to make the most sense as features would then be checking the validity of the code against the database and against the feature server.. the user experience for features would then be centralized around admin/build/features.
After navigating to a project and then clicking to add a new release (on path node/add/fserver-release), it would be neat if the field_fserver_project field defaulted to the current project (i.e the project one was on when clicking "add new release" and the one defined by the URL ).
A couple of times I didn't check this field and took a moment to realise why my release had been applied to a different project: namely, the alpabetically-first project on my feature server, because it was the default choice in the combobox field.
I don't really know if this is possible to change with CCK (weighting a field based on some argument / condition such as what referer or something) - it'd just be a neat usability thing to know the Release you're making is by default going to apply to the project you were viewing when you clicked 'Add new release'.
Cheers :)
Maybe I've completely overlooked something, but feature server projects can't be pulled via the initial feed update, when using update_feed_api. When implementing the update_feed class this module looks for "http://example.com/fserver/project-list/all" to update its database tables with the complete release history of each feature on a server. The view shipped with fserver is only listening to the module_name and build arguments, so submitting "project-list/all" doesn't return the need complete xml list of projects.
I've created a view listing the complete XML of the feature server at "fserver/project-list/all". this seemed to be the logical way for me. Please correct me if I am wrong.
Here's the export of my view:
$view = new view; $view->name = 'fserver_updates_project_list'; $view->description = 'Feature Server > Update feed all Projects list'; $view->tag = 'fserver'; $view->view_php = ''; $view->base_table = 'node'; $view->is_cacheable = FALSE; $view->api_version = 2; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->override_option('relationships', array( 'field_fserver_project_nid' => array( 'label' => 'Project', 'required' => 1, 'delta' => -1, 'id' => 'field_fserver_project_nid', 'table' => 'node_data_field_fserver_project', 'field' => 'field_fserver_project_nid', 'relationship' => 'none', ), 'field_fserver_file_fid' => array( 'label' => 'Package', 'required' => 1, 'delta' => -1, 'id' => 'field_fserver_file_fid', 'table' => 'node_data_field_fserver_file', 'field' => 'field_fserver_file_fid', 'relationship' => 'none', ), )); $handler->override_option('fields', array( 'field_fserver_api_value' => array( 'label' => 'API version', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'custom', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_api_value', 'table' => 'node_data_field_fserver_api', 'field' => 'field_fserver_api_value', 'relationship' => 'none', ), 'field_fserver_versionextra_value' => array( 'label' => 'Extra version', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_versionextra_value', 'table' => 'node_data_field_fserver_versionextra', 'field' => 'field_fserver_versionextra_value', 'relationship' => 'none', ), 'field_fserver_versionmajor_value' => array( 'label' => 'Major version', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_versionmajor_value', 'table' => 'node_data_field_fserver_versionmajor', 'field' => 'field_fserver_versionmajor_value', 'relationship' => 'none', ), 'field_fserver_versionpatch_value' => array( 'label' => 'Patch version', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_versionpatch_value', 'table' => 'node_data_field_fserver_versionpatch', 'field' => 'field_fserver_versionpatch_value', 'relationship' => 'none', ), 'created' => array( 'label' => 'Post date', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'date_format' => 'custom', 'custom_date_format' => 'U', 'exclude' => 0, 'id' => 'created', 'table' => 'node', 'field' => 'created', 'relationship' => 'none', ), 'title' => array( 'label' => 'Project title', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'exclude' => 0, 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'field_fserver_project_nid', ), 'field_fserver_name_value' => array( 'label' => 'Project name', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_name_value', 'table' => 'node_data_field_fserver_name', 'field' => 'field_fserver_name_value', 'relationship' => 'field_fserver_project_nid', ), 'nid' => array( 'label' => 'Project URL', 'alter' => array( 'alter_text' => 1, 'text' => 'node/[nid]', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'exclude' => 0, 'id' => 'nid', 'table' => 'node', 'field' => 'nid', 'relationship' => 'field_fserver_project_nid', ), 'filepath' => array( 'label' => 'File path', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_file' => 0, 'exclude' => 0, 'id' => 'filepath', 'table' => 'files', 'field' => 'filepath', 'relationship' => 'field_fserver_file_fid', ), 'filesize' => array( 'label' => 'Filesize', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'file_size_display' => 'bytes', 'exclude' => 0, 'id' => 'filesize', 'table' => 'files', 'field' => 'filesize', 'relationship' => 'field_fserver_file_fid', ), 'nid_1' => array( 'label' => 'Release URL', 'alter' => array( 'alter_text' => 1, 'text' => 'node/[nid_1]', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'exclude' => 0, 'id' => 'nid_1', 'table' => 'node', 'field' => 'nid', 'relationship' => 'none', ), 'mdhash' => array( 'label' => 'MD5 hash', 'alter' => array( 'alter_text' => FALSE, 'text' => '', 'make_link' => FALSE, 'path' => '', 'alt' => '', 'link_class' => '', 'prefix' => '', 'suffix' => '', 'trim' => FALSE, 'max_length' => '', 'word_boundary' => TRUE, 'ellipsis' => TRUE, 'strip_tags' => FALSE, 'html' => FALSE, ), 'exclude' => 0, 'id' => 'mdhash', 'table' => 'files', 'field' => 'mdhash', 'relationship' => 'field_fserver_file_fid', ), 'field_fserver_security_value' => array( 'label' => 'Security release', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_security_value', 'table' => 'node_data_field_fserver_security', 'field' => 'field_fserver_security_value', 'relationship' => 'none', ), 'field_fserver_recommended_value' => array( 'label' => 'Recommended', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'default', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_recommended_value', 'table' => 'node_data_field_fserver_recommended', 'field' => 'field_fserver_recommended_value', 'relationship' => 'none', ), 'field_fserver_type_value' => array( 'label' => 'Type', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'plain', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_type_value', 'table' => 'node_data_field_fserver_type', 'field' => 'field_fserver_type_value', 'relationship' => 'field_fserver_project_nid', ), 'field_fserver_redirect_value' => array( 'label' => 'Type', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 0, 'label_type' => 'widget', 'format' => 'plain', 'multiple' => array( 'group' => TRUE, 'multiple_number' => '', 'multiple_from' => '', 'multiple_reversed' => FALSE, ), 'exclude' => 0, 'id' => 'field_fserver_redirect_value', 'table' => 'node_data_field_fserver_redirect', 'field' => 'field_fserver_redirect_value', 'relationship' => 'field_fserver_project_nid', ), )); $handler->override_option('sorts', array( 'release_tag' => array( 'order' => 'DESC', 'id' => 'release_tag', 'table' => 'views', 'field' => 'release_tag', 'relationship' => 'none', ), 'status' => array( 'order' => 'DESC', 'id' => 'status', 'table' => 'node', 'field' => 'status', 'override' => array( 'button' => 'Override', ), 'relationship' => 'none', ), )); $handler->override_option('filters', array( 'status' => array( 'operator' => '=', 'value' => '1', 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'status', 'table' => 'node', 'field' => 'status', 'relationship' => 'none', ), 'type' => array( 'operator' => 'in', 'value' => array( 'fserver_release' => 'fserver_release', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('items_per_page', 0); $handler->override_option('style_options', array( 'grouping' => '', )); $handler = $view->new_display('feed', 'Update XML feed', 'feed_1'); $handler->override_option('style_plugin', 'updatexml'); $handler->override_option('style_options', array( 'mission_description' => FALSE, 'description' => '', 'project' => array( 'title' => 'title', 'short_name' => 'field_fserver_name_value', 'api_version' => 'field_fserver_api_value', 'link' => 'nid', 'type' => 'field_fserver_type_value', 'redirect' => 'field_fserver_redirect_value', ), 'release' => array( 'version_major' => 'field_fserver_versionmajor_value', 'version_patch' => 'field_fserver_versionpatch_value', 'version_extra' => 'field_fserver_versionextra_value', 'release_link' => 'nid_1', 'download_link' => 'filepath', 'date' => 'created', 'mdhash' => 'mdhash', 'filesize' => 'filesize', 'security' => 'field_fserver_security_value', 'recommended' => 'field_fserver_recommended_value', ), )); $handler->override_option('row_plugin', ''); $handler->override_option('path', 'fserver/project-list/all'); $handler->override_option('menu', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, 'name' => 'navigation', )); $handler->override_option('displays', array()); $handler->override_option('sitename_title', FALSE);
Just wondering if there is any reason why there does not exist a 'feature' project type.
Realizing they are practically the same as modules, it still seems good to have this logical separation. Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.