Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webbasics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
webbasics
Commits
caa0fc0d
Commit
caa0fc0d
authored
Jul 14, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed project name to BasicWeb.
parent
18311e43
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
22 deletions
+21
-22
README.txt
README.txt
+5
-4
autoloader.php
autoloader.php
+2
-2
base.php
base.php
+5
-6
logger.php
logger.php
+2
-2
tests/test_autoloader.php
tests/test_autoloader.php
+2
-2
tests/test_base.php
tests/test_base.php
+4
-5
tests/test_logger.php
tests/test_logger.php
+1
-1
No files found.
README.txt
View file @
caa0fc0d
-------
-------
Summary
Summary
-------
-------
Minimalistic is a set of classes to create websites with. The core exists of
BasicWeb is a set of classes that provides the minimal functionalities of a
a class autoloader, a template parser, a logger and some array manipulation
website. The core exists of a class autoloader, a template parser, a logger
functions. No MVC 'model' implementation is included, there are already many
and some array manipulation functions. No MVC 'model' implementation is
of these out there (PHPActiveRecord is recommended).
included, there are already many of these out there (PHPActiveRecord is
recommended).
----------
----------
Unit tests
Unit tests
...
...
autoloader.php
View file @
caa0fc0d
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* @date 13-07-2012
* @date 13-07-2012
*/
*/
namespace
Minimalistic
;
namespace
BasicWeb
;
require_once
'base.php'
;
require_once
'base.php'
;
...
@@ -52,7 +52,7 @@ require_once 'base.php';
...
@@ -52,7 +52,7 @@ require_once 'base.php';
* $baz = new Baz(); // Throws an exception, since 'other_classes/baz.php' does not exist
* $baz = new Baz(); // Throws an exception, since 'other_classes/baz.php' does not exist
* </code>
* </code>
*
*
* @package
Minimalistic
* @package
BasicWeb
*/
*/
class
Autoloader
extends
Base
{
class
Autoloader
extends
Base
{
/**
/**
...
...
base.php
View file @
caa0fc0d
<?php
<?php
/**
/**
* Commonly used classes used in the
Minimalistic
package.
* Commonly used classes used in the
BasicWeb
package.
*
*
* @author Taddeus Kroes
* @author Taddeus Kroes
* @version 1.0
* @version 1.0
* @date 13-07-2012
* @date 13-07-2012
* @package Minimalistic
*/
*/
namespace
Minimalistic
;
namespace
BasicWeb
;
require_once
'logger.php'
;
require_once
'logger.php'
;
/**
/**
* Base class for instantiable classes in the
Minimalistic
package.
* Base class for instantiable classes in the
BasicWeb
package.
*
*
* The base class defines a static 'create' method that acts as a chainable
* The base class defines a static 'create' method that acts as a chainable
* shortcut for the class constructor.
* shortcut for the class constructor.
*
*
* @package
Minimalistic
* @package
BasicWeb
*/
*/
abstract
class
Base
{
abstract
class
Base
{
/**
/**
...
@@ -41,7 +40,7 @@ abstract class Base {
...
@@ -41,7 +40,7 @@ abstract class Base {
/**
/**
* Exception, thrown when a required file does not exist.
* Exception, thrown when a required file does not exist.
*
*
* @package
Minimalistic
* @package
BasicWeb
*/
*/
class
FileNotFoundError
extends
\RuntimeException
{
class
FileNotFoundError
extends
\RuntimeException
{
/**
/**
...
...
logger.php
View file @
caa0fc0d
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
* @date 13-07-2012
* @date 13-07-2012
*/
*/
namespace
Minimalistic
;
namespace
BasicWeb
;
/**
/**
* Logger class.
* Logger class.
*
*
* A Logger object provides five functions to process log messages.
* A Logger object provides five functions to process log messages.
*
*
* @package
Minimalistic
* @package
BasicWeb
*/
*/
class
Logger
{
class
Logger
{
const
CRITICAL
=
0
;
const
CRITICAL
=
0
;
...
...
tests/test_autoloader.php
View file @
caa0fc0d
<?php
<?php
require_once
'autoloader.php'
;
require_once
'autoloader.php'
;
use
Minimalistic
\Autoloader
;
use
BasicWeb
\Autoloader
;
define
(
'PATH'
,
'tests/_files/'
);
define
(
'PATH'
,
'tests/_files/'
);
...
@@ -49,7 +49,7 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase {
...
@@ -49,7 +49,7 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase {
/**
/**
* @depends test_create_path
* @depends test_create_path
* @expectedException
Minimalistic
\FileNotFoundError
* @expectedException
BasicWeb
\FileNotFoundError
* @expectedExceptionMessage File "tests/_files/foobar.php" does not exist.
* @expectedExceptionMessage File "tests/_files/foobar.php" does not exist.
*/
*/
function
test_load_class_not_found
()
{
function
test_load_class_not_found
()
{
...
...
tests/test_base.php
View file @
caa0fc0d
<?php
<?php
require_once
'base.php'
;
require_once
'base.php'
;
use
Minimalistic\asprintf
;
class
BaseExtension
extends
Minimalistic
\Base
{
class
BaseExtension
extends
BasicWeb
\Base
{
function
__construct
(
$foo
,
$bar
)
{
function
__construct
(
$foo
,
$bar
)
{
$this
->
foo
=
$foo
;
$this
->
foo
=
$foo
;
$this
->
bar
=
$bar
;
$this
->
bar
=
$bar
;
...
@@ -16,10 +15,10 @@ class BaseTest extends PHPUnit_Framework_TestCase {
...
@@ -16,10 +15,10 @@ class BaseTest extends PHPUnit_Framework_TestCase {
}
}
function
test_asprintf
()
{
function
test_asprintf
()
{
$this
->
assertEquals
(
Minimalistic
\asprintf
(
'%(foo) baz'
,
array
(
'foo'
=>
'bar'
)),
'bar baz'
);
$this
->
assertEquals
(
BasicWeb
\asprintf
(
'%(foo) baz'
,
array
(
'foo'
=>
'bar'
)),
'bar baz'
);
$this
->
assertEquals
(
Minimalistic
\asprintf
(
'%(foo) baz %(foo)'
,
$this
->
assertEquals
(
BasicWeb
\asprintf
(
'%(foo) baz %(foo)'
,
array
(
'foo'
=>
'bar'
)),
'bar baz bar'
);
array
(
'foo'
=>
'bar'
)),
'bar baz bar'
);
$this
->
assertEquals
(
Minimalistic
\asprintf
(
'%(bar) baz %(foo)'
,
$this
->
assertEquals
(
BasicWeb
\asprintf
(
'%(bar) baz %(foo)'
,
array
(
'foo'
=>
'bar'
,
'bar'
=>
'foobar'
)),
'foobar baz bar'
);
array
(
'foo'
=>
'bar'
,
'bar'
=>
'foobar'
)),
'foobar baz bar'
);
}
}
}
}
...
...
tests/test_logger.php
View file @
caa0fc0d
<?php
<?php
require_once
'logger.php'
;
require_once
'logger.php'
;
use
Minimalistic
\Logger
;
use
BasicWeb
\Logger
;
define
(
'NAME'
,
'Testlogger'
);
define
(
'NAME'
,
'Testlogger'
);
define
(
'FORMAT'
,
'%(level): %(message)'
);
define
(
'FORMAT'
,
'%(level): %(message)'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment