Skip to content

Commit

Permalink
Move vendor/Joomla to src/Joomla. Update necessary paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
dongilbert committed Mar 27, 2013
0 parents commit 4ba523a
Show file tree
Hide file tree
Showing 15 changed files with 1,938 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor/
composer.phar
composer.lock
phpunit.xml
340 changes: 340 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

97 changes: 97 additions & 0 deletions ProfilePoint.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php
/**
* Part of the Joomla Framework Profiler Package
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Profiler;

/**
* Implementation of ProfilePointInterface.
*
* @since 1.0
*/
class ProfilePoint implements ProfilePointInterface
{
/**
* The profile point name.
*
* @var string
*/
protected $name;

/**
* The elapsed time in seconds since
* the first point in the profiler it belongs to was marked.
*
* @var float
*/
protected $time;

/**
* The allocated amount of memory in bytes
* since the first point in the profiler it belongs to was marked.
*
* @var integer
*/
protected $memoryBytes;

/**
* Constructor.
*
* @param string $name The point name.
* @param float $time The time in seconds.
* @param integer $memoryBytes The allocated amount of memory in bytes
*/
public function __construct($name, $time = 0.0, $memoryBytes = 0)
{
$this->name = $name;
$this->time = (float) $time;
$this->memoryBytes = (int) $memoryBytes;
}

/**
* Get the name of this profile point.
*
* @return string The name of this profile point.
*/
public function getName()
{
return $this->name;
}

/**
* Get the elapsed time in seconds since the first
* point in the profiler it belongs to was marked.
*
* @return float The time in seconds.
*/
public function getTime()
{
return $this->time;
}

/**
* Get the allocated amount of memory in bytes
* since the first point in the profiler it belongs to was marked.
*
* @return integer The amount of allocated memory in B.
*/
public function getMemoryBytes()
{
return $this->memoryBytes;
}

/**
* Get the allocated amount of memory in mega bytes
* since the first point in the profiler it belongs to was marked.
*
* @return integer The amount of allocated memory in MB.
*/
public function getMemoryMegaBytes()
{
return $this->memoryBytes / 1048576;
}
}
51 changes: 51 additions & 0 deletions ProfilePointInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Part of the Joomla Framework Profiler Package
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/

namespace Joomla\Profiler;

/**
* Interface for profile points.
* A Profile point belongs to a ProfilerInterface and the values
* it holds (time and memory) are relative to the values
* of the first marked point in that profiler.
*
* @since 1.0
*/
interface ProfilePointInterface
{
/**
* Get the name of this profile point.
*
* @return string The name of this profile point.
*/
public function getName();

/**
* Get the elapsed time in seconds since the first
* point in the profiler it belongs to was marked.
*
* @return float The time in seconds.
*/
public function getTime();

/**
* Get the allocated amount of memory in bytes
* since the first point in the profiler it belongs to was marked.
*
* @return integer The amount of allocated memory in B.
*/
public function getMemoryBytes();

/**
* Get the allocated amount of memory in mega bytes
* since the first point in the profiler it belongs to was marked.
*
* @return integer The amount of allocated memory in MB.
*/
public function getMemoryMegaBytes();
}
Loading

0 comments on commit 4ba523a

Please sign in to comment.