Skip to content

#122 updated phpdoc #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ app/resource/cache
bin/phpcbf
bin/phpcs
bin/phpunit
build
vendor
.buildpath
.project
Expand Down
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ php:

before_script:
- composer install
- wget -nc -O ./phpDocumentor.phar http://www.phpdoc.org/phpDocumentor.phar
- chmod 755 ./phpDocumentor.phar
- wget -nc -O ./phpcs.phar --no-check-certificate https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
- chmod 755 ./phpcs.phar
- phpenv rehash

matrix:
allow_failures:
- php: 5.6

script:
- bin/phpcs
- php ./phpcs.phar
- php ./phpDocumentor.phar -f phpdoc.dist.xml
117 changes: 85 additions & 32 deletions app/config/Routes.php
Original file line number Diff line number Diff line change
@@ -1,45 +1,98 @@
<?php

/**
* VisualPHPUnit
*
* VisualPHPUnit is a visual front-end for PHPUnit.
*
* PHP Version 5.3<
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
* @copyright 2011-2015 VisualPHPUnit
* @license http://opensource.org/licenses/BSD-3-Clause The BSD License
* @link https://github.com/VisualPHPUnit/VisualPHPUnit VisualPHPUnit
*/
namespace app\config;

/**
* Routes
*
* Routing class for http requests
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
*/
class Routes
{

/**
* Gret routes
*
* @return array
*/
public static function getRoutes()
{
return array(
array(array('get', 'post'), '/', function ($request) {
$controller = new \app\controller\Home();
return $controller->call('index', $request);
}),

array('get', '/archives', function ($request) {
$controller = new \app\controller\Archives();
return $controller->call('index', $request);
}),

array(array('get', 'post'), '/graphs', function ($request) {
$controller = new \app\controller\Graph();
return $controller->call('index', $request);
}),

array('get', '/file-list', function ($request) {
$controller = new \app\controller\FileList();
return $controller->call('index', $request);
}),

array('get', '/help', function ($request) {
$controller = new \app\controller\Home();
return $controller->call('help', $request);
}),

array(
array(
'get',
'post'
),
'/',
function ($request) {
$controller = new \app\controller\Home();
return $controller->call('index', $request);
}
),

array(
'get',
'/archives',
function ($request) {
$controller = new \app\controller\Archives();
return $controller->call('index', $request);
}
),

array(
array(
'get',
'post'
),
'/graphs',
function ($request) {
$controller = new \app\controller\Graph();
return $controller->call('index', $request);
}
),

array(
'get',
'/file-list',
function ($request) {
$controller = new \app\controller\FileList();
return $controller->call('index', $request);
}
),

array(
'get',
'/help',
function ($request) {
$controller = new \app\controller\Home();
return $controller->call('help', $request);
}
),

// 404
array('get', '*', function ($request) {
return array(
'status' => 404,
'body' => '<h1>Not Found</h1>'
);
})
array(
'get',
'*',
function ($request) {
return array(
'status' => 404,
'body' => '<h1>Not Found</h1>'
);
}
)
);
}
}
13 changes: 12 additions & 1 deletion app/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?php

/**
* VisualPHPUnit
*
* VisualPHPUnit is a visual front-end for PHPUnit.
*
* PHP Version 5.3<
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
* @copyright 2011-2015 VisualPHPUnit
* @license http://opensource.org/licenses/BSD-3-Clause The BSD License
* @link https://github.com/VisualPHPUnit/VisualPHPUnit VisualPHPUnit
*/
$root = dirname(dirname(__DIR__));

$config = array(
Expand Down
45 changes: 34 additions & 11 deletions app/controller/Archives.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
<?php

/**
* VisualPHPUnit
*
* VisualPHPUnit is a visual front-end for PHPUnit.
*
* PHP Version 5.3<
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
* @copyright 2011-2015 VisualPHPUnit
* @license http://opensource.org/licenses/BSD-3-Clause The BSD License
* @link https://github.com/VisualPHPUnit/VisualPHPUnit VisualPHPUnit
*/
namespace app\controller;

/**
* Archives
*
* Class for managing archives
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
*/
class Archives extends \app\core\Controller
{

// GET
/**
* Index
*
* @param string $request
* The request to process
* @return array
*/
public function index($request)
{
$snapshot_directory = \app\lib\Library::retrieve('snapshot_directory');
if (!$request->is('ajax')) {
if (! $request->is('ajax')) {
$snapshots = array();
$handler = @opendir($snapshot_directory);
if (!$handler) {
if (! $handler) {
return compact('snapshots');
}
while (($file = readdir($handler)) !== false) {
Expand All @@ -24,16 +48,15 @@ public function index($request)
}
closedir($handler);
rsort($snapshots);

return compact('snapshots');
}

if (!isset($request->query['snapshot'])) {
if (! isset($request->query['snapshot'])) {
return '';
}

$file = realpath($snapshot_directory)
. "/{$request->query['snapshot']}";
return ( file_exists($file) ) ? file_get_contents($file) : '';

$file = realpath($snapshot_directory) . "/{$request->query['snapshot']}";
return (file_exists($file)) ? file_get_contents($file) : '';
}
}
69 changes: 47 additions & 22 deletions app/controller/FileList.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
<?php

/**
* VisualPHPUnit
*
* VisualPHPUnit is a visual front-end for PHPUnit.
*
* PHP Version 5.3<
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
* @copyright 2011-2015 VisualPHPUnit
* @license http://opensource.org/licenses/BSD-3-Clause The BSD License
* @link https://github.com/VisualPHPUnit/VisualPHPUnit VisualPHPUnit
*/
namespace app\controller;

/**
* FileList
*
* Class for managing file lists
*
* @author Nick Sinopoli <NSinopoli@gmail.com>
*/
class FileList extends \app\core\Controller
{

// GET

/**
* Index
*
* @param string $request
* The request to process
* @return array
*/
public function index($request)
{
if (!$request->is('ajax')) {
if (! $request->is('ajax')) {
return $this->redirect('/');
}

$dir = realpath(urldecode($request->query['dir']));
if (!$dir) {
if (! $dir) {
return array();
}

$test_directories = \app\lib\Library::retrieve('test_directories');
$valid_dir = false;
$group_name = '';
Expand All @@ -28,28 +52,26 @@ public function index($request)
}
}

//echo 'here';

if (!$valid_dir) {
// echo 'here';
if (! $valid_dir) {
return array();
}

$dir .= '/';
$files = scandir($dir);
// Don't return anything if 'files' are '.' or '..'
if (count($files) < 3) {
return array();
}

$ignore_hidden = \app\lib\Library::retrieve('ignore_hidden_folders');

$final_dirs = array();
$final_files = array();
foreach ($files as $file) {
$is_hidden = ( strpos($file, '.') === 0 );
if ($file != '.' && $file != '..'
&& (!$is_hidden || !$ignore_hidden)
) {
$is_hidden = (strpos($file, '.') === 0);
if ($file != '.' && $file != '..' && (! $is_hidden || ! $ignore_hidden)) {
$path = $dir . $file;
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
if (is_dir($path)) {
Expand All @@ -60,14 +82,17 @@ public function index($request)
);
} elseif (is_file($path) && $ext == 'php') {
$final_files[] = array(
'type' => 'file',
'name' => $file,
'path' => $path
'type' => 'file',
'name' => $file,
'path' => $path
);
}
}
}

return array('name' => $group_name, 'results' => array_merge($final_dirs, $final_files));

return array(
'name' => $group_name,
'results' => array_merge($final_dirs, $final_files)
);
}
}
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy