Niezalogowany [ logowanie ]
Subskrybuj kanał ATOM Kanał ATOM

Autor wpisu: widmogrod, dodany: 28.12.2012 21:25, tagi: php

If you try to use phing to deploy your application on phpcloud.com and you encountered some problems with it here is why:

  • no possibility to login via ssh eg: ssh someapp@someapp.my.phpcloud.com returns:
Connection to someapp.my.phpcloud.com closed.
Transferred: sent 2848, received 2344 bytes, in 1.6 seconds
Bytes per second: sent 1754.5, received 1444.0
debug1: Exit status 1
  • no possibility to run scp eg: scp -v text.txt someapp@someapp.my.phpcloud.com:/c.txt which returns:
Transferred: sent 2544, received 2328 bytes, in 4.0 seconds
Bytes per second: sent 630.6, received 577.1
debug1: Exit status 128
lost connection

Only recommended way is to use sftp. So to do that in phing you should use scp taks, and vote for my pull request :P (https://github.com/phingofficial/phing/pull/176)

Or modify your phing taks to use php ssh.sftp wrapper as fallow:

// sometimes remote server allow only create files via sftp (eg phpcloud.com)
if (false === $ret && $this->sftp) {
    // try create file via ssh2.sftp://file wrapper
    $fh = @fopen("ssh2.sftp://$this->sftp/$remoteEndpoint", 'w');
    if (is_resource($fh)) {
        $ret = fwrite($fh, file_get_contents($localEndpoint));
        fclose($fh);
    }
}

Direct link: https://github.com/widmogrod/phing/commit/d2865095b4118d6c0bdca42d9f3a54b45224a48a

Autor wpisu: Jakub, dodany: 27.12.2012 22:58, tagi: apache, mysql, php

Instalacja wirtualnego serwera na systemie Ubuntu, jest trudniejsza niż w przypadku pospolitego Windows’a. Należy jednak pamiętać, że Linux o wiele lepiej spełni zadanie wirtualnej maszyny z wielu oczywistych przyczyn. A więc zaczynajmy: 1. Zaczynamy od upewniania się, czy nasze oprogramowanie jest w pełni aktualne:

1sudo apt-get update

2. Następnie instalujemy fundament naszego serwera, czyli Apache:

1sudo apt-get install apache2

3. Teraz PHP:

1sudo apt-get install php5

Opcjonalnie, możemy jeszcze teraz doinstalować najważniejsze biblioteki PHP:

1234sudo apt-get install php-pear sudo apt-get install php5-xsl sudo apt-get install php5-gd sudo apt-get install php5-ming

4. Baza danych MySQL:

1sudo apt-get install mysql-server

Aby serwer MySQL był w pełni zintegrowany z PHP, musimy dołączyć jeszcze odpowiednie komponenty:

12sudo apt-get install libapache2-mod-auth-mysql sudo apt-get install php5-mysql

5. Dla ułatwienia naszej pracy, warto doinstalować jeszcze phpMyAdmn. Wklejamy do konsoli:

1sudo apt-get install phpmyadmin

I postępujemy zgodnie ze wskazówkami instalatora. Następnie wpisujemy komendę:

1sudo gedit /etc/apache2/apache2.conf

Otworzy nam się pewien plik, na koniec którego doklejamy poniższą linijkę:

1Include /etc/phpmyadmin/apache.conf

Zapisz i zamknij plik.   Gratulację! Od teraz, masz w pełni działający serwer!

Czytaj dalej tutaj (rozwija treść wpisu)
Czytaj dalej na blogu autora...

Autor wpisu: Śpiechu, dodany: 27.12.2012 16:13, tagi: php

Wpis może trochę stary tematyką, jednak podsumowujący co nieco z punktu widzenia mojej codziennej pięciomiesięcznej praktyki.

Czy potrzebujesz rozszerzać Smarty? Jeśli w twoich templatkach coraz więcej {assign}, {math}, {if 5|in_array:$object->getFeatureIds()}, {$object->getPhotosLinks() assign="photos"}{$photos[0]}, {assign var="values" value=$values|cat:'random shit here'} itd. to wiedz, że coś się dzieje. Warstwa logiki niebezpiecznie wkrada się do warstwy prezentacji. Problemu jeszcze nie ma dopóki nie potrzebujesz przerzucać sporych części szablonów w różne miejsca i nikt nie musi kontynuować Twojej roboty. W pozostałych przypadkach natężenie frustracji kontynuatorów rośnie (jak to k… działa?, po ch… tu jest ta zmienna?) i tak soczyście dalej…

Plugins to the rescue!

W zasadzie w moich szablonach używam trzech rodzajów pluginów: modyfikatorów, funkcji i funkcji blokowych. Jest tego sporo więcej, jednak nie będę pisał o pozostałych.

Żeby korzystać z rozszerzeń należy najpierw wskazać Smarty gdzie ma szukać pluginów. Robi się to super prosto. Wystarczy w kodzie tworzącym instancję Smarty dodać

$smarty = new Smarty();
$smarty->addPluginsDir(__DIR__ . '/smarty_plugins');
 
// rest of initialization stuff

Druga rzecz to konwencja nazewnicza. Mam na myśli nazewnictwo funkcji i plików. Jeśli nie przestrzegamy konwencji, Smarty wywali błąd.

Modyfikator

Przeznaczenie: prosta modyfikacja tekstu. Nazwa pliku: modifier.nazwa_modyfikatora.php. Sygnatura funkcji: smarty_modifier_nazwa_modyfikatora($value, [$param1, $paramN]). Przykład:

/**
 * Modyfikator odwracajacy podany tekst,
 * opcjonalnie wrzucajacy jakis ciag pomiedzy znaki tekstu.
 * 
 * @param string $value
 * @param string $separationChar
 * @return string
 */
function smarty_modifier_reverse_me($value, $separationChar = '') {
  $arrayString = preg_split('//u', $value, -1, PREG_SPLIT_NO_EMPTY);
  $reversedString = '';
  for ($i = count($arrayString) - 1; $i >= 0; $i--) {
    $reversedString .= $arrayString[$i] . $separationChar;
  }
 
  return $reversedString;
}

Użycie:

{'some text string'|reverse_me}
{* gnirts txet emos *}
 
{assign var='text_string' value='some text string'}
{$text_string|reverse_me:'.'}
{* g.n.i.r.t.s. .t.x.e.t. .e.m.o.s. *}

Funkcja

Przeznaczenie: zaawansowane generowanie treści do wyświetlenia. Nazwa pliku: function.nazwa_funkcji.php. Sygnatura funkcji: smarty_function_nazwa_funkcji(array $params, \Smarty_Internal_Template $template). Przykład:

/**
 * Funkcja zwracajaca biezacy czas w postaci ciagu 'dzien tygodnia, dd.mm.yyyy'.
 *
 * @param array $params
 * @param \Smarty_Internal_Template $smarty
 * @return string
 */
function smarty_function_get_localized_time_string(array $params, \Smarty_Internal_Template $template) {
  static $weekdays = ['Niedziela', 'Poniedziałek', 'Wtorek', 'Środa', 'Czwartek', 'Piątek', 'Sobota'];
  static $today = null;
  if ($today == null) {
    $today = new \DateTime();
  }  
 
  return "{$weekdays[$today->format('w')]}, {$today->format('d.m.Y')}";
}

Użycie:

{get_localized_time_string}
{* Czwartek, 27.12.2012 *}

Funkcja blokowa

Przeznaczenie: otaczanie treści wygenerowanym ciągiem znaków. Nazwa pliku: block.nazwa_funkcji.php. Sygnatura funkcji: smarty_block_nazwa_funkcji(array $params, $content, \Smarty_Internal_Template $template, &$repeat). Przykład:

Czytaj dalej tutaj (rozwija treść wpisu)
Czytaj dalej na blogu autora...

Autor wpisu: vonski, dodany: 25.12.2012 12:51, tagi: design

T

he term ‘minimalism’ is a trend from early 19th century and gradually became an important movement in response to the over decorated design of the previous period. Minimalist architecture became popular in the late 1980s in London and New York,[3] where architects and fashion designers worked together in the boutiques to achieve simplicity, using white elements, cold lighting, large space with minimum objects and furniture. Minimalist architecture simplifies living space to reveal the essential quality of buildings and conveys simplicity in attitudes toward life. It is highly inspired from the Japanese traditional design and the concept of Zen philosophy.

 

Influences from Japanese tradition

The idea of simplicity appears in many cultures, especially the Japanese traditional culture of Zen Philosophy. Japanese manipulate the Zen culture into aesthetic and design elements for their buildings.[11] This idea of architecture has influenced Western Society, especially in America since the mid 18th century.

The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. 

For example, the sand garden in Ryoanji temple demonstrates the concepts of simplicity and the essentiality from the considered setting of a few stones and a huge empty space.[14] The Japanese aesthetic principle of Ma refers to empty or open space. That removes all the unnecessary internal walls and opensup the space between interior and the exterior. Frank Lloyd Wright was influenced by the design element of Japanese sliding door that allows to bring the exterior to the interior. The emptiness of spatial arrangement is another idea that reduces everything down to the most essential quality.[16] The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. It appreciates the absence of unnecessary features to view life in quietness and reveals the most innate character of chosen materials.

surf The Japanese minimalist architect, Tadao Ando conveys the Japanese traditional spirit and his own perception of nature in his works. His design concepts are materials, pure geometry and nature. He normally uses concrete or natural wood and basic structural form to achieve austerity and rays of light in space. He also sets up dialogue between the site and nature to create relationship and order with the buildings. Ando’s works and the translation of Japanese aesthetic principles are highly influential on Japanese architecture. For example, the Japanese flora art, also known as Ikebana.

 

Autor wpisu: vonski, dodany: 24.12.2012 16:02, tagi: design

T

he term ‘minimalism’ is a trend from early 19th century and gradually became an important movement in response to the over decorated design of the previous period. Minimalist architecture became popular in the late 1980s in London and New York,[3] where architects and fashion designers worked together in the boutiques to achieve simplicity, using white elements, cold lighting, large space with minimum objects and furniture. Minimalist architecture simplifies living space to reveal the essential quality of buildings and conveys simplicity in attitudes toward life. It is highly inspired from the Japanese traditional design and the concept of Zen philosophy.

 

Influences from Japanese tradition

The idea of simplicity appears in many cultures, especially the Japanese traditional culture of Zen Philosophy. Japanese manipulate the Zen culture into aesthetic and design elements for their buildings.[11] This idea of architecture has influenced Western Society, especially in America since the mid 18th century.

The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. 

For example, the sand garden in Ryoanji temple demonstrates the concepts of simplicity and the essentiality from the considered setting of a few stones and a huge empty space.[14] The Japanese aesthetic principle of Ma refers to empty or open space. That removes all the unnecessary internal walls and opensup the space between interior and the exterior. Frank Lloyd Wright was influenced by the design element of Japanese sliding door that allows to bring the exterior to the interior. The emptiness of spatial arrangement is another idea that reduces everything down to the most essential quality.[16] The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. It appreciates the absence of unnecessary features to view life in quietness and reveals the most innate character of chosen materials.

surf The Japanese minimalist architect, Tadao Ando conveys the Japanese traditional spirit and his own perception of nature in his works. His design concepts are materials, pure geometry and nature. He normally uses concrete or natural wood and basic structural form to achieve austerity and rays of light in space. He also sets up dialogue between the site and nature to create relationship and order with the buildings. Ando’s works and the translation of Japanese aesthetic principles are highly influential on Japanese architecture. For example, the Japanese flora art, also known as Ikebana.

 

Autor wpisu: vonski, dodany: 24.12.2012 15:28, tagi: design

T

he term ‘minimalism’ is a trend from early 19th century and gradually became an important movement in response to the over decorated design of the previous period. Minimalist architecture became popular in the late 1980s in London and New York,[3] where architects and fashion designers worked together in the boutiques to achieve simplicity, using white elements, cold lighting, large space with minimum objects and furniture. Minimalist architecture simplifies living space to reveal the essential quality of buildings and conveys simplicity in attitudes toward life. It is highly inspired from the Japanese traditional design and the concept of Zen philosophy.

 

Influences from Japanese tradition

The idea of simplicity appears in many cultures, especially the Japanese traditional culture of Zen Philosophy. Japanese manipulate the Zen culture into aesthetic and design elements for their buildings.[11] This idea of architecture has influenced Western Society, especially in America since the mid 18th century.

The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. 

For example, the sand garden in Ryoanji temple demonstrates the concepts of simplicity and the essentiality from the considered setting of a few stones and a huge empty space.[14] The Japanese aesthetic principle of Ma refers to empty or open space. That removes all the unnecessary internal walls and opensup the space between interior and the exterior. Frank Lloyd Wright was influenced by the design element of Japanese sliding door that allows to bring the exterior to the interior. The emptiness of spatial arrangement is another idea that reduces everything down to the most essential quality.[16] The Japanese aesthetic of Wabi-sabi values the quality of simple and plain objects. It appreciates the absence of unnecessary features to view life in quietness and reveals the most innate character of chosen materials.

surf The Japanese minimalist architect, Tadao Ando conveys the Japanese traditional spirit and his own perception of nature in his works. His design concepts are materials, pure geometry and nature. He normally uses concrete or natural wood and basic structural form to achieve austerity and rays of light in space. He also sets up dialogue between the site and nature to create relationship and order with the buildings. Ando’s works and the translation of Japanese aesthetic principles are highly influential on Japanese architecture. For example, the Japanese flora art, also known as Ikebana.

 

Autor wpisu: batman, dodany: 24.12.2012 12:00, tagi: php

Ekipa odpowiedzialna za AppFog postanowiła sprawić deweloperom prezent świąteczny i dodała do swojej oferty nowy plan taryfowy. W cenie 50 dolarów miesięcznie, otrzymujemy do dyspozycji “maszynę” wyposażoną w 2GB pamięci, możliwość uruchomienia 8 różnych instancji naszych aplikacji, maksymalny limit 500 (…)

Read the rest of this entry »

Wszystkie wpisy należą do ich twórców. PHP.pl nie ponosi odpowiedzialności za treść wpisów.