Example #1
0
/**
 * Get a session for this implementation.
 * @param config The configuration that is passed to getRepository
 * @param credentials The credentials to log into the repository. If omitted, $config['user'] and $config['pass'] is used with getSimpleCredentials
 * @return A session resulting from logging into the repository found at the $config path
 */
function getJCRSession($config, $credentials = null)
{
    $repository = getRepository($config);
    if (isset($config['pass']) || isset($credentials)) {
        if (empty($config['workspace'])) {
            $config['workspace'] = null;
        }
        if (empty($credentials)) {
            $credentials = getSimpleCredentials($config['user'], $config['pass']);
        }
        return $repository->login($credentials, $config['workspace']);
    } elseif (isset($config['workspace'])) {
        return $repository->login(null, $config['workspace']);
    } else {
        return $repository->login(null, null);
    }
}
Example #2
0
/**
 * Get a session for this implementation.
 * @param config The configuration that is passed to getRepository
 * @param credentials The credentials to log into the repository. If omitted, $config['user'] and $config['pass'] is used with getSimpleCredentials
 * @return A session resulting from logging into the repository found at the $config path
 */
function getJCRSession($config, $credentials = null)
{
    $repository = getRepository($config);
    if (isset($config['pass']) || isset($credentials)) {
        if (empty($config['workspace'])) {
            $config['workspace'] = null;
        }
        if (empty($credentials)) {
            $credentials = getSimpleCredentials($config['user'], $config['pass']);
        }
        return $repository->login($credentials, $config['workspace']);
    } elseif (isset($config['workspace'])) {
        throw new \PHPCR\RepositoryException(jackalope_baseCase::NOTSUPPORTEDLOGIN);
        //return $repository->login(null, $config['workspace']);
    } else {
        throw new \PHPCR\RepositoryException(jackalope_baseCase::NOTSUPPORTEDLOGIN);
        //return $repository->login(null, null);
    }
}
Example #3
0
echo "git repository changed, it need a pull\n";
$Name = $argv[1];
echo $Name . "\n";
$RepoUrl = "https://github.com/maplefu0602/" . $Name . ".git";
$Dir = $Name;
function gitClone($url, $name)
{
    $cmd = "git clone " . $url . " " . $name;
    echo $cmd . "\n";
    echo shell_exec($cmd . " 2>&1; echo \$?\n");
}
function gitPull($name)
{
    $cmd = "git --git-dir=" . $name . "/.git checkout && git --git-dir=" . $name . "/.git pull";
    echo shell_exec($cmd . " 2>&1;echo \$?\n");
}
//echo shell_exec("ls -l 2>&1; echo $?");
function getRepository($RepoUrl, $Dir)
{
    if (file_exists($Dir)) {
        echo "Folder " . $Dir . " exists, need git pull.\n";
        gitPull($Dir);
    } else {
        echo "Folder " . $Dir . "is not there, need git clone.\n";
        gitClone($RepoUrl, $Dir);
    }
}
getRepository($RepoUrl, $Dir);
?>

Example #4
0
 /**
  * De record verwijderen.
  *
  * @throws Exception on failure
  *
  * @return Json
  */
 private function delete()
 {
     $repo = getRepository($this->repository);
     $repo->delete($this->model, $_POST[$this->primaryKey]);
     //throw new Exception('Verwijderen van '.$this->subject.' #'.$_POST[$this->primarykey].' is mislukt');
     return Json::success();
 }
Example #5
0
 public function testAction()
 {
     $repository = $this->getDoctrine()->getManager() - getRepository(OCPlatformBundle::Advert);
     $listAdvert = $repository->myFindAll();
 }
Example #6
0
<?php

include 'parser.php';
include 'repository.php';
?>

<html>
	<head>
		<?php 
title();
?>
		<!--<meta charset='utf-8'/>-->
		<link rel="stylesheet" type="text/css" href="css/style.css">
		<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
		<script type="text/javascript" src="js/javascript.js"></script>
	</head>
	<body>
		<div class='title'>Live Editor</div>
		<div class='repository'><?php 
getRepository();
?>
</div>
		<textarea class="edit"></textarea>
		<button type='submit'>Cancel</button>
		<button type='submit'>Save</button>
	</body>
</html>
Example #7
0
/**
 * getGuthubData
 * retrieve data through github API
 */
function getData($params)
{
    $response = array();
    // repository
    $response['repository'] = getRepository($params['user'], $params['repo']);
    // contributors
    $response['contributors'] = getContributors($params['user'], $params['repo']);
    // issues
    // $response['issues'] = getIssues($params['user'], $params['repo'], array());
    return json_encode($response);
}