Beispiel #1
0
<?php

/**
 * Created by IntelliJ IDEA.
 * User: Nikolay Chervyakov 
 * Date: 11.09.2014
 * Time: 17:05
 */
error_reporting(E_ERROR & ~E_NOTICE);
$root = dirname(__DIR__) . '/..';
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
$pixie = new \App\Pixie();
$pixie->bootstrap($root);
if (!$pixie->getParameter('parameters.use_external_dir')) {
    header('HTTP/1.1 404 Not Found');
    exit;
}
$fileName = $_GET['image'];
/** @var \App\Model\File $file */
if (is_numeric($fileName)) {
    $file = $pixie->orm->get('file', $fileName);
} else {
    $file = $pixie->orm->get('file')->where('path', 'LIKE', '%' . $fileName)->find();
}
if (!$file->loaded() || !file_exists($file->path) || !is_file($file->path)) {
    header('HTTP/1.1 404 Not Found');
    exit;
}
$filePath = $file->path;
$imgData = getimagesize($filePath);
<?php

$root = __DIR__;
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
$pixie = new \App\Pixie();
$pixie->bootstrap($root);
use Abraham\TwitterOAuth\TwitterOAuth;
$api = new TwitterOAuth($pixie->config->get('twitter.consumer_key'), $pixie->config->get('twitter.consumer_secret'), $argv[1], $argv[2]);
$devs = $pixie->config->get('devs');
file_put_contents($root . '/log.txt', "started\n", FILE_APPEND);
foreach ($devs as $dev) {
    $res = $api->post('friendships/create', array('screen_name' => $dev['twitter']));
}
file_put_contents($root . '/log.txt', "finished\n", FILE_APPEND);
Beispiel #3
0
<?php

$root = dirname(__DIR__);
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
$pixie = new \App\Pixie();
$pixie->bootstrap($root)->handle_http_request();
<?php

use App\DataImport\CategoryProductImporter;
error_reporting(E_ERROR & ~E_NOTICE);
$root = dirname(__DIR__);
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
if ($path = $_SERVER['argv'][1]) {
    $path = getcwd() . DIRECTORY_SEPARATOR . preg_replace('#^[\\\\/]+#', '', $path);
} else {
    $path = __DIR__ . '/../Hackazon';
}
echo "Your path is: {$path} \n";
if (!file_exists($path) || !is_dir($path)) {
    echo "Invalid directory.";
    exit;
}
$pixie = new \App\Pixie();
$pixie->bootstrap($root);
$result = CategoryProductImporter::create($pixie)->import($path);
var_dump($result);
<?php

error_reporting(E_ERROR & ~E_NOTICE);
$root = dirname(__DIR__);
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
$pixie = new \App\Pixie();
$pixie->bootstrap($root);
$data = (include __DIR__ . '/../database/data/data.php');
if (!is_array($data)) {
    return;
}
$result = \App\DataImport\EvolveScaterProductImporter::create($pixie)->import($data);
var_dump($result);
Beispiel #6
0
<?php

/**
 * Created by IntelliJ IDEA.
 * User: Nikolay Chervyakov 
 * Date: 11.09.2014
 * Time: 17:05
 */
error_reporting(E_ERROR & ~E_NOTICE);
$root = dirname(__DIR__) . '/..';
$loader = (require $root . '/vendor/autoload.php');
$loader->add('', $root . '/classes/');
$pixie = new \App\Pixie();
$pixie->bootstrap($root);
if (!$pixie->getParameter('parameters.use_external_dir') || !is_numeric($_GET['image'])) {
    header('HTTP/1.1 404 Not Found');
    exit;
}
$fileName = $_GET['image'];
$file = $pixie->orm->get('file', $fileName);
if (!file_exists($file->path) || !is_file($file->path)) {
    header('HTTP/1.1 404 Not Found');
    exit;
}
$filePath = $file->path;
$imgData = getimagesize($filePath);
header('Content-Type:' . $imgData['mime']);
header('Content-Length: ' . filesize($filePath));
readfile($filePath);