Ratings | | Unique User Downloads | | Download Rankings |
Not enough user ratings | | Total: 42 | | All time: 10,880 This week: 206 |
|
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. | |
|
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
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.