Skip to content

Instantly share code, notes, and snippets.

@oliverservin
oliverservin / core.php
Created July 18, 2022 14:53
Fix Yclas auto update.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Core class for OC common, contains commons functions and helpers
*
* @package OC
* @category Core
* @author Chema <chema@open-classifieds.com>
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*/
@oliverservin
oliverservin / supervisor.conf
Created June 23, 2022 22:07
Fly.io: PHP 8.1 supervisor.conf
[supervisord]
user=root
nodaemon=true
loglevel=info
logfile=/dev/stdout
pidfile=/var/run/supervisord.pid
logfile_maxbytes=0
[group:laravel-worker]
priority=999
@oliverservin
oliverservin / server.conf
Created June 23, 2022 22:06
Fly.io: PHP 8.1 server.conf
server {
listen 8080;
server_name localhost;
root /var/www/html/public;
server_tokens off;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-Content-Type-Options "nosniff";
@oliverservin
oliverservin / php-fpm.conf
Created June 23, 2022 22:06
Fly.io: PHP 8.1 php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
;;;;;;;;;;;;;;;;;;
; Global Options ;
@oliverservin
oliverservin / app.conf
Created June 23, 2022 22:02
Fly.io: PHP 8.1 app.conf
; Start a new pool named 'app'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('app' here)
[app]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
@oliverservin
oliverservin / Dockerfile
Last active June 23, 2022 22:04
Fly.io: PHP 8.1 Dockerfile
# syntax = docker/dockerfile:experimental
FROM alpine:edge as base
LABEL fly_launch_runtime="laravel"
RUN apk update \
&& apk add curl zip unzip tzdata supervisor nginx htop vim ca-certificates \
php81 php81-cli \
php81-soap php81-openssl php81-gmp \
php81-pdo_odbc php81-json php81-dom \
@oliverservin
oliverservin / ad.php
Created April 28, 2022 19:58
oc/classes/model/ad.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* description...
*
* @author Chema <chema@open-classifieds.com>
* @package OC
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*
*/
@oliverservin
oliverservin / core.php
Created April 28, 2022 19:57
oc/classes/core.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Core class for OC common, contains commons functions and helpers
*
* @package OC
* @category Core
* @author Chema <chema@open-classifieds.com>
* @copyright (c) 2009-2013 Open Classifieds Team
* @license GPL v3
*/
<form x-data="initialData()" x-init="init()" x-on:trix-action-invoke="if ($event.actionName == 'x-horizontal-rule') insertHorizontalRule($event)">
<input id="x" type="hidden" name="content">
<trix-editor x-ref="trix" input="x"></trix-editor>
</form>
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Panel_Category extends Auth_Crud {
/**
* @var $_index_fields ORM fields shown in index
*/
protected $_index_fields = array('name','order','price', 'id_category', 'id_category_parent');
/**