Skip to content

Instantly share code, notes, and snippets.

@jburns131
jburns131 / gist:5962739
Last active December 19, 2015 13:29
$plugins array description and usage examples
<?php
/**
* Plugin array structure
*
* Goals:
* To define routes so we can facilitate 'Clean URLS' and future development
* To define permissions
* To allow plugins to override/add to other core, provider (3rd Pary) and custom plugins, without touching their core code
* Note: Template overrides are separate from Plugin overrides and will be applied in
* the Template system using the directory structure
@jburns131
jburns131 / gist:6170813
Last active December 20, 2015 17:48
Navigation Links Example
<div id="navigation">
<div class="center_wrapper">
<ul>
<li class="current_page_item">
<a href="http://localhost/AllianceCMS">Home</a>
</li>
<li>
<a href="http://localhost/AllianceCMS/hello/hey">Ciao Folks</a>
</li>
<li>
@jburns131
jburns131 / gist:6202734
Created August 11, 2013 00:03
chmod folder
<?php
file_put_contents($dbConnFile, $data);
$currentOS = strtoupper(substr(PHP_OS, 0, 3));
if ($currentOS != 'WIN') {
chmod(DBCONNFILE, 0644);
}
@jburns131
jburns131 / gist:6216881
Last active December 20, 2015 23:59
My understanding of the public interface of phprbac...
  • Base Methods

    • jf::$RBAC->Assign($Role, $Permission)

    • jf::$RBAC->Check($Permission, $UserID)

    • jf::$RBAC->Enforce($Permission)

    • jf::$RBAC->Reset($Ensure=false)

@jburns131
jburns131 / gist:6217218
Created August 13, 2013 02:11
Proposed Interface for phprbac

Proposed Interface:

  • Offer Two Interfaces:

    • All in one

        use PhpRbac\Rbac;
        
        $rbac = new Rbac; // Equals original jb::$RBAC object structure
      
@jburns131
jburns131 / phpdoc.bat
Last active December 21, 2015 03:58
phpdoc.bat
@ECHO OFF
php "%~dp0phpDocumentor.phar" %*
PAUSE
#Naming Conventions
**Retrieval**
get(Descriptor) = Retrieve element(s), descriptor is optional
getOne = Retrieve single element
getSet = Retrieve a defined collection of elements
getAll = Retrieve all elements
<?php
...
public function logoutAttempt()
{
$sql = new Db();
$this->sessionAxis->start();
<?php
...
public function loginAttempt()
{
$sql = new Db();
$form_helper = new FormHelper($this->basePath);
<?php
/**
* Create random salt for blowfish crypt hash
*/
$acmsSalt = sprintf('$2y$%02d$', 12).substr(str_replace('+', '.', base64_encode(pack('N4', mt_rand(), mt_rand(), mt_rand(), mt_rand()))), 0, 22).'$';