1. Go to this page and download the library: Download ashleydawson/class-meta library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ashleydawson / class-meta example snippets
namespace Acme\Enum;
use AshleyDawson\ClassMeta\Annotation\Meta;
/**
* @Meta(data={"name"="Invoice Status Types"})
*/
class InvoiceStatus
{
/**
* @Meta(data={"name"="Draft", "description"="Invoice has not yet been sent to the customer"})
*/
const DRAFT = 'draft';
/**
* @Meta(data={"name"="Sent", "description"="Invoice has been sent to the customer"})
*/
const SENT = 'sent';
/**
* @Meta(data={"name"="Paid", "description"="Invoice has been paid by the customer"})
*/
const PAID = 'paid';
/**
* @Meta(data={"name"="Void", "description"="Invoice is void and no longer billable"})
*/
const VOID = 'void';
}
use AshleyDawson\ClassMeta\ClassMetaManager;
use AshleyDawson\ClassMeta\Annotation\Meta;
$manager = new ClassMetaManager();
$classMeta = $manager->getClassMeta('Acme\Enum\InvoiceStatus');
// "Invoice Status Types" will be echoed
echo $classMeta->data['name'];
use Doctrine\Common\Cache\FilesystemCache;
$manager = new ClassMetaManager();
$manager->setCache(new FilesystemCache('/path/to/cache/dir'));
use Doctrine\Common\Cache\FilesystemCache;
$manager = new ClassMetaManager();
$manager->setCache(new FilesystemCache('/path/to/cache/dir'), 300); // Cache stale after 5 minutes
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.