#!/bin/bash
if [ ! $1 ] || [ ! $2 ]; then
echo "Please enter a revision from, revision to, SVN repository, and target directory"
exit
fi
# set up nice names for the incoming parameters to make the script more readable
revision_from=$1
revision_to=$2
repository=$3
target_directory='export/r'${1}'-r'${2}
# the grep is needed so we only get added/modified files and not the deleted ones or anything else
# if it's a modified directory it's " M" so won't show with this command (good)
# if it's an added directory it's still "A" so will show with this command (not so good)
for line in `svn diff --summarize -r$revision_from:$revision_to $repository | grep "^[AM]"`
do
# each line in the above command in the for loop is split into two:
# 1) the status line (containing A, M, AM, D etc)
# 2) the full repository and filename string
# so only export the file when it's not the status line
if [ $line != "A" ] && [ $line != "AM" ] && [ $line != "M" ]; then
# use sed to remove the repository from the full repo and filename
filename=`echo "$line" |sed "s|$repository||g"`
# don't export if it's a directory we've already created
if [ ! -d $target_directory$filename ]; then
directory=`dirname $filename`
mkdir -p $target_directory$directory
svn export -r $revision_to $line $target_directory$filename
fi
fi
done
# to summarize any deleted files or directories at the end of the script uncomment the following line
#svn diff --summarize -r$revision_from:$revision_to $repository | grep "^[D]"
public function widget(){
global $wpdb;
echo $before_widget;
$sql = "SELECT post_title, post_content FROM wp_posts WHERE post_type='newspages' ORDER BY post_date DESC LIMIT 3";
$result = $wpdb->get_results($sql, ARRAY_A);
foreach($result as $news):
?>
<dl>
<dt>
<?php
echo $news['post_title'];
?>
</dt>
<dd>
<?php
echo $news['post_content'];
?>
</dd>
</dl>
<?php
endforeach;
echo $after_widget;
}
<?php
return array(
'view_manager' => array(
'template_path_stack' => array(
__DIR__.'/../view'
)
),
'router'=> array(
'routes'=>array(
'users'=>array(
'type' =>'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route'=>'/users',
'defaults'=> array(
'__NAMESPACE__'=> 'Users\Controller',
'controller'=>'Index',
'action'=>'index',
)
),
'may_terminate' => true,
'child_routes' => array(
// This route is a sane default when developing a module;
// as you solidify the routes for your module, however,
// you may want to remove it and replace it with more
// specific routes.
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
)
)
),
'controllers'=>array(
'invokables'=>array(
'Users\Controller\Index'=> 'Users\Controller\IndexController'
)
),
)
?>