-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
215 changed files
with
3,738 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"require-dev": { | ||
"phpunit/phpunit": "7" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
/** | ||
* PureMVC PHP Basic Demo | ||
* PureMVC Port to PHP originally translated by Asbjørn Sloth Tønnesen | ||
* | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
|
||
use puremvc\php\multicore\demos\basic; | ||
|
||
require __DIR__ . '/puremvc_autoloader.php'; | ||
|
||
// name of file user browsed to | ||
$filename = $_SERVER[ 'PHP_SELF' ]; | ||
|
||
// css file name from css zen garden styles click | ||
if (isset( $_GET['c'] )) | ||
{ | ||
$cssName = $_GET['c']; | ||
} | ||
else | ||
{ | ||
$cssName = 'default'; | ||
} | ||
|
||
function html_debug( $stack ) | ||
{ | ||
print( $stack . '<br/>' ); | ||
} | ||
|
||
// start php application | ||
$basicDemo = new basic\BasicDemo(); | ||
// start up the view by sending in the variables. | ||
$basicDemo->startView( $filename, $cssName ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
/** | ||
* PureMVC PHP Class Autoloader | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Class auto-loader for use with the PureMVC Port for PHP. | ||
* | ||
* While it's usage is completely optional, usage will reduce | ||
* the amount of require(), require_once(), include() and include_once() | ||
* statements you would need to write. | ||
* | ||
* It also provides the benefit of allowing you to centralize the location of | ||
* your PureMVC framework to just one location. | ||
* | ||
* USAGE: | ||
* 1) Change the paths listed in the $_includePaths array to match your PureMVC PHP install paths. | ||
* 2) Add a require_once() statement to your index or bootstrap PHP file. | ||
* ie., require_once 'path/to/puremvc_autoloader.php'; | ||
*/ | ||
|
||
/** | ||
* Defines a constant that indicates that the base directory ("root") for lookups should be | ||
* the directory in which this file is located in. | ||
*/ | ||
//define( 'PMVC_BASE_DIR', __DIR__ ); | ||
|
||
/** | ||
* Checks all paths defined in $_includePaths for | ||
* the existence of $class and loads $class if found. | ||
* | ||
* @param string $class The class to search for. | ||
*/ | ||
|
||
|
||
/** | ||
* @see http://www.php-fig.org/psr/psr-4/examples/ | ||
*/ | ||
spl_autoload_register(function ($class) { | ||
// project-specific namespace prefix | ||
$prefix = 'puremvc\php\multicore\\'; | ||
|
||
// base directory for the namespace prefix | ||
$base_dir = __DIR__ . '/src/org/puremvc/php/multicore/'; | ||
|
||
// does the class use the namespace prefix? | ||
$len = strlen($prefix); | ||
|
||
if (0 !== strncmp($prefix, $class, $len)) { | ||
return; | ||
} | ||
|
||
// get the relative class name | ||
$relativeClass = substr($class, $len); | ||
|
||
// replace the namespace prefix with the base directory, replace namespace | ||
// separators with directory separators in the relative class name, append | ||
// with .php | ||
$file = $base_dir . str_replace('\\', '/', $relativeClass) . '.php'; | ||
|
||
// if the file exists, require it | ||
if (file_exists($file)) { | ||
require $file; | ||
} | ||
}); |
77 changes: 77 additions & 0 deletions
77
src/org/puremvc/php/multicore/demos/basic/ApplicationFacade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
namespace puremvc\php\multicore\demos\basic; | ||
use puremvc\php\multicore\interfaces\IFacade; | ||
use puremvc\php\multicore\patterns\facade\Facade; | ||
use puremvc\php\multicore\demos\basic\controller\commands\StartApplicationCommand; | ||
|
||
/** | ||
* PureMVC PHP Basic Demo | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
//require_once 'org/puremvc/php/patterns/facade/Facade.php'; | ||
|
||
// demo requires | ||
//require_once 'org/puremvc/php/demos/basic/controller/commands/StartApplicationCommand.php'; | ||
|
||
/** | ||
* ApplicationFacade for the BasicDemo starts the Model, View | ||
* Controller for the application. | ||
*/ | ||
class ApplicationFacade extends Facade | ||
{ | ||
/** | ||
* Notification constant that starts the application. | ||
*/ | ||
const START_APPLICATION = 'startApplication'; | ||
/** | ||
* Notification constant sent when view data is ready to be displayed. | ||
*/ | ||
const VIEW_DATA_READY = 'viewDataReady'; | ||
|
||
/** | ||
* <b>Facade</b> Multiton Factory method | ||
* | ||
* This <b>IFacade</b> implementation is a Multiton, | ||
* so you MUST not call the constructor | ||
* directly, but instead call this static Factory method, | ||
* passing the unique key for this instance | ||
* | ||
* @param string $key Unique key for this instance. | ||
* @return IFacade Instance for this key | ||
*/ | ||
public static function getInstance( $key ) | ||
{ | ||
if (!isset( self::$instanceMap[ $key ] ) ) | ||
{ | ||
self::$instanceMap[ $key ] = new ApplicationFacade( $key ); | ||
} | ||
return self::$instanceMap[ $key ]; | ||
} | ||
|
||
/** | ||
* Starts the application by sending a START_APPLICATION notification. | ||
* The filename (/index.php) is sent along to demonstrate passing | ||
* data along. | ||
* @param mixed $filename | ||
* @param mixed $cssName | ||
*/ | ||
public function startUp($filename, $cssName) | ||
{ | ||
$this->sendNotification(self::START_APPLICATION, $filename, $cssName); | ||
} | ||
|
||
/** | ||
* Initializes the controller and gives you an opportunity to register application | ||
* specific commands that extend SimpleCommand or MacroCommand with the PureMVC framework. | ||
*/ | ||
protected function initializeController() | ||
{ | ||
parent::initializeController(); | ||
$this->registerCommand(self::START_APPLICATION, StartApplicationCommand::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
namespace puremvc\php\multicore\demos\basic; | ||
use puremvc\php\multicore\demos\basic\ApplicationFacade; | ||
/** | ||
* PureMVC PHP Basic Demo | ||
* PureMVC Port to PHP originally translated by Asbjørn Sloth Tønnesen | ||
* | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
|
||
/** | ||
* PureMVC PHP Basic demo base class. The index starts an | ||
* instance of the BasicDemo object to start the application | ||
* view calling the <code>startView()</code> method. | ||
*/ | ||
class BasicDemo | ||
{ | ||
|
||
/** | ||
* Starts the PureMVC framework passing in variables | ||
* from the index.php | ||
* @param mixed $filename | ||
* @param mixed $cssName | ||
*/ | ||
public function startView($filename, $cssName) | ||
{ | ||
$facade = ApplicationFacade::getInstance( 'BasicDemo'); | ||
$facade->startUp($filename, $cssName); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/org/puremvc/php/multicore/demos/basic/controller/commands/StartApplicationCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
namespace puremvc\php\multicore\demos\basic\controller\commands; | ||
use puremvc\php\multicore\patterns\command\MacroCommand; | ||
use puremvc\php\multicore\patterns\facade\Facade; | ||
|
||
|
||
/** | ||
* PureMVC PHP Basic Demo | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
|
||
/** | ||
* The <code>StartApplicationCommand</code> prepares the view first | ||
* so that it is ready to display data when the model is done loading. | ||
*/ | ||
class StartApplicationCommand extends MacroCommand | ||
{ | ||
protected $facade; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->facade = Facade::getInstance('StartViewCommand'); | ||
|
||
} | ||
/** | ||
* The <code>initializeMacroCommand</code> is overridden to | ||
* add references to instances of SimpleCommand that should | ||
* be executed. | ||
*/ | ||
protected function initializeMacroCommand() | ||
{ | ||
$this->addSubCommand(StartViewCommand::class); | ||
$this->addSubCommand(StartModelCommand::class); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/org/puremvc/php/multicore/demos/basic/controller/commands/StartModelCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
namespace puremvc\php\multicore\demos\basic\controller\commands; | ||
use puremvc\php\multicore\demos\basic\model\proxy\ApplicationDataProxy; | ||
use puremvc\php\multicore\interfaces\INotification; | ||
use puremvc\php\multicore\patterns\command\SimpleCommand; | ||
use puremvc\php\multicore\patterns\facade\Facade; | ||
|
||
/** | ||
* PureMVC PHP Basic Demo | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
|
||
/** | ||
* Starts the application model, for the basic demo | ||
* this command loads the CSS file selected on the index.php page. | ||
*/ | ||
class StartModelCommand extends SimpleCommand | ||
{ | ||
protected $facade; | ||
|
||
public function __construct() | ||
{ | ||
$this->facade = Facade::getInstance('StartViewCommand'); | ||
} | ||
/** | ||
* Override execute to add logic. In the <code>StartModelCommand</code> | ||
* the ApplicationDataProxy is started and registered, and then | ||
* the selected CSS file is loaded. | ||
* @param INotification $notification | ||
*/ | ||
public function execute(INotification $notification) | ||
{ | ||
$view = $notification->getBody(); | ||
$cssFileName = $notification->getType(); | ||
|
||
$applicationDataProxy = new ApplicationDataProxy(); | ||
$this->facade->registerProxy($applicationDataProxy); | ||
|
||
$applicationDataProxy->loadCSS($cssFileName); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/org/puremvc/php/multicore/demos/basic/controller/commands/StartViewCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
namespace puremvc\php\multicore\demos\basic\controller\commands; | ||
use puremvc\php\multicore\interfaces\INotification; | ||
use puremvc\php\multicore\patterns\command\SimpleCommand; | ||
use puremvc\php\multicore\patterns\facade\Facade; | ||
use puremvc\php\multicore\demos\basic\view\ApplicationView; | ||
use puremvc\php\multicore\demos\basic\view\ApplicationMediator; | ||
/** | ||
* PureMVC PHP Basic Demo | ||
* @author Omar Gonzalez :: omar@almerblank.com | ||
* @author Hasan Otuome :: hasan@almerblank.com | ||
* | ||
* Created on Sep 24, 2008 | ||
* PureMVC - Copyright(c) 2006-2008 Futurescale, Inc., Some rights reserved. | ||
* Your reuse is governed by the Creative Commons Attribution 3.0 Unported License | ||
*/ | ||
|
||
/** | ||
* Starts the view class which initializes php/html templates. | ||
*/ | ||
class StartViewCommand extends SimpleCommand | ||
{ | ||
protected $facade; | ||
|
||
public function __construct() | ||
{ | ||
$this->facade = Facade::getInstance('StartViewCommand'); | ||
} | ||
/** | ||
* The <code>execute()</code> method is overridden in order | ||
* to add your application logic for this specific command. | ||
* @param INotification $notification | ||
*/ | ||
public function execute(INotification $notification) | ||
{ | ||
$view = $notification->getBody(); | ||
$this->facade->registerMediator(new ApplicationMediator(new ApplicationView($view))); | ||
} | ||
} |
Oops, something went wrong.