PHP Classes

Phady Developer Tools: Simplify using Phady Zephir framework from PHP

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 42 All time: 10,880 This week: 206Up
Version License PHP version Categories
phady-devtools 1.0The PHP License5PHP 5, Libraries, Code Generation
Description 

Author

This package can simplify using Phady Zephir framework from PHP.

Currently it provides PHP classes equivalent to the classes of the framework originally written in Zephir.

The PHP classes are empty, so they can serve only to help IDE to autocomplete when calling these classes from PHP code.

It can also generate files to create new projects based on the Phady framework.

Picture of Alien Fernandez
  Performance   Level  

 

Example

#!/usr/bin/env php
<?php

/*
  +------------------------------------------------------------------------+
  | Phady Developer Tools |
  +------------------------------------------------------------------------+
  | Copyright (c) 2015 |
  +------------------------------------------------------------------------+
  | Phady Framework is a complement of Phalcon Framework |
  | |
  +------------------------------------------------------------------------+
  | Authors: Alien fernandez Fuentes <alienfernandez85@gmail.com> |
  +------------------------------------------------------------------------+
  */

error_reporting(E_ALL);

use
Phady\Script;
use
Phady\Version;
use
Phady\Exception as PhadyException;

use
Phady\Script\Color;
use
Phady\Commands\CommandsListener;
use
Phalcon\Loader;
use
Phalcon\Events\Manager as EventsManager;

try {

   
$extensionLoaded = true;
    if (!
extension_loaded('phalcon')) {
       
$extensionLoaded = false;
        throw new
Exception('Phalcon extension isn\'t installed, follow these instructions to install it: http://docs.phalconphp.com/en/latest/reference/install.html');
    }
    if (!
extension_loaded('phady')) {
       
$extensionLoaded = false;
        throw new
Exception('Phady extension isn\'t installed, follow these instructions to install it: URL');
    }

   
$loader = new Loader();

   
$loader->registerDirs(array(
       
__DIR__ . '/scripts/'
   
));

   
$loader->registerNamespaces(array(
       
'Phady' => __DIR__ . '/scripts/'
   
));

   
$loader->register();

    if (
Version::getId() < Script::COMPATIBLE_VERSION) {
        throw new
PhadyException('Your Phady version isn\'t compatible with Developer Tools, download the latest at: URL');
    }

    if (!
defined('TEMPLATE_PATH')) {
       
define('TEMPLATE_PATH', __DIR__ . '/templates');
    }

   
$vendor = sprintf('Phady DevTools (%s)', Version::get());
    print
PHP_EOL . Color::colorize($vendor, Color::FG_GREEN, Color::AT_BOLD) . PHP_EOL . PHP_EOL;

   
$eventsManager = new EventsManager();

   
$eventsManager->attach('command', new CommandsListener());

   
$script = new Script($eventsManager);

   
$commandsToEnable = array(
       
'\Phady\Commands\Builtin\Project'
   
);
    foreach (
$commandsToEnable as $command) {
       
$script->attach(new $command($script, $eventsManager));
    }
   
//print_r(1111);die;

   
$script->run();

} catch (
PhadyException $e) {
    if (
$extensionLoaded) {
        print
Color::error($e->getMessage()) . PHP_EOL;
    } else {
        print
'ERROR: ' . $e->getMessage() . PHP_EOL;
    }

} catch (
Exception $e) {
    if (
$extensionLoaded) {
        print
Color::error($e->getMessage()) . PHP_EOL;
    } else {
        print
'ERROR: ' . $e->getMessage() . PHP_EOL;
    }
}


Details

What are Devtools?

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phady framework.

Requirements

  • PHP >= 5.3.0
  • Phalcon >= 1.3.0

Installation via Git

Phady Devtools can be installed by using Git.

Just clone the repo and checkout the current branch:

cd ~
git clone https://github.com/alienfernandez/phady-devtools.git
cd phady-devtools

  Files folder image Files (176)  
File Role Description
Files folder imagedocs (1 file)
Files folder imageide (1 directory)
Files folder imagescripts (2 directories)
Files folder imagetemplates (1 file)
Accessible without login Plain text file phady-completion.bash Data Auxiliary data
Accessible without login Plain text file phady.bat Data Auxiliary data
Accessible without login Plain text file phady.pear Example Example script
Accessible without login Plain text file phady.php Example Example script
Accessible without login Plain text file phady.sh Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:42
This week:0
All time:10,880
This week:206Up